A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix checklist on mobile & desktop
ammarahm-edc8e99b2bd0d7
diff --git a/apps/mobile/android/app/src/main/assets/dist/main.js b/apps/mobile/android/app/src/main/assets/dist/main.jsindex c1c2b002a..154b68379 100644--- a/apps/mobile/android/app/src/main/assets/dist/main.js+++ b/apps/mobile/android/app/src/main/assets/dist/main.js@@ -1 +1 @@-(()=>{var t={2968:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.css"},6202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.min.css"},7286:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.css"},7362:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.min.css"},287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.css"},2271:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.min.css"},5417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.css"},874:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.min.css"},3341:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.css"},8786:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.css"},4243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.min.css"},9702:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.min.css"},1389:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.css"},3513:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.min.css"},1064:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/fonts/tinymce-mobile.woff"},8057:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.css"},6332:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.min.css"},4429:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.css"},18:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.min.css"},7899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.css"},7548:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.min.css"},9506:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.css"},8273:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.css"},7251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.min.css"},6122:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.min.css"},993:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.css"},8215:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.min.css"},9916:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/fonts/tinymce-mobile.woff"},8382:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.css"},4522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.min.css"},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.css"},8537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.min.css"},818:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.css"},6913:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.min.css"},8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-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 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-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 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.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 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 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 01-.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 00-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 010 2H5a1 1 0 010-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 110-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 01-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></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 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 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 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 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.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.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 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.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 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 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 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-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>',"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 01-.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 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-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.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.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 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.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 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-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 010-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 010-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 010-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-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 010-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 010-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 010-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 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.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 010-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.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-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 010-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 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-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.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.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 01-.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 01-.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 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.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 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.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 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 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 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-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 01-1-1v-2H7V9H5a1 1 0 110-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 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 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 017 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 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.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 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 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.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-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 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.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 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-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 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-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-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-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 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.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 0119 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 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.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 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-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 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 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 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-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 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-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 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-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 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 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.7l2.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-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 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.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 00-.8.8.8.8 0 01-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 012.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 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 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 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-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 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.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 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 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.7l-.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>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-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 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.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 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 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.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.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.6L34.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 00-.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 00-.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 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.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 17l-.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 01-.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 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-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 110-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 01-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="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.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 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.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 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 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 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.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 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-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 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-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 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-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 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 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 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.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 012.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 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-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 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.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 11-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 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-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.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-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 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 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 01-.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 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 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 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.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 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-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 01-.2-.6V8H5a1 1 0 110-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 01-.2-.6V13H5a1 1 0 010-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 01-.2-.6V18H5a1 1 0 010-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 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.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 010-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 00-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 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 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 017 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 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.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 00-.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 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.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-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-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 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.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 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.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 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-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 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-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 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-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 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.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.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.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 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-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 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.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 010-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 01-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 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 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 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.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 01-.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 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-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 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.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>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.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 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.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 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},6890:(t,e,n)=>{n(8785)},4400:(t,e,n)=>{n(2242)},2242:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},m=function(t,e,n){var r=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(e.parents,d),o=-1!==r?e.parents.slice(0,r):e.parents,u=i.grep(o,function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&function(t,e){return t.$.contains(t.getBody(),e)}(t,e)}}(t));return u.length>0&&u[0].nodeName===n},g=function(t,e,n,r,u,a){t.ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===u?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(i.map(a,(function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===u?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t)}})))},onAction:function(){return t.execCommand(r)},onItemAction:function(e,n){o(t,u,n)},select:function(e){return function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return function(t){return null==t?l:f(t)}(t.dom.getStyle(e,"listStyleType"))}(t).map((function(t){return e===t})).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(m(t,n,u))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}})},h=function(t,e,n,r,o,i){i.length>1?g(t,e,n,r,o,i):function(t,e,n,r,o,i){t.ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(m(t,n,o))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},onAction:function(){return t.execCommand(r)}})}(t,e,n,r,o)};r.add("advlist",(function(t){t.hasPlugin("lists")&&(function(t){h(t,"numlist","Numbered list","InsertOrderedList","OL",function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]}(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",function(t){var e=t.getParam("advlist_bullet_styles","default,circle,square");return e?e.split(/[ ,]/):[]}(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(e,n){o(t,"UL",n["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(e,n){o(t,"OL",n["list-style-type"])}))}(t))}))}()},6884:(t,e,n)=>{n(7652)},7652:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},r=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,n(e,r)):t.setStartBefore(e)},o=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,n(e,r)):t.setEndAfter(e)},i=function(t,e,n){var i,u,a,c,s,l,f,d=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i)}(t),m=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var g=t.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(l=s.length,r(g,s,l),o(g,s,l),g.endOffset<5)return;i=g.endOffset,u=s}else{if(3!==(u=g.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(r(g,u,0),o(g,u,u.nodeValue.length))}i=1===g.endOffset?2:g.endOffset-1-e}var h=i;do{r(g,u,i>=2?i-2:0),o(g,u,i>=1?i-1:0),i-=1,f=g.toString()}while(" "!==f&&""!==f&&160!==f.charCodeAt(0)&&i-2>=0&&f!==n);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(g.toString(),n)?0===g.startOffset?(r(g,u,0),o(g,u,h)):(r(g,u,i),o(g,u,h)):(r(g,u,i),o(g,u,h),i+=1),"."===(c=g.toString()).charAt(c.length-1)&&o(g,u,h-1);var p=(c=g.toString().trim()).match(d),v=function(t){return t.getParam("link_default_protocol","http","string")}(t);p&&("www."===p[1]?p[1]=v+"://www.":/@$/.test(p[1])&&!/^mailto:/.test(p[1])&&(p[1]="mailto:"+p[1]),a=t.selection.getBookmark(),t.selection.setRng(g),t.execCommand("createlink",!1,p[1]+p[2]),!1!==m&&t.dom.setAttrib(t.selection.getNode(),"target",m),t.selection.moveToBookmark(a),t.nodeChanged())}};t.add("autolink",(function(t){!function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){i(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){i(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){i(t,0,"")}(t)})))}(t)}))}()},5209:(t,e,n)=>{n(8578)},8578:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=tinymce.util.Tools.resolve("tinymce.util.Delay"),r=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},o=function(t,e,r,i,u){n.setEditorTimeout(t,(function(){a(t,e),r--?o(t,e,r,i,u):u&&u()}),i)},i=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},u=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},a=function(t,n){var o=t.dom,c=t.getDoc();if(c)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))i(t,!0);else{var s=c.documentElement,l=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),f=r(t),d=u(o,s,"margin-top",!0),m=u(o,s,"margin-bottom",!0),g=s.offsetHeight+d+m+l;g<0&&(g=0);var h=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;g+h>r(t)&&(f=g+h);var p=function(t){return t.getParam("max_height",0,"number")}(t);if(p&&f>p?(f=p,i(t,!0)):i(t,!1),f!==n.get()){var v=f-n.get();if(o.setStyle(t.getContainer(),"height",f+"px"),n.set(f),function(t){t.fire("ResizeEditor")}(t),e.browser.isSafari()&&e.mac){var b=t.getWin();b.scrollTo(b.pageXOffset,b.pageYOffset)}t.hasFocus()&&t.selection.scrollIntoView(t.selection.getNode()),e.webkit&&v<0&&a(t,n)}}};t.add("autoresize",(function(t){if(t.settings.hasOwnProperty("resize")||(t.settings.resize=!1),!t.inline){var e=(n=0,{get:function(){return n},set:function(t){n=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){a(t,e)}))}(t,e),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(){a(t,e)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){o(t,e,20,100,(function(){o(t,e,5,1e3)}))}))}(t,e)}var n}))}()},8190:(t,e,n)=>{n(7440)},7440:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.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:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})};t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){e(t)}))}(t),function(t){t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return e(t)}}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return e(t)}})}(t),{}}))}()},7259:(t,e,n)=>{n(8492)},8492:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var n,r=t.dom,i=t.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),o.each(i,(function(t){r.getParent(t.parentNode,'*[dir="'+e+'"]',r.getRoot())||r.setAttrib(t,"dir",n!==e?e:null)})),t.nodeChanged())},u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return"function"==typeof t},g=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},h=g,p=("undefined"!=typeof window?window:Function("return this;")(),function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}}),v=p(3),b=p(9),y=p(11),w=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode)?function(t){return h(t.dom.getRootNode())}:function(t){return b(t)?t:h(t.dom.ownerDocument)},x=function(t){return h(t.dom.host)},C=function(t){var e=v(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o,i,u=e.ownerDocument;return(o=h(e),i=w(o),y(i)?d.some(i):d.none()).fold((function(){return u.body.contains(e)}),(n=C,r=x,function(t){return n(r(t))}))},S=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||C(t)?r:function(t,e){return function(t){return void 0!==t.style&&m(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""}(n,e)}(t,"direction")?"rtl":"ltr"},k=function(t,e){return function(n){var r=function(t){var r=h(t.element);n.setActive(S(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};r.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){i(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){i(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:k(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:k(t,"rtl")})}(t)}))}()},4926:(t,e,n)=>{n(755)},755:()=>{!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})}(t)}))}()},2170:(t,e,n)=>{n(3302)},3302:()=>{!function(){"use strict";var t,e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},c=u("string"),s=u("object"),l=u("array"),f=(null,function(t){return null===t}),d=a("boolean"),m=a("number"),g=function(){},h=function(t){return function(){return t}},p=h(!1),v=h(!0),b=function(){return y},y=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:r,orThunk:n,map:b,each:g,bind:b,exists:p,forall:v,filter:b,equals:e,equals_:e,toArray:function(){return[]},toString:h("none()")}),w=function(t){var e=h(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.push,S=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!l(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);C.apply(e,t[n])}return e},k=("undefined"!=typeof window?window:Function("return this;")(),function(t,e,n){!function(t,e,n){if(!(c(n)||d(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)}),O=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},T=O,_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),A=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(t){return t.getParam("image_dimensions",!0,"boolean")},R=function(t){return t.getParam("images_upload_url","","string")},M=function(t){return t.getParam("images_upload_handler",void 0,"function")},z=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},D=function(t){return t&&(t=t.replace(/px$/,"")),t},B=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},P=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},I=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},L=_.DOM,H=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?D(t.style.marginLeft):""},F=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?D(t.style.marginTop):""},V=function(t){return t.style.borderWidth?D(t.style.borderWidth):""},j=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},U=function(t,e){return t.style[e]?t.style[e]:""},W=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},q=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},$=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},G=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=B(r),$(t,e)):q(t,n,r)}},X=function(t,e){return t.style[e]?D(t.style[e]):j(t,e)},K=function(t,e){var n=B(e);t.style.marginLeft=n,t.style.marginRight=n},Y=function(t,e){var n=B(e);t.style.marginTop=n,t.style.marginBottom=n},J=function(t,e){var n=B(e);t.style.borderWidth=n},Q=function(t,e){t.style.borderStyle=e},Z=function(t){return"FIGURE"===t.nodeName},tt=function(t){return 0===L.getAttrib(t,"alt").length&&"presentation"===L.getAttrib(t,"role")},et=function(t){return tt(t)?"":j(t,"alt")},nt=function(t,e){return{src:j(e,"src"),alt:et(e),title:j(e,"title"),width:X(e,"width"),height:X(e,"height"),class:j(e,"class"),style:t(j(e,"style")),caption:W(e),hspace:H(e),vspace:F(e),border:V(e),borderStyle:U(e,"borderStyle"),isDecorative:tt(e)}},rt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},ot=function(t,e,n){if(n){L.setAttrib(t,"role","presentation");var r=T(t);k(r,"alt","")}else f(e)?("alt",(r=T(t)).dom.removeAttribute("alt")):(r=T(t),k(r,"alt",e)),"presentation"===L.getAttrib(t,"role")&&L.setAttrib(t,"role","")},it=function(t,e){return function(n,r,o){t(n,o),$(n,e)}},ut=function(t,e,n){var r=nt(t,n);rt(n,r,e,"caption",(function(t,e,n){return function(t){W(t)?function(t){var e=t.parentNode;L.insertAfter(t,e),L.remove(e)}(t):function(t){var e=L.create("figure",{class:"image"});L.insertAfter(e,t),e.appendChild(t),e.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)}(t)})),rt(n,r,e,"src",q),rt(n,r,e,"title",q),rt(n,r,e,"width",G(0,t)),rt(n,r,e,"height",G(0,t)),rt(n,r,e,"class",q),rt(n,r,e,"style",it((function(t,e){return q(t,"style",e)}),t)),rt(n,r,e,"hspace",it(K,t)),rt(n,r,e,"vspace",it(Y,t)),rt(n,r,e,"border",it(J,t)),rt(n,r,e,"borderStyle",it(Q,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||ot(t,n.alt,n.isDecorative)}(n,r,e)},at=function(t,e){var n=t.dom.styles.parse(e),r=P(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},ct=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||I(e))?null:e},st=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,(function(e){return!!t.schema.getTextBlockElements()[e.nodeName]}),t.getBody());return r?n.split(r,e):e},lt=Object.prototype.hasOwnProperty,ft=(t=function(t,e){return s(t)&&s(e)?ft(t,e):e},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)lt.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}),dt=tinymce.util.Tools.resolve("tinymce.util.Tools"),mt=function(t){return c(t.value)?t.value:""},gt=function(t,e){var n=[];return dt.each(t,(function(t){var r=function(t){return c(t.text)?t.text:c(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=gt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},ht=function(t){return void 0===t&&(t=mt),function(e){return e?x.from(e).map((function(e){return gt(e,t)})):x.none()}},pt=function(t,e){return function(t,n){for(var r=0;r<t.length;r++){var o=function(t){return Object.prototype.hasOwnProperty.call(t,"items")}(i=t[r])?pt(i.items,e):i.value===e?x.some(i):x.none();if(o.isSome())return o}var i;return x.none()}(t)},vt=ht,bt=function(t,e){return t.bind((function(t){return pt(t,e)}))};var yt=function(t){var e,n=vt((function(e){return t.convertURL(e.value||e.url,"src")})),r=new E((function(e){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);"string"==typeof n?A.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}(t,(function(t){e(n(t).map((function(t){return S([[{text:"None",value:""}],t])})))}))})),o=(e=function(t){return t.getParam("image_class_list")}(t),ht(mt)(e)),i=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),u=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return!!R(t)}(t),s=function(t){return!!M(t)}(t),l=function(t){var e=ct(t);return e?nt((function(e){return at(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),f=function(t){return t.getParam("image_description",!0,"boolean")}(t),d=function(t){return t.getParam("image_title",!1,"boolean")}(t),m=N(t),g=function(t){return t.getParam("image_caption",!1,"boolean")}(t),h=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),p=R(t),v=function(t){return t.getParam("images_upload_base_path",void 0,"string")}(t),b=function(t){return t.getParam("images_upload_credentials",!1,"boolean")}(t),y=M(t),w=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),C=x.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return c(t)&&t.length>0}));return r.then((function(t){return{image:l,imageList:t,classList:o,hasAdvTab:i,hasUploadTab:u,hasUploadUrl:a,hasUploadHandler:s,hasDescription:f,hasImageTitle:d,hasDimensions:m,hasImageCaption:g,url:p,basePath:v,credentials:b,handler:y,prependURL:C,hasAccessibilityOptions:h,automaticUploads:w}}))},wt=function(t){var e=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),n={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},r=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[n]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:S([r.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},xt=function(t){return{title:"General",name:"general",items:wt(t)}},Ct=wt,St=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},kt=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Ot=function(t,e,n,r){(function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?x.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?x.some(t+e):x.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))})(e,r),function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=ft({},n);!function(t,e,n){t.hasDescription&&c(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&c(n.title)&&(e.title=n.title),t.hasDimensions&&(c(n.width)&&(e.dimensions.width=n.width),c(n.height)&&(e.dimensions.height=n.height)),c(n.class)&&bt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&d(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(c(n.style)&&(e.style=n.style),c(n.vspace)&&(e.vspace=n.vspace),c(n.border)&&(e.border=n.border),c(n.hspace)&&(e.hspace=n.hspace),c(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}}(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=bt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Tt=function(t,e,n,r){var o,i=r.getData();r.block("Uploading image"),(o=i.fileinput,function(t,e){return 0<t.length?x.some(t[0]):x.none()}(o)).fold((function(){r.unblock()}),(function(o){var i,u,a,c=URL.createObjectURL(o),s=(u={url:e.url,basePath:e.basePath,credentials:e.credentials,handler:e.handler},a=function(t,e,n,r){var o=new XMLHttpRequest;o.open("POST",u.url),o.withCredentials=u.credentials,o.upload.onprogress=function(t){r(t.loaded/t.total*100)},o.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){if(o.status<200||o.status>=300)n("HTTP Error: "+o.status);else{var t,r,i=JSON.parse(o.responseText);i&&"string"==typeof i.location?e((t=u.basePath,r=i.location,t?t.replace(/\/$/,"")+"/"+r.replace(/^\//,""):r)):n("Invalid JSON: "+o.responseText)}};var i=new FormData;i.append("file",t.blob(),t.filename()),o.send(i)},u=dt.extend({credentials:!1,handler:a},u),{upload:function(t){return u.url||u.handler!==a?function(t,e){return new E((function(n,r){try{e(t,n,r,g)}catch(t){r(t.message)}}))}(t,u.handler):E.reject("Upload url missing from the settings.")}}),l=function(){r.unblock(),URL.revokeObjectURL(c)},f=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ot(t,e,n,r)};(i=o,new E((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,c,n);e.automaticUploads?s.upload(i).then((function(t){f(t),l()})).catch((function(e){l(),t.alertErr(e)})):(t.addToBlobCache(i),f(i.blobUri()),r.unblock())}))}))},_t=function(t,e,n){return function(r,o){"src"===o.name?Ot(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=bt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ot(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=function(t,e,n){var r=P(t(n.style)),o=ft({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?D(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?D(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?D(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o}(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=ft(St(e.image),n.getData()),o=function(t,e){var n=document.createElement("img");return q(n,"style",e.style),(H(n)||""!==e.hspace)&&K(n,e.hspace),(F(n)||""!==e.vspace)&&Y(n,e.vspace),(V(n)||""!==e.border)&&J(n,e.border),(function(t){return U(t,"borderStyle")}(n)||""!==e.borderStyle)&&Q(n,e.borderStyle),t(n.getAttribute("style"))}(t.normalizeCss,kt(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?Tt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Et=function(t){return function(){t.open=!1}},At=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:S([[xt(t)],t.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{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"}]}]}]}]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Ct(t)}},Nt=function(t){return function(e){return function(n){var r=ft(St(e.image),n.getData());t.execCommand("mceUpdateImage",!1,kt(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Rt=function(t){return function(e){return function(t){return new E((function(e){var n=document.createElement("img"),r=function(t){n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:z(n.width,n.clientWidth),height:z(n.height,n.clientHeight)};r(E.resolve(t))},n.onerror=function(){r(E.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},Mt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Dt=function(t){return function(e){t.windowManager.alert(e)}},Bt=function(t){return function(e){return at(t,e)}},Pt=function(t){return function(e){return t.dom.parseStyle(e)}},It=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},Lt=function(t){var e={onSubmit:Nt(t),imageSize:Rt(t),addToBlobCache:zt(t),createBlobCache:Mt(t),alertErr:Dt(t),normalizeCss:Bt(t),parseStyle:Pt(t),serializeStyle:It(t)};return{open:function(){yt(t).then(function(t){return function(e){var n=function(t){return{prevImage:bt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:At(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:St(e.image),onSubmit:t.onSubmit(e),onChange:_t(t,e,n),onClose:Et(n)}}}(e)).then(t.windowManager.open)}}},Ht=function(t){t.addCommand("mceImage",Lt(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return function(t,e){var n=ct(t);if(n){var r=nt((function(e){return at(t,e)}),n),o=i(i({},r),e);o.src?function(t,e){var n=ct(t);if(ut((function(e){return at(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),Z(n.parentNode)){var r=n.parentNode;st(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!N(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)}(t,o):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&function(t,e){var n=function(t,e){var n=document.createElement("img");if(ut(t,i(i({},e),{caption:!1}),n),ot(n,e.alt,e.isDecorative),e.caption){var r=L.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return at(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Z(r)){var o=st(t,r);t.selection.select(o)}else t.selection.select(r)}(t,i(i({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))}(t,n)}))}))},Ft=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},Vt=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];Ft(o)&&(o.attr("contenteditable",t?"false":null),dt.each(o.getAll("figcaption"),r))}}};o.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",Vt(!0)),t.serializer.addNodeFilter("figure",Vt(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Lt(t).open,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Lt(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return Z(t)||"IMG"===t.nodeName&&!I(t)?["image"]:[]}})}(t),Ht(t)}))}()},5053:(t,e,n)=>{n(3253)},3253:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return!function(t){return null==t}(t)},g=("function",function(t){return"function"==typeof t});function h(t,e){return b(document.createElement("canvas"),t,e)}function p(t){var e=h(t.width,t.height);return v(e).drawImage(t,0,0),e}function v(t){return t.getContext("2d")}function b(t,e,n){return t.width=e,t.height=n,t}var y=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function w(t){return new y((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}function x(t){return new y((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return d.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,m=Math.min(f+i,a),g=new Array(m-f),h=f,p=0;h<m;++p,++h)g[p]=u[h].charCodeAt(0);s[l]=new Uint8Array(g)}return d.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))}function C(t,e,n){return e=e||"image/png",g(HTMLCanvasElement.prototype.toBlob)?new y((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):x(t.toDataURL(e,n))}var S=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()}(t,e,a)};function k(t,e,n){var r=e.type;function o(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:u(r),toBlob:function(){return y.resolve(e)},toDataURL:u(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return C(t,e,n)}))},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(p)}}}function O(t){return function(t){return new y((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return k(function(t){return w(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=h(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return v(e).drawImage(t,0,0),e}))}(t),t,e)}))}function T(t,e){return C(t,e).then((function(e){return k(y.resolve(t),e,t.toDataURL())}))}var _=Object.keys,E=function(t,e,n){return void 0===n&&(n=!1),new y((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=_(t),r=0,i=n.length;r<i;r++){var u=n[r];a=t[u],c=u,o.setRequestHeader(c,a)}var a,c}(e),o.responseType="blob",o.send()}))},A=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],N=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],R=function(t){var e=function(t){return"ImageProxy HTTP error: "+S(A,(function(e){return t===e.code})).fold(u("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return y.reject(e)},M=function(t){return S(N,(function(e){return e.type===t})).fold(u("Unknown service error"),(function(t){return t.message}))},z=function(t){return function(t){return new y((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=function(t){return"ImageProxy Service error: "+function(t){try{return d.some(JSON.parse(t))}catch(t){return d.none()}}(t).bind((function(t){return(e=t,n=["error","type"],r=function(t,e){return m(t)?t[e]:void 0},o=e,function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(n,(function(t){o=r(o,t)})),i=o,d.from(i)).map(M);var e,n,r,o,i})).getOr("Invalid JSON in service error message")}(t);return y.reject(e)}))},D=function(t){return t<200||t>=300},B=function(t,e,n){return void 0===n&&(n=!1),e?function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return E(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return D(t.status)?function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e=t.status,n=t.blob)?z(n):R(e):y.resolve(t.blob);var e,n}))}(t,e):function(t,e){return E(t,{},e).then((function(t){return D(t.status)?R(t.status):y.resolve(t.blob)}))}(t,n)},P=function(t){return O(t)},I=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},L=I,H=("undefined"!=typeof window?window:Function("return this;")(),function(t,e){return function(t,n){return S(t.dom.childNodes,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(L(t),e)})).map(L)}(t)}),F=tinymce.util.Tools.resolve("tinymce.util.Delay"),V=tinymce.util.Tools.resolve("tinymce.util.Promise"),j=tinymce.util.Tools.resolve("tinymce.util.URI"),U=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},W=function(t){return t.getParam("imagetools_proxy")};function q(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)}function $(t){return{w:t.naturalWidth,h:t.naturalHeight}}var G=0,X=function(t){return H(L(t),"img")},K=function(t,e){return t.dom.is(e,"figure")},Y=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},J=function(t,e){var n=function(e){return Y(t,e)&&(et(t,e)||nt(t,e)||m(W(t)))};return K(t,e)?X(e).bind((function(t){return n(t.dom)?d.some(t.dom):d.none()})):n(e)?d.some(e):d.none()},Q=function(t,e){t.notificationManager.open({text:e,type:"error"})},Z=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&K(t,n)?X(n):Y(t,e)?d.some(L(e)):d.none()},tt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return m(r)?t.dom.encode(r[n]):null},et=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new j(n).host===t.documentBaseURI.host},nt=function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new j(e.src).host)},rt=function(t,e){if(nt(t,e))return B(e.src,null,function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new j(e.src).host)}(t,e));if(!et(t,e)){var n=W(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return B(r,o,!1)}return function(t){var e,n=t.src;return 0===n.indexOf("data:")?x(n):(e=n,new y((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(){200===this.status&&t(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()})))}(e)},ot=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?V.resolve(n.blob()):function(t,e){return function(t){return d.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return rt(t,e)}),(function(t){return t(e)}))}(t,e)},it=function(t){F.clearTimeout(t.get())},ut=function(t,e,n,r,o,i,u){return n.toBlob().then((function(a){var c,s,l,f,d=t.editorUpload.blobCache;c=i.src;var g=e.type===a.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(f=d.getByUri(c),m(f)?(c=f.uri(),s=f.name(),l=f.filename()):(s=tt(t,c,2),l=tt(t,c,1))),f=d.create({id:"imagetools"+G++,blob:a,base64:n.toBase64(),uri:c,name:s,filename:g?l:void 0}),d.add(f),t.undoManager.transact((function(){t.$(i).on("load",(function e(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(it(o),function(t,e){var n=F.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))})),u&&t.$(i).attr({width:u.w,height:u.h}),t.$(i).attr({src:f.blobUri()}).removeAttr("data-mce-src")})),f}))},at=function(t,e,n,r){return function(){return Z(t).fold((function(){Q(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return ot(t,o.dom)})).then((function(i){return P(i).then(n).then((function(n){return ut(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){Q(t,e)}))}))}},ct=function(t,e,n){return function(){var r=Z(t).fold((function(){return null}),(function(t){var e=q(t.dom);return e?{w:e.h,h:e.w}:null}));return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||b(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}),r)()}},st=function(t,e,n){return function(){return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}))()}},lt=function(t,e){return function(){var n=Z(t),r=n.map((function(t){return $(t.dom)}));n.each((function(o){J(t,o.dom).each((function(i){ot(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){!function(t,e,n,r,o){(function(t){return w(t)})(o).then((function(t){var e=$(t);return r.w===e.w&&r.h===e.h||q(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(P).then((function(r){return ut(t,o,r,!0,e,n)})).catch((function(){}))}(t,e,n.dom,r,i)}))})),o.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};o.add("imagetools",(function(t){var e=r(0),n=r(null);!function(t,e){i.each({mceImageRotateLeft:ct(t,e,-90),mceImageRotateRight:ct(t,e,90),mceImageFlipVertical:st(t,e,"v"),mceImageFlipHorizontal:st(t,e,"h"),mceEditImage:lt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:e("mceImageRotateLeft")}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:e("mceImageRotateRight")}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:e("mceImageFlipVertical")}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:e("mceImageFlipHorizontal")}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:e("mceEditImage"),onSetup:function(e){var n=function(){var n=Z(t).forall((function(e){return J(t,e.dom).isNone()}));e.setDisabled(n)};return t.on("NodeChange",n),function(){t.off("NodeChange",n)}}}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:e("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(n){return J(t,n).fold((function(){return[]}),(function(t){return[{text:"Edit image",icon:"edit-image",onAction:e("mceEditImage")}]}))}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:U(t),predicate:function(e){return J(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=J(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(it(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},2682:(t,e,n)=>{n(7384)},7384:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(null,function(t){return null===t}),l=u("boolean"),f=u("function"),d=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},m=function(t){return t.getParam("default_link_target")},g=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},p=function(t){return t.getParam("link_title",!0,"boolean")},v=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},b=function(t){return t.getParam("link_default_protocol","http","string")},y=function(){},w=function(t){return function(){return t}},x=w(!1),C=w(!0),S=function(){return k},k=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:x,isSome:x,isNone:C,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:w(null),getOrUndefined:w(void 0),or:n,orThunk:e,map:S,each:y,bind:S,exists:x,forall:C,filter:S,equals:t,equals_:t,toArray:function(){return[]},toString:w("none()")}),O=function(t){var e=w(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:C,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return O(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:k},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(x,(function(e){return n(t,e)}))}};return o},T={some:O,none:S,from:function(t){return null==t?k:O(t)}},_=Array.prototype.indexOf,E=Array.prototype.push,A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},N=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return T.none()},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},M=function(t,e){return t?T.some(e):T.none()},z=tinymce.util.Tools.resolve("tinymce.util.Tools"),D=function(t){return a(t.value)?t.value:""},B=function(t,e){var n=[];return z.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=B(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},P=function(t){return void 0===t&&(t=D),function(e){return T.from(e).map((function(e){return B(e,t)}))}},I=function(t){return P(D)(t)},L=P,H=function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},F=D,V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=Object.keys,U=Object.hasOwnProperty,W=function(t,e){return U.call(t,e)},q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t){return t&&"a"===t.nodeName.toLowerCase()},G=function(t){return $(t)&&!!Y(t)},X=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new q(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},K=function(t){return/^\w+:/i.test(t)},Y=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},J=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===z.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return z.trim(t.sort().join(" "))}(i):""},Q=function(t,e){return e=e||t.selection.getNode(),nt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},Z=function(t,e){return(e?e.innerText||e.textContent:t.getContent({format:"text"})).replace(/\uFEFF/g,"")},tt=function(t){return z.grep(t,G).length>0},et=function(t){var e=t.schema.getTextInlineElements();return 0===X(t.selection.getRng(),(function(t){return 1===t.nodeType&&!$(t)&&!W(e,t.nodeName.toLowerCase())})).length},nt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},rt=function(t,e,n){var r=t.selection.getNode(),o=Q(t,r),i=function(t,e){var n=V({},e);if(!(h(t).length>0)&&!1===v(t)){var r=J(n.rel,"_blank"===n.target);n.rel=r||null}return T.from(n.target).isNone()&&!1===g(t)&&(n.target=m(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||K(t)?t:e+"://"+t}(n.href,d(t)),n}(t,function(t){return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(e,(function(t){r=n(r,t)})),r;var e,n,r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){nt(e)?ct(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},ot=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return function(t,e,n,r){(function(t,e){for(var n=j(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}})(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,(function(t,e){return!1===s(t)}),(n=r,function(t,e){n[e]=t}),y),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()})},it=function(t,e,n){t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ot(n)):rt(t,e,n)},ut=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();nt(e)?at(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},at=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},ct=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},st=function(t,e){return N(e,(function(e){return function(t){return W(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n}(e)?st(t,e.items):M(e.value===t,e)}))},lt=function(t,e){var n={text:t.text,title:t.title},r=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:T.none()).getOr([]);return function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?st(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:y}},text:i?t:e.text}})):T.none()}(n.text,r.name,u,t)};return{onChange:function(t,e){var o,i,u,a,c=e.name;return"url"===c?(o=t(),i=o.url,u=M(n.text.length<=0,T.from(i.meta.text).getOr(i.value)),a=function(t){return M(n.title.length<=0,T.from(t.meta.title).getOr(""))}(o.url),u.isSome()||a.isSome()?T.some(V(V({},u.map((function(t){return{text:t}})).getOr({})),a.map((function(t){return{title:t}})).getOr({}))):T.none()):function(t,e){return _.call(t,e)}(["anchor","link"],c)>-1?r(t(),e):"text"===c||"title"===c?(n[c]=t()[c],T.none()):T.none()}}},ft=tinymce.util.Tools.resolve("tinymce.util.Delay"),dt=tinymce.util.Tools.resolve("tinymce.util.Promise"),mt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?T.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return V(V({},t),{href:"mailto:"+e})}}):T.none()},gt=function(t,e){return function(n){var r=n.href;return 1===t&&!K(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?T.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return V(V({},t),{href:e+"://"+r})}}):T.none()}},ht=function(t){var e=t.dom.select("a:not([href])"),n=A(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]})));return n.length>0?T.some([{text:"None",value:""}].concat(n)):T.none()},pt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?I(e):T.none()},vt=tinymce.util.Tools.resolve("tinymce.util.XHR"),bt=function(t,e){var n=h(t);if(n.length>0){var r=e.is("_blank");return(!1===v(t)?L((function(t){return J(F(t),r)})):I)(n)}return T.none()},yt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],wt=function(t){var e=g(t);return c(e)?I(e).orThunk((function(){return T.some(yt)})):!1===e?T.none():T.some(yt)},xt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?T.some(r):T.none()},Ct=function(t,e){return function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new dt((function(t){a(n)?vt.send({url:n,success:function(e){return t(function(t){try{return T.some(JSON.parse(t))}catch(t){return T.none()}}(e))},error:function(e){return t(T.none())}}):f(n)?n((function(e){return t(T.some(e))})):t(T.from(n))})).then((function(t){return t.bind(L(e)).map((function(t){return t.length>0?[{text:"None",value:""}].concat(t):t}))}))}(t).then((function(n){var r=function(t,e){var n=t.dom,r=et(t)?T.some(Z(t.selection,e)):T.none(),o=e?T.some(n.getAttrib(e,"href")):T.none(),i=e?T.from(n.getAttrib(e,"target")):T.none(),u=xt(n,e,"rel"),a=xt(n,e,"class");return{url:o,text:r,title:xt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:wt(t),rels:bt(t,r.target),classes:pt(t),anchor:ht(t),link:n},optNode:T.from(e),flags:{titleEnabled:p(t)}}}))},St=function(t){(function(t){var e=Q(t);return Ct(t,e)})(t).then((function(e){var n=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ut(t),void n.close();var o=function(t){return T.from(r[t]).filter((function(n){return!e.anchor[t].is(n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};(function(t,e){return N([mt,gt(d(t),b(t))],(function(t){return t(e)})).fold((function(){return dt.resolve(e)}),(function(n){return new dt((function(r){!function(t,e,n){var r=t.selection.getRng();ft.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))})(t,i).then((function(e){it(t,u,e)})),n.close()}}(t,e);return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,T.from(m(n))),u=t.catalogs,a=lt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:A([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([u.anchor.map(H("anchor","Anchors")),u.rels.map(H("rel","Rel")),u.targets.map(H("target","Open link in...")),u.link.map(H("link","Link list")),u.classes.map(H("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,n,t)})).then((function(e){t.windowManager.open(e)}))},kt=function(t,e){return t.dom.getParent(e,"a[href]")},Ot=function(t){return kt(t,t.selection.getStart())},Tt=function(t,e){if(e){var n=Y(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else!function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)}(e.href)}},_t=function(t){return function(){St(t)}},Et=function(t){return function(){Tt(t,Ot(t))}},At=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Nt=function(t){return function(e){return At(t,(function(){e.setActive(!t.mode.isReadOnly()&&null!==Q(t,t.selection.getNode()))}))}},Rt=function(t){return function(e){var n=function(){return e.setDisabled(null===Q(t,t.selection.getNode()))};return n(),At(t,n)}},Mt=function(t){return function(e){var n=function(e){return tt(e)||(n=t.selection.getRng(),X(n,G).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),At(t,(function(t){return e.setDisabled(!n(t.parents))}))}};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:_t(t),onSetup:Nt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:_t(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return tt(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!Q(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Nt(t)},label:"Link",predicate:function(e){return!!Q(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=Q(t);return e?Y(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!Q(t,n)),Nt(t)(e)},onAction:function(e){var n=Q(t),r=e.getValue();if(n)t.undoManager.transact((function(){t.dom.setAttrib(n,"href",r),function(t){t.selection.collapse(!1)}(t),e.hide()}));else{var o={href:r,attach:function(){}},i=et(t)?T.some(Z(t.selection,n)).filter((function(t){return t.length>0})).or(T.from(r)):T.none();it(t,o,{href:r,text:i,title:T.none(),rel:T.none(),target:T.none(),class:T.none()}),e.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ut(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Et(t)(),e.hide()}}]})}(t),function(t){t.on("click",(function(e){var n=kt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Tt(t,n))})),t.on("keydown",(function(e){var n=Ot(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Tt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?_t(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},1236:(t,e,n)=>{n(7585)},7585:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){},i=function(t){return function(){return t}},u=function(t){return function(e){return!t(e)}},a=i(!1),c=i(!0),s=function(){return l},l=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:s,each:o,bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}}(),f=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},g=function(t){return function(e){return typeof e===t}},h=m("string"),p=m("array"),v=g("boolean"),b=g("function"),y=g("number"),w=Array.prototype.slice,x=Array.prototype.push,C=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},k=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},O=function(t,e,n){return S(t,(function(t){n=e(n,t)})),n},T=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()},_=function(t,e){return T(t,e,a)},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!p(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e}(C(t,e))},A=function(t){var e=w.call(t,0);return e.reverse(),e},N=function(t,e){return e>=0&&e<t.length?d.some(t[e]):d.none()},R=function(t){return N(t,0)},M=function(t){return N(t,t.length-1)},z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(){return B(0,0)},B=function(t,e){return{major:t,minor:e}},P=function(t,e){var n=String(e).toLowerCase();return 0===t.length?D():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return B(r(1),r(2))}(t,n)},I=D,L=function(t,e){var n=String(e).toLowerCase();return _(t,(function(t){return t.search(n)}))},H=function(t,e){return-1!==t.indexOf(e)},F=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,V=function(t){return function(e){return H(e,t)}},j=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return H(t,"edge/")&&H(t,"chrome")&&H(t,"safari")&&H(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,F],search:function(t){return H(t,"chrome")&&!H(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return H(t,"msie")||H(t,"trident")}},{name:"Opera",versionRegexes:[F,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:V("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:V("firefox")},{name:"Safari",versionRegexes:[F,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(H(t,"safari")||H(t,"mobile/"))&&H(t,"applewebkit")}}],U=[{name:"Windows",search:V("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return H(t,"iphone")||H(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:V("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:V("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:V("linux"),versionRegexes:[]},{name:"Solaris",search:V("sunos"),versionRegexes:[]},{name:"FreeBSD",search:V("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:V("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],W={browsers:i(j),oses:i(U)},q="Edge",$="Chrome",G="Opera",X="Firefox",K="Safari",Y=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(q),isChrome:r($),isIE:r("IE"),isOpera:r(G),isFirefox:r(X),isSafari:r(K)}},J=function(){return Y({current:void 0,version:I()})},Q=Y,Z=(i(q),i($),i("IE"),i(G),i(X),i(K),"Windows"),tt="Android",et="Linux",nt="Solaris",rt="FreeBSD",ot="ChromeOS",it=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Z),isiOS:r("iOS"),isAndroid:r(tt),isOSX:r("OSX"),isLinux:r(et),isSolaris:r(nt),isFreeBSD:r(rt),isChromeOS:r(ot)}},ut=function(){return it({current:void 0,version:I()})},at=it,ct=(i(Z),i("iOS"),i(tt),i(et),i("OSX"),i(nt),i(rt),i(ot),function(t,e){var n=W.browsers(),r=W.oses(),o=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(J,Q),u=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ut,at),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}}(u,o,t,e);return{browser:o,os:u,deviceType:a}}),st=function(t){return window.matchMedia(t).matches},lt=(t=function(){return ct(navigator.userAgent,st)},n=!1,function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}),ft=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},dt=function(t,e){var n=(e||document).createElement(t);return ft(n)},mt=ft,gt=function(t,e){return t.dom===e.dom},ht=function(t,e){return lt().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},pt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},vt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),yt=tinymce.util.Tools.resolve("tinymce.util.VK"),wt=Object.keys,xt=function(t,e){for(var n=wt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ct=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),St=(1,function(t){return 1===function(t){return t.dom.nodeType}(t)}),kt=function(t,e){var n=t.dom;xt(e,(function(t,e){!function(t,e,n){if(!(h(n)||v(n)||y(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Ot=function(t){return O(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Tt=function(t){return d.from(t.dom.parentNode).map(mt)},_t=function(t){return C(t.dom.childNodes,mt)},Et=function(t,e){var n=t.dom.childNodes;return d.from(n[e]).map(mt)},At=function(t){return Et(t,0)},Nt=function(t){return Et(t,t.dom.childNodes.length-1)},Rt=function(t,e){Tt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Mt=function(t,e){t.dom.appendChild(e.dom)},zt=function(t,e){S(e,(function(e){Mt(t,e)}))},Dt=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Bt=function(t){return function(t,e){return mt(t.dom.cloneNode(!0))}(t)},Pt=function(t,e){var n=function(t,e){var n=dt(e),r=Ot(t);return kt(n,r),n}(t,e);Rt(t,n);var r=_t(t);return zt(n,r),Dt(t),n},It=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ht=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ft=function(t){return function(e){return e&&t.test(e.nodeName)}},Vt=function(t){return t&&3===t.nodeType},jt=Ft(/^(OL|UL|DL)$/),Ut=Ft(/^(OL|UL)$/),Wt=Ht("ol"),qt=Ft(/^(LI|DT|DD)$/),$t=Ft(/^(DT|DD)$/),Gt=Ft(/^(TH|TD)$/),Xt=Ht("br"),Kt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Yt=function(t,e){return t&&t.nodeName in e},Jt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Qt=function(t,e){return t.isChildOf(e,t.getRoot())},Zt=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Yt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Yt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},te=It.DOM,ee=function(t){pt(t,"dt")&&Pt(t,"dd")},ne=function(t,e){if(Vt(t))return{container:t,offset:e};var n=vt.getNode(t,e);return Vt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Vt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Vt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},re=function(t){var e=t.cloneRange(),n=ne(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=ne(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},oe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ie=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ae(t,n))},ue=function(t){var e=t.selection.getSelectedBlocks();return Lt.grep(function(t,e){var n=Lt.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",ae(t,e))||e}));return oe.unique(n)}(t,e),(function(t){return qt(t)}))},ae=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ce=function(t,e){var n=t.dom.getParents(e,"ol,ul",ae(t,e));return M(n)},se=function(t,e){var n=C(e,(function(e){return ce(t,e).getOr(e)}));return oe.unique(n)},le=function(t,e,n){return t.isSome()&&e.isSome()?d.some(n(t.getOrDie(),e.getOrDie())):d.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!h(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&b(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){Mt(t.item,e.list)},ge=function(t,e){var n={list:dt(e,t),item:dt("li",t)};return Mt(n.list,n.item),n},he=function(t){return pt(t,"OL,UL")},pe=function(t){return At(t).map(he).getOr(!1)},ve=function(t){return t.depth>0},be=function(t){return t.isSelected},ye=function(t){var e=_t(t),n=Nt(t).map(he).getOr(!1)?e.slice(0,-1):e;return C(n,Bt)},we=function(t){return S(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return T(A(t.slice(0,e)),r,o).orThunk((function(){return T(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=function(t,e){var n={};return function(t,e,n,r){xt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),o),n}(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=z({},r.listAttributes));var n,r}))})),t},xe=function(t,e,n,r){return At(r).filter(he).fold((function(){e.each((function(t){gt(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return Tt(t).filter(St).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:ye(t),itemAttributes:Ot(t),listAttributes:Ot(r),listType:Ct(r)}}))}(r,t,n.get());e.each((function(t){gt(t.end,r)&&n.set(!1)}));var i=Nt(r).filter(he).map((function(r){return Ce(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Ce(t,e,n,r)}))},Ce=function(t,e,n,r){return E(_t(r),(function(r){return(he(r)?Ce:xe)(t+1,e,n,r)}))},Se=function(t,e){var n=we(e);return function(t,e){var n=O(e,(function(e,n){return n.depth>e.length?function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item.dom,de(r,"list-style-type","none");var r;M(t).each((function(t){kt(t.list,e.listAttributes),kt(t.item,e.itemAttributes),zt(t.item,e.content)}))}(o,n),r=o,le(M(e),R(r),me),e.concat(o)}(t,e,n):function(t,e,n){var r=e.slice(0,n.depth);return M(r).each((function(e){!function(t,e){Mt(t.list,e),t.item=e}(e,function(t,e,n){var r=dt("li",t);return kt(r,e),zt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){Ct(t.list)!==e.listType&&(t.list=Pt(t.list,e.listType)),kt(t.list,e.listAttributes)}(e,n)})),r}(t,e,n)}),[]);return R(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},ke=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return C(t,(function(t){return{sourceList:t,entries:Ce(0,e,r,t)}}))}(e,function(t){var e=C(ue(t),mt);return le(_(e,u(pe)),_(A(e),u(pe)),(function(t,e){return{start:t,end:e}}))}(t));S(r,(function(e){!function(t,e){S(k(t,be),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return E(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ve),(function(e){return R(e).map(ve).getOr(!1)?Se(t,e):function(t,e){var n=we(e);return C(n,(function(e){var n,r,o=(n=e.content,r=document.createDocumentFragment(),S(n,(function(t){r.appendChild(t.dom)})),mt(r));return mt(Zt(t,o.dom))}))}(t,e)}))}(t,e.entries);S(o,(function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,S(o,(function(t){Rt(r,t)})),Dt(e.sourceList)}))},Oe=function(t,e){var n=C(function(t){var e=function(t){var e=ce(t,t.selection.getStart()),n=k(t.selection.getSelectedBlocks(),Ut);return e.toArray().concat(n)}(t);return se(t,e)}(t),mt),r=C(function(t){return k(ue(t),$t)}(t),mt),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();ke(t,n,e),function(t,e,n){S(n,"Indent"===e?ee:function(e){return function(t,e){pt(e,"dd")?Pt(e,"dt"):pt(e,"dt")&&Tt(e).each((function(n){return function(t,e,n){var r=te.select('span[data-mce-type="bookmark"]',e),o=Zt(t,n),i=te.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){te.remove(c);break}t.dom.isEmpty(a)||te.insertAfter(a,e),te.insertAfter(o,e),Jt(t.dom,n.parentNode)&&(u=n.parentNode,Lt.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),te.remove(u)),te.remove(n),Jt(t.dom,e)&&te.remove(e)}(t,n.dom,e.dom)}))}(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(re(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Te=function(t){return Oe(t,"Indent")},_e=function(t){return Oe(t,"Outdent")},Ee=function(t){return Oe(t,"Flatten")},Ae=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Ne=It.DOM,Re=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=Ne.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):Ne.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},Me=function(t){function e(e){var n,r,o;n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(n),n=n.parentNode,Ne.remove(o),!n.hasChildNodes()&&Ne.isBlock(n)&&n.appendChild(Ne.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Ne.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),re(n)},ze=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},De=function(t){return/\btox\-/.test(t.className)},Be=function(t,e,n){var r=function(t){var r=T(t.parents,jt,Gt).filter((function(t){return t.nodeName===e&&!De(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Pe=function(t,e){Lt.each(e,(function(e,n){t.setAttribute(n,e)}))},Ie=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Pe(e,n["list-attributes"]),Lt.each(t.select("li",e),(function(t){Pe(t,n["list-item-attributes"])}))}(t,e,n)},Le=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Xt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Kt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},He=function(t,e,n){return function(t,e){return t&&e&&jt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Fe=function(t,e){var n,r;if(n=e.nextSibling,He(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,He(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},Ve=function(t){return"list-style-type"in t},je=function(t,e,n){var r=ie(t),o=function(t){var e=ie(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return Lt.grep(t.querySelectorAll("ol,ul,dl"),(function(t){return jt(t)}))}(e):Lt.grep(n,(function(t){return jt(t)&&e!==t}))}(t);n=n||{},r&&o.length>0?function(t,e,n,r,o){if(e.nodeName!==r||Ve(o)){var i=Re(t.selection.getRng(!0));Lt.each([e].concat(n),(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Ie(t.dom,o,r),fe(t,ze(n),o)}else Ie(t.dom,e,r),fe(t,ze(n),e)}(t,e,r,o)})),t.selection.setRng(Me(i))}else Ee(t)}(t,r,o,e,n):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Ve(r)||De(e)){var o=Re(t.selection.getRng(!0));Ie(t.dom,e,r);var i=t.dom.rename(e,n);Fe(t.dom,i),t.selection.setRng(Me(o)),fe(t,ze(n),i)}else Ee(t);else(function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=ae(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=Re(r);Lt.each(function(t,e,n){for(var r,o=[],i=t.dom,u=Le(t,e,!0,n),a=Le(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Lt.each(c,(function(e){if(Kt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Xt(e))return Xt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Ae.isBookmarkNode(e)&&(Kt(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i),(function(r){var i,a=r.previousSibling;a&&jt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Lt.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r),Ie(u,i,n),Fe(t.dom,i)})),t.selection.setRng(Me(a))}})(t,n,r),fe(t,ze(n),e)}(t,r,e,n)},Ue=It.DOM,We=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Vt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=vt.getNode(o,i));var a=new bt(o,r);for(n&&function(t,e){return!!Xt(e)&&t.isBlock(e.nextSibling)&&!Xt(e.previousSibling)}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Vt(o)&&o.data.length>0)return o}},qe=function(t,e){var n=e.childNodes;return 1===n.length&&!jt(n[0])&&t.isBlock(n[0])},$e=function(t,e,n){var r,o=e.parentNode;if(Qt(t,e)&&Qt(t,n)){jt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Xt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Xt(i)&&e.hasChildNodes()&&t.remove(i),Jt(t,n,!0)&&t.$(n).empty(),function(t,e,n){var r,o=qe(t,n)?n.firstChild:n;if(function(t,e){qe(t,e)&&t.remove(e.firstChild,!0)}(t,e),!Jt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)}(t,e,n),r&&n.appendChild(r);var u=ht(mt(n),mt(e))?t.getParents(e,jt,n):[];t.remove(e),S(u,(function(e){Jt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Ge=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ae(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&Jt(n,a))return!0;var c=re(r.getRng()),s=n.getParent(We(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),$e(t.dom,e,n),t.selection.setCursorLocation(n)}(t,n,r);else{var i=Re(e);$e(o,n,r),t.selection.setRng(Me(i))}}(t,c,s,u):(n=u).parentNode.firstChild===n?_e(t):function(t,e,n,r){var o=Re(e);$e(t.dom,n,r);var i=Me(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Ee(t)})),!0}return!1},Xe=function(t,e){return t.selection.isCollapsed()?function(t,e){return Ge(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ae(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=re(t.selection.getRng()),a=n.getParent(We(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Fe(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)}(t,e):function(t){var e=t.selection.getStart(),n=ae(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||ue(t).length>0)&&(t.undoManager.transact((function(){var e,n;t.execCommand("Delete"),e=t.dom,n=t.getBody(),Lt.each(Lt.grep(e.select("ol,ul",n)),(function(t){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),Jt(t,r)&&Ue.remove(r)):Ue.setStyle(r,"listStyleType","none")),jt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(e,t)}))})),!0)}(t)},Ke=function(t){var e=t.dom,n=ie(t);Wt(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact((function(){e.setAttrib(ie(t),"start","1"===r.start?"":r.start)})),n.close()}})},Ye=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}};r.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)&&(function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==yt.TAB||yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?_e(t):Te(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===yt.BACKSPACE?Xe(t,!1)&&e.preventDefault():e.keyCode===yt.DELETE&&Xe(t,!0)&&e.preventDefault()}))}(t)}(t),function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Te(t):"outdent"===n&&_e(t)})),t.addCommand("InsertUnorderedList",(function(e,n){je(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){je(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){je(t,"DL",n)})),t.addCommand("RemoveList",(function(){Ee(t)})),t.addCommand("mceListProps",(function(){Ke(t)})),t.addQueryStateHandler("InsertUnorderedList",Ye(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Ye(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Ye(t,"DL"))}(t)),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Be(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Be(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return Ke(t)},onSetup:function(e){return Be(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ie(t,e);return Wt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){Xe(t,e)}}}(t)}))}()},2540:(t,e,n)=>{n(3167)},3167:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},m=d("string"),g=d("object"),h=d("array"),p=Array.prototype.push,v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!h(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);p.apply(e,t[n])}return e},y=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},w=Object.keys,x=Object.hasOwnProperty,C=function(t,e){return S(t,e)?f.from(t[e]):f.none()},S=function(t,e){return x.call(t,e)},k=function(t){return t.getParam("media_scripts")},O=function(t){return t.getParam("media_live_embeds",!0)},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},N=_.DOM,R=function(t){return t.replace(/px$/,"")},M=function(t,e){var n=y(!1),r={};return E({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(S(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?N.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:C(n,"max-width").map(R).getOr(""),height:C(n,"max-height").map(R).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=T.extend(o.map,r)),"script"===e){var i=A(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=function(t){return{mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()]||""},D=tinymce.util.Tools.resolve("tinymce.html.Schema"),B=tinymce.util.Tools.resolve("tinymce.html.Writer"),P=_.DOM,I=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},L=function(t,e){!function(t,e){for(var n=w(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},H=["source","altsource"],F=function(t,e,n){var r,o=B(),i=y(!1),u=0;return E({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(S(a.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?P.parseStyle(n):{};r["max-width"]=I(t.width),r["max-height"]=I(t.height),L(e,{style:P.serializeStyle(r)})}(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&L(a,{width:e.width,height:e.height})}if(n)switch(t){case"video":L(a,{poster:e.poster,src:""}),e.altsource&&L(a,{src:""});break;case"iframe":L(a,{src:e.source});break;case"source":if(u<2&&(L(a,{src:e[H[u]],type:e[H[u]+"mime"]}),!e[H[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[H[a]]){var c=[];c.map={},u<=a&&(L(c,{src:e[H[a]],type:e[H[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},L(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},D({})).parse(t),o.getContent()},V=[{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&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}],j=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},U=function(t,e){var n=T.extend({},e);if(!n.source&&(T.extend(n,M(k(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=z(n.source),n.altsourcemime=z(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=V.filter((function(t){return t.regex.test(r)}))).length>0?T.extend({},o[0],{url:j(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowFullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return F(n.embed,n,!0);var u=A(k(t),n.source);u&&(n.type="script",n.width=String(u.width),n.height=String(u.height));var a=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",T.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,a):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},W=tinymce.util.Tools.resolve("tinymce.util.Promise"),q={},$=function(t){return function(e){return U(t,e)}},G=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new W((function(r,o){var i=function(n){return n.html&&(q[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};q[t.source]?i(q[t.source]):n({url:t.source},i,o)}))}(e,$(t),n):function(t,e){return new W((function(n){n({html:e(t),url:t.source})}))}(e,$(t))},X=function(t,e){return C(e,t).bind((function(t){return C(t,"meta")}))},K=function(t,e,n){return function(r){var o,i=function(){return C(t,r)},u=function(){return C(e,r)},a=function(t){return C(t,"value").bind((function(t){return t.length>0?f.some(t):f.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return g(t)?a(t).orThunk(u):u().orThunk((function(){return f.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return g(t)?a(t):f.from(t)}))}))).getOr(""),o}},Y=function(t,e){var n={};return C(t,"dimensions").each((function(t){v(["width","height"],(function(r){C(e,r).orThunk((function(){return C(t,r)})).each((function(t){return n[r]=t}))}))})),n},J=function(t,e){var n=e?X(e,t).getOr({}):{},r=K(t,n,e);return o(o(o(o(o({},r("source")),r("altsource")),r("poster")),r("embed")),Y(t,n))},Q=function(t){var e=o(o({},t),{source:{value:C(t,"source").getOr("")},altsource:{value:C(t,"altsource").getOr("")},poster:{value:C(t,"poster").getOr("")}});return v(["width","height"],(function(n){C(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Z=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},tt=function(t,e){return M(k(t),e)},et=function(t,e){return function(n){if(m(n.url)&&n.url.trim().length>0){var r=n.html,i=tt(e,r),u=o(o({},i),{source:n.url,embed:r});t.setData(Q(u))}}},nt=function(t,e){var n=t.dom.select("img[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("img[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},rt=function(t){var e=function(t){var e=t.selection.getNode(),n=function(t){return t.getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")}(e)?t.serializer.serialize(e,{selection:!0}):"";return o({embed:n},M(k(t),n))}(t),n=y(e),r=Q(e),i=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],u={title:"General",name:"general",items:b([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},a=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&a.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&a.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var c={title:"Advanced",name:"advanced",items:a},s=[u,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];a.length>0&&s.push(c);var l={type:"tabpanel",tabs:s},f=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=J(e.getData());(function(t,e,n){var r;e.embed=F(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,q.hasOwnProperty(r)))?nt(n,e.embed):G(n,e).then((function(t){nt(n,t.html)})).catch(Z(n))})(n.get(),r,t),e.close()},onChange:function(e,r){switch(r.name){case"source":!function(e,n){var r=J(n.getData(),"source");e.source!==r.source&&(et(f,t)({url:r.source,html:""}),G(t,r).then(et(f,t)).catch(Z(t)))}(n.get(),e);break;case"embed":!function(e){var n=J(e.getData()),r=tt(t,n.embed);e.setData(Q(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var r=J(e.getData(),n),i=U(t,r);e.setData(Q(o(o({},r),{embed:i})))}(e,r.name)}n.set(J(e.getData()))},initialData:r})},ot=tinymce.util.Tools.resolve("tinymce.html.Node"),it=tinymce.util.Tools.resolve("tinymce.Env"),ut=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=B();return E({validate:!1,allow_conditional_comments:!1,comment:function(t){r.comment(t)},cdata:function(t){r.cdata(t)},text:function(t,e){r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},D({})).parse(e),r.getContent()},at=function(t,e){var n=e.name,r=new ot("img",1);return r.shortEnded=!0,st(t,e,r),r.attr({width:e.attr("width")||"300",height:e.attr("height")||("audio"===n?"30":"150"),style:e.attr("style"),src:it.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},ct=function(t,e){var n=e.name,r=new ot("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),st(t,e,r);var o=new ot(n,1);o.attr({src:e.attr("src"),allowfullscreen:e.attr("allowfullscreen"),style:e.attr("style"),class:e.attr("class"),width:e.attr("width"),height:e.attr("height"),frameborder:"0"});var i=new ot("span",1);return i.attr("class","mce-shim"),r.append(o),r.append(i),r},st=function(t,e,n){var r,o,i,u=e.attributes;for(i=u.length;i--;)r=u[i].name,o=u[i].value,"width"!==r&&"height"!==r&&"style"!==r&&("data"!==r&&"src"!==r||(o=t.convertURL(o,r)),n.attr("data-mce-p-"+r,o));var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(ut(t,a))),n.firstChild=null)},lt=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},ft=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||lt(t))return!0;return!1},dt=function(t,e){return function(n){return t.selection.selectorChangedWithUnbind(e.join(","),n.setActive).unbind}};r.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){rt(t)}))}(t),function(t){t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){t.execCommand("mceMedia")},onSetup:dt(t,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){t.execCommand("mceMedia")}})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();T.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();T.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=A(k(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),"iframe"===n.name&&O(t)&&it.ceFalse?ft(n)||n.replace(ct(t,n)):ft(n)||n.replace(at(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,u,a,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new ot(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(u=r.attributes).length;i--;){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new ot("#text",3)).raw=!0,c.value=ut(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))}(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){var e=t.target.getAttribute("data-mce-object");"audio"!==e&&"script"!==e||t.preventDefault()})),t.on("ObjectResized",(function(t){var e,n=t.target;n.getAttribute("data-mce-object")&&(e=n.getAttribute("data-mce-html"))&&(e=unescape(e),n.setAttribute("data-mce-html",escape(F(e,{width:String(t.width),height:String(t.height)}))))}))}(t),function(t){return{showDialog:function(){rt(t)}}}(t)}))}()},8208:(t,e,n)=>{n(8931)},8931:(t,e,n)=>{const{EventDispatcher:r}=n(7575);!function(){"use strict";tinymce.PluginManager.add("mychecklist",(function(t,e){function n(){t.insertContent('<ul class="tox-checklist">\n \n <li></li>\n </ul>')}t.addCommand("InsertCheckList",(function(t,e){n()})),t.ui.registry.addButton("mychecklist",{icon:"checklist",tooltip:"Insert check list",onAction:n});let r=null;t.on("mousedown",(function(e){e.offsetX>0||(r=t.selection.getRng())})),t.on("NodeChange",(function(t){var e=t.target,n=e?.parentElement;n&&"tox-checklist"===n.className&&"LI"===e.nodeName&&"tox-checklist--checked"===e.className&&(e.className="")})),t.on("NewBlock",(function(t){"LI"===t.newBlock.nodeName&&"tox-checklist--checked"===t.newBlock.className&&(t.newBlock.className="")})),t.on("click",(function(e){var n=e.target,o=n.parentElement;e.offsetX>0||(t.selection.setRng(r),"tox-checklist"===o.className&&(n.scrollIntoView(!1),"LI"===n.nodeName&&"tox-checklist--checked"===n.className?n.className="":"LI"===n.nodeName&&""===n.className&&(n.className="tox-checklist--checked")),t.fire("input"))}))}))}()},1933:(t,e,n)=>{n(4129)},4129:(t,e,n)=>{"use strict";n.r(e);var r,o,i,u=n(7575);r=n.n(u)().util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){if(e&&e.isActive&&e.isActive())t.execCommand("mceInsertNewLine",!1,{shiftKey:!0});else{var r=t.selection.getContent({format:"text"});r=r.replace(/^\n/gm,""),"shortcut"===n&&(r="<br>"),r.length>0?(t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,`<pre class='codeblock'>${r}</pre>`)})),t.selection.setCursorLocation(),t.nodeChanged()):function(t,e){let n=t.selection.getNode();t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,(t=>`<pre class='codeblock'>${t.innerHTML.replace(/\n/gm,"<br>")}</pre>`)(n))})),n=t.selection.getNode(),t.focus(),t.selection.setCursorLocation(n,5),t.nodeChanged()}(t)}},i=function(t){return function(e){var n=function(t){e.setActive("PRE"===t.element.tagName)},r=function(e){"<pre></pre>"===e.content&&(e.preventDefault(),t.creatingCodeBlock=!0,o(t,void 0,"shortcut"))},i=function(e){console.log(e),t.creatingCodeBlock&&"mceInsertNewLine"===e.command&&(e.preventDefault(),t.creatingCodeBlock=!1)};return t.on("BeforeExecCommand",i),t.on("BeforeSetContent",r),t.on("NodeChange",n),function(){return t.off("BeforeExecCommand",i),t.off("BeforeSetContent",r),t.off("NodeChange",n)}}},r.add("mycode",(function(t){return function(t){t.addCommand("CodeBlock",(function(e){o(t,e)}))}(t),function(t){t.ui.registry.addToggleButton("code",{icon:"sourcecode",tooltip:"Code",onAction:function(e){return o(t,e)},onSetup:i(t)})}(t),{}}))},6586:(t,e,n)=>{n(9586)},9586:()=>{!function(){"use strict";tinymce.PluginManager.add("myimage",(function(t,e){function n(){var e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.onchange=function(){var e=this.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=function(){r(n.result,600,"image/jpeg",(e=>{var r=`<img src="${e}">`;t.insertContent(r),n.onerror=null}),.7),n.onerror=function(t){n.onerror=null}}},e.dispatchEvent(new MouseEvent("click"))}t.ui.registry.addButton("myimage",{icon:"image",tooltip:"Insert image",onAction:n});var r=function(t,e,n="image/jpeg",r,o=.7){var i,u,a,c,s,l;new Promise((function(e){(i=new Image).src=t,e("Done : ")})).then((t=>{u=i.width,a=i.height,c=Math.floor(a/u*e),(s=document.createElement("canvas")).width=e,s.height=c,s.getContext("2d").drawImage(i,0,0,e,c),l=s.toDataURL(n,o),r(l)}))};t.addCommand("InsertImage",(function(t,e){n()}))}))}()},5031:(t,e,n)=>{n(7814)},7814:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return function(e){return-1!==(" "+e.attr("class")+" ").indexOf(t)}},o=function(t,e,n){return function(r){var o=arguments,i=o[o.length-2],u=i>0?e.charAt(i-1):"";if('"'===u)return r;if(">"===u){var a=e.lastIndexOf("<",i);if(-1!==a){var c=e.substring(a,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+t.dom.encode(o[0])+'">'+t.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}};t.add("noneditable",(function(t){!function(t){var i="contenteditable",u=" "+e.trim(function(t){return t.getParam("noneditable_editable_class","mceEditable")}(t))+" ",a=" "+e.trim(n(t))+" ",c=r(u),s=r(a),l=function(t){var e=t.getParam("noneditable_regexp",[]);return e&&e.constructor===RegExp?[e]:e}(t);t.on("PreInit",(function(){l.length>0&&t.on("BeforeSetContent",(function(e){!function(t,e,r){var i=e.length,u=r.content;if("raw"!==r.format){for(;i--;)u=u.replace(e[i],o(t,u,n(t)));r.content=u}}(t,l,e)})),t.parser.addAttributeFilter("class",(function(t){for(var e,n=t.length;n--;)e=t[n],c(e)?e.attr(i,"true"):s(e)&&e.attr(i,"false")})),t.serializer.addAttributeFilter(i,(function(t){for(var e,n=t.length;n--;)e=t[n],(c(e)||s(e))&&(l.length>0&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(i,null))}))}))}(t)}))}()},2875:(t,e,n)=>{n(5103)},5103:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return!function(t){return null==t}(t)},m=("function",function(t){return"function"==typeof t}),g=Array.prototype.slice,h=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},p=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=m(Array.from)?Array.from:function(t){return g.call(t)},y=function(){var t=r(f.none());return{clear:function(){return t.set(f.none())},set:function(e){return t.set(f.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},w=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},x=tinymce.util.Tools.resolve("tinymce.Env"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=tinymce.util.Tools.resolve("tinymce.util.Promise"),k=tinymce.util.Tools.resolve("tinymce.util.VK"),O=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=function(t){return t.getParam("paste_data_images",!1)},E=function(t){return t.getParam("paste_merge_formats",!0)},A=function(t){return t.getParam("paste_retain_style_properties")},N=function(t){return t.getParam("validate")},R=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},M=function(t){return t.getParam("paste_data_images",!1,"boolean")},z=function(t){return T.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},D="\x3c!-- x-tinymce/html --\x3e",B=function(t){return-1!==t.indexOf(D)},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),I=tinymce.util.Tools.resolve("tinymce.html.DomParser"),L=tinymce.util.Tools.resolve("tinymce.html.Serializer"),H=" ",F=tinymce.util.Tools.resolve("tinymce.html.Node"),V=tinymce.util.Tools.resolve("tinymce.html.Schema");function j(t,e){return T.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t}function U(t){return j(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?H:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function W(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}function q(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),T.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e}function $(t){var e,n,r=1;function o(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e}function i(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0}function u(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{u(t)}while(t=t.next)}function a(t,o,a){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new F(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,u(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)}for(var c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){a(t,"ul");continue}if(q(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),a(t,"ol",m);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}function G(t,e,n,r){var o,i={},u=t.dom.parseStyle(r);return T.each(u,(function(u,a){switch(a){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(u)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":a="text-align";break;case"vert-align":a="vertical-align";break;case"font-color":case"mso-foreground":a="color";break;case"mso-background":case"mso-highlight":a="background";break;case"font-weight":case"font-style":return void("normal"!==u&&(i[a]=u));case"mso-element":if(/^(comment|comment-list)$/i.test(u))return void n.remove()}0!==a.indexOf("mso-comment")?0!==a.indexOf("mso-")&&("all"===A(t)||e&&e[a])&&(i[a]=u):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new F("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new F("i",1))),(i=t.dom.serializeStyle(i,n.name))||null}var X,K=function(t,e){return{content:t,cancelled:e}},Y=function(t,e){return t.insertContent(e,{merge:E(t),paste:!0}),!0},J=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},Q=function(t,e){return J(e)&&h(z(t),(function(t){return w(n=e,r="."+t,n.length-r.length);var n,r}))},Z=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!J(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},tt=function(t,e,n){return!!Q(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},et=function(t){return"\n"===t||"\r"===t},nt=function(t,e,n,r){var o=function(t,e,n){var r=W(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?function(t,e){var n,r=A(t);r&&(n=T.makeMap(r.split(/[, ]/))),e=j(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,H],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(H):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=V({valid_elements:o,valid_children:"-li[p]"});T.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var u=I({},i);u.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",G(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),u.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),u.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),u.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var a=u.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&$(a),L({validate:N(t)},i).serialize(a)}(t,e):e}(t,e):e;return function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=I({},t.schema);n.addNodeFilter("meta",(function(t){T.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return L({validate:N(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return K(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):K(i,o.isDefaultPrevented())}(t,o,n,r)}(t,e,n);!1===o.cancelled&&function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?Y(t,e):function(t,e){T.each([Z,tt,Y],(function(n){return!0!==n(t,e,Y)}))}(t,e)}(t,o.content,r)},rt=function(t,e,n){var r=n||B(e);nt(t,function(t){return t.replace(D,"")}(e),r,!1)},ot=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=T.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===u.length?u[0]:T.map(u,(function(t){return o+t+i})).join("")}(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(function(t,e){var n,r,o,i=(n=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(n+1).join(" "),u=e.replace(/\t/g,i);return(r=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===H?t.pcIsSpace||""===t.str||t.str.length===u.length-1||function(t,e){return e<t.length&&e>=0&&et(t[e])}(u,t.str.length+1)?{pcIsSpace:!1,str:t.str+H}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:et(e),str:t.str+e}},o={pcIsSpace:!1,str:""},v(u,(function(t){o=r(o,t)})),o).str}(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));nt(t,r,!1,!0)},it=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},ut=function(t,e){return e in t&&t[e].length>0},at=function(t){return ut(t,"text/html")||ut(t,"text/plain")},ct=("mceclip",X=0,function(){return"mceclip"+X++}),st=function(t,e,n){var r,o="paste"===e.type?e.clipboardData:e.dataTransfer;if(M(t)&&o){var i=function(t,e){var n=e.items?p(b(e.items),(function(t){return t.getAsFile()})):[],r=e.files?b(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,function(t){var e=z(t);return function(t){return n=t.type,w(n,"image/",0)&&h(e,(function(e){return n=e,r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(T.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}));var n}}(t))}(t,o);if(i.length>0)return e.preventDefault(),(r=i,S.all(p(r,(function(t){return new S((function(e){var n=function(t){return d(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))).then((function(e){n&&t.selection.setRng(n),v(e,(function(e){!function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,u=o.type,a=ct(),c=e.blob,s=new Image;if(s.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,s)){var l=t.editorUpload.blobCache,f=void 0,m=l.getByData(i,u);if(m)f=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&d(c.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return d(n)?t.dom.encode(n[1]):null}(t,c.name):a,p=g?c.name:void 0;f=l.create(a,c,i,h,p),l.add(f)}rt(t,'<img src="'+f.blobUri()+'">',!1)}else rt(t,'<img src="'+e.uri+'">',!1)}(t,e)}))})),!0}return!1},lt=function(t){return k.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},ft=function(t){return x.ie&&t.inline?document.body:t.getBody()},dt=function(t){return t.dom.get("mcepastebin")},mt=function(t,e){return e===t},gt=function(t,e){var n,r=dt(t);return(n=r)&&"mcepastebin"===n.id&&mt(e,r.innerHTML)},ht=function(t){var e=r(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(ft(t),"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"},n);(x.ie||x.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),function(t,e,n){(function(t){return ft(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){gt(t,n)||t.fire("paste")}))}(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(dt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return dt(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=T.grep(ft(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();T.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var u=t.dom.create("div");r.insertBefore(u,o[i]),e(u,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return gt(t,n)},isDefaultContent:function(t){return mt(n,t)}}},pt=function(t,e){var n=ht(t);return t.on("PreInit",(function(){return function(t,e,n){var r;(function(t,e,n){var r,o=y(),i=y();function u(t,n,r,o,i){var u;ut(n,"text/html")?u=n["text/html"]:(u=e.getHtml(),i=i||B(u),e.isDefaultContent(u)&&(o=!0)),u=U(u),e.remove();var a,c,s,l,f,d,m,g=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(u),h=Q(t,u);(!u.length||g&&!h)&&(o=!0),(o||h)&&(u=ut(n,"text/plain")&&g?n["text/plain"]:(a=u,c=V(),s=I({},c),l="",f=c.getShortEndedElements(),d=T.makeMap("script noscript style textarea video audio iframe object"," "),m=c.getBlockElements(),a=j(a,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(f[n]&&(l+=" "),d[n])l+=" ";else{if(3===e.type&&(l+=e.value),!e.shortEnded&&(e=e.firstChild))do{t(e)}while(e=e.next);m[n]&&r.next&&(l+="\n","p"===n&&(l+="\n"))}}else l+="\n"}(s.parse(a)),l)),e.isDefaultContent(u)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?ot(t,u):rt(t,u,i)}t.on("keyup",i.clear),t.on("keydown",(function(n){var u=function(t){lt(t)&&!t.isDefaultPrevented()&&e.remove()};if(lt(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&x.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),x.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:!0})}(t);e.remove(),e.create(),t.once("keyup",u),t.once("paste",(function(){t.off("keyup",u)}))}})),t.on("paste",(function(a){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return it(e.clipboardData||t.getDoc().dataTransfer)}(t,a),l="text"===n.get()||r,f=ut(s,"x-tinymce/html");r=!1,a.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(a)?e.remove():at(s)||!st(t,a,e.getLastRng()||t.selection.getRng())?(c||a.preventDefault(),!x.ie||c&&!a.ieFake||ut(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),ut(s,"text/html")?(a.preventDefault(),f||(f=B(s["text/html"])),u(t,s,c,l,f)):C.setEditorTimeout(t,(function(){u(t,s,c,l,f)}),0)):e.remove()}))})(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i,u=function(t){return 0===t.indexOf("webkit-fake-url")},a=function(t){return 0===t.indexOf("data:")};if(!M(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var c=e.length;c--;)(r=e[c].attr("src"))&&(u(r)||!R(t)&&a(r))&&((i=e[c]).attr("data-mce-object")||r===x.transparentSrc||i.remove())}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return rt(t,e,n)},pasteText:function(e){return ot(t,e)},pasteImageData:function(e,n){return st(t,e,n)},getDataTransferItems:it,hasHtmlOrText:at,hasContentType:ut}},vt=function(t,e,n,r){!function(t,e,n){if(!function(t){return!1===x.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData("x-tinymce/html",e),!0}catch(t){return!1}}(t.clipboardData,e.html,e.text)?n(e.html,r):(t.preventDefault(),r())},bt=function(t){return function(e,n){var r=function(t){return D+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var u=t.selection.getRng();i.focus();var a=t.dom.createRng();a.selectNodeContents(i),t.selection.setRng(a),C.setTimeout((function(){t.selection.setRng(u),o.parentNode.removeChild(o),n()}),0)}},yt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},wt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},xt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ct=function(t,e){return xt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},St=function(t,e){t.focus(),t.selection.setRng(e)};function kt(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))}function Ot(t,e){if(!W(e))return e;var n=[];return T.each(t.schema.getBlockElements(),(function(t,e){n.push(e)})),e=j(e,[[new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g"),"$1"]]),j(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Tt(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var u=t.dom,a=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=u.parseStyle(u.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=u.getStyle(a,o[s],!0);/color/.test(o[s])&&(l=u.toHex(l),f=u.toHex(f)),f!==l&&(c[o[s]]=l)}return(c=u.serializeStyle(c,"span"))?e+' style="'+c+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))}function _t(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))}var Et=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};o.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=r(!1),n=r(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),o=pt(t,n),i=function(t){x.webkit&&kt(t,Tt),x.ie&&(kt(t,Ot),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,_t))}(t);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)})}(t,o),function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),O(t,!1)):(e.pasteFormat.set("text"),O(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))}(t,o),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),function(t){t.on("cut",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){if(x.browser.isChrome()||x.browser.isFirefox()){var e=t.selection.getRng();C.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){}))}}(t))}(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),_(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ct(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,u=e.getDataTransferItems(r.dataTransfer),a=e.hasContentType(u,"x-tinymce/html");if((e.hasHtmlOrText(u)&&(!(i=u["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=u["mce-internal"]||u["text/html"]||u["text/plain"];c&&(r.preventDefault(),C.setEditorTimeout(t,(function(){t.undoManager.transact((function(){u["mce-internal"]&&t.execCommand("Delete"),St(t,o),c=U(c),u["text/html"]?e.pasteHtml(c,a):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){_(t)&&!1===n.get()&&(e.preventDefault(),St(t,Ct(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,o,e),function(t,e){return{clipboard:t,quirks:e}}(o,i)}}))}()},1295:(t,e,n)=>{n(6834)},6834:()=>{!function(){"use strict";var t,e,n,r,o,i=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},c=function(t){return function(){return t}},s=c(!1),l=c(!0),f=c("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),d=function(){return m},m=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:s,isSome:s,isNone:l,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:n,orThunk:e,map:d,each:function(){},bind:d,exists:s,forall:l,filter:d,equals:t,equals_:t,toArray:function(){return[]},toString:c("none()")}),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,(function(e){return n(t,e)}))}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=f,v=tinymce.util.Tools.resolve("tinymce.util.Tools"),b=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},y=function(t){return function(e){return typeof e===t}},w=b("string"),x=b("array"),C=y("boolean"),S=y("number"),k=Array.prototype.slice,O=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},_=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},E=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!x(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e}(T(t,e))},N=Object.hasOwnProperty,R=function(t,e){return N.call(t,e)},M=("undefined"!=typeof window?window:Function("return this;")(),3,function(t){return 3===function(t){return t.dom.nodeType}(t)}),z=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},D=z,B=function(t,e){return{element:t,offset:e}},P=function(t,e){(function(t,e){(function(t){return h.from(t.dom.parentNode).map(D)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))})(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},I=(r=M,"text",{get:function(t){if(!r(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o=function(t){return r(t)?h.from(t.dom.nodeValue):h.none()},set:function(t,e){if(!r(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}}),L=function(t){return I.get(t)},H=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),F=function(t,e){return t.isBlock(e)||R(t.schema.getShortEndedElements(),e.nodeName)},V=function(t,e){return"false"===t.getContentEditable(e)},j=function(t,e){return!t.isBlock(e)&&R(t.schema.getWhiteSpaceElements(),e.nodeName)},U=function(t,e){return function(t,e){var n=function(t){return T(t.dom.childNodes,D)}(t);return n.length>0&&e<n.length?B(n[e],0):B(t,e)}(D(t),e)},W=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var u=i?e(!1):n;u;){var a=V(t,u);if(a||j(t,u)){if(a?r.cef(u):r.boundary(u))break;u=e(!0)}else{if(F(t,u)){if(r.boundary(u))break}else 3===u.nodeType&&r.text(u);if(u===o)break;u=e(!1)}}},q=function(t,e,n,r,o){if(!function(t,e){return F(t,e)||V(t,e)||j(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),u=new H(n,i),a=o?u.next:u.prev;W(t,a,n,{boundary:l,cef:l,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(D(t))}})}},$=function(t,e,n,r,o,i){void 0===i&&(i=!0);var u=new H(n,e),a=[],c={sOffset:0,fOffset:0,elements:[]};q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(a.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return W(t,u.next,n,{boundary:s,cef:function(t){return s(),o&&a.push.apply(a,o.cef(t)),!1},text:function(t){c.elements.push(D(t)),o&&o.text(t,c)}},r,i),r&&q(t,c,r,e,!0),s(),a},G=function(t,e){var n=U(e.startContainer,e.startOffset),r=n.element.dom,o=U(e.endContainer,e.endOffset),i=o.element.dom;return $(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i;return n=A((i=D(e),function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),D)}("*[contenteditable=true]",i)),(function(e){var n=e.dom;return $(t,n,n)})),r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=k.call(n,0)).sort(r),o}},!1)},X=function(t,e){return e.collapsed?[]:G(t,e)},K=function(t,e){var n=t.createRng();return n.selectNode(e),X(t,n)},Y=function(t,e){return A(e,(function(e){var n=e.elements,r=T(n,L).join("");return function(t,e){var n,r,o;return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}((n=t,r=function(t,n){var r=L(n),o=t.last,i=o+r.length,u=A(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(u),last:i}},o={results:[],last:0},_(n,(function(t){o=r(o,t)})),o).results,(function(t){return t.matchId}))}(n,function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,u=[];i=o.exec(t);){var a=i[e.matchIndex],c=i.index+i[0].indexOf(a),s=c+a.length;if(s>r)break;u.push({start:c,finish:s}),o.lastIndex=s}return u}(r,t,e.sOffset,r.length-e.fOffset))}))},J=function(t,e){E(t,(function(t,n){E(t,(function(t){var r,o,i=D(e.cloneNode(!1));r="data-mce-index",o=n,function(t,e,n){if(!(w(n)||C(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(i.dom,r,o);var u=t.element.dom;if(u.length===t.finish&&0===t.start)P(t.element,i);else{u.length!==t.finish&&u.splitText(t.finish);var a=u.splitText(t.start);P(D(a),i)}}))}))},Q=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},Z=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return st(t,e,!1),r?function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),u=i.length>0?function(t,e){return A(e,(function(e){return K(t,e)}))}(t,i):X(t,n.getRng()),a=Y(e,u);return J(a,r),n.moveToBookmark(o),a.length}(t.dom,n,t.selection,o):function(t,e,n,r){var o=K(t,n),i=Y(e,o);return J(i,r),i.length}(t.dom,n,i,o)},tt=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},et=function(t,e){var n=[],r=v.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=Q(r[o]);null!==i&&i.length&&i===e.toString()&&n.push(r[o])}return n},nt=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(et(t,r.index),"mce-match-marker-selected");var u=et(t,o);return u.length?(i.addClass(et(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(u[0]),o):-1},rt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},ot=function(t,e,n,r,o,i){var u=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+p()+")"+n+"(?=$|\\s|"+p()+")":n}(n,o),a={regex:new RegExp(u,r?"g":"gi"),matchIndex:1},c=Z(t,e,a,i);if(c){var s=nt(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},it=function(t,e){var n=nt(t,e,!0);e.set(a(a({},e.get()),{index:n}))},ut=function(t,e){var n=nt(t,e,!1);e.set(a(a({},e.get()),{index:n}))},at=function(t){var e=Q(t);return null!==e&&e.length>0},ct=function(t,e,n,r,o){var i,u=e.get(),c=u.index,s=c;r=!1!==r;for(var l=t.getBody(),f=v.grep(v.toArray(l.getElementsByTagName("span")),at),d=0;d<f.length;d++){var m=Q(f[d]),g=i=parseInt(m,10);if(o||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,tt(f[d])):rt(t.dom,f[d]);f[++d];){if((g=parseInt(Q(f[d]),10))!==i){d--;break}rt(t.dom,f[d])}r&&s--}else i>c&&f[d].setAttribute("data-mce-index",String(i-1))}return e.set(a(a({},u),{count:o?0:u.count-1,index:s})),r?it(t,e):ut(t,e),!o&&e.get().count>0},st=function(t,e,n){var r,o,i,u=e.get(),c=v.toArray(t.getBody().getElementsByTagName("span"));for(r=0;r<c.length;r++){var s=Q(c[r]);null!==s&&s.length&&(s===u.index.toString()&&(o||(o=c[r].firstChild),i=c[r].firstChild),tt(c[r]))}if(e.set(a(a({},u),{index:-1,count:0,text:""})),o&&i){var l=t.dom.createRng();return l.setStart(o,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},lt=tinymce.util.Tools.resolve("tinymce.Env"),ft=function(t,e){var n,r=(n=i(h.none()),{clear:function(){return n.set(h.none())},set:function(t){return n.set(h.some(t))},isSet:function(){return n.get().isSome()},on:function(t){return n.get().each(t)}});t.undoManager.add();var o=v.trim(t.selection.getContent({format:"text"}));function u(t){(!function(t,e){return e.get().count>1}(0,e)?t.disable:t.enable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")}var c=function(t,e){var n=e?t.disable:t.enable;_(["replace","replaceall","prev","next"],n)},s=function(t,e){lt.browser.isSafari()&<.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},l=function(n){st(t,e,!1),c(n,!0),u(n)},f=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)it(t,e);else{var i=ot(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);i<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),c(n,0===i)}u(n)}else l(n)},d=e.get(),m={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:o,replacetext:"",wholewords:d.wholeWord,matchcase:d.matchCase,inselection:d.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&l(t)},onAction:function(n,r){var o=n.getData();switch(r.name){case"find":f(n);break;case"replace":ct(t,e,o.replacetext)?u(n):l(n);break;case"replaceall":ct(t,e,o.replacetext,!0,!0),l(n);break;case"prev":ut(t,e),u(n);break;case"next":it(t,e),u(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(a(a({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),l(n)}s(n,r.name)},onSubmit:function(t){f(t),s(t,"find")},onClose:function(){t.focus(),st(t,e),t.undoManager.add()}};r.set(t.windowManager.open(m,{inline:"toolbar"}))},dt=function(t,e){return function(){ft(t,e)}};u.add("searchreplace",(function(t){var e=i({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){ft(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:dt(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:dt(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",dt(t,e))}(t,e),function(t,e){return{done:function(n){return st(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),ot(t,e,n,r,o,i)},next:function(){return it(t,e)},prev:function(){return ut(t,e)},replace:function(n,r,o){return ct(t,e,n,r,o)}}}(t,e)}))}()},8619:(t,e,n)=>{n(2590)},2590:()=>{!function(){"use strict";var t=function(){},e=function(t){return function(){return t}},n=function(t){return t};function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var o,i,u,a=function(t){return function(e){return!t(e)}},c=e(!1),s=e(!0),l=function(){return f},f=(o=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:u=function(t){return t},getOrThunk:i=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:e(null),getOrUndefined:e(void 0),or:u,orThunk:i,map:l,each:t,bind:l,exists:c,forall:s,filter:l,equals:o,equals_:o,toArray:function(){return[]},toString:e("none()")}),d=function(t){var n=e(t),r=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(e){return d(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=function(t){return function(e){return typeof e===t}},p=g("string"),v=g("object"),b=g("array"),y=h("boolean"),w=(void 0,function(t){return undefined===t}),x=function(t){return!function(t){return null==t}(t)},C=h("function"),S=h("number"),k=Array.prototype.slice,O=Array.prototype.indexOf,T=Array.prototype.push,_=function(t,e){return function(t,e){return O.call(t,e)}(t,e)>-1},E=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},N=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},R=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},M=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},z=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},D=function(t,e,n){return R(t,(function(t){n=e(n,t)})),n},B=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,e,c)},P=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return m.some(n);return m.none()},I=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!b(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);T.apply(e,t[n])}return e},L=function(t,e){return I(N(t,e))},H=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},F=function(t){return[t]},V=function(t,e){return e>=0&&e<t.length?m.some(t[e]):m.none()},j=function(t){return V(t,t.length-1)},U=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return m.none()},W=function(){return(W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function q(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var $=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},G=function(){return X(0,0)},X=function(t,e){return{major:t,minor:e}},K=function(t,e){var n=String(e).toLowerCase();return 0===t.length?G():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return X(r(1),r(2))}(t,n)},Y=G,J=function(t,e){var n=String(e).toLowerCase();return B(t,(function(t){return t.search(n)}))},Q=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Z=function(t,e){return-1!==t.indexOf(e)},tt=function(t,e){return Q(t,e,0)},et=function(t,e){return Q(t,e,t.length-e.length)},nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),rt=function(t){return t.length>0},ot=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,it=function(t){return function(e){return Z(e,t)}},ut=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Z(t,"edge/")&&Z(t,"chrome")&&Z(t,"safari")&&Z(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ot],search:function(t){return Z(t,"chrome")&&!Z(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Z(t,"msie")||Z(t,"trident")}},{name:"Opera",versionRegexes:[ot,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:it("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:it("firefox")},{name:"Safari",versionRegexes:[ot,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Z(t,"safari")||Z(t,"mobile/"))&&Z(t,"applewebkit")}}],at=[{name:"Windows",search:it("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Z(t,"iphone")||Z(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:it("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:it("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:it("linux"),versionRegexes:[]},{name:"Solaris",search:it("sunos"),versionRegexes:[]},{name:"FreeBSD",search:it("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:it("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ct={browsers:e(ut),oses:e(at)},st="Edge",lt="Chrome",ft="Opera",dt="Firefox",mt="Safari",gt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(st),isChrome:r(lt),isIE:r("IE"),isOpera:r(ft),isFirefox:r(dt),isSafari:r(mt)}},ht=function(){return gt({current:void 0,version:Y()})},pt=gt,vt=(e(st),e(lt),e("IE"),e(ft),e(dt),e(mt),"Windows"),bt="Android",yt="Linux",wt="Solaris",xt="FreeBSD",Ct="ChromeOS",St=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r("iOS"),isAndroid:r(bt),isOSX:r("OSX"),isLinux:r(yt),isSolaris:r(wt),isFreeBSD:r(xt),isChromeOS:r(Ct)}},kt=function(){return St({current:void 0,version:Y()})},Ot=St,Tt=(e(vt),e("iOS"),e(bt),e(yt),e("OSX"),e(wt),e(xt),e(Ct),function(t,n){var r=ct.browsers(),o=ct.oses(),i=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ht,pt),u=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kt,Ot),a=function(t,n,r,o){var i=t.isiOS()&&!0===/ipad/i.test(r),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),d=!l&&!s&&!f;return{isiPad:e(i),isiPhone:e(u),isTablet:e(s),isPhone:e(l),isTouch:e(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:e(f),isDesktop:e(d)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}}),_t=function(t){return window.matchMedia(t).matches},Et=$((function(){return Tt(navigator.userAgent,_t)})),At=function(){return Et()},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Nt(n)},fromDom:Nt,fromPoint:function(t,e,n){return m.from(t.dom.elementFromPoint(e,n)).map(Nt)}},Mt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Dt=function(t,e){return t.dom===e.dom},Bt=function(t,e){return At().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Pt=Mt,It=Object.keys,Lt=Object.hasOwnProperty,Ht=function(t,e){for(var n=It(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ft=function(t,e){return Vt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Vt=function(t,e){var n={};return Ht(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},jt=function(e,n){var r={};return function(t,e,n,r){Ht(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r},Ut=function(t,e){return Wt(t,e)?m.from(t[e]):m.none()},Wt=function(t,e){return Lt.call(t,e)},qt=["tfoot","thead","tbody","colgroup"],$t=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Gt=function(t,e,n){return{element:t,cells:e,section:n}},Xt=function(t,e){return{element:t,isNew:e}},Kt=function(t,e){return{cells:t,section:e}},Yt=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),Jt=function(t){return t.dom.nodeType},Qt=function(t){return function(e){return Jt(e)===t}},Zt=function(t){return 8===Jt(t)||"#comment"===Yt(t)},te=Qt(1),ee=Qt(3),ne=Qt(9),re=Qt(11),oe=function(t){return Rt.fromDom(t.dom.ownerDocument)},ie=function(t){return ne(t)?t:oe(t)},ue=function(t){return m.from(t.dom.parentNode).map(Rt.fromDom)},ae=function(t,e){for(var n=C(e)?e:c,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Rt.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ce=function(t){return m.from(t.dom.previousSibling).map(Rt.fromDom)},se=function(t){return m.from(t.dom.nextSibling).map(Rt.fromDom)},le=function(t){return N(t.dom.childNodes,Rt.fromDom)},fe=function(t,e){var n=t.dom.childNodes;return m.from(n[e]).map(Rt.fromDom)},de=C(Element.prototype.attachShadow)&&C(Node.prototype.getRootNode),me=e(de),ge=de?function(t){return Rt.fromDom(t.dom.getRootNode())}:ie,he=function(t){return Rt.fromDom(t.dom.host)},pe=function(t){return x(t.dom.shadowRoot)},ve=function(t){var e=ee(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=ge(t);return re(e)?m.some(e):m.none()}(Rt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=ve,r=he,function(t){return n(r(t))}))},be=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Rt.fromDom(e)},ye=function(t,e){var n=[];return R(le(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(ye(t,e))})),n},we=function(t,e,n){return function(t,n,r){return M(ae(t,r),(function(t){return Mt(t,e)}))}(t,0,n)},xe=function(t,e){return function(t,n){return M(le(t),(function(t){return Mt(t,e)}))}(t)},Ce=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:N(n.querySelectorAll(t),Rt.fromDom)}(e,t)};function Se(t,e,n,r,o){return t(n,r)?m.some(n):C(o)&&o(n)?m.none():e(n,r,o)}var ke=function(t,e,n){for(var r=t.dom,o=C(n)?n:c;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(e(i))return m.some(i);if(o(i))break}return m.none()},Oe=function(t,e,n){return ke(t,(function(t){return Mt(t,e)}),n)},Te=function(t,e){return function(t,n){return B(t.dom.childNodes,(function(t){return n=Rt.fromDom(t),Mt(n,e);var n})).map(Rt.fromDom)}(t)},_e=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?m.none():m.from(n.querySelector(t)).map(Rt.fromDom)}(e,t)},Ee=function(t,e,n){return Se((function(t,e){return Mt(t,e)}),Oe,t,e,n)},Ae=function(t,e,n){if(!(p(n)||y(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ne=function(t,e,n){Ae(t.dom,e,n)},Re=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ae(n,e,t)}))},Me=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},ze=function(t,e){return m.from(Me(t,e))},De=function(t,e){t.dom.removeAttribute(e)},Be=function(t){return D(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Pe=function(t){return void 0!==t.style&&C(t.style.getPropertyValue)},Ie=function(t,e,n){if(!p(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Pe(t)&&t.style.setProperty(e,n)},Le=function(t,e,n){var r=t.dom;Ie(r,e,n)},He=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ie(n,e,t)}))},Fe=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||ve(t)?r:Ve(n,e)},Ve=function(t,e){return Pe(t)?t.style.getPropertyValue(e):""},je=function(t,e){var n=t.dom,r=Ve(n,e);return m.from(r).filter((function(t){return t.length>0}))},Ue=function(t,e){!function(t,e){Pe(t)&&t.style.removeProperty(e)}(t.dom,e),ze(t,"style").map(nt).is("")&&De(t,"style")},We=function(t,e,n){return void 0===n&&(n=0),ze(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},qe=function(t,e){return We(t,e,1)},$e=function(t){return qe(t,"colspan")>1},Ge=function(t){return qe(t,"rowspan")>1},Xe=function(t,e){return parseInt(Fe(t,e),10)},Ke=e(10),Ye=e(10),Je=function(t,e){return Qe(t,e,s)},Qe=function(t,e,n){return L(le(t),(function(t){return Mt(t,e)?n(t)?[t]:[]:Qe(t,e,n)}))},Ze=function(t,e){return function(t,e,n){return void 0===n&&(n=c),n(e)?m.none():_(t,Yt(e))?m.some(e):Oe(e,t.join(","),(function(t){return Mt(t,"table")||n(t)}))}(["td","th"],t,e)},tn=function(t){return Je(t,"th,td")},en=function(t){return Mt(t,"colgroup")?xe(t,"col"):L(on(t),(function(t){return xe(t,"col")}))},nn=function(t,e){return Ee(t,"table",e)},rn=function(t){return Je(t,"tr")},on=function(t){return nn(t).fold(e([]),(function(t){return xe(t,"colgroup")}))},un=function(t,e){return N(t,(function(t){if("colgroup"===Yt(t)){var n=N(en(t),(function(t){var e=We(t,"span",1);return $t(t,1,e)}));return Gt(t,n,"colgroup")}return n=N(tn(t),(function(t){var e=We(t,"rowspan",1),n=We(t,"colspan",1);return $t(t,e,n)})),Gt(t,n,e(t))}))},an=function(t){return ue(t).map((function(t){var e=Yt(t);return function(t){return _(qt,t)}(e)?e:"tbody"})).getOr("tbody")},cn=function(t){var e=rn(t),n=q(on(t),e);return un(n,an)},sn=function(t,e){return t+","+e},ln=function(t,e){var n=L(t.all,(function(t){return t.cells}));return M(n,e)},fn=function(t){var e={},n=[],r={},o=0,i=0,u=0;return R(t,(function(t){if("colgroup"===t.section)r=function(t){var e={},n=0;return R(t.cells,(function(t){var r=t.colspan;A(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);else{var a=[];R(t.cells,(function(t){for(var n=0;void 0!==e[sn(u,n)];)n++;for(var r=(f=t.element,d=t.rowspan,m=t.colspan,{element:f,rowspan:d,colspan:m,row:u,column:n}),o=0;o<t.colspan;o++)for(var c=0;c<t.rowspan;c++){var s=n+o,l=sn(u+c,s);e[l]=r,i=Math.max(i,s+1)}var f,d,m;a.push(r)})),o++,n.push(Gt(t.element,a,t.section)),u++}})),{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:r}},dn=function(t){var e=cn(t);return fn(e)},mn=fn,gn=function(t,e,n){var r=t.access[sn(e,n)];return void 0!==r?m.some(r):m.none()},hn=function(t,e,n){var r=ln(t,(function(t){return n(e,t.element)}));return r.length>0?m.some(r[0]):m.none()},pn=ln,vn=function(t){return L(t.all,(function(t){return t.cells}))},bn=function(t){return function(t,e){var n=[];return Ht(t,(function(t,e){n.push(t)})),n}(t.columns)},yn=function(t){return It(t.columns).length>0},wn=function(t,e){return m.from(t.columns[e])},xn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Cn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Sn=function(t,e,n){var r=hn(t,e,Dt),o=hn(t,n,Dt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,{startRow:Math.min(n.row,r.row),startCol:Math.min(n.column,r.column),finishRow:Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),finishCol:Math.max(n.column+n.colspan-1,r.column+r.colspan-1)};var n,r}))}))},kn=function(t,e,n){return Sn(t,e,n).map((function(e){var n=pn(t,r(xn,e));return N(n,(function(t){return t.element}))}))},On=function(t,e){return hn(t,e,(function(t,e){return Bt(e,t)})).map((function(t){return t.element}))},Tn=function(t,e,n){var r=En(t);return kn(r,e,n)},_n=function(t,e,n,r,o){var i=En(t),u=Dt(t,n)?m.some(e):On(i,e),a=Dt(t,o)?m.some(r):On(i,r);return u.bind((function(t){return a.bind((function(e){return kn(i,t,e)}))}))},En=dn,An=function(t,e){ue(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Nn=function(t,e){se(t).fold((function(){ue(t).each((function(t){Mn(t,e)}))}),(function(t){An(t,e)}))},Rn=function(t,e){(function(t){return fe(t,0)})(t).fold((function(){Mn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Mn=function(t,e){t.dom.appendChild(e.dom)},zn=function(t,e){An(t,e),Mn(e,t)},Dn=function(t,e){R(e,(function(n,r){var o=0===r?t:e[r-1];Nn(o,n)}))},Bn=function(t,e){R(e,(function(e){Mn(t,e)}))},Pn=function(t){t.dom.textContent="",R(le(t),(function(t){In(t)}))},In=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ln=function(t){var e,n=le(t);n.length>0&&(e=t,R(n,(function(t){An(e,t)}))),In(t)},Hn=function(t,e){var n=function(e){return t(e)?m.from(e.dom.nodeValue):m.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(ee),Fn=function(t){return Hn.get(t)},Vn=function(t){return Hn.getOption(t)},jn=function(t,e){return Hn.set(t,e)},Un=["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"];function Wn(){return{up:e({selector:Oe,closest:Ee,predicate:ke,all:ae}),down:e({selector:Ce,predicate:ye}),styles:e({get:Fe,getRaw:je,set:Le,remove:Ue}),attrs:e({get:Me,set:Ne,remove:De,copyTo:function(t,e){var n=Be(t);Re(e,n)}}),insert:e({before:An,after:Nn,afterAll:Dn,append:Mn,appendAll:Bn,prepend:Rn,wrap:zn}),remove:e({unwrap:Ln,remove:In}),create:e({nu:Rt.fromTag,clone:function(t){return Rt.fromDom(t.dom.cloneNode(!1))},text:Rt.fromText}),query:e({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ce,nextSibling:se}),property:e({children:le,name:Yt,parent:ue,document:function(t){return ie(t).dom},isText:ee,isComment:Zt,isElement:te,getText:Fn,setText:jn,isBoundary:function(t){return!!te(t)&&("body"===Yt(t)||_(Un,Yt(t)))},isEmptyTag:function(t){return!!te(t)&&_(["br","img","hr","input"],Yt(t))},isNonEditable:function(t){return te(t)&&"false"===Me(t,"contenteditable")}}),eq:Dt,is:Pt}}var qn=function(t,e,n,r){var o=e(t,n);return z(r,(function(n,r){var o=e(t,r);return $n(t,n,o)}),o)},$n=function(t,e,n){return e.bind((function(e){return n.filter(r(t.eq,e))}))},Gn=Wn(),Xn=function(t,e){return function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,qn):m.none()}(Gn,(function(e,n){return t(n)}),e)},Kn=function(t){return Oe(t,"table")},Yn=function(t,e,n){var o=function(t){return function(e){return void 0!==n&&n(e)||Dt(e,t)}};return Dt(t,e)?m.some({boxes:m.some([t]),start:t,finish:e}):Kn(t).bind((function(i){return Kn(e).bind((function(u){if(Dt(i,u))return m.some({boxes:Tn(i,t,e),start:t,finish:e});if(Bt(i,u)){var a=(s=we(e,"td,th",o(i))).length>0?s[s.length-1]:e;return m.some({boxes:_n(i,t,i,e,u),start:t,finish:a})}if(Bt(u,i)){var s,l=(s=we(t,"td,th",o(u))).length>0?s[s.length-1]:t;return m.some({boxes:_n(u,t,i,e,u),start:t,finish:l})}return function(t,e,n){return function(t,e,n,o){void 0===o&&(o=c);var i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return P(t,o).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},s=a(i),l=a(u),f=B(s,(function(e){return E(l,function(t,e){return r(t.eq,e)}(t,e))}));return{firstpath:s,secondpath:l,shared:f}}(Gn,t,e,void 0)}(t,e).shared.bind((function(r){return Ee(r,"table",n).bind((function(n){var r=we(e,"td,th",o(n)),a=r.length>0?r[r.length-1]:e,c=we(t,"td,th",o(n)),s=c.length>0?c[c.length-1]:t;return m.some({boxes:_n(n,t,i,e,u),start:s,finish:a})}))}))}))}))},Jn=function(t,e){var n=Ce(t,e);return n.length>0?m.some(n):m.none()},Qn=function(t,e,n){return _e(t,e).bind((function(e){return _e(t,n).bind((function(t){return Xn(Kn,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Zn=function(t,e,n,r,o){return function(t,e){return B(t,(function(t){return Mt(t,e)}))}(t,o).bind((function(t){return function(t,e,n){return nn(t).bind((function(r){return function(t,e,n,r){return hn(t,e,Dt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return gn(t,o+n,i+r).map((function(t){return t.element}))}))}(En(r),t,e,n)}))}(t,e,n).bind((function(t){return function(t,e){return Oe(t,"table").bind((function(n){return _e(n,e).bind((function(e){return Yn(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},tr=function(t,e){return Jn(t,e)},er=function(t,e,n){return Qn(t,e,n).bind((function(e){var n=function(e){return Dt(t,e)},o="thead,tfoot,tbody,table",i=Oe(e.first,o,n),u=Oe(e.last,o,n);return i.bind((function(t){return u.bind((function(n){return Dt(t,n)?function(t,e,n){return function(t,e,n){return Sn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,o=r(Cn,e),i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)n=n&&gn(t,i,u).exists(o);return n?m.some(e):m.none()}(t,e)}))}(En(t),e,n)}(e.table,e.first,e.last):m.none()}))}))}))},nr=function(t){if(!b(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return R(t,(function(r,o){var i=It(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!b(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=It(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!H(e,(function(t){return _(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},rr=nr([{none:[]},{multiple:["elements"]},{single:["element"]}]),or=function(t,e,n,r){return t.fold(e,n,r)},ir=rr.none,ur=rr.multiple,ar=rr.single,cr=tinymce.util.Tools.resolve("tinymce.PluginManager"),sr=function(t,e,n){var r=t[n].element,o=Rt.fromTag("td");Mn(o,Rt.fromTag("br")),(e?Mn:Rn)(r,o)},lr=function(t,e){var n=function(t){return Mt(t.element,e)},r=cn(t),o=mn(r),i=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0;return Ht(t.access,(function(t){if(e(t)){var n=t.row,a=n+t.rowspan-1,c=t.column,s=c+t.colspan-1;n<r?r=n:a>i&&(i=a),c<o?o=c:s>u&&(u=s)}})),function(t,e,n,r){return{minRow:t,minCol:e,maxRow:n,maxCol:r}}(r,o,i,u)}(o,n),u="th:not("+e+"),td:not("+e+")",a=Qe(t,"th,td",(function(t){return Mt(t,u)}));return R(a,In),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol||(gn(e,u,c).filter(r).isNone()?sr(t,a,u):a=!0)}(r,o,i,n),function(t,e){var n=M(Je(t,"tr"),(function(t){return 0===t.dom.childElementCount}));R(n,In),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||R(Je(t,"th,td"),(function(t){De(t,"rowspan"),De(t,"colspan")})),De(t,"width"),De(t,"height"),Ue(t,"width"),Ue(t,"height")}(t,i),t},fr=function(t){return"img"===Yt(t)?1:Vn(t).fold((function(){return le(t).length}),(function(t){return t.length}))},dr=["img","br"],mr=function(t){return Vn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||_(dr,Yt(t))},gr=function(t){return e=mr,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Rt.fromDom(t.childNodes[r]);if(e(o))return m.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return m.none()})(t.dom);var e,n},hr=function(t){return pr(t,mr)},pr=function(t,e){var n=function(t){for(var r=le(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return m.some(i);var u=n(i);if(u.isSome())return u}return m.none()};return n(t)},vr=function(t,e){return Rt.fromDom(t.dom.cloneNode(e))},br=function(t){return vr(t,!1)},yr=function(t){return vr(t,!0)},wr={scope:["row","col"]},xr=function(){var t=Rt.fromTag("td");return Mn(t,Rt.fromTag("br")),t},Cr=function(){return Rt.fromTag("col")},Sr=function(){return Rt.fromTag("colgroup")},kr=function(t,e,n){var r=function(t,e){var n=function(t,e){var n=Rt.fromTag(e),r=Be(t);return Re(n,r),n}(t,e),r=le(yr(t));return Bn(n,r),n}(t,e);return Ht(n,(function(t,e){null===t?De(r,e):Ne(r,e,t)})),r},Or=function(t){return t},Tr=function(t){return function(){return Rt.fromTag("tr",t.dom)}},_r=function(t,e,n){var r=function(t,e){var n,r,o;n=e,r=t.element.dom,o=n.dom,Pe(r)&&Pe(o)&&(o.style.cssText=r.style.cssText),Ue(e,"height"),1!==t.colspan&&Ue(t.element,"width")};return{col:function(e){var n=oe(e.element),o=Rt.fromTag(Yt(e.element),n.dom);return r(e,o),t(e.element,o),o},colgroup:Sr,row:Tr(e),cell:function(e){var o=oe(e.element),i=Rt.fromTag(Yt(e.element),o.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?function(t,e,n){return gr(t).map((function(r){var o=n.join(","),i=we(r,o,(function(e){return Dt(e,t)}));return z(i,(function(t,e){var n=br(e);return De(n,"contenteditable"),Mn(t,n),n}),e)})).getOr(e)}(e.element,i,u):i;return Mn(a,Rt.fromTag("br")),r(e,i),function(t,e){Ht(wr,(function(n,r){return ze(t,r).filter((function(t){return _(n,t)})).each((function(t){return Ne(e,r,t)}))}))}(e.element,i),t(e.element,i),i},replace:kr,gap:xr}},Er=function(t){return{col:Cr,colgroup:Sr,row:Tr(t),cell:xr,replace:Or,gap:xr}},Ar=function(t){return N(t,Rt.fromDom)},Nr=function(t){return or(t.get(),e([]),n,F)},Rr=function(t){var e=function(t,e){return ze(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Nr(t);return n.length>0&&H(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?m.some(n):m.none()},Mr=function(t,e,n){return or(e.get(),m.none,(function(e){return e.length<=1?m.none():er(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),m.none)},zr={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Dr=function(t){return{element:t,mergable:m.none(),unmergable:m.none(),selection:[t]}},Br=function(t,e,n){return{element:n,mergable:Mr(e,t,zr),unmergable:Rr(t),selection:Nr(t)}},Pr=nr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ir=W({},Pr),Lr=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e};function Hr(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Fe(n,t);return parseFloat(o)||0}return r},r=function(t,e){return D(e,(function(e,n){var r=Fe(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!S(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Pe(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var Fr,Vr,jr,Ur=Hr("width",(function(t){return t.dom.offsetWidth})),Wr=function(t){return Ur.get(t)},qr=function(t){return Ur.getOuter(t)},$r=function(t){var e=t.grid,r=A(e.columns,n),o=A(e.rows,n);return N(r,(function(e){return Gr((function(){return L(o,(function(n){return gn(t,n,e).filter((function(t){return t.column===e})).toArray()}))}),(function(t){return 1===t.colspan}),(function(){return gn(t,0,e)}))}))},Gr=function(t,e,n){var r=t();return B(r,e).orThunk((function(){return m.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Xr=function(t){var r=t.grid,o=A(r.rows,n),i=A(r.columns,n);return N(o,(function(n){return Gr((function(){return L(i,(function(r){return gn(t,n,r).filter((function(t){return t.row===n})).fold(e([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return gn(t,n,0)}))}))},Kr=function(t,e){return function(n){return"rtl"===Yr(n)?e:t}},Yr=function(t){return"rtl"===Fe(t,"direction")?"rtl":"ltr"},Jr=Hr("height",(function(t){var e=t.dom;return ve(t)?e.getBoundingClientRect().height:e.offsetHeight})),Qr=function(t){return Jr.get(t)},Zr=function(t){return Jr.getOuter(t)},to=function(t,e){return{left:t,top:e,translate:function(n,r){return to(t+n,e+r)}}},eo=to,no=function(t,e){return void 0!==t?t:void 0!==e?e:0},ro=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return eo(n.offsetLeft,n.offsetTop);var i=no(null==r?void 0:r.pageYOffset,o.scrollTop),u=no(null==r?void 0:r.pageXOffset,o.scrollLeft),a=no(o.clientTop,n.clientTop),c=no(o.clientLeft,n.clientLeft);return oo(t).translate(u-c,i-a)},oo=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?eo(n.offsetLeft,n.offsetTop):ve(t)?function(t){var e=t.getBoundingClientRect();return eo(e.left,e.top)}(e):eo(0,0)},io=function(t,e){return{row:t,y:e}},uo=function(t,e){return{col:t,x:e}},ao=function(t){return ro(t).left+qr(t)},co=function(t){return ro(t).left},so=function(t,e){return uo(t,co(e))},lo=function(t,e){return uo(t,ao(e))},fo=function(t){return ro(t).top},mo=function(t,e){return io(t,fo(e))},go=function(t,e){return io(t,fo(e)+Zr(e))},ho=function(t,e,n){if(0===n.length)return[];var r=N(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},po={delta:n,positions:function(t){return ho(mo,go,t)},edge:fo},vo=Kr({delta:n,edge:co,positions:function(t){return ho(so,lo,t)}},{delta:function(t){return-t},edge:ao,positions:function(t){return ho(lo,so,t)}}),bo={delta:function(t,e){return vo(e).delta(t,e)},positions:function(t,e){return vo(e).positions(t,e)},edge:function(t){return vo(t).edge(t)}},yo={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:[""]},wo=(Fr="[eE][+-]?[0-9]+",jr=["Infinity","[0-9]+\\."+(Vr=function(t){return"(?:"+t+")?"})("[0-9]+")+Vr(Fr),"\\.[0-9]+"+Vr(Fr),"[0-9]+"+Vr(Fr)].join("|"),new RegExp("^([+-]?(?:"+jr+"))(.*)$")),xo=function(){var t=At().browser;return t.isIE()||t.isEdge()},Co=function(t,e,n){return function(t,e){var n=parseFloat(t);return isNaN(n)?e:n}(Fe(t,e),n)},So=function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().width;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-left",0)-Co(t,"padding-right",0)-(Co(t,"border-left-width",0)+Co(t,"border-right-width",0))}(t):Co(t,"width",Wr(t))},ko=/(\d+(\.\d+)?)%/,Oo=/(\d+(\.\d+)?)px|em/,To=function(t,e){Le(t,"width",e+"px")},_o=function(t,e){Le(t,"width",e+"%")},Eo=function(t,e){Le(t,"height",e+"px")},Ao=function(t){var e=function(t){return je(t,"height").getOrThunk((function(){return function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().height;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-top",0)-Co(t,"padding-bottom",0)-(Co(t,"border-top-width",0)+Co(t,"border-bottom-width",0))}(t):Co(t,"height",Qr(t))}(t)+"px"}))}(t);return e?function(t,e,n,r){var o=parseInt(t,10);return et(t,"%")&&"table"!==Yt(e)?function(t,e,n,r){var o=nn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o}(e,t,Qr,Eo):Qr(t)},No=function(t){return je(t,"width").fold((function(){return m.from(Me(t,"width"))}),(function(t){return m.some(t)}))},Ro=function(t,e){return t/e.pixelWidth()*100},Mo=function(t,e){return No(t).fold((function(){var n=Wr(t);return Ro(n,e)}),(function(n){return function(t,e,n){var r=ko.exec(e);if(null!==r)return parseFloat(r[1]);var o=So(t);return Ro(o,n)}(t,n,e)}))},zo=function(t,e){return No(t).fold((function(){return So(t)}),(function(n){return function(t,e,n){var r=Oo.exec(e);if(null!==r)return parseInt(r[1],10);var o=ko.exec(e);return null!==o?function(t,e){return t/100*e.pixelWidth()}(parseFloat(o[1]),n):So(t)}(t,n,e)}))},Do=function(t){return function(t,e,n){return n(t)/qe(t,"rowspan")}(t,0,Ao)},Bo=function(t,e,n){Le(t,"width",e+n)},Po=function(t){return n=Wr,o=(r=e=t,m.from(r.dom.offsetParent).map(Rt.fromDom)).getOr(be(oe(e))),n(e)/n(o)*100+"%";var e,n,r,o},Io=e(ko),Lo=e(Oo),Ho=("col",function(t){return te(t)&&"col"===Yt(t)}),Fo=function(t,e,n){return je(t,e).fold((function(){return n(t)+"px"}),(function(t){return t}))},Vo=function(t,e){return Fo(t,"width",(function(t){return Ho(t)?Wr(t):zo(t,e)}))},jo=function(t){return Fo(t,"height",Do)},Uo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(function(t,e){if(e<0||e>=t.length-1)return m.none();var n=t[e].fold((function(){var n=function(t){var e=k.call(t,0);return e.reverse(),e}(t.slice(0,e));return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))}(n,e))}),(function(t){return o(t)}))},Wo=function(t,e,r,o,i){var u=$r(t),c=yn(t)?function(t){return N(bn(t),(function(t){return m.from(t.element)}))}(t):u,s=[m.some(bo.edge(e))].concat(N(bo.positions(u,e),(function(t){return t.map((function(t){return t.x}))}))),l=a($e);return N(c,(function(t,e){return Uo(t,e,s,l,(function(t){if(function(t){return!Ho(t)||je(t,"width").isSome()}(t))return r(t,i);var a,c=null!=(a=u[e])?n(a):m.none();return Uo(c,e,s,l,(function(t){return o(m.some(Wr(t)))}),o)}),o)}))},qo=function(t){return t.map((function(t){return t+"px"})).getOr("")},$o=function(t,e,n){return Wo(t,e,zo,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Go=function(t,e,n,r,o){var i=Xr(t),u=[m.some(n.edge(e))].concat(N(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return N(i,(function(t,e){return Uo(t,e,u,a(Ge),r,o)}))},Xo=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ko=function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Yo=function(t,e,n){var r=function(t,e){return yn(t)?function(t,e){var n=bn(t);return N(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)}(t,e);R(r,(function(t){n.setElementWidth(t.element,t.width)}))},Jo=function(t,n,r,o,i){var u=dn(t),a=i.getCellDelta(n),c=i.getWidths(u,i),s=r===u.grid.columns-1,l=o.clampTableDelta(c,r,a,i.minCellWidth(),s),f=function(t,n,r,o,i){var u=t.slice(0),a=function(t,e){return 0===t.length?Ir.none():1===t.length?Ir.only(0):0===e?Ir.left(0,1):e===t.length-1?Ir.right(e-1,e):e>0&&e<t.length-1?Ir.middle(e-1,e,e+1):Ir.none()}(t,n),c=e(N(u,e(0)));return a.fold(c,(function(t){return o.singleColumnWidth(u[t],r)}),(function(t,e){return i.calcLeftEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}),(function(t,e,n){return i.calcMiddleDeltas(u,t,e,n,r,o.minCellWidth(),o.isRelative)}),(function(t,e){return i.calcRightEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}))}(c,r,l,i,o),d=N(f,(function(t,e){return t+c[e]}));Yo(u,d,i),o.resizeTable(i.adjustTableWidth,l,s)},Qo=function(t){return N(t,e(0))},Zo=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},ti=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},ei=ti((function(t){return t<0})),ni=ti(s),ri=function(t,n){var r=m.from(t.dom.documentElement).map(Rt.fromDom).getOr(t);return{parent:e(r),view:e(t),origin:e(eo(0,0)),isResizable:n}},oi=nr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),ii=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):oi.invalid(n)},ui=W(W({},oi),{from:function(t){return et(t,"%")?ii("%",oi.percent,t):et(t,"px")?ii("px",oi.pixels,t):oi.invalid(t)}}),ai=function(t,n,r){var o=ui.from(r),i=H(t,(function(t){return"0px"===t}))?function(t,n){var r=t.fold((function(){return e("")}),(function(t){return e(t/n+"px")}),(function(){return e(100/n+"%")}));return A(n,r)}(o,t.length):function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))}(o,t,n);return li(i)},ci=function(t,r){return 0===t.length?r:z(t,(function(t,r){return ui.from(r).fold(e(0),n,n)+t}),0)},si=function(t,n){return ui.from(t).fold(e(t),(function(t){return t+n+"px"}),(function(t){return t+n+"%"}))},li=function(t){if(0===t.length)return t;var e=z(t,(function(t,e){var n=ui.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+"px",remainder:t-n}}(t)}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([si(n[n.length-1],Math.round(e.remainder))])},fi=ui.from,di=function(t){return fi(t).fold(e("px"),e("px"),e("%"))},mi=function(t,e,n,r){var o=dn(t),i=o.all,u=vn(o),a=bn(o);e.each((function(e){var n=di(e),i=Wr(t),c=function(t,e,n){return Wo(t,e,Vo,qo,n)}(o,t,r),s=ai(c,i,e);yn(o)?function(t,e,n){R(e,(function(e,r){var o=ci([t[r]],Ke());Le(e.element,"width",o+n)}))}(s,a,n):function(t,e,n){R(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=ci(r,Ke());Le(e.element,"width",o+n)}))}(s,u,n),Le(t,"width",e)})),n.each((function(e){var n=di(e),r=Qr(t),a=function(t,e,n){return Go(t,e,n,jo,qo)}(o,t,po);!function(t,e,n,r){R(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=ci(n,Ye());Le(e.element,"height",o+r)})),R(e,(function(e,n){Le(e.element,"height",t[n])}))}(ai(a,r,e),i,u,n),Le(t,"height",e)}))},gi=function(t){return No(t).exists((function(t){return ko.test(t)}))},hi=function(t){return No(t).exists((function(t){return Oo.test(t)}))},pi=function(t){return No(t).isNone()},vi=Po,bi=function(t){return dn(t).grid},yi=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=M(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};R(t,(function(t,e){o[t]=n[e]})),R(e,(function(t){t(o)}))}}},wi=function(t){return{registry:Ft(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Ft(t,(function(t){return t.trigger}))}},xi=function(t){return t.slice(0).sort()},Ci=function(t,e){var n=M(e,(function(e){return!_(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+xi(t).join(", "))}(n)},Si=function(t){return function(t,e){return function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var r;return function(t,e){if(!b(e))throw new Error("The required fields must be an array. Was: "+e+".");R(e,(function(e){if(!p(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),r=xi(e),B(r,(function(t,e){return e<r.length-1&&t===r[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+r.join(", ")+"].")})),function(r){var o=It(r);H(e,(function(t){return _(o,t)}))||function(t,e){throw new Error("All required keys ("+xi(t).join(", ")+") were not specified. Specified keys were: "+xi(e).join(", ")+".")}(e,o),t(e,o);var i=M(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+xi(t).join(", ")+") were not.")}(i,n.label),r}}(t,e,{validate:C,label:"function"})}(Ci,t)},ki=Si(["compare","extract","mutate","sink"]),Oi=Si(["element","start","stop","destroy"]),Ti=Si(["forceDrop","drop","move","delayDrop"]);function _i(){var e,n,r={onEvent:t,reset:t},o=(e=m.none(),{onEvent:function(t,r){r.extract(t).each((function(t){(function(t,n){var r=e.map((function(e){return t.compare(e,n)}));return e=m.some(n),r})(r,t).each((function(t){n.trigger.move(t)}))}))},reset:function(){e=m.none()},events:(n=wi({move:yi(["info"])})).registry}),i=r;return{on:function(){i.reset(),i=o},off:function(){i.reset(),i=r},isOn:function(){return i===o},onEvent:function(t,e){i.onEvent(t,e)},events:o.events}}var Ei=function(t){var e,n,r=Rt.fromDom(function(t){if(me()&&x(t.target)){var e=Rt.fromDom(t.target);if(te(e)&&pe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return V(n,0)}}return m.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Ai=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ni=s,Ri=function(t,e,n){return function(t,e,n,o){return function(t,e,n,o,i){var u=function(t,e){return function(n){t(n)&&e(Ei(n))}}(n,o);return t.dom.addEventListener(e,u,i),{unbind:r(Ai,t,e,u,i)}}(t,e,n,o,!1)}(t,e,Ni,n)},Mi=Ei,zi=function(t){return void 0!==t.dom.classList},Di=function(t,e){return function(t,e,n){var r=function(t,e){var n=Me(t,e);return void 0===n||""===n?[]:n.split(" ")}(t,e).concat([n]);return Ne(t,e,r.join(" ")),!0}(t,"class",e)},Bi=function(t,e){zi(t)?t.dom.classList.add(e):Di(t,e)},Pi=function(t,e){return zi(t)&&t.dom.classList.contains(e)},Ii=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Li=Ii("ephox-dragster"),Hi=Li.resolve,Fi=ki({compare:function(t,e){return eo(e.left-t.left,e.top-t.top)},extract:function(t){return m.some(eo(t.x,t.y))},sink:function(t,e){var n=function(t){var e=W({layerClass:Hi("blocker")},t),n=Rt.fromTag("div");return Ne(n,"role","presentation"),He(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Bi(n,Hi("blocker")),Bi(n,e.layerClass),{element:function(){return n},destroy:function(){In(n)}}}(e),r=Ri(n.element(),"mousedown",t.forceDrop),o=Ri(n.element(),"mouseup",t.drop),i=Ri(n.element(),"mousemove",t.move),u=Ri(n.element(),"mouseout",t.delayDrop);return Oi({element:n.element,start:function(t){Mn(t,n.element())},stop:function(){In(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Vi=function(t){return"true"===Me(t,"contenteditable")},ji=Ii("ephox-snooker"),Ui=ji.resolve,Wi=Ui("resizer-bar"),qi=Ui("resizer-rows"),$i=Ui("resizer-cols"),Gi=function(t){var e=Ce(t.parent(),"."+Wi);R(e,In)},Xi=function(t,e,n){var r=t.origin();R(e,(function(e){e.each((function(e){var o=n(r,e);Bi(o,Wi),Mn(t.parent(),o)}))}))},Ki=function(t,e,n,r,o){var i=ro(n),u=e.isResizable,a=r.length>0?po.positions(r,n):[],c=a.length>0?function(t,e){return L(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Rt.fromTag("div");return He(i,{position:"absolute",left:e+"px",top:n-3.5+"px",height:"7px",width:r+"px"}),Re(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r);return Bi(o,qi),o}))}(e,M(a,(function(t,e){return E(c,(function(t){return e===t}))})),i,qr(n));var s=o.length>0?bo.positions(o,n):[],l=s.length>0?function(t,e){var n=[];return A(t.grid.columns,(function(r){wn(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),M(n,(function(n){var r=pn(t,(function(t){return t.column===n}));return H(r,(function(t){return e(t.element)}))}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o,i,u,a,c,s=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=r,c=Rt.fromTag("div"),He(c,{position:"absolute",left:i-3.5+"px",top:u+"px",height:a+"px",width:"7px"}),Re(c,{"data-column":o,role:"presentation"}),c);return Bi(s,$i),s}))}(e,M(s,(function(t,e){return E(l,(function(t){return e===t}))})),i,Zr(n))},Yi=function(t,e){if(Gi(t),t.isResizable(e)){var n=dn(e),r=Xr(n),o=$r(n);Ki(n,t,e,r,o)}},Ji=function(t,e){var n=Ce(t.parent(),"."+Wi);R(n,e)},Qi=function(t){Ji(t,(function(t){Le(t,"display","none")}))},Zi=function(t){Ji(t,(function(t){Le(t,"display","block")}))},tu=Ui("resizer-bar-dragging"),eu=function(t){var e=function(){var t=wi({drag:yi(["xDelta","yDelta","target"])}),e=m.none(),n=function(){var t=wi({drag:yi(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();return n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))})),{assign:function(t){e=m.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}}(),n=function(t,e){return void 0===e&&(e={}),function(t,e,n){var r,o,i=!1,u=wi({start:yi([]),stop:yi([])}),a=_i(),c=function(){f.stop(),a.isOn()&&(a.off(),u.trigger.stop())},s=(r=c,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout((function(){r.apply(null,t),o=null}),200)}});a.events.move.bind((function(n){e.mutate(t,n.info)}));var l=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i&&t.apply(null,e)}},f=e.sink(Ti({forceDrop:c,drop:l(c),move:l((function(t){s.cancel(),a.onEvent(t,e)})),delayDrop:l(s.throttle)}),n);return{element:f.element,go:function(t){f.start(t),a.on(),u.trigger.start()},on:function(){i=!0},off:function(){i=!1},destroy:function(){f.destroy()},events:u.registry}}(t,void 0!==e.mode?e.mode:Fi,e)}(e,{}),o=m.none(),i=function(t,e){return m.from(Me(t,e))};e.events.drag.bind((function(t){i(t.target,"data-row").each((function(e){var n=Xe(t.target,"top");Le(t.target,"top",n+t.yDelta+"px")})),i(t.target,"data-column").each((function(e){var n=Xe(t.target,"left");Le(t.target,"left",n+t.xDelta+"px")}))}));var u=function(t,e){return Xe(t,e)-We(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){o.each((function(n){i(e,"data-row").each((function(t){var r=u(e,"top");De(e,"data-initial-top"),f.trigger.adjustHeight(n,r,parseInt(t,10))})),i(e,"data-column").each((function(t){var r=u(e,"left");De(e,"data-initial-left"),f.trigger.adjustWidth(n,r,parseInt(t,10))})),Yi(t,n)}))}))}));var a=function(r,o){f.trigger.startAdjust(),e.assign(r),Ne(r,"data-initial-"+o,Xe(r,o)),Bi(r,tu),Le(r,"opacity","0.2"),n.go(t.parent())},c=Ri(t.parent(),"mousedown",(function(t){var e;e=t.target,Pi(e,qi)&&a(t.target,"top"),function(t){return Pi(t,$i)}(t.target)&&a(t.target,"left")})),s=function(e){return Dt(e,t.view())},l=Ri(t.view(),"mouseover",(function(e){var n;(n=e.target,Ee(n,"table",s).filter((function(t){return function(t,e){return Ee(t,"[contenteditable]",e)}(t,s).exists(Vi)}))).fold((function(){ve(e.target)&&Gi(t)}),(function(e){o=m.some(e),Yi(t,e)}))})),f=wi({adjustHeight:yi(["table","delta","row"]),adjustWidth:yi(["table","delta","column"]),startAdjust:yi([])});return{destroy:function(){c.unbind(),l.unbind(),n.destroy(),Gi(t)},refresh:function(e){Yi(t,e)},on:n.on,off:n.off,hideBars:r(Qi,t),showBars:r(Zi,t),events:f.registry}},nu=function(t,e,n){var r=po,o=bo,i=eu(t),u=wi({beforeResize:yi(["table","type"]),afterResize:yi(["table","type"]),startDrag:yi([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row"),function(t,e,n,r){var o=dn(t),i=function(t,e,n){return Go(t,e,n,Do,(function(t){return t.getOrThunk(Ye)}))}(o,t,r),u=N(i,(function(t,r){return n===r?Math.max(e+t,Ye()):t})),a=Ko(o,u),c=function(t,e){return N(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);R(c,(function(t){Eo(t.element,t.height)})),R(a,(function(t){Eo(t.element,t.height)}));var s=z(u,(function(t,e){return t+e}),0);Eo(t,s)}(e,r.delta(t.delta,e),t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Jo(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},ru=function(t,e){return t.fire("newrow",{node:e})},ou=function(t,e){return t.fire("newcell",{node:e})},iu=function(t,e,n){t.fire("TableModified",W(W({},n),{table:e}))},uu={"border-collapse":"collapse",width:"100%"},au={border:"1"},cu="preservetable",su=function(t){return t.getParam("table_sizing_mode","auto")},lu=function(t){return t.getParam("table_responsive_width")},fu=function(t){return t.getParam("table_default_attributes",au,"object")},du=function(t){return t.getParam("table_default_styles",function(t){if(bu(t)){var e=t.getBody().offsetWidth;return W(W({},uu),{width:e+"px"})}return yu(t)?jt(uu,(function(t,e){return"width"!==e})):uu}(t),"object")},mu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},gu=function(t){return t.getParam("table_row_advtab",!0,"boolean")},hu=function(t){return t.getParam("table_advtab",!0,"boolean")},pu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},vu=function(t){return"relative"===su(t)||!0===lu(t)},bu=function(t){return"fixed"===su(t)||!1===lu(t)},yu=function(t){return"responsive"===su(t)},wu=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},xu=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return _(["section","cells","sectionCells","auto"],n)?n:e},Cu=function(t){var e=t.getParam("table_column_resizing",cu,"string");return B(["preservetable","resizetable"],(function(t){return t===e})).getOr(cu)},Su=function(t){return"preservetable"===Cu(t)},ku=function(t){var e=t.getParam("table_clone_elements");return p(e)?m.some(e.split(/[ ,]/)):Array.isArray(e)?m.some(e):m.none()},Ou=function(t){return t.nodeName.toLowerCase()},Tu=function(t){return Rt.fromDom(t.getBody())},_u=function(t){return t.getBoundingClientRect().width},Eu=function(t){return t.getBoundingClientRect().height},Au=function(t){return function(e){return Dt(e,Tu(t))}},Nu=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Ru=function(t){De(t,"data-mce-style");var e=function(t){return De(t,"data-mce-style")};R(tn(t),e),R(en(t),e)},Mu=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return m.from(n).filter(rt)},zu=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},Du=function(t){return Rt.fromDom(t.selection.getStart())},Bu=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Pu=function(t,e){var n=Bu(parseFloat(t)),r=Bu(Wr(e));return{width:n.get,pixelWidth:r.get,getWidths:function(t,n){return function(t,e,n){return Wo(t,e,Mo,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)}(t,e,n)},getCellDelta:function(t){return t/r.get()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Ke()/r.get()*100},setElementWidth:_o,adjustTableWidth:function(t){var o=n.get(),i=o+t/100*o;_o(e,i),n.set(i),r.set(Wr(e))},isRelative:!0,label:"percent"}},Iu=function(t,e){var r=Bu(t),o=r.get;return{width:o,pixelWidth:o,getWidths:function(t,n){return $o(t,e,n)},getCellDelta:n,singleColumnWidth:function(t,e){return[Math.max(Ke(),t+e)-t]},minCellWidth:Ke,setElementWidth:To,adjustTableWidth:function(t){var n=o()+t;To(e,n),r.set(n)},isRelative:!1,label:"pixel"}},Lu=function(n){return No(n).fold((function(){return function(n){var r=function(){return Wr(n)},o=e(0);return{width:r,pixelWidth:r,getWidths:function(t,e){return $o(t,n,e)},getCellDelta:o,singleColumnWidth:e([0]),minCellWidth:o,setElementWidth:t,adjustTableWidth:t,isRelative:!0,label:"none"}}(n)}),(function(t){return function(t,e){var n=Io().exec(e);if(null!==n)return Pu(n[1],t);var r=Lo().exec(e);if(null!==r){var o=parseInt(r[1],10);return Iu(o,t)}var i=Wr(t);return Iu(i,t)}(n,t)}))},Hu=Iu,Fu=Pu,Vu=function(t,e){if(vu(t)){var n=Mu(t,e.dom).filter(zu).getOrThunk((function(){return vi(e)}));return Fu(n,e)}return bu(t)?Hu(Wr(e),e):Lu(e)},ju=function(t){De(t,"width")},Uu=function(t,e){!function(t,e){var n=Po(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},Wu=function(t,e){!function(t,e){var n=function(t){return Wr(t)+"px"}(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},qu=function(t){Ue(t,"width");var e=en(t),n=e.length>0?e:tn(t);R(n,(function(t){Ue(t,"width"),ju(t)})),ju(t)},$u="bar-",Gu=function(t){return"false"!==Me(t,"data-mce-resize")},Xu=function(t){var n,r,o=m.none(),i=m.none(),u=m.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Vu(t,e)},l=function(){return Su(t)?{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=D(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ei(t,e,n,r)},calcLeftEdgeDeltas:n=function(t,e,n,r,o){var i=ni(t,r>=0?n:e,r,o);return Zo(t,e,n+1,[i,-i],Qo)},calcMiddleDeltas:function(t,e,r,o,i,u){return n(t,r,o,i,u)},calcRightEdgeDeltas:function(t,n,r,o,i,u){if(u)return Qo(t);var a=o/t.length;return N(t,e(a))}}:function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return N(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=ei(t,e,r,o);return Zo(t,e,n+1,[i,0],Qo)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ei,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=ei(e,r,o,i);return Qo(e.slice(0,r)).concat([a])}}}();var n};return t.on("init",(function(){var n=function(t,n){return t.inline?function(t,n,r){return{parent:e(n),view:e(t),origin:e(eo(0,0)),isResizable:r}}(Tu(t),(r=Rt.fromTag("div"),He(r,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Mn(be(Rt.fromDom(document)),r),r),n):ri(Rt.fromDom(t.getDoc()),n);var r}(t,Gu);if(u=m.some(n),function(t){var e=t.getParam("object_resizing",!0);return p(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var r=l(),a=nu(n,r,s);a.on(),a.events.startDrag.bind((function(e){o=m.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,_u(n),Eu(n),$u+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Ru(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,_u(r),Eu(r),$u+e.type),t.undoManager.add()})),i=m.some(a)}})),t.on("ObjectResizeStart",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o);R(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Cu(t)+"-columns")})),!hi(i)&&bu(t)?Wu(t,i):!gi(i)&&vu(t)&&Uu(t,i),pi(i)&&tt(e.origin,$u)&&Uu(t,i),n=e.width,r=yu(t)?"":Mu(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o),u=e.origin;tt(u,"corner-")&&function(e,o,i){var u=et(o,"e");if(""===r&&Uu(t,e),i!==n&&""!==r){Le(e,"width",r);var a=l(),c=s(e),f=Su(t)||u?function(t){return bi(t).columns}(e)-1:0;Jo(e,i-n,f,a,c)}else if(zu(r)){var d=parseFloat(r.replace("%",""));Le(e,"width",i*d/n+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(r)&&function(t){var e=dn(t);yn(e)||R(tn(t),(function(t){var e=Fe(t,"width");Le(t,"width",e),De(t,"width")}))}(e)}(i,u,e.width),Ru(i),iu(t,i.dom)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr(ri(Rt.fromDom(t.getBody()),Gu))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&In(e.parent())}(t,e)}))}}},Ku=function(t,e){return{element:t,offset:e}},Yu=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return Yu(t,e,n).orThunk((function(){return m.some(e)}))})):m.none()},Ju=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},Qu=function(t,e){var n=Yu(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return Ku(n,Ju(t,n));var r=t.property().children(n);return r.length>0?Qu(t,r[r.length-1]):Ku(n,Ju(t,n))},Zu=Qu,ta=Wn(),ea=function(t,e){(function(t){return No(t).bind((function(t){return e=t,n=["fixed","relative","empty"],m.from(wo.exec(e)).bind((function(t){var e=Number(t[1]),r=t[2];return function(t,e){return E(e,(function(e){return E(yo[e],(function(e){return t===e}))}))}(r,n)?m.some({value:e,unit:r}):m.none()}));var e,n}))})(t).each((function(n){var r=n.value/2;Bo(t,r,n.unit),Bo(e,r,n.unit)}))},na=function(t,e,n){t.cells[e]=n},ra=function(t,e){return Kt(e,t.section)},oa=function(t,e){var n=t.cells,r=N(n,e);return Kt(r,t.section)},ia=function(t,e){return t.cells[e]},ua=function(t,e){return ia(t,e).element},aa=function(t){return t.cells.length},ca=function(t){var e=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(a=u,"colgroup"===a.section?n:r).push(u)}var a;return{pass:n,fail:r}}(t);return{rows:e.fail,cols:e.pass}},sa=function(t,e,n,r){n===r?De(t,e):Ne(t,e,n)},la=function(t,e,n){j(xe(t,e)).fold((function(){return Rn(t,n)}),(function(t){return Nn(t,n)}))},fa=function(t,e){var n=[],r=[],o=function(t){return N(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return Pn(e),R(t.cells,(function(t){t.isNew&&r.push(t.element),sa(t.element,"colspan",t.colspan,1),sa(t.element,"rowspan",t.rowspan,1),Mn(e,t.element)})),e}))},i=function(t){return L(t,(function(t){return N(t.cells,(function(t){return sa(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Te(t,e).getOrThunk((function(){var n=Rt.fromTag(e,oe(t).dom);return"thead"===e?la(t,"caption,colgroup",n):"colgroup"===e?la(t,"caption",n):Mn(t,n),n}));return Pn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Bn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Te(t,e).each(In)}(n)},c=[],s=[],l=[],f=[];return R(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},da=function(t,e){if(0===t.length)return 0;var n=t[0];return P(t,(function(t){return!e(n.element,t.element)})).fold((function(){return t.length}),(function(t){return t}))},ma=function(t,e){var n=N(t,(function(t){return N(t.cells,c)}));return N(t,(function(r,o){return i=L(r.cells,(function(r,i){if(!1===n[o][i]){var u=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e).cells.slice(n),i=da(o,r),u=function(t,e){return N(t,(function(t){return ia(t,e)}))}(t,n).slice(e);return{colspan:i,rowspan:da(u,r)}}(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l})),u=r.section,{details:i,section:u};var i,u}))},ga=function(t,e,n){var r=[];if(yn(t)){var o=N(bn(t),(function(t){return Xt(t.element,n)}));r.push(Kt(o,"colgroup"))}for(var i=0;i<t.grid.rows;i++){for(var u=[],a=0;a<t.grid.columns;a++){var c=gn(t,i,a).map((function(t){return Xt(t.element,n)})).getOrThunk((function(){return Xt(e.gap(),!0)}));u.push(c)}var s=Kt(u,t.all[i].section);r.push(s)}return r},ha=function(t,e){return function(t,e){return N(t,(function(t){var n=function(t){return U(t,(function(t){return ue(t.element).map((function(t){var e=ue(t).isNone();return Xt(t,e)}))})).getOrThunk((function(){return Xt(e.row(),!0)}))}(t.details);return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(n.element,t.details,t.section,n.isNew)}))}(ma(t,Dt),e)},pa=function(t,e){return U(t.all,(function(t){return B(t.cells,(function(t){return Dt(e,t.element)}))}))},va=function(t,e,n,r,o){return function(i,u,a,c,s){var l=dn(u);return e(l,a).map((function(e){var n=function(t,e){return ga(t,e,!1)}(l,c),r=t(n,e,Dt,o(c));return{grid:ha(r.grid,c),cursor:r.cursor}})).fold((function(){return m.none()}),(function(t){var e=fa(u,t.grid),o=m.from(s).getOrThunk((function(){return Lu(u)}));return n(u,t.grid,o),r(u),Yi(i,u),m.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},ba=function(t,e){return Ze(e.element).bind((function(e){return pa(t,e)}))},ya=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some({cells:r,generators:e.generators,clipboard:e.clipboard}):m.none()},wa=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some(r):m.none()},xa=function(t,e,n,r){for(var o=ca(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<aa(o[0]);a++){var c=n(ua(o[u],a),e);!0===c&&!1===i?na(o[u],a,Xt(r(),!0)):!0===c&&(i=!1)}return t},Ca=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:e(t),getOrThunk:e(t),getOrDie:e(t),or:function(e){return Ca(t)},orThunk:function(e){return Ca(t)},fold:function(e,n){return n(t)},map:function(e){return Ca(e(t))},mapError:function(e){return Ca(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},Sa=function(e){return{is:c,isValue:c,isError:s,getOr:n,getOrThunk:function(t){return t()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return Sa(e)},mapError:function(t){return Sa(t(e))},each:t,bind:function(t){return Sa(e)},exists:c,forall:s,toOptional:m.none}},ka={value:Ca,error:Sa,fromOption:function(t,e){return t.fold((function(){return Sa(e)}),Ca)}},Oa=function(t,e){return{rowDelta:0,colDelta:aa(t[0])-aa(e[0])}},Ta=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},_a=function(t,e,n){var r="colgroup"===e.section?n.col:n.cell;return N(t,(function(){return Xt(r(),!0)}))},Ea=function(t,e,n){return t.concat(A(e,(function(){var e=t[t.length-1];return ra(e,_a(e.cells,e,n))})))},Aa=function(t,e,r){return N(t,(function(t){var o=_a(A(e,n),t,r);return ra(t,t.cells.concat(o))}))},Na=function(t,e,r){var o=e.colDelta<0?Aa:n;return(e.rowDelta<0?Ea:n)(o(t,Math.abs(e.colDelta),r),Math.abs(e.rowDelta),r)},Ra=function(t,e,n,o){var i=r(o,ia(t[e],n).element),u=t[e];return t.length>1&&aa(u)>1&&(n>0&&i(ua(u,n-1))||n<u.cells.length-1&&i(ua(u,n+1))||e>0&&i(ua(t[e-1],n))||e<t.length-1&&i(ua(t[e+1],n)))},Ma=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&R(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&na(t,e,Xt(r(),!0))}))}(e,t,o,r.cell);var i=Ta(n,e),u=Na(n,i,r),a=Ta(e,u),c=Na(e,a,r);return N(c,(function(e,n){var r=e.cells.slice(0,t).concat(u[n].cells).concat(e.cells.slice(t,e.cells.length));return ra(e,r)}))},za=function(t,e,n,r,o){!function(t,e,n,r){var o=ca(t).rows;if(e>0&&e<o.length){var i=function(t,e){return D(t,(function(t,n){return E(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);R(i,(function(t){for(var i=m.none(),u=function(e){for(var u=function(u){var a=o[e].cells[u];n(a.element,t.element)&&(i.isNone()&&(i=m.some(r())),i.each((function(t){na(o[e],u,Xt(t,!0))})))},a=0;a<aa(o[0]);a++)u(a)},a=e;a<o.length;a++)u(a)}))}}(e,t,o,r.cell);var i=Oa(n,e),u=Na(n,i,r),a=Oa(e,u),c=Na(e,a,r),s=ca(c),l=s.cols,f=s.rows;return l.concat(f.slice(0,t)).concat(u).concat(f.slice(t,f.length))},Da=function(t,e,n,r,o){var i=ca(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=oa(u[n],(function(t,n){return e>0&&e<u.length&&r(ua(u[e-1],n),ua(u[e],n))?ia(u[e],n):Xt(o(t.element,r),!0)}));return a.concat(c).concat([l]).concat(s)},Ba=function(t,e,n,r,o){return N(t,(function(t){var i=e>0&&e<aa(t)&&r(ua(t,e-1),ua(t,e)),u=function(t,e,n,r,o,i,u){return"colgroup"!==n&&r?ia(t,e):Xt(u(ua(t,o),i),!0)}(t,e,t.section,i,n,r,o);return function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat([n]).concat(i);return ra(t,u)}(t,e,u)}))},Pa=function(t,e,n,r){return N(t,(function(t){return oa(t,(function(t){return function(t){return E(e,(function(e){return n(t.element,e.element)}))}(t)?Xt(r(t.element,n),!0):t}))}))},Ia=function(t,e,n,r){return void 0!==ua(t[e],n)&&e>0&&r(ua(t[e-1],n),ua(t[e],n))},La=function(t,e,n){return e>0&&n(ua(t,e-1),ua(t,e))},Ha=function(t,e,n,r){var o=L(t,(function(r,o){return Ia(t,o,e,n)||La(r,e,n)?[]:[ia(r,e)]}));return Pa(t,o,n,r)},Fa=function(t,e,n,r){var o=ca(t).rows,i=o[e],u=L(i.cells,(function(t,r){return Ia(o,e,r,n)||La(i,r,n)?[]:[t]}));return Pa(t,u,n,r)},Va=Si(["cell","row","replace","gap","col","colgroup"]),ja=function(t){return{element:t,colspan:We(t,"colspan",1),rowspan:We(t,"rowspan",1)}},Ua=function(t,e){void 0===e&&(e=ja),Va(t);var n=Bu(m.none()),r=function(r){var i=function(n){return function(e){switch(Yt(e.element)){case"col":return t.col(e);default:return t.cell(e)}}(e(n))}(r);return n.get().isNone()&&n.set(m.some(i)),o=m.some({item:r,replacement:i}),i},o=m.none();return{getOrInit:function(t,e){return o.fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.replacement:r(t)}))},cursor:n.get}},Wa=function(t,e){return function(n){var r=Bu(m.none());Va(n);var o=[],i=function(i){var u={scope:t},a=n.replace(i,e,u);return o.push({item:i,sub:a}),r.get().isNone()&&r.set(m.some(a)),a};return{replaceOrInit:function(t,e){return function(t,e){return B(o,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return i(t)}),(function(n){return e(t,n.item)?n.sub:i(t)}))},cursor:r.get}}},qa=function(t){Va(t);var e=Bu(m.none());return{combine:function(n){return e.get().isNone()&&e.set(m.some(n)),function(){var e=t.cell({element:n,colspan:1,rowspan:1});return Ue(e,"width"),Ue(n,"width"),e}},cursor:e.get}},$a=["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"],Ga=Wn(),Xa=function(t){return function(t,e){var n=t.property().name(e);return _($a,n)}(Ga,t)},Ka=function(t){return function(t,e){var n=t.property().name(e);return _(["ol","ul"],n)}(Ga,t)},Ya=function(t){var e,n=function(t){return"br"===Yt(t)},r=function(t){return hr(t).bind((function(e){var r=se(e).map((function(t){return!!Xa(t)||!!function(t,e){return _(["br","img","hr","input"],t.property().name(e))}(Ga,t)&&"img"!==Yt(t)})).getOr(!1);return ue(e).map((function(o){return!0===r||("li"===Yt(i=o)||ke(i,Ka).isSome())||n(e)||Xa(o)&&!Dt(t,o)?[]:[Rt.fromTag("br")];var i}))})).getOr([])},o=0===(e=L(t,(function(t){var e=le(t);return function(t){return H(t,(function(t){return n(t)||ee(t)&&0===Fn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Rt.fromTag("br")]:e;Pn(t[0]),Bn(t[0],o)},Ja=function(t){0===tn(t).length&&In(t)},Qa=function(t,e){return{grid:t,cursor:e}},Za=function(t,e,n){var r=ca(t).rows;return tc(r,e,n).orThunk((function(){return tc(r,0,0)}))},tc=function(t,e,n){return m.from(t[e]).bind((function(t){return m.from(t.cells[n]).bind((function(t){return m.from(t.element)}))}))},ec=function(t,e,n){var r=ca(t).rows;return Qa(t,tc(r,e,n))},nc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},rc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},oc=function(t,e,n){var r,o,i=(r=t,o=n.section,un(r,(function(){return o}))),u=mn(i);return ga(u,e,!0)},ic=function(t,e){var n=M(t,e);return 0===n.length?m.some("td"):n.length===t.length?m.some("th"):m.none()},uc=function(t,e,n){var r=mn(e),o=n.getWidths(r,n);Yo(r,o,n)},ac=va((function(t,e,n,r){var o=e[0].row,i=e[0].row,u=nc(e),a=D(u,(function(t,e){return Da(t,i,o,n,r.getOrInit)}),t);return ec(a,i,e[0].column)}),wa,t,t,Ua),cc=va((function(t,e,n,r){var o=nc(e),i=o[o.length-1].row,u=o[o.length-1].row+o[o.length-1].rowspan,a=D(o,(function(t,e){return Da(t,u,i,n,r.getOrInit)}),t);return ec(a,u,e[0].column)}),wa,t,t,Ua),sc=va((function(t,e,n,r){var o=rc(e),i=o[0].column,u=o[0].column,a=D(o,(function(t,e){return Ba(t,u,i,n,r.getOrInit)}),t);return ec(a,e[0].row,u)}),wa,uc,t,Ua),lc=va((function(t,e,n,r){var o=e[e.length-1].column,i=e[e.length-1].column+e[e.length-1].colspan,u=rc(e),a=D(u,(function(t,e){return Ba(t,i,o,n,r.getOrInit)}),t);return ec(a,e[0].row,i)}),wa,uc,t,Ua),fc=va((function(t,e,n,r){var o=rc(e),i=function(t,e,n){var r=N(t,(function(t){var r=t.cells.slice(0,e).concat(t.cells.slice(n+1));return Kt(r,t.section)}));return M(r,(function(t){return t.cells.length>0}))}(t,o[0].column,o[o.length-1].column),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,uc,Ja,Ua),dc=va((function(t,e,n,r){var o=nc(e),i=function(t,e,n){var r=ca(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,t,Ja,Ua),mc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("row","th")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("row","th"))),gc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td"))),hc=(va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("col","th")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("col","th")),va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td")),va((function(t,n,r,o){var i=n.cells;Ya(i);var u=function(t,e,n,r){var o=ca(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)na(o[i],u,Xt(r(),!1));return t}(t,n.bounds,0,e(i[0]));return Qa(u,m.from(i[0]))}),(function(t,e){return e.mergable}),t,t,qa)),pc=va((function(t,e,n,r){var o=z(e,(function(t,e){return xa(t,e,n,r.combine(e))}),t);return Qa(o,m.from(e[0]))}),(function(t,e){return e.unmergable}),uc,t,qa),vc=va((function(t,e,n,r){var o,i,u=function(t,e){var n=dn(t);return ga(n,e,!0)}(e.clipboard,e.generators);return function(t,e,n,r,o){return function(t,e,n){if(t.row>=e.length||t.column>aa(e[0]))return ka.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=aa(n[0]),u=n.length;return ka.value({rowDelta:r.length-u,colDelta:o.length-i})}(t,e,n).map((function(i){var u=Na(e,i,r);return function(t,e,n,r,o){for(var i=t.row,u=t.column,a=i+n.length,c=u+aa(n[0]),s=i;s<a;s++)for(var l=u;l<c;l++){Ra(e,s,l,o)&&xa(e,ua(e[s],l),o,r.cell);var f=ua(n[s-i],l-u),d=r.replace(f);na(e[s],l,Xt(d,!0))}return e}(t,u,n,r,o)}))}((o=e.row,i=e.column,{row:o,column:i}),t,u,e.generators,n).fold((function(){return Qa(t,m.some(e.element))}),(function(t){var n=Za(t,e.row,e.column);return Qa(t,n)}))}),(function(t,e){return Ze(e.element).bind((function(n){return pa(t,n).map((function(t){return W(W({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),uc,t,Ua),bc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),yc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),wc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].row,u=o[i],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),xc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),Cc=function(t,e){var n=dn(t);return wa(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=I(N(n.all,(function(t){return M(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return ic(i,(function(t){return"th"===Yt(t.element)}))})).getOr("")},Sc=function(t){return Ou(t.parentNode)},kc=function(t,e){var n="thead"===Sc(e),r=!E(e.cells,(function(t){return"th"!==Ou(t)}));return n||r?m.some({thead:n,ths:r}):m.none()},Oc=function(t,e){return"thead"===(n=kc(0,e).fold((function(){return Sc(e)}),(function(t){return"thead"})))?"header":"tfoot"===n?"footer":"body";var n},Tc=function(t,e,n){var r=t.getParent(e,"table"),o=e.parentNode,i=Ou(o);if(n!==i){var u=t.select(n,r)[0];if(!u){u=t.create(n);var a=r.firstChild;"thead"===n?j(xe(Rt.fromDom(r),"caption,colgroup")).fold((function(){return r.insertBefore(u,a)}),(function(e){return t.insertAfter(u,e.dom)})):r.appendChild(u)}"tbody"===n&&"thead"===i&&u.firstChild?u.insertBefore(e,u.firstChild):u.appendChild(e),o.hasChildNodes()||t.remove(o)}},_c=function(t,e,n,r){var o=t.dom,i=function(t,e,n){if(x(n)&&Ou(e)!==n){var r=t.dom.rename(e,n);return ou(t,r),r}return e}(t,e,n);return w(r)||o.setAttrib(i,"scope",r),i},Ec=function(t,e,n,r){return R(e,(function(e){return _c(t,e,n,r)}))},Ac=function(t,e,n){var r,o=t.dom;if("header"===n){var i=xu(t),u="auto"===i?(r=nn(Rt.fromDom(e.cells[0])).map((function(t){return rn(t)})).getOr([]),U(r,(function(t){return kc(0,t.dom)})).map((function(t){return t.thead&&t.ths?"sectionCells":t.thead?"section":"cells"})).getOr("section")):i;Ec(t,e.cells,"section"===u?"td":"th","col"),Tc(o,e,"cells"===u?"tbody":"thead")}else Ec(t,e.cells,"td",null),Tc(o,e,"footer"===n?"tfoot":"tbody")},Nc=function(t){return function(e){var n=Yt(e),r="col"===n||"colgroup"===n?function(t){return nn(t).bind((function(t){return tr(t,zr.firstSelectedSelector)})).fold((function(){return t}),(function(t){return t[0]}))}(e):e;return Ee(r,t)}},Rc=Nc("th,td"),Mc=Nc("th,td,caption"),zc=function(t,e){return Rc(t).map((function(t){return Nr(e)})).getOr([])},Dc=function(t,e){var n,r,o,i=Rc(t),u=i.bind((function(t){return nn(t)})).map((function(t){return rn(t)}));return(n=i,r=u,o=function(t,n){return M(n,(function(n){return E(Ar(n.dom.cells),(function(n){return"1"===Me(n,e)||Dt(n,t)}))}))},n.isSome()&&r.isSome()?m.some(o(n.getOrDie(),r.getOrDie())):m.none()).getOr([])},Bc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Pc=function(t,e,n,r){return A(t,(function(t){return function(t,e,n,r){for(var o=Rt.fromTag("tr"),i=0;i<t;i++){var u=Rt.fromTag(r<e||i<n?"th":"td");i<n&&Ne(u,"scope","row"),r<e&&Ne(u,"scope","col"),Mn(u,Rt.fromTag("br")),Mn(o,u)}return o}(e,n,r,t)}))},Ic=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Lc=function(t,e,n,o,i){var u=du(t),a={styles:u,attributes:fu(t),colGroups:wu(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=Bc);var u=Rt.fromTag("table"),a="cells"!==o;He(u,i.styles),Re(u,i.attributes),i.colGroups&&Mn(u,function(t){var e=Rt.fromTag("colgroup");return A(t,(function(){return Mn(e,Rt.fromTag("col"))})),e}(e));var c=Math.min(t,n);if(a&&n>0){var s=Rt.fromTag("thead");Mn(u,s);var l=Pc(n,e,"sectionCells"===o?c:0,r);Bn(s,l)}var f=Rt.fromTag("tbody");Mn(u,f);var d=Pc(a?t-c:t,e,a?0:n,r);return Bn(f,d),u}(n,e,i,o,xu(t),a);Ne(r,"data-mce-id","__mce");var u=function(t){var e=Rt.fromTag("div"),n=Rt.fromDom(t.dom.cloneNode(!0));return Mn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),_e(Tu(t),'table[data-mce-id="__mce"]').map((function(e){return bu(t)?Wu(t,e):yu(t)?qu(e):(vu(t)||function(t){return p(t)&&-1!==t.indexOf("%")}(u.width))&&Uu(t,e),Ru(e),De(e,"data-mce-id"),function(t,e){R(Ce(e,"tr"),(function(e){ru(t,e.dom),R(Ce(e,"th,td"),(function(e){ou(t,e.dom)}))}))}(t,e),function(t,e){_e(e,"td,th").each(r(Ic,t))}(t,e),e.dom})).getOr(null)},Hc=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return S(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return Lc(t,n,e,a,u)}return console.error(o),null},Fc=function(t){return function(){return t().fold((function(){return[]}),(function(t){return N(t,(function(t){return t.dom}))}))}},Vc=function(t){return function(e){var n=e.length>0?m.some(Ar(e)):m.none();t(n)}},jc=function(t){return function(e,n,r){void 0===r&&(r={});var o=Hc(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Uc=function(t,e,n){var r=We(t,e,1);1===n||r<=1?De(t,e):Ne(t,e,Math.min(n,r))},Wc=tinymce.util.Tools.resolve("tinymce.util.Tools"),qc=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},$c=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Gc=function(t,e){Wc.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Xc=function(t,e){return function(t,e){return e.concat(N(t,(function(t){var e=t.text||t.title;return function(t){return e=t,Wt(e,"menu")&&void 0!==e.menu&&null!==e.menu;var e}(t)?{text:e,items:Xc(t.menu)}:{text:e,value:t.value}})))}(t,e||[])},Kc=function(t){return function(e){return tt(e,"rgb")?t.toHex(e):e}},Yc=function(t,e){var n=Rt.fromDom(e);return{borderwidth:je(n,"border-width").getOr(""),borderstyle:je(n,"border-style").getOr(""),bordercolor:je(n,"border-color").map(Kc(t)).getOr(""),backgroundcolor:je(n,"background-color").map(Kc(t)).getOr("")}},Jc=function(t){var e=t[0],n=t.slice(1);return R(n,(function(t){R(It(e),(function(n){Ht(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},Qc=function(t){var e=[{name:"borderstyle",type:"listbox",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"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(e):e}},Zc=function(t,e,n,r){return B(t,(function(t){return n.formatter.matchNode(r,e+t)})).getOr("")},ts=r(Zc,["left","center","right"],"align"),es=r(Zc,["top","middle","bottom"],"valign"),ns=[{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:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],rs=function(t){return ns.concat(function(t){var e=Xc(function(t){return t.getParam("table_cell_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},os=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},is={normal:os(!1),ifTruthy:os(!0)},us=function(t){return nn(t[0]).map((function(e){var n=dn(e),r=vn(n),o=M(r,(function(e){return E(t,(function(t){return Dt(e.element,t)}))}));return N(o,(function(t){return{element:t.element.dom,column:wn(n,t.column).map((function(t){return t.element.dom}))}}))}))},as=function(t,e,n){var r=n.getData();n.close(),t.undoManager.transact((function(){(function(t,e,n){var r=1===e.length;if(e.length>=1){var o=nn(e[0]);us(e).each((function(e){R(e,(function(e){var o=_c(t,e.element,n.celltype),i=r?is.normal(t,o):is.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Nu(n.height)),e.setStyle("width",Nu(n.width))}(i,e.column.map((function(e){return r?is.normal(t,e):is.ifTruthy(t,e)})).getOr(i),n),mu(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Nu(e.borderwidth))}(i,n),r&&(Gc(t,o),function(t,e){Wc.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&$c(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))})),o.each((function(e){return iu(t,e.dom)}))}})(t,e,r),t.focus()}))},cs=function(t,e){var n=zc(Du(t),e);if(0!==n.length){var o=function(t,e){var n=us(e).map((function(e){return N(e,(function(e){return function(t,e,n,r){var o=t.dom,i=r.getOr(e),u=function(t,e){return o.getStyle(t,e)||o.getAttrib(t,e)};return W({width:u(i,"width"),height:u(e,"height"),scope:o.getAttrib(e,"scope"),celltype:Ou(e),class:o.getAttrib(e,"class",""),halign:ts(t,e),valign:es(t,e)},n?Yc(o,e):{})}(t,e.element,mu(t),e.column)}))}));return Jc(n.getOrDie())}(t,n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:rs(t)},Qc("cell")]},u={type:"panel",items:[{type:"grid",columns:2,items:rs(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:mu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(as,t,n)})}},ss=[{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"}],ls=function(t){return ss.concat(function(t){var e=Xc(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},fs=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){(function(t,e,n,r){var o=1===e.length;R(e,(function(e){r.type!==Ou(e.parentNode)&&Ac(t,e,r.type);var i=o?is.normal(t,e):is.ifTruthy(t,e);!function(t,e){t.setAttrib("scope",e.scope),t.setAttrib("class",e.class),t.setStyle("height",Nu(e.height))}(i,r),gu(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,r),r.align!==n.align&&(Gc(t,e),$c(t,e,r.align))})),nn(Rt.fromDom(e[0])).each((function(e){return iu(t,e.dom)}))})(t,e,n,o),t.focus()}))},ds=function(t){var e=Dc(Du(t),zr.selected);if(0!==e.length){var n=N(e,(function(e){return function(t,e,n){var r=t.dom;return W({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),class:r.getAttrib(e,"class",""),type:Oc(0,e),align:ts(t,e)},n?Yc(r,e):{})}(t,e.dom,gu(t))})),o=Jc(n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:ls(t)},Qc("row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ls(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:gu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(fs,t,N(e,(function(t){return t.dom})),o)})}},ms=tinymce.util.Tools.resolve("tinymce.Env"),gs=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{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"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},hs=function(t,e,n,r){if("TD"===e.tagName||"TH"===e.tagName)p(n)?t.setStyle(e,n,r):t.setStyle(e,n);else if(e.children)for(var o=0;o<e.children.length;o++)hs(t,e.children[o],n,r)},ps=function(t,e,n){var r,o=t.dom,i=n.getData();n.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,u=parseInt(i.rows,10)||1;e=Lc(t,n,u,0,0)}!function(t,e,n){var r,o=t.dom,i={},u={};if(i.class=n.class,u.height=Nu(n.height),o.getAttrib(e,"width")&&!pu(t)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Nu(n.width),pu(t)?(u["border-width"]=Nu(n.border),u["border-spacing"]=Nu(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),pu(t)&&e.children)for(var a=0;a<e.children.length;a++)hs(o,e.children[a],{"border-width":Nu(n.border),padding:Nu(n.cellpadding)}),hu(t)&&hs(o,e.children[a],{"border-color":n.bordercolor});hu(t)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(W(W({},du(t)),u)),o.setAttribs(e,W(W({},fu(t)),i)),iu(t,e)}(t,e,i),(r=o.select("caption",e)[0])&&!i.caption&&o.remove(r),!r&&i.caption&&((r=o.create("caption")).innerHTML=ms.ie?" ":'<br data-mce-bogus="1"/>',e.insertBefore(r,e.firstChild)),""===i.align?Gc(t,e):$c(t,e,i.align),t.focus(),t.addVisual()}))},vs=function(t,e){var n,o=t.dom,i=function(t,e){var n,r,o,i,u=du(t),a=fu(t),c=e?(n=t.dom,{borderstyle:Ut(u,"border-style").getOr(""),bordercolor:Kc(n)(Ut(u,"border-color").getOr("")),backgroundcolor:Kc(n)(Ut(u,"background-color").getOr(""))}):{};return W(W(W(W(W(W({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],pu(t)&&i?{border:i}:Ut(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Ut(u,"border-spacing").or(Ut(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Ut(u,"border-padding").or(Ut(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),W(W({},r),o)))}(t,hu(t));!1===e?(n=o.getParent(t.selection.getStart(),"table"))?i=function(t,e,n){var r=t.dom;return W({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"),cellpadding:r.getAttrib(e,"cellpadding")||qc(t.dom,e,"padding"),border:function(e,n){var r=je(Rt.fromDom(n),"border-width");return pu(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||qc(t.dom,n,"border-width")||qc(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:ts(t,e)},n?Yc(r,e):{})}(t,n,hu(t)):hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""):(i.cols="1",i.rows="1",hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""));var u=Xc(function(t){return t.getParam("table_class_list",[],"array")}(t));u.length>0&&i.class&&(i.class=i.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:gs(t,u,e)},c=hu(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},Qc("table")]}:{type:"panel",items:[a]};t.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:r(ps,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i})},bs=function(t){return Mc(Du(t))},ys=function(t){return Rc(Du(t))},ws=function(e,n,o,i,u){var c=Au(e),s=function(t){return nn(t,c)},l=function(t){return function(n){e.selection.setRng(n),e.focus(),o.clear(t),Ru(t),iu(e,t.dom)}},f=function(t){return ys(e).each((function(e){s(e).each((function(n){var r=Br(i,n,e);t(n,r).each(l(n))}))}))},d=function(){return ys(e).map((function(n){return s(n).bind((function(r){return function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1),o=ca(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan);return function(t){return N(t,(function(t){var e=br(t.element);return R(t.cells,(function(t){var n=yr(t.element);sa(n,"colspan",t.colspan,1),sa(n,"rowspan",t.rowspan,1),Mn(e,n)})),e}))}(ha(o,n))}))}(r,Br(i,r,n),_r(t,Rt.fromDom(e.getDoc()),m.none()))}))}))},g=function(){return ys(e).map((function(t){return s(t).bind((function(e){return function(t,e){var n=dn(t);return wa(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan;return q(function(t,e,n){if(yn(t)){var r=M(bn(t),(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"span",n-e),r})),i=Rt.fromTag("colgroup");return Bn(i,o),[i]}return[]}(n,r,o),function(t,e,n){return N(t.all,(function(t){var r=M(t.cells,(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"colspan",n-e),r})),i=Rt.fromTag("tr");return Bn(i,o),i}))}(n,r,o))}))}(e,Br(i,e,t))}))}))},h=function(t,n){return n().each((function(n){var r=N(n,(function(t){return yr(t)}));ys(e).each((function(n){return s(n).each((function(n){var o=Er(Rt.fromDom(e.getDoc())),u=function(t,e,n,r){return{selection:Nr(t),clipboard:n,generators:r}}(i,0,r,o);t(n,u).each(l(n))}))}))}))};Ht({mceTableSplitCells:function(){return f(n.unmergeCells)},mceTableMergeCells:function(){return f(n.mergeCells)},mceTableInsertRowBefore:function(){return f(n.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(n.insertRowsAfter)},mceTableInsertColBefore:function(){return f(n.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(n.insertColumnsAfter)},mceTableDeleteCol:function(){return f(n.deleteColumn)},mceTableDeleteRow:function(){return f(n.deleteRow)},mceTableCutCol:function(t){return g().each((function(t){u.setColumns(t),f(n.deleteColumn)}))},mceTableCutRow:function(t){return d().each((function(t){u.setRows(t),f(n.deleteRow)}))},mceTableCopyCol:function(t){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(t){return d().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(t){return h(n.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(t){return h(n.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(t){return h(n.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(t){return h(n.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return bs(e).each((function(t){nn(t,c).filter(a(c)).each((function(t){var n=Rt.fromText("");if(Nn(t,n),In(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{var r=e.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),e.selection.setRng(r),e.nodeChanged()}}))}))},mceTableSizingMode:function(t,n){return function(t){return bs(e).each((function(n){yu(e)||bu(e)||vu(e)||nn(n,c).each((function(n){"relative"!==t||gi(n)?"fixed"!==t||hi(n)?"responsive"!==t||pi(n)||qu(n):Wu(e,n):Uu(e,n),Ru(n),iu(e,n.dom)}))}))}(n)}},(function(t,n){return e.addCommand(n,t)}));var b=function(t,e){e.each((function(e){iu(t,e.dom)}))};Ht({mceTableCellType:function(t,r){var o=nn(Du(e),c);n.setTableCellType(e,r),b(e,o)},mceTableRowType:function(t,r){var o=nn(Du(e),c);n.setTableRowType(e,r),b(e,o)}},(function(t,n){return e.addCommand(n,t)})),e.addCommand("mceTableColType",(function(t,e){return Ut(e,"type").each((function(t){return f("th"===t?n.makeColumnsHeader:n.unmakeColumnsHeader)}))})),Ht({mceTableProps:r(vs,e,!1),mceTableRowProps:r(ds,e),mceTableCellProps:r(cs,e,i)},(function(t,n){return e.addCommand(n,(function(){return t()}))})),e.addCommand("mceInsertTable",(function(t,n){v(n)&&It(n).length>0?Hc(e,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):vs(e,!0)})),e.addCommand("mceTableApplyCellStyle",(function(t,n){var r=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(v(n)){var o=zc(Du(e),i);if(0!==o.length){var u=jt(n,(function(t,n){return e.formatter.has(r(n))&&p(t)}));(function(t){for(var e in t)if(Lt.call(t,e))return!1;return!0})(u)||(Ht(u,(function(t,n){R(o,(function(o){is.normal(e,o.dom).setFormat(r(n),t)}))})),s(o[0]).each((function(t){return iu(e,t.dom,{structure:!1,style:!0})})))}}}))},xs={tablecellbackgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},tablecellbordercolor:{selector:"td,th",styles:{borderColor:"%value"},remove_similar:!0},tablecellborderstyle:{selector:"td,th",styles:{borderStyle:"%value"},remove_similar:!0},tablecellborderwidth:{selector:"td,th",styles:{borderWidth:"%value"},remove_similar:!0}},Cs=nr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Ss=W(W({},Cs),{none:function(t){return void 0===t&&(t=void 0),Cs.none(t)}}),ks=function(t,e){return nn(t,e).bind((function(e){var n=tn(e);return P(n,(function(e){return Dt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Os=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ts=nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_s={before:Ts.before,on:Ts.on,after:Ts.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(n,n,n)}},Es=nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),As={domRange:Es.domRange,relative:Es.relative,exact:Es.exact,exactFromRange:function(t){return Es.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Rt.fromDom(t.startContainer)},relative:function(t,e){return _s.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return Rt.fromDom(ie(e).dom.defaultView)},range:Os},Ns=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rs=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ms=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zs=nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ds=function(t,e,n){return e(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},Bs=function(t,n){return r=function(t,n){return n.match({domRange:function(t){return{ltr:e(t),rtl:m.none}},relative:function(e,n){return{ltr:$((function(){return Ns(t,e,n)})),rtl:$((function(){return m.some(Ns(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:$((function(){return Rs(t,e,n,r,o)})),rtl:$((function(){return m.some(Rs(t,r,o,e,n))}))}}})}(t,n),(o=r.ltr()).collapsed?r.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zs.rtl(Rt.fromDom(t.endContainer),t.endOffset,Rt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ds(0,zs.ltr,o)})):Ds(0,zs.ltr,o);var r,o},Ps=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})},Is=(zs.ltr,zs.rtl,function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom}),Ls=function(t,e,n,r){return ee(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return U(i,(function(t){return Is(t,n,r)?m.some(t):m.none()})).map((function(o){return function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Fn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,a=1;a<o;a++){var c=i(a).getBoundingClientRect(),s=Math.abs(e-c.left);if(n<=c.bottom){if(n<c.top||s>u)return a-1;u=s}}return 0}(0,n,r,o.right,u);return i(a)}(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=le(e);return U(i,(function(e){return o.selectNode(e.dom),Is(o.getBoundingClientRect(),n,r)?Ls(t,e,n,r):m.none()}))}(t,e,n,r)},Hs=function(t,e){return e-t.left<t.right-e},Fs=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Vs=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Hs(o,n);return(!0===i?gr:hr)(e).map((function(e){return Fs(t,e,i)}))},js=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Hs(r,n);return m.some(Fs(t,e,o))},Us=document.caretPositionFromPoint?function(t,e,n){return m.from(t.dom.caretPositionFromPoint(e,n)).bind((function(e){if(null===e.offsetNode)return m.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),m.some(n)}))}:document.caretRangeFromPoint?function(t,e,n){return m.from(t.dom.caretRangeFromPoint(e,n))}:function(t,e,n){return Rt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===le(e).length?js:Vs)(t,e,n)}(t,r,e)};return 0===le(r).length?o():function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Ls(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))}(t,r,e,n).orThunk(o)}))},Ws=function(t,e){var n=Yt(t);return"input"===n?_s.after(t):_(["br","img"],n)?0===e?_s.before(t):_s.after(t):_s.on(t,e)},qs=function(t,e){var n=t.fold(_s.before,Ws,_s.after),r=e.fold(_s.before,Ws,_s.after);return As.relative(n,r)},$s=function(t,e,n,r){var o=Ws(t,e),i=Ws(n,r);return As.relative(o,i)},Gs=function(t){return m.from(t.getSelection())},Xs=function(t,e){Gs(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},Ks=function(t,e,n,r,o){var i=Rs(t,e,n,r,o);Xs(t,i)},Ys=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){Ks(t,e,n,r,o)},rtl:function(e,n,r,o){Gs(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Ks(t,r,o,e,n)}else Ks(t,r,o,e,n)}))}})},Js=function(t,e,n,r,o){var i=$s(e,n,r,o);Ys(t,i)},Qs=function(t,e,n){var r=qs(e,n);Ys(t,r)},Zs=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return m.some(Os(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(n.endContainer),n.endOffset))}return m.none()},tl=function(t){if(null===t.anchorNode||null===t.focusNode)return Zs(t);var e=Rt.fromDom(t.anchorNode),n=Rt.fromDom(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=oe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Dt(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?m.some(Os(e,t.anchorOffset,n,t.focusOffset)):Zs(t)},el=function(t){return function(t){return Gs(t).filter((function(t){return t.rangeCount>0})).bind(tl)}(t).map((function(t){return As.exact(t.start,t.soffset,t.finish,t.foffset)}))},nl=tinymce.util.Tools.resolve("tinymce.util.VK"),rl=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none(o)}),(function(t){return t.index+1<t.all.length?Ss.middle(o,t.all[t.index+1]):Ss.last(o)})),r);var o},ol=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none()}),(function(t){return t.index-1>=0?Ss.middle(o,t.all[t.index-1]):Ss.first(o)})),r);var o},il=function(t,e){return function(t){var e=As.getWin(t).dom,n=function(t,n,r,o){return Rs(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Rt.fromDom(t.startContainer),n=Rt.fromDom(t.endContainer);return $s(e,t.startOffset,n,t.endOffset)},relative:qs,exact:$s})}(t);return Bs(e,r).match({ltr:n,rtl:n})}(As.exact(e,0,e,0))},ul=function(t,e,n,r){return n.fold(m.none,m.none,(function(t,e){return gr(e).map((function(t){return il(0,t)}))}),(function(n){return nn(n,e).bind((function(e){var o=Dr(n);return t.undoManager.transact((function(){r.insertRowsAfter(e,o)})),function(t,e){var n=Ce(e,"tr");return j(n).bind((function(t){return _e(t,"td,th").map((function(t){return il(0,t)}))}))}(0,e)}))}))},al=["table","li","dl"],cl=function(t,e){return{selection:t,kill:e}},sl=function(t,e,n,r){return{start:_s.on(t,e),finish:_s.on(n,r)}},ll=function(t,e){var n=Ps(t,e);return Os(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},fl=sl,dl=function(t,e,n,r,o){return Dt(n,r)?m.none():Yn(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>0?(o(t,r,e.start,e.finish),m.some(cl(m.some(fl(n,0,n,fr(n))),!0))):m.none()}))},ml=function(t,e){return{item:t,mode:e}},gl=function(t,e,n,r){return void 0===r&&(r=hl),t.property().parent(e).map((function(t){return ml(t,r)}))},hl=function(t,e,n,r){return void 0===r&&(r=pl),n.sibling(t,e).map((function(t){return ml(t,r)}))},pl=function(t,e,n,r){void 0===r&&(r=pl);var o=t.property().children(e);return n.first(o).map((function(t){return ml(t,r)}))},vl=[{current:gl,next:hl,fallback:m.none()},{current:hl,next:pl,fallback:m.some(gl)},{current:pl,next:pl,fallback:m.some(hl)}],bl=function(t,e,n,r,o){return void 0===o&&(o=vl),B(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return bl(t,e,n,r)}))}))}))},yl=function(t,e,n,r,o,i){return bl(t,e,r,o).bind((function(e){return i(e.item)?m.none():n(e.item)?m.some(e.item):yl(t,e.item,n,e.mode,o,i)}))},wl=function(t){return function(e){return 0===t.property().children(e).length}},xl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?m.some(t[t.length-1]):m.none()}},r)},Cl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?m.some(t[0]):m.none()}},r)},Sl=Wn(),kl=function(t,e){return function(t,e,n){return xl(t,e,wl(t),n)}(Sl,t,e)},Ol=function(t,e){return function(t,e,n){return Cl(t,e,wl(t),n)}(Sl,t,e)},Tl=nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),_l=function(t){return Ee(t,"tr")},El=W(W({},Tl),{verify:function(t,e,n,r,o,i,u){return Ee(r,"td,th",u).bind((function(n){return Ee(e,"td,th",u).map((function(e){return Dt(n,e)?Dt(r,n)&&fr(n)===o?i(e):Tl.none("in same cell"):Xn(_l,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?Tl.success():i(e)}),(function(t){return i(e)}))}))})).getOr(Tl.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Al=function(t){return"br"===Yt(t)},Nl=function(t,e,n){return e(t,n).bind((function(t){return ee(t)&&0===Fn(t).trim().length?Nl(t,e,n):m.some(t)}))},Rl=function(t,e,n,o){return function(t,e){return fe(t,e).filter(Al).orThunk((function(){return fe(t,e-1).filter(Al)}))}(e,n).bind((function(e){return o.traverse(e).fold((function(){return Nl(e,o.gather,t).map(o.relative)}),(function(t){return function(t){return ue(t).bind((function(e){var n=le(e);return function(t,e){return P(t,r(Dt,e))}(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return _s.on(t.parent,t.index)}))}))}))},Ml=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},zl=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},Dl=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Bl=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Pl=function(t,e){return m.some(t.getRect(e))},Il=function(t,e,n){return te(e)?Pl(t,e).map(Bl):ee(e)?function(t,e,n){return n>=0&&n<fr(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):m.none()}(t,e,n).map(Bl):m.none()},Ll=function(t,e){return te(e)?Pl(t,e).map(Bl):ee(e)?t.getRangedRect(e,0,e,fr(e)).map(Bl):m.none()},Hl=nr([{none:[]},{retry:["caret"]}]),Fl=function(t,e,n){return(r=e,o=Xa,Se((function(t,e){return e(t)}),ke,r,o,undefined)).fold(c,(function(e){return Ll(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o},Vl={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=Ml(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?Hl.retry(i):n.top===o.bottom?Hl.retry(Ml(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:Ml,gather:Ol},jl=function(t,e,n,r,o){return 0===o?m.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===Yt(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return jl(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(m.none,(function(i){return Ll(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(m.none,(function(r){return jl(t,e,n,r,o-1)}))})).orThunk((function(){return m.some(r)}))}),m.none)}))},Ul=function(t,e,n){var r=t.move(n,5),o=jl(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?m.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?m.some(-t.point(e)):m.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Wl={tryUp:r(Ul,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=zl(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?Hl.retry(i):n.bottom===o.top?Hl.retry(zl(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:zl,gather:kl}),tryDown:r(Ul,Vl),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:e(5)},ql=function(t,e,n){return t.getSelection().bind((function(r){return function(t,e,n,r){return(Al(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Nl(e,n.gather,t)})).map(n.relative)}(t,e,r):Rl(t,e,n,r)).map((function(t){return{start:t,finish:t}}))}(e,r.finish,r.foffset,n).fold((function(){return m.some(Ku(r.finish,r.foffset))}),(function(o){var i,u=t.fromSitus(o);return i=El.verify(t,r.finish,r.foffset,u.finish,u.foffset,n.failure,e),El.cata(i,(function(t){return m.none()}),(function(){return m.none()}),(function(t){return m.some(Ku(t,0))}),(function(t){return m.some(Ku(t,fr(t)))}))}))}))},$l=function(t,e,n,r,o,i){return 0===i?m.none():Kl(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=El.verify(t,n,r,a.finish,a.foffset,o.failure,e);return El.cata(c,(function(){return m.none()}),(function(){return m.some(u)}),(function(u){return Dt(n,u)&&0===r?Gl(t,n,r,zl,o):$l(t,e,u,0,o,i-1)}),(function(u){return Dt(n,u)&&r===fr(u)?Gl(t,n,r,Ml,o):$l(t,e,u,fr(u),o,i-1)}))}))},Gl=function(t,e,n,r,o){return Il(t,e,n).bind((function(e){return Xl(t,o,r(e,Wl.getJumpSize()))}))},Xl=function(t,e,n){var r=At().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):m.none()},Kl=function(t,e,n,r,o){return Il(t,n,r).bind((function(e){return Xl(t,o,e)}))},Yl=function(t,e,n,r,o){return Ee(r,"td,th",e).bind((function(r){return Ee(r,"table",e).bind((function(i){return function(t,e){return ke(t,(function(t){return ue(t).exists((function(t){return Dt(t,e)}))}),void 0).isSome()}(o,i)?function(t,e,n){return ql(t,e,n).bind((function(r){return $l(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Ee(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):m.none()}))}))},Jl=function(t,e,n,r,o,i){return At().browser.isIE()?m.none():i(r,e).orThunk((function(){return Yl(t,e,n,r,o).map((function(t){var e=t.range;return cl(m.some(fl(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Ql=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[0])?function(t,e,n){return xl(Sl,t,(function(t){return hr(t).isSome()}),n)}(n,0,e).map((function(t){var e=fr(t);return cl(m.some(fl(t,e,t,e)),!0)})):m.none()}))}))},Zl=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[r.length-1])?function(t,e,n){return Cl(Sl,t,(function(t){return gr(t).isSome()}),n)}(n,0,e).map((function(t){return cl(m.some(fl(t,0,t,0)),!0)})):m.none()}))}))},tf=function(t,e,n,r,o,i,u){return Yl(t,n,r,o,i).bind((function(t){return dl(e,n,t.start,t.finish,u)}))},ef=function(t,e){return Ee(t,"td,th",e)};var nf={traverse:se,gather:Ol,relative:_s.before,otherRetry:Wl.tryDown,ieRetry:Wl.ieTryDown,failure:El.failedDown},rf={traverse:ce,gather:kl,relative:_s.before,otherRetry:Wl.tryUp,ieRetry:Wl.ieTryUp,failure:El.failedUp},of=function(t){return function(e){return e===t}},uf=of(38),af=of(40),cf=function(t){return t>=37&&t<=40},sf={isBackward:of(37),isForward:of(39)},lf={isBackward:of(39),isForward:of(37)},ff=function(t){return{elementFromPoint:function(e,n){return Rt.fromPoint(Rt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=As.exact(e,n,r,o);return function(t,e){return n=Ps(t,e),r=n.getClientRects(),(o=r.length>0?r[0]:n.getBoundingClientRect()).width>0||o.height>0?m.some(o).map(Ms):m.none();var n,r,o}(t,i)},getSelection:function(){return el(t).map((function(e){return ll(t,e)}))},fromSitus:function(e){var n=As.relative(e.start,e.finish);return ll(t,n)},situsFromPoint:function(e,n){return function(t,e,n){return function(t,e,n){var r=Rt.fromDom(t.document);return Us(r,e,n).map((function(t){return Os(Rt.fromDom(t.startContainer),t.startOffset,Rt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)}(t,e,n).map((function(t){return sl(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){Gs(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),el(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Qs(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;Js(t,u,a,u,a)}))}))},setSelection:function(e){Js(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Qs(t,e,n)},selectContents:function(e){!function(t,e){var n=function(t,e){var n=t.document.createRange();return function(t,e){t.selectNodeContents(e.dom)}(n,e),n}(t,e);Xs(t,n)}(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Rt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,eo(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Rt.fromDom(t.document))}}},df=function(t,e){return{rows:t,cols:e}},mf=function(t){return!1===Pi(Rt.fromDom(t.target),"ephox-snooker-resizer-bar")};function gf(e,n,o){var i=function(t,e,n){var r=function(e){De(e,t.selected),De(e,t.firstSelected),De(e,t.lastSelected)},o=function(e){Ne(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=Ce(e,t.selectedSelector);R(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),R(r,o),Ne(u,t.firstSelected,"1"),Ne(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}}(zr,(function(n,r,i){o.targets().each((function(o){nn(r).each((function(u){var a=ku(e),c=_r(t,Rt.fromDom(e.getDoc()),a),s=function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1);return{upOrLeftCells:function(t,e,n){var r=t.slice(0,e[e.length-1].row+1),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return N(n,(function(t){return t.element}))}))}(e,t,n),downOrRightCells:function(t,e,n){var r=t.slice(e[0].row+e[0].rowspan-1,t.length),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return N(n,(function(t){return t.element}))}))}(e,t,n)}}))}(u,o,c);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(e,n,r,i,s)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(e)}));return e.on("init",(function(o){var u=e.getWin(),a=Tu(e),c=Au(e),s=function(t,e,n,r){var o=function(t,e,n,r){var o,i=(o=Bu(m.none()),{clear:function(){return o.set(m.none())},set:function(t){return o.set(m.some(t))},isSet:function(){return o.get().isSome()},on:function(t){return o.get().each(t)}}),u=i.clear;return{clearstate:u,mousedown:function(t){r.clear(e),ef(t.target,n).each(i.set)},mouseover:function(o){i.on((function(i){r.clearBeforeUpdate(e),ef(o.target,n).each((function(o){Yn(i,o,n).each((function(n){var u=n.boxes.getOr([]);(u.length>1||1===u.length&&!Dt(i,o))&&(r.selectRange(e,u,n.start,n.finish),t.selectContents(o))}))}))}))},mouseup:function(t){u()}}}(ff(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}}(u,a,c,i),l=function(t,e,n,o){var i=ff(t),u=function(){return o.clear(e),m.none()};return{keydown:function(t,a,c,s,l,f){var d=t.raw,g=d.which,h=!0===d.shiftKey;return Jn(e,o.selectedSelector).fold((function(){return af(g)&&h?r(tf,i,e,n,nf,s,a,o.selectRange):uf(g)&&h?r(tf,i,e,n,rf,s,a,o.selectRange):af(g)?r(Jl,i,n,nf,s,a,Zl):uf(g)?r(Jl,i,n,rf,s,a,Ql):m.none}),(function(t){var n=function(n){return function(){return U(n,(function(n){return function(t,e,n,r,o){return Zn(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,o)})).fold((function(){return Qn(e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){var n=af(g)||f.isForward(g)?_s.after:_s.before;return i.setRelativeSelection(_s.on(t.first,0),n(t.table)),o.clear(e),cl(m.none(),!0)}))}),(function(t){return m.some(cl(m.none(),!0))}))}};return af(g)&&h?n([df(1,0)]):uf(g)&&h?n([df(-1,0)]):f.isBackward(g)&&h?n([df(0,-1),df(-1,0)]):f.isForward(g)&&h?n([df(0,1),df(1,0)]):cf(g)&&!1===h?u:m.none}))()},keyup:function(t,r,i,u,a){return Jn(e,o.selectedSelector).fold((function(){var c=t.raw,s=c.which;return 0==(!0===c.shiftKey)?m.none():cf(s)?function(t,e,n,r,o,i,u){return Dt(n,o)&&r===i?m.none():Ee(n,"td,th",e).bind((function(n){return Ee(o,"td,th",e).bind((function(r){return dl(t,e,n,r,u)}))}))}(e,n,r,i,u,a,o.selectRange):m.none()}),m.none)}}}(u,a,c,i),f=function(t,e,n,r){var o=ff(t);return function(t,i){r.clearBeforeUpdate(e),Yn(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(u,a,c,i);e.on("TableSelectorChange",(function(t){return f(t.start,t.finish)}));var d,g,h=function(t,n){(function(t){return!0===t.raw.shiftKey})(t)&&(n.kill&&t.kill(),n.selection.each((function(t){var n=As.relative(t.start,t.finish),r=Ps(u,n);e.selection.setRng(r)})))},p=function(t){return 0===t.button},v=(d=Bu(Rt.fromDom(a)),g=Bu(0),{touchEnd:function(t){var e=Rt.fromDom(t.target);if("td"===Yt(e)||"th"===Yt(e)){var n=d.get(),r=g.get();Dt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),f(e,e))}d.set(e),g.set(t.timeStamp)}});e.on("dragstart",(function(t){s.clearstate()})),e.on("mousedown",(function(t){p(t)&&mf(t)&&s.mousedown(Mi(t))})),e.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||ms.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&mf(t)&&s.mouseover(Mi(t))})),e.on("mouseup",(function(t){p(t)&&mf(t)&&s.mouseup(Mi(t))})),e.on("touchend",v.touchEnd),e.on("keyup",(function(t){var n=Mi(t);if(n.raw.shiftKey&&cf(n.raw.which)){var r=e.selection.getRng(),o=Rt.fromDom(r.startContainer),i=Rt.fromDom(r.endContainer);l.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){h(n,t)}))}})),e.on("keydown",(function(t){var r=Mi(t);n().each((function(t){return t.hideBars()}));var o=e.selection.getRng(),i=Rt.fromDom(o.startContainer),u=Rt.fromDom(o.endContainer),a=Kr(sf,lf)(Rt.fromDom(e.selection.getStart()));l.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){h(r,t)})),n().each((function(t){return t.showBars()}))})),e.on("NodeChange",(function(){var n=e.selection,r=Rt.fromDom(n.getStart()),o=Rt.fromDom(n.getEnd());Xn(nn,[r,o]).fold((function(){return i.clear(a)}),t)}))})),{clear:i.clear}}cr.add("table",(function(e){var n,r=(n=zr.selectedSelector,{get:function(){return tr(Tu(e),n).fold((function(){return Mc(Du(e)).map(ar).getOrThunk(ir)}),(function(t){return ur(t)}))}}),o=function(t,e){var n=Bu(m.none()),r=Bu([]),o=function(){return Mc(Du(t)).bind((function(t){return nn(t).map((function(n){return"caption"===Yt(t)?Dr(t):Br(e,n,t)}))}))},i=function(){n.set($(o)()),R(r.get(),(function(t){return t()}))},u=function(t,e){var o=function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))};return o(),r.set(r.get().concat([o])),function(){r.set(M(r.get(),(function(t){return t!==o})))}};return t.on("NodeChange ExecCommand TableSelectorChange",i),{onSetupTable:function(t){return u(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return u(t,(function(t){return"caption"===Yt(t.element)}))},onSetupPasteable:function(t){return function(e){return u(e,(function(e){return"caption"===Yt(e.element)||t().isNone()}))}},onSetupMergeable:function(t){return u(t,(function(t){return t.mergable.isNone()}))},onSetupUnmergeable:function(t){return u(t,(function(t){return t.unmergable.isNone()}))},resetTargets:i,targets:function(){return n.get()}}}(e,r),i=Xu(e),u=gf(e,i.lazyResize,o),a=function(e,n,r){var o=function(t){return"table"===Yt(Tu(t))},i=ku(e),u=function(t,n,r,o){return function(u,a){Ru(u);var c=o(),s=Rt.fromDom(e.getDoc()),l=_r(r,s,i),f=Vu(e,u);return n(u)?t(c,u,a,l,f).bind((function(t){return R(t.newRows,(function(t){ru(e,t.dom)})),R(t.newCells,(function(t){ou(e,t.dom)})),t.cursor.map((function(t){var n=Zu(ta,t),r=e.dom.createRng();return r.setStart(n.element.dom,n.offset),r.setEnd(n.element.dom,n.offset),r}))})):m.none()}},a=u(dc,(function(t){return!1===o(e)||bi(t).rows>1}),t,n),c=u(fc,(function(t){return!1===o(e)||bi(t).columns>1}),t,n),l=u(ac,s,t,n),f=u(cc,s,t,n),d=u(sc,s,ea,n),g=u(lc,s,ea,n),h=u(hc,s,t,n),p=u(pc,s,t,n),v=u(bc,s,t,n),b=u(yc,s,t,n),y=u(wc,s,t,n),w=u(xc,s,t,n),x=u(vc,s,t,n),C=function(t,e){return Ut(t,"type").filter((function(t){return _(e,t)}))};return{deleteRow:a,deleteColumn:c,insertRowsBefore:l,insertRowsAfter:f,insertColumnsBefore:d,insertColumnsAfter:g,mergeCells:h,unmergeCells:p,pasteColsBefore:v,pasteColsAfter:b,pasteRowsBefore:y,pasteRowsAfter:w,pasteCells:x,setTableCellType:function(t,e){return C(e,["td","th"]).each((function(e){var n=N(zc(Du(t),r),(function(t){return t.dom}));Ec(t,n,e,null)}))},setTableRowType:function(t,e){return C(e,["header","body","footer"]).each((function(e){N(Dc(Du(t),zr.selected),(function(n){return Ac(t,n.dom,e)}))}))},makeColumnsHeader:u(mc,s,t,n),unmakeColumnsHeader:u(gc,s,t,n),getTableRowType:function(t){var e=Dc(Du(t),zr.selected);if(e.length>0){var n=N(e,(function(t){return Oc(0,t.dom)})),r=_(n,"header"),o=_(n,"footer");if(r||o){var i=_(n,"body");return!r||i||o?r||i||!o?"":"footer":"header"}return"body"}},getTableCellType:function(t){return ic(zc(Du(t),r),(function(t){return"th"===Yt(t)})).getOr("")},getTableColType:Cc}}(e,i.lazyWire,r),c=function(){var t=Bu(m.none()),e=Bu(m.none()),n=function(t){t.set(m.none())};return{getRows:t.get,setRows:function(r){t.set(r),n(e)},clearRows:function(){return n(t)},getColumns:e.get,setColumns:function(r){e.set(r),n(t)},clearColumns:function(){return n(e)}}}();return ws(e,a,u,r,c),function(t,e,n){var r=Au(t);Ht({mceTableRowType:function(){return e.getTableRowType(t)},mceTableCellType:function(){return e.getTableCellType(t)},mceTableColType:function(){return Rc(Du(t)).bind((function(t){return function(t){return nn(t,r)}(t).map((function(r){var o=Br(n,r,t);return e.getTableColType(r,o)}))})).getOr("")}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(e,a,r),function(e,n,r,o){e.on("BeforeGetContent",(function(r){!0===r.selection&&or(n.get(),t,(function(t){r.preventDefault(),function(t){return nn(t[0]).map(yr).map((function(t){return[lr(t,"[data-mce-selected]")]}))}(t).each((function(t){r.content="text"===r.format?function(t){return N(t,(function(t){return t.dom.innerText})).join("")}(t):function(t,e){return N(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(e,t)}))}),t)})),e.on("BeforeSetContent",(function(t){!0===t.selection&&!0===t.paste&&m.from(e.dom.getParent(e.selection.getStart(),"th,td")).each((function(n){var i=Rt.fromDom(n);nn(i).each((function(n){var u,a,c,s=M((u=t.content,(a=document.createElement("div")).innerHTML=u,le(Rt.fromDom(a))),(function(t){return"meta"!==Yt(t)}));if(1===s.length&&(c=s[0],"table"===Yt(c))){t.preventDefault();var l=Rt.fromDom(e.getDoc()),f=Er(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(i,s[0],f);r.pasteCells(n,d).each((function(t){e.selection.setRng(t),e.focus(),o.clear(n)}))}}))}))}))}(e,r,a,u),function(t,e,n){var r=function(e){return function(){return t.execCommand(e)}},o=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},i={text:"Table properties",onSetup:e.onSetupTable,onAction:r("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:r("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:e.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}),!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",i),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}}),t.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter"}}),t.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}}),t.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold((function(){return""}),(function(t){return"caption"===Yt(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}})}(e,o,c),function(t,e,n){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})}(e,o,c),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(e),e.on("PreInit",(function(){e.serializer.addTempAttr(zr.firstSelected),e.serializer.addTempAttr(zr.lastSelected),function(t){t.formatter.register(xs)}(e)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(e)&&e.on("keydown",(function(t){!function(t,e,n){if(t.keyCode===nl.TAB){var r=Tu(e),o=function(t){var e=Yt(t);return Dt(t,r)||_(al,e)},i=e.selection.getRng();if(i.collapsed){var u=Rt.fromDom(i.startContainer);Ze(u,o).each((function(r){t.preventDefault(),(t.shiftKey?ol:rl)(e,o,r,n).each((function(t){e.selection.setRng(t)}))}))}}}(t,e,a)})),e.on("remove",(function(){i.destroy()})),function(t,e,n,r){return{insertTable:jc(t),setClipboardRows:Vc(e.setRows),getClipboardRows:Fc(e.getRows),setClipboardCols:Vc(e.setColumns),getClipboardCols:Fc(e.getColumns),resizeHandler:n,selectionTargets:r}}(e,c,i,o)}))}()},397:(t,e,n)=>{n(2738)},2738:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(){},u=function(t){return function(){return t}},a=function(t){return t},c=u(!1),s=u(!0),l=function(){return f},f=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:l,each:i,bind:l,exists:c,forall:s,filter:l,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),d=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=g("string"),p=g("object"),v=g("array"),b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(t,e){return n=t,r=e,y.call(n,r)>-1;var n,r},x=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},C=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},S=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},k=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},O=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},T=Object.keys,_=Object.hasOwnProperty,E=(function(t){if(!v(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};C(t,(function(r,o){var i=T(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!v(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=T(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!O(e,(function(t){return w(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}}))}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var e=[],n=[];return C(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}),A=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:u(t),getOrThunk:u(t),getOrDie:u(t),or:function(e){return A(t)},orThunk:function(e){return A(t)},fold:function(e,n){return n(t)},map:function(e){return A(e(t))},mapError:function(e){return A(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},N=function(t){return{is:c,isValue:c,isError:s,getOr:a,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return N(t)},mapError:function(e){return N(e(t))},each:i,bind:function(e){return N(t)},exists:c,forall:s,toOptional:m.none}},R={value:A,error:N,fromOption:function(t,e){return t.fold((function(){return N(e)}),A)}},M=function(t){return"inline-command"===t.type||"inline-format"===t.type},z=function(t){return"block-command"===t.type||"block-format"===t.type},D=function(t){return e=t,n=function(t,e){return t.start.length===e.start.length?0:t.start.length>e.start.length?-1:1},(r=b.call(e,0)).sort(n),r;var e,n,r},B=function(t){var e=function(e){return R.error({message:e,pattern:t})},n=function(n,r,o){if(void 0!==t.format){var i=void 0;if(v(t.format)){if(!O(t.format,h))return e(n+" pattern has non-string items in the `format` array");i=t.format}else{if(!h(t.format))return e(n+" pattern has non-string `format` parameter");i=[t.format]}return R.value(r(i))}return void 0!==t.cmd?h(t.cmd)?R.value(o(t.cmd,t.value)):e(n+" pattern has non-string `cmd` parameter"):e(n+" pattern is missing both `format` and `cmd` parameters")};if(!p(t))return e("Raw pattern is not an object");if(!h(t.start))return e("Raw pattern is missing `start` parameter");if(void 0!==t.end){if(!h(t.end))return e("Inline pattern has non-string `end` parameter");if(0===t.start.length&&0===t.end.length)return e("Inline pattern has empty `start` and `end` parameters");var r=t.start,o=t.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(t){return{type:"inline-format",start:r,end:o,format:t}}),(function(t,e){return{type:"inline-command",start:r,end:o,cmd:t,value:e}}))}return void 0!==t.replacement?h(t.replacement)?0===t.start.length?e("Replacement pattern has empty `start` parameter"):R.value({type:"inline-command",start:"",end:t.start,cmd:"mceInsertContent",value:t.replacement}):e("Replacement pattern has non-string `replacement` parameter"):0===t.start.length?e("Block pattern has empty `start` parameter"):n("Block",(function(e){return{type:"block-format",start:t.start,format:e[0]}}),(function(e,n){return{type:"block-command",start:t.start,cmd:e,value:n}}))},P=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},I=function(t){return{inlinePatterns:S(t,M),blockPatterns:D(S(t,z))}},L="undefined"!=typeof window?window:Function("return this;")(),H=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=L.console;n&&(n.error?n.error.apply(n,t):n.log.apply(n,t))},F=[{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"}],V=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},j=tinymce.util.Tools.resolve("tinymce.util.Delay"),U=tinymce.util.Tools.resolve("tinymce.util.VK"),W=tinymce.util.Tools.resolve("tinymce.util.Tools"),q=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),G=function(t,e){return{container:t,offset:e}},X=function(t){return t.nodeType===Node.TEXT_NODE},K=function(t,e,n){if(e&&t.isEmpty(e)&&!n(e)){var r=e.parentNode;t.remove(e),K(t,r,n)}},Y=function(t,e,n,r){void 0===r&&(r=!0);var o=e.startContainer.parentNode,i=e.endContainer.parentNode;e.deleteContents(),r&&!n(e.startContainer)&&(X(e.startContainer)&&0===e.startContainer.data.length&&t.remove(e.startContainer),X(e.endContainer)&&0===e.endContainer.data.length&&t.remove(e.endContainer),K(t,o,n),o!==i&&K(t,i,n))},J=function(t,e){var n,r=e.get(t);return v(r)&&(n=r,function(t,e){return 0<t.length?m.some(t[0]):m.none()}(n)).exists((function(t){return e=t,"block",_.call(e,"block");var e}))},Q=function(t){return 0===t.start.length},Z=function(t,e){var n=m.from(t.dom.getParent(e.startContainer,t.dom.isBlock));return""===V(t)?n.orThunk((function(){return m.some(t.getBody())})):n},tt=q.DOM,et=function(t){return function(e){return t===e?-1:0}},nt=function(t,e,n){if(X(t)&&e>=0)return m.some(G(t,e));var r=$(tt);return m.from(r.backwards(t,e,et(t),n)).map((function(t){return G(t.container,t.container.data.length)}))},rt=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e>=0&&e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.backwards(t,e,et(t),n)).bind((function(t){var r=t.container.data;return rt(t.container,e+r.length,n)}))},ot=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.forwards(t,e,et(t),n)).bind((function(t){return ot(t.container,e-r.length,n)}))},it=function(t,e,n){if(X(e)&&(n<0||n>e.data.length))return[];for(var r=[n],o=e;o!==t&&o.parentNode;){for(var i=o.parentNode,u=0;u<i.childNodes.length;u++)if(i.childNodes[u]===o){r.push(u);break}o=i}return o===t?r.reverse():[]},ut=function(t,e,n,r,o){return{start:it(t,e,n),end:it(t,r,o)}},at=function(t,e){var n,r,o,i=e.slice(),u=i.pop();return(n=i,r=function(t,e){return t.bind((function(t){return m.from(t.childNodes[e])}))},o=m.some(t),C(n,(function(t){o=r(o,t)})),o).bind((function(t){return X(t)&&(u<0||u>t.data.length)?m.none():m.some({node:t,offset:u})}))},ct=function(t,e){return at(t,e.start).bind((function(n){var r=n.node,o=n.offset;return at(t,e.end).map((function(t){var e=t.node,n=t.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(e,n),i}))}))},st=function(t,e,n){(function(t,e,n){if(X(t)&&0>=t.length)return m.some(G(t,0));var r=$(tt);return m.from(r.forwards(t,0,et(t),n)).map((function(t){return G(t.container,0)}))})(e,0,e).each((function(r){var o=r.container;ot(o,n.start.length,e).each((function(n){var r=t.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Y(t,r,(function(t){return t===e}))}))}))},lt=function(t,e){var n=t.dom,r=t.selection.getRng();return Z(t,r).filter((function(e){var r=V(t),o=""===r&&n.is(e,"body")||n.is(e,r);return null!==e&&o})).bind((function(t){var r=t.textContent;return function(t,e){var n=e.replace(" "," ");return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,(function(t){return 0===e.indexOf(t.start)||0===n.indexOf(t.start)}),c)}(e,r).map((function(e){return W.trim(r).length===e.start.length?[]:[{pattern:e,range:ut(n.getRoot(),t,0,t,0)}]}))})).getOr([])},ft=0,dt=function(t,e){return t.create("span",{"data-mce-type":"bookmark",id:e})},mt=function(t,e){var n=t.createRng();return n.setStartAfter(e.start),n.setEndBefore(e.end),n},gt=function(t,e,n){var r=ct(t.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,u=0===r.endOffset?i:i.splitText(r.endOffset),a=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:e,end:u.parentNode.insertBefore(dt(t,e+"-end"),u),start:a.parentNode.insertBefore(dt(t,e+"-start"),a)}},ht=function(t,e,n){K(t,t.get(e.prefix+"-end"),n),K(t,t.get(e.prefix+"-start"),n)},pt=function(t,e,n,r){var o,i=e.start;return function(t,e,n,r,o){var i=$(t,function(t){return function(e){return t.isBlock(e)||w(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}}(t));return m.from(i.backwards(e,n,r,o))}(t,r.container,r.offset,(o=i,function(t,e){var n=t.data.substring(0,e),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=t.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),m.some(o)}var u=r.offset-i.length;return rt(r.container,u,n).map((function(e){var n=t.createRng();return n.setStart(e.container,e.offset),n.setEnd(r.container,r.offset),n})).filter((function(t){return t.toString()===i})).orThunk((function(){return pt(t,e,n,G(r.container,0))}))}))},vt=function(t,e,n){var r=t.dom,o=r.getRoot(),i=n.pattern,u=n.position.container,a=n.position.offset;return rt(u,a-n.pattern.end.length,e).bind((function(c){var s=ut(o,c.container,c.offset,u,a);if(Q(i))return m.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=bt(t,n.remainingPatterns,c.container,c.offset,e),f=l.getOr({matches:[],position:c}),d=f.position;return function(t,e,n,r,o,i){if(void 0===i&&(i=!1),0===e.start.length&&!i){var u=t.createRng();return u.setStart(n,r),u.setEnd(n,r),m.some(u)}return nt(n,r,o).bind((function(n){return pt(t,e,o,n).bind((function(t){if(i){if(t.endContainer===n.container&&t.endOffset===n.offset)return m.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return m.none()}return m.some(t)}))}))}(r,i,d.container,d.offset,e,l.isNone()).map((function(t){var e=function(t,e){return ut(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}(o,t);return{matches:f.matches.concat([{pattern:i,startRng:e,endRng:s}]),position:G(t.startContainer,t.startOffset)}}))}))},bt=function(t,e,n,r,o){var i=t.dom;return nt(n,r,i.getRoot()).bind((function(u){var a=i.createRng();a.setStart(o,0),a.setEnd(n,r);for(var c,s,l=a.toString(),f=0;f<e.length;f++){var d=e[f];if(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(c=l,s=d.end,c.length-s.length)){var g=e.slice();g.splice(f,1);var h=vt(t,o,{pattern:d,remainingPatterns:g,position:u});if(h.isSome())return h}}return m.none()}))},yt=function(t,e,n){t.selection.setRng(n),"inline-format"===e.type?C(e.format,(function(e){t.formatter.apply(e)})):t.execCommand(e.cmd,!1,e.value)},wt=function(t,e,n){var r=t.selection.getRng();return!1===r.collapsed?[]:Z(t,r).bind((function(o){var i=r.startOffset-(n?1:0);return bt(t,e,r.startContainer,i,o)})).fold((function(){return[]}),(function(t){return t.matches}))},xt=function(t,e){if(0!==e.length){var n=t.dom,r=t.selection.getBookmark(),i=function(t,e){var n,r=(n=(new Date).getTime(),"mce_textpattern_"+Math.floor(1e9*Math.random())+ ++ft+String(n)),i=k(e,(function(e,n){var i=gt(t,r+"_end"+e.length,n.endRng);return e.concat([o(o({},n),{endMarker:i})])}),[]);return k(i,(function(e,n){var u=i.length-e.length-1,a=Q(n.pattern)?n.endMarker:gt(t,r+"_start"+u,n.startRng);return e.concat([o(o({},n),{startMarker:a})])}),[])}(n,e);C(i,(function(e){var r=n.getParent(e.startMarker.start,n.isBlock),o=function(t){return t===r};Q(e.pattern)?function(t,e,n,r){var o=mt(t.dom,n);Y(t.dom,o,r),yt(t,e,o)}(t,e.pattern,e.endMarker,o):function(t,e,n,r,o){var i=t.dom,u=mt(i,r),a=mt(i,n);Y(i,a,o),Y(i,u,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=mt(i,c);yt(t,e,s)}(t,e.pattern,e.startMarker,e.endMarker,o),ht(n,e.endMarker,o),ht(n,e.startMarker,o)})),t.selection.moveToBookmark(r)}},Ct=function(t,e){var n=wt(t,e.inlinePatterns,!0);n.length>0&&t.undoManager.transact((function(){xt(t,n)}))},St=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0},kt=function(t,e){var n=[",",".",";",":","!","?"],r=[32];t.on("keydown",(function(n){13!==n.keyCode||U.modifierPressed(n)||function(t,e){if(!t.selection.isCollapsed())return!1;var n=wt(t,e.inlinePatterns,!1),r=lt(t,e.blockPatterns);return(r.length>0||n.length>0)&&(t.undoManager.add(),t.undoManager.extra((function(){t.execCommand("mceInsertNewLine")}),(function(){t.insertContent("\ufeff"),xt(t,n),function(t,e){if(0!==e.length){var n=t.selection.getBookmark();C(e,(function(e){return function(t,e){var n=t.dom,r=e.pattern,o=ct(n.getRoot(),e.range).getOrDie("Unable to resolve path range");return Z(t,o).each((function(e){"block-format"===r.type?J(r.format,t.formatter)&&t.undoManager.transact((function(){st(t.dom,e,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((function(){st(t.dom,e,r),t.execCommand(r.cmd,!1,r.value)}))})),!0}(t,e)})),t.selection.moveToBookmark(n)}}(t,r);var e=t.selection.getRng(),o=nt(e.startContainer,e.startOffset,t.dom.getRoot());t.execCommand("mceInsertNewLine"),o.each((function(e){var n=e.container;"\ufeff"===n.data.charAt(e.offset-1)&&(n.deleteData(e.offset-1,1),K(t.dom,n.parentNode,(function(e){return e===t.dom.getRoot()})))}))})),!0)}(t,e.get())&&n.preventDefault()}),!0),t.on("keyup",(function(n){St(r,n,(function(t,e){return t===e.keyCode&&!1===U.modifierPressed(e)}))&&Ct(t,e.get())})),t.on("keypress",(function(r){St(n,r,(function(t,e){return t.charCodeAt(0)===e.charCode}))&&j.setEditorTimeout(t,(function(){Ct(t,e.get())}))}))};r.add("textpattern",(function(t){var e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(function(t){var e=t.getParam("textpattern_patterns",F,"array");if(!v(e))return H("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=E(x(e,B));return C(n.errors,(function(t){return H(t.message,t.pattern)})),I(n.values)}(t));return kt(t,e),function(t){return{setPatterns:function(e){var n=E(x(e,B));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}t.set(I(n.values))},getPatterns:function(){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}(x(t.get().inlinePatterns,P),x(t.get().blockPatterns,P))}}}(e)}))}()},3356:(t,e,n)=>{n(3562)},3562:()=>{!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp("[-'\\.‘’․﹒'.]"),new RegExp("[:··״‧︓﹕:]"),new RegExp("[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]"),new RegExp("[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]"),new RegExp("\\r"),new RegExp("\\n"),new RegExp("[\v\f \u2028\u2029]"),new RegExp("[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]"),new RegExp("[-឴឵---\ufeff-]"),new RegExp("[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]"),new RegExp("[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]"),new RegExp("@")],i=new RegExp("^[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]$"),u=o,a=function(t){for(var e=13,n=u.length,r=0;r<n;++r){var o=u[r];if(o&&o.test(t)){e=r;break}}return e},c=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(0===n&&0===r)return!1;var o=t[e+2];if(0===n&&(2===r||1===r||12===r)&&0===o)return!1;var i=t[e-1];return(2!==n&&1!==n&&12!==r||0!==r||0!==i)&&(4!==n&&0!==n||4!==r&&0!==r)&&(3!==n&&1!==n||4!==r||4!==i)&&(4!==n||3!==r&&1!==r||4!==o)&&8!==n&&9!==n&&8!==i&&9!==i&&8!==r&&9!==r&&(5!==n||6!==r)&&(7===n||5===n||6===n||7===r||5===r||6===r||(10!==n||10!==r)&&(11!==r||0!==n&&4!==n&&10!==n&&11!==n)&&(11!==n||0!==r&&4!==r&&10!==r)&&12!==n)},s=/^\s+$/,l=i,f=function(t){return"http"===t||"https"===t},d=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],u=0;u<t.length;u++){var d=e(t[u]);"\ufeff"!==d&&(o.push(t[u]),i.push(d))}return function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),c(n,u)){var a=e[u];if((r.includeWhitespace||!s.test(a))&&(r.includePunctuation||!l.test(a))){var d=u-i.length+1,m=u+1,g=e.slice(d,m).join("");if(f(g)){var h=(y=void 0,y=function(t,e){var n;for(n=e;n<t.length&&!s.test(t[n]);n++);return n}(v=e,(b=u)+1),"://"===v.slice(b+1,y).join("").substr(0,3)?y:b),p=t.slice(m,h);Array.prototype.push.apply(i,p),u=h}o.push(i)}i=[]}var v,b,y;return o}(o,i,function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(i,(m=a,g={},function(t){if(g[t])return g[t];var e=m(t);return g[t]=e,e})),n);var m,g},m=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),g=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],u="",a=new m(t,t);t=a.next();)3===t.nodeType?u+=t.data.replace(/\uFEFF/g,""):o(t)&&u.length&&(i.push(u),u="");return u.length&&i.push(u),i},h=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},p=function(t,e){var r=g(t,e).join("\n");return d(r.split(""),n).length},v=function(t,e){var n=g(t,e).join("");return h(n)},b=function(t,e){var n=g(t,e).join("").replace(/\s/g,"");return h(n)},y=function(t,e){return function(){return e(t.getBody(),t.schema)}},w=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},x=function(t){return y(t,p)},C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)},k=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};void 0===t&&(t=300),e.add("wordcount",(function(e){var n=function(t){return{body:{getWordCount:x(t),getCharacterCount:y(t,v),getCharacterCountWithoutSpaces:y(t,b)},selection:{getWordCount:w(t,p),getCharacterCount:w(t,v),getCharacterCountWithoutSpaces:w(t,b)},getCount:x(t)}}(e);return function(t,e){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return k(t,e)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return k(t,e)}})}(e,n),function(t,e,n){var r=C.debounce((function(){return S(t,e)}),n);t.on("init",(function(){S(t,e),C.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)}),0)}))}(e,n,t),n}))}()},5187:(t,e,n)=>{var r={"./content/dark/content.css":2968,"./content/dark/content.min.css":6202,"./content/default/content.css":7286,"./content/default/content.min.css":7362,"./content/document/content.css":287,"./content/document/content.min.css":2271,"./content/writer/content.css":5417,"./content/writer/content.min.css":874,"./ui/oxide-dark/content.css":3341,"./ui/oxide-dark/content.inline.css":8786,"./ui/oxide-dark/content.inline.min.css":4243,"./ui/oxide-dark/content.min.css":9702,"./ui/oxide-dark/content.mobile.css":1389,"./ui/oxide-dark/content.mobile.min.css":3513,"./ui/oxide-dark/fonts/tinymce-mobile.woff":1064,"./ui/oxide-dark/skin.css":8057,"./ui/oxide-dark/skin.min.css":6332,"./ui/oxide-dark/skin.mobile.css":4429,"./ui/oxide-dark/skin.mobile.min.css":18,"./ui/oxide-dark/skin.shadowdom.css":7899,"./ui/oxide-dark/skin.shadowdom.min.css":7548,"./ui/oxide/content.css":9506,"./ui/oxide/content.inline.css":8273,"./ui/oxide/content.inline.min.css":7251,"./ui/oxide/content.min.css":6122,"./ui/oxide/content.mobile.css":993,"./ui/oxide/content.mobile.min.css":8215,"./ui/oxide/fonts/tinymce-mobile.woff":9916,"./ui/oxide/skin.css":8382,"./ui/oxide/skin.min.css":4522,"./ui/oxide/skin.mobile.css":108,"./ui/oxide/skin.mobile.min.css":8537,"./ui/oxide/skin.shadowdom.css":818,"./ui/oxide/skin.shadowdom.min.css":6913};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=5187},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(){},e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},r=function(t){return function(){return t}},o=function(t){return t};function i(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var u=function(t){return function(e){return!t(e)}},a=function(t){return function(){throw new Error(t)}},c=r(!1),s=r(!0),l=tinymce.util.Tools.resolve("tinymce.ThemeManager"),f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var g,h,p,v,b=function(){return y},y=(h=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:v=function(t){return t},getOrThunk:p=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:v,orThunk:p,map:b,each:t,bind:b,exists:c,forall:s,filter:b,equals:h,equals_:h,toArray:function(){return[]},toString:r("none()")}),w=function(t){var e=r(t),n=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=C("string"),O=C("object"),T=C("array"),_=S("boolean"),E=function(t){return void 0===t},A=function(t){return!function(t){return null==t}(t)},N=S("function"),R=S("number"),M=function(t,e){if(T(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},z=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,P=function(t,e){return D.call(t,e)},I=function(t,e){return P(t,e)>-1},L=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},H=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},F=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=z.call(t,r,r+e);n.push(o)}return n},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,c)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!T(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},Y=function(t,e){return K(V(t,e))},J=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},Q=function(t){var e=z.call(t,0);return e.reverse(),e},Z=function(t,e){return W(t,(function(t){return!I(e,t)}))},tt=function(t,e){var n=z.call(t,0);return n.sort(e),n},et=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},nt=function(t){return et(t,0)},rt=function(t){return et(t,t.length-1)},ot=N(Array.from)?Array.from:function(t){return z.call(t)},it=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},ut=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:r(t),getOrThunk:r(t),getOrDie:r(t),or:function(e){return ut(t)},orThunk:function(e){return ut(t)},fold:function(e,n){return n(t)},map:function(e){return ut(e(t))},mapError:function(e){return ut(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},at=function(e){return{is:c,isValue:c,isError:s,getOr:o,getOrThunk:function(t){return t()},getOrDie:function(){return a(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return at(e)},mapError:function(t){return at(t(e))},each:t,bind:function(t){return at(e)},exists:c,forall:s,toOptional:x.none}},ct={value:ut,error:at,fromOption:function(t,e){return t.fold((function(){return at(e)}),ut)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(g||(g={}));var st=function(t,e,n){return t.stype===g.Error?e(t.serror):n(t.svalue)},lt=function(t){return{stype:g.Value,svalue:t}},ft=function(t){return{stype:g.Error,serror:t}},dt=lt,mt=function(t){var e=[],n=[];return j(t,(function(t){st(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},gt=ft,ht=function(t,e){return t.stype===g.Value?e(t.svalue):t},pt=function(t,e){return t.stype===g.Value?{stype:g.Value,svalue:e(t.svalue)}:t},vt=Object.keys,bt=Object.hasOwnProperty,yt=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},wt=function(t,e){return xt(t,(function(t,n){return{k:n,v:e(t,n)}}))},xt=function(t,e){var n={};return yt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ct=function(t,e){var n=[];return yt(t,(function(t,r){n.push(e(t,r))})),n},St=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return x.some(u)}return x.none()},kt=function(t){return Ct(t,(function(t){return t}))},Ot=function(t,e){return Tt(t,e)?x.from(t[e]):x.none()},Tt=function(t,e){return bt.call(t,e)},_t=function(t,e){return Tt(t,e)&&void 0!==t[e]&&null!==t[e]},Et=function(t){if(!T(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=vt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!T(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=vt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!J(e,(function(t){return I(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},At=Object.prototype.hasOwnProperty,Nt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)At.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Rt=Nt((function(t,e){return O(t)&&O(e)?Rt(t,e):e})),Mt=Nt((function(t,e){return e})),zt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Dt=Et([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Bt=function(t){return Dt.defaultedThunk(r(t))},Pt=Dt.strict,It=Dt.asOption,Lt=Dt.defaultedThunk,Ht=(Dt.asDefaultedOptionThunk,Dt.mergeWithThunk),Ft=(Et([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){var n;return(n={})[t]=e,n}),Vt=function(t,e){return Ft(t,e)},jt=function(t){return function(t){var e={};return j(t,(function(t){e[t.key]=t.value})),e}(t)},Ut=function(t){return e(gt,K)(t)},Wt=function(t){var e=mt(t);return e.errors.length>0?Ut(e.errors):dt(e.values)},qt=function(t){return O(t)&&vt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},$t=function(t,e){return gt([{path:t,getErrorInfo:e}])},Gt=Et([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Xt=function(t,e,n){var r=Ot(t,e).fold((function(){return n(t)}),o);return dt(r)},Kt=function(t,e,n,o){return n.fold((function(n,i,u,a){var c=function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(t))}))},s=function(e){return e.fold((function(){var t=Ft(i,o(x.none()));return dt(t)}),(function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(x.some(t)))}))}))};return u.fold((function(){return ht(function(t,e,n){return Ot(e,n).fold((function(){return function(t,e,n){return $t(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+qt(n)}))}(t,n,e)}),dt)}(t,e,n),c)}),(function(t){return ht(Xt(e,n,t),c)}),(function(){return ht(function(t,e){return dt(Ot(t,e))}(e,n),s)}),(function(t){return ht(function(t,e,n){var r=Ot(t,e).map((function(e){return!0===e?n(t):e}));return dt(r)}(e,n,t),s)}),(function(t){var o=t(e),i=pt(Xt(e,n,r({})),(function(t){return Rt(o,t)}));return ht(i,c)}))}),(function(t,n){var r=n(e);return dt(Ft(t,o(r)))}))},Yt=function(t){return{extract:function(e,n,r){return o=t(r,n),i=function(t){return function(t,e){return $t(t,(function(){return e}))}(e,t)},o.stype===g.Error?i(o.serror):o;var o,i},toString:function(){return"val"}}},Jt=function(e){return vt(function(e,n){var r={};return function(t,e,n,r){yt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r}(e,(function(t){return null!=t})))},Qt=function(t){var e=Zt(t),n=q(t,(function(t,e){return e.fold((function(e){return Rt(t,Vt(e,!0))}),r(t))}),{});return{extract:function(t,r,o){var i=_(o)?[]:Jt(o),u=W(i,(function(t){return!_t(n,t)}));return 0===u.length?e.extract(t,r,o):function(t,e){return $t(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,u)},toString:e.toString}},Zt=function(t){return{extract:function(e,n,r){return function(t,e,n,r){return function(t,e){var n=mt(t);return n.errors.length>0?Ut(n.errors):function(t,e){return t.length>0?dt(Rt(e,Mt.apply(void 0,t))):dt(e)}(n.values,e)}(V(n,(function(n){return Kt(t,e,n,r)})),{})}(e,r,t,n)},toString:function(){return"obj{\n"+V(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},te=function(t){return{extract:function(e,n,r){var o=V(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return Wt(o)},toString:function(){return"array("+t.toString()+")"}}},ee=function(t){return{extract:function(e,n,r){for(var o=[],i=0,u=t;i<u.length;i++){var a=u[i].extract(e,n,r);if(a.stype===g.Value)return a;o.push(a)}return Wt(o)},toString:function(){return"oneOf("+V(t,(function(t){return t.toString()})).join(", ")+")"}}},ne=r(Yt(dt)),re=e(te,Zt),oe=Gt.state,ie=Gt.field,ue=function(t,e){return{extract:function(n,r,o){return Ot(o,t).fold((function(){return function(t,e){return $t(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return function(t,e,n,r,o){return Ot(r,o).fold((function(){return function(t,e,n){return $t(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+qt(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))}(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+vt(e)}}},ae=Yt(dt),ce=function(t){return re(t)},se=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}},le=function(t){return Yt((function(e){return t(e).fold(gt,dt)}))},fe=function(t,e){return function(t,e){return{extract:function(n,r,i){var u=vt(i),a=function(e,n){return te(Yt(t)).extract(e,o,n)}(n,u);return ht(a,(function(t){var o=V(t,(function(t){return Gt.field(t,t,Pt(),e)}));return Zt(o).extract(n,r,i)}))},toString:function(){return"setOf("+e.toString()+")"}}}((function(e){return t(e).fold(ft,lt)}),e)},de=function(t,e,n){return r=function(t,e,n,r){return function(t,e){return t.stype===g.Error?{stype:g.Error,serror:e(t.serror)}:t}(e.extract([t],n,r),(function(t){return{input:r,errors:t}}))}(t,e,o,n),st(r,ct.error,ct.value);var r},me=function(t){return t.fold((function(t){throw new Error(he(t))}),o)},ge=function(t,e,n){return me(de(t,e,n))},he=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,V(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+qt(t.input);var e,n},pe=function(t,e){return ue(t,e)},ve=function(t,e){return ue(t,wt(e,Zt))},be=r(ae),ye=function(t,e){return Yt((function(n){var r=typeof n;return t(n)?dt(n):gt("Expected type: "+e+" but got: "+r)}))},we=ye(R,"number"),xe=ye(k,"string"),Ce=ye(_,"boolean"),Se=ye(N,"function"),ke=function(t){var e=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every((function(e){return ke(t[e])}));case"Map":return e(t.keys(),ke)&&e(t.values(),ke);case"Set":return e(t.keys(),ke);default:return!1}},Oe=Yt((function(t){return ke(t)?dt(t):gt("Expected value to be acceptable for sending via postMessage")})),Te=function(t){return le((function(e){return I(t,e)?ct.value(e):ct.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},_e=function(t){return ie(t,t,Pt(),ne())},Ee=function(t,e){return ie(t,t,Pt(),e)},Ae=function(t){return Ee(t,we)},Ne=function(t){return Ee(t,xe)},Re=function(t,e){return ie(t,t,Pt(),Te(e))},Me=function(t){return Ee(t,Se)},ze=function(t,e){return ie(t,t,Pt(),Zt(e))},De=function(t,e){return ie(t,t,Pt(),re(e))},Be=function(t,e){return ie(t,t,Pt(),te(e))},Pe=function(t){return ie(t,t,It(),ne())},Ie=function(t,e){return ie(t,t,It(),e)},Le=function(t){return Ie(t,we)},He=function(t){return Ie(t,xe)},Fe=function(t){return Ie(t,Se)},Ve=function(t,e){return Ie(t,Zt(e))},je=function(t,e){return ie(t,t,Bt(e),ne())},Ue=function(t,e,n){return ie(t,t,Bt(e),n)},We=function(t,e){return Ue(t,e,we)},qe=function(t,e){return Ue(t,e,xe)},$e=function(t,e,n){return Ue(t,e,Te(n))},Ge=function(t,e){return Ue(t,e,Ce)},Xe=function(t,e){return Ue(t,e,Se)},Ke=function(t,e,n){return Ue(t,e,te(n))},Ye=function(t,e,n){return Ue(t,e,Zt(n))},Je=function(t,e){return oe(t,e)},Qe=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Ze=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},tn=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ze(n.childNodes[0])},en=function(t,e){var n=(e||document).createElement(t);return Ze(n)},nn=function(t,e){var n=(e||document).createTextNode(t);return Ze(n)},rn=Ze,on=function(){return un(0,0)},un=function(t,e){return{major:t,minor:e}},an=function(t,e){var n=String(e).toLowerCase();return 0===t.length?on():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return un(r(1),r(2))}(t,n)},cn=on,sn=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},ln=function(t,e){return-1!==t.indexOf(e)},fn=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,t.length-e.length)},dn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),mn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,gn=function(t){return function(e){return ln(e,t)}},hn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ln(t,"edge/")&&ln(t,"chrome")&&ln(t,"safari")&&ln(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,mn],search:function(t){return ln(t,"chrome")&&!ln(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ln(t,"msie")||ln(t,"trident")}},{name:"Opera",versionRegexes:[mn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:gn("firefox")},{name:"Safari",versionRegexes:[mn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ln(t,"safari")||ln(t,"mobile/"))&&ln(t,"applewebkit")}}],pn=[{name:"Windows",search:gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ln(t,"iphone")||ln(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:gn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:gn("linux"),versionRegexes:[]},{name:"Solaris",search:gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:gn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:gn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],vn={browsers:r(hn),oses:r(pn)},bn="Edge",yn="Chrome",wn="Opera",xn="Firefox",Cn="Safari",Sn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(bn),isChrome:r(yn),isIE:r("IE"),isOpera:r(wn),isFirefox:r(xn),isSafari:r(Cn)}},kn=function(){return Sn({current:void 0,version:cn()})},On=Sn,Tn=(r(bn),r(yn),r("IE"),r(wn),r(xn),r(Cn),"Windows"),_n="Android",En="Linux",An="Solaris",Nn="FreeBSD",Rn="ChromeOS",Mn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Tn),isiOS:r("iOS"),isAndroid:r(_n),isOSX:r("OSX"),isLinux:r(En),isSolaris:r(An),isFreeBSD:r(Nn),isChromeOS:r(Rn)}},zn=function(){return Mn({current:void 0,version:cn()})},Dn=Mn,Bn=(r(Tn),r("iOS"),r(_n),r(En),r("OSX"),r(An),r(Nn),r(Rn),function(t,e){var n=vn.browsers(),o=vn.oses(),i=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(kn,On),u=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(zn,Dn),a=function(t,e,n,o){var i=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:r(i),isiPhone:r(u),isTablet:r(s),isPhone:r(l),isTouch:r(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:r(f),isDesktop:r(d)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}}),Pn=function(t){return window.matchMedia(t).matches},In=zt((function(){return Bn(navigator.userAgent,Pn)})),Ln=function(){return In()},Hn=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Fn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Vn=function(t,e){return t.dom===e.dom},jn=function(t,e){return Ln().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Un=function(t){return N(t)?t:c},Wn=function(t,e,n){for(var r=t.dom,o=Un(n);r.parentNode;){r=r.parentNode;var i=rn(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()},qn=function(t,e,n){var r=e(t),o=Un(n);return r.orThunk((function(){return o(t)?x.none():Wn(t,e,o)}))},$n=function(t,e){return Vn(t.element,e.event.target)},Gn=function(e){if(!_t(e,"can")&&!_t(e,"abort")&&!_t(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return ge("Extracting event.handler",Qt([je("can",s),je("abort",c),je("run",t)]),e)},Xn=r,Kn=Xn("touchstart"),Yn=Xn("touchmove"),Jn=Xn("touchend"),Qn=Xn("touchcancel"),Zn=Xn("mousedown"),tr=Xn("mousemove"),er=Xn("mouseout"),nr=Xn("mouseup"),rr=Xn("mouseover"),or=Xn("focusin"),ir=Xn("focusout"),ur=Xn("keydown"),ar=Xn("keyup"),cr=Xn("input"),sr=Xn("change"),lr=Xn("click"),fr=Xn("transitionend"),dr=Xn("selectstart"),mr=function(t){return r("alloy."+t)},gr={tap:mr("tap")},hr=mr("focus"),pr=mr("blur.post"),vr=mr("paste.post"),br=mr("receive"),yr=mr("execute"),wr=mr("focus.item"),xr=gr.tap,Cr=mr("longpress"),Sr=mr("sandbox.close"),kr=mr("typeahead.cancel"),Or=mr("system.init"),Tr=mr("system.touchmove"),_r=mr("system.touchend"),Er=mr("system.scroll"),Ar=mr("system.resize"),Nr=mr("system.attached"),Rr=mr("system.detached"),Mr=mr("system.dismissRequested"),zr=mr("system.repositionRequested"),Dr=mr("focusmanager.shifted"),Br=mr("slotcontainer.visibility"),Pr=mr("change.tab"),Ir=mr("dismiss.tab"),Lr=mr("highlight"),Hr=mr("dehighlight"),Fr=function(t,e){Wr(t,t.element,e,{})},Vr=function(t,e,n){Wr(t,t.element,e,n)},jr=function(t){Fr(t,yr())},Ur=function(t,e,n){Wr(t,e,n,{})},Wr=function(t,e,n,r){var o=f({target:e},r);t.getSystem().triggerEvent(n,e,o)},qr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},$r=function(t){return jt(t)},Gr=function(t,e){return{key:t,value:Gn({abort:e})}},Xr=function(t){return{key:t,value:Gn({run:function(t,e){e.event.prevent()}})}},Kr=function(t,e){return{key:t,value:Gn({run:e})}},Yr=function(t,e,n){return{key:t,value:Gn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Jr=function(t){return function(e){return{key:t,value:Gn({run:function(t,n){$n(t,n)&&e(t,n)}})}}},Qr=function(t,e,n){return function(t,e){return Kr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){qr(e,e.element,t,r)}))}))}(t,e.partUids[n])},Zr=function(t,e){return Kr(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).fold((function(){return qn(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),c).getOr(t)}),(function(t){return t}));e(t,o,n)}))},to=function(t){return Kr(t,(function(t,e){e.cut()}))},eo=function(t){return Kr(t,(function(t,e){e.stop()}))},no=function(t,e){return Jr(t)(e)},ro=Jr(Nr()),oo=Jr(Rr()),io=Jr(Or()),uo=function(t){return function(e){return Kr(t,e)}}(yr()),ao=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),co=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},so=co(1),lo=co(3),fo=co(9),mo=co(11),go=function(t){return rn(t.dom.ownerDocument)},ho=function(t){return fo(t)?t:go(t)},po=function(t){return rn(ho(t).dom.documentElement)},vo=function(t){return rn(ho(t).dom.defaultView)},bo=function(t){return x.from(t.dom.parentNode).map(rn)},yo=function(t){return x.from(t.dom.offsetParent).map(rn)},wo=function(t){return V(t.dom.childNodes,rn)},xo=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rn)},Co=function(t,e){bo(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},So=function(t,e){(function(t){return x.from(t.dom.nextSibling).map(rn)})(t).fold((function(){bo(t).each((function(t){Oo(t,e)}))}),(function(t){Co(t,e)}))},ko=function(t,e){(function(t){return xo(t,0)})(t).fold((function(){Oo(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Oo=function(t,e){t.dom.appendChild(e.dom)},To=function(t,e){j(e,(function(e){Oo(t,e)}))},_o=function(t){t.dom.textContent="",j(wo(t),(function(t){Eo(t)}))},Eo=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ao=function(t){var e,n=wo(t);n.length>0&&(e=t,j(n,(function(t){Co(e,t)}))),Eo(t)},No=function(t){return t.dom.innerHTML},Ro=function(t,e){var n,r,o=go(t).dom,i=rn(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,wo(rn(r)));To(i,u),_o(t),Oo(t,i)},Mo=function(t,e,n){if(!(k(n)||_(n)||R(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},zo=function(t,e,n){Mo(t.dom,e,n)},Do=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Bo=function(t,e){return x.from(Do(t,e))},Po=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Io=function(t,e){t.dom.removeAttribute(e)},Lo=function(t){return function(t){var e=en("div"),n=rn(t.dom.cloneNode(!0));return Oo(e,n),No(e)}(function(t){return function(t,e){return rn(t.dom.cloneNode(!1))}(t)}(t))},Ho=function(t){return Lo(t)},Fo=$r([function(t,e){return{key:t,value:Gn({can:function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return Vn(e,t.element)&&!Vn(e,n)}(t,r,o)||(console.warn(hr()+" did not get interpreted by the desired target. \nOriginator: "+Ho(r)+"\nTarget: "+Ho(o)+"\nCheck the "+hr()+" event handlers"),!1)}})}}(hr())]),Vo=Object.freeze({__proto__:null,events:Fo}),jo=0,Uo=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++jo+String(e)},Wo=r("alloy-id-"),qo=r("data-alloy-id"),$o=Wo(),Go=qo(),Xo=function(t,e){Object.defineProperty(t.dom,Go,{value:e,writable:!0})},Ko=function(t){var e=so(t)?t.dom[Go]:null;return x.from(e)},Yo=function(t){return Uo(t)},Jo=o,Qo=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Ho(t().element)+" is not in context.":""))}};return{debugInfo:r("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:c}},Zo=Qo(),ti=function(t){return V(t,(function(t){return fn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},ei=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(i)}},t},ni=Uo("alloy-premade"),ri=function(t){return Vt(ni,t)},oi=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ti(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,m([e.getApis(),e],n))}),t)},ii={init:function(){return ui({readState:function(){return"No State required"}})}},ui=function(t){return t},ai=function(t,e){var n={};return yt(t,(function(t,r){yt(t,(function(t,o){var i=Ot(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},ci=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},si=function(t){return t.cHandler},li=function(t,e){return{name:t,handler:e}},fi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=tt(n,(function(e,n){var o=e.name,i=n.name,u=r.indexOf(o),a=r.indexOf(i);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));return u<a?-1:a<u?1:0}));return ct.value(o)}catch(t){return ct.error([t])}}("Event: "+n,0,t,r).map((function(t){return function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return Gn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,(function(t){t.run.apply(void 0,e)}))}})}(V(t,(function(t){return t.handler})))})):function(t,e){return ct.error(["The event ("+t+') 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(V(e,(function(t){return t.name})),null,2)])}(n,t)},di=function(t,e){var n,o,i,u=Ct(t,(function(t,n){return(1===t.length?ct.value(t[0].handler):fi(t,e,n)).map((function(o){var i=function(t){var e=function(t){return N(t)?{can:r(!0),abort:r(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}}(o),u=t.length>1?W(e[n],(function(e){return L(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Vt(n,function(t,e){return{handler:t,purpose:e}}(i,u))}))}));return n={},(i=function(t){var e=[],n=[];return j(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(u)).errors.length>0?(o=i.errors,ct.error(K(o))):function(t,e){return 0===t.length?ct.value(e):ct.value(Rt(e,Mt.apply(void 0,t)))}(i.values,n)},mi="alloy.base.behaviour",gi=function(t){return t.events},hi=function(t,e){var n=Do(t,e);return void 0===n||""===n?[]:n.split(" ")},pi=function(t){return void 0!==t.dom.classList},vi=function(t,e){pi(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=hi(t,e).concat([n]);zo(t,e,r.join(" "))})(t,"class",e)}(t,e)},bi=function(t,e){pi(t)?t.dom.classList.remove(e):function(t,e){(function(t,e,n){var r=W(hi(t,e),(function(t){return t!==n}));r.length>0?zo(t,e,r.join(" ")):Io(t,e)})(t,"class",e)}(t,e),function(t){0===(pi(t)?t.dom.classList:function(t){return hi(t,"class")}(t)).length&&Io(t,"class")}(t)},yi=function(t,e){return pi(t)&&t.dom.classList.contains(e)},wi=function(t,e){j(e,(function(e){vi(t,e)}))},xi=function(t,e){j(e,(function(e){bi(t,e)}))},Ci=function(t){return void 0!==t.style&&N(t.style.getPropertyValue)},Si=function(t){return mo(t)},ki=N(Element.prototype.attachShadow)&&N(Node.prototype.getRootNode),Oi=r(ki),Ti=ki?function(t){return rn(t.dom.getRootNode())}:ho,_i=function(t){return Si(t)?t:rn(ho(t).dom.body)},Ei=function(t){var e=Ti(t);return Si(e)?x.some(e):x.none()},Ai=function(t){return rn(t.dom.host)},Ni=function(t){var e=lo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Ei(rn(e)).fold((function(){return o.body.contains(e)}),(n=Ni,r=Ai,function(t){return n(r(t))}))},Ri=function(){return Mi(rn(document))},Mi=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return rn(e)},zi=function(t,e,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ci(t)&&t.style.setProperty(e,n)},Di=function(t,e){Ci(t)&&t.style.removeProperty(e)},Bi=function(t,e,n){var r=t.dom;zi(r,e,n)},Pi=function(t,e){var n=t.dom;yt(e,(function(t,e){zi(n,e,t)}))},Ii=function(t,e){var n=t.dom;yt(e,(function(t,e){t.fold((function(){Di(n,e)}),(function(t){zi(n,e,t)}))}))},Li=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ni(t)?r:Hi(n,e)},Hi=function(t,e){return Ci(t)?t.style.getPropertyValue(e):""},Fi=function(t,e){var n=t.dom,r=Hi(n,e);return x.from(r).filter((function(t){return t.length>0}))},Vi=function(t){var e={},n=t.dom;if(Ci(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},ji=function(t,e,n){var r=en(t);return Bi(r,e,n),Fi(r,e).isSome()},Ui=function(t,e){var n=t.dom;Di(n,e),Bo(t,"style").map(dn).is("")&&Io(t,"style")},Wi=function(t){return t.dom.offsetWidth},qi=function(t){return t.dom.value},$i=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Gi=function(t){return function(t,e){return function(t,e){var n=V(e,(function(t){return Ve(t.name(),[_e("config"),je("state",ii)])})),r=de("component.behaviours",Zt(n),t.behaviours).fold((function(e){throw new Error(he(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:wt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)}(t,function(t){var e=Ot(t,"behaviours").getOr({}),n=W(vt(e),(function(t){return void 0!==e[t]}));return V(n,(function(t){return e[t].me}))}(t))},Xi=function(t,e,n){var r={"alloy.base.behaviour":gi(t)};return function(t,e,n,r){var o=function(t,e,n){var r=f(f({},n),function(t,e){var n={};return j(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return ai(r,li)}(t,n,r);return di(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ki=function(t){var e=function(){return d},n=Qe(Zo),o=me(function(t){var e,n;return de("custom.definition",Zt([ie("dom","dom",Pt(),Zt([_e("tag"),je("styles",{}),je("classes",[]),je("attributes",{}),Pe("value"),Pe("innerHtml")])),_e("components"),_e("uid"),je("events",{}),je("apis",{}),ie("eventOrder","eventOrder",(e={},e[yr()]=["disabling",mi,"toggling","typeaheadevents"],e[hr()]=[mi,"focusing","keying"],e[Or()]=[mi,"disabling","toggling","representing"],e[cr()]=[mi,"representing","streaming","invalidating"],e[Rr()]=[mi,"representing","item-events","tooltipping"],e[Zn()]=["focusing",mi,"item-type-events"],e[Kn()]=["focusing",mi,"item-type-events"],e[rr()]=["item-type-events","tooltipping"],e[br()]=["receiving","reflecting","tooltipping"],n=e,Dt.mergeWithThunk(r(n))),be()),Pe("domModification")]),t)}(t)),i=Gi(t),u=function(t){return t.list}(i),a=function(t){return t.data}(i),c=function(t){var e=en(t.tag);!function(t,e){var n=t.dom;yt(e,(function(t,e){Mo(n,e,t)}))}(e,t.attributes),wi(e,t.classes),Pi(e,t.styles),t.innerHtml.each((function(t){return Ro(e,t)}));var n=t.domChildren;return To(e,n),t.value.each((function(t){$i(e,t)})),t.uid,Xo(e,t.uid),e}(function(t,e,n){var r,o,i,u=f(f({},(r=t).dom),{uid:r.uid,domChildren:V(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return ci({})}),ci)}(t),c={"alloy.base.modification":a};return i=e.length>0?function(t,e,n,r){var o=f({},e);j(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=ai(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return q(t,(function(t,e){return f(f({},e.modification),t)}),{})},a=q(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return ci({classes:a,attributes:c,styles:s})}(n,c,e,u):a,f(f({},o=u),{attributes:f(f({},o.attributes),i.attributes),styles:f(f({},o.styles),i.styles),classes:o.classes.concat(i.classes)})}(o,u,a)),s=Xi(o,u,a),l=Qe(o.components),d={getSystem:n.get,config:function(e){var n=a;return(N(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return N(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Qo(e))},element:c,syncComponents:function(){var t=wo(c),e=Y(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));l.set(e)},components:l.get,events:s};return d},Yi=function(t){var e=nn(t);return Ji({element:e})},Ji=function(e){var n=ge("external.component",Qt([_e("element"),Pe("uid")]),e),o=Qe(Qo());n.uid.each((function(t){Xo(n.element,t)}));var i={getSystem:o.get,config:x.none,hasConfigured:c,connect:function(t){o.set(t)},disconnect:function(){o.set(Qo((function(){return i})))},getApis:function(){return{}},element:n.element,spec:e,readState:r("No state"),syncComponents:t,components:r([]),events:{}};return ri(i)},Qi=Yo,Zi=function(t){return function(t){return Ot(t,ni)}(t).fold((function(){return function(t){var e=Jo(t),n=e.events,r=d(e,["events"]),o=function(t){var e=Ot(t,"components").getOr([]);return V(e,Zi)}(r),i=f(f({},r),{events:f(f({},Vo),n),components:o});return ct.value(Ki(i))}(t.hasOwnProperty("uid")?t:f({uid:Qi("")},t)).getOrDie()}),(function(t){return t}))},tu=ri;function eu(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Li(n,t);return parseFloat(o)||0}return r},r=function(t,e){return $(e,(function(e,n){var r=Li(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!R(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ci(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var nu=eu("height",(function(t){var e=t.dom;return Ni(t)?e.getBoundingClientRect().height:e.offsetHeight})),ru=function(t){return nu.get(t)},ou=function(t){return nu.getOuter(t)},iu=function(t,e){return{left:t,top:e,translate:function(n,r){return iu(t+n,e+r)}}},uu=iu,au=function(t,e){return void 0!==t?t:void 0!==e?e:0},cu=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return uu(n.offsetLeft,n.offsetTop);var i=au(null==r?void 0:r.pageYOffset,o.scrollTop),u=au(null==r?void 0:r.pageXOffset,o.scrollLeft),a=au(o.clientTop,n.clientTop),c=au(o.clientLeft,n.clientLeft);return su(t).translate(u-c,i-a)},su=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?uu(n.offsetLeft,n.offsetTop):Ni(t)?function(t){var e=t.getBoundingClientRect();return uu(e.left,e.top)}(e):uu(0,0)},lu=eu("width",(function(t){return t.dom.offsetWidth})),fu=function(t){return lu.get(t)},du=function(t){return lu.getOuter(t)},mu=function(t){var n=rn(function(t){if(Oi()&&A(t.target)){var e=rn(t.target);if(so(e)&&function(t){return A(t.dom.shadowRoot)}(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return nt(n)}}return x.from(t.target)}(t).getOr(t.target)),r=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=e(o,r);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(n,t.clientX,t.clientY,r,o,i,t)},gu=function(t,e,n,r,o){var u=function(t,e){return function(n){t(n)&&e(mu(n))}}(n,r);return t.dom.addEventListener(e,u,o),{unbind:i(hu,t,e,u,o)}},hu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},pu=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return uu(n,r)},vu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},bu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},yu=function(t){var e=void 0===t?window:t,n=e.document,r=pu(rn(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return bu(r.left,r.top,n,o)}),(function(t){return bu(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},wu=function(t,e){return t.view(e).fold(r([]),(function(e){var n=t.owner(e),r=wu(t,n);return[e].concat(r)}))},xu=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(rn)},owner:function(t){return go(t)}}),Cu=function(t){var e=rn(document),n=pu(e);return function(t,e){var n=e.owner(t),r=wu(e,n);return x.some(r)}(t,xu).fold(i(cu,t),(function(e){var r=su(t),o=q(e,(function(t,e){var n=su(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return uu(o.left+r.left+n.left,o.top+r.top+n.top)}))},Su=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ku=function(t){var e=cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Ou=function(t){var e=Cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Tu=function(){return yu(window)};function _u(t,e,n,r,o){return t(n,r)?x.some(n):N(o)&&o(n)?x.none():e(n,r,o)}var Eu,Au=function(t,e,n){for(var r=t.dom,o=N(n)?n:c;r.parentNode;){r=r.parentNode;var i=rn(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},Nu=function(t,e,n){return _u((function(t,e){return e(t)}),Au,t,e,n)},Ru=function(t,e,n){return Nu(t,e,n).isSome()},Mu=function(t,e,n){return Au(t,(function(t){return Hn(t,e)}),n)},zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?x.none():x.from(n.querySelector(t)).map(rn)}(e,t)},Du=function(t,e,n){return _u((function(t,e){return Hn(t,e)}),Mu,t,e,n)},Bu=function(){var t=Uo("aria-owns");return{id:t,link:function(e){zo(e,"aria-owns",t)},unlink:function(t){Io(t,"aria-owns")}}},Pu=function(t,e){return Ru(e,(function(e){return Vn(e,t.element)}),c)||function(t,e){return function(t){return Nu(t,(function(t){if(!so(t))return!1;var e=Do(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Do(t,"id"),n=Ti(t);return zu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return Pu(t,e)}))}(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Eu||(Eu={}));var Iu,Lu=Qe({}),Hu=["alloy/data/Fields","alloy/debugging/Debugging"],Fu=function(t,e,n){return function(t,e,n){switch(Ot(Lu.get(),t).orThunk((function(){var e=vt(Lu.get());return it(e,(function(e){return t.indexOf(e)>-1?x.some(Lu.get()[e]):x.none()}))})).getOr(Eu.NORMAL)){case Eu.NORMAL:return n(Vu());case Eu.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();I(["mousemove","mouseover","mouseout",Or()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:V(n,(function(t){return I(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ho(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case Eu.STOP:return!0}}(t,e,n)},Vu=r({logEventCut:t,logEventStopped:t,logNoParent:t,logEventNoHandlers:t,logEventResponse:t,write:t}),ju=r([_e("menu"),_e("selectedMenu")]),Uu=r([_e("item"),_e("selectedItem")]),Wu=(r(Zt(Uu().concat(ju()))),r(Zt(Uu()))),qu=ze("initSize",[_e("numColumns"),_e("numRows")]),$u=function(){return ze("markers",[_e("backgroundMenu")].concat(ju()).concat(Uu()))},Gu=function(t){return ze("markers",V(t,_e))},Xu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");G(e,(function(t){return t.indexOf("alloy")>0&&!L(Hu,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),ie(e,e,n,le((function(t){return ct.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},Ku=function(e){return Xu(0,e,Bt(t))},Yu=function(t){return Xu(0,t,Bt(x.none))},Ju=function(t){return Xu(0,t,Pt())},Qu=function(t){return Xu(0,t,Pt())},Zu=function(t,e){return Je(t,r(e))},ta=function(t){return Je(t,o)},ea=r(qu),na=function(t,e,n,r,o,i){return{x:t,y:e,bubble:n,direction:r,boundsRestriction:o,label:i}},ra=Et([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),oa=ra.southeast,ia=ra.southwest,ua=ra.northeast,aa=ra.northwest,ca=ra.south,sa=ra.north,la=ra.east,fa=ra.west,da=function(t,e){return function(n,r){for(var o={},i=0,u=n.length;i<u;i++){var a=n[i];o[String(a)]=Ot(e,a).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}return o}(["left","right","top","bottom"])},ma=function(t){return t.x},ga=function(t,e){return t.x+t.width/2-e.width/2},ha=function(t,e){return t.x+t.width-e.width},pa=function(t,e){return t.y-e.height},va=function(t){return t.y+t.height},ba=function(t,e){return t.y+t.height/2-e.height/2},ya=function(t,e,n){return na(ma(t),va(t),n.southeast(),oa(),da(t,{left:1,top:3}),"layout-se")},wa=function(t,e,n){return na(ha(t,e),va(t),n.southwest(),ia(),da(t,{right:0,top:3}),"layout-sw")},xa=function(t,e,n){return na(ma(t),pa(t,e),n.northeast(),ua(),da(t,{left:1,bottom:2}),"layout-ne")},Ca=function(t,e,n){return na(ha(t,e),pa(t,e),n.northwest(),aa(),da(t,{right:0,bottom:2}),"layout-nw")},Sa=function(t,e,n){return na(ga(t,e),pa(t,e),n.north(),sa(),da(t,{bottom:2}),"layout-n")},ka=function(t,e,n){return na(ga(t,e),va(t),n.south(),ca(),da(t,{top:3}),"layout-s")},Oa=function(t,e,n){return na(function(t){return t.x+t.width}(t),ba(t,e),n.east(),la(),da(t,{left:0}),"layout-e")},Ta=function(t,e,n){return na(function(t,e){return t.x-e.width}(t,e),ba(t,e),n.west(),fa(),da(t,{right:1}),"layout-w")},_a=function(){return[ya,wa,xa,Ca,ka,Sa,Oa,Ta]},Ea=function(){return[wa,ya,Ca,xa,ka,Sa,Oa,Ta]},Aa=function(){return[xa,Ca,ya,wa,Sa,ka]},Na=function(){return[Ca,xa,wa,ya,Sa,ka]},Ra=function(){return[ya,wa,xa,Ca,ka,Sa]},Ma=function(){return[wa,ya,Ca,xa,ka,Sa]},za=Object.freeze({__proto__:null,events:function(t){return $r([Kr(br(),(function(e,n){var r=t.channels,o=vt(r),i=n,u=function(t,e){return e.universal?t:W(t,(function(t){return I(e.channels,t)}))}(o,i);j(u,(function(t){var n=r[t],o=n.schema,u=ge("channel["+t+"] data\nReceiver: "+Ho(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),Da=[Ee("channels",fe(ct.value,Qt([Ju("onReceive"),je("schema",be())])))],Ba=function(t,e,n){return io((function(r,o){n(r,t,e)}))},Pa=function(t){return{key:t,value:void 0}},Ia=function(t,e,n,o,u,a,c){var s=function(t){return _t(t,n)?t[n]():x.none()},l=wt(u,(function(t,e){return function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(u.slice(0,1).concat(u.slice(3)))}},t}((function(o){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:r(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[o,t.config,t.state].concat(n))}))}),n,e)}(n,t,e)})),d=wt(a,(function(t,e){return ei(t,e)})),m=f(f(f({},d),l),{revoke:i(Pa,n),config:function(e){var r=ge(n+"-config",t,e);return{key:n,value:{config:r,me:m,configAsRaw:zt((function(){return ge(n+"-config",t,e)})),initialConfig:e,state:c}}},schema:function(){return e},exhibit:function(t,e){return s(t).bind((function(t){return Ot(o,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(ci({}))},name:function(){return n},handlers:function(t){return s(t).map((function(t){return Ot(o,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return m},La=function(t){return jt(t)},Ha=Qt([_e("fields"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),Fa=function(t){var e=ge("Creating behaviour: "+t.name,Ha,t);return function(t,e,n,r,o,i){var u,a=Qt(t),c=Ve(e,[("config",u=t,Ie("config",Qt(u)))]);return Ia(a,c,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Va=Qt([_e("branchKey"),_e("branches"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),ja=function(t){var e=ge("Creating behaviour: "+t.name,Va,t);return function(t,e,n,r,o,i){var u=t,a=Ve(e,[Ie("config",t)]);return Ia(u,a,e,n,r,o,i)}(ve(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Ua=r(void 0),Wa=Fa({fields:Da,name:"receiving",active:za}),qa=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),$a=function(t){return t.dom.focus()},Ga=function(t){return void 0===t&&(t=rn(document)),x.from(t.dom.activeElement).map(rn)},Xa=function(t){return Ga(Ti(t)).filter((function(e){return t.dom.contains(e.dom)}))},Ka=function(e,n){var r=Ti(n),o=Ga(r).bind((function(t){var e,r,o=function(e){return Vn(t,e)};return o(n)?x.some(n):(e=o,(r=function(t){for(var n=0;n<t.childNodes.length;n++){var o=rn(t.childNodes[n]);if(e(o))return x.some(o);var i=r(t.childNodes[n]);if(i.isSome())return i}return x.none()})(n.dom))})),i=e(n);return o.each((function(e){Ga(r).filter((function(t){return Vn(t,e)})).fold((function(){$a(e)}),t)})),i},Ya=function(t,e,n,r,o){return{position:t,left:e,top:n,right:r,bottom:o}},Ja=function(t,e){var n=function(t){return t+"px"};Ii(t,{position:x.some(e.position),left:e.left.map(n),top:e.top.map(n),right:e.right.map(n),bottom:e.bottom.map(n)})},Qa=Et([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Za=function(t,e,n,r,o,i){var u=e.x-n,a=e.y-r,c=o-(u+e.width),s=i-(a+e.height),l=x.some(u),f=x.some(a),d=x.some(c),m=x.some(s),g=x.none();return e.direction.fold((function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,g,g,d,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}))},tc=function(t,e){var n=i(Cu,e),r=t.fold(n,n,(function(){var t=pu();return Cu(e).translate(-t.left,-t.top)})),o=du(e),u=ou(e);return Su(r.left,r.top,o,u)},ec=function(t,e){return e.fold((function(){return t.fold(Tu,Tu,Su)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=nc(t,n.x,n.y);return Su(r.left,r.top,n.width,n.height)}))}))},nc=function(t,e,n){var o=uu(e,n);return t.fold(r(o),r(o),(function(){var t=pu();return o.translate(-t.left,-t.top)}))},rc=(Qa.none,Qa.relative),oc=Qa.fixed,ic=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},uc=function(t,e,n){return Math.min(Math.max(t,e),n)},ac=Et([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),cc=function(t,e,n,u){Ui(e,"max-height"),Ui(e,"max-width");var a,c={width:du(a=e),height:ou(a)};return function(t,e,n,u,a){var c=n.width,s=n.height,l=function(t,i,l,f){return function(t,e,n,i){var u=t.x,a=t.y,c=t.bubble.offset,s=c.left,l=c.top,f=function(t,e,n){var r=function(t,r){var i="top"===t||"bottom"===t?n.top:n.left;return Ot(e,t).bind(o).bind((function(e){return"left"===t||"top"===t?e>=r?x.some(e):x.none():e<=r?x.some(e):x.none()})).map((function(t){return t+i})).getOr(r)},i=r("left",t.x),u=r("top",t.y),a=r("right",t.right),c=r("bottom",t.bottom);return Su(i,u,a-i,c-u)}(i,t.boundsRestriction,c),d=f.y,m=f.bottom,g=f.x,h=f.right,p=a+l,v=function(t,e,n,r,o){var i=o.x,u=o.y,a=o.width,c=o.height,s=t>=i,l=e>=u,f=s&&l,d=t+n<=i+a&&e+r<=u+c,m=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),g=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),h=Math.max(o.x,o.right-n),p=Math.max(o.y,o.bottom-r);return{originInBounds:f,sizeInBounds:d,limitX:uc(t,o.x,h),limitY:uc(e,o.y,p),deltaW:m,deltaH:g}}(u+s,p,e,n,f),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,C=v.limitY,S=v.deltaW,k=v.deltaH,O=r(C+k-d),T=r(m-C),_=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction,T,T,O),E=r(w+S-g),A=r(h-w),N={x:w,y:C,width:S,height:k,maxHeight:_,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction,A,A,E),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:p};return b&&y?ac.fit(N):ac.nofit(N,S,k)}(t(e,n,u),c,s,a).fold(ac.fit,(function(t,e,n){return n>f||e>l?ac.nofit(t,e,n):ac.nofit(i,l,f)}))};return $(t,(function(t,e){var n=i(l,e);return t.fold(ac.fit,n)}),ac.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:oa(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(o,o)}(u.preference,t,c,n,u.bounds)},sc=function(t,e){!function(t,e){var n=nu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Bi(t,"max-height",n+"px")}(t,Math.floor(e))},lc=r((function(t,e){sc(t,e),Pi(t,{"overflow-x":"hidden","overflow-y":"auto"})})),fc=r((function(t,e){sc(t,e)})),dc=function(t,e,n){return void 0===t[e]?n:t[e]},mc=function(t,e,n,r){var o=cc(t,e,n,r);(function(t,e,n){Ja(t,function(t,e){return t.fold((function(){return Ya("absolute",x.some(e.x),x.some(e.y),x.none(),x.none())}),(function(t,n,r,o){return Za("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Za("fixed",e,t,n,r,o)}))}(n.origin,e))})(e,o,r),function(t,e){var n=e.classes;xi(t,n.off),wi(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r)},gc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],hc=function(t,e,n){var r=function(t){return Ot(n,t).getOr([])},o=function(t,e,n){var o=Z(gc,n);return{offset:uu(t,e),classesOn:Y(n,r),classesOff:Y(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},pc=function(){return hc(0,0,{})},vc=function(t,e){return function(n){return"rtl"===bc(n)?e:t}},bc=function(t){return"rtl"===Li(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Iu||(Iu={}));var yc="data-alloy-vertical-dir",wc=function(t){return Ru(t,(function(t){return so(t)&&Do(t,"data-alloy-vertical-dir")===Iu.BottomToTop}))},xc=function(){return Ve("layouts",[_e("onLtr"),_e("onRtl"),Pe("onBottomLtr"),Pe("onBottomRtl")])},Cc=function(t,e,n,r,o,i,u){var a=u.map(wc).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return vc(l,f)(t)},Sc=[_e("hotspot"),Pe("bubble"),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=e.hotspot,o=tc(n,r.element),i=Cc(t.element,e,Ra(),Ma(),Aa(),Na(),x.some(e.hotspot.element));return x.some({anchorBox:o,bubble:e.bubble.getOr(pc()),overrides:e.overrides,layouts:i,placer:x.none()})}))],kc=[_e("x"),_e("y"),je("height",0),je("width",0),je("bubble",pc()),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=nc(n,e.x,e.y),o=Su(r.left,r.top,e.width,e.height),i=Cc(t.element,e,_a(),Ea(),_a(),Ea(),x.none());return x.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:x.none()})}))],Oc=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Tc=Et([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_c=(Tc.before,Tc.on,Tc.after,function(t){return t.fold(o,o,o)}),Ec=Et([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ac={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(t){return Ec.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return rn(t.startContainer)},relative:function(t,e){return _c(t)},exact:function(t,e,n,r){return t}})}(t);return vo(e)},range:Oc},Nc=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rc=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Mc=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zc=Et([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Dc=function(t,e,n){return e(rn(n.startContainer),n.startOffset,rn(n.endContainer),n.endOffset)};zc.ltr,zc.rtl;var Bc,Pc=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(lo),Ic=function(t){return Pc.getOption(t)},Lc=["img","br"],Hc=function(t){return Ic(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||I(Lc,ao(t))},Fc=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?[]:V(n.querySelectorAll(t),rn)}(e,t)},Vc=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return x.some(Oc(rn(e.startContainer),e.startOffset,rn(n.endContainer),n.endOffset))}return x.none()},jc=function(t){if(null===t.anchorNode||null===t.focusNode)return Vc(t);var e=rn(t.anchorNode),n=rn(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=go(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Vn(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?x.some(Oc(e,t.anchorOffset,n,t.focusOffset)):Vc(t)},Uc=function(t,e){return n=function(t,e){return function(t,e){return n=function(t,e){return e.match({domRange:function(t){return{ltr:r(t),rtl:x.none}},relative:function(e,n){return{ltr:zt((function(){return Nc(t,e,n)})),rtl:zt((function(){return x.some(Nc(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:zt((function(){return Rc(t,e,n,r,o)})),rtl:zt((function(){return x.some(Rc(t,r,o,e,n))}))}}})}(t,e),(o=n.ltr()).collapsed?n.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zc.rtl(rn(t.endContainer),t.endOffset,rn(t.startContainer),t.startOffset)})).getOrThunk((function(){return Dc(0,zc.ltr,o)})):Dc(0,zc.ltr,o);var n,o}(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e),o=n.getClientRects(),(i=o.length>0?o[0]:n.getBoundingClientRect()).width>0||i.height>0?x.some(i).map(Mc):x.none();var n,o,i},Wc=function(t,e){return{element:t,offset:e}},qc=Et([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$c=function(t){return t.fold(o,(function(t,e,n){return t.translate(-e,-n)}))},Gc=function(t){return t.fold(o,o)},Xc=function(t){return $(t,(function(t,e){return t.translate(e.left,e.top)}),uu(0,0))},Kc=function(t){var e=V(t,Gc);return Xc(e)},Yc=qc.screen,Jc=qc.absolute,Qc=function(t,e,n){var r=go(t.element),o=pu(r),i=function(t,e,n){var r=vo(n.root).dom;return x.from(r.frameElement).map(rn).filter((function(e){var n=go(e),r=go(t.element);return Vn(n,r)})).map(cu)}(t,0,n).getOr(o);return Jc(i,o.left,o.top)},Zc=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=Yc(uu(o,i));return x.some(function(t,e,n){return{point:t,width:e,height:n}}(c,u,a))},ts=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c,s,l,f,d=[e,t.point],m=(i=function(){return Kc(d)},u=function(){return Kc(d)},a=function(){return function(t){var e=V(t,$c);return Xc(e)}(d)},r.fold(i,u,a)),g=(c=m.left,s=m.top,l=t.width,f=t.height,{x:c,y:s,width:l,height:f}),h=n.showAbove?Aa():Ra(),p=n.showAbove?Na():Ma(),v=Cc(o,n,h,p,h,p,x.none());return{anchorBox:g,bubble:n.bubble.getOr(pc()),overrides:n.overrides,layouts:v,placer:x.none()}}))},es=function(t,e){return lo(t)?Wc(t,e):function(t,e){var n=wo(t);if(0===n.length)return Wc(t,e);if(e<n.length)return Wc(n[e],0);var r=n[n.length-1],o=lo(r)?function(t){return Pc.get(t)}(r).length:wo(r).length;return Wc(r,o)}(t,e)},ns=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return function(t){return function(t){return x.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(jc)}(t)}}))().map((function(t){var e=es(t.start,t.soffset),n=es(t.finish,t.foffset);return Ac.range(e.element,e.offset,n.element,n.offset)}))},rs=[Pe("getSelection"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=vo(e.root).dom,o=Qc(t,0,e),i=ns(r,e).bind((function(t){return Uc(r,Ac.exactFromRange(t)).orThunk((function(){var e=nn("\ufeff");return Co(t.start,e),Uc(r,Ac.exact(e,0,e,1)).map((function(t){return Eo(e),t}))})).bind((function(t){return Zc(t.left,t.top,t.width,t.height)}))})),u=ns(r,e).bind((function(t){return so(t.start)?x.some(t.start):function(t){return bo(t)}(t.start)})).getOr(t.element);return ts(i,o,e,n,u)}))],os=[_e("node"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=Qc(t,0,e);return e.node.bind((function(o){var i=o.dom.getBoundingClientRect(),u=Zc(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return ts(u,r,e,n,a)}))}))],is=function(t){return t.x+t.width},us=function(t,e){return t.x-e.width},as=function(t,e){return t.y-e.height+t.height},cs=function(t){return t.y},ss=function(t,e,n){return na(is(t),cs(t),n.southeast(),oa(),da(t,{left:0,top:2}),"link-layout-se")},ls=function(t,e,n){return na(us(t,e),cs(t),n.southwest(),ia(),da(t,{right:1,top:2}),"link-layout-sw")},fs=function(t,e,n){return na(is(t),as(t,e),n.northeast(),ua(),da(t,{left:0,bottom:3}),"link-layout-ne")},ds=function(t,e,n){return na(us(t,e),as(t,e),n.northwest(),aa(),da(t,{right:1,bottom:3}),"link-layout-nw")},ms=function(){return[ss,ls,fs,ds]},gs=function(){return[ls,ss,ds,fs]},hs=[_e("item"),xc(),je("overrides",{}),Zu("placement",(function(t,e,n){var r=tc(n,e.item.element),o=Cc(t.element,e,ms(),gs(),ms(),gs(),x.none());return x.some({anchorBox:r,bubble:pc(),overrides:e.overrides,layouts:o,placer:x.none()})}))],ps=ve("anchor",{selection:rs,node:os,hotspot:Sc,submenu:hs,makeshift:kc}),vs=function(e,n,r,o,i){!function(e,n,r,o,i,u){var a=dc(u,"maxHeightFunction",lc()),c=dc(u,"maxWidthFunction",t),s=e.anchorBox,l=e.origin,f={bounds:ec(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};mc(s,n,r,f)}(function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)}(r.anchorBox,n),i.element,r.bubble,r.layouts,o,r.overrides)},bs=function(t,e,n,r,o,i){var u=i.map(ku);return ys(t,e,n,r,o,u)},ys=function(t,e,n,o,i,u){var a=ge("positioning anchor.info",ps,o);Ka((function(){Bi(i.element,"position","fixed");var n=Fi(i.element,"visibility");Bi(i.element,"visibility","hidden");var o,c=e.useFixed()?(o=document.documentElement,oc(0,0,o.clientWidth,o.clientHeight)):function(t){var e=cu(t.element),n=t.element.dom.getBoundingClientRect();return rc(e.left,e.top,n.width,n.height)}(t),s=a.placement,l=u.map(r).or(e.getBounds);s(t,a,c).each((function(e){e.placer.getOr(vs)(t,c,e,l,i)})),n.fold((function(){Ui(i.element,"visibility")}),(function(t){Bi(i.element,"visibility",t)})),Fi(i.element,"left").isNone()&&Fi(i.element,"top").isNone()&&Fi(i.element,"right").isNone()&&Fi(i.element,"bottom").isNone()&&Fi(i.element,"position").is("fixed")&&Ui(i.element,"position")}),i.element)},ws=Object.freeze({__proto__:null,position:function(t,e,n,r,o){bs(t,e,n,r,o,x.none())},positionWithin:bs,positionWithinBounds:ys,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),xs=[je("useFixed",c),Pe("getBounds")],Cs=Fa({fields:xs,name:"positioning",active:qa,apis:ws}),Ss=function(t){Fr(t,Rr());var e=t.components();j(e,Ss)},ks=function(t){var e=t.components();j(e,ks),Fr(t,Nr())},Os=function(t,e){Oo(t.element,e.element)},Ts=function(t,e){var n=t.components();!function(t){j(t.components(),(function(t){return Eo(t.element)})),_o(t.element),t.syncComponents()}(t);var r=Z(n,e);j(r,(function(e){Ss(e),t.getSystem().removeFromWorld(e)})),j(e,(function(e){e.getSystem().isConnected()?Os(t,e):(t.getSystem().addToWorld(e),Os(t,e),Ni(t.element)&&ks(e)),t.syncComponents()}))},_s=function(t,e){Es(t,e,Oo)},Es=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ni(t.element)&&ks(e),t.syncComponents()},As=function(t){Ss(t),Eo(t.element),t.getSystem().removeFromWorld(t)},Ns=function(t){var e=bo(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));As(t),e.each((function(t){t.syncComponents()}))},Rs=function(t){var e=t.components();j(e,As),_o(t.element),t.syncComponents()},Ms=function(t,e){zs(t,e,Oo)},zs=function(t,e,n){n(t,e.element);var r=wo(e.element);j(r,(function(t){e.getByDom(t).each(ks)}))},Ds=function(t){var e=wo(t.element);j(e,(function(e){t.getByDom(e).each(Ss)})),Eo(t.element)},Bs=function(t,e,n,r){n.get().each((function(e){Rs(t)}));var o=e.getAttachPoint(t);_s(o,t);var i=t.getSystem().build(r);return _s(t,i),n.set(i),i},Ps=function(t,e,n,r){var o=Bs(t,e,n,r);return e.onOpen(t,o),o},Is=function(t,e,n){n.get().each((function(r){Rs(t),Ns(t),e.onClose(t,r),n.clear()}))},Ls=function(t,e,n){return n.isOpen()},Hs=function(t,e,n){var r=e.getAttachPoint(t);Bi(t.element,"position",Cs.getMode(r)),function(t,e,n,r){Fi(t.element,e).fold((function(){Io(t.element,n)}),(function(e){zo(t.element,n,e)})),Bi(t.element,e,"hidden")}(t,"visibility",e.cloakVisibilityAttr)},Fs=function(t,e,n){(function(t){return L(["top","left","right","bottom"],(function(e){return Fi(t,e).isSome()}))})(t.element)||Ui(t.element,"position"),function(t,e,n){Bo(t.element,n).fold((function(){return Ui(t.element,e)}),(function(n){return Bi(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Vs=Object.freeze({__proto__:null,cloak:Hs,decloak:Fs,open:Ps,openWhileCloaked:function(t,e,n,r,o){Hs(t,e),Ps(t,e,n,r),o(),Fs(t,e)},close:Is,isOpen:Ls,isPartOf:function(t,e,n,r){return Ls(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Bs(t,e,n,r)}))}}),js=Object.freeze({__proto__:null,events:function(t,e){return $r([Kr(Sr(),(function(n,r){Is(n,t,e)}))])}}),Us=[Ku("onOpen"),Ku("onClose"),_e("isPartOf"),_e("getAttachPoint"),je("cloakVisibilityAttr","data-precloak-visibility")],Ws=Fa({fields:Us,name:"sandboxing",active:js,apis:Vs,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=r("not-implemented");return ui({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(x.none())},set:function(e){t.set(x.some(e))},get:function(){return t.get()}})}})}),qs=r("dismiss.popups"),$s=r("reposition.popups"),Gs=r("mouse.released"),Xs=Qt([je("isExtraPart",c),Ve("fireEventInstead",[je("event",Mr())])]),Ks=function(t){var e,n=ge("Dismissal",Xs,t);return(e={})[qs()]={schema:Qt([_e("target")]),onReceive:function(t,e){Ws.isOpen(t)&&(Ws.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Ws.close(t)}),(function(e){return Fr(t,e.event)})))}},e},Ys=Qt([Ve("fireEventInstead",[je("event",zr())]),Me("doReposition")]),Js=function(t){var e,n=ge("Reposition",Ys,t);return(e={})[$s()]={onReceive:function(t){Ws.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Fr(t,e.event)}))}},e},Qs=function(t,e,n){e.store.manager.onLoad(t,e,n)},Zs=function(t,e,n){e.store.manager.onUnload(t,e,n)},tl=Object.freeze({__proto__:null,onLoad:Qs,onUnload:Zs,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),el=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[ro((function(n,r){Qs(n,t,e)})),oo((function(n,r){Zs(n,t,e)}))]:[Ba(t,e,Qs)];return $r(n)}}),nl=function(){var t=Qe(null);return ui({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},rl=function(){var t=Qe({}),e=Qe({});return ui({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Ot(t.get(),n).orThunk((function(){return Ot(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};j(n,(function(t){i[t.value]=t,Ot(t,"meta").each((function(e){Ot(e,"text").each((function(e){u[e]=t}))}))})),t.set(f(f({},r),i)),e.set(f(f({},o),u))},clear:function(){t.set({}),e.set({})}})},ol=Object.freeze({__proto__:null,memory:nl,dataset:rl,manual:function(){return ui({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),il=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},ul=[Pe("initialValue"),_e("getFallbackEntry"),_e("getDataKey"),_e("setValue"),Zu("manager",{setValue:il,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){il(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:rl})],al=[_e("getValue"),je("setValue",t),Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:t,state:ii.init})],cl=[Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:nl})],sl=[Ue("store",{mode:"memory"},ve("mode",{memory:cl,manual:al,dataset:ul})),Ku("onSetValue"),je("resetOnDom",!1)],ll=Fa({fields:sl,name:"representing",active:el,apis:tl,extra:{setValueFrom:function(t,e){var n=ll.getValue(e);ll.setValue(t,n)}},state:ol}),fl=function(t,e){return Ye(t,{},V(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,ie(n,n,It(),Yt((function(t){return gt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Je("dump",o)]))},dl=function(t){return t.dump},ml=function(t,e){return f(f({},t.dump),La(e))},gl=fl,hl=ml,pl="placeholder",vl=Et([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),bl=function(t){return Tt(t,"uiType")},yl=function(t,e,n,i){return function(t,e,n,o){return bl(n)&&n.uiType===pl?function(t,e,n,o){return t.exists((function(t){return t!==n.owner}))?vl.single(!0,r(n)):Ot(o,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+vt(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,o):vl.single(!1,r(n))}(t,0,n,i).fold((function(r,o){var u=bl(n)?o(e,n.config,n.validated):o(e),a=Ot(u,"components").getOr([]),c=Y(a,(function(n){return yl(t,e,n,i)}));return[f(f({},u),{components:c})]}),(function(t,r){if(bl(n)){var i=r(e,n.config,n.validated);return n.validated.preprocess.getOr(o)(i)}return r(e)}))},wl=vl.single,xl=vl.multiple,Cl=r(pl),Sl=Et([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),kl=je("factory",{sketch:o}),Ol=je("schema",[]),Tl=_e("name"),_l=ie("pname","pname",Lt((function(t){return"<alloy."+Uo(t.name)+">"})),be()),El=Je("schema",(function(){return[Pe("preprocess")]})),Al=je("defaults",r({})),Nl=je("overrides",r({})),Rl=Zt([kl,Ol,Tl,_l,Al,Nl]),Ml=Zt([kl,Ol,Tl,Al,Nl]),zl=Zt([kl,Ol,Tl,_l,Al,Nl]),Dl=Zt([kl,El,Tl,_e("unit"),_l,Al,Nl]),Bl=function(t){return t.fold(x.some,x.none,x.some,x.some)},Pl=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Il=function(t,e){return function(n){var r=ge("Converting part type",e,n);return t(r)}},Ll=Il(Sl.required,Rl),Hl=Il(Sl.external,Ml),Fl=Il(Sl.optional,zl),Vl=Il(Sl.group,Dl),jl=r("entirety"),Ul=Object.freeze({__proto__:null,required:Ll,external:Hl,optional:Fl,group:Vl,asNamedPart:Bl,name:Pl,asCommon:function(t){return t.fold(o,o,o,o)},original:jl}),Wl=function(t,e,n,r){return Rt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},ql=function(t,e){var n={};return j(e,(function(e){Bl(e).each((function(e){var r=$l(t,e.pname);n[e.name]=function(n){var o=ge("Part: "+e.name+" in "+t,Zt(e.schema),n);return f(f({},r),{config:n,validated:o})}}))})),n},$l=function(t,e){return{uiType:Cl(),owner:t,name:e}},Gl=function(t,e,n){return{uiType:Cl(),owner:t,name:e,config:n,validated:{}}},Xl=function(t){return Y(t,(function(t){return t.fold(x.none,x.some,x.none,x.none).map((function(t){return ze(t.name,t.schema.concat([ta(jl())]))})).toArray()}))},Kl=function(t){return V(t,Pl)},Yl=function(t,e,n){return function(t,e,n){var o={},i={};return j(n,(function(t){t.fold((function(t){o[t.pname]=wl(!0,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];i[t.name]=r(t.factory.sketch(Wl(e,t,n[jl()]),n))}),(function(t){o[t.pname]=wl(!1,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){o[t.pname]=xl(!0,(function(e,n,r){var o=e[t.name];return V(o,(function(n){return t.factory.sketch(Rt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:r(o),externals:r(i)}}(0,e,n)},Jl=function(t,e,n){return function(t,e,n,o){var i=wt(o,(function(t,e){return o=t,i=!1,{name:r(n=e),required:function(){return o.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+n);return i=!0,o}};var n,o,i})),u=function(t,e,n,r){return Y(n,(function(n){return yl(t,e,n,r)}))}(t,e,n,i);return yt(i,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),u}(x.some(t),e,e.components,n)},Ql=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Zl=function(t,e,n){return Ql(t,e,n).getOrDie("Could not find part: "+n)},tf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]))})),o},ef=function(t,e){var n=t.getSystem();return wt(e.partUids,(function(t,e){return r(n.getByUid(t))}))},nf=function(t){return vt(t.partUids)},rf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]).getOrDie())})),o},of=function(t,e){var n=Kl(e);return jt(V(n,(function(e){return{key:e,value:t+"-"+e}})))},uf=function(t){return ie("partUids","partUids",Ht((function(e){return of(e.uid,t)})),be())},af=Object.freeze({__proto__:null,generate:ql,generateOne:Gl,schemas:Xl,names:Kl,substitutes:Yl,components:Jl,defaultUids:of,defaultUidsSchema:uf,getAllParts:ef,getAllPartNames:nf,getPart:Ql,getPartOrDie:Zl,getParts:tf,getPartsOrDie:rf}),cf=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[ze("parts",t)]:[]).concat([_e("uid"),je("dom",{}),je("components",[]),ta("originalSpec"),je("debug.sketcher",{})]).concat(e)}(r,o);return ge(t+" [SpecSchema]",Qt(i.concat(e)),n)},sf=function(t,e,n,r,o){var i=lf(o),u=Xl(n),a=uf(n),c=cf(t,e,i,u,[a]),s=Yl(0,c,n);return r(c,Jl(t,c,s.internals()),i,s.externals())},lf=function(t){return function(t){return Tt(t,"uid")}(t)?t:f(f({},t),{uid:Yo("uid")})},ff=Qt([_e("name"),_e("factory"),_e("configFields"),je("apis",{}),je("extraApis",{})]),df=Qt([_e("name"),_e("factory"),_e("configFields"),_e("partFields"),je("apis",{}),je("extraApis",{})]),mf=function(t){var e=ge("Sketcher for "+t.name,ff,t),n=wt(e.apis,oi),r=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=lf(r);return n(cf(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},gf=function(t){var e=ge("Sketcher for "+t.name,df,t),n=ql(e.name,e.partFields),r=wt(e.apis,oi),o=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return sf(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},hf=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},pf=function(t,e){return t?x.some(e):x.none()},vf=function(t){return"input"===ao(t)&&"radio"!==Do(t,"type")||"textarea"===ao(t)},bf=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),yf=[_e("find")],wf=Fa({fields:yf,name:"composing",apis:bf}),xf=function(t,e,n,r){var o=Fc(t.element,"."+e.highlightClass);j(o,(function(n){L(r,(function(t){return t.element===n}))||(bi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Fr(n,Hr())})))}))},Cf=function(t,e,n,r){xf(t,e,0,[r]),Sf(t,e,n,r)||(vi(r.element,e.highlightClass),e.onHighlight(t,r),Fr(r,Lr()))},Sf=function(t,e,n,r){return yi(r.element,e.highlightClass)},kf=function(t,e,n){return zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Of=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return(r.length>0?x.some(r[r.length-1]):x.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Tf=function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return X(o,(function(t){return yi(t,e.highlightClass)})).bind((function(e){var n=ic(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},_f=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return hf(V(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ef=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return xf(t,e,0,[])},dehighlight:function(t,e,n,r){Sf(t,e,n,r)&&(bi(r.element,e.highlightClass),e.onDehighlight(t,r),Fr(r,Hr()))},highlight:Cf,highlightFirst:function(t,e,n){kf(t,e).each((function(r){Cf(t,e,n,r)}))},highlightLast:function(t,e,n){Of(t,e).each((function(r){Cf(t,e,n,r)}))},highlightAt:function(t,e,n,r){(function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return x.from(o[r]).fold((function(){return ct.error("No element found with index "+r)}),t.getSystem().getByDom)})(t,e,0,r).fold((function(t){throw new Error(t)}),(function(r){Cf(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=_f(t,e);G(o,r).each((function(r){Cf(t,e,n,r)}))},isHighlighted:Sf,getHighlighted:function(t,e,n){return zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:kf,getLast:Of,getPrevious:function(t,e,n){return Tf(t,e,0,-1)},getNext:function(t,e,n){return Tf(t,e,0,1)},getCandidates:_f}),Af=[_e("highlightClass"),_e("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],Nf=Fa({fields:Af,name:"highlighting",apis:Ef}),Rf=[8],Mf=[9],zf=[13],Df=[27],Bf=[32],Pf=[37],If=[38],Lf=[39],Hf=[40],Ff=function(t,e,n){var r=Q(t.slice(0,e)),o=Q(t.slice(e+1));return G(r.concat(o),n)},Vf=function(t,e,n){var r=Q(t.slice(0,e));return G(r,n)},jf=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return G(o.concat(r),n)},Uf=function(t,e,n){var r=t.slice(e+1);return G(r,n)},Wf=function(t){return function(e){var n=e.raw;return I(t,n.which)}},qf=function(t){return function(e){return J(t,(function(t){return t(e)}))}},$f=function(t){return!0===t.raw.shiftKey},Gf=function(t){return!0===t.raw.ctrlKey},Xf=u($f),Kf=function(t,e){return{matches:t,classification:e}},Yf=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Vn(e,t)}))}))||Vr(t,Dr(),{prevFocus:e,newFocus:n})},Jf=function(){var t=function(t){return Xa(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Yf(e,r,o)}}},Qf=function(){var e=function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))};return{get:e,set:function(n,r){var o=e(n);n.getSystem().getByDom(r).fold(t,(function(t){Nf.highlight(n,t)}));var i=e(n);Yf(n,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Bc||(Bc={}));var Zf=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u;return(i=n(t,e,r,o),u=e.event,G(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([je("focusManager",Jf()),Ue("focusInside","onFocus",le((function(t){return I(["onFocus","onEnterOrSpace","onApi"],t)?ct.value(t):ct.error("Invalid value for focusInside")}))),Zu("handler",u),Zu("state",e),Zu("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Bc.OnFocusMode?x.none():o(t).map((function(n){return Kr(hr(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Kr(ur(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=Wf(Bf.concat(zf))(r.event);t.focusInside===Bc.OnEnterOrSpaceMode&&i&&$n(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Kr(ar(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return $r(u.toArray().concat(a))}};return u},td=function(t){var e=[Pe("onEscape"),Pe("onEnter"),je("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),je("firstTabstop",0),je("useTabstopAt",s),Pe("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Du(e,t)})).getOr(e);return ru(n)>0},o=function(t,e,r){(function(t,e){var r=Fc(t.element,e.selector),o=W(r,(function(t){return n(e,t)}));return x.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},u=function(t,e,r,o){var u=Fc(t.element,r.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,r).bind((function(e){return X(u,i(Vn,e)).bind((function(e){return function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?x.some(!0):x.none()}),(function(e){return o.focusManager.set(t,e),x.some(!0)}))}(t,u,e,r,o)}))}))},a=r([Kf(qf([$f,Wf(Mf)]),(function(t,e,n){var r=n.cyclic?Ff:Vf;return u(t,0,n,r)})),Kf(Wf(Mf),(function(t,e,n){var r=n.cyclic?jf:Uf;return u(t,0,n,r)})),Kf(Wf(Df),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Kf(qf([Xf,Wf(zf)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),c=r([]);return Zf(e,ii.init,a,c,(function(){return x.some(o)}))},ed=td(Je("cyclic",c)),nd=td(Je("cyclic",s)),rd=function(t,e,n){return vf(n)&&Wf(Bf)(e.event)?x.none():function(t,e,n){return Ur(t,n,yr()),x.some(!0)}(t,0,n)},od=function(t,e){return x.some(!0)},id=[je("execute",rd),je("useSpace",!1),je("useEnter",!0),je("useControlEnter",!1),je("useDown",!1)],ud=function(t,e,n){return n.execute(t,e,t.element)},ad=Zf(id,ii.init,(function(t,e,n,r){var o=n.useSpace&&!vf(t.element)?Bf:[],i=n.useEnter?zf:[],u=n.useDown?Hf:[],a=o.concat(i).concat(u);return[Kf(Wf(a),ud)].concat(n.useControlEnter?[Kf(qf([Gf,Wf(zf)]),ud)]:[])}),(function(t,e,n,r){return n.useSpace&&!vf(t.element)?[Kf(Wf(Bf),od)]:[]}),(function(){return x.none()})),cd=function(){var t=Qe(x.none());return ui({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(x.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},sd=Object.freeze({__proto__:null,flatgrid:cd,init:function(t){return t.state(t)}}),ld=function(t){return function(e,n,r,o){var i=t(e.element);return gd(i,e,n,r,o)}},fd=function(t,e){var n=vc(t,e);return ld(n)},dd=function(t,e){var n=vc(e,t);return ld(n)},md=function(t){return function(e,n,r,o){return gd(t,e,n,r,o)}},gd=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},hd=md,pd=md,vd=md,bd=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},yd=function(t,e,n){var r=Fc(t,n);return function(t,n){return X(t,(function(t){return Vn(t,e)})).map((function(e){return{index:e,candidates:t}}))}(W(r,bd))},wd=function(t,e){return X(t,(function(t){return Vn(e,t)}))},xd=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?x.some(t[r]):x.none()}))},Cd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=ic(i,o,0,u-1);return x.some({row:e,column:a})}))},Sd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=ic(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=uc(i,0,a-1);return x.some({row:u,column:c})}))},kd=[_e("selector"),je("execute",rd),Yu("onEscape"),je("captureTab",!1),ea()],Od=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Td=function(t){return function(e,n,r,o){return yd(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},_d=function(t,e,n){return n.captureTab?x.some(!0):x.none()},Ed=Td((function(t,e,n,r){return Cd(t,e,n,r,-1)})),Ad=Td((function(t,e,n,r){return Cd(t,e,n,r,1)})),Nd=Td((function(t,e,n,r){return Sd(t,e,n,r,-1)})),Rd=Td((function(t,e,n,r){return Sd(t,e,n,r,1)})),Md=r([Kf(Wf(Pf),fd(Ed,Ad)),Kf(Wf(Lf),dd(Ed,Ad)),Kf(Wf(If),hd(Nd)),Kf(Wf(Hf),pd(Rd)),Kf(qf([$f,Wf(Mf)]),_d),Kf(qf([Xf,Wf(Mf)]),_d),Kf(Wf(Df),(function(t,e,n){return n.onEscape(t,e)})),Kf(Wf(Bf.concat(zf)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),zd=r([Kf(Wf(Bf),od)]),Dd=Zf(kd,cd,Md,zd,(function(){return x.some(Od)})),Bd=function(t,e,n,r){var o=function(t,e,n){var i,u=ic(e,r,0,n.length-1);return u===t?x.none():(i=n[u],"button"===ao(i)&&"disabled"===Do(i,"disabled")?o(t,u,n):x.from(n[u]))};return yd(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Pd=[_e("selector"),je("getInitial",x.none),je("execute",rd),Yu("onEscape"),je("executeOnMove",!1),je("allowVertical",!0)],Id=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Ld=function(t,e,n){e.getInitial(t).orThunk((function(){return zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Hd=function(t,e,n){return Bd(t,n.selector,e,-1)},Fd=function(t,e,n){return Bd(t,n.selector,e,1)},Vd=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Id(e,n,r):x.some(!0)}))}},jd=function(t,e,n){return n.onEscape(t,e)},Ud=r([Kf(Wf(Bf),od)]),Wd=Zf(Pd,ii.init,(function(t,e,n,r){var o=Pf.concat(n.allowVertical?If:[]),i=Lf.concat(n.allowVertical?Hf:[]);return[Kf(Wf(o),Vd(fd(Hd,Fd))),Kf(Wf(i),Vd(dd(Hd,Fd))),Kf(Wf(zf),Id),Kf(Wf(Bf),Id),Kf(Wf(Df),jd)]}),Ud,(function(){return x.some(Ld)})),qd=function(t,e,n){return x.from(t[e]).bind((function(t){return x.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},$d=function(t,e,n,r){var o=t[e].length,i=ic(n,r,0,o-1);return qd(t,e,i)},Gd=function(t,e,n,r){var o=ic(n,r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Xd=function(t,e,n,r){var o=t[e].length,i=uc(n+r,0,o-1);return qd(t,e,i)},Kd=function(t,e,n,r){var o=uc(n+r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Yd=[ze("selectors",[_e("row"),_e("cell")]),je("cycles",!0),je("previousSelector",x.none),je("execute",rd)],Jd=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return zu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Qd=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Du(r,o.selectors.row).bind((function(t){var e=Fc(t,o.selectors.cell);return wd(e,r).bind((function(e){var r=Fc(n,o.selectors.row);return wd(r,t).bind((function(t){var n=function(t,e){return V(t,(function(t){return Fc(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Zd=Qd((function(t,e,n){return $d(t,e,n,-1)}),(function(t,e,n){return Xd(t,e,n,-1)})),tm=Qd((function(t,e,n){return $d(t,e,n,1)}),(function(t,e,n){return Xd(t,e,n,1)})),em=Qd((function(t,e,n){return Gd(t,n,e,-1)}),(function(t,e,n){return Kd(t,n,e,-1)})),nm=Qd((function(t,e,n){return Gd(t,n,e,1)}),(function(t,e,n){return Kd(t,n,e,1)})),rm=r([Kf(Wf(Pf),fd(Zd,tm)),Kf(Wf(Lf),dd(Zd,tm)),Kf(Wf(If),hd(em)),Kf(Wf(Hf),pd(nm)),Kf(Wf(Bf.concat(zf)),(function(t,e,n){return Xa(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),om=r([Kf(Wf(Bf),od)]),im=Zf(Yd,ii.init,rm,om,(function(){return x.some(Jd)})),um=[_e("selector"),je("execute",rd),je("moveOnTab",!1)],am=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},cm=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},sm=function(t,e,n){return Bd(t,n.selector,e,-1)},lm=function(t,e,n){return Bd(t,n.selector,e,1)},fm=r([Kf(Wf(If),vd(sm)),Kf(Wf(Hf),vd(lm)),Kf(qf([$f,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(sm)(t,e,n,r):x.none()})),Kf(qf([Xf,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(lm)(t,e,n,r):x.none()})),Kf(Wf(zf),am),Kf(Wf(Bf),am)]),dm=r([Kf(Wf(Bf),od)]),mm=Zf(um,ii.init,fm,dm,(function(){return x.some(cm)})),gm=[Yu("onSpace"),Yu("onEnter"),Yu("onShiftEnter"),Yu("onLeft"),Yu("onRight"),Yu("onTab"),Yu("onShiftTab"),Yu("onUp"),Yu("onDown"),Yu("onEscape"),je("stopSpaceKeyup",!1),Pe("focusIn")],hm=Zf(gm,ii.init,(function(t,e,n){return[Kf(Wf(Bf),n.onSpace),Kf(qf([Xf,Wf(zf)]),n.onEnter),Kf(qf([$f,Wf(zf)]),n.onShiftEnter),Kf(qf([$f,Wf(Mf)]),n.onShiftTab),Kf(qf([Xf,Wf(Mf)]),n.onTab),Kf(Wf(If),n.onUp),Kf(Wf(Hf),n.onDown),Kf(Wf(Pf),n.onLeft),Kf(Wf(Lf),n.onRight),Kf(Wf(Bf),n.onSpace),Kf(Wf(Df),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Kf(Wf(Bf),od)]:[]}),(function(t){return t.focusIn})),pm=ed.schema(),vm=nd.schema(),bm=Wd.schema(),ym=Dd.schema(),wm=im.schema(),xm=ad.schema(),Cm=mm.schema(),Sm=hm.schema(),km=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:pm,cyclic:vm,flow:bm,flatgrid:ym,matrix:wm,execution:xm,menu:Cm,special:Sm}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return _t(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:sd}),Om=function(t,e,n,r){var o=t.getSystem().build(r);Es(t,o,n)},Tm=function(t,e,n,r){var o=_m(t);G(o,(function(t){return Vn(r.element,t.element)})).each(Ns)},_m=function(t,e){return t.components()},Em=function(t,e,n,r,o){var i=_m(t);return x.from(i[r]).map((function(e){return Tm(t,0,0,e),o.each((function(e){Om(t,0,(function(t,e){!function(t,e,n){xo(t,n).fold((function(){Oo(t,e)}),(function(t){Co(t,e)}))}(t,e,r)}),e)})),e}))},Am=Fa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Om(t,0,Oo,r)},prepend:function(t,e,n,r){Om(t,0,ko,r)},remove:Tm,replaceAt:Em,replaceBy:function(t,e,n,r,o){var i=_m(t);return X(i,r).bind((function(e){return Em(t,0,0,e,o)}))},set:function(t,e,n,r){Ka((function(){var e=V(r,t.getSystem().build);Ts(t,e)}),t.element)},contents:_m})}),Nm=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=$r(e);return Fa({fields:[_e("enabled")],name:t,active:{events:r(n)}})}(t,e),configAsRaw:r({}),initialConfig:{},state:ii}}},Rm=function(t,e){e.ignore||($a(t.element),e.onFocus(t))},Mm=Object.freeze({__proto__:null,focus:Rm,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return function(t){var e=Ti(t).dom;return t.dom===e.activeElement}(t.element)}}),zm=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return ci(n)},events:function(t){return $r([Kr(hr(),(function(e,n){Rm(e,t),n.stop()}))].concat(t.stopMousedown?[Kr(Zn(),(function(t,e){e.event.prevent()}))]:[]))}}),Dm=[Ku("onFocus"),je("stopMousedown",!1),je("ignore",!1)],Bm=Fa({fields:Dm,name:"focusing",active:zm,apis:Mm}),Pm=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Im=function(t,e,n){e.toggleClass.each((function(e){n.get()?vi(t.element,e):bi(t.element,e)}))},Lm=function(t,e,n){Vm(t,e,n,!n.get())},Hm=function(t,e,n){n.set(!0),Im(t,e,n),Pm(t,e,n)},Fm=function(t,e,n){n.set(!1),Im(t,e,n),Pm(t,e,n)},Vm=function(t,e,n,r){(r?Hm:Fm)(t,e,n)},jm=function(t,e,n){Vm(t,e,n,e.selected)},Um=Object.freeze({__proto__:null,onLoad:jm,toggle:Lm,isOn:function(t,e,n){return n.get()},on:Hm,off:Fm,set:Vm}),Wm=Object.freeze({__proto__:null,exhibit:function(){return ci({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Lm,uo((function(t){o(t,n,r)}))),u=Ba(t,e,jm);return $r(K([t.toggleOnExecute?[i]:[],[u]]))}}),qm=function(t,e,n){zo(t.element,"aria-expanded",n)},$m=[je("selected",!1),Pe("toggleClass"),je("toggleOnExecute",!0),Ue("aria",{mode:"none"},ve("mode",{pressed:[je("syncWithExpanded",!1),Zu("update",(function(t,e,n){zo(t.element,"aria-pressed",n),e.syncWithExpanded&&qm(t,0,n)}))],checked:[Zu("update",(function(t,e,n){zo(t.element,"aria-checked",n)}))],expanded:[Zu("update",qm)],selected:[Zu("update",(function(t,e,n){zo(t.element,"aria-selected",n)}))],none:[Zu("update",t)]}))],Gm=Fa({fields:$m,name:"toggling",active:Wm,apis:Um,state:(!1,{init:function(){var t=Qe(false);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(false)},readState:function(){return t.get()}}}})}),Xm=function(){var t=function(t,e){e.stop(),jr(t)};return[Kr(lr(),t),Kr(xr(),t),to(Kn()),to(Zn())]},Km=function(t){return $r(K([t.map((function(t){return uo((function(e,n){t(e),n.stop()}))})).toArray(),Xm()]))},Ym="alloy.item-hover",Jm="alloy.item-focus",Qm=function(t){(Xa(t.element).isNone()||Bm.isFocused(t))&&(Bm.isFocused(t)||Bm.focus(t),Vr(t,Ym,{item:t}))},Zm=function(t){Vr(t,Jm,{item:t})},tg=r(Ym),eg=r(Jm),ng=[_e("data"),_e("components"),_e("dom"),je("hasSubmenu",!1),Pe("toggling"),gl("itemBehaviours",[Gm,Bm,km,ll]),je("ignoreFocus",!1),je("domModification",{}),Zu("builder",(function(t){return{dom:t.dom,domModification:f(f({},t.domModification),{attributes:f(f(f({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:hl(t.itemBehaviours,[t.toggling.fold(Gm.revoke,(function(t){return Gm.config(f({aria:{mode:"checked"}},t))})),Bm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"execution"}),ll.config({store:{mode:"memory",initialValue:t.data}}),Nm("item-type-events",m(Xm(),[Kr(rr(),Qm),Kr(wr(),Bm.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),je("eventOrder",{})],rg=[_e("dom"),_e("components"),Zu("builder",(function(t){return{dom:t.dom,components:t.components,events:$r([eo(wr())])}}))],og=r([Ll({name:"widget",overrides:function(t){return{behaviours:La([ll.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),ig=[_e("uid"),_e("data"),_e("components"),_e("dom"),je("autofocus",!1),je("ignoreFocus",!1),gl("widgetBehaviours",[ll,Bm,km]),je("domModification",{}),uf(og()),Zu("builder",(function(t){var e=Yl(0,t,og()),n=Jl("item-widget",t,e.internals()),r=function(e){return Ql(e,t,"widget").map((function(t){return km.focusIn(t),t}))},o=function(e,n){return vf(n.event.target)?x.none():t.autofocus?(n.setSource(e.element),x.none()):x.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:$r([uo((function(t,e){r(t).each((function(t){e.stop()}))})),Kr(rr(),Qm),Kr(wr(),(function(e,n){t.autofocus?r(e):Bm.focus(e)}))]),behaviours:hl(t.widgetBehaviours,[ll.config({store:{mode:"memory",initialValue:t.data}}),Bm.config({ignore:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Ua(),onLeft:o,onRight:o,onEscape:function(e,n){return Bm.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),x.none()):x.none():(Bm.focus(e),x.some(!0))}})])}}))],ug=ve("type",{widget:ig,item:ng,separator:rg}),ag=r([Vl({factory:{sketch:function(t){var e=ge("menu.spec item",ug,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:f(f({},e),{uid:Yo("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),cg=r([_e("value"),_e("items"),_e("dom"),_e("components"),je("eventOrder",{}),fl("menuBehaviours",[Nf,ll,wf,km]),Ue("movement",{mode:"menu",moveOnTab:!0},ve("mode",{grid:[ea(),Zu("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Zu("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),_e("rowSelector")],menu:[je("moveOnTab",!0),Zu("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Ee("markers",Wu()),je("fakeFocus",!1),je("focusManager",Jf()),Ku("onHighlight")]),sg=r("alloy.menu-focus"),lg=gf({name:"Menu",configFields:cg(),partFields:ag(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.menuBehaviours,[Nf.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),ll.config({store:{mode:"memory",initialValue:t.value}}),wf.config({find:x.some}),km.config(t.movement.config(t,t.movement))]),events:$r([Kr(eg(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Nf.highlight(t,n),e.stop(),Vr(t,sg(),{menu:t,item:n})}))})),Kr(tg(),(function(t,e){var n=e.event.item;Nf.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),fg=function(t,e,n,r){return Ot(n,r).bind((function(r){return Ot(t,r).bind((function(r){var o=fg(t,e,n,r);return x.some([r].concat(o))}))})).getOr([])},dg=function(t){return"prepared"===t.type?x.some(t.menu):x.none()},mg=function(){var t=Qe({}),e=Qe({}),n=Qe({}),r=Qe(x.none()),o=Qe({}),i=function(t){return u(t).bind(dg)},u=function(t){return Ot(e.get(),t)},a=function(e){return Ot(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(f(f({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(x.some(i)),t.set(a),e.set(u),o.set(c);var s=function(t,e){var n={};yt(t,(function(t,e){j(t,(function(t){n[t]=e}))}));var r=e,o=xt(e,(function(t,e){return{k:t,v:e}})),i=wt(o,(function(t,e){return[e].concat(fg(n,r,o,e))}));return wt(n,(function(t){return Ot(i,t).getOr([t])}))}(c,a);n.set(s)},expand:function(e){return Ot(t.get(),e).map((function(t){var r=Ot(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Ot(n.get(),t)},collapse:function(t){return Ot(n.get(),t).bind((function(t){return t.length>1?x.some(t.slice(1)):x.none()}))},lookupMenu:u,lookupItem:a,otherMenus:function(t){var e=o.get();return Z(vt(e),t)},getPrimary:function(){return r.get().bind(i)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(x.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(e,o){var u=W(a(e).toArray(),(function(t){return i(t).isSome()}));return Ot(n.get(),e).bind((function(e){var n=Q(u.concat(e));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return x.none();e.push(r.getOrDie())}return x.some(e)}(Y(n,(function(e,u){return function(e,n,r){return i(e).bind((function(o){return function(e){return St(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))}(e,o,n.slice(0,u+1)).fold((function(){return r.get().is(e)?[]:[x.none()]}),(function(t){return[x.some(t)]}))})))}))}}},gg=dg,hg=r("collapse-item"),pg=mf({name:"TieredMenu",configFields:[Qu("onExecute"),Qu("onEscape"),Ju("onOpenMenu"),Ju("onOpenSubmenu"),Ku("onRepositionMenu"),Ku("onCollapseMenu"),je("highlightImmediately",!0),ze("data",[_e("primary"),_e("menus"),_e("expansions")]),je("fakeFocus",!1),Ku("onHighlight"),Ku("onHover"),$u(),_e("dom"),je("navigateOnHover",!0),je("stayInDom",!1),fl("tmenuBehaviours",[km,Nf,wf,Am]),je("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Qe(x.none()),o=mg(),i=function(t){return ll.getValue(t).value},u=function(e){return wt(t.data.menus,(function(t,e){return Y(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},a=function(t,e){Nf.highlight(t,e),Nf.getHighlighted(e).orThunk((function(){return Nf.getFirst(e)})).each((function(e){Ur(t,e.element,wr())}))},c=function(t,e){return hf(V(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?x.some(t.menu):x.none()}))})))},s=function(e,n,r){var o=c(n,n.otherMenus(r));j(o,(function(n){xi(n.element,[t.markers.backgroundMenu]),t.stayInDom||Am.remove(e,n)}))},l=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=Fc(e.element,"."+t.markers.item),u=W(o,(function(t){return"true"===Do(t,"aria-haspopup")}));return j(u,(function(t){e.getSystem().getByDom(t).each((function(t){var e=i(t);n[e]=t}))})),r.set(x.some(n)),n}))}(e);yt(o,(function(t,e){var r=I(n,e);zo(t.element,"aria-expanded",r)}))},d=function(e,n,r){return x.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return x.none();var i=o.menu,u=c(n,r.slice(1));return j(u,(function(e){vi(e.element,t.markers.backgroundMenu)})),Ni(i.element)||Am.append(e,tu(i)),xi(i.element,[t.markers.backgroundMenu]),a(e,i),s(e,n,r),x.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,u){void 0===u&&(u=n.HighlightSubmenu);var a=i(r);return o.expand(a).bind((function(i){return l(e,i),x.from(i[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ni(s.element)||Am.append(e,tu(s)),t.onOpenSubmenu(e,r,s,Q(i)),u===n.HighlightSubmenu?(Nf.highlightFirst(s),d(e,o,i)):(Nf.dehighlightAll(s),x.some(r))}))}))}))},g=function(e,n){var r=i(n);return o.collapse(r).bind((function(r){return l(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},h=function(e){return function(n,r){return Du(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},p=$r([Kr(sg(),(function(t,e){var n=e.event.item;o.lookupItem(i(n)).each((function(){var n=e.event.menu;Nf.highlight(t,n);var r=i(e.event.item);o.refresh(r).each((function(e){return s(t,o,e)}))}))})),uo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===i(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),ro((function(e,n){(function(e){var n=function(e,n,r){return wt(r,(function(r,o){var i=function(){return lg.sketch(f(f({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Qf():Jf()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()})(e).each((function(n){Am.append(e,tu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&a(e,n)}))}))].concat(t.navigateOnHover?[Kr(tg(),(function(e,r){var u=r.event.item;!function(t,e){var n=i(e);o.refresh(n).bind((function(e){return l(t,e),d(t,o,e)}))}(e,u),m(e,u,n.HighlightParent),t.onHover(e,u)}))]:[])),v=function(t){return Nf.getHighlighted(t).bind(Nf.getHighlighted)},b={collapseMenu:function(t){v(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){a(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return v(e).bind((function(t){var e=i(t),n=kt(o.getMenus()),r=hf(V(n,gg));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return it(e,(function(t){if(!t.getSystem().isConnected())return x.none();var e=Nf.getCandidates(t);return G(e,(function(t){return i(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return x.from(t.components()[0]).filter((function(t){return"menu"===Do(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.tmenuBehaviours,[km.config({mode:"special",onRight:h((function(t,e){return vf(e.element)?x.none():m(t,e,n.HighlightSubmenu)})),onLeft:h((function(t,e){return vf(e.element)?x.none():g(t,e)})),onEscape:h((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ur(t,e.element,wr())}))}}),Nf.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),wf.config({find:function(t){return Nf.getHighlighted(t)}}),Am.config({})]),eventOrder:t.eventOrder,apis:b,events:p}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Vt(t,e),expansions:{}}},collapseItem:function(t){return{value:Uo(hg()),meta:{text:t}}}}}),vg=mf({name:"InlineView",configFields:[_e("lazySink"),Ku("onShow"),Ku("onHide"),Fe("onEscape"),fl("inlineBehaviours",[Ws,ll,Wa]),Ve("fireDismissalEventInstead",[je("event",Mr())]),Ve("fireRepositionEventInstead",[je("event",zr())]),je("getRelated",x.none),je("isExtraPart",c),je("eventOrder",x.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return ku(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Ws.openWhileCloaked(e,r,(function(){return Cs.positionWithinBounds(i,n,e,o())})),ll.setValue(e,x.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Ra()},onRtl:function(){return Ma()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return pg.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Ws.close(e),t.onEscape.map((function(t){return t(e)})),x.some(!0)},onExecute:function(){return x.some(!0)},onOpenMenu:function(t,e){Cs.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Cs.position(o,f({anchor:"submenu",item:e},a(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Cs.positionWithinBounds(u,n,e,o()),j(r,(function(t){var e=a(t.triggeringPath);Cs.position(u,f({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})}(t,e,n,r,o);Ws.open(e,i),ll.setValue(e,x.some({mode:"menu",menu:i}))},i=function(e){Ws.isOpen(e)&&ll.getValue(e).each((function(n){switch(n.mode){case"menu":Ws.getState(e).each((function(t){pg.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Cs.positionWithinBounds(r,n.anchor,e,n.getBounds())}}))},u={setContent:function(t,e){Ws.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,x.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,(function(){return x.none()}))},showMenuWithinBounds:o,hide:function(t){Ws.isOpen(t)&&(ll.setValue(t,x.none()),Ws.close(t))},getContent:function(t){return Ws.getState(t)},reposition:i,isOpen:Ws.isOpen};return{uid:t.uid,dom:t.dom,behaviours:ml(t.inlineBehaviours,[Ws.config({isPartOf:function(e,n,r){return Pu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return Pu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),ll.config({store:{mode:"memory",initialValue:x.none()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js(f(f({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),bg=function(t){return t.x},yg=function(t,e){return t.x+t.width/2-e.width/2},wg=function(t,e){return t.x+t.width-e.width},xg=function(t){return t.y},Cg=function(t,e){return t.y+t.height-e.height},Sg=function(t,e,n){return na(wg(t,e),Cg(t,e),n.innerSoutheast(),aa(),da(t,{right:0,bottom:3}),"layout-inner-se")},kg=function(t,e,n){return na(bg(t),Cg(t,e),n.innerSouthwest(),ua(),da(t,{left:1,bottom:3}),"layout-inner-sw")},Og=function(t,e,n){return na(wg(t,e),xg(t),n.innerNortheast(),ia(),da(t,{right:0,top:2}),"layout-inner-ne")},Tg=function(t,e,n){return na(bg(t),xg(t),n.innerNorthwest(),oa(),da(t,{left:1,top:2}),"layout-inner-nw")},_g=function(t,e,n){return na(yg(t,e),xg(t),n.innerNorth(),ca(),da(t,{top:2}),"layout-inner-n")},Eg=function(t,e,n){return na(yg(t,e),Cg(t,e),n.innerSouth(),sa(),da(t,{bottom:3}),"layout-inner-s")},Ag=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ng=mf({name:"Button",factory:function(t){var e=Km(t.action),n=t.dom.tag,r=function(e){return Ot(t.dom,"attributes").bind((function(t){return Ot(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:hl(t.buttonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return f({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[je("uid",void 0),_e("dom"),je("components",[]),gl("buttonBehaviours",[Bm,km]),Pe("action"),Pe("role"),je("eventOrder",{})]}),Rg=function(t){var e=function(t){return void 0!==t.uid}(t)&&_t(t,"uid")?t.uid:Yo("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return f(f({},t),{uid:e})}}},Mg=function(t){return x.from(t()["temporary-placeholder"]).getOr("!not found!")},zg=function(t,e){return x.from(e()[t.toLowerCase()]).getOrThunk((function(){return Mg(e)}))},Dg=function(t,e){return it(t,(function(t){return x.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Mg(e)}))},Bg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Pg=mf({name:"Notification",factory:function(t){var e=Rg({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:La([Am.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Rg({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:La([Am.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Am.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Am.set(r,[Yi(n)])}}},u=K([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return x.from(Bg[t])})).toArray()]),a=Rg(Ng.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),c=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Dg(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:La([Am.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:La([Bm.config({}),Nm("notification-events",[Kr(or(),(function(t){a.getOpt(t).each(Bm.focus)}))])]),components:c.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[a.asSpec()]:[]),apis:i}},configFields:[Pe("level"),_e("progress"),_e("icon"),_e("onAction"),_e("text"),_e("iconProvider"),_e("translationProvider"),Ge("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});var Ig,Lg=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Hg=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Fg=function(t,e,n,r,o){var i=Hg(t,(function(e){return function(t,e){return t.isBlock(e)||I(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return x.from(i.backwards(e,n,r,o))},Vg=function(t,e){return jg(rn(t.selection.getNode())).getOrThunk((function(){var n=tn('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Oo(n,rn(e.extractContents())),e.insertNode(n.dom),bo(n).each((function(t){return t.dom.normalize()})),function(t){return e=Hc,(n=function(t){for(var r=wo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return x.some(i);var u=n(i);if(u.isSome())return u}return x.none()})(t);var e,n}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===ao(t)?1:Ic(t).fold((function(){return wo(t).length}),(function(t){return t.length}))}(e))})),n}))},jg=function(t){return Du(t,"[data-mce-autocompleter]")},Ug=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Wg=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},qg=function(t,e){return t.substring(e.length)},$g=function(t,e,n,r){return void 0===r&&(r=0),jg(rn(e.startContainer)).fold((function(){return function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return x.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Fg(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Wg(o))return x.none();if(o===n)break}return x.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return x.none();var i=Ug(o);return 0!==i.lastIndexOf(n)||qg(i,n).length<r?x.none():x.some({text:qg(i,n),range:o,triggerChar:n})}))}(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Ug(r);return x.some({range:r,text:qg(o,n),triggerChar:n})}))},Gg=tinymce.util.Tools.resolve("tinymce.util.Promise"),Xg=function(t,e){return{container:t,offset:e}},Kg=function(t){if(function(t){return 3===t.nodeType}(t))return Xg(t,t.data.length);var e=t.childNodes;return e.length>0?Kg(e[e.length-1]):Xg(t,e.length)},Yg=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Yg(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Kg(n[n.length-1]):Xg(t,e)},Jg=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=W(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return function(t){return function(e){var n=Yg(e.startContainer,e.startOffset);return!function(t,e){return Fg(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Wg(e)})).isSome()}(t,n)}}(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return x.none();var a=Gg.all(V(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return x.some({lookupData:a,context:n})},Qg=Zt([Ne("type"),He("text")]),Zg=Zt([je("type","autocompleteitem"),je("active",!1),je("disabled",!1),je("meta",{}),Ne("value"),He("text"),He("icon")]),th=Zt([Ne("type"),Ne("ch"),We("minChars",1),je("columns",1),We("maxResults",10),Fe("matches"),Me("fetch"),Me("onAction"),Ke("highlightOn",[],xe)]),eh=[Ge("disabled",!1),He("tooltip"),He("icon"),He("text"),Xe("onSetup",(function(){return t}))],nh=Zt([Ne("type"),Me("onAction")].concat(eh)),rh=function(t){return de("toolbarbutton",nh,t)},oh=[Ge("active",!1)].concat(eh),ih=Zt(oh.concat([Ne("type"),Me("onAction")])),uh=function(t){return de("ToggleButton",ih,t)},ah=[Xe("predicate",(function(){return!1})),$e("scope","node",["node","editor"]),$e("position","selection",["node","selection","line"])],ch=eh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),sh=oh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),lh=eh.concat([je("type","contextformbutton")]),fh=oh.concat([je("type","contextformtogglebutton")]),dh=ve("type",{contextformbutton:ch,contextformtogglebutton:sh}),mh=Zt([je("type","contextform"),Xe("initValue",(function(){return""})),He("label"),Be("commands",dh),Ie("launch",ve("type",{contextformbutton:lh,contextformtogglebutton:fh}))].concat(ah)),gh=Zt([je("type","contexttoolbar"),Ne("items")].concat(ah));!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ig||(Ig={}));var hh,ph=Ig,vh="tox-menu-nav__js",bh="tox-collection__item",yh={normal:vh,color:"tox-swatch"},wh="tox-collection__item--enabled",xh="tox-collection__item-label",Ch="tox-collection__item-caret",Sh="tox-collection__item--active",kh="tox-collection__item-container",Oh="tox-collection__item-container--row",Th=function(t){return Ot(yh,t).getOr(vh)},_h=function(t){return"color"===t?"tox-swatches":"tox-menu"},Eh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:_h(t),tieredMenu:"tox-tiered-menu"}},Ah=function(t){var e=Eh(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Th(t)}},Nh=function(t,e,n){var r=Eh(n);return{tag:"div",classes:K([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Rh=[lg.parts.items({})],Mh=function(t,e,n){var r=Eh(n);return{dom:{tag:"div",classes:K([[r.tieredMenu]])},markers:Ah(n)}},zh=function(t,e){return function(n){var r=F(n,e);return V(r,(function(e){return{dom:t,components:e}}))}},Dh=function(t,e){var n=[],r=[];return j(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Tt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),V(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Bh=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[lg.parts.items({preprocess:function(n){return"auto"!==t&&t>1?zh({tag:"div",classes:["tox-collection__group"]},t)(n):Dh(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ph=function(t){return L(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Ih=function(t){return console.error(he(t)),console.log(t),x.none()},Lh=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[lg.parts.items({preprocess:function(t){return Dh(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},Hh=function(t,e,n,r,i){var u;return"color"===i?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[lg.parts.items({preprocess:"auto"!==t?zh({tag:"div",classes:["tox-swatches__row"]},t):o})]}]}}(r)).dom,components:u.components,items:n}:"normal"===i&&"auto"===r?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"normal"===i&&1===r?{value:t,dom:(u=Bh(1,n)).dom,components:u.components,items:n}:"normal"===i?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"listpreview"===i&&"auto"!==r?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[lg.parts.items({preprocess:zh({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:u.components,items:n}:{value:t,dom:Nh(e,r,i),components:Rh,items:n}},Fh=[Ne("type"),Ne("src"),He("alt"),Ke("classes",[],xe)],Vh=Zt(Fh),jh=[Ne("type"),Ne("text"),He("name"),Ke("classes",["tox-collection__item-label"],xe)],Uh=Zt(jh),Wh=se((function(){return pe("type",{cardimage:Vh,cardtext:Uh,cardcontainer:qh})})),qh=Zt([Ne("type"),qe("direction","horizontal"),qe("align","left"),qe("valign","middle"),Be("items",Wh)]),$h=[Ge("disabled",!1),He("text"),He("shortcut"),ie("value","value",Lt((function(){return Uo("menuitem-value")})),be()),je("meta",{})],Gh=Zt([Ne("type"),He("label"),Be("items",Wh),Xe("onSetup",(function(){return t})),Xe("onAction",t)].concat($h)),Xh=Zt([Ne("type"),Ge("active",!1),He("icon")].concat($h)),Kh=Zt([Ne("type"),Re("fancytype",["inserttable","colorswatch"]),Xe("onAction",t)]),Yh=Zt([Ne("type"),Xe("onSetup",(function(){return t})),Xe("onAction",t),He("icon")].concat($h)),Jh=Zt([Ne("type"),Me("getSubmenuItems"),Xe("onSetup",(function(){return t})),He("icon")].concat($h)),Qh=Zt([Ne("type"),He("icon"),Ge("active",!1),Xe("onSetup",(function(){return t})),Me("onAction")].concat($h)),Zh=function(t,e,n){var r=Fc(t.element,"."+n);if(r.length>0){var o=X(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return x.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return x.none()},tp=function(t){return function(t,e){return La([Nm(t,e)])}(Uo("unnamed-events"),t)},ep=[_e("lazySink"),_e("tooltipDom"),je("exclusive",!0),je("tooltipComponents",[]),je("delay",300),$e("mode","normal",["normal","follow-highlight"]),je("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:r([ka,Sa,ya,xa,wa,Ca]),onRtl:r([ka,Sa,ya,xa,wa,Ca])}}})),Ku("onHide"),Ku("onShow")],np=Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=Qe(x.none()),n=function(){t.get().each((function(t){clearTimeout(t)}))},o=r("not-implemented");return ui({getTooltip:function(){return e.get()},isShowing:function(){return e.get().isSome()},setTooltip:function(t){e.set(x.some(t))},clearTooltip:function(){e.set(x.none())},clearTimer:n,resetTimer:function(e,r){n(),t.set(x.some(setTimeout((function(){e()}),r)))},readState:o})}}),rp=Uo("tooltip.exclusive"),op=Uo("tooltip.show"),ip=Uo("tooltip.hide"),up=function(t,e,n){t.getSystem().broadcastOn([rp],{})},ap=Object.freeze({__proto__:null,hideAllExclusive:up,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Am.set(t,r)}))}}),cp=Fa({fields:ep,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Ns(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return $r(K([[Kr(op,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){up(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:$r("normal"===t.mode?[Kr(rr(),(function(t){Fr(n,op)})),Kr(er(),(function(t){Fr(n,ip)}))]:[]),behaviours:La([Am.config({})])});e.setTooltip(o),_s(r,o),t.onShow(n,o),Cs.position(r,t.anchor(n),o)}}(n)}),t.delay)})),Kr(ip,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Kr(br(),(function(t,e){var r=e;r.universal||I(r.channels,rp)&&n(t)})),oo((function(t){n(t)}))],"normal"===t.mode?[Kr(or(),(function(t){Fr(t,op)})),Kr(pr(),(function(t){Fr(t,ip)})),Kr(rr(),(function(t){Fr(t,op)})),Kr(er(),(function(t){Fr(t,ip)}))]:[Kr(Lr(),(function(t,e){Fr(t,op)})),Kr(Hr(),(function(t){Fr(t,ip)}))]]))}}),state:np,apis:ap}),sp=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),lp=tinymce.util.Tools.resolve("tinymce.util.I18n"),fp=["input","button","textarea","select"],dp=function(t,e,n){(e.disabled()?bp:yp)(t,e)},mp=function(t,e){return!0===e.useNative&&I(fp,ao(t.element))},gp=function(t){zo(t.element,"disabled","disabled")},hp=function(t){Io(t.element,"disabled")},pp=function(t){zo(t.element,"aria-disabled","true")},vp=function(t){zo(t.element,"aria-disabled","false")},bp=function(t,e,n){e.disableClass.each((function(e){vi(t.element,e)})),(mp(t,e)?gp:pp)(t),e.onDisabled(t)},yp=function(t,e,n){e.disableClass.each((function(e){bi(t.element,e)})),(mp(t,e)?hp:vp)(t),e.onEnabled(t)},wp=function(t,e){return mp(t,e)?function(t){return Po(t.element,"disabled")}(t):function(t){return"true"===Do(t.element,"aria-disabled")}(t)},xp=Object.freeze({__proto__:null,enable:yp,disable:bp,isDisabled:wp,onLoad:dp,set:function(t,e,n,r){(r?bp:yp)(t,e)}}),Cp=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return $r([Gr(yr(),(function(e,n){return wp(e,t)})),Ba(t,e,dp)])}}),Sp=[Xe("disabled",c),je("useNative",!0),Pe("disableClass"),Ku("onDisabled"),Ku("onEnabled")],kp=Fa({fields:Sp,name:"disabling",active:Cp,apis:xp}),Op=tinymce.util.Tools.resolve("tinymce.EditorManager"),Tp=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},_p=function(t){return t.getParam("width",sp.DOM.getStyle(t.getElement(),"width"))},Ep=function(t){return x.from(t.getParam("min_width")).filter(R)},Ap=function(t){return x.from(t.getParam("min_height")).filter(R)},Np=function(t){return x.from(t.getParam("max_width")).filter(R)},Rp=function(t){return x.from(t.getParam("max_height")).filter(R)},Mp=function(t){return!1!==t.getParam("menubar",!0,"boolean")},zp=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=k(e),o=T(e)&&e.length>0;return!Bp(t)&&(o||r||n)},Dp=function(t){var e=H(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=W(e,(function(t){return"string"==typeof t}));return n.length>0?x.some(n):x.none()},Bp=function(t){return Dp(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),(function(){return!0}))};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(hh||(hh={}));var Pp,Ip=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Pp||(Pp={}));var Lp,Hp,Fp=function(t){return t.getParam("toolbar_location",Pp.auto,"string")},Vp=function(t){return Fp(t)===Pp.bottom},jp=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?zu(Ri(),e):x.none()},Up=function(t){return t.inline&&jp(t).isSome()},Wp=function(t){return jp(t).getOrThunk((function(){return _i(Ti(rn(t.getElement())))}))},qp=function(t){return t.inline&&!Mp(t)&&!zp(t)&&!Bp(t)},$p=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Up(t)&&!qp(t)},Gp=function(t){var e=t.getParam("menu");return e?wt(e,(function(t){return f(f({},t),{items:t.items})})):{}},Xp=function(t){return t.getParam("menubar")},Kp=function(t){return t.getParam("anchor_top","#top")},Yp=function(t){return t.getParam("anchor_bottom","#bottom")},Jp="silver.readonly",Qp=Zt([("readonly",Ee("readonly",Ce))]),Zp=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([qs()],{target:n}),t.uiMothership.broadcastOn([qs()],{target:n})),t.mothership.broadcastOn([Jp],{readonly:e}),t.uiMothership.broadcastOn([Jp],{readonly:e})},tv=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Zp(e,!0)})),t.on("SwitchMode",(function(){return Zp(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},ev=function(){var t;return Wa.config({channels:(t={},t[Jp]={schema:Qp,onReceive:function(t,e){kp.set(t,e.readonly)}},t)})},nv=function(t){return kp.config({disabled:t})},rv=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},ov=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},iv=function(t,e){var n=t.getApi(e);return function(t){t(n)}},uv=function(t,e){return ro((function(n){iv(t,n)((function(n){var r=t.onSetup(n);null!=r&&e.set(r)}))}))},av=function(t,e){return oo((function(n){return iv(t,n)(e.get())}))},cv=function(t,e){return uo((function(n,r){iv(t,n)(t.onAction),t.triggersSubmenu||e!==ph.CLOSE_ON_EXECUTE||(Fr(n,Sr()),r.stop())}))},sv=((Lp={})[yr()]=["disabling","alloy.base.behaviour","toggling","item-events"],Lp),lv=function(t){return Y(t,(function(t){return t.toArray()}))},fv=function(e,n,r,o){var i,u=Qe(t);return{type:"item",dom:n.dom,components:lv(n.optComponents),data:e.data,eventOrder:sv,hasSubmenu:e.triggersSubmenu,itemBehaviours:La([Nm("item-events",[cv(e,r),uv(e,u),av(e,u)]),(i=function(){return e.disabled||o.isDisabled()},kp.config({disabled:i,disableClass:"tox-collection__item--state-disabled"})),ev(),Am.config({})].concat(e.itemBehaviours))}},dv=function(t){return{value:t.value,meta:f({text:t.text.getOr("")},t.meta)}},mv=tinymce.util.Tools.resolve("tinymce.Env"),gv=function(t){var e=mv.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=V(n,(function(t){var n=t.toLowerCase().trim();return Tt(e,n)?e[n]:t}));return mv.mac?r.join(""):r.join("+")},hv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},pv=function(t){return{dom:{tag:"div",classes:[xh]},components:[Yi(lp.translate(t))]}},vv=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},bv=function(t,e){return{dom:{tag:"div",classes:[xh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(lp.translate(e))]}]}},yv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:gv(t)}}},wv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:zg("checkmark",t)}}},xv=function(t,e){var n=e.map((function(t){return{attributes:{title:lp.translate(t)}}})).getOr({});return f({tag:"div",classes:[vh,bh].concat(t?["tox-collection__item-icon-rtl"]:[])},n)},Cv=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Sv=["list-bull-circle","list-bull-default","list-bull-square"],kv=function(t,e,n,r){void 0===r&&(r=x.none());var o,u=lp.isRtl()&&t.iconContent.exists((function(t){return I(Sv,t)})),a=(o=t.iconContent,o.map((function(t){return lp.isRtl()&&I(Cv,t)?t+"-rtl":t}))).map((function(t){return function(t,e,n){return x.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Mg(e)}))}(t,e.icons,r)})),c=x.from(t.meta).fold((function(){return pv}),(function(t){return Tt(t,"style")?i(bv,t.style):pv}));return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=n.getOr(""),i={tag:"div",attributes:t.map((function(t){return{title:r.translate(t)}})).getOr({}),classes:["tox-swatch"]},f(f({},i),"custom"===e?{tag:"button",classes:m(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:m(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:f(f({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,a,e):function(t,e,n,r,o){var i=n?e.or(x.some("")).map(hv):x.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return x.some(vv(t,[xh]))}));return{dom:xv(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(yv),u,t.caret]}}(t,a,n,c,u)},Ov=function(t,e){return Ot(t,"tooltipWorker").map((function(t){return[cp.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:fc}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){cp.setComponents(e,[Ji({element:rn(t)})])}))}})]})).getOr([])},Tv=function(t,e){var n=function(t){return sp.DOM.encode(t)}(lp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},_v=ql("item-widget",og()),Ev=function(t){return{value:t}},Av=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Nv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Rv=function(t){return Av.test(t)||Nv.test(t)},Mv=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},zv=function(t){var e=Mv(t.red)+Mv(t.green)+Mv(t.blue);return Ev(e)},Dv=Math.min,Bv=Math.max,Pv=Math.round,Iv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Lv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Hv=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Fv=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Vv=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Bv(0,Dv(i,1)),u=Bv(0,Dv(u,1)),0===i)return e=n=r=Pv(255*u),Hv(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Pv(255*(e+l)),n=Pv(255*(n+l)),r=Pv(255*(r+l)),Hv(e,n,r,1)},jv=function(t){var e,n,r=(e=function(t){return{value:t.value.replace(Av,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),null===(n=Nv.exec(e.value))?["FFFFFF","FF","FF","FF"]:n),o=parseInt(r[1],16),i=parseInt(r[2],16),u=parseInt(r[3],16);return Hv(o,i,u,1)},Uv=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Hv(o,i,u,a)},Wv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},qv=Hv(255,0,0,1),$v=function(t,e){return t.fire("ResizeContent",e)},Gv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Xv="tinymce-custom-colors",Kv="choiceitem",Yv=[{type:Kv,text:"Light Green",value:"#BFEDD2"},{type:Kv,text:"Light Yellow",value:"#FBEEB8"},{type:Kv,text:"Light Red",value:"#F8CAC6"},{type:Kv,text:"Light Purple",value:"#ECCAFA"},{type:Kv,text:"Light Blue",value:"#C2E0F4"},{type:Kv,text:"Green",value:"#2DC26B"},{type:Kv,text:"Yellow",value:"#F1C40F"},{type:Kv,text:"Red",value:"#E03E2D"},{type:Kv,text:"Purple",value:"#B96AD9"},{type:Kv,text:"Blue",value:"#3598DB"},{type:Kv,text:"Dark Turquoise",value:"#169179"},{type:Kv,text:"Orange",value:"#E67E23"},{type:Kv,text:"Dark Red",value:"#BA372A"},{type:Kv,text:"Dark Purple",value:"#843FA1"},{type:Kv,text:"Dark Blue",value:"#236FA1"},{type:Kv,text:"Light Gray",value:"#ECF0F1"},{type:Kv,text:"Medium Gray",value:"#CED4D9"},{type:Kv,text:"Gray",value:"#95A5A6"},{type:Kv,text:"Dark Gray",value:"#7E8C8D"},{type:Kv,text:"Navy Blue",value:"#34495E"},{type:Kv,text:"Black",value:"#000000"},{type:Kv,text:"White",value:"#ffffff"}],Jv=function(t){void 0===t&&(t=10);var e,n=Gv.getItem(Xv),r=k(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=P(t,e);return-1===n?x.none():x.some(n)})(o,e).each(i),o.unshift(e),o.length>t&&o.pop(),Gv.setItem(Xv,JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),Qv=function(t){return!1!==t.getParam("custom_colors")},Zv=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u<t.length;u+=2)e.push({text:t[u+1],value:i(t[u]),type:"choiceitem"});return e}(e):Yv},tb=function(t){Jv.add(t)},eb=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,(e=Zv(t).length,Math.max(5,Math.ceil(Math.sqrt(e)))));var e},nb=function(t,e,n,r){"custom"===n?cb(t)((function(n){n.each((function(n){tb(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},rb=function(t,e){return t.concat(V(Jv.state(),(function(t){return{type:Kv,text:t,value:t}})).concat(function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]}(e)))},ob=function(t,e){return function(n){n(rb(t,e))}},ib=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},ub=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return x.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return function(t){if("transparent"===t)return x.some(Hv(0,0,0,0));var e=Iv.exec(t);if(null!==e)return x.some(Uv(e[1],e[2],e[3],"1"));var n=Lv.exec(t);return null!==n?x.some(Uv(n[1],n[2],n[3],n[4])):x.none()}(t).map((function(t){var n=zv(t).value;return ln(e.toLowerCase(),n)}))})).getOr(!1)},columns:eb(t),fetch:ob(Zv(t),Qv(t)),onAction:function(e){null!==o.get()&&nb(t,n,o.get(),(function(){}))},onItemAction:function(r,i){nb(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&ib(n,e,o.get());var r=function(t){t.name===e&&ib(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},ab=function(e,n,r,o){e.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){nb(e,r,n.value,t)}}]}})},cb=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(x.from(n.colorpicker)),e.close()}}(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(x.none())}})}},sb=function(t,e,n,r,o,i,u,a){var c=Ph(e),s=lb(e,n,r,"color"!==o?"normal":"color",i,u,a);return Hh(t,c,s,r,o)},lb=function(t,e,n,r,o,i,u){return hf(V(t,(function(a){return"choiceitem"===a.type?(c=a,de("choicemenuitem",Xh,c)).fold(Ih,(function(c){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:n,textContent:e?t.text:x.none(),htmlContent:x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:x.none(),checkMark:e?x.some(wv(u.icons)):x.none(),caret:x.none(),value:t.value},u,a);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,Ph(t)))})):x.none();var c})))},fb=function(t,e){var n=Ah(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},db=Uo("cell-over"),mb=Uo("cell-execute"),gb=function(t,e,n){var r,o=function(n){return Vr(n,mb,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Zi({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:La([Nm("insert-table-picker-cell",[Kr(rr(),Bm.focus),Kr(yr(),o),Kr(lr(),i),Kr(xr(),i)]),Gm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Bm.config({onFocus:function(n){return Vr(n,db,{row:t,col:e})}})])})},hb=function(t){return Y(t,(function(t){return V(t,tu)}))},pb=function(t,e){return Yi(e+1+"x"+(t+1))},vb={inserttable:function(t){var e=Uo("size-label"),n=function(t,e,n){for(var r=[],o=0;o<10;o++){for(var i=[],u=0;u<10;u++)i.push(gb(o,u,t));r.push(i)}return r}(e),r=Rg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Yi("0x0")],behaviours:La([Am.config({})])});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:hb(n).concat(r.asSpec()),behaviours:La([Nm("insert-table-picker",[Zr(db,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<10;i++)for(var u=0;u<10;u++)Gm.set(t[i][u],i<=e&&u<=n)}(n,i,u),Am.set(r.get(t),[pb(i,u)])})),Zr(mb,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Fr(e,Sr())}))]),km.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=rb(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o="color",i=sb(Uo("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),u=f(f({},i),{markers:Ah(o),movement:fb(r,o)});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget(lg.sketch(u))]}}},bb=function(t,e){return V(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Oh,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[kh,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,bb(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return I(e.cardText.highlightOn,t)}))?x.from(e.cardText.matchText).getOr(""):"";return vv(Tv(t.text,n),t.classes)}}))},yb=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:f({tag:"div",classes:[bh,"tox-collection__group-heading"]},e),components:[]}};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Hp||(Hp={}));var wb=function(e,n,r,o,i){var u,a=r.shared.providers,c=function(t){return i?f(f({},t),{shortcut:x.none(),icon:t.text.isSome()?x.none():t.icon}):t};switch(e.type){case"menuitem":return(u=e,de("menuitem",Yh,u)).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,caret:x.none(),checkMark:x.none(),shortcutContent:t.shortcut},n,r);return fv({data:dv(t),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)}(c(t),n,a,o))}));case"nestedmenuitem":return function(t){return de("nestedmenuitem",Jh,t)}(e).fold(Ih,(function(e){return x.some(function(e,n,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var u,a=i?(u=r.icons,{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-down",u)}}):function(t){return{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-right",t)}}}(r.icons),c=kv({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:x.none(),ariaLabel:e.text,caret:x.some(a),checkMark:x.none(),shortcutContent:e.shortcut},r,o);return fv({data:dv(e),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:e.disabled,onAction:t,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,r)}(c(e),n,a,o,i))}));case"togglemenuitem":return function(t){return de("togglemenuitem",Qh,t)}(e).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,checkMark:x.some(wv(n.icons)),caret:x.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c(t),n,a,o))}));case"separator":return function(t){return de("separatormenuitem",Qg,t)}(e).fold(Ih,(function(t){return x.some(yb(t))}));case"fancymenuitem":return function(t){return de("fancymenuitem",Kh,t)}(e).fold(Ih,(function(t){return function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?x.some(t[e]):x.none()}(vb,t.fancytype).map((function(n){return n(t,e)}))}(c(t),r)}));default:return console.error("Unknown item in general menu",e),x.none()}},xb=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Ph(t);return hf(V(t,(function(t){switch(t.type){case"separator":return(r=t,de("Autocompleter.Separator",Qg,r)).fold(Ih,(function(t){return x.some(yb(t))}));case"cardmenuitem":return function(t){return de("cardmenuitem",Gh,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r){var o={dom:xv(!1,t.label),optComponents:[x.some({dom:{tag:"div",classes:[kh,Oh]},components:bb(t.items,r)})]};return fv({data:dv(f({text:x.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){kp.set(t,e),j(Fc(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(kp)&&kp.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:x.from(r.itemBehaviours).getOr([])},o,e,n.providers)}(f(f({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Ov(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return de("Autocompleter.Item",Zg,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:r,textContent:x.none(),htmlContent:n?t.text.map((function(t){return Tv(t,e)})):x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:x.none(),checkMark:x.none(),caret:x.none(),value:t.value},u.providers,a,t.icon);return fv({data:dv(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:Ov(t.meta,u)},c,i,u.providers)}(t,e,a,"normal",n,o,i,c))}))}var r})))},Cb=function(t,e,n,r,o){var i=Ph(e),u=hf(V(e,(function(t){var e=function(t){return wb(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(f(f({},t),{disabled:!0})):e(t)})));return(o?Lh:Hh)(t,i,u,1,"normal")},Sb=function(t){return pg.singleData(t.value,t)},kb=function(t,e){var n=Qe(x.none()),r=Qe(!1),o=Zi(vg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissAutocompleter",[Kr(Mr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&vg.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));jg(e.getOr(rn(t.selection.getNode()))).each(Ao),u(),n.set(x.none()),r.set(!1)}},c=zt((function(){return function(t){var e,n,r=t.ui.registry.getAll().popups,o=wt(r,(function(t){return(e=t,de("Autocompleter",th,e)).fold((function(t){throw new Error(he(t))}),(function(t){return t}));var e})),i=(e=Ct(o,(function(t){return t.ch})),n={},j(e,(function(t){n[t]={}})),vt(n)),u=kt(o);return{dataset:o,triggerChars:i,lookupByChar:function(t){return W(u,(function(e){return e.ch===t}))}}}(t)})),s=function(l){(function(e){return n.get().map((function(n){return $g(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Jg(t,c,n,e)}))})).getOrThunk((function(){return function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return it(n.triggerChars,(function(n){return $g(t,e,n)}))}(t.dom,r,n).bind((function(n){return Jg(t,e,n)}))}(t,c)}))})(l).fold(a,(function(c){!function(e){if(!i()){var o=Vg(t,e.range);n.set(x.some({triggerChar:e.triggerChar,element:o,matchLength:e.text.length})),r.set(!1)}}(c.context),c.lookupData.then((function(i){n.get().map((function(n){var l,f,d,m=c.context;if(n.triggerChar===m.triggerChar){var g=(l=m.triggerChar,d=it(f=i,(function(t){return x.from(t.columns)})).getOr(1),Y(f,(function(n){var o=n.items;return xb(o,n.matchText,(function(e,o){var i=t.selection.getRng();$g(t.dom,i,l).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),s(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,ph.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?function(e,n,r,i){e.matchLength=n.text.length;var u=it(r,(function(t){return x.from(t.columns)})).getOr(1);vg.showAt(o,{anchor:"node",root:rn(t.getBody()),node:x.from(e.element)},lg.sketch(function(t,e,n,r){var o=n===Hp.ContentFocus?Qf():Jf(),i=fb(e,r),u=Ah(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===Hp.ContentFocus,focusManager:o,menuBehaviours:tp("auto"!==e?[]:[ro((function(t,e){Zh(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;km.setGridSize(t,r,n)}))}))])}}(Hh("autocompleter-value",!0,i,u,"normal"),u,Hp.ContentFocus,"normal"))),vg.getContent(o).each(Nf.highlightFirst)}(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},l={onKeypress:Lg((function(t){27!==t.which&&s()}),50),cancelIfNecessary:a,isMenuOpen:function(){return vg.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return vg.getContent(o)}};!1===t.hasPlugin("rtc")&&function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Vr(t,ur(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Nf.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(jr),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Nf.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&jg(rn(e.element)).isNone()&&t.cancelIfNecessary()}))}(l,t)},Ob=s,Tb=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!1)}(t,e,Ob,n)},_b=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!0)}(t,e,Ob,n)},Eb=mu,Ab=function(t,e,n){return Du(t,e,n).isSome()};function Nb(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}}var Rb=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?x.none():x.some(e.touches[0])},Mb=function(){return Ln().browser.isFirefox()},zb=Qt([Me("triggerEvent"),je("stopBackspace",!0)]),Db=function(t,e){var n=ge("Getting GUI events settings",zb,e),r=function(t){var e=Qe(x.none()),n=Qe(!1),r=Nb((function(e){t.triggerEvent(Cr(),e),n.set(!0)}),400),o=jt([{key:Kn(),value:function(t){return Rb(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(x.some(i))})),x.none()}},{key:Yn(),value:function(t){return r.cancel(),Rb(t).each((function(t){e.get().each((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(x.none())}))})),x.none()}},{key:Jn(),value:function(o){return r.cancel(),e.get().filter((function(t){return Vn(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(xr(),o)}))}}]);return{fireIfReady:function(t,e){return Ot(o,e).bind((function(e){return e(t)}))}}}(n),o=V(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return Tb(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Qe(x.none()),u=Tb(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(x.some(setTimeout((function(){n.triggerEvent(vr(),t)}),0)))})),a=Tb(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===Rf[0]&&!I(["input","textarea"],ao(t.target))&&!Ab(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Mb()?_b(t,"focus",e):Tb(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Qe(x.none()),l=function(t,e){return Mb()?_b(t,"blur",e):Tb(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(x.some(setTimeout((function(){n.triggerEvent(pr(),t)}),0)))}));return{unbind:function(){j(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.get().each(clearTimeout),s.get().each(clearTimeout)}}},Bb=function(t,e){var n=Ot(t,"target").getOr(e);return Qe(n)},Pb=Et([{stopped:[]},{resume:["element"]},{complete:[]}]),Ib=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=Qe(!1),r=Qe(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),Pb.complete()}),(function(t){var n=t.descHandler;return si(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Pb.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Pb.complete()):bo(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Pb.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Pb.resume(r)}))}))},Lb=function(t,e,n,r,o,i){return Ib(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return Lb(t,e,n,r,o,i)}),(function(){return!1}))},Hb=function(t,e,n,r,o){var i=Bb(n,r);return Lb(t,e,n,r,i,o)};function Fb(){var t,e=(t={},{registerId:function(e,n,r){yt(r,(function(r,o){var u=void 0!==t[o]?t[o]:{};u[n]=function(t,e){return{cHandler:i.apply(void 0,[t.handler].concat(e)),purpose:t.purpose}}(r,e),t[o]=u}))},unregisterId:function(e){yt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return Ot(t,e).map((function(t){return Ct(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Ot(t,n);return qn(r,(function(t){return function(t,e){return Ko(e).fold((function(){return x.none()}),(function(n){return t.bind((function(t){return Ot(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}),n={},r=function(t){Ko(t.element).each((function(t){delete n[t],e.unregisterId(t)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(t){var o=function(t){var e=t.element;return Ko(e).fold((function(){return function(t,e){var n=Uo($o+"uid-");return Xo(e,n),n}(0,t.element)}),(function(t){return t}))}(t);_t(n,o)&&function(t,e){var o=n[e];if(o!==t)throw new Error('The tagId "'+e+'" is already used by: '+Ho(o.element)+"\nCannot use it for: "+Ho(t.element)+"\nThe conflicting element is"+(Ni(o.element)?" ":" not ")+"already in the DOM");r(t)}(t,o);var i=[t];e.registerId(i,o,t.events),n[o]=t},unregister:r,getById:function(t){return Ot(n,t)}}}var Vb=mf({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=d(e,["attributes"]);return{uid:t.uid,dom:f({tag:"div",attributes:f({role:"presentation"},n)},r),components:t.components,behaviours:dl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[je("components",[]),fl("containerBehaviours",[]),je("events",{}),je("domModification",{}),je("eventOrder",{})]}),jb=function(e){var n=function(t){return bo(e.element).fold((function(){return!0}),(function(e){return Vn(t,e)}))},o=Fb(),i=function(t,e){return o.find(n,t,e)},u=Db(e.element,{triggerEvent:function(t,e){return Fu(t,e.target,(function(n){return function(t,e,n,r){return Hb(t,e,n,n.target,r)}(i,t,e,n)}))}}),l={debugInfo:r("real"),triggerEvent:function(t,e,n){Fu(t,e,(function(r){return Hb(i,t,n,e,r)}))},triggerFocus:function(e,n){Ko(e).fold((function(){$a(e)}),(function(r){Fu(hr(),e,(function(r){return function(t,e,n,r,o){var i=Bb(n,r);Ib(t,e,n,r,i,o)}(i,hr(),{originator:n,kill:t,prevent:t,target:e},e,r),!1}))}))},triggerEscape:function(t,e){l.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return y(t)},getByDom:function(t){return w(t)},build:Zi,addToGui:function(t){m(t)},removeFromGui:function(t){g(t)},addToWorld:function(t){f(t)},removeFromWorld:function(t){d(t)},broadcast:function(t){p(t)},broadcastOn:function(t,e){v(t,e)},broadcastEvent:function(t,e){b(t,e)},isConnected:s},f=function(t){t.connect(l),lo(t.element)||(o.register(t),j(t.components(),f),l.triggerEvent(Or(),t.element,{target:t.element}))},d=function(t){lo(t.element)||(j(t.components(),d),o.unregister(t)),t.disconnect()},m=function(t){_s(e,t)},g=function(t){Ns(t)},h=function(t){var e=o.filter(br());j(e,(function(e){var n=e.descHandler;si(n)(t)}))},p=function(t){h({universal:!0,data:t})},v=function(t,e){h({universal:!1,channels:t,data:e})},b=function(e,n){return function(e,n,r){var o=function(e){var n=Qe(!1);return{stop:function(){n.set(!0)},cut:t,isStopped:n.get,isCut:c,event:e,setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")}}(n);return j(e,(function(t){var e=t.descHandler;si(e)(o)})),o.isStopped()}(o.filter(e),n)},y=function(t){return o.getById(t).fold((function(){return ct.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ct.value)},w=function(t){var e=Ko(t).getOr("not found");return y(e)};return f(e),{root:e,element:e.element,destroy:function(){u.unbind(),Eo(e.element)},add:m,remove:g,getByUid:y,getByDom:w,addToWorld:f,removeFromWorld:d,broadcast:p,broadcastOn:v,broadcastEvent:b}},Ub=r([je("prefix","form-field"),fl("fieldBehaviours",[wf,ll])]),Wb=r([Fl({schema:[_e("dom")],name:"label"}),Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Ll({factory:{sketch:function(t){var e=function(t,e){var n={};return yt(t,(function(t,r){I(e,r)||(n[r]=t)})),n}(t,["factory"]);return t.factory.sketch(e)}},schema:[_e("factory")],name:"field"})]),qb=gf({name:"FormField",configFields:Ub(),partFields:Wb(),factory:function(t,e,n,r){var o=ml(t.fieldBehaviours,[wf.config({find:function(e){return Ql(e,t,"field")}}),ll.config({store:{mode:"manual",getValue:function(t){return wf.getCurrent(t).bind(ll.getValue)},setValue:function(t,e){wf.getCurrent(t).each((function(t){ll.setValue(t,e)}))}}})]),i=$r([ro((function(e,n){var r=tf(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Uo(t.prefix);r.label().each((function(t){zo(t.element,"for",n),zo(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Uo(t.prefix);zo(n.element,"id",r),zo(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Ql(e,t,"field")},getLabel:function(e){return Ql(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),$b=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({attributes:jt([{key:e.tabAttr,value:"true"}])})}}),Gb=[je("tabAttr","data-alloy-tabstop")],Xb=Fa({fields:Gb,name:"tabstopping",active:$b}),Kb=tinymce.util.Tools.resolve("tinymce.html.Entities"),Yb=function(t,e,n,r){var o=Jb(t,e,n,r);return qb.sketch(o)},Jb=function(t,e,n,r){return{dom:Qb(n),components:t.toArray().concat([e]),fieldBehaviours:La(r)}},Qb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Zb=function(t,e){return qb.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ty=Uo("form-component-change"),ey=Uo("form-close"),ny=Uo("form-cancel"),ry=Uo("form-action"),oy=Uo("form-submit"),iy=Uo("form-block"),uy=Uo("form-unblock"),ay=Uo("form-tabchange"),cy=Uo("form-resize"),sy=r([Pe("data"),je("inputAttributes",{}),je("inputStyles",{}),je("tag","input"),je("inputClasses",[]),Ku("onSetValue"),je("styles",{}),je("eventOrder",{}),fl("inputBehaviours",[ll,Bm]),je("selectOnFocus",!0)]),ly=function(e){return La([Bm.config({onFocus:e.selectOnFocus?function(t){var e=t.element,n=qi(e);e.dom.setSelectionRange(0,n.length)}:t})])},fy=function(t){return f(f({},ly(t)),ml(t.inputBehaviours,[ll.config({store:f(f({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return qi(t.element)},setValue:function(t,e){qi(t.element)!==e&&$i(t.element,e)}}),onSetValue:t.onSetValue})]))},dy=function(t){return{tag:t.tag,attributes:f({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},my=mf({name:"Input",configFields:sy(),factory:function(t,e){return{uid:t.uid,dom:dy(t),components:[],behaviours:fy(t),eventOrder:t.eventOrder}}}),gy={},hy={exports:gy};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,gy,hy);var py,vy=hy.exports.boltExport,by=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return by((function(e){r((function(n){e(t(n))}))}))},isReady:o}},yy={nu:by,pure:function(t){return by((function(e){e(t)}))}},wy=function(t){setTimeout((function(){throw t}),0)},xy=function(t){var e=function(e){t().then(e,wy)};return{map:function(e){return xy((function(){return t().then(e)}))},bind:function(e){return xy((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return xy((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return yy.nu(e)},toCached:function(){var e=null;return xy((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Cy=function(t){return xy((function(){return new vy(t)}))},Sy=function(t){return xy((function(){return vy.resolve(t)}))},ky=["input","textarea"],Oy=function(t){var e=ao(t);return I(ky,e)},Ty=function(t,e){var n=e.getRoot(t).getOr(t.element);bi(n,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ro(t,e.validHtml)})),e.onValid(t)}))},_y=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);vi(o,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ro(t,r)})),e.onInvalid(t,r)}))},Ey=function(t,e,n){return e.validator.fold((function(){return Sy(ct.value(!0))}),(function(e){return e.validate(t)}))},Ay=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Ey(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return _y(t,e,0,n),ct.error(n)}),(function(n){return Ty(t,e),ct.value(n)})):ct.error("No longer in system")}))},Ny=Object.freeze({__proto__:null,markValid:Ty,markInvalid:_y,query:Ey,run:Ay,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return yi(n,e.invalidClass)}}),Ry=Object.freeze({__proto__:null,events:function(e,n){return e.validator.map((function(n){return $r([Kr(n.onEvent,(function(t){Ay(t,e).get(o)}))].concat(n.validateOnLoad?[ro((function(n){Ay(n,e).get(t)}))]:[]))})).getOr({})}}),My=[_e("invalidClass"),je("getRoot",x.none),Ve("notify",[je("aria","alert"),je("getContainer",x.none),je("validHtml",""),Ku("onValid"),Ku("onInvalid"),Ku("onValidate")]),Ve("validator",[_e("validate"),je("onEvent","input"),je("validateOnLoad",!0)])],zy=Fa({fields:My,name:"invalidating",active:Ry,apis:Ny,extra:{validation:function(t){return function(e){var n=ll.getValue(e);return Sy(t(n))}}}}),Dy=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),By=[Ee("others",fe(ct.value,be()))],Py=Fa({fields:By,name:"coupling",apis:Dy,state:Object.freeze({__proto__:null,init:function(){var t={},e=r({});return ui({readState:e,getOrCreate:function(e,n,r){var o=vt(n.others);if(o)return Ot(t,r).getOrThunk((function(){var o=Ot(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),Iy=r("sink"),Ly=r(Fl({name:Iy(),overrides:r({dom:{tag:"div"},behaviours:La([Cs.config({useFixed:s})]),events:$r([to(ur()),to(Zn()),to(lr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(py||(py={}));var Hy=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},Fy=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Uy(r,t);return a.map((function(t){return t.bind((function(t){return x.from(pg.sketch(f(f({},i.menu()),{uid:Yo(""),data:t,highlightImmediately:u===py.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Cs.position(r,n,e),Ws.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Cs.position(r,{anchor:"submenu",item:e},n),Ws.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Cs.position(o,n,e),j(r,(function(t){Cs.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Bm.focus(r),Ws.close(o),x.some(!0)}})))}))}))}(t,e,Hy(t,n),n,r,o,u).map((function(t){return t.fold((function(){Ws.isOpen(r)&&Ws.close(r)}),(function(t){Ws.cloak(r),Ws.open(r,t),i(r)})),r}))},Vy=function(t,e,n,r,o,i,u){return Ws.close(r),Sy(r)},jy=function(t,e,n,r,o,i){var u=Py.getCoupled(n,"sandbox");return(Ws.isOpen(u)?Vy:Fy)(t,e,n,u,r,o,i)},Uy=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Iy()).map((function(t){return function(){return ct.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return ct.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Wy=function(t){Ws.getState(t).each((function(t){pg.repositionMenus(t)}))},qy=function(t,e,n){var r=Bu(),o=Uy(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:hl(t.sandboxBehaviours,[ll.config({store:{mode:"memory",initialValue:e}}),Ws.config({onOpen:function(o,i){var u=Hy(t,e);r.link(e.element),t.matchWidth&&function(t,e,n){var r=wf.getCurrent(e).getOr(e),o=fu(t.element);n?Bi(r.element,"min-width",o+"px"):function(t,e){lu.set(t,e)}(r.element,o)}(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return Pu(n,r)||Pu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),wf.config({find:function(t){return Ws.getState(t).bind((function(t){return wf.getCurrent(t)}))}}),Wa.config({channels:f(f({},Ks({isExtraPart:c})),Js({doReposition:Wy}))})])}},$y=function(t){var e=Py.getCoupled(t,"sandbox");Wy(e)},Gy=function(){return[je("sandboxClasses",[]),gl("sandboxBehaviours",[wf,Wa,Ws,ll])]},Xy=r([_e("dom"),_e("fetch"),Ku("onOpen"),Yu("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),fl("dropdownBehaviours",[Gm,Py,km,Bm]),_e("toggleClass"),je("eventOrder",{}),Pe("lazySink"),je("matchWidth",!1),je("useMinWidth",!1),Pe("role")].concat(Gy())),Ky=r([Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Ly()]),Yy=gf({name:"Dropdown",configFields:Xy(),partFields:Ky(),factory:function(e,n,r,o){var i,u=function(t){Ws.getState(t).each((function(t){pg.highlightPrimary(t)}))},a={expand:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightNone).get(t)},open:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},isOpen:Gm.isOn,close:function(n){Gm.isOn(n)&&jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},repositionMenus:function(t){Gm.isOn(t)&&$y(t)}},c=function(t,e){return jr(t),x.some(!0)};return{uid:e.uid,dom:e.dom,components:n,behaviours:ml(e.dropdownBehaviours,[Gm.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){Gm.on(t)},onClose:function(){Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Yy.isOpen(t)){var n=Py.getCoupled(t,"sandbox");u(n)}else Yy.open(t);return x.some(!0)},onEscape:function(t,e){return Yy.isOpen(t)?(Yy.close(t),x.some(!0)):x.none()}}),Bm.config({})]),events:Km(x.some((function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)}))),eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:a,domModification:{attributes:f(f({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===e.dom.tag?{type:("type",Ot(e.dom,"attributes").bind((function(t){return Ot(t,"type")}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Jy=Fa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return $r([Gr(dr(),s)])},exhibit:function(){return ci({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Qy=Uo("color-input-change"),Zy=Uo("color-swatch-change"),tw=Uo("color-picker-cancel"),ew=function(t,e,n){return{hue:t,saturation:e,value:n}},nw=Uo("rgb-hex-update"),rw=Uo("slider-update"),ow=Uo("palette-update"),iw=Fl({schema:[_e("dom")],name:"label"}),uw=function(t){return Fl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:$r([Yr(Kn(),(function(e,n,r){return t(e,r)}),[e]),Yr(Zn(),(function(e,n,r){return t(e,r)}),[e]),Yr(tr(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},aw=uw("top-left"),cw=uw("top"),sw=uw("top-right"),lw=uw("right"),fw=uw("bottom-right"),dw=uw("bottom"),mw=uw("bottom-left"),gw=[iw,uw("left"),lw,cw,dw,aw,sw,mw,fw,Ll({name:"thumb",defaults:r({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:$r([Qr(Kn(),t,"spectrum"),Qr(Yn(),t,"spectrum"),Qr(Jn(),t,"spectrum"),Qr(Zn(),t,"spectrum"),Qr(tr(),t,"spectrum"),Qr(nr(),t,"spectrum")])}}}),Ll({schema:[Je("mouseIsDown",(function(){return Qe(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:La([km.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Bm.config({})]),events:$r([Kr(Kn(),n),Kr(Yn(),n),Kr(Zn(),n),Kr(tr(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],hw=r("slider.change.value"),pw=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?x.some(n.touches[0]).map((function(t){return uu(t.clientX,t.clientY)})):x.none()}var r=e;return void 0!==r.clientX?x.some(r).map((function(t){return uu(t.clientX,t.clientY)})):x.none()},vw=function(t){return t.model.minX},bw=function(t){return t.model.minY},yw=function(t){return t.model.minX-1},ww=function(t){return t.model.minY-1},xw=function(t){return t.model.maxX},Cw=function(t){return t.model.maxY},Sw=function(t){return t.model.maxX+1},kw=function(t){return t.model.maxY+1},Ow=function(t,e,n){return e(t)-n(t)},Tw=function(t){return Ow(t,xw,vw)},_w=function(t){return Ow(t,Cw,bw)},Ew=function(t){return Tw(t)/2},Aw=function(t){return _w(t)/2},Nw=function(t){return t.stepSize},Rw=function(t){return t.snapToGrid},Mw=function(t){return t.snapStart},zw=function(t){return t.rounded},Dw=function(t,e){return void 0!==t[e+"-edge"]},Bw=function(t){return Dw(t,"left")},Pw=function(t){return Dw(t,"right")},Iw=function(t){return Dw(t,"top")},Lw=function(t){return Dw(t,"bottom")},Hw=function(t){return t.model.value.get()},Fw=function(t){return{x:t}},Vw=function(t){return{y:t}},jw=function(t,e){return{x:t,y:e}},Uw=function(t,e){Vr(t,hw(),{value:e})},Ww=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},qw=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},$w=function(t,e,n){return Math.max(e,Math.min(n,t))},Gw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=$w(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return $w(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},Xw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},Kw="top",Yw="right",Jw="bottom",Qw="left",Zw=function(t){return t.element.dom.getBoundingClientRect()},tx=function(t,e){return t[e]},ex=function(t){var e=Zw(t);return tx(e,Qw)},nx=function(t){var e=Zw(t);return tx(e,Yw)},rx=function(t){var e=Zw(t);return tx(e,Kw)},ox=function(t){var e=Zw(t);return tx(e,Jw)},ix=function(t){var e=Zw(t);return tx(e,"width")},ux=function(t){var e=Zw(t);return tx(e,"height")},ax=function(t,e,n){return(t+e)/2-n},cx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Qw),i=tx(n,Yw),u=tx(r,Qw);return ax(o,i,u)},sx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Kw),i=tx(n,Jw),u=tx(r,Kw);return ax(o,i,u)},lx=function(t,e){Vr(t,hw(),{value:e})},fx=function(t){return{x:t}},dx=function(t,e,n){var r={min:vw(e),max:xw(e),range:Tw(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),maxBound:nx(t),screenRange:ix(t)};return Gw(r)},mx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).x,vw(n),xw(n),Nw(n));return lx(e,fx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},gx=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ix(t),u=r.bind((function(e){return x.some(cx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(cx(e,t))})).getOr(i),c={min:vw(e),max:xw(e),range:Tw(e),value:n,hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),minOffset:0,maxBound:nx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return ex(e)-ex(t)+u},hx=mx(-1),px=mx(1),vx=x.none,bx=x.none,yx={"top-left":x.none(),top:x.none(),"top-right":x.none(),right:x.some((function(t,e){Uw(t,Fw(Sw(e)))})),"bottom-right":x.none(),bottom:x.none(),"bottom-left":x.none(),left:x.some((function(t,e){Uw(t,Fw(yw(e)))}))},wx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n),o=fx(r);return lx(t,o),r},setToMin:function(t,e){var n=vw(e);lx(t,fx(n))},setToMax:function(t,e){var n=xw(e);lx(t,fx(n))},findValueOfOffset:dx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.left}))},findPositionOfValue:gx,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=fu(e.element)/2;Bi(e.element,"left",i-u+"px")},onLeft:hx,onRight:px,onUp:vx,onDown:bx,edgeActions:yx}),xx=function(t,e){Vr(t,hw(),{value:e})},Cx=function(t){return{y:t}},Sx=function(t,e,n){var r={min:bw(e),max:Cw(e),range:_w(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),maxBound:ox(t),screenRange:ux(t)};return Gw(r)},kx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).y,bw(n),Cw(n),Nw(n));return xx(e,Cx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},Ox=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ux(t),u=r.bind((function(e){return x.some(sx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(sx(e,t))})).getOr(i),c={min:bw(e),max:Cw(e),range:_w(e),value:n,hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),minOffset:0,maxBound:ox(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return rx(e)-rx(t)+u},Tx=x.none,_x=x.none,Ex=kx(-1),Ax=kx(1),Nx={"top-left":x.none(),top:x.some((function(t,e){Uw(t,Vw(ww(e)))})),"top-right":x.none(),right:x.none(),"bottom-right":x.none(),bottom:x.some((function(t,e){Uw(t,Vw(kw(e)))})),"bottom-left":x.none(),left:x.none()},Rx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Sx(t,e,n),o=Cx(r);return xx(t,o),r},setToMin:function(t,e){var n=bw(e);xx(t,Cx(n))},setToMax:function(t,e){var n=Cw(e);xx(t,Cx(n))},findValueOfOffset:Sx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.top}))},findPositionOfValue:Ox,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ru(e.element)/2;Bi(e.element,"top",i-u+"px")},onLeft:Tx,onRight:_x,onUp:Ex,onDown:Ax,edgeActions:Nx}),Mx=function(t,e){Vr(t,hw(),{value:e})},zx=function(t,e){return{x:t,y:e}},Dx=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?qw:Ww,i=e?Hw(r).x:o(Hw(r).x,vw(r),xw(r),Nw(r)),u=e?o(Hw(r).y,bw(r),Cw(r),Nw(r)):Hw(r).y;return Mx(n,zx(i,u)),x.some(i)}(t,e,n,r).map((function(){return!0}))}},Bx=Dx(-1,!1),Px=Dx(1,!1),Ix=Dx(-1,!0),Lx=Dx(1,!0),Hx={"top-left":x.some((function(t,e){Uw(t,jw(yw(e),ww(e)))})),top:x.some((function(t,e){Uw(t,jw(Ew(e),ww(e)))})),"top-right":x.some((function(t,e){Uw(t,jw(Sw(e),ww(e)))})),right:x.some((function(t,e){Uw(t,jw(Sw(e),Aw(e)))})),"bottom-right":x.some((function(t,e){Uw(t,jw(Sw(e),kw(e)))})),bottom:x.some((function(t,e){Uw(t,jw(Ew(e),kw(e)))})),"bottom-left":x.some((function(t,e){Uw(t,jw(yw(e),kw(e)))})),left:x.some((function(t,e){Uw(t,jw(yw(e),Aw(e)))}))},Fx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n.left),o=Sx(t,e,n.top),i=zx(r,o);return Mx(t,i),i},setToMin:function(t,e){var n=vw(e),r=bw(e);Mx(t,zx(n,r))},setToMax:function(t,e){var n=xw(e),r=Cw(e);Mx(t,zx(n,r))},getValueFromEvent:function(t){return pw(t)},setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=fu(e.element)/2,c=ru(e.element)/2;Bi(e.element,"left",i-a+"px"),Bi(e.element,"top",u-c+"px")},onLeft:Bx,onRight:Px,onUp:Ix,onDown:Lx,edgeActions:Hx}),Vx=gf({name:"Slider",configFields:[je("stepSize",1),je("onChange",t),je("onChoose",t),je("onInit",t),je("onDragStart",t),je("onDragEnd",t),je("snapToGrid",!1),je("rounded",!0),Pe("snapStart"),Ee("model",ve("mode",{x:[je("minX",0),je("maxX",100),Je("value",(function(t){return Qe(t.mode.minX)})),_e("getInitialValue"),Zu("manager",wx)],y:[je("minY",0),je("maxY",100),Je("value",(function(t){return Qe(t.mode.minY)})),_e("getInitialValue"),Zu("manager",Rx)],xy:[je("minX",0),je("maxX",100),je("minY",0),je("maxY",100),Je("value",(function(t){return Qe({x:t.mode.minX,y:t.mode.minY})})),_e("getInitialValue"),Zu("manager",Fx)]})),fl("sliderBehaviours",[km,ll]),Je("mouseIsDown",(function(){return Qe(!1)}))],partFields:gw,factory:function(t,e,n,r){var o,i=function(e){return Zl(e,t,"thumb")},u=function(e){return Zl(e,t,"spectrum")},a=function(e){return Ql(e,t,"left-edge")},c=function(e){return Ql(e,t,"right-edge")},l=function(e){return Ql(e,t,"top-edge")},f=function(e){return Ql(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:l,getBottomEdge:f,getSpectrum:u})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),x.some(!0)},p=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Ql(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},b=function(e,n){n.stop(),t.onDragEnd(e,i(e)),p(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.sliderBehaviours,[km.config({mode:"special",focusIn:function(e){return Ql(e,t,"spectrum").map(km.focusIn).map(s)}}),ll.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),Wa.config({channels:(o={},o[Gs()]={onReceive:p},o)})]),events:$r([Kr(hw(),(function(t,e){h(t,e.event.value)})),ro((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),Kr(Kn(),v),Kr(Jn(),b),Kr(Zn(),v),Kr(nr(),b)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),jx=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Vx.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return Vx.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:r({y:0})},components:[n,o],sliderBehaviours:La([Bm.config({})]),onChange:function(t,e,n){Vr(t,rw,{value:n})}})},Ux="form",Wx=[fl("formBehaviours",[ll])],qx=function(t){return"<alloy.field."+t+">"},$x=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.formBehaviours,[ll.config({store:{mode:"manual",getValue:function(e){var n=ef(e,t);return wt(n,(function(t,e){return t().bind((function(t){var n,r;return n=wf.getCurrent(t),r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ho(t.element)),n.fold((function(){return ct.error(r)}),ct.value)})).map(ll.getValue)}))},setValue:function(e,n){yt(n,(function(n,r){Ql(e,t,r).each((function(t){wf.getCurrent(t).each((function(t){ll.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Ql(e,t,n).bind(wf.getCurrent)}}}},Gx={getField:oi((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),Gl(Ux,qx(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:qx(t)})}));return sf(Ux,Wx,o,$x,n)}},Xx=Uo("valid-input"),Kx=Uo("invalid-input"),Yx=Uo("validating-input"),Jx="colorcustom.rgb.",Qx=function(e,n,r,o){var i=function(t,r){return zy.config({invalidClass:n("invalid"),notify:{onValidate:function(e){Vr(e,Yx,{type:t})},onValid:function(e){Vr(e,Xx,{type:t,value:ll.getValue(e)})},onInvalid:function(e){Vr(e,Kx,{type:t,value:ll.getValue(e)})}},validator:{validate:function(t){var n=ll.getValue(t),o=r(n)?ct.value(!0):ct.error(e("aria.input.invalid"));return Sy(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=e("colorcustom.rgb.range"),l=[qb.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),qb.parts.field({data:c,factory:my,inputAttributes:f({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:La([i(o,r),Xb.config({})]),onSetValue:function(e){zy.isInvalid(e)&&zy.run(e).get(t)}})],d="hex"!==o?[qb.parts["aria-descriptor"]({text:s})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(d)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;ll.setValue(t,{red:n,green:r,blue:o})},c=Rg({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Bi(t.element,"background-color","#"+e.value)}))};return mf({factory:function(){var t={red:Qe(x.some(255)),green:Qe(x.some(255)),blue:Qe(x.some(255)),hex:Qe(x.some("ffffff"))},i=function(e){return t[e].get()},l=function(e,n){t[e].set(n)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",x.some(e)),l("green",x.some(n)),l("blue",x.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,x.none()):o(t)},m=function(t,e){var n=e.event;!function(t){return"hex"===t.type}(n)?function(t,e,n){var r=parseInt(n,10);l(e,x.some(r)),i("red").bind((function(t){return i("green").bind((function(e){return i("blue").map((function(n){return Hv(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=zv(e);return Gx.getField(t,"hex").each((function(e){Bm.isFocused(e)||ll.setValue(t,{hex:n.value})})),n}(t,e);s(t,n)}))}(t,n.type,n.value):function(t,e){r(t);var n=Ev(e);l("hex",x.some(e));var o=jv(n);a(t,o),f(o),Vr(t,nw,{hex:n}),s(t,n)}(t,n.value)},g=function(t){return{label:e(Jx+t+".label"),description:e(Jx+t+".description")}},h=g("red"),p=g("green"),v=g("blue"),b=g("hex");return Rt(Gx.sketch((function(t){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[t.field("red",qb.sketch(u(Fv,"red",h.label,h.description,255))),t.field("green",qb.sketch(u(Fv,"green",p.label,p.description,255))),t.field("blue",qb.sketch(u(Fv,"blue",v.label,v.description,255))),t.field("hex",qb.sketch(u(Rv,"hex",b.label,b.description,"ffffff"))),c.asSpec()],formBehaviours:La([zy.config({invalidClass:n("form-invalid")}),Nm("rgb-form-events",[Kr(Xx,m),Kr(Kx,d),Kr(Yx,d)])])}})),{apis:{updateHex:function(t,e){ll.setValue(t,{hex:e.value}),function(t,e){var n=jv(e);a(t,n),f(n)}(t,e),s(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Zx=function(e,n){return mf({name:"ColourPicker",configFields:[_e("dom"),je("onValidHex",t),je("onInvalidHex",t)],factory:function(t){var o,i=Qx(e,n,t.onValidHex,t.onInvalidHex),u=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),o=Vx.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return mf({factory:function(t){var u=r({x:0,y:0}),a=La([wf.config({find:x.some}),Bm.config({})]);return Vx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[n,o],onChange:function(t,e,n){Vr(t,ow,{value:n})},onInit:function(t,e,n,r){i(n.element.dom,Wv(qv))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom;i(n,Wv(e))}(e,n)}},extraApis:{}})}(0,n),a={paletteRgba:Qe(qv)},c=Rg(u.sketch({})),s=Rg(i.sketch({})),l=function(t,e){c.getOpt(t).each((function(t){var n=jv(e);a.paletteRgba.set(n),u.setRgba(t,n)}))},f=function(t,e){s.getOpt(t).each((function(t){i.updateHex(t,e)}))},d=function(t,e,n){j(n,(function(n){n(t,e)}))};return{uid:t.uid,dom:t.dom,components:[c.asSpec(),jx(0,n),s.asSpec()],behaviours:La([Nm("colour-picker-events",[Kr(ow,(o=[f],function(t,e){var n=e.event.value,r=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?ew(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,ew(Math.round(n),Math.round(100*e),Math.round(100*r)))}(a.paletteRgba.get()),i=ew(r.hue,n.x,100-n.y),u=Vv(i),c=zv(u);d(t,c,o)})),Kr(rw,function(){var t=[l,f];return function(e,n){var r=function(t){var e=ew((100-t)/100*360,100,100),n=Vv(e);return zv(n)}(n.event.value.y);d(e,r,t)}}())]),wf.config({find:function(t){return s.getOpt(t)}}),km.config({mode:"acyclic"})])}}})},tC=function(){return wf.config({find:x.some})},eC=function(t){return wf.config({find:function(e){return xo(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},nC={"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","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},rC=function(t){return function(t){return nC[t]}(t)},oC=tinymce.util.Tools.resolve("tinymce.Resource"),iC=tinymce.util.Tools.resolve("tinymce.util.Tools"),uC=Zt([je("preprocess",o),je("postprocess",o)]),aC=function(t,e,n){return ll.config(Rt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},cC=function(t,e){var n=ge("RepresentingConfigs.memento processors",uC,e);return ll.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=ll.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);ll.setValue(i,o)}}})},sC=aC,lC=function(t){return e=No,n=Ro,aC(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}));var e,n},fC=function(t){return ll.config({store:{mode:"memory",initialValue:t}})},dC=Uo("alloy-fake-before-tabstop"),mC=Uo("alloy-fake-after-tabstop"),gC=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:La([Bm.config({ignore:!0}),Xb.config({})])}},hC=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[gC([dC]),t,gC([mC])],behaviours:La([eC(1)])}},pC=function(t,e){Vr(t,ur(),{raw:{which:9,shiftKey:e}})},vC=function(t,e){var n=e.element;yi(n,dC)?pC(t,!0):yi(n,mC)&&pC(t,!1)},bC=function(t){return Ab(t,["."+dC,"."+mC].join(","),c)},yC=!(Ln().browser.isIE()||Ln().browser.isEdge());function wC(t,e){return SC(document.createElement("canvas"),t,e)}function xC(t){var e=wC(t.width,t.height);return CC(e).drawImage(t,0,0),e}function CC(t){return t.getContext("2d")}function SC(t,e,n){return t.width=e,t.height=n,t}function kC(t){return t.naturalWidth||t.width}function OC(t){return t.naturalHeight||t.height}var TC=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function _C(t,e,n){return e=e||"image/png",N(HTMLCanvasElement.prototype.toBlob)?new TC((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):(r=t.toDataURL(e,n),new TC((function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return x.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,a),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=u[g].charCodeAt(0);s[l]=new Uint8Array(m)}return x.some(new Blob(s,{type:r}))})(r).fold((function(){e("uri is not base64: "+r)}),t)})));var r}function EC(t,e,n){var o=e.type;function i(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:r(o),toBlob:function(){return TC.resolve(e)},toDataURL:r(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return _C(t,e,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(xC)}}}function AC(t){return function(t){return new TC((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return EC(function(t){return function(t){return new TC((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=wC(kC(t),OC(t));return CC(e).drawImage(t,0,0),e}))}(t),t,e)}))}function NC(t,e){return _C(t,e).then((function(e){return EC(TC.resolve(t),e,t.toDataURL())}))}function RC(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var MC=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function zC(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o}function DC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t);var o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*O+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),NC(t,e)}(n,t.getType(),e)}))}function BC(t){return function(e,n){return DC(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var PC,IC,LC=function(t){return function(e){return DC(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),HC=BC((function(t,e){return zC(t,[1,0,0,0,e=RC(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),FC=BC((function(t,e){var n;return e=RC(e,-1,1),zC(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?MC[e]:MC[Math.floor(e)]*(1-n)+MC[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),VC=(PC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),NC(t,e)}(n,t.getType(),e)}))}(t,PC)}),jC=(IC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=CC(t),o=new Array(256),i=0;i<o.length;i++)o[i]=IC(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),NC(t,e)}(n,t.getType(),e)}))});function UC(t,e,n){var r=kC(t),o=OC(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=function(t,e,n){return new TC((function(r){var o=kC(t),i=OC(t),u=Math.floor(o*e),a=Math.floor(i*n),c=wC(u,a);CC(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}(t,i,u);return a?c.then((function(t){return UC(t,e,n)})):c}var WC,qC=function(t){return LC(t)},$C=function(t){return VC(t)},GC=function(t,e){return jC(t,e)},XC=function(t,e){return HC(t,e)},KC=function(t,e){return FC(t,e)},YC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),NC(r,e)}(n,t.getType(),e)}))}(t,e)},JC=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return UC(r,e,n).then((function(e){return NC(e,t.getType())}))}))}(t,e,n)},QC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||SC(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),NC(r,e)}(n,t.getType(),e)}))}(t,e)},ZC=function(t,e){return f({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},tS=function(t,e){return ZC(zg(t,e),{})},eS=function(t,e){return ZC(zg(t,e),{behaviours:La([Am.config({})])})},nS=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:La([Am.config({})])}},rS=Uo("toolbar.button.execute"),oS=((WC={})[yr()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],WC),iS=Uo("update-menu-text"),uS=Uo("update-menu-icon"),aS=function(e,n,r){var o=Qe(t),u=e.text.map((function(t){return Rg(nS(t,n,r.providers))})),a=e.icon.map((function(t){return Rg(eS(t,r.providers.icons))})),c=function(t,e){var n=ll.getValue(t);return Bm.focus(n),Vr(n,"keydown",{raw:e.event.raw}),Yy.close(n),x.some(!0)},s=e.role.fold((function(){return{}}),(function(t){return{role:t}})),l=e.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}}));return Rg(Yy.sketch(f(f(f({},e.uid?{uid:e.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(V(e.classes,(function(t){return n+"--"+t}))),attributes:f({},l)},components:lv([a.map((function(t){return t.asSpec()})),u.map((function(t){return t.asSpec()})),x.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:zg("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:La(m(e.dropdownBehaviours,[nv((function(){return e.disabled||r.providers.isDisabled()})),ev(),Jy.config({}),Am.config({}),Nm("dropdown-events",[uv(e,o),av(e,o)]),Nm("menubutton-update-display-text",[Kr(iS,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[Yi(r.providers.translate(e.event.text))])}))})),Kr(uS,(function(t,e){a.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[eS(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Rt(oS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:La([km.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:Mh(0,e.columns,e.presets)},fetch:function(t){return Cy(i(e.fetch,t))}}))).asSpec()},cS=function(t){return"separator"===t.type},sS={type:"separator"},lS=function(t,e){var n=function(t,e){var n=$(t,(function(t,n){return function(t){return k(t)}(n)?""===n?t:"|"===n?t.length>0&&!cS(t[t.length-1])?t.concat([sS]):t:Tt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&cS(n[n.length-1])&&n.pop(),n}(k(t)?t.split(" "):t,e);return q(n,(function(t,n){var r=function(t,e){return function(t){return Tt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=lS(n,e);return{item:t,menus:Rt(r.menus,Vt(t.value,r.items)),expansions:Rt(r.expansions,Vt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}}(function(t){if(cS(t))return t;var e=Ot(t,"value").getOrThunk((function(){return Uo("generated-menu-item")}));return Rt({value:e},t)}(n),e);return{menus:Rt(t.menus,r.menus),items:[r.item].concat(t.items),expansions:Rt(t.expansions,r.expansions)}}),{menus:{},expansions:{},items:[]})},fS=function(t,e,n,r){var o=Uo("primary-menu"),i=lS(t,n.shared.providers.menuItems());if(0===i.items.length)return x.none();var u=Cb(o,i.items,e,n,r),a=wt(i.menus,(function(t,r){return Cb(r,t,e,n,!1)})),c=Rt(a,Vt(o,u));return x.from(pg.tieredData(o,c,i.expansions))},dS=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setActive:function(e){var n=t.element;e?(vi(n,"tox-tbtn--enabled"),zo(n,"aria-pressed",!0)):(bi(n,"tox-tbtn--enabled"),Io(n,"aria-pressed"))},isActive:function(){return yi(t.element,"tox-tbtn--enabled")}}},mS=function(t,e,n,r){return aS({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(fS(t,ph.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:dS,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({})]},e,n.shared)},gS=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){$a(e.element),Vr(e,ry,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(V(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return f(f({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},hS=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=f({buttonBehaviours:La([nv((function(){return t.disabled||i.isDisabled()})),ev(),Xb.config({}),Nm("button press",[Xr("click"),Xr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Rt(a,{dom:r});return Rt(c,{components:o})},pS=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return tS(t,n.icons)})),u=lv([i]);return hS(t,e,r,o,u,n)},vS=function(t,e,n,r){void 0===r&&(r=[]);var o=pS(t,x.some(e),n,r);return Ng.sketch(o)},bS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return tS(t,n.icons)})):x.none(),a=u.isSome()?lv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=m(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=f(f({tag:"button",classes:s},c),{attributes:{title:i}});return hS(t,e,r,l,a,n)},yS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=bS(t,x.some(e),n,r,o);return Ng.sketch(i)},wS=function(t,e){return function(n){"custom"===e?Vr(n,ry,{name:t,value:{}}):"submit"===e?Fr(n,oy):"cancel"===e?Fr(n,ny):console.error("Unknown button type: ",e)}},xS=function(e,n,r){if(function(t,e){return"menu"===e}(0,n)){var o=e,i=f(f({},e),{onSetup:function(n){return n.setDisabled(e.disabled),t},fetch:gS(o.items,(function(){return u}),r)}),u=Rg(mS(i,"tox-tbtn",r,x.none()));return u.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,n)){var a=wS(e.name,n),c=f(f({},e),{borderless:!1});return yS(c,a,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},CS=r([je("field1Name","field1"),je("field2Name","field2"),Ju("onLockedChange"),Gu(["lockClass"]),je("locked",!1),gl("coupledFieldBehaviours",[wf,ll])]),SS=function(t,e){return Ll({factory:qb,name:t,overrides:function(t){return{fieldBehaviours:La([Nm("coupled-input-behaviour",[Kr(cr(),(function(n){(function(t,e,n){return Ql(t,e,n).bind(wf.getCurrent)})(n,t,e).each((function(e){Ql(n,t,"lock").each((function(r){Gm.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},kS=r([SS("field1","field2"),SS("field2","field1"),Ll({factory:Ng,schema:[_e("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:La([Gm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),OS=gf({name:"FormCoupledInputs",configFields:CS(),partFields:kS(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hl(t.coupledFieldBehaviours,[wf.config({find:x.some}),ll.config({store:{mode:"manual",getValue:function(e){var n,r=rf(e,t,["field1","field2"]);return(n={})[t.field1Name]=ll.getValue(r.field1()),n[t.field2Name]=ll.getValue(r.field2()),n},setValue:function(e,n){var r=rf(e,t,["field1","field2"]);_t(n,t.field1Name)&&ll.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&ll.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Ql(e,t,"field1")},getField2:function(e){return Ql(e,t,"field2")},getLock:function(e){return Ql(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),TS=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return ct.value({value:n,unit:r})}return ct.error(t)},_S=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?x.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?x.some(t.value):x.some(t.value/n[t.unit]*n[e]):x.none()},ES=function(t){return x.none()},AS=function(t,e){var n=ES,r=Uo("ratio-event"),o=OS.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:zg("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:zg("unlock",e.icons)}}],buttonBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return qb.parts.field({factory:my,inputClasses:["tox-textfield"],inputBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({}),Nm("size-input-events",[Kr(or(),(function(t,e){Vr(t,r,{isField1:n})})),Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=OS.parts.field1(i([qb.parts.label(a("Width")),u(!0)])),s=OS.parts.field2(i([qb.parts.label(a("Height")),u(!1)]));return OS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){TS(ll.getValue(t)).each((function(t){n(t).each((function(t){ll.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.disable),OS.getField2(t).bind(qb.getField).each(kp.disable),OS.getLock(t).each(kp.disable)},onEnabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.enable),OS.getField2(t).bind(qb.getField).each(kp.enable),OS.getLock(t).each(kp.enable)}}),ev(),Nm("size-input-events2",[Kr(r,(function(t,e){var r,o,i,u,a=e.event.isField1,c=a?OS.getField1(t):OS.getField2(t),s=a?OS.getField2(t):OS.getField1(t),l=c.map(ll.getValue).getOr(""),f=s.map(ll.getValue).getOr("");r=f,n=(o=TS(l).toOptional(),i=TS(r).toOptional(),u=function(t,e){return _S(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return _S(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(ES)},o.isSome()&&i.isSome()?x.some(u(o.getOrDie(),i.getOrDie())):x.none()).getOr(ES)}))])])})},NS={undo:r(Uo("undo")),redo:r(Uo("redo")),zoom:r(Uo("zoom")),back:r(Uo("back")),apply:r(Uo("apply")),swap:r(Uo("swap")),transform:r(Uo("transform")),tempTransform:r(Uo("temp-transform")),transformApply:r(Uo("transform-apply"))},RS=r("save-state"),MS=r("disable"),zS=r("enable"),DS={formActionEvent:ry,saveState:RS,disable:MS,enable:zS},BS=function(e,n){var o=function(t,e,r,o){return Rg(yS({name:t,text:t,disabled:r,primary:o,icon:x.none(),borderless:!1},e,n))},i=function(t,e,r,o){return Rg(vS({name:t,icon:x.some(t),tooltip:x.some(e),disabled:o,primary:!1,borderless:!1},r,n))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=t,l=function(t,e,n){Vr(t,e,n)},f=function(t){return Fr(t,DS.disable())},d=function(t){return Fr(t,DS.enable())},m=function(t,e){f(t),l(t,NS.transform(),{transform:e}),d(t)},g=function(t){return function(){et.getOpt(t).each((function(t){Am.set(t,[Z])}))}},h=function(t,e){f(t),l(t,NS.transformApply(),{transform:e,swap:g(t)}),d(t)},p=function(){return o("Back",(function(t){return l(t,NS.back(),{swap:g(t)})}),!1,!1)},v=function(){return Rg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:La([kp.config({})])})},b=function(){return o("Apply",(function(t){return l(t,NS.apply(),{swap:g(t)})}),!0,!0)},y=function(){return function(t){var n=e.getRect();return function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return function(t,e,n,r,o,i){var u=wC(o,i);return CC(u).drawImage(t,-n,-r),NC(u,e)}(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)}(t,n.x,n.y,n.w,n.h)}},w=[p(),v(),o("Apply",(function(t){var n=y();h(t,n),e.hideCrop()}),!1,!0)],C=Vb.sketch({dom:c,components:w.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-crop-buttons-events",[Kr(DS.disable(),(function(t,e){u(w,t)})),Kr(DS.enable(),(function(t,e){a(w,t)}))])])}),S=Rg(AS({name:"size",label:x.none(),constrain:!0,disabled:!1},n)),k=[p(),v(),S,v(),o("Apply",(function(t){S.getOpt(t).each((function(e){var n,r,o=ll.getValue(e),i=(n=parseInt(o.width,10),r=parseInt(o.height,10),function(t){return JC(t,n,r)});h(t,i)}))}),!1,!0)],O=Vb.sketch({dom:c,components:k.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-resize-buttons-events",[Kr(DS.disable(),(function(t,e){u(k,t)})),Kr(DS.enable(),(function(t,e){a(k,t)}))])])}),T=function(t,e){return function(n){return t(n,e)}},_=T(YC,"h"),E=T(YC,"v"),A=T(QC,-90),N=T(QC,90),R=function(t,e){!function(t,e){f(t),l(t,NS.tempTransform(),{transform:e}),d(t)}(t,e)},M=[p(),v(),i("flip-horizontally","Flip horizontally",(function(t){R(t,_)}),!1),i("flip-vertically","Flip vertically",(function(t){R(t,E)}),!1),i("rotate-left","Rotate counterclockwise",(function(t){R(t,A)}),!1),i("rotate-right","Rotate clockwise",(function(t){R(t,N)}),!1),v(),b()],z=Vb.sketch({dom:c,components:M.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-fliprotate-buttons-events",[Kr(DS.disable(),(function(t,e){u(M,t)})),Kr(DS.enable(),(function(t,e){a(M,t)}))])])}),D=function(t,e,o,i,u){var a=Vx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}),c=Vx.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=Vx.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Rg(Vx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:u,getInitialValue:r({x:i})},components:[a,c,s],sliderBehaviours:La([Bm.config({})]),onChoose:e}))},B=function(t,e,n,r,o){return D(t,(function(t,n,r){var o=T(e,r.x/100);m(t,o)}),n,r,o)},P=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[p(),B(t,e,n,r,o),b()]}(t,e,n,r,o);return Vb.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-filter-panel-buttons-events",[Kr(DS.disable(),(function(t,e){u(i,t)})),Kr(DS.enable(),(function(t,e){a(i,t)}))])])})},I=[p(),v(),b()],L=Vb.sketch({dom:c,components:I.map((function(t){return t.asSpec()}))}),H=P("Brightness",XC,-100,0,100),F=P("Contrast",KC,-100,0,100),V=P("Gamma",GC,-100,0,100),j=function(t,e,n){return function(r){return function(t,e,n,r){return function(t,e,n,r){return DC(t,function(t,e,n,r){return zC([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[e=RC(e,0,2),0,0,0,0,0,n=RC(n,0,2),0,0,0,0,0,r=RC(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}(0,e,n,r))}(t,e,n,r)}(r,t,e,n)}},U=function(t){return D(t,(function(t,e,n){var r=W.getOpt(t),o=$.getOpt(t),i=q.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=ll.getValue(e).x/100,i=ll.getValue(r).x/100,u=ll.getValue(n).x/100,a=j(o,i,u);m(t,a)}))}))}))}),0,100,200)},W=U("R"),q=U("G"),$=U("B"),G=[p(),W,q,$,b()],X=Vb.sketch({dom:c,components:G.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){l(r,NS.swap(),{transform:e,swap:function(){et.getOpt(r).each((function(e){Am.set(e,[t]),n(e)}))}})}},Y=x.some($C),J=x.some(qC),Q=[i("crop","Crop",K(C,x.none(),(function(t){e.showCrop()})),!1),i("resize","Resize",K(O,x.none(),(function(t){S.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;ll.setValue(t,{width:r,height:o})}))})),!1),i("orientation","Orientation",K(z,x.none(),s),!1),i("brightness","Brightness",K(H,x.none(),s),!1),i("sharpen","Sharpen",K(L,Y,s),!1),i("contrast","Contrast",K(F,x.none(),s),!1),i("color-levels","Color levels",K(X,x.none(),s),!1),i("gamma","Gamma",K(V,x.none(),s),!1),i("invert","Invert",K(L,J,s),!1)],Z=Vb.sketch({dom:c,components:Q.map((function(t){return t.asSpec()}))}),tt=Vb.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:La([Am.config({})])}),et=Rg(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},PS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),IS=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),LS=tinymce.util.Tools.resolve("tinymce.util.Observable"),HS=tinymce.util.Tools.resolve("tinymce.util.VK");function FS(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function VS(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(FS(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){FS(t),IS(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};this.destroy=function(){IS(a).off()},IS(a).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);FS(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=IS("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(u.body),IS(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)}))}var jS,US=0,WS=function(t){var e=Rg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=Qe(1),r=Qe(x.none()),o=Qe({x:0,y:0,w:1,h:1}),i=Qe({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=fu(t.element),c=ru(t.element),s=i.dom.naturalWidth*u,l=i.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Pi(i,m),e.getOpt(t).each((function(t){Pi(t.element,m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=en("img");return zo(a,"src",e),(r=a.dom,new Gg((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){return s.getOpt(t).map((function(t){var e=Ji({element:a});Am.replaceAt(t,1,x.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=PS.inflate(c,-20,-20);return o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=fu(t.element),o=ru(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a),a}))}))},c=Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:La([Nm("image-panel-crop-events",[ro((function(t){s.getOpt(t).each((function(t){var e=function(t,e,n,r,o){var i,u="tox-crid-"+US++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function l(e,r,o,i){var u,a,c,l,f;u=r.x,a=r.y,c=r.w,l=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=PS.clamp({x:u,y:a,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)}function f(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),IS("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}iC.each(a,(function(e){IS("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){f(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}IS('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),iC.each(c,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),iC.each(a,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=iC.map(a,(function(e){var n;return new VS(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),IS(r).on("focusin focusout",(function(t){IS(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),IS(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)}switch(iC.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1})),e.keyCode){case HS.LEFT:r(e,0,t,-10,0);break;case HS.RIGHT:r(e,0,t,10,0);break;case HS.UP:r(e,0,t,0,-10);break;case HS.DOWN:r(e,0,t,0,10);break;case HS.ENTER:case HS.SPACEBAR:e.preventDefault(),o()}}));var g=iC.extend({toggleVisibility:function(t){var e=iC.map(a,(function(t){return"#"+u+"-"+t.name})).concat(iC.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?IS(e,r).show():IS(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){iC.each(i,(function(t){t.destroy()})),i=[]}},LS);return g}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element.dom,(function(){}));e.toggleVisibility(!1),e.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(x.some(e))}))}))])])}],containerBehaviours:La([Am.config({}),Nm("image-panel-events",[ro((function(e){a(e,t)}))])])}),s=Rg(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.get().each((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.get().each((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},qS=function(t,e,n,r,o){return vS({name:t,icon:x.some(e),disabled:n,tooltip:x.some(t),primary:!1,borderless:!1},r,o)},$S=function(t,e){e?kp.enable(t):kp.disable(t)},GS=function(e,n){var r=function(t){var e=Qe(t),n=Qe(x.none()),r=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();r.add(t);var o=function(t){e.set(t)},i=function(t){return{blob:t,url:URL.createObjectURL(t)}},u=function(t){URL.revokeObjectURL(t.url)},a=function(){n.get().each(u),n.set(x.none())},c=function(t){var e,n=i(t);return o(n),e=r.add(n).removed,iC.each(e,u),n.url};return{getBlobState:function(){return e.get()},setBlobState:o,addBlobState:c,getTempState:function(){return n.get().fold((function(){return e.get()}),(function(t){return t}))},updateTempState:function(t){var e=i(t);return a(),n.set(x.some(e)),e.url},addTempState:function(t){var e=i(t);return n.set(x.some(e)),e.url},applyTempState:function(t){return n.get().fold((function(){}),(function(e){c(e.blob),t()}))},destroyTempState:a,undo:function(){var t=r.undo();return o(t),t.url},redo:function(){var t=r.redo();return o(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}}(e.currentState),o=function(t){var e=r.getHistoryStates();m.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Vr(t,DS.formActionEvent,{name:DS.saveState(),value:e.undoEnabled})},i=function(t){return t.toBlob()},u=function(t){Vr(t,DS.formActionEvent,{name:DS.disable(),value:{}})},a=function(t){g.getApplyButton(t).each((function(t){kp.enable(t)})),Vr(t,DS.formActionEvent,{name:DS.enable(),value:{}})},c=function(t,e){return u(t),d.updateSrc(t,e)},s=function(t,e,n,r,s){return u(t),function(t){return AC(t)}(e).then(n).then(i).then(r).then((function(e){return c(t,e).then((function(e){return o(t),s(),a(t),e}))})).catch((function(e){return console.log(e),a(t),e}))},l=function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(t){return r.updateTempState(t)}),n)},f=function(t){var e=r.getBlobState().url;return r.destroyTempState(),o(t),e},d=WS(e.currentState.url),m=function(t){var e=Rg(qS("Undo","undo",!0,(function(t){Vr(t,NS.undo(),{direction:1})}),t)),n=Rg(qS("Redo","redo",!0,(function(t){Vr(t,NS.redo(),{direction:1})}),t));return{container:Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),qS("Zoom in","zoom-in",!1,(function(t){Vr(t,NS.zoom(),{direction:1})}),t),qS("Zoom out","zoom-out",!1,(function(t){Vr(t,NS.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){$S(t,r)})),n.getOpt(t).each((function(t){$S(t,o)}))}}}(n),g=BS(d,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[g.memContainer.asSpec(),d.memContainer.asSpec(),m.container],behaviours:La([ll.config({store:{mode:"manual",getValue:function(){return r.getBlobState()}}}),Nm("image-tools-events",[Kr(NS.undo(),(function(t,e){var n=r.undo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.redo(),(function(t,e){var n=r.redo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.zoom(),(function(t,e){var n=e.event.direction;d.zoom(t,n)})),Kr(NS.back(),(function(t,e){!function(t){var e=f(t);c(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),d.hideCrop()})),Kr(NS.apply(),(function(t,e){r.applyTempState((function(){f(t),(0,e.event.swap)()}))})),Kr(NS.transform(),(function(e,n){return l(e,n.event.transform,t)})),Kr(NS.tempTransform(),(function(e,n){return function(e,n){var o=r.getTempState().blob;s(e,o,n,(function(t){return r.addTempState(t)}),t)}(e,n.event.transform)})),Kr(NS.transformApply(),(function(t,e){return function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(e){var n=r.addBlobState(e);return f(t),n}),n)}(t,e.event.transform,e.event.swap)})),Kr(NS.swap(),(function(t,e){!function(t){m.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){l(t,e,r)}))}))]),tC()])}},XS=function(t){return!Tt(t,"items")},KS="data-value",YS=function(t,e,n,r){return V(n,(function(n){return XS(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){ll.setValue(t,n.value),Vr(t,ty,{name:e}),Bm.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return YS(t,e,n.items,r)}}}))},JS=function(t,e){return it(t,(function(t){return XS(t)?pf(t.value===e,t):JS(t.items,e)}))},QS=mf({name:"HtmlSelect",configFields:[_e("options"),fl("selectBehaviours",[Bm,ll]),je("selectClasses",[]),je("selectAttributes",{}),Pe("data")],factory:function(t,e){var n=V(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Vt("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:ml(t.selectBehaviours,[Bm.config({}),ll.config({store:f({mode:"manual",getValue:function(t){return qi(t.element)},setValue:function(e,n){G(t.options,(function(t){return t.value===n})).isSome()&&$i(e.element,n)}},r)})])}}}),ZS=function(t,e){var n=t.label.map((function(t){return Zb(t,e)})),o=[kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),km.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Fr(t,oy),x.some(!0)}}),Nm("textfield-change",[Kr(cr(),(function(e,n){Vr(e,ty,{name:t.name})})),Kr(vr(),(function(e,n){Vr(e,ty,{name:t.name})}))]),Xb.config({})],i=t.validation.map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=ll.getValue(e),r=t.validator(n);return Sy(!0===r?ct.value(n):ct.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),u=t.placeholder.fold(r({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(r({}),(function(t){return{inputmode:t}})),c=f(f({},u),a),s=qb.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:c,inputClasses:[t.classname],inputBehaviours:La(K([o,i])),selectOnFocus:!1,factory:my}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),d=[kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()];return Yb(n,s,l,d)},tk=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return $r([Kr(t.event,n),oo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Kr(t,(function(){return e.cancel()}))]})).getOr([])))}}),ek=function(t){var e=Qe(null);return ui({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},nk=Object.freeze({__proto__:null,throttle:ek,init:function(t){return t.stream.streams.state(t)}}),rk=[Ee("stream",ve("mode",{throttle:[_e("delay"),je("stopEvent",!0),Zu("streams",{setup:function(t,e){var n=t.stream,r=Lg(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:ek})]})),je("event","input"),Pe("cancelEvent"),Ju("onStream")],ok=Fa({fields:rk,name:"streaming",active:tk,state:nk}),ik=function(t,e,n){var r=ll.getValue(n);ll.setValue(e,r),ak(e)},uk=function(t,e){var n=t.element,r=qi(n),o=n.dom;"number"!==Do(n,"type")&&e(o,r)},ak=function(t){uk(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},ck=r("alloy.typeahead.itemexecute"),sk=r([Pe("lazySink"),_e("fetch"),je("minChars",5),je("responseTime",1e3),Ku("onOpen"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),je("layouts",x.none()),je("eventOrder",{}),Ye("model",{},[je("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),je("selectsOver",!0),je("populateFromBrowse",!0)]),Ku("onSetValue"),Yu("onExecute"),Ku("onItemExecute"),je("inputClasses",[]),je("inputAttributes",{}),je("inputStyles",{}),je("matchWidth",!0),je("useMinWidth",!1),je("dismissOnBlur",!0),Gu(["openClass"]),Pe("initialData"),fl("typeaheadBehaviours",[Bm,ll,ok,km,Gm,Py]),Je("previewing",(function(){return Qe(!0)}))].concat(sy()).concat(Gy())),lk=r([Hl({schema:[$u()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){(function(t,e,n){if(t.selectsOver){var r=ll.getValue(e),o=t.getDisplayText(r),i=ll.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?x.some((function(){ik(0,e,n),function(t,e){uk(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):x.none()}return x.none()})(t.model,r,n).fold((function(){return Nf.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Vr(t,ck(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)}))}}}})]),fk=gf({name:"Typeahead",configFields:sk(),partFields:lk(),factory:function(e,n,r,o){var i=function(n,r,i){e.previewing.set(!1);var u=Py.getCoupled(n,"sandbox");Ws.isOpen(u)?wf.getCurrent(u).each((function(t){Nf.getHighlighted(t).fold((function(){i(t)}),(function(){qr(u,t.element,"keydown",r)}))})):Fy(e,a(n),n,u,o,(function(t){wf.getCurrent(t).each(i)}),py.HighlightFirst).get(t)},u=ly(e),a=function(t){return function(e){return e.map((function(e){var n=kt(e.menus),r=Y(n,(function(t){return W(t.items,(function(t){return"item"===t.type}))}));return ll.getState(t).update(V(r,(function(t){return t.data}))),e}))}},c=[Bm.config({}),ll.config({onSetValue:e.onSetValue,store:f({mode:"dataset",getDataKey:function(t){return qi(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){$i(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(t){return Vt("initialValue",t)})).getOr({}))}),ok.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(n,r){var i=Py.getCoupled(n,"sandbox");if(Bm.isFocused(n)&&qi(n.element).length>=e.minChars){var u=wf.getCurrent(i).bind((function(t){return Nf.getHighlighted(t).map(ll.getValue)}));e.previewing.set(!0),Fy(e,a(n),n,i,o,(function(t){wf.getCurrent(i).each((function(t){u.fold((function(){e.model.selectsOver&&Nf.highlightFirst(t)}),(function(e){Nf.highlightBy(t,(function(t){return ll.getValue(t).value===e.value})),Nf.getHighlighted(t).orThunk((function(){return Nf.highlightFirst(t),x.none()}))}))}))}),py.HighlightFirst).get(t)}},cancelEvent:kr()}),km.config({mode:"special",onDown:function(t,e){return i(t,e,Nf.highlightFirst),x.some(!0)},onEscape:function(t){var e=Py.getCoupled(t,"sandbox");return Ws.isOpen(e)?(Ws.close(e),x.some(!0)):x.none()},onUp:function(t,e){return i(t,e,Nf.highlightLast),x.some(!0)},onEnter:function(t){var n=Py.getCoupled(t,"sandbox"),r=Ws.isOpen(n);if(r&&!e.previewing.get())return wf.getCurrent(n).bind((function(t){return Nf.getHighlighted(t)})).map((function(e){return Vr(t,ck(),{item:e}),!0}));var o=ll.getValue(t);return Fr(t,kr()),e.onExecute(n,t,o),r&&Ws.close(n),x.some(!0)}}),Gm.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){return Gm.on(t)},onClose:function(){return Gm.off(t)}})}}}),Nm("typeaheadevents",[uo((function(n){var r=t;jy(e,a(n),n,o,r,py.HighlightFirst).get(t)})),Kr(ck(),(function(t,n){var r=Py.getCoupled(t,"sandbox");ik(e.model,t,n.event.item),Fr(t,kr()),e.onItemExecute(t,r,n.event.item,ll.getValue(t)),Ws.close(r),ak(t)}))].concat(e.dismissOnBlur?[Kr(pr(),(function(t){var e=Py.getCoupled(t,"sandbox");Xa(e.element).isNone()&&Ws.close(e)}))]:[]))];return{uid:e.uid,dom:dy(Rt(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:f(f({},u),ml(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}}}),dk=function(t){return f(f({},t),{toCached:function(){return dk(t.toCached())},bindFuture:function(e){return dk(t.bind((function(t){return t.fold((function(t){return Sy(ct.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return dk(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return dk(t.map((function(t){return t.map(e)})))},mapError:function(e){return dk(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return dk(Cy((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ct.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},mk=function(t){return dk(Cy(t))},gk={type:"separator"},hk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},pk=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},vk=function(t,e){return function(t){return V(t,hk)}(function(t,e){return W(e,(function(e){return e.type===t}))}(t,e))},bk=function(t){return vk("header",t.targets)},yk=function(t){return vk("anchor",t.targets)},wk=function(t){return x.from(t.anchorTop).map((function(t){return pk("<top>",t)})).toArray()},xk=function(t){return x.from(t.anchorBottom).map((function(t){return pk("<bottom>",t)})).toArray()},Ck=function(t,e){var n=t.toLowerCase();return W(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return ln(e.toLowerCase(),n)||ln(t.value.toLowerCase(),n)}))},Sk=Uo("aria-invalid"),kk=function(t){return function(e,n,r){return Ot(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},Ok={bar:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),collection:kk((function(t,e){return function(t,e){var n,r,i=t.label.map((function(t){return Zb(t,e)})),u=function(t){return function(e,n){Du(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Do(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||Vr(n,ry,{name:t.name,value:i})})),c=[Kr(rr(),u((function(t,e,n){$a(n)}))),Kr(lr(),a),Kr(xr(),a),Kr(or(),u((function(t,e,n){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)})),vi(n,Sh)}))),Kr(ir(),u((function(t){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)}))}))),uo(u((function(e,n,r,o){Vr(e,ry,{name:t.name,value:o})})))],s=function(t,e){return V(Fc(t.element,".tox-collection__item"),e)},l=qb.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:o},behaviours:La([kp.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){vi(t,"tox-collection__item--state-disabled"),zo(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){bi(t,"tox-collection__item--state-disabled"),Io(t,"aria-disabled")}))}}),ev(),Am.config({}),ll.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=V(r,(function(n){var r=lp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Kb.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?F(o,t.columns):[o],u=V(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ro(n.element,u.join(""))}(n,r),"auto"===t.columns&&Zh(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;km.setGridSize(n,e,r)})),Fr(n,cy)}}),Xb.config({}),km.config((r=t.columns,1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+bh}})),Nm("collection-events",c)]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Yb(i,l,["tox-form__group--collection"],[])}(t,e.shared.providers)})),alertbanner:kk((function(t,e){return function(t,e){return Vb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:zg(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Vr(e,ry,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!0,label:t.label,inputMode:x.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:kk((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=V(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:La([tC(),Am.config({}),lC(x.none()),km.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Rt(n,{source:"dynamic"});return kk(t)(e,o,r)}}((function(t,e){return function(t,e){var n=yC&&t.sandboxed,r=f(f({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=Qe("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)zo(n.element,"srcdoc",r);else{zo(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Zb(t,e)})),u=qb.parts.field({factory:{sketch:function(t){return hC({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:La([Xb.config({}),Bm.config({}),sC(x.none(),o.getValue,o.setValue)])})}}});return Yb(i,u,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),button:kk((function(t,e){return function(t,e){var n,r,o=wS(t.name,"custom");return n=x.none(),r=qb.parts.field(f({factory:Ng},bS(t,x.some(o),e,[fC(""),tC()]))),Yb(n,r,[],[])}(t,e.shared.providers)})),checkbox:kk((function(t,e){return function(t,e){var n=ll.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),x.some(!0)},i=qb.parts.field({factory:{sketch:o},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:La([tC(),kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Bm.config({}),n,km.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Nm("checkbox-events",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),u=qb.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:La([Jy.config({})])}),a=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:zg("checked"===t?"selected":"unselected",e.icons)}}},c=Rg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return qb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,c.asSpec(),u],fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),colorinput:kk((function(t,e){return function(t,e,n){var r=qb.parts.field({factory:my,inputClasses:["tox-textfield"],onSetValue:function(t){return zy.run(t).get((function(){}))},inputBehaviours:La([kp.config({disabled:e.providers.isDisabled}),ev(),Xb.config({}),zy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return bo(t.element)},notify:{onValid:function(t){var e=ll.getValue(t);Vr(t,Qy,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=ll.getValue(t);if(0===e.length)return Sy(ct.value(!0));var n=en("span");Bi(n,"background-color",e);var r=Fi(n,"background-color").fold((function(){return ct.error("blah")}),(function(t){return ct.value(e)}));return Sy(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Zb(t,e.providers)})),i=function(t,e){Vr(t,Zy,{value:e})},u=Rg(function(t,e){return Yy.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:La([nv(e.providers.isDisabled),ev(),Jy.config({}),Xb.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Cy((function(e){return t.fetch(e)})).map((function(r){return x.from(Sb(Rt(sb(Uo("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:fb(t.columns,t.presets)})))}))},parts:{menu:Mh(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[wa,ya,ka]},onLtr:function(){return[ya,wa,ka]}},components:[],fetch:ob(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Fr(t,tw)}),(function(e){i(t,e),tb(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:La([Nm("form-field-events",[Kr(Qy,(function(e,n){u.getOpt(e).each((function(t){Bi(t.element,"background-color",n.event.color)})),Vr(e,ty,{name:t.name})})),Kr(Zy,(function(t,e){qb.getField(t).each((function(n){ll.setValue(n,e.event.value),wf.getCurrent(t).each(Bm.focus)}))})),Kr(tw,(function(t,e){qb.getField(t).each((function(e){wf.getCurrent(t).each(Bm.focus)}))}))])])})}(t,e.shared,e.colorinput)})),colorpicker:kk((function(t){var e=function(t){return"tox-"+t},n=Zx(rC,e),r=Rg(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:La([ll.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return wf.getCurrent(e).bind((function(t){return ll.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);wf.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){ll.setValue(t,{hex:x.from(n[1]).getOr("")}),Gx.getField(t,"hex").each((function(t){Fr(t,cr())}))}))}}}),tC()])}})),dropzone:kk((function(t,e){return function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,(function(t){t(e,n)}))}},o=function(t,e){if(!kp.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){ll.setValue(n,function(t,e){var n=iC.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return W(ot(t),(function(t){return L(n,(function(e){return fn(t.name,"."+e)}))}))}(r,e)),Vr(n,ty,{name:t.name})},a=Rg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:La([Nm("input-file-events",[to(lr()),to(xr())])])}),c=t.label.map((function(t){return Zb(t,e)})),s=qb.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:La([fC([]),tC(),kp.config({}),Gm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Nm("dropzone-events",[Kr("dragenter",r([n,Gm.toggle])),Kr("dragleave",r([n,Gm.toggle])),Kr("dragover",n),Kr("drop",r([n,o])),Kr(sr(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Ng.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:La([Xb.config({}),nv(e.isDisabled),ev()])})]}]}}}});return Yb(c,s,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),grid:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),listbox:kk((function(e,n){return function(e,n){var o=n.shared.providers,i=nt(e.items).filter(XS),u=e.label.map((function(t){return Zb(t,o)})),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[qb.parts.field({dom:{},factory:{sketch:function(o){return aS({uid:o.uid,text:i.map((function(t){return t.text})),icon:x.none(),tooltip:e.label,role:x.none(),fetch:function(t,r){var o=YS(t,e.name,e.items,ll.getValue(t));r(fS(o,ph.CLOSE_ON_EXECUTE,n,!1))},onSetup:r(t),getApi:r({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({}),ll.config({store:{mode:"manual",initialValue:i.map((function(t){return t.value})).getOr(""),getValue:function(t){return Do(t.element,KS)},setValue:function(t,n){JS(e.items,n).each((function(e){zo(t.element,KS,e.value),Vr(t,iS,{text:e.text})}))}}})]},"tox-listbox",n.shared)}}})]};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([u.toArray(),[a]]),fieldBehaviours:La([kp.config({disabled:r(e.disabled),onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}})])})}(e,n)})),selectbox:kk((function(t,e){return function(t,e){var n=V(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Zb(t,e)})),o=qb.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:QS,selectBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Nm("selectbox-change",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),i=t.size>1?x.none():x.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:zg("chevron-down",e.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:K([[o],i.toArray()])};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([r.toArray(),[u]]),fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),sizeinput:kk((function(t,e){return AS(t,e.shared.providers)})),urlinput:kk((function(e,n){return function(e,n,r){var o,i=n.shared.providers,u=function(t){var n=ll.getValue(t);r.addToHistory(n.value,e.filetype)},a=qb.parts.field({factory:fk,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":Sk,type:"url"},minChars:0,responseTime:0,fetch:function(t){var o=function(t,e,n){var r=ll.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=Ck(o,function(t){return V(t,(function(t){return pk(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,Ck(o,bk(e)),Ck(o,K([wk(e),yk(e),xk(e)]))],$(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(gk,e)}),[])):i}))}(e.filetype,t,r),i=fS(o,ph.BUBBLE_TO_SANDBOX,n,!1);return Sy(i)},getHotspot:function(t){return g.getOpt(t)},onSetValue:function(e,n){e.hasConfigured(zy)&&zy.run(e).get(t)},typeaheadBehaviours:La(K([r.getValidationHandler().map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){zo(t.element,"title",i.translate(e))}))}},validator:{validate:function(n){var r=ll.getValue(n);return mk((function(n){t({type:e.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ct.error(t.message);n(e)}else{var r=ct.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[kp.config({disabled:function(){return e.disabled||i.isDisabled()}}),Xb.config({}),Nm("urlinput-events",K(["file"===e.filetype?[Kr(cr(),(function(t){Vr(t,ty,{name:e.name})}))]:[],[Kr(sr(),(function(t){Vr(t,ty,{name:e.name}),u(t)})),Kr(vr(),(function(t){Vr(t,ty,{name:e.name}),u(t)}))]]))]])),eventOrder:(o={},o[cr()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:Mh(0,0,"normal")},onExecute:function(t,e,n){Vr(e,oy,{})},onItemExecute:function(t,n,r,o){u(t),Vr(t,ty,{name:e.name})}}),c=e.label.map((function(t){return Zb(t,i)})),s=Rg(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:zg(n,i.icons),attributes:f({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}}("invalid",x.some(Sk),"warning")),l=Rg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),d=r.getUrlPicker(e.filetype),m=Uo("browser.url.event"),g=Rg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()}})])}),h=Rg(yS({name:e.name,icon:x.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(t){return Fr(t,m)}),i,[],["tox-browse-url"]));return qb.sketch({dom:Qb([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:K([[g.asSpec()],d.map((function(){return h.asSpec()})).toArray()])}]),fieldBehaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable),h.getOpt(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable),h.getOpt(t).each(kp.enable)}}),ev(),Nm("url-input-events",[Kr(m,(function(t){wf.getCurrent(t).each((function(n){var r=ll.getValue(n),o=f({fieldname:e.name},r);d.each((function(r){r(o).get((function(r){ll.setValue(n,r),Vr(t,ty,{name:e.name})}))}))}))}))])])})}(e,n,n.urlinput)})),customeditor:kk((function(t){var e=Qe(x.none()),n=Rg({dom:{tag:t.tag}}),r=Qe(x.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:La([Nm("custom-editor-events",[ro((function(o){n.getOpt(o).each((function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?oC.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(x.none()),e.set(x.some(t))}))}))}))]),ll.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(x.some(n))}),(function(t){return t.setValue(n)}))}}}),tC()]),components:[n.asSpec()]}})),htmlpanel:kk((function(t){return"presentation"===t.presets?Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:La([Xb.config({}),Bm.config({})])})})),imagetools:kk((function(t,e){return GS(t,e.shared.providers)})),table:kk((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(r,(function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}}))}]}),(n=t.cells,{dom:{tag:"tbody"},components:V(n,(function(t){return{dom:{tag:"tr"},components:V(t,o)}}))})],behaviours:La([Xb.config({}),Bm.config({})])}}(t,e.shared.providers)})),panel:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:V(t.items,e.shared.interpreter)}}(t,e)}))},Tk={field:function(t,e){return e}},_k=function(t,e,n){var r=Rt(n,{shared:{interpreter:function(e){return Ek(t,e,r)}}});return Ek(t,e,r)},Ek=function(t,e,n){return Ot(Ok,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},Ak={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Nk=function(t,e,n){var r=hc(-12,12,Ak),o={maxHeightFunction:fc()};return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),bubble:r,layouts:{onRtl:function(){return[Tg]},onLtr:function(){return[Og]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[ya]},onLtr:function(){return[wa]}},overrides:o}}},Rk=function(t,e,n){return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),layouts:{onRtl:function(){return[_g]},onLtr:function(){return[_g]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ka]},onLtr:function(){return[ka]}}}}},Mk=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return x.some(Ac.range(rn(e.startContainer),e.startOffset,rn(e.endContainer),e.endOffset))}}}},zk=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},Dk=function(t,e,n){var r=Up(t),o=function(){return rn(t.getBody())},i=function(){return rn(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:Nk(i,e,u),banner:Rk(i,e,u),cursor:Mk(t,o),node:zk(o)}},Bk=function(t){return function(e,n){cb(t)(e,n)}},Pk=function(t){return function(){return Qv(t)}},Ik=function(t){return function(){return Zv(t)}},Lk=function(t){return function(){return eb(t)}},Hk=function(t){return{colorPicker:Bk(t),hasCustomColors:Pk(t),getColors:Ik(t),getColorCols:Lk(t)}},Fk=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},Vk=function(t){return{isDraggableModal:Fk(t)}},jk=[{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"}]}],Uk=function(t){return $(t,(function(t,e){if(Tt(e,"items")){var n=Uk(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(Tt(e,"inline")||function(t){return Tt(t,"block")}(e)||function(t){return Tt(t,"selector")}(e)){var r="custom-"+(k(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return f(f({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},Wk=function(t){return function(t){return x.from(t.getParam("style_formats")).filter(T)}(t).map((function(e){var n=function(t,e){var n=Uk(e),r=function(e){j(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?jk.concat(n):n})).getOr(jk)},qk=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Rt(t,r)},$k=function(t,e,n,r){var o=function(e){return V(e,(function(e){var i=vt(e);if(_t(e,"items")){var u=o(e.items);return Rt(function(t){return Rt(t,{type:"submenu"})}(e),{getStyleItems:function(){return u}})}return _t(e,"format")?function(t){return qk(t,n,r)}(e):1===i.length&&I(i,"title")?Rt(e,{type:"separator"}):function(e){var o=k(e.name)?e.name:Uo(e.title),i="custom-"+o,u={type:"formatter",format:i,isSelected:n(i),getStylePreview:r(i)},a=Rt(e,u);return t.formatter.register(o,a),a}(e)}))};return o(e)},Gk=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,r):[t.format]},o=Qe([]),i=Qe([]),u=Qe([]),a=Qe([]),c=Qe(!1);return t.on("PreInit",(function(u){var a=Wk(t),c=$k(t,a,e,n);o.set(c),i.set(Y(c,r))})),t.on("addStyleModifications",(function(o){var i=$k(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Y(i,r))})),{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},Xk=iC.trim,Kk=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Yk=Kk("true"),Jk=Kk("false"),Qk=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},Zk=function(t){return t.innerText||t.textContent},tO=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&nO(t)},eO=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},nO=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Yk(t)}return!1}(t)&&!Jk(t)},rO=function(t){return eO(t)&&nO(t)},oO=function(t){var e=function(t){return t.id?t.id:Uo("h")}(t);return Qk("header",Zk(t),"#"+e,function(t){return eO(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},iO=function(e){var n=e.id||e.name,r=Zk(e);return Qk("anchor",r||"#"+n,"#"+n,0,t)},uO=function(t){return Xk(t.title).length>0},aO=function(t){var e=function(t){return V(Fc(rn(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),(function(t){return t.dom}))}(t);return W(function(t){return V(W(t,rO),oO)}(e).concat(function(t){return V(W(t,tO),iO)}(e)),uO)},cO="tinymce-url-history",sO=function(t){return k(t)&&/^https?/.test(t)},lO=function(t){return O(t)&&St(t,(function(t){return!(T(e=t)&&e.length<=5&&J(e,sO));var e})).isNone()},fO=function(){var t,e=Gv.getItem(cO);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+cO+" was not valid JSON",t),{};throw t}return lO(t)?t:(console.log("Local storage "+cO+" was not valid format",t),{})},dO=function(t){var e=fO();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},mO=function(t,e){if(sO(t)){var n=fO(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=W(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!lO(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Gv.setItem(cO,JSON.stringify(t))}(n)}},gO=function(t){return!!t},hO=function(t){return wt(iC.makeMap(t,/[, ]/),gO)},pO=function(t){return x.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(N)},vO=function(t){return x.from(t).filter(k).getOrUndefined()},bO=function(t){return{getHistory:dO,addToHistory:mO,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?x.none():x.some({targets:aO(t.getBody()),anchorTop:vO(Kp(t)),anchorBottom:vO(Yp(t))})}(t)},getValidationHandler:function(){return function(t){return x.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return function(t,e){var n=function(t){var e=x.some(function(t){return t.getParam("file_picker_types")}(t)).filter(gO),n=x.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(gO),r=e.or(n).map(hO);return pO(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return vt(t).length>0&&t}))}))}(t);return _(n)?n?pO(t):x.none():n[e]?pO(t):x.none()}(t,e).map((function(n){return function(r){return Cy((function(o){var i=f({filetype:e,fieldname:r.fieldname},x.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!k(t))throw new Error("Expected value to be string");if(void 0!==e&&!O(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})}),r.value,i)}))}}))}(t,e)}}},yO=r((function(t,e){!function(t,e){var n=lu.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Bi(t,"max-width",n+"px")}(t,Math.floor(e))})),wO="contexttoolbar-hide",xO=r([_e("dom"),je("shell",!0),fl("toolbarBehaviours",[Am])]),CO=r([Fl({name:"groups",overrides:function(){return{behaviours:La([Am.config({})])}}})]),SO=gf({name:"Toolbar",configFields:xO(),partFields:CO(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.toolbarBehaviours,o.behaviours),apis:{setGroups:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"groups")).fold((function(){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")}),(function(t){Am.set(t,n)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),kO=function(t,e,n){return{within:t,extra:e,withinWidth:n}},OO=function(t,e,n){var o,i=(o=function(t,e){var r=n(t);return x.some({element:t,start:e,finish:e+r,width:r})},$(t,(function(t,e){return o(e,t.len).fold(r(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),u=W(i,(function(t){return t.finish<=e})),a=q(u,(function(t,e){return t+e.width}),0);return{within:u,extra:i.slice(u.length),withinWidth:a}},TO=function(t){return V(t,(function(t){return t.element}))},_O=function(t,e){var n=V(e,(function(t){return tu(t)}));SO.setGroups(t,n)},EO=function(t,e,n){var r=Zl(t,e,"primary"),o=Py.getCoupled(t,"overflowGroup");Bi(r.element,"visibility","hidden");var i=e.builtGroups.get().concat([o]),u=it(i,(function(t){return Xa(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),_O(r,i);var a=function(t,e,n,r){var o=function(t,e,n){var r=OO(e,t,n);return 0===r.extra.length?x.some(r):x.none()}(t,e,n).getOrThunk((function(){return OO(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=TO(t.concat(e));return kO(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=TO(t).concat([n]);return kO(o,TO(e),r)}(i,u,r,a):function(t,e,n){return kO(TO(t),[],n)}(i,0,a)}(fu(r.element),e.builtGroups.get(),(function(t){return fu(t.element)}),o);0===a.extra.length?(Am.remove(r,o),n([])):(_O(r,a.within),n(a.extra)),Ui(r.element,"visibility"),Wi(r.element),u.each(Bm.focus)},AO=r([fl("splitToolbarBehaviours",[Py]),Je("builtGroups",(function(){return Qe([])}))]),NO=r([Gu(["overflowToggledClass"]),Fe("getOverflowBounds"),_e("lazySink"),Je("overflowGroups",(function(){return Qe([])}))].concat(AO())),RO=r([Ll({factory:SO,schema:xO(),name:"primary"}),Hl({schema:xO(),name:"overflow"}),Hl({name:"overflow-button"}),Hl({name:"overflow-group"})]),MO=r([Gu(["toggledClass"]),_e("lazySink"),Me("fetch"),Fe("getBounds"),Ve("fireDismissalEventInstead",[je("event",Mr())]),xc()]),zO=r([Hl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:La([Gm.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Hl({factory:SO,schema:xO(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:La([km.config({mode:"cyclic",onEscape:function(e){return Ql(e,t,"button").each(Bm.focus),x.none()}})])}}})]),DO=function(t,e){var n=Py.getCoupled(t,"toolbarSandbox");Ws.isOpen(n)?Ws.close(n):Ws.open(n,e.toolbar())},BO=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Cs.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:yO()}},e,o)},PO=function(t,e,n,r,o){SO.setGroups(e,o),BO(t,e,n,r),Gm.on(t)},IO=gf({name:"FloatingToolbarButton",factory:function(t,e,n,r){return f(f({},Ng.sketch(f(f({},r.button()),{action:function(t){DO(t,r)},buttonBehaviours:hl({dump:r.button().buttonBehaviours},[Py.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Bu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:La([km.config({mode:"special",onEscape:function(t){return Ws.close(t),x.some(!0)}}),Ws.config({onOpen:function(o,i){n.fetch().get((function(o){PO(t,i,n,e.layouts,o),r.link(t.element),km.focusIn(i)}))},onClose:function(){Gm.off(t),Bm.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return Pu(n,r)||Pu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:c},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js({doReposition:function(){Ws.getState(Py.getCoupled(t,"toolbarSandbox")).each((function(r){BO(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(o){PO(e,o,t,n.layouts,r)}))},reposition:function(e){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(r){BO(e,r,t,n.layouts)}))},toggle:function(t){DO(t,r)},getToolbar:function(t){return Ws.getState(Py.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Ws.isOpen(Py.getCoupled(t,"toolbarSandbox"))}}})},configFields:MO(),partFields:zO(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),LO=r([_e("items"),Gu(["itemSelector"]),fl("tgroupBehaviours",[km])]),HO=r([Vl({name:"items",unit:"item"})]),FO=gf({name:"ToolbarGroup",configFields:LO(),partFields:HO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.tgroupBehaviours,[km.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),VO=function(t){return V(t,(function(t){return tu(t)}))},jO=function(t,e,n){EO(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){IO.setGroups(t,VO(r))}))}))},UO=gf({name:"SplitFloatingToolbar",configFields:NO(),partFields:RO(),factory:function(t,e,n,r){var o=Rg(IO.sketch({fetch:function(){return Cy((function(e){e(VO(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[wa,ya]},onRtl:function(){return[ya,wa]},onBottomLtr:function(){return[Ca,xa]},onBottomRtl:function(){return[xa,Ca]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(){return FO.sketch(f(f({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(V(n,e.getSystem().build)),jO(e,o,t)},refresh:function(e){return jO(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){IO.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(IO.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){IO.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(IO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),WO=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},qO=function(t){return t.dimension.property},$O=function(t,e){return t.dimension.getDimension(e)},GO=function(t,e){var n=WO(t,e);xi(n,[e.shrinkingClass,e.growingClass])},XO=function(t,e){bi(t.element,e.openClass),vi(t.element,e.closedClass),Bi(t.element,qO(e),"0px"),Wi(t.element)},KO=function(t,e){bi(t.element,e.closedClass),vi(t.element,e.openClass),Ui(t.element,qO(e))},YO=function(t,e,n,r){n.setCollapsed(),Bi(t.element,qO(e),$O(e,t.element)),Wi(t.element),GO(t,e),XO(t,e),e.onStartShrink(t),e.onShrunk(t)},JO=function(t,e,n,r){var o=r.getOrThunk((function(){return $O(e,t.element)}));n.setCollapsed(),Bi(t.element,qO(e),o),Wi(t.element);var i=WO(t,e);bi(i,e.growingClass),vi(i,e.shrinkingClass),XO(t,e),e.onStartShrink(t)},QO=function(t,e,n){var r=$O(e,t.element);("0px"===r?YO:JO)(t,e,n,x.some(r))},ZO=function(t,e,n){var r=WO(t,e),o=yi(r,e.shrinkingClass),i=$O(e,t.element);KO(t,e);var u=$O(e,t.element);(o?function(){Bi(t.element,qO(e),i),Wi(t.element)}:function(){XO(t,e)})(),bi(r,e.shrinkingClass),vi(r,e.growingClass),KO(t,e),Bi(t.element,qO(e),u),n.setExpanded(),e.onStartGrow(t)},tT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.growingClass)},eT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.shrinkingClass)},nT=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Ui(t.element,qO(e));var r=$O(e,t.element);Bi(t.element,qO(e),r)}},grow:function(t,e,n){n.isExpanded()||ZO(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&QO(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&YO(t,e,n,x.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:tT,isShrinking:eT,isTransitioning:function(t,e,n){return!0===tT(t,e)||!0===eT(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?QO:ZO)(t,e,n)},disableTransitions:GO}),rT=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return ci(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Vt(e.dimension.property,"0px")})},events:function(t,e){return $r([no(fr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(GO(n,t),e.isExpanded()&&Ui(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),oT=[_e("closedClass"),_e("openClass"),_e("shrinkingClass"),_e("growingClass"),Pe("getAnimationRoot"),Ku("onShrunk"),Ku("onStartShrink"),Ku("onGrown"),Ku("onStartGrow"),je("expanded",!1),Ee("dimension",ve("property",{width:[Zu("property","width"),Zu("getDimension",(function(t){return fu(t)+"px"}))],height:[Zu("property","height"),Zu("getDimension",(function(t){return ru(t)+"px"}))]}))],iT=Fa({fields:oT,name:"sliding",active:rT,apis:nT,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(t.expanded);return ui({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:i(e.set,!1),setExpanded:i(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),uT=r([Gu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ku("onOpened"),Ku("onClosed")].concat(AO())),aT=r([Ll({factory:SO,schema:xO(),name:"primary"}),Ll({factory:SO,schema:xO(),name:"overflow",overrides:function(t){return{toolbarBehaviours:La([iT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Ql(e,t,"overflow-button").each((function(t){Gm.off(t),Bm.focus(t)})),t.onClosed(e)},onGrown:function(e){km.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Ql(e,t,"overflow-button").each(Gm.on)}}),km.config({mode:"acyclic",onEscape:function(e){return Ql(e,t,"overflow-button").each(Bm.focus),x.some(!0)}})])}}}),Hl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:La([Gm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Hl({name:"overflow-group"})]),cT=function(t,e){Ql(t,e,"overflow-button").bind((function(){return Ql(t,e,"overflow")})).each((function(n){sT(t,e),iT.toggleGrow(n)}))},sT=function(t,e){Ql(t,e,"overflow").each((function(n){EO(t,e,(function(t){var e=V(t,(function(t){return tu(t)}));SO.setGroups(n,e)})),Ql(t,e,"overflow-button").each((function(t){iT.hasGrown(n)&&Gm.on(t)})),iT.refresh(n)}))},lT=gf({name:"SplitSlidingToolbar",configFields:uT(),partFields:aT(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(t){return FO.sketch(f(f({},r["overflow-group"]()),{items:[Ng.sketch(f(f({},r["overflow-button"]()),{action:function(e){Fr(t,o)}}))]}))}}}),Nm("toolbar-toggle-events",[Kr(o,(function(e){cT(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=V(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),sT(e,t)},refresh:function(e){return sT(e,t)},toggle:function(e){return cT(e,t)},isOpen:function(e){return function(t,e){return Ql(t,e,"overflow").map(iT.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),fT=r(Uo("toolbar-height-change")),dT=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:f({tag:"div",classes:["tox-toolbar__group"]},e),components:[FO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:La([Xb.config({}),Bm.config({})])}},mT=function(t){return FO.sketch(dT(t))},gT=function(t,e){var n=ro((function(e){var n=V(t.initGroups,mT);SO.setGroups(e,n)}));return La([ov(t.providers.isDisabled),ev(),km.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Nm("toolbar-events",[n])])},hT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":dT({title:x.none(),items:[]}),"overflow-button":pS({name:"more",icon:x.some("more-drawer"),disabled:!1,tooltip:x.some("More..."),primary:!1,borderless:!1},x.none(),t.providers)},splitToolbarBehaviours:gT(t,e)}},pT=function(t){var e=hT(t),n=UO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return UO.sketch(f(f({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Ou(e),r=po(e),o=Ou(r),i=Math.max(r.dom.scrollHeight,o.height);return Su(n.x+4,o.y,n.width-8,i)},parts:f(f({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},vT=function(t){var e=lT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=lT.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=hT(t);return lT.sketch(f(f({},r),{components:[e,n],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:function(t){t.getSystem().broadcastOn([fT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([fT()],{type:"closed"})}}))},bT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return SO.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===hh.scrolling?["tox-toolbar--scrolling"]:[])},components:[SO.parts.groups({})],toolbarBehaviours:gT(t,e)})},yT=Zt([Ne("type"),Ee("items",ee([ce([Ne("name"),Be("items",xe)]),xe]))].concat(eh)),wT=[He("text"),He("tooltip"),He("icon"),Me("fetch"),Xe("onSetup",(function(){return t}))],xT=Zt(m([Ne("type")],wT)),CT=function(t){return de("menubutton",xT,t)},ST=Zt([Ne("type"),He("tooltip"),He("icon"),He("text"),Fe("select"),Me("fetch"),Xe("onSetup",(function(){return t})),$e("presets","normal",["normal","color","listpreview"]),je("columns",1),Me("onAction"),Me("onItemAction")]),kT=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=V(o,n.getSystem().build);Ts(n,i)}))};return $r([Kr(br(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;I(o.channels,i)&&n(e,o.data)}})),ro((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),OT=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),TT=[_e("channel"),Pe("renderComponents"),Pe("updateState"),Pe("initialData")],_T=Fa({fields:TT,name:"reflecting",active:kT,apis:OT,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(t){return t}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(x.none())}}}})}),ET=r([_e("toggleClass"),_e("fetch"),Ju("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),Ju("onItemExecute"),Pe("lazySink"),_e("dom"),Ku("onOpen"),fl("splitDropdownBehaviours",[Py,km,Bm]),je("matchWidth",!1),je("useMinWidth",!1),je("eventOrder",{}),Pe("role")].concat(Gy())),AT=Ll({factory:Ng,schema:[_e("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(jr)},buttonBehaviours:La([Gm.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),NT=Ll({factory:Ng,schema:[_e("dom")],name:"button",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),RT=r([AT,NT,Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Ly()]),MT=gf({name:"SplitDropdown",configFields:ET(),partFields:RT(),factory:function(e,n,r,o){var i,u=function(t){wf.getCurrent(t).each((function(t){Nf.highlightFirst(t),km.focusIn(t)}))},a=function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)},c=function(t){var n=Zl(t,e,"button");return jr(n),x.some(!0)},s=f(f({},$r([ro((function(t,n){Ql(t,e,"aria-descriptor").each((function(e){var n=Uo("aria");zo(e.element,"id",n),zo(t.element,"aria-describedby",n)}))}))])),Km(x.some(a))),l={repositionMenus:function(t){Gm.isOn(t)&&$y(t)}};return{uid:e.uid,dom:e.dom,components:n,apis:l,eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),events:s,behaviours:ml(e.splitDropdownBehaviours,[Py.config({others:{sandbox:function(t){var n=Zl(t,e,"arrow");return qy(e,t,{onOpen:function(){Gm.on(n),Gm.on(t)},onClose:function(){Gm.off(n),Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t){return a(t),x.some(!0)}}),Bm.config({}),Gm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),zT=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},DT=function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},BT=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},PT=Uo("focus-button"),IT=["checklist","ordered-list"],LT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],HT=function(t,e,n,r,o,i){var u,a=function(t){return lp.isRtl()&&I(IT,t)?t+"-rtl":t},c=lp.isRtl()&&t.exists((function(t){return I(LT,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:BT(n,i)},components:lv([t.map((function(t){return tS(a(t),i.icons)})),e.map((function(t){return nS(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Zn()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:La([ov(i.isDisabled),ev(),Nm("common-button-display-events",[Kr(Zn(),(function(t,e){e.event.prevent(),Fr(t,PT)}))])].concat(r.map((function(n){return _T.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return lv([t.icon.map((function(t){return tS(a(t),i.icons)})),t.text.map((function(t){return nS(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},FT=function(e,n,r){var o,i=Qe(t),u=HT(e.icon,e.text,e.tooltip,x.none(),x.none(),r);return Ng.sketch({dom:u.dom,components:u.components,eventOrder:oS,buttonBehaviours:La([Nm("toolbar-button-events",[(o={onAction:e.onAction,getApi:n.getApi},uo((function(t,e){iv(o,t)((function(e){Vr(t,rS,{buttonApi:e}),o.onAction(e)}))}))),uv(n,i),av(n,i)]),ov((function(){return e.disabled||r.isDisabled()})),ev()].concat(n.toolbarButtonBehaviours))})},VT=function(t,e,n){return FT(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Nm("toolbarButtonWith",n)]:[]),getApi:zT,onSetup:t.onSetup},e)},jT=function(t,e,n){return Rt(FT(t,{toolbarButtonBehaviours:[Am.config({}),Gm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Nm("toolbarToggleButtonWith",n)]:[]),getApi:DT,onSetup:t.onSetup},e))},UT=function(t,e,n){return function(r){return Cy((function(t){return e.fetch(t)})).map((function(o){return x.from(Sb(Rt(sb(Uo("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,ph.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:fb(e.columns,e.presets),menuBehaviours:tp("auto"!==e.columns?[]:[ro((function(t,n){Zh(t,4,Th(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;km.setGridSize(t,n,r)}))}))])})))}))}},WT=function(t,e){return Kr(rS,(function(n,r){var o=function(t){return{hide:function(){return Fr(t,Sr())},getValue:function(){return ll.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},qT=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Rg(my.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:La([km.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return jr(t),!0}))},onLeft:function(t,e){return e.cut(),x.none()},onRight:function(t,e){return e.cut(),x.none()}})])})),o=function(t,e,n){var r=V(e,(function(e){return Rg(function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(uh(f(f({},o),{type:"togglebutton",onAction:function(){}})));return jT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(rh(f(f({},o),{type:"button",onAction:function(){}})));return VT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r)}(t,e,n))}));return{asSpecs:function(){return V(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return it(e,(function(e,n){return e.primary?x.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(u(kp.isDisabled)):x.none()}))}}}(r,t.commands,e);return[{title:x.none(),items:[r.asSpec()]},{title:x.none(),items:o.asSpecs()}]},$T=function(t,e){var n=yu(window),r=ku(rn(t.getContentAreaContainer())),o=Mp(t)||zp(t)||Bp(t),i=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(r,n),u=i.x,a=i.width;if(t.inline&&!o)return Su(u,n.y,a,n.height);var c=function(t,e,n,r){var o=rn(t.getContainer()),i=zu(o,".tox-editor-header").getOr(o),u=ku(i),a=u.y>=e.bottom,c=r&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,n.y),bottom:n.bottom};if(t.inline&&!c)return{y:n.y,bottom:Math.min(u.y,n.bottom)};var s=ku(o);return c?{y:Math.max(u.bottom,n.y),bottom:Math.min(s.bottom,n.bottom)}:{y:Math.max(s.y,n.y),bottom:Math.min(u.y,n.bottom)}}(t,r,n,e.header.isPositionedAtTop()),s=c.y,l=c.bottom;return Su(u,s,a,l-s)},GT=function(t,e){var n=W(e,(function(e){return e.predicate(t.dom)})),r=U(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},XT=function(t,e){var n={},r=[],o=[],i={},u={},a=vt(t);return j(a,(function(a){var c=t[a];"contextform"===c.type?function(t,a){var c=me(de("ContextForm",mh,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=f(f({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c}(a,c):"contexttoolbar"===c.type&&function(t,e){var n;(n=e,de("ContextToolbar",gh,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))}(a,c)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},KT=Uo("forward-slide"),YT=Uo("backward-slide"),JT=Uo("change-slide-event"),QT="tox-pop--resizing",ZT=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return x.some({type:"separator",text:a});if("submenu"===t.type){var c=Y(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?x.none():x.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Y(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return x.some(f({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Y(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(fS(u,ph.CLOSE_ON_EXECUTE,t,!1))}}}},t_=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return V(r.data,(function(t){return qk(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:ZT(0,e,n),getStyleItems:o}},e_=function(e,n,r){var o=t_(0,n,r),i=o.items,u=o.getStyleItems;return aS({text:r.icon.isSome()?x.none():x.some(""),icon:r.icon,tooltip:x.from(r.tooltip),role:x.none(),fetch:i.getFetch(n,u),onSetup:function(n){return r.setInitialValue.each((function(t){return t(n.getComponent())})),r.nodeChangeHandler.map((function(t){var r=t(n.getComponent());return e.on("NodeChange",r),function(){e.off("NodeChange",r)}})).getOr(t)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(jS||(jS={}));var n_,r_,o_,i_,u_=function(t,e,n,r){return{type:"basic",data:(o=function(t,e){return e===jS.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r),V(o,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}})))};var o},a_=[{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"}],c_=function(t){var e=function(e){var n=G(a_,(function(e){return t.formatter.match(e.format)})).fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));Vr(e,uS,{icon:"align-"+n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o={type:"basic",data:a_};return{tooltip:"Align",icon:x.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(t){return function(){return x.none()}},onAction:function(e){return function(){return G(a_,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},s_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],l_=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},f_=function(t){var e=function(){var e=function(t){return t?l_(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:G(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return function(t){var e;return 0===t.indexOf("-apple-system")&&(e=l_(t.toLowerCase()),J(s_,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(o)?x.from({title:"System Font",format:o}):x.none()})),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)})),i=u_(t,"font_formats","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",jS.SemiColon);return{tooltip:"Fonts",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return x.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},d_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},m_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},g_=function(t){var e=function(){var e=x.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":Ot(m_,t).getOr(t)}(r,t),i=function(t){return Ot(d_,t).getOr("")}(o);e=G(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=r(x.none),o=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},i=x.some((function(t){return function(){return o(t)}})),u=x.some((function(t){return o(t)})),a=u_(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",jS.Space);return{tooltip:"Font sizes",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},setInitialValue:u,nodeChangeHandler:i,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},h_=function(t,e){var n=e(),r=V(n,(function(t){return t.format}));return x.from(t.formatter.closest(r)).bind((function(t){return G(n,(function(e){return e.format===t}))})).orThunk((function(){return pf(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},p_=function(t){var e=Qe(x.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(x.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(x.some(t))}}},v_=function(){return p_((function(t){return t.destroy()}))},b_=function(){return p_((function(t){return t.unbind()}))},y_=function(t,e){return function(n){var r=b_(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.on("init",o),r.clear}},w_=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},x_=function(t){var e=function(e){var n=h_(t,(function(){return o.data})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o=u_(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",jS.SemiColon);return{tooltip:"Blocks",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:w_(t),setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},C_=function(t,e){var n=function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,n):[{title:t.title,format:t.format}]},r=Y(Wk(t),n),o=h_(t,(function(){return r})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:o})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)}));return{tooltip:"Formats",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},onAction:w_(t),setInitialValue:o,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},S_=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{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"]}],k_=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return he(t)})).getOrDie();return e(i,r,o)}},O_={button:k_(rh,(function(t,e){return n=t,r=e.backstage.shared.providers,VT(n,r,[]);var n,r})),togglebutton:k_(uh,(function(t,e){return n=t,r=e.backstage.shared.providers,jT(n,r,[]);var n,r})),menubutton:k_(CT,(function(t,e){return mS(t,"tox-tbtn",e.backstage,x.none())})),splitbutton:k_((function(t){return de("SplitButton",ST,t)}),(function(e,n){return function(e,n){var r,o=Uo("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setIconFill:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"fill",n)}))},setIconStroke:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"stroke",n)}))},setActive:function(e){zo(t.element,"aria-pressed",e),zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Gm.set(t,e)}))}))},isActive:function(){return zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(Gm.isOn)}))}}},u=Qe(t),a={getApi:i,onSetup:e.onSetup};return MT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:f({"aria-pressed":!1},BT(e.tooltip,n.providers))},onExecute:function(t){e.onAction(i(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:La([rv(n.providers.isDisabled),ev(),Nm("split-dropdown-events",[Kr(PT,Bm.focus),uv(a,u),av(a,u)]),Jy.config({})]),eventOrder:(r={},r[Nr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:UT(i,e,n.providers),parts:{menu:Mh(0,e.columns,e.presets)},components:[MT.parts.button(HT(e.icon,e.text,x.none(),x.some(o),x.some([Gm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),MT.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:zg("chevron-down",n.providers.icons)},buttonBehaviours:La([rv(n.providers.isDisabled),ev()])}),MT.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(e,n.backstage.shared)})),grouptoolbarbutton:k_((function(t){return de("GroupToolbarButton",yT,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[yc]=e.backstage.shared.header.isPositionedAtTop()?Iu.TopToBottom:Iu.BottomToTop,r);switch(Ip(n)){case hh.floating:return function(t,e,n,r){var o=e.shared;return IO.sketch({lazySink:o.getSink,fetch:function(){return Cy((function(e){e(V(n(t.items),mT))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:HT(t.icon,t.text,t.tooltip,x.none(),x.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return __(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,x.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=f({type:"advanced"},e.styleselect);return e_(t,e,C_(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return e_(t,e,g_(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return e_(t,e,f_(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return e_(t,e,x_(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return e_(t,e,c_(t))}(t,e.backstage)}},T_={styleselect:O_.styleSelectButton,fontsizeselect:O_.fontsizeSelectButton,fontselect:O_.fontSelectButton,formatselect:O_.formatButton,align:O_.alignMenuButton},__=function(t,e,n,r){var o=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=V(S_,(function(e){var n=W(e.items,(function(e){return Tt(t,e)||Tt(T_,e)}));return{name:e.name,items:n}}));return W(e,(function(t){return t.items.length>0}))}(r):k(n)?(e=n.split("|"),V(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return M(t,(function(t){return Tt(t,"name")&&Tt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}(e),i=V(o,(function(o){var i=Y(o.items,(function(o){return 0===o.trim().length?[]:function(t,e,n,r,o,i){return Ot(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return it(t,(function(t){return Ot(e,t+n.toLowerCase())}))}))})).fold((function(){return Ot(T_,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return x.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return Ot(O_,t.type).fold((function(){return console.error("skipping button defined by",t),x.none()}),(function(r){return x.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),x.none())}))}(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:x.from(t.translate(o.name)),items:i}}));return W(i,(function(t){return t.items.length>0}))},E_={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"]},A_={maxHeightFunction:fc(),maxWidthFunction:yO()},N_={onLtr:function(){return[Sa,ka,xa,ya,Ca,wa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[Sa,ka,Ca,wa,xa,ya,_g,Eg,Tg,kg,Og,Sg]}},R_={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},M_=function(t,e,n,r){var o,i,u=Ln().deviceType.isTouch,a=Zi((o={sink:n,onEscape:function(){return t.focus(),x.some(!0)}},i=Qe([]),vg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),vg.getContent(t).each((function(t){Ui(t.element,"visibility")})),bi(t.element,QT),Ui(t.element,"width")},inlineBehaviours:La([Nm("context-toolbar-events",[no(fr(),(function(t,e){bi(t.element,QT),Ui(t.element,"width")})),Kr(JT,(function(t,e){Ui(t.element,"width");var n=fu(t.element);vg.setContent(t,e.event.contents),vi(t.element,QT);var r=fu(t.element);Bi(t.element,"width",n+"px"),vg.getContent(t).each((function(n){e.event.focus.bind((function(e){return $a(e),Xa(t.element)})).orThunk((function(){return km.focusIn(n),Ga()}))})),Ag.setTimeout((function(){Bi(t.element,"width",r+"px")}),0)})),Kr(KT,(function(t,e){vg.getContent(t).each((function(t){i.set(i.get().concat([{bar:t,focus:Ga()}]))})),Vr(t,JT,{contents:e.event.forwardContents,focus:x.none()})})),Kr(YT,(function(t,e){rt(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Vr(t,JT,{contents:tu(e.bar),focus:e.focus})}))}))]),km.config({mode:"special",onEscape:function(t){return rt(i.get()).fold((function(){return o.onEscape()}),(function(e){return Fr(t,YT),x.some(!0)}))}})]),lazySink:function(){return ct.value(o.sink)}}))),c=function(){return $T(t,r.backstage.shared)},s=function(){if(u()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,a,s,l=(e=g.get().filter((function(t){return Ni(rn(t))})).map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?pu().top:Ou(rn(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),f=c();return o=l.y,i=l.bottom,a=f.y,s=f.bottom,!(Math.max(o,a)<=Math.min(i,s))},l=function(){vg.hide(a)},d=function(){m.get().each((function(t){var e=a.element;Ui(e,"display"),s()?Bi(e,"display","none"):Cs.positionWithinBounds(n,t,a,x.some(c()))}))},m=Qe(x.none()),g=Qe(x.none()),h=Qe(null),p=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:La([km.config({mode:"acyclic"}),Nm("pop-dialog-wrap-events",[ro((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return km.focusIn(e)}))})),oo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},v=zt((function(){return XT(e,(function(t){var e=b([t]);Vr(a,KT,{forwardContents:p(e)})}))})),b=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=f(f({},n),o.formNavigators),u=Ip(t)===hh.scrolling?hh.scrolling:hh.default,a=K(V(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return __(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,x.some(["form:"]))}(i,e):function(t,e){return qT(t,e)}(e,r.backstage.shared.providers)})));return bT({type:u,uid:Uo("context-toolbar"),initGroups:a,onEscape:x.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",(function(e){var n=v();Ot(n.lookupTable,e.toolbarKey).each((function(n){y([n],e.target===t?x.none():x.some(e)),vg.getContent(a).each(km.focusIn)}))}));var y=function(t,e){if(C(),!u()||!r.backstage.isContextMenuOpen()){var n=b(t),o=e.map(rn),i=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Rt(n,function(t,e){return"line"===t?{bubble:hc(12,0,E_),layouts:{onLtr:function(){return[Oa]},onRtl:function(){return[Ta]}},overrides:A_}:{bubble:hc(0,12,E_),layouts:e?R_:N_,overrides:A_}}(t,u()))}(t[0].position,o);m.set(x.some(i)),g.set(e);var l=a.element;Ui(l,"display"),vg.showWithinBounds(a,i,p(n),(function(){return x.some(c())})),s()&&Bi(l,"display","none")}},w=function(){t.hasFocus()&&function(t,e){var n=rn(e.getBody()),r=function(t){return Vn(t,n)},o=rn(e.selection.getNode());return function(t){return!r(t)&&!jn(n,t)}(o)?x.none():function(t,e,n){var r=GT(t,e);if(r.contextForms.length>0)return x.some({elem:t,toolbars:[r.contextForms[0]]});var o=GT(t,n);if(o.contextForms.length>0)return x.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return L(t,(function(t){return t.position===e}))},n=function(e){return W(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=V(n("selection"),(function(t){return f(f({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return x.some({elem:t,toolbars:i})}return x.none()}(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return function(t,e,n){return t(e)?x.none():Wn(e,(function(t){var e=GT(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return G(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return W(t,(function(t){return t.position===e}))}))}(r);return i.length>0?x.some({elem:t,toolbars:i}):x.none()}),t)}(r,o,t)}))}(v(),t).fold((function(){m.set(x.none()),vg.hide(a)}),(function(t){y(t.toolbars,x.some(t.elem.dom))}))},C=function(){var t=h.get();null!==t&&(Ag.clearTimeout(t),h.set(null))},S=function(t){C(),h.set(t)};t.on("init",(function(){t.on(wO,l),t.on("ScrollContent ScrollWindow longpress",d),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){S(Ag.setEditorTimeout(t,w,0))})),t.on("focusout",(function(e){Ag.setEditorTimeout(t,(function(){Xa(n.element).isNone()&&Xa(a.element).isNone()&&(m.set(x.none()),vg.hide(a))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(m.set(x.none()),vg.hide(a))})),t.on("NodeChange",(function(e){Xa(a.element).fold((function(){S(Ag.setEditorTimeout(t,w,0))}),(function(t){}))}))}))},z_=af,D_=Ul,B_=r([je("shell",!1),_e("makeItem"),je("setupItem",t),gl("listBehaviours",[Am])]),P_=Fl({name:"items",overrides:function(){return{behaviours:La([Am.config({})])}}}),I_=r([P_]),L_=gf({name:r("CustomList")(),configFields:B_(),partFields:I_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"items")).fold((function(){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")}),(function(r){var o=Am.contents(r),i=n.length,u=i-o.length,a=u>0?H(u,(function(){return t.makeItem()})):[],c=o.slice(i);j(c,(function(t){return Am.remove(r,t)})),j(a,(function(t){return Am.append(r,t)}));var s=Am.contents(r);j(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),H_=t,F_=c,V_=r([]),j_=Object.freeze({__proto__:null,setup:H_,isDocked:F_,getBehaviours:V_}),U_=function(t){return(Fi(t,"position").is("fixed")?x.none():yo(t)).orThunk((function(){var e=en("span");return bo(t).bind((function(t){Oo(t,e);var n=yo(e);return Eo(e),n}))}))},W_=function(t){return U_(t).map(cu).getOrThunk((function(){return uu(0,0)}))},q_=Et([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),$_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeOutClass),vi(n,e.fadeInClass),e.onShow(t)},G_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeInClass),vi(n,e.fadeOutClass),e.onHide(t)},X_=function(t,e,n){return J(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},K_=function(t,e){return e.getInitialPosition().map((function(e){return Su(e.bounds.x,e.bounds.y,fu(t),ru(t))}))},Y_=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(x.none()),r.position){case"static":return x.some(q_.static());case"absolute":var o=U_(t).map(ku).getOrThunk((function(){return ku(Ri())}));return x.some(q_.absolute(Ya("absolute",Ot(r.style,"left").map((function(t){return e.x-o.x})),Ot(r.style,"top").map((function(t){return e.y-o.y})),Ot(r.style,"right").map((function(t){return o.right-e.right})),Ot(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return x.none()}}))},J_=function(t,e,n){var r=t.element;return Fi(r,"position").is("fixed")?function(t,e,n){return K_(t,n).filter((function(t){return X_(n.getModes(),t,e)})).bind((function(e){return Y_(t,e,n)}))}(r,e,n):function(t,e,n){var r=ku(t);if(X_(n.getModes(),r,e))return x.none();!function(t,e,n){n.setInitialPosition(x.some({style:Vi(t),position:Li(t,"position")||"static",bounds:e}))}(t,r,n);var o=Tu(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return x.some(q_.fixed(Ya("fixed",x.some(i),c?x.some(u):x.none(),x.none(),c?x.none():x.some(a))))}(r,e,n)},Q_=function(t,e){j(["left","right","top","bottom","position"],(function(e){return Ui(t.element,e)})),e.onUndocked(t)},Z_=function(t,e,n){Ja(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},tE=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(wi(t.element,[e.fadeOutClass]),e.onHide(t)):(u?$_:G_)(t,e))}))}))},eE=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&tE(t,e,n,r),J_(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return Q_(t,e)}),(function(n){return Z_(t,e,n)}),(function(o){tE(t,e,n,r,!0),Z_(t,e,o)}))}))}(t,e,n)},nE=function(e,n,r){r.isDocked()&&function(e,n,r){var o=e.element;r.setDocked(!1),function(t,e){var n=t.element;return K_(n,e).bind((function(t){return Y_(n,t,e)}))}(e,r).each((function(r){r.fold((function(){return Q_(e,n)}),(function(t){return Z_(e,n,t)}),t)})),r.setVisible(!0),n.contextual.each((function(t){xi(o,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),eE(e,n,r)}(e,n,r)},rE=Object.freeze({__proto__:null,refresh:eE,reset:nE,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),oE=Object.freeze({__proto__:null,events:function(t,e){return $r([no(fr(),(function(n,r){t.contextual.each((function(t){yi(n.element,t.transitionClass)&&(xi(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n)),r.stop()}))})),Kr(Er(),(function(n,r){eE(n,t,e)})),Kr(Ar(),(function(n,r){nE(n,t,e)}))])}}),iE=[Ve("contextual",[Ne("fadeInClass"),Ne("fadeOutClass"),Ne("transitionClass"),Me("lazyContext"),Ku("onShow"),Ku("onShown"),Ku("onHide"),Ku("onHidden")]),Xe("lazyViewport",Tu),Ke("modes",["top","bottom"],xe),Ku("onDocked"),Ku("onUndocked")],uE=Fa({fields:iE,name:"docking",active:oE,apis:rE,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(!1),n=Qe(!0),r=Qe(x.none()),o=Qe(t.modes);return ui({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),aE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},cE="tox-tinymce--toolbar-sticky-on",sE="tox-tinymce--toolbar-sticky-off",lE=function(t){var e=t.element;bo(e).each((function(n){var r="padding-"+uE.getModes(t)[0];if(uE.isDocked(t)){var o=fu(n);Bi(e,"width",o+"px"),Bi(n,r,function(t){return ou(t)+(parseInt(Li(t,"margin-top"),10)||0)+(parseInt(Li(t,"margin-bottom"),10)||0)}(e)+"px")}else Ui(e,"width"),Ui(n,r)}))},fE=function(t,e){e?(bi(t,aE.fadeOutClass),wi(t,[aE.transitionClass,aE.fadeInClass])):(bi(t,aE.fadeInClass),wi(t,[aE.fadeOutClass,aE.transitionClass]))},dE=function(t,e){var n=rn(t.getContainer());e?(vi(n,cE),bi(n,sE)):(vi(n,sE),bi(n,cE))},mE=function(t,e){var n=Qe(x.none()),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||lE(e),dE(t,uE.isDocked(e)),e.getSystem().broadcastOn([$s()],{}),r().each((function(t){return t.getSystem().broadcastOn([$s()],{})}))},u=t.inline?[]:function(){var t;return[Wa.config({channels:(t={},t[fT()]={onReceive:lE},t)})]}();return m([Bm.config({}),uE.config({contextual:f({lazyContext:function(e){var n,r=ou(e.element),o=t.inline?t.getContentAreaContainer():t.getContainer(),i=ku(rn(o)),u=i.height-r,a=i.y+(n=e,"top",I(uE.getModes(n),"top")?0:r);return x.some(Su(i.x,a,i.width,u))},onShow:function(){o((function(t){return fE(t,!0)}))},onShown:function(t){o((function(t){return xi(t,[aE.transitionClass,aE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=go(o=e),Ga(i).filter((function(t){return!Vn(o,t)})).filter((function(t){return Vn(t,rn(i.dom.body))||jn(r,t)})).each((function(){return $a(o)})),n.set(x.none())}))},onHide:function(t){n.set(function(t,e){return Xa(t).orThunk((function(){return e().toOptional().bind((function(t){return Xa(t.element)}))}))}(t.element,r)),o((function(t){return fE(t,!1)}))},onHidden:function(){o((function(t){return xi(t,[aE.transitionClass])}))}},aE),modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},gE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(uE.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(lE)})),t.on("SkinLoaded",(function(){n().each((function(t){uE.isDocked(t)?uE.reset(t):uE.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(uE.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){uE.refresh(e);var n=e.element;bd(n)&&function(t,e){var n=go(e),r=n.dom.defaultView.innerHeight,o=pu(n),i=rn(t.elm),u=Ou(i),a=ru(i),c=u.y,s=c+a,l=cu(e),f=ru(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)vu(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;vu(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){dE(t,!1)}))},isDocked:function(t){return t().map(uE.isDocked).getOr(!1)},getBehaviours:mE}),hE=mf({factory:function(t,e){var n={focus:km.focusIn,setMenus:function(t,n){var r=V(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=CT(n).mapError((function(t){return he(t)})).getOrDie();return mS(r,"tox-mbtn",e.backstage,x.some("menuitem"))}));Am.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:La([Am.config({}),Nm("menubar-events",[ro((function(e){t.onSetup(e)})),Kr(rr(),(function(t,e){zu(t.element,".tox-mbtn--active").each((function(n){Du(e.event.target,".tox-mbtn").each((function(e){Vn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Yy.expand(t),Yy.close(n),Bm.focus(t)}))}))}))}))})),Kr(Dr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Yy.isOpen(n)&&(Yy.expand(t),Yy.close(n))}))}))}))]),km.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),x.some(!0)}}),Xb.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[_e("dom"),_e("uid"),_e("onEscape"),_e("backstage"),je("onSetup",t)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),pE="container",vE=[fl("slotBehaviours",[])],bE=function(t){return"<alloy.field."+t+">"},yE=function(t,e){var n,r=function(e){return nf(t)},o=function(e,n){return function(r,o){return Ql(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Do(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Bi(n,"display","none"),zo(n,"aria-hidden","true"),Vr(t,Br(),{name:e,visible:!1})}})),c=(n=a,function(t,e){j(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;Ui(n,"display"),Io(n,"aria-hidden"),Vr(t,Br(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return Ql(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.slotBehaviours),apis:l}},wE=wt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return oi(t)})),xE=f(f({},wE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Gl(pE,bE(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:bE(t)})}));return sf(pE,vE,o,yE,n)}}),CE=Zt([He("icon"),He("tooltip"),Xe("onShow",t),Xe("onHide",t),Xe("onSetup",(function(){return t}))]),SE=function(t){return{element:function(){return t.element.dom}}},kE=function(e,n){var r=V(vt(n),(function(t){var e=n[t],r=me(function(t){return de("sidebar",CE,t)}(e));return{name:t,getApi:SE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return V(r,(function(n){var o=Qe(t);return e.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:tp([uv(n,o),av(n,o),Kr(Br(),(function(t,e){var n=e.event;G(r,(function(t){return t.name===n.name})).each((function(e){(n.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},OE=function(t){return xE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:kE(e,t),slotBehaviours:tp([ro((function(t){return xE.hideAllSlots(t)}))])}}))},TE=function(t){return wf.getCurrent(t).bind((function(t){return iT.isGrowing(t)||iT.hasGrown(t)?wf.getCurrent(t).bind((function(t){return G(xE.getSlotNames(t),(function(e){return xE.isShowing(t,e)}))})):x.none()}))},_E=Uo("FixSizeEvent"),EE=Uo("AutoSizeEvent"),AE=function(t){var e=tn(t),n=wo(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return $(e,(function(t,e){var n;return"class"===e.name?t:f(f({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:No(e)};return f({tag:ao(e),classes:o,attributes:r},i)},NE=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})])}},RE=D_.optional({factory:hE,name:"menubar",schema:[_e("backstage")]}),ME=D_.optional({factory:{sketch:function(t){return L_.sketch({uid:t.uid,dom:t.dom,listBehaviours:La([km.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return bT({type:t.type,uid:Uo("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),x.some(!0)}})},setupItem:function(t,e,n,r){SO.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[_e("dom"),_e("onEscape")]}),zE=D_.optional({factory:{sketch:function(t){return function(t){return t.type===hh.sliding?vT:t.type===hh.floating?pT:bT}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),x.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[_e("dom"),_e("onEscape"),_e("getSink")]}),DE=D_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?mE:V_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:La(n(e,t.sharedBackstage))}}},name:"header",schema:[_e("dom")]}),BE=D_.optional({name:"socket",schema:[_e("dom")]}),PE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:La([Xb.config({}),Bm.config({}),iT.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:function(t){wf.getCurrent(t).each(xE.hideAllSlots),Fr(t,EE)},onGrown:function(t){Fr(t,EE)},onStartGrow:function(t){Vr(t,_E,{width:Fi(t.element,"width").getOr("")})},onStartShrink:function(t){Vr(t,_E,{width:fu(t.element)+"px"})}}),Am.config({}),wf.config({find:function(t){var e=Am.contents(t);return nt(e)}})])}],behaviours:La([eC(0),Nm("sidebar-sliding-events",[Kr(_E,(function(t,e){Bi(t.element,"width",e.event.width)})),Kr(EE,(function(t,e){Ui(t.element,"width")}))])])}}},name:"sidebar",schema:[_e("dom")]}),IE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:La([Am.config({})]),components:[]}}},name:"throbber",schema:[_e("dom")]}),LE=gf({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return z_.getPart(e,t,"socket")},setSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){return Am.set(t,[OE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){wf.getCurrent(t).each((function(n){iT.hasGrown(t)?xE.isShowing(n,e)?iT.shrink(t):(xE.hideAllSlots(n),xE.showSlot(n,e)):(xE.hideAllSlots(n),xE.showSlot(n,e),iT.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return z_.getPart(e,t,"sidebar").bind(TE).getOrNull()},getHeader:function(e){return z_.getPart(e,t,"header")},getToolbar:function(e){return z_.getPart(e,t,"toolbar")},setToolbar:function(e,n){z_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){z_.getPart(e,t,"multiple-toolbar").each((function(t){L_.setItems(t,n)}))},refreshToolbar:function(e){z_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){z_.getPart(e,t,"toolbar").each((function(t){var e,n;n=function(e){return e(t)},null!=(e=t.getApis().toggle)?x.some(n(e)):x.none()}))},isToolbarDrawerToggled:function(e){return z_.getPart(e,t,"toolbar").bind((function(t){return x.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return z_.getPart(e,t,"throbber")},focusToolbar:function(e){z_.getPart(e,t,"toolbar").orThunk((function(){return z_.getPart(e,t,"multiple-toolbar")})).each((function(t){km.focusIn(t)}))},setMenubar:function(e,n){z_.getPart(e,t,"menubar").each((function(t){hE.setMenus(t,n)}))},focusMenubar:function(e){z_.getPart(e,t,"menubar").each((function(t){hE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[_e("dom"),_e("behaviours")],partFields:[DE,RE,zE,ME,BE,PE,IE],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=V(n,(function(t){return mT(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=V(n,(function(t){return V(t,mT)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),HE={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 toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},FE=function(t){return"string"==typeof t?t.split(" "):t},VE=function(t,e){var n=f(f({},HE),e.menus),r=vt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?FE("file edit view insert format tools table help"):FE(!1===e.menubar?"":e.menubar),i=W(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||HE.hasOwnProperty(t)})),u=V(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Y(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||L(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:FE(o.items)},e,t)}));return W(u,(function(t){return t.getItems().length>0&&L(t.getItems(),(function(t){return"separator"!==t.type}))}))},jE=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},UE=function(t,e,n){return new Gg((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},WE=function(t,e){return UE(t,e+"/skin.min.css",t.ui.styleSheetLoader)},qE=function(t,e){var n;return n=rn(t.getElement()),Ei(n).isSome()?UE(t,e+"/skin.shadowdom.min.css",sp.DOM.styleSheetLoader):Gg.resolve()},$E=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Op.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&k(n)?Gg.all([WE(e,n),qE(e,n)]).then(jE(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:"Skin could not be loaded"})}}(e)):jE(e)()},GE=i($E,!1),XE=i($E,!0),KE=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,u=n.buttons;if(M(i,k)){var a=i.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return __(t,o,{backstage:r},x.none())}));LE.setToolbars(o,a)}else LE.setToolbar(o,__(t,n,{backstage:r},x.none()))},YE=Ln(),JE=YE.os.isiOS()&&YE.os.version.major<=12,QE=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=Qe(0),u=e.outerContainer;GE(t);var a=rn(o.targetNode),c=_i(Ti(a));!function(t,e){zs(t,e,So)}(a,e.mothership),Ms(c,e.uiMothership),t.on("PostRender",(function(){KE(t,e,n,r),i.set(t.getWin().innerWidth),LE.setMenubar(u,VE(t,n)),LE.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=Qe(uu(r.innerWidth,r.innerHeight)),u=Qe(uu(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(uu(r.innerWidth,r.innerHeight)),$v(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(uu(e.offsetWidth,e.offsetHeight)),$v(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=_b(rn(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Bi(f,"display","none")})),t.on("show",(function(){Ui(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var s,l,f=LE.getSocket(u).getOrDie("Could not find expected socket element");if(JE){Pi(f.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var d=(s=function(){t.fire("ScrollContent")},20,l=null,{cancel:function(){null!==l&&(clearTimeout(l),l=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===l&&(l=setTimeout((function(){s.apply(null,t),l=null}),20))}}),m=Tb(f.element,"scroll",d.throttle);t.on("remove",m.unbind)}tv(t,e),t.addCommand("ToggleSidebar",(function(e,n){LE.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return LE.whichSidebar(u)}));var g=Ip(t);g!==hh.sliding&&g!==hh.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(LE.refreshToolbar(e.outerContainer),i.set(n))}));var h={enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(u)}};return{iframeContainer:f.element.dom,editorContainer:u.element.dom,api:h}}}),ZE=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?x.some(parseInt(""+t,10)):x.none()},tA=function(t){return R(t)?t+"px":t},eA=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},nA=function(t){var e=_p(t),n=Ep(t),r=Np(t);return ZE(e).map((function(t){return eA(t,n,r)}))},rA=function(t,e){var n=ku(t);return{pos:e?n.y:n.bottom,bounds:n}},oA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=Qe(null),s=rn(o.targetNode),l=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=sp.DOM,c=Up(t),s=$p(t),l=Np(t).or(nA(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Ip(t),g=m===hh.sliding||m===hh.floating,h=Qe(!1),p=function(){return h.get()&&!t.removed},v=function(t){return g?t.fold((function(){return 0}),(function(t){return t.components().length>1?ru(t.components()[1].element):0})):0},b=function(){i.broadcastOn([$s()],{})},y=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=ZE(Li(Ri(),"margin-left")).getOr(0);return fu(Ri())-cu(e).left+t})),Bi(o.get().element,"max-width",n+"px")),g&&LE.refreshToolbar(u),c||function(){var t=LE.getToolbar(u),n=v(t),r=ku(e),i=d()?Math.max(r.y-ru(o.get().element)+n,0):r.bottom;Pi(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?uE.reset(r):uE.refresh(r)}b()}},w=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Fp(t)){case Pp.auto:var r=LE.getToolbar(u),o=v(r),i=ru(n.element)-o,a=ku(e);if(a.y>i)return"top";var c=po(e),s=Math.max(c.dom.scrollHeight,ru(c));return a.bottom<s-i||Tu().bottom<a.bottom-i?"bottom":"top";case Pp.bottom:return"bottom";case Pp.top:default:return"top"}}(o.get());i!==r&&(function(t){var e=o.get();uE.setModes(e,[t]),f.setDockingMode(t);var n=d()?Iu.TopToBottom:Iu.BottomToTop;zo(e.element,yc,n)}(i),n&&y(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Bi(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Ui(i.element,"display"),w(!1),y()},hide:function(){h.set(!1),n.outerContainer&&(Bi(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Bi(i.element,"display","none")},update:y,updateMode:w,repositionPopups:b}}(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);XE(t);var d=function(){if(c.get())l.show();else{c.set(LE.getHeader(a).getOrDie());var o=Wp(t);Ms(o,i),Ms(o,u),KE(t,e,n,r),LE.setMenubar(a,VE(t,n)),l.show(),function(t,e,n,r){var o=Qe(rA(e,n.isPositionedAtTop())),i=function(r){var i=rA(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&$v(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Ag.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=b_();u.set(_b(rn(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&d()})),tv(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),iA=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},uA=function(t){(function(t){!function(t){iC.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"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:y_(t,e.name),onAction:iA(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:y_(t,n),onAction:iA(t,n)})}}(t),function(t){iC.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"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))}(t),function(t){iC.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:y_(t,e.name)})}))}(t)})(t),function(t){iC.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",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{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"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:iA(t,"code")})}(t)},aA=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},cA={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:[""]},sA=(n_="[eE][+-]?[0-9]+",o_=["Infinity","[0-9]+\\."+(r_=function(t){return"(?:"+t+")?"})("[0-9]+")+r_(n_),"\\.[0-9]+"+r_(n_),"[0-9]+"+r_(n_)].join("|"),new RegExp("^([+-]?(?:"+o_+"))(.*)$")),lA=function(t){return function(t,e){return function(t,e){return x.from(sA.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return L(e,(function(e){return L(cA[e],(function(e){return t===e}))}))}(r,e)?x.some({value:n,unit:r}):x.none()}))}(t,["fixed","relative","empty"]).map((function(t){return t.value+t.unit}))}(t).getOr(t)},fA=function(t){var e=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")}(t),n=new Map,r=v_(),o=function(){var e=lA(t.queryCommandValue("LineHeight"));x.from(n.get(e)).fold((function(){return r.clear()}),(function(t){r.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)}))};return t.on("nodeChange",o),V(e,(function(i,u){return{type:"togglemenuitem",text:i,onSetup:function(a){return n.set(lA(i),a),u+1===e.length&&o(),function(){0===u&&(t.off("nodeChange",o),r.clear())}},onAction:function(){return t.execCommand("LineHeight",!1,i)}}}))},dA=function(t,e){!function(t){iC.each([{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"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:y_(t,e.name)})}));t.ui.registry.addButton("alignnone",{tooltip:"No alignment",onAction:function(){return t.execCommand("JustifyNone")},icon:"align-none"})}(t),uA(t),function(t,e){!function(t,e){var n=t_(0,e,c_(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,f_(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=f({type:"advanced"},e.styleselect),r=t_(0,e,C_(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,x_(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,g_(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)}(t,e),function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)}(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=Qe(null),n=Qe(null);ub(t,"forecolor","forecolor","Text color",e),ub(t,"backcolor","hilitecolor","Background color",n),ab(t,"forecolor","forecolor","Text color"),ab(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t),function(t){!function(t){t.ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return fA(t)}})}(t),function(t){t.ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(e){return e(fA(t))}})}(t)}(t)},mA=function(t,e){return{anchor:"makeshift",x:t,y:e}},gA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},hA=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(gA(t)){var e=t.touches[0];return mA(e.pageX,e.pageY)}return mA(t.pageX,t.pageY)}(e):function(t,e){var n=sp.DOM.getPos(t);return function(t,e,n){return mA(t.x+e,t.y+n)}(e,n.x,n.y)}(t.getContentAreaContainer(),function(t){if(gA(t)){var e=t.touches[0];return mA(e.clientX,e.clientY)}return mA(t.clientX,t.clientY)}(e)):pA(t)},pA=function(t){return{anchor:"selection",root:rn(t.selection.getNode())}},vA=function(t){return{anchor:"node",node:x.some(rn(t.selection.getNode())),root:rn(t.getBody())}},bA=function(t,e,n,r,o,i){var u=n(),a=i?vA(t):hA(t,e);fS(u,ph.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),vg.showMenuAt(o,a,{menu:{markers:Ah("normal")},data:t})}))},yA={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},wA={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"]},xA=function(t,e,n,r,o,i){var u=Ln(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),d=function(){var u=n();!function(t,e,n,r,o,i,u){var a=i?vA(t):function(t,e){return f({bubble:hc(0,12,wA),layouts:yA,overrides:{maxWidthFunction:yO(),maxHeightFunction:fc()}},hA(t,e))}(t,e);fS(n,ph.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),vg.showMenuWithinBounds(o,a,{menu:{markers:Ah("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return x.some($T(t,r.shared))})),t.fire(wO)}))}(t,e,u,r,o,i,!(s||a||c&&l))};if(!c&&!a||i)s&&!i&&t.selection.setCursorLocation(e.target,0),d();else{var m=function(){!function(t){var e=t.selection.getRng(),n=function(){Ag.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),d()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Uc(t.getWin(),Ac.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)}))):m()}},CA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},SA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},kA=function(t){return k(t)?"|"===t:"separator"===t.type},OA={type:"separator"},TA=function(t){if(k(t))return t;switch(t.type){case"separator":return OA;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return k(e)?e:V(e,TA)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(e=t.onAction,function(){return e()})}}var e},_A=function(t,e){if(0===e.length)return t;var n=rt(t).filter((function(t){return!kA(t)})).fold((function(){return[]}),(function(t){return[OA]}));return t.concat(n).concat(e).concat([OA])},EA=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},AA=function(t,e){return EA(t,e)?t.selection.getStart(!0):e.target},NA=function(t,e,n){var r=Ln().deviceType.isTouch,o=Zi(vg.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissContextMenu",[Kr(Mr(),(function(e,n){Ws.close(e),t.focus()}))])])})),i=function(t){return vg.hide(o)},u=function(e){if(SA(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!SA(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t);if(EA(t,e))return!0;if(n){var r=AA(t,e);return Ab(rn(r),n)}return!1}(t,e);(r()?xA:bA)(t,e,(function(){var n=AA(t,e),r=t.ui.registry.getAll(),o=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return x.from(t.getParam("contextmenu")).map(CA).getOrThunk((function(){return W(CA("link linkchecker image imagetools table spellchecker configurepermanentpen"),(function(t){return Tt(r,t)}))}))}(t)}(t);return function(t,e,n){var r=$(e,(function(e,r){if(Tt(t,r)){var o=t[r].update(n);if(k(o))return _A(e,o.split(" "));if(o.length>0){var i=V(o,TA);return _A(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&kA(r[r.length-1])&&r.pop(),r}(r.contextMenus,o,n)}),n,o,i)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",u)}))},RA=Et([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),MA=function(t){return function(e){return e.translate(-t.left,-t.top)}},zA=function(t){return function(e){return e.translate(t.left,t.top)}},DA=function(t){return function(e,n){return $(t,(function(t,e){return e(t)}),uu(e,n))}},BA=function(t,e,n){return t.fold(DA([zA(n),MA(e)]),DA([MA(e)]),DA([]))},PA=function(t,e,n){return t.fold(DA([zA(n)]),DA([]),DA([zA(e)]))},IA=function(t,e,n){return t.fold(DA([]),DA([MA(n)]),DA([zA(e),MA(n)]))},LA=function(t,e,n){var r=t.fold((function(t,e){return{position:x.some("absolute"),left:x.some(t+"px"),top:x.some(e+"px")}}),(function(t,e){return{position:x.some("absolute"),left:x.some(t-n.left+"px"),top:x.some(e-n.top+"px")}}),(function(t,e){return{position:x.some("fixed"),left:x.some(t+"px"),top:x.some(e+"px")}}));return f({right:x.none(),bottom:x.none()},r)},HA=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(IA,FA),o(PA,VA),o(BA,jA))},FA=RA.offset,VA=RA.absolute,jA=RA.fixed,UA=function(t,e){var n=Do(t,e);return E(n)?NaN:parseInt(n,10)},WA=function(t,e,n,r,o,i){var u=function(t,e,n,r){return function(t,e){var n=t.element,r=UA(n,e.leftAttr),o=UA(n,e.topAttr);return isNaN(r)||isNaN(o)?x.none():x.some(uu(r,o))}(t,e).fold((function(){return n}),(function(t){return jA(t.left+r.left,t.top+r.top)}))}(t,e,n,r),a=e.mustSnap?$A(t,e,u,o,i):GA(t,e,u,o,i),c=BA(u,o,i);return function(t,e,n){var r=t.element;zo(r,e.leftAttr,n.left+"px"),zo(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:jA(c.left,c.top),extra:x.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},qA=function(t,e,n,r){return it(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?x.some({output:HA(t.output,e,n,r),extra:t.extra}):x.none()}))},$A=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o).orThunk((function(){return $(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return uu(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:x.some(u),snap:x.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:x.some(u),snap:x.some(e)}:t}))}),{deltas:x.none(),snap:x.none()}).snap.map((function(t){return{output:HA(t.output,n,r,o),extra:t.extra}}))}))},GA=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o)},XA=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t,e,n){return{coord:HA(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=LA(c.coord,0,a);Ii(o,s)}}}),KA="data-initial-z-index",YA=function(t,e){t.getSystem().addToGui(e),function(t){bo(t.element).filter(so).each((function(e){Fi(e,"z-index").each((function(t){zo(e,KA,t)})),Bi(e,"z-index",Li(t.element,"z-index"))}))}(e)},JA=function(t){!function(t){bo(t.element).filter(so).each((function(t){Bo(t,KA).fold((function(){return Ui(t,"z-index")}),(function(e){return Bi(t,"z-index",e)})),Io(t,KA)}))}(t),t.getSystem().removeFromGui(t)},QA=function(t,e,n){return t.getSystem().build(Vb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},ZA=Ve("snaps",[_e("getSnapPoints"),Ku("onSensor"),_e("leftAttr"),_e("topAttr"),je("lazyViewport",Tu),je("mustSnap",!1)]),tN=[je("useFixed",c),_e("blockerClass"),je("getTarget",o),je("onDrag",t),je("repositionTarget",!0),je("onDrop",t),Xe("getBounds",Tu),ZA],eN=function(t,e){return{bounds:t.getBounds(),height:ou(e.element),width:du(e.element)}},nN=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return eN(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t){return(e=Fi(t,"left"),n=Fi(t,"top"),r=Fi(t,"position"),o=function(t,e,n){return("fixed"===n?jA:FA)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?x.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):x.none()).getOrThunk((function(){var e=cu(t);return VA(e.left,e.top)}));var e,n,r,o}(o),s=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=PA(e,n,r),a=uc(u.left,i.x,i.x+i.width-o.width),c=uc(u.top,i.y,i.y+i.height-o.height),s=VA(a,c);return e.fold((function(){var t=IA(s,n,r);return FA(t.left,t.top)}),(function(){return s}),(function(){var t=BA(s,n,r);return jA(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return FA(t+e,n+u)}),(function(t,n){return VA(t+e,n+u)}),(function(t,n){return jA(t+e,n+u)}))),c=BA(a,r,o);return jA(c.left,c.top)}),(function(e){var u=WA(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)}(t,e.snaps,c,u,a,r,n),l=LA(s,0,a);Ii(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},rN=function(t,e,n,r){e.each(JA),n.snaps.each((function(e){!function(t,e){!function(t,e){var n=t.element;Io(n,e.leftAttr),Io(n,e.topAttr)}(t,e)}(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},oN=function(t){return function(e,n){var r=function(t){n.setStartData(eN(e,t))};return $r(m([Kr(Er(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},iN=Object.freeze({__proto__:null,getData:function(t){return x.from(uu(t.x,t.y))},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),uN=function(t,e,n){return[Kr(Zn(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return rN(r,x.some(c),t,e)},u=Nb(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),nN(r,t,e,iN,n)}},c=QA(r,t.blockerClass,function(t){return $r([Kr(Zn(),t.forceDrop),Kr(nr(),t.drop),Kr(tr(),(function(e,n){t.move(n.event)})),Kr(er(),t.delayDrop)])}(a));n(r),YA(r,c)}}))]},aN=m(tN,[Zu("dragger",{handlers:oN(uN)})]),cN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return x.some(uu(e.clientX,e.clientY))}(e):x.none()},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),sN=function(t,e,n){var r=Qe(x.none());return[Kr(Kn(),(function(o,i){i.stop();var u=function(){rN(o,r.get(),t,e),r.set(x.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(n){nN(o,t,e,cN,n)}},c=QA(o,t.blockerClass,function(t){return $r([Kr(Kn(),t.forceDrop),Kr(Jn(),t.drop),Kr(Qn(),t.drop),Kr(Yn(),(function(e,n){t.move(n.event)}))])}(a));r.set(x.some(c)),n(o),YA(o,c)})),Kr(Yn(),(function(n,r){r.stop(),nN(n,t,e,cN,r.event)})),Kr(Jn(),(function(n,o){o.stop(),rN(n,r.get(),t,e),r.set(x.none())})),Kr(Qn(),(function(n){rN(n,r.get(),t,e),r.set(x.none())}))]},lN=aN,fN=m(tN,[Zu("dragger",{handlers:oN(sN)})]),dN=m(tN,[Zu("dragger",{handlers:oN((function(t,e,n){return m(uN(t,e,n),sN(t,e,n))}))})]),mN=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:lN,touch:fN,mouseOrTouch:dN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:x.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=x.none(),e=x.none(),n=r({});return ui({readState:n,reset:function(){t=x.none(),e=x.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=x.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=x.some(t)}})}}),apis:XA}),gN=function(t,e,n,r,o,i){return t.fold((function(){return mN.snap({sensor:VA(n-20,r-20),range:uu(o,i),output:VA(x.some(n),x.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return mN.snap({sensor:VA(o,i),range:uu(40,40),output:VA(x.some(n-u.width/2),x.some(r-u.height/2)),extra:{td:e}})}))},hN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Vn(t,e)}))})(e.get(),o)||(e.set(x.some(o)),n(o))},mustSnap:!0}},pN=function(t){return Rg(Ng.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:La([mN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Jy.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},vN=function(t,e){var n=Qe([]),r=Qe([]),o=Qe(!1),i=Qe(x.none()),u=Qe(x.none()),a=function(t){var n=Ou(t);return gN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Ou(t);return gN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=hN((function(){return V(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=hN((function(){return V(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=pN(s),d=pN(l),m=Zi(f.asSpec()),g=Zi(d.asSpec()),h=function(e,n,r,o){var i=r(n);mN.snapTo(e,i),function(e,n,r,i){var u=n.dom.getBoundingClientRect();Ui(e.element,"display");var a=vo(rn(t.getBody())).dom.innerHeight,c=u[o]<0,s=function(t,e){return t[o]>e}(u,a);(c||s)&&Bi(e.element,"display","none")}(e,n)},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};Ln().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(_s(e,m),_s(e,g),o.set(!0)),i.set(x.some(t.start)),u.set(x.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Ns(m),Ns(g),o.set(!1)),i.set(x.none()),u.set(x.none())})))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(i_||(i_={}));var bN,yN,wN,xN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},CN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(function(t,e,n){return e.delimiter||(e.delimiter="»"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:La([km.config({mode:"flow",selector:"div[role=button]"}),kp.config({disabled:n.isDisabled}),ev(),Xb.config({}),Am.config({}),Nm("elementPathEvents",[ro((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return km.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!xN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?Am.set(r,(i=V(a||[],(function(e,r){return Ng.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:La([nv(n.isDisabled),ev()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},$(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):Am.set(r,[])}))}))])]),components:[]}}(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Am.set(t,[Yi(e.translate(["{0} "+r,n[r]]))])};return Ng.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:La([nv(e.isDisabled),ev(),Xb.config({}),Am.config({}),ll.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Nm("wordcount-events",[uo((function(t){var e=ll.getValue(t),n="words"===e.mode?"characters":"words";ll.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),ro((function(e){t.on("wordCountUpdate",(function(t){var n=ll.getValue(e).mode;ll.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=lp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?i_.None:"both"===n?i_.Both:i_.Vertical}(t);return o!==i_.None&&r.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:zg("resize-handle",e.icons)},behaviours:La([mN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){!function(t,e,n){var r=rn(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=eA(r+e.top,Ap(t),Rp(t)),n===i_.Both&&(i.width=eA(o+e.left,Ep(t),Np(t))),i}(t,e,n,ru(r),fu(r));yt(o,(function(t,e){return Bi(r,e,tA(t))})),function(t){t.fire("ResizeEditor")}(t)}(t,o,n)},blockerClass:"tox-blocker"})])}}(o)),r}()}},SN=function(t){var e,n,r,o,i=t.inline,u=i?oA:QE,a=$p(t)?gE:j_,c=x.none(),s=Ln(),l=s.browser.isIE()?["tox-platform-ie"]:[],d=s.deviceType.isTouch()?["tox-platform-touch"]:[],m=Vp(t),g=Wp(t),h=lp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[yc]=m?Iu.BottomToTop:Iu.TopToBottom,e)},v=function(){return c.bind(LE.getHeader)},b=Zi((n=Vn(Ri(),g)&&"grid"===Li(g,"display"),r={dom:f({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(d)},h),behaviours:La([Cs.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:$r([Kr(Ar(),(function(){Bi(q.element,"width",document.body.clientWidth+"px")}))])},Rt(r,n?o:{}))),y=function(){return ct.value(b)},w=Rg({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return LE.getThrobber(t)})).getOrDie("Could not find throbber element")},S=function(t,e,n){var r=Qe(!1),o=function(t){var e=Qe(Vp(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:lp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return Ek(Tk,t,e)}(t,i)},anchors:Dk(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ct.value(t)}},urlinput:bO(e),styleselect:Gk(e),colorinput:Hk(e),dialog:Vk(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i}(b,t,(function(){return c.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=LE.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=Ip(t),T=LE.parts.toolbar(f({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind((function(t){return LE.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),_=LE.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),E=LE.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),A=LE.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),N=LE.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),M=t.getParam("statusbar",!0,"boolean")&&!i?x.some(CN(t,S.shared.providers)):x.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[E,A]},D=Bp(t),B=zp(t),P=Mp(t),I=LE.parts.header({dom:f({tag:"div",classes:["tox-editor-header"]},p),components:K([P?[k]:[],D?[_]:B?[T]:[],Up(t)?[]:[w.asSpec()]]),sticky:$p(t),editor:t,sharedBackstage:S.shared}),L=K([m?[]:[I],i?[]:[z],m?[I]:[]]),H=K([[{dom:{tag:"div",classes:["tox-editor-container"]},components:L}],i?[]:M.toArray(),[N]]),F=qp(t),V=f(f({role:"application"},lp.isRtl()?{dir:"rtl"}:{}),F?{"aria-hidden":"true"}:{}),U=Zi(LE.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d).concat(l),styles:f({visibility:"hidden"},F?{opacity:"0",border:"0"}:{}),attributes:V},components:H,behaviours:La([ev(),kp.config({disableClass:"tox-tinymce--disabled"}),km.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"})])}));c=x.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){LE.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){LE.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){LE.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return LE.isToolbarDrawerToggled(U)}));var W=jb(U),q=jb(b);!function(t,e,n){var r=function(t,r){j([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){j([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(qs(),{target:t.target})},u=Tb(rn(document),"touchstart",i),a=Tb(rn(document),"touchmove",(function(t){return r(Tr(),t)})),c=Tb(rn(document),"touchend",(function(t){return r(_r(),t)})),s=Tb(rn(document),"mousedown",i),l=Tb(rn(document),"mouseup",(function(t){0===t.raw.button&&o(Gs(),{target:t.target})})),f=function(t){return o(qs(),{target:rn(t.target)})},d=function(t){0===t.button&&o(Gs(),{target:rn(t.target)})},m=function(t){return r(Er(),Eb(t))},g=function(t){o($s(),{}),r(Ar(),Eb(t))},h=function(){return o($s(),{})};t.on("PostRender",(function(){t.on("click",f),t.on("tap",f),t.on("mouseup",d),t.on("ScrollWindow",m),t.on("ResizeWindow",g),t.on("ResizeEditor",h)})),t.on("remove",(function(){t.off("click",f),t.off("tap",f),t.off("mouseup",d),t.off("ScrollWindow",m),t.off("ResizeWindow",g),t.off("ResizeEditor",h),s.unbind(),u.unbind(),a.unbind(),c.unbind(),l.unbind()})),t.on("detach",(function(){Ds(e),Ds(n),e.destroy(),n.destroy()}))}(t,W,q);var $=function(){var e=tA(function(t){return function(t){var e=Tp(t),n=Ap(t),r=Rp(t);return ZE(e).map((function(t){return eA(t,n,r)}))}(t).getOr(Tp(t))}(t)),n=tA(function(t){return nA(t).getOr(_p(t))}(t));return t.inline||(ji("div","width",n)&&Bi(U.element,"width",n),ji("div","height",e)?Bi(U.element,"height",e):Bi(U.element,"height","200px")),e};return{mothership:W,uiMothership:q,backstage:S,renderUI:function(){a.setup(t,S.shared,v),dA(t,S),NA(t,y,S),function(t){var e=t.ui.registry.getAll().sidebars;j(vt(e),(function(n){var r=e[n],o=function(){return x.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),function(t,e,n){var r=Qe(!1),o=Qe(x.none()),i=function(t){t!==r.get()&&(function(t,e,n){var r=t.element;!0===e?(Am.set(t,[NE(n)]),Ui(r,"display"),Io(r,"aria-hidden")):(Am.set(t,[]),Bi(r,"display","none"),zo(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(Ag.clearTimeout),R(e.time)){var n=Ag.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(x.some(n))}else i(e.state),o.set(x.none())}))}(t,C,S.shared),wt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Dp(t),s={menuItems:r,menus:Gp(t),menubar:Xp(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===hh.floating,buttons:n,sidebar:i};M_(t,o,b,{backstage:S}),vN(t,b);var l=t.getElement(),f=$(),d={mothership:W,uiMothership:q,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:q.broadcast,broadcastOn:q.broadcastOn,register:function(){}}}}}},kN=r([_e("lazySink"),Pe("dragBlockClass"),Xe("getBounds",Tu),je("useTabstopAt",s),je("eventOrder",{}),fl("modalBehaviours",[km]),Yu("onExecute"),Qu("onEscape")]),ON={sketch:o},TN=r([Fl({name:"draghandle",overrides:function(t,e){return{behaviours:La([mN.config({mode:"mouse",getTarget:function(t){return Mu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Ll({schema:[_e("dom")],name:"title"}),Ll({factory:ON,schema:[_e("dom")],name:"close"}),Ll({factory:ON,schema:[_e("dom")],name:"body"}),Fl({factory:ON,schema:[_e("dom")],name:"footer"}),Hl({factory:{sketch:function(t,e){return f(f({},t),{dom:e.dom,components:e.components})}},schema:[je("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),je("components",[])],name:"blocker"})]),_N=Object.freeze({__proto__:null,block:function(t,e,n,r){zo(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})]),u=r(o,i),a=o.getSystem().build(u);Am.append(o,tu(a)),a.hasConfigured(km)&&km.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Am.remove(o,a)}))},unblock:function(t,e,n){Io(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),EN=[Xe("getRoot",x.none),Ku("onBlock"),Ku("onUnblock")],AN=Fa({fields:EN,name:"blocking",apis:_N,state:Object.freeze({__proto__:null,init:function(){var t=v_();return ui({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NN=gf({name:"ModalDialog",configFields:kN(),partFields:TN(),factory:function(t,e,n,r){var i,u=Qe(x.none()),a=Uo("modal-events"),c=f(f({},t.eventOrder),((i={})[Nr()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),i));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){u.set(x.some(e));var n=t.lazySink(e).getOrDie(),o=r.blocker(),i=n.getSystem().build(f(f({},o),{components:o.components.concat([tu(e)]),behaviours:La([Bm.config({}),Nm("dialog-blocker-events",[no(or(),(function(){km.focusIn(e)}))])])}));_s(n,i),km.focusIn(e)},hide:function(t){u.set(x.none()),bo(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Ns(t)}))}))},getBody:function(e){return Zl(e,t,"body")},getFooter:function(e){return Zl(e,t,"footer")},setIdle:function(t){AN.unblock(t)},setBusy:function(t,e){AN.block(t,e)}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:ml(t.modalBehaviours,[Am.config({}),km.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),AN.config({getRoot:u.get}),Nm(a,[ro((function(e){var n,r,i,u,a,c;n=e.element,r=Zl(e,t,"title").element,i=Bo(n,"id").fold((function(){var t=Uo("dialog-label");return zo(r,"id",t),t}),o),zo(n,"aria-labelledby",i),u=e.element,a=Zl(e,t,"body").element,c=x.from(Do(u,"id")).fold((function(){var t=Uo("dialog-describe");return zo(a,"id",t),t}),o),zo(u,"aria-describedby",c)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),RN=Zt([Ne("type"),Ne("name")].concat($h)),MN=Ce,zN=[ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),$e("align","end",["start","end"]),Ge("primary",!1),Ge("disabled",!1)],DN=m(zN,[Ne("text")]),BN=m([Re("type",["submit","cancel","custom"])],DN),PN=m([Re("type",["menu"]),He("text"),He("tooltip"),He("icon"),Be("items",RN)],zN),IN=ve("type",{submit:BN,cancel:BN,custom:BN,menu:PN}),LN=[Ne("type"),Ne("text"),Re("level",["info","warn","error","success"]),Ne("icon"),je("url","")],HN=Zt(LN),FN=[Ne("type"),Ne("text"),Ge("disabled",!1),Ge("primary",!1),ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),Ge("borderless",!1)],VN=Zt(FN),jN=[Ne("type"),Ne("name"),Ne("label"),Ge("disabled",!1)],UN=Zt(jN),WN=Ce,qN=[Ne("type"),Ne("name")],$N=qN.concat([He("label")]),GN=$N.concat([je("columns","auto")]),XN=Zt(GN),KN=ce([Ne("value"),Ne("text"),Ne("icon")]),YN=Zt($N),JN=xe,QN=Zt($N),ZN=xe,tR=qN.concat([qe("tag","textarea"),Ne("scriptId"),Ne("scriptUrl"),Ue("settings",void 0,Oe)]),eR=qN.concat([qe("tag","textarea"),Me("init")]),nR=le((function(t){return de("customeditor.old",Qt(eR),t).orThunk((function(){return de("customeditor.new",Qt(tR),t)}))})),rR=xe,oR=Zt($N),iR=te(ae),uR=function(t){return[Ne("type"),Ae("columns"),t]},aR=[Ne("type"),Ne("html"),$e("presets","presentation",["presentation","document"])],cR=Zt(aR),sR=$N.concat([Ge("sandboxed",!0)]),lR=Zt(sR),fR=xe,dR=$N.concat([Ee("currentState",Zt([_e("blob"),Ne("url")]))]),mR=Zt(dR),gR=$N.concat([He("inputMode"),He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),hR=Zt(gR),pR=xe,vR=function(t){return[Ne("type"),Ne("label"),t]},bR=[Ne("text"),Ne("value")],yR=[Ne("text"),Be("items",(yN=function(){return wR},wN=zt((function(){return yN()})),{extract:function(t,e,n){return wN().extract(t,e,n)},toString:function(){return wN().toString()}}))],wR=ee([Zt(bR),Zt(yR)]),xR=$N.concat([Be("items",wR),Ge("disabled",!1)]),CR=Zt(xR),SR=xe,kR=$N.concat([De("items",[Ne("text"),Ne("value")]),We("size",1),Ge("disabled",!1)]),OR=Zt(kR),TR=xe,_R=$N.concat([Ge("constrain",!0),Ge("disabled",!1)]),ER=Zt(_R),AR=Zt([Ne("width"),Ne("height")]),NR=[Ne("type"),Be("header",xe),Be("cells",te(xe))],RR=Zt(NR),MR=$N.concat([He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),zR=Zt(MR),DR=xe,BR=$N.concat([$e("filetype","file",["image","media","file"]),je("disabled",!1)]),PR=Zt(BR),IR=Zt([Ne("value"),je("meta",{})]),LR=function(t){return ie("items","items",Pt(),te(le((function(e){return de("Checking item of "+t,HR,e).fold((function(t){return ct.error(he(t))}),(function(t){return ct.value(t)}))}))))},HR=se((function(){return pe("type",{alertbanner:HN,bar:Zt((t=LR("bar"),[Ne("type"),t])),button:VN,checkbox:UN,colorinput:YN,colorpicker:QN,dropzone:oR,grid:Zt(uR(LR("grid"))),iframe:lR,input:hR,listbox:CR,selectbox:OR,sizeinput:ER,textarea:zR,urlinput:PR,customeditor:nR,htmlpanel:cR,imagetools:mR,collection:XN,label:Zt(vR(LR("label"))),table:RR,panel:VR});var t})),FR=[Ne("type"),je("classes",[]),Be("items",HR)],VR=Zt(FR),jR=[ie("name","name",Lt((function(){return Uo("tab-name")})),xe),Ne("title"),Be("items",HR)],UR=[Ne("type"),De("tabs",jR)],WR=Zt(UR),qR=DN,$R=IN,GR=Zt([Ne("title"),Ee("body",pe("type",{panel:VR,tabpanel:WR})),qe("size","normal"),Be("buttons",$R),je("initialData",{}),Xe("onAction",t),Xe("onChange",t),Xe("onSubmit",t),Xe("onClose",t),Xe("onCancel",t),je("onTabChange",t)]),XR=Zt(m([Re("type",["cancel","custom"])],qR)),KR=Zt([Ne("title"),Ne("url"),Le("height"),Le("width"),(bN=XR,Ie("buttons",te(bN))),Xe("onAction",t),Xe("onCancel",t),Xe("onClose",t),Xe("onMessage",t)]),YR=function(t){return O(t)?[t].concat(Y(kt(t),YR)):T(t)?Y(t,YR):[]},JR=function(t){return k(t.type)&&k(t.name)},QR={checkbox:WN,colorinput:JN,colorpicker:ZN,dropzone:iR,input:pR,iframe:fR,sizeinput:AR,selectbox:TR,listbox:SR,size:AR,textarea:DR,urlinput:IR,customeditor:rR,collection:KN,togglemenuitem:MN},ZR=function(t){var e=function(t){return W(YR(t),JR)}(t),n=Y(e,(function(t){return function(t){return x.from(QR[t.type])}(t).fold((function(){return[]}),(function(e){return[Ee(t.name,e)]}))}));return Zt(n)},tM=function(t){return{internalDialog:me(de("dialog",GR,t)),dataValidator:ZR(t),initialData:t.initialData}},eM={open:function(t,e){var n=tM(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(me(de("dialog",KR,e)))},redial:function(t){return tM(t)}},nM=function(t){var e=[],n={};return yt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ct.error(e):ct.value(n)},rM=function(t,e){var n,r=Rg(Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:V(t.items,(function(t){return _k(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),(n=r,wf.config({find:n.getOpt})),cC(r,{postprocess:function(t){return nM(t).fold((function(t){return console.error(t),{}}),(function(t){return t}))}})])}},oM=mf({name:"TabButton",configFields:[je("uid",void 0),_e("value"),ie("dom","dom",Ht((function(){return{attributes:{role:"tab",id:Uo("aria"),"aria-selected":"false"}}})),be()),Pe("action"),je("domModification",{}),fl("tabButtonBehaviours",[Bm,km,ll]),_e("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Km(t.action),behaviours:ml(t.tabButtonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0}),ll.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),iM=r([_e("tabs"),_e("dom"),je("clickToDismiss",!1),fl("tabbarBehaviours",[Nf,km]),Gu(["tabClass","selectedClass"])]),uM=Vl({factory:oM,name:"tabs",unit:"tab",overrides:function(e){var n=function(t,e){Nf.dehighlight(t,e),Vr(t,Ir(),{tabbar:t,button:e})},r=function(t,e){Nf.highlight(t,e),Vr(t,Pr(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(e.uid).getOrDie(),u=Nf.isHighlighted(i,o);(u&&e.clickToDismiss?n:u?t:r)(i,o)},domModification:{classes:[e.markers.tabClass]}}}}),aM=r([uM]),cM=gf({name:"Tabbar",configFields:iM(),partFields:aM(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:ml(t.tabbarBehaviours,[Nf.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){zo(e.element,"aria-selected","true")},onDehighlight:function(t,e){zo(e.element,"aria-selected","false")}}),km.config({mode:"flow",getInitial:function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),sM=mf({name:"Tabview",configFields:[fl("tabviewBehaviours",[Am])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:ml(t.tabviewBehaviours,[Am.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),lM=r([je("selectFirst",!0),Ku("onChangeTab"),Ku("onDismissTab"),je("tabs",[]),fl("tabSectionBehaviours",[])]),fM=Ll({factory:cM,schema:[_e("dom"),ze("markers",[_e("tabClass"),_e("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),dM=Ll({factory:sM,name:"tabview"}),mM=r([fM,dM]),gM=gf({name:"TabSection",configFields:lM(),partFields:mM(),factory:function(t,e,n,r){var o=function(e,n){Ql(e,t,"tabbar").each((function(t){n(t).each(jr)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.tabSectionBehaviours),events:$r(K([t.selectFirst?[ro((function(t,e){o(t,Nf.getFirst)}))]:[],[Kr(Pr(),(function(e,n){var r,o;r=n.event.button,o=ll.getValue(r),Ql(r,t,"tabview").each((function(e){G(t.tabs,(function(t){return t.value===o})).each((function(n){var o=n.view();Bo(r.element,"id").each((function(t){zo(e.element,"aria-labelledby",t)})),Am.set(e,o),t.onChangeTab(e,r,o)}))}))})),Kr(Ir(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Ql(e,t,"tabview").map((function(t){return Am.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Nf.getCandidates(t);return G(n,(function(t){return ll.getValue(t)===e})).filter((function(e){return!Nf.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),hM=function(t,e){Bi(t,"height",e+"px"),Ln().browser.isIE()?Ui(t,"flex-basis"):Bi(t,"flex-basis",e+"px")},pM=function(t,e,n){Mu(t,'[role="dialog"]').each((function(t){zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Bi(e,"height","0"),Bi(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=po(t).dom,i=Mu(t,".tox-dialog-wrap").getOr(t);r="fixed"===Li(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=ru(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+fu(n)?Math.max(ru(n),u):u,c=parseInt(Li(t,"margin-top"),10)||0,s=parseInt(Li(t,"margin-bottom"),10)||0;return r-(ru(t)+c+s-a)}(t,e,r))})).each((function(t){hM(e,t)}))}))}))},vM=function(t){return zu(t,'[role="tabpanel"]')},bM="send-data-to-section",yM="send-data-to-view",wM=function(t,e){var n=Qe({}),r=function(t){var e=ll.getValue(t),r=nM(e).getOr({}),o=n.get(),i=Rt(o,r);n.set(i)},o=function(t){var e=n.get();ll.setValue(t,e)},i=Qe(null),a=V(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,(function(t){return _k(n,t,e)})),formBehaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),Nm("TabView.form.events",[ro(o),oo(r)]),Wa.config({channels:jt([{key:bM,value:{onReceive:r}},{key:yM,value:{onReceive:o}}])})])}}))]}}})),c=function(t){var e;return{smartTabHeight:(e=Qe(x.none()),{extraEvents:[ro((function(n){var r=n.element;vM(r).each((function(o){Bi(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r,i=(r=function(t,e,n){return V(t,(function(r,o){Am.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Am.set(n,[]),i.height}))}(t,o,n),nt(tt(r,(function(t,e){return t>e?-1:t<e?1:0}))));e.set(i)})),pM(r,o,e),Ui(o,"visibility"),function(t,e){nt(t).each((function(t){return gM.showTab(e,t.value)}))}(t,n),Ag.requestAnimationFrame((function(){pM(r,o,e)}))}))})),Kr(Ar(),(function(t){var n=t.element;vM(n).each((function(t){pM(n,t,e)}))})),Kr(cy,(function(t,n){var r=t.element;vM(r).each((function(t){var n=Ga();Bi(t,"visibility","hidden");var o=Fi(t,"height").map((function(t){return parseInt(t,10)}));Ui(t,"height"),Ui(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(x.from(i)),pM(r,t,e)):o.each((function(e){hM(t,e)})),Ui(t,"visibility"),n.each($a)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}(a).smartTabHeight;return gM.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=ll.getValue(e);Vr(t,ay,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[gM.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[cM.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:La([Xb.config({})])}),gM.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:La([Nm("tabpanel",c.extraEvents),km.config({mode:"acyclic"}),wf.config({find:function(t){return nt(gM.getViewItems(t))}}),ll.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([bM],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([yM],{})}}})])})},xM=Uo("update-dialog"),CM=Uo("update-title"),SM=Uo("update-body"),kM=Uo("update-footer"),OM=Uo("body-send-message"),TM=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:f(f({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:La([eC(0),_T.config({channel:SM,updateState:function(t,e){return x.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[wM(t.body,n)];default:return[rM(t.body,n)]}},initialData:t})])}},_M=mv.deviceType.isTouch(),EM=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},AM=function(t,e){return NN.parts.close(Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:La([Xb.config({})])}))},NM=function(){return NN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},RM=function(t,e){return NN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:AE("<p>"+e.translate(t)+"</p>")}]}]})},MM=function(t){return NN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},zM=function(t,e){return[Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},DM=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return NN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),x.some(!0)},useTabstopAt:function(t){return!bC(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:f({position:"relative"},t.extraStyles)},components:m([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:AE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:_M?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:La(m([Bm.config({}),Nm("dialog-events",t.dialogEvents.concat([no(or(),(function(t,e){km.focusIn(t)}))])),Nm("scroll-lock",[ro((function(){vi(Ri(),i)})),oo((function(){bi(Ri(),i)}))])],t.extraBehaviours)),eventOrder:f((e={},e[yr()]=["dialog-events"],e[Nr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Rr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},BM=function(t){return Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.icons)}}],action:function(t){Fr(t,ny)}})},PM=function(t,e,n){var r=function(t){return[Yi(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:f({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:La([_T.config({channel:CM,renderComponents:r})])}},IM=function(){return{dom:AE('<div class="tox-dialog__draghandle"></div>')}},LM=function(t,e){return function(t,e){var n=NN.parts.title(PM(t,x.none(),e)),r=NN.parts.draghandle(IM()),o=NN.parts.close(BM(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},HM=function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},FM=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){NN.setBusy(t(),(function(t,n){return HM(e.message,n)}))},onUnblock:function(){NN.setIdle(t())}}},VM=function(t,e,n,r){var o;return Zi(DM(f(f({},t),{lazySink:r.shared.getSink,extraBehaviours:m([_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:e}),fC({})],t.extraBehaviours),onEscape:function(t){Fr(t,ny)},dialogEvents:n,eventOrder:(o={},o[br()]=[_T.name(),Wa.name()],o[Nr()]=["scroll-lock",_T.name(),"messages","dialog-events","alloy.base.behaviour"],o[Rr()]=["alloy.base.behaviour","dialog-events","messages",_T.name(),"scroll-lock"],o)})))},jM=function(t){return V(t,(function(t){return"menu"===t.type?function(t){var e=V(t.items,(function(t){var e=Qe(!1);return f(f({},t),{storage:e})}));return f(f({},t),{items:e})}(t):t}))},UM=function(t){return $(t,(function(t,e){return"menu"===e.type?$(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},WM=function(t,e){return[Zr(or(),vC),t(ey,(function(t,n){e.onClose(),n.onClose()})),t(ny,(function(t,e,n,r){e.onCancel(t),Fr(r,ey)})),Kr(uy,(function(t,n){return e.onUnblock()})),Kr(iy,(function(t,n){return e.onBlock(n.event)}))]},qM=function(t,e,n){var r=function(e,n){return Kr(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){_T.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return m(WM(r,e),[r(oy,(function(t,e){return e.onSubmit(t)})),r(ty,(function(t,e,n){e.onChange(t,{name:n.name})})),r(ry,(function(t,e,r,o){var i=function(){return km.focusIn(o)},u=function(t){return Po(t,"disabled")||Bo(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Ti(o.element),c=Ga(a);e.onAction(t,{name:r.name,value:r.value}),Ga(a).fold(i,(function(t){u(t)||c.exists((function(e){return jn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!jn(e.element,t)})).each(i)}))})),r(ay,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),oo((function(e){var n=t();ll.setValue(e,n.getData())}))])},$M=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=U(n,(function(t){return"start"===t.align})),o=function(t,e){return Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},GM=function(t,e){return{dom:AE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:La([_T.config({channel:kM,initialData:t,updateState:function(t,n){var r=V(n.buttons,(function(t){var n=Rg(function(t,e){return xS(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return x.some({lookupByName:function(t,e){return function(t,e,n){return G(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:$M})])}},XM=function(t,e){return NN.parts.footer(GM(t,e))},KM=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=wf.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return Gx.getField(n,e).fold((function(){var r=t.getFooter();return _T.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return x.some(t)}))}return x.none()},YM=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=ll.getValue(r),i=wt(n,(function(t){return t.get()}));return f(f({},o),i)},setData:function(e){r((function(r){var i=o.getData(),u=f(f({},i),e),a=function(t,e){var n=t.getRoot();return _T.getState(n).get().map((function(t){return me(de("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();ll.setValue(c,a),yt(n,(function(t,e){Tt(u,e)&&t.set(u[e])}))}))},disable:function(e){KM(t,e).each(kp.disable)},enable:function(e){KM(t,e).each(kp.enable)},focus:function(e){KM(t,e).each(Bm.focus)},block:function(t){if(!k(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Vr(e,iy,{message:t})}))},unblock:function(){r((function(t){Fr(t,uy)}))},showTab:function(e){r((function(n){var r=t.getBody();_T.getState(r).get().exists((function(t){return t.isTabPanel()}))&&wf.getCurrent(r).each((function(t){gM.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([xM],r),n.getSystem().broadcastOn([CM],r.internalDialog),n.getSystem().broadcastOn([SM],r.internalDialog),n.getSystem().broadcastOn([kM],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(t){Fr(t,ey)}))}};return o},JM=tinymce.util.Tools.resolve("tinymce.util.URI"),QM=["insertContent","setContent","execCommand","close","block","unblock"],ZM=function(t){return O(t)&&-1!==QM.indexOf(t.mceAction)},tz=function(t,e,n,r){var o,i,a,c,s,l,d,g,h=LM(t.title,r),p=(g={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[hC({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:La([Xb.config({}),Bm.config({})])})]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)})])},NN.parts.body(g)),v=t.buttons.bind((function(t){return 0===t.length?x.none():x.some(XM({buttons:t},r))})),b=(c=function(){return N},s=FM((function(){return A}),e),l=function(t,e){return Kr(t,(function(t,n){d(t,(function(r,o){e(c(),r,n.event,t)}))}))},d=function(t,e){_T.getState(t).get().each((function(n){e(n,t)}))},m(WM(l,s),[l(ry,(function(t,e,n){e.onAction(t,{name:n.name})}))])),y=f(f({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),w=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],C=new JM(t.url,{base_uri:new JM(window.location.href)}),S=C.protocol+"://"+C.host+(C.port?":"+C.port:""),T=Qe(x.none()),E=[Nm("messages",[ro((function(){var e=Tb(rn(window),"message",(function(e){if(C.isSameOrigin(new JM(e.raw.origin))){var r=e.raw.data;ZM(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!_(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,N,r):function(t){return!ZM(t)&&O(t)&&Tt(t,"mceAction")}(r)&&t.onMessage(N,r)}}));T.set(x.some(e))})),oo((function(){T.get().each((function(t){return t.unbind()}))}))]),Wa.config({channels:(o={},o[OM]={onReceive:function(t,e){zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,S)}))}},o)})],A=VM({header:h,body:p,footer:v,extraClasses:w,extraBehaviours:E,extraStyles:y},t,b,r),N=(i=A,a=function(t){i.getSystem().isConnected()&&t(i)},{block:function(t){if(!k(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a((function(e){Vr(e,iy,{message:t})}))},unblock:function(){a((function(t){Fr(t,uy)}))},close:function(){a((function(t){Fr(t,ey)}))},sendMessage:function(t){a((function(e){e.getSystem().broadcastOn([OM],t)}))}});return{dialog:A,instanceApi:N}},ez=function(t,e,n){return e&&n?[]:[uE.config({contextual:{lazyContext:function(){return x.some(ku(rn(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},nz=function(t){var e=t.backstage,n=t.editor,r=$p(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){NN.hide(c),r()},i=Rg(xS({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage)),u=NM(),a=AM(o,e.providers),c=Zi(DM({lazySink:function(){return e.getSink()},header:EM(u,a),body:RM(n,e.providers),footer:x.some(MM(zM([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,o)],eventOrder:{}}));NN.show(c);var s=i.get(c);Bm.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){NN.hide(s),r(t)},i=Rg(xS({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:x.none()},"submit",t.backstage)),u=xS({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage),a=NM(),c=AM((function(){return o(!1)}),e.providers),s=Zi(DM({lazySink:function(){return e.getSink()},header:EM(a,c),body:RM(n,e.providers),footer:x.some(MM(zM([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,(function(){return o(!1)})),Kr(oy,(function(){return o(!0)}))],eventOrder:{}}));NN.show(s);var l=i.get(s);Bm.focus(l)}}}(t),u=function(t,n){return eM.open((function(t,r,o){var i=r,u=function(t,e,n){var r=LM(t.internalDialog.title,n),o=function(t,e){var n=TM(t,x.none(),e,!1);return NN.parts.body(n)}({body:t.internalDialog.body},n),i=jM(t.internalDialog.buttons),u=UM(i),a=XM({buttons:i},n),c=qM((function(){return d}),FM((function(){return f}),e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:x.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=VM(l,t,c,n),d=YM({getRoot:function(){return f},getBody:function(){return NN.getBody(f)},getFooter:function(){return NN.getFooter(f)},getFormWrapper:function(){var t=NN.getBody(f);return wf.getCurrent(t).getOr(t)}},e.redial,u);return{dialog:f,instanceApi:d}}({dataValidator:o,initialData:i,internalDialog:t},{redial:eM.redial,closeWindow:function(){NN.hide(u.dialog),n(u.instanceApi)}},e);return NN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},a=function(t,o,i,u){return eM.open((function(t,a,c){var s,l=me(de("data",c,a)),d=(s=Qe(x.none()),{clear:function(){return s.set(x.none())},set:function(t){return s.set(x.some(t))},isSet:function(){return s.get().isSome()},on:function(t){return s.get().each(t)}}),g=e.shared.header.isPositionedAtTop(),h=function(){return d.on((function(t){vg.reposition(t),uE.refresh(t)}))},p=function(t,e,n,r){var o,i,u,a,c,s=Uo("dialog-label"),l=Uo("dialog-content"),f=Rg((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:[PM(u,x.some(a),c),IM(),BM(c)],containerBehaviours:La([mN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Du(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Rg(function(t,e,n,r){return TM(t,x.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=jM(t.internalDialog.buttons),g=UM(m),h=Rg(function(t,e){return GM(t,e)}({buttons:m},n)),p=qM((function(){return b}),{onBlock:function(t){AN.block(v,(function(e,n){return HM(t.message,n)}))},onUnblock:function(){AN.unblock(v)},onClose:function(){return e.closeWindow()}},n.shared.getSink),v=Zi({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=""+l,o)},eventOrder:(i={},i[br()]=[_T.name(),Wa.name()],i[yr()]=["execute-on-form"],i[Nr()]=["reflecting","execute-on-form"],i),behaviours:La([km.config({mode:"cyclic",onEscape:function(t){return Fr(t,ey),x.some(!0)},useTabstopAt:function(t){return!bC(t)&&("button"!==ao(t)||"disabled"!==Do(t,"disabled"))}}),_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:t}),Bm.config({}),Nm("execute-on-form",p.concat([no(or(),(function(t,e){km.focusIn(t)}))])),AN.config({getRoot:function(){return x.some(v)}}),Am.config({}),fC({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),b=YM({getRoot:function(){return v},getFooter:function(){return h.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var t=d.get(v);return wf.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:v,instanceApi:b}}({dataValidator:c,initialData:l,internalDialog:t},{redial:eM.redial,closeWindow:function(){d.on(vg.hide),n.off("ResizeEditor",h),d.clear(),i(p.instanceApi)}},e,u),v=Zi(vg.sketch(f(f({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},g?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:La(m([Nm("window-manager-inline-events",[Kr(Mr(),(function(t,e){Fr(p.dialog,ny)}))])],ez(n,r,g))),isExtraPart:function(t,e){return function(t){return Ab(t,".tox-alert-dialog")||Ab(t,".tox-confirm-dialog")}(e)}})));return d.set(v),vg.showWithin(v,o,tu(p.dialog),x.some(Ri())),r&&g||(uE.refresh(v),n.on("ResizeEditor",h)),p.instanceApi.setData(l),km.focusIn(p.dialog),p.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?a(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?a(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,r){return function(t,r){return eM.openUrl((function(t){var o=tz(t,{closeWindow:function(){NN.hide(o.dialog),r(o.instanceApi)}},n,e);return NN.show(o.dialog),o.instanceApi}),t)}(t,r)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};l.add("silver",(function(t){var e=SN(t),n=e.uiMothership,o=e.backstage,i=e.renderUI,u=e.getUi;kb(t,o.shared);var a=nz({editor:t,backstage:o});return{renderUI:i,getWindowManagerImpl:r(a),getNotificationManagerImpl:function(){return function(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),u=function(){o(),vg.hide(c)},a=Zi(Pg.sketch({text:t.text,level:I(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:x.from(t.icon),closeButton:!i,onAction:u,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),c=Zi(vg.sketch(f({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(c),t.timeout>0&&Ag.setTimeout((function(){u()}),t.timeout),{close:u,moveTo:function(t,e){vg.showAt(c,{anchor:"makeshift",x:t,y:e},tu(a))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(t){case"bc-bc":return Eg;case"tc-tc":return _g;case"tc-bc":return Sa;case"bc-tc":default:return ka}}(n),o={anchor:"node",root:Ri(),node:x.some(rn(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};vg.showAt(c,o,tu(a))}else vg.showAt(c,e.backstage.shared.anchors.banner(),tu(a))},text:function(t){Pg.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){Pg.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){j(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(nt(t).each((function(t){return t.moveRel(null,"banner")})),j(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}(0,{backstage:o},n)},ui:u()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t){return r((function(e,n){var u=Object.keys(e),a=Object.keys(n);if(!function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))}(o).eq(u,a))return!1;for(var c=u.length,s=0;s<c;s++){var l=u[s];if(!t.eq(e[l],n[l]))return!1}return!0}))},a=r((function(t,n){if(t===n)return!0;var r=e(t);return r===e(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===n:"array"===r?i(a).eq(t,n):"object"===r&&u(a).eq(t,n))})),c=function(){},s=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},l=function(t){return function(){return t}},f=function(t){return t};function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var m=function(t){return function(e){return!t(e)}},g=function(t){return function(){throw new Error(t)}},h=function(t){t()},p=l(!1),v=l(!0),b=function(){return y},y=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:e,map:b,each:c,bind:b,exists:p,forall:v,filter:b,equals:t,equals_:t,toArray:function(){return[]},toString:l("none()")}}(),w=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=function(t){return function(e){return t===e}},O=C("string"),T=C("object"),_=C("array"),E=k(null),A=S("boolean"),N=k(void 0),R=function(t){return null==t},M=function(t){return!R(t)},z=S("function"),D=S("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(t,e){return P.call(t,e)},H=function(t,e){return L(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return U(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,p)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!_(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);I.apply(e,t[n])}return e}(V(t,e))},Y=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},J=function(t){var e=B.call(t,0);return e.reverse(),e},Q=function(t,e){return W(t,(function(t){return!H(e,t)}))},Z=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},tt=function(t){return Z(t,0)},et=function(t){return Z(t,t.length-1)},nt=z(Array.from)?Array.from:function(t){return B.call(t)},rt=Object.keys,ot=Object.hasOwnProperty,it=function(t,e){for(var n=rt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ut=function(t,e){return at(t,(function(t,n){return{k:n,v:e(t,n)}}))},at=function(t,e){var n={};return it(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ct=function(t){return function(e,n){t[n]=e}},st=function(t,e,n,r){return it(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},lt=function(t,e){var n={},r={};return st(t,e,ct(n),ct(r)),{t:n,f:r}},ft=function(t,e){var n={};return st(t,e,ct(n),c),n},dt=function(t,e){return mt(t,e)?x.from(t[e]):x.none()},mt=function(t,e){return ot.call(t,e)},gt=function(t,e){return mt(t,e)&&void 0!==t[e]&&null!==t[e]},ht=Array.isArray,pt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return!1;return!0},vt=function(t,e){var n=[];return pt(t,(function(r,o){n.push(e(r,o,t))})),n},bt=function(t,e){var n=[];return pt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},yt=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},wt=function(t,e,n,r){for(var o=N(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},xt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Ct=function(t){return t[t.length-1]},St=function(){return(St=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function kt(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var Ot=function(){return Tt(0,0)},Tt=function(t,e){return{major:t,minor:e}},_t=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ot():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Tt(r(1),r(2))}(t,n)},Et=Ot,At=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},Nt=function(t,e){return-1!==t.indexOf(e)},Rt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(0,0+e.length)===e}(t,e)},Mt=function(t){return function(e){return e.replace(t,"")}},zt=Mt(/^\s+|\s+$/g),Dt=Mt(/^\s+/g),Bt=Mt(/\s+$/g),Pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,It=function(t){return function(e){return Nt(e,t)}},Lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Nt(t,"edge/")&&Nt(t,"chrome")&&Nt(t,"safari")&&Nt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pt],search:function(t){return Nt(t,"chrome")&&!Nt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Nt(t,"msie")||Nt(t,"trident")}},{name:"Opera",versionRegexes:[Pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:It("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:It("firefox")},{name:"Safari",versionRegexes:[Pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Nt(t,"safari")||Nt(t,"mobile/"))&&Nt(t,"applewebkit")}}],Ht=[{name:"Windows",search:It("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Nt(t,"iphone")||Nt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:It("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:It("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:It("linux"),versionRegexes:[]},{name:"Solaris",search:It("sunos"),versionRegexes:[]},{name:"FreeBSD",search:It("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:It("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ft={browsers:l(Lt),oses:l(Ht)},Vt="Edge",jt="Chrome",Ut="Opera",Wt="Firefox",qt="Safari",$t=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Vt),isChrome:r(jt),isIE:r("IE"),isOpera:r(Ut),isFirefox:r(Wt),isSafari:r(qt)}},Gt=function(){return $t({current:void 0,version:Et()})},Xt=$t,Kt=(l(Vt),l(jt),l("IE"),l(Ut),l(Wt),l(qt),"Windows"),Yt="Android",Jt="Linux",Qt="Solaris",Zt="FreeBSD",te="ChromeOS",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Kt),isiOS:r("iOS"),isAndroid:r(Yt),isOSX:r("OSX"),isLinux:r(Jt),isSolaris:r(Qt),isFreeBSD:r(Zt),isChromeOS:r(te)}},ne=function(){return ee({current:void 0,version:Et()})},re=ee,oe=(l(Kt),l("iOS"),l(Yt),l(Jt),l("OSX"),l(Qt),l(Zt),l(te),function(t,e){var n=Ft.browsers(),r=Ft.oses(),o=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(Gt,Xt),i=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ne,re),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,t,e);return{browser:o,os:i,deviceType:u}}),ie=function(t){return window.matchMedia(t).matches},ue=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return oe(navigator.userAgent,ie)})),ae=function(){return ue()},ce=navigator.userAgent,se=ae(),le=se.browser,fe=se.os,de=se.deviceType,me=/WebKit/.test(ce)&&!le.isEdge(),ge="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,he=-1!==ce.indexOf("Windows Phone"),pe={opera:le.isOpera(),webkit:me,ie:!(!le.isIE()&&!le.isEdge())&&le.version.major,gecko:le.isFirefox(),mac:fe.isOSX()||fe.isiOS(),iOS:de.isiPad()||de.isiPhone(),android:fe.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:le.isIE()?document.documentMode||7:10,fileApi:ge,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!le.isIE(),desktop:de.isDesktop(),windowsPhone:he,browser:{current:le.current,version:le.version,isChrome:le.isChrome,isEdge:le.isEdge,isFirefox:le.isFirefox,isIE:le.isIE,isOpera:le.isOpera,isSafari:le.isSafari},os:{current:fe.current,version:fe.version,isAndroid:fe.isAndroid,isChromeOS:fe.isChromeOS,isFreeBSD:fe.isFreeBSD,isiOS:fe.isiOS,isLinux:fe.isLinux,isOSX:fe.isOSX,isSolaris:fe.isSolaris,isWindows:fe.isWindows},deviceType:{isDesktop:de.isDesktop,isiPad:de.isiPad,isiPhone:de.isiPhone,isPhone:de.isPhone,isTablet:de.isTablet,isTouch:de.isTouch,isWebView:de.isWebView}},ve=/^\s*|\s*$/g,be=function(t){return null==t?"":(""+t).replace(ve,"")},ye=function(t,e){return e?!("array"!==e||!ht(t))||typeof t===e:void 0!==t},we=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),pt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;we(t,e,n,r)})))},xe={trim:be,isArray:ht,is:ye,toArray:function(t){if(ht(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:pt,map:vt,grep:bt,inArray:yt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=this,a=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},walk:we,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||ye(t,"array")?t:vt(t.split(e||","),be)},_addCacheSuffix:function(t){var e=pe.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Ce=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Se=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ce(n.childNodes[0])},ke=function(t,e){var n=(e||document).createElement(t);return Ce(n)},Oe=function(t,e){var n=(e||document).createTextNode(t);return Ce(n)},Te=Ce,_e=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Ee=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ae=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ne=function(t,e){return t.dom===e.dom},Re=function(t,e){return ae().browser.isIE()?function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t.dom,e.dom,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Me=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),ze=function(t){return t.dom.nodeType},De=function(t){return function(e){return ze(e)===t}},Be=De(1),Pe=De(3),Ie=De(9),Le=De(11),He=function(t){return Te(t.dom.ownerDocument)},Fe=function(t){return Ie(t)?t:He(t)},Ve=function(t){return Te(Fe(t).dom.defaultView)},je=function(t){return x.from(t.dom.parentNode).map(Te)},Ue=function(t){return x.from(t.dom.previousSibling).map(Te)},We=function(t){return x.from(t.dom.nextSibling).map(Te)},qe=function(t){return J(_e(t,Ue))},$e=function(t){return _e(t,We)},Ge=function(t){return V(t.dom.childNodes,Te)},Xe=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(Te)},Ke=function(t){return Xe(t,0)},Ye=function(t){return Xe(t,t.dom.childNodes.length-1)},Je=function(t){return Le(t)},Qe=z(Element.prototype.attachShadow)&&z(Node.prototype.getRootNode),Ze=l(Qe),tn=Qe?function(t){return Te(t.dom.getRootNode())}:Fe,en=function(t){return Je(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Te(e)}(Fe(t))},nn=function(t){return Te(t.dom.host)},rn=function(t,e){je(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},on=function(t,e){We(t).fold((function(){je(t).each((function(t){an(t,e)}))}),(function(t){rn(t,e)}))},un=function(t,e){Ke(t).fold((function(){an(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},an=function(t,e){t.dom.appendChild(e.dom)},cn=function(t,e){j(e,(function(e){an(t,e)}))},sn=function(t){t.dom.textContent="",j(Ge(t),(function(t){ln(t)}))},ln=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},fn=function(t){var e,n=Ge(t);n.length>0&&(e=t,j(n,(function(t){rn(e,t)}))),ln(t)},dn=function(t){var e=Pe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=tn(t);return Je(e)?x.some(e):x.none()}(Te(e)).fold((function(){return o.body.contains(e)}),(n=dn,r=nn,function(t){return n(r(t))}))},mn=function(t,e){return{left:t,top:e,translate:function(n,r){return mn(t+n,e+r)}}},gn=mn,hn=function(t,e){return void 0!==t?t:void 0!==e?e:0},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?gn(n.offsetLeft,n.offsetTop):dn(t)?function(t){var e=t.getBoundingClientRect();return gn(e.left,e.top)}(e):gn(0,0)},vn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return gn(n,r)},bn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},yn=function(t,e){ae().browser.isSafari()&&z(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},wn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},xn=function(t){var e=void 0===t?window:t,n=e.document,r=vn(Te(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return wn(r.left,r.top,n,o)}),(function(t){return wn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Cn=function(t){return function(e){return!!e&&e.nodeType===t}},Sn=function(t){return!!t&&!Object.getPrototypeOf(t)},kn=Cn(1),On=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return H(e,n)}return!1}},Tn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(kn(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},_n=function(t){return function(e){return kn(e)&&e.hasAttribute(t)}},En=function(t){return kn(t)&&t.hasAttribute("data-mce-bogus")},An=function(t){return kn(t)&&"TABLE"===t.tagName},Nn=function(t){return function(e){if(kn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Rn=On(["textarea","input"]),Mn=Cn(3),zn=Cn(8),Dn=Cn(9),Bn=Cn(11),Pn=On(["br"]),In=On(["img"]),Ln=Nn("true"),Hn=Nn("false"),Fn=On(["td","th"]),Vn=On(["video","audio","object","embed"]),jn=function(t){return void 0!==t.style&&z(t.style.getPropertyValue)},Un=function(t,e,n){if(!(O(n)||A(n)||D(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Wn=function(t,e,n){Un(t.dom,e,n)},qn=function(t,e){var n=t.dom;it(e,(function(t,e){Un(n,e,t)}))},$n=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Gn=function(t,e){return x.from($n(t,e))},Xn=function(t,e){t.dom.removeAttribute(e)},Kn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||dn(t)?r:Yn(n,e)},Yn=function(t,e){return jn(t)?t.style.getPropertyValue(e):""},Jn=function(t,e){var n=t.dom,r=Yn(n,e);return x.from(r).filter((function(t){return t.length>0}))},Qn=function(t){var e={},n=t.dom;if(jn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Zn=ae().browser,tr=function(t){return G(t,Be)},er=function(t,e){return t.children&&H(t.children,e)},nr={},rr={exports:nr};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,nr,rr);var or=rr.exports.boltExport,ir=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return ir((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ur={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ar=function(t){setTimeout((function(){throw t}),0)},cr=function(t){var e=function(e){t().then(e,ar)};return{map:function(e){return cr((function(){return t().then(e)}))},bind:function(e){return cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sr=function(t){return cr((function(){return new or(t)}))},lr=function(t){return{is:function(e){return t===e},isValue:v,isError:p,getOr:l(t),getOrThunk:l(t),getOrDie:l(t),or:function(e){return lr(t)},orThunk:function(e){return lr(t)},fold:function(e,n){return n(t)},map:function(e){return lr(e(t))},mapError:function(e){return lr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},fr=function(t){return{is:p,isValue:p,isError:v,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return g(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return fr(t)},mapError:function(e){return fr(e(t))},each:c,bind:function(e){return fr(t)},exists:p,forall:v,toOptional:x.none}},dr={value:lr,error:fr,fromOption:function(t,e){return t.fold((function(){return fr(e)}),lr)}},mr=function(t){if(!_(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=rt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!_(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=rt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!Y(e,(function(t){return H(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},gr=(mr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(f,f)});function hr(t,e,n,r,o){return t(n,r)?x.some(n):z(o)&&o(n)?x.none():e(n,r,o)}var pr,vr=function(t,e,n){for(var r=t.dom,o=z(n)?n:p;r.parentNode;){r=r.parentNode;var i=Te(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},br=function(t,e,n){return hr((function(t,e){return e(t)}),vr,t,e,n)},yr=function(t,e,n){return vr(t,(function(t){return Ee(t,e)}),n)},wr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?x.none():x.from(n.querySelector(t)).map(Te)}(e,t)},xr=function(t,e,n){return hr((function(t,e){return Ee(t,e)}),yr,t,e,n)},Cr=window.Promise?window.Promise:function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(e,t(i,this),t(u,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};function o(t){var e=this;null!==this._state?r((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function i(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void s(t(n,e),t(i,this),t(u,this))}this._state=!0,this._value=e,a.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n((function(n,i){o.call(r,new c(t,e,n,i))}))},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new n((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}t[i]=u,0==--r&&e(t)}catch(t){n(t)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.race=function(t){return new n((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},n}(),Sr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},kr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Or=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Sr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Tr={requestAnimationFrame:function(t,e){pr?pr.then(t):pr=new Cr((function(t){e||(e=document.body),function(t,e){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(t){window.setTimeout(t,0)}),r(t,e)}(t,e)})).then(t)},setTimeout:Sr,setInterval:kr,setEditorTimeout:function(t,e,n){return Sr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=kr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Or,throttle:Or,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}};function _r(t,e){void 0===e&&(e={});var n=0,r={},o=Te(t),i=Fe(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=xe._addCacheSuffix(a),d=function(t){return dt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?Tr.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=ke("link",i.dom);qn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Wn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Wn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,an(en(o),b),Wn(v,"href",f)}else h();else g()},c=function(t){return sr((function(e){a(t,s(e,l(dr.value(t))),s(e,l(dr.error(t))))}))},f=function(t){var e=xe._addCacheSuffix(t);dt(r,e).each((function(t){var n,i;0==--t.count&&(delete r[e],n=t.id,i=en(o),wr(i,"#"+n).each(ln))}))};return{load:a,loadAll:function(t,e,n){var r;(r=V(t,c),function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):j(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))}(r,sr)).get((function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(gr)):e(r.pass.map(gr))}))},unload:f,unloadAll:function(t){j(t,(function(t){f(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var Er=function(){var t=new WeakMap;return{forElement:function(e,n){var r=tn(e).dom;return x.from(t.get(r)).getOrThunk((function(){var e=_r(r,n);return t.set(r,e),e}))}}}(),Ar=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Nr=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,v)).hasOwnProperty(Me(n))}},Rr=Nr(["h1","h2","h3","h4","h5","h6"]),Mr=Nr(["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"]),zr=function(t){return Be(t)&&!Mr(t)},Dr=function(t){return Be(t)&&"br"===Me(t)},Br=Nr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Pr=Nr(["ul","ol","dl"]),Ir=Nr(["li","dd","dt"]),Lr=Nr(["thead","tbody","tfoot"]),Hr=Nr(["td","th"]),Fr=Nr(["pre","script","textarea","style"]),Vr=" ",jr="\ufeff",Ur=function(t){return"\ufeff"===t},Wr=function(t){return t.replace(/\uFEFF/g,"")},qr=kn,$r=Mn,Gr=function(t){return $r(t)&&(t=t.parentNode),qr(t)&&t.hasAttribute("data-mce-caret")},Xr=function(t){return $r(t)&&Ur(t.data)},Kr=function(t){return Gr(t)||Xr(t)},Yr=function(t){return t.firstChild!==t.lastChild||!Pn(t.firstChild)},Jr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset())===jr||t.isAtStart()&&Xr(e.previousSibling))},Qr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset()-1)===jr||t.isAtEnd()&&Xr(e.nextSibling))},Zr=function(t){return $r(t)&&t.data[0]===jr},to=function(t){return $r(t)&&t.data[t.data.length-1]===jr},eo=function(t){return t&&t.hasAttribute("data-mce-caret")?(n=(e=t.getElementsByTagName("br"))[e.length-1],En(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},no=Ln,ro=Hn,oo=Pn,io=Mn,uo=On(["script","style","textarea"]),ao=On(["img","input","textarea","hr","iframe","video","audio","object","embed"]),co=On(["table"]),so=Kr,lo=function(t){return!so(t)&&(io(t)?!uo(t.parentNode):ao(t)||oo(t)||co(t)||fo(t))},fo=function(t){return!1===function(t){return kn(t)&&"true"===t.getAttribute("unselectable")}(t)&&ro(t)},mo=function(t,e){return lo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(fo(t))return!1;if(no(t))return!0}return!0}(t,e)},go=/^[ \t\r\n]*$/,ho=function(t){return go.test(t)},po=function(t,e){return lo(t)&&!1===function(t,e){return Mn(t)&&ho(t.data)&&!1===function(t,e){var n,r,o=Te(e);return n=Te(t),r=d(Ne,o),yr(n,"pre,code",r).isSome()}(t,e)}(t,e)||function(t){return kn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||vo(t)},vo=_n("data-mce-bookmark"),bo=_n("data-mce-bogus"),yo=("data-mce-bogus","all",function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}),wo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(po(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new Ar(n,t);do{if(e){if(yo(n)){n=o.next(!0);continue}if(bo(n)){n=o.next();continue}}if(Pn(n))r++,n=o.next();else{if(po(n,t))return!1;n=o.next()}}while(n);return r<=1}(t.dom,e)},xo=function(t,e){return M(t)&&(po(t,e)||zr(Te(t)))},Co=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},So=function(t,e,n){var r=n||e;if(kn(e)&&Co(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)So(t,o[i],r);if(kn(e)){var u=e.childNodes;1===u.length&&Co(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Bn(t)||Dn(t)}(e)||po(e,r)||function(t){return!!kn(t)&&t.childNodes.length>0}(e)||function(t,e){return Mn(t)&&t.data.length>0&&function(t,e){var n=new Ar(t,e).prev(!1),r=new Ar(t,e).next(!1),o=N(n)||xo(n,e),i=N(r)||xo(r,e);return o&&i}(t,e)}(e,r)||t.remove(e),e},ko=xe.makeMap,Oo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,To=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_o=/[<>&\"\']/g,Eo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ao={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:"Ÿ"},No={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Ro={"<":"<",">":">","&":"&",""":'"',"'":"'"},Mo=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),No[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},zo=Mo("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),Do=function(t,e){return t.replace(e?Oo:To,(function(t){return No[t]||t}))},Bo=function(t,e){return t.replace(e?Oo:To,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":No[t]||"&#"+t.charCodeAt(0)+";"}))},Po=function(t,e,n){return n=n||zo,t.replace(e?Oo:To,(function(t){return No[t]||n[t]||t}))},Io={encodeRaw:Do,encodeAllRaw:function(t){return(""+t).replace(_o,(function(t){return No[t]||t}))},encodeNumeric:Bo,encodeNamed:Po,getEncodeFunc:function(t,e){var n=Mo(e)||zo,r=ko(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Oo:To,(function(t){return void 0!==No[t]?No[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Po(t,e,n)}:Po:r.numeric?Bo:Do},decode:function(t){return t.replace(Eo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Ao[e]||String.fromCharCode(e):Ro[t]||zo[t]||function(t){var e=ke("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},Lo={},Ho={},Fo=xe.makeMap,Vo=xe.each,jo=xe.extend,Uo=xe.explode,Wo=xe.inArray,qo=function(t,e){return(t=xe.trim(t))?t.split(e||" "):[]},$o=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Vo(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Fo(t,/[, ]/):Uo(t,/[, ]/)}))),n};function Go(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=Fo(o,/[, ]/,Fo(o.toUpperCase(),/[, ]/)):(o=Lo[e])||(o=Fo(n," ",Fo(n.toUpperCase()," ")),o=jo(o,r),Lo[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=qo(r));var s=qo(t);for(o=s.length;o--;)u={attributes:c(i=qo([e,n].join(" "))),attributesOrder:i,children:c(r,Ho)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=qo(t);n=u.length;for(var c=qo(e);n--;)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return Lo[t]?Lo[t]:(e="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"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),Vo(qo(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Vo(qo(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("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),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("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"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Vo(qo("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,Lo[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=$o(t.valid_styles),s=$o(t.invalid_styles,"map"),l=$o(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h="td th iframe video audio object script code",p=u("non_empty_elements",h+" pre",m),v=u("move_caret_before_on_enter_elements",h+" table",m),b=u("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"),y=u("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",b),w=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");Vo((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=qo(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(p=a[1],f=a[2],v=a[3],l=a[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(it(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=qo(l,"|")).length;i<u;i++)if(a=S.exec(l[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],w=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(Wo(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===p&&(s.validValues=Fo(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=x(f),r.push(c)):e[f]=c}}},S=function(t){e={},r=[],C(t),Vo(a,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(Lo.text_block_elements=Lo.block_elements=null,Vo(qo(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[a];delete(s=jo({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Vo(n,(function(t,e){t[a]&&(n[e]=t=jo({},n[e]),t[c]=t[a])}))})))},O=function(e){var r=/^([+\-]?)([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]+)\[([^\]]+)]$/;Lo[t.schema]=null,e&&Vo(qo(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Vo(qo(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},T=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};return t.valid_elements?S(t.valid_elements):(Vo(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Vo(qo("strong/b em/i"),(function(t){var n=qo(t,"/");e[n[1]].outputName=n[0]})),Vo(qo("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Vo(qo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Vo(qo("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Vo({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"},(function(t,n){e[n]&&(e[n].parentsRequired=qo(t))})),t.invalid_elements&&Vo(Uo(t.invalid_elements),(function(t){e[t]&&delete e[t]})),T("span")||C("span[!data-mce-type|*]"),{children:n,elements:e,getValidStyles:function(){return c},getValidClasses:function(){return l},getBlockElements:function(){return y},getInvalidStyles:function(){return s},getShortEndedElements:function(){return m},getTextBlockElements:function(){return b},getTextInlineElements:function(){return w},getBoolAttrs:function(){return g},getElementRule:T,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return p},getMoveCaretBeforeOnEnterElements:function(){return v},getWhiteSpaceElements:function(){return f},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=T(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}}var Xo,Ko,Yo,Jo,Qo,Zo,ti,ei,ni,ri,oi,ii,ui,ai,ci,si,li,fi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},di=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,a=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<l.length;n++)s[l[n]]="\ufeff"+n,s["\ufeff"+n]=l[n];return{toHex:function(t){return t.replace(i,fi)},parse:function(e){var r,o,l,f,d,m,g,h={},p=t.url_converter,v=t.url_converter_scope||this,b=function(t,e,r){var o=h[t+"-top"+e];if(o){var i=h[t+"-right"+e];if(i){var u=h[t+"-bottom"+e];if(u){var a=h[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(h[t+e]=-1===n?c[0]:c.join(" "),delete h[t+"-top"+e],delete h[t+"-right"+e],delete h[t+"-bottom"+e],delete h[t+"-left"+e])}}}}},y=function(t){var e,n=h[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return h[t]=n[0],!0}},w=function(t){return f=!0,s[t]},x=function(t,e){return f&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return s[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},C=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},S=function(t){return t.replace(/\\[0-9a-f]+/gi,C)},k=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=x(i)).replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return p&&(n=p.call(v,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));r=a.exec(e);)if(a.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),l=r[2].replace(c,""),o&&l){if(o=S(o),l=S(l),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===o&&"700"===l?l="bold":"color"!==o&&"background-color"!==o||(l=l.toLowerCase()),l=(l=l.replace(i,fi)).replace(u,k),h[o]=f?x(l,!0):l}b("border","",!0),b("border","-width"),b("border","-color"),b("border","-style"),b("padding",""),b("margin",""),"border",m="border-style",g="border-color",y(d="border-width")&&y(m)&&y(g)&&(h.border=h[d]+" "+h[m]+" "+h[g],delete h[d],delete h[m],delete h[g]),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):it(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},mi=/^(?:mouse|contextmenu)|click/,gi={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},hi=function(){return!1},pi=function(){return!0},vi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},bi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},yi=function(t,e){var n,r=e||{};for(n in t)gi[n]||(r[n]=t[n]);if(r.target||(r.target=r.srcElement||document),r.composedPath&&(r.composedPath=function(){return t.composedPath()}),t&&function(t){return mi.test(t.type)}(t)&&void 0===t.pageX&&void 0!==t.clientX){var o=r.target.ownerDocument||document,i=o.documentElement,u=o.body;r.pageX=t.clientX+(i&&i.scrollLeft||u&&u.scrollLeft||0)-(i&&i.clientLeft||u&&u.clientLeft||0),r.pageY=t.clientY+(i&&i.scrollTop||u&&u.scrollTop||0)-(i&&i.clientTop||u&&u.clientTop||0)}return r.preventDefault=function(){r.isDefaultPrevented=pi,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},r.stopPropagation=function(){r.isPropagationStopped=pi,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=pi,r.stopPropagation()},!1===function(t){return t.isDefaultPrevented===pi||t.isDefaultPrevented===hi}(r)&&(r.isDefaultPrevented=hi,r.isPropagationStopped=hi,r.isImmediatePropagationStopped=hi),void 0===r.metaKey&&(r.metaKey=!1),r},wi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){bi(t,"DOMContentLoaded",i),bi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():vi(t,"DOMContentLoaded",i),n.domLoaded||vi(t,"load",i)}},xi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(yi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,yi({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=yi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=yi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(yi({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?wi(t,s,f):vi(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],bi(t,r.fakeName||u,r.nativeHandler,r.capture))}}else it(a,(function(e,n){bi(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(mt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=yi(null,n);o.type=e,o.target=t;do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Ci="sizzle"+-new Date,Si=window.document,ki=0,Oi=0,Ti=iu(),_i=iu(),Ei=iu(),Ai=function(t,e){return t===e&&(ri=!0),0},Ni="undefined",Ri=1<<31,Mi={}.hasOwnProperty,zi=[],Di=zi.pop,Bi=zi.push,Pi=zi.push,Ii=zi.slice,Li=zi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Hi="[\\x20\\t\\r\\n\\f]",Fi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Vi="\\[[\\x20\\t\\r\\n\\f]*("+Fi+")(?:"+Hi+"*([*^$|!~]?=)"+Hi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Fi+"))|)"+Hi+"*\\]",ji=":("+Fi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Vi+")*)|.*)\\)|)",Ui=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),Wi=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),qi=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),$i=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),Gi=new RegExp(ji),Xi=new RegExp("^"+Fi+"$"),Ki={ID:new RegExp("^#("+Fi+")"),CLASS:new RegExp("^\\.("+Fi+")"),TAG:new RegExp("^("+Fi+"|[*])"),ATTR:new RegExp("^"+Vi),PSEUDO:new RegExp("^"+ji),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Yi=/^(?:input|select|textarea|button)$/i,Ji=/^h\d$/i,Qi=/^[^{]+\{\s*\[native \w/,Zi=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tu=/[+~]/,eu=/'|\\/g,nu=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ru=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Pi.apply(zi=Ii.call(Si.childNodes),Si.childNodes),zi[Si.childNodes.length].nodeType}catch(t){Pi={apply:zi.length?function(t,e){Bi.apply(t,Ii.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var ou=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Si)!==ii&&oi(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||ii).nodeType)&&9!==a)return[];if(ai&&!r){if(o=Zi.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&li(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Pi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&Xo.getElementsByClassName)return Pi.apply(n,e.getElementsByClassName(u)),n}if(Xo.qsa&&(!ci||!ci.test(t))){if(f=l=Ci,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Qo(t),(l=e.getAttribute("id"))?f=l.replace(eu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+fu(s[c]);d=tu.test(t)&&su(e.parentNode)||e,m=s.join(",")}if(m)try{return Pi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return ti(t.replace(Ui,"$1"),e,n,r)};function iu(){var t=[];return function e(n,r){return t.push(n+" ")>Ko.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function uu(t){return t[Ci]=!0,t}function au(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Ri)-(~t.sourceIndex||Ri);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function cu(t){return uu((function(e){return e=+e,uu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function su(t){return t&&typeof t.getElementsByTagName!==Ni&&t}function lu(){}function fu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function du(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Oi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[ki,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Ci]||(e[Ci]={}))[r])&&a[0]===ki&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function mu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function gu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function hu(t,e,n,r,o,i){return r&&!r[Ci]&&(r=hu(r)),o&&!o[Ci]&&(o=hu(o,i)),uu((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ou(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:gu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=gu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?Li.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=gu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Pi.apply(u,v)}))}function pu(t){for(var e,n,r,o=t.length,i=Ko.relative[t[0].type],u=i||Ko.relative[" "],a=i?1:0,c=du((function(t){return t===e}),u,!0),s=du((function(t){return Li.call(e,t)>-1}),u,!0),l=[function(t,n,r){return!i&&(r||n!==ei)||((e=n).nodeType?c(t,n,r):s(t,n,r))}];a<o;a++)if(n=Ko.relative[t[a].type])l=[du(mu(l),n)];else{if((n=Ko.filter[t[a].type].apply(null,t[a].matches))[Ci]){for(r=++a;r<o&&!Ko.relative[t[r].type];r++);return hu(a>1&&mu(l),a>1&&fu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Ui,"$1"),n,a<r&&pu(t.slice(a,r)),r<o&&pu(t=t.slice(r)),r<o&&fu(t))}l.push(n)}return mu(l)}Xo=ou.support={},Jo=ou.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},oi=ou.setDocument=function(t){var e,n=t?t.ownerDocument||t:Si,r=n.defaultView;return n!==ii&&9===n.nodeType&&n.documentElement?(ii=n,ui=n.documentElement,ai=!Jo(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){oi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){oi()}))),Xo.attributes=!0,Xo.getElementsByTagName=!0,Xo.getElementsByClassName=Qi.test(n.getElementsByClassName),Xo.getById=!0,Ko.find.ID=function(t,e){if(typeof e.getElementById!==Ni&&ai){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Ko.filter.ID=function(t){var e=t.replace(nu,ru);return function(t){return t.getAttribute("id")===e}},Ko.find.TAG=Xo.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Ni)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Ko.find.CLASS=Xo.getElementsByClassName&&function(t,e){if(ai)return e.getElementsByClassName(t)},si=[],ci=[],Xo.disconnectedMatch=!0,ci=ci.length&&new RegExp(ci.join("|")),si=si.length&&new RegExp(si.join("|")),e=Qi.test(ui.compareDocumentPosition),li=e||Qi.test(ui.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ai=e?function(t,e){if(t===e)return ri=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Xo.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Si&&li(Si,t)?-1:e===n||e.ownerDocument===Si&&li(Si,e)?1:ni?Li.call(ni,t)-Li.call(ni,e):0:4&r?-1:1)}:function(t,e){if(t===e)return ri=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:ni?Li.call(ni,t)-Li.call(ni,e):0;if(i===u)return au(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?au(a[o],c[o]):a[o]===Si?-1:c[o]===Si?1:0},n):ii},ou.matches=function(t,e){return ou(t,null,null,e)},ou.matchesSelector=function(t,e){if((t.ownerDocument||t)!==ii&&oi(t),e=e.replace($i,"='$1']"),Xo.matchesSelector&&ai&&(!si||!si.test(e))&&(!ci||!ci.test(e)))try{var n=(void 0).call(t,e);if(n||Xo.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return ou(e,ii,null,[t]).length>0},ou.contains=function(t,e){return(t.ownerDocument||t)!==ii&&oi(t),li(t,e)},ou.attr=function(t,e){(t.ownerDocument||t)!==ii&&oi(t);var n=Ko.attrHandle[e.toLowerCase()],r=n&&Mi.call(Ko.attrHandle,e.toLowerCase())?n(t,e,!ai):void 0;return void 0!==r?r:Xo.attributes||!ai?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},ou.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ou.uniqueSort=function(t){var e,n=[],r=0,o=0;if(ri=!Xo.detectDuplicates,ni=!Xo.sortStable&&t.slice(0),t.sort(Ai),ri){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return ni=null,t},Yo=ou.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Yo(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Yo(e);return n},(Ko=ou.selectors={cacheLength:50,createPseudo:uu,match:Ki,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(nu,ru),t[3]=(t[3]||t[4]||t[5]||"").replace(nu,ru),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ou.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ou.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Ki.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Gi.test(n)&&(e=Qo(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(nu,ru).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Ti[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+Hi+"|$)"))&&Ti(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Ni&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=ou.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[Ci]||(p[Ci]={}))[t]||[])[0]===ki&&s[1],d=s[0]===ki&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[ki,m,d];break}}else if(b&&(s=(e[Ci]||(e[Ci]={}))[t])&&s[0]===ki)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ci]||(f[Ci]={}))[t]=[ki,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Ko.pseudos[t]||Ko.setFilters[t.toLowerCase()]||ou.error("unsupported pseudo: "+t);return r[Ci]?r(e):r.length>1?(n=[t,t,"",e],Ko.setFilters.hasOwnProperty(t.toLowerCase())?uu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Li.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:uu((function(t){var e=[],n=[],r=Zo(t.replace(Ui,"$1"));return r[Ci]?uu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:uu((function(t){return function(e){return ou(t,e).length>0}})),contains:uu((function(t){return t=t.replace(nu,ru),function(e){return(e.textContent||e.innerText||Yo(e)).indexOf(t)>-1}})),lang:uu((function(t){return Xi.test(t||"")||ou.error("unsupported lang: "+t),t=t.replace(nu,ru).toLowerCase(),function(e){var n;do{if(n=ai?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===ui},focus:function(t){return t===ii.activeElement&&(!ii.hasFocus||ii.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Ko.pseudos.empty(t)},header:function(t){return Ji.test(t.nodeName)},input:function(t){return Yi.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:cu((function(){return[0]})),last:cu((function(t,e){return[e-1]})),eq:cu((function(t,e,n){return[n<0?n+e:n]})),even:cu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:cu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:cu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:cu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Ko.pseudos.eq,j(["radio","checkbox","file","password","image"],(function(t){Ko.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),j(["submit","reset"],(function(t){Ko.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),lu.prototype=Ko.filters=Ko.pseudos,Ko.setFilters=new lu,Qo=ou.tokenize=function(t,e){var n,r,o,i,u,a,c,s=_i[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=Ko.preFilter;u;){for(i in n&&!(r=Wi.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=qi.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Ui," ")}),u=u.slice(n.length)),Ko.filter)Ko.filter.hasOwnProperty(i)&&(!(r=Ki[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?ou.error(t):_i(t,a).slice(0)},Zo=ou.compile=function(t,e){var n,r=[],o=[],i=Ei[t+" "];if(!i){for(e||(e=Qo(t)),n=e.length;n--;)(i=pu(e[n]))[Ci]?r.push(i):o.push(i);(i=Ei(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=ei,v=o||r&&Ko.find.TAG("*",c),b=ki+=null==p?1:Math.random()||.1,y=v.length;for(c&&(ei=i!==ii&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(ki=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Di.call(a));h=gu(h)}Pi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&ou.uniqueSort(a)}return c&&(ki=b,ei=p),g};return n?uu(o):o}(o,r))).selector=t}return i},ti=ou.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Qo(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&Xo.getById&&9===e.nodeType&&ai&&Ko.relative[i[1].type]){if(!(e=(Ko.find.ID(u.matches[0].replace(nu,ru),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=Ki.needsContext.test(t)?0:i.length;o--&&(u=i[o],!Ko.relative[a=u.type]);)if((c=Ko.find[a])&&(r=c(u.matches[0].replace(nu,ru),tu.test(i[0].type)&&su(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&fu(i)))return Pi.apply(n,r),n;break}}return(s||Zo(t,l))(r,e,!ai,n,tu.test(t)&&su(e.parentNode)||e),n},Xo.sortStable=Ci.split("").sort(Ai).join("")===Ci,Xo.detectDuplicates=!!ri,oi(),Xo.sortDetached=!0;var vu=document,bu=Array.prototype.push,yu=Array.prototype.slice,wu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,xu=xi.Event,Cu=xe.makeMap("children,contents,next,prev"),Su=function(t){return void 0!==t},ku=function(t){return"string"==typeof t},Ou=function(t,e){var n,r=(e=e||vu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Tu=function(t,e,n,r){var o;if(ku(e))e=Ou(e,Fu(t[0]));else if(e.length&&!e.nodeType){if(e=Wu.makeArray(e),r)for(o=e.length-1;o>=0;o--)Tu(t,e[o],n,r);else for(o=0;o<e.length;o++)Tu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},_u=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Eu=function(t,e,n){var r,o;return e=Wu(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Au=xe.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Nu=xe.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ru={for:"htmlFor",class:"className",readonly:"readOnly"},Mu={float:"cssFloat"},zu={},Du={},Bu=function(t,e){return new Wu.fn.init(t,e)},Pu=/^\s*|\s*$/g,Iu=function(t){return null==t?"":(""+t).replace(Pu,"")},Lu=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Hu=function(t,e){var n=[];return Lu(t,(function(t,r){e(r,t)&&n.push(r)})),n},Fu=function(t){return t?9===t.nodeType?t:t.ownerDocument:vu};Bu.fn=Bu.prototype={constructor:Bu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return Wu(t).attr(e);o.context=e=document}if(ku(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:wu.exec(t)))return Wu(e).find(t);if(n[1])for(r=Ou(t,Fu(e)).firstChild;r;)bu.call(o,r),r=r.nextSibling;else{if(!(r=Fu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return xe.toArray(this)},add:function(t,e){var n,r,o=this;if(ku(t))return o.add(Wu(t));if(!1!==e)for(n=Wu.unique(o.toArray().concat(Wu.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else bu.apply(o,Wu.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)Lu(t,(function(t,e){r.attr(t,e)}));else{if(!Su(e)){if(r[0]&&1===r[0].nodeType){if((n=zu[t])&&n.get)return n.get(r[0],t);if(Nu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=zu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ru[t]||t))Lu(t,(function(t,e){n.prop(t,e)}));else{if(!Su(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)Lu(t,(function(t,e){o.css(t,e)}));else if(Su(e))t=i(t),"number"!=typeof e||Au[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Du[t])&&r.set)r.set(this,e);else{try{this.style[Mu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Du[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],xu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if(Su(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){Wu(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(Su(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Wu(t).append(this),this},prependTo:function(t){return Wu(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Eu(this,t)},wrapAll:function(t){return Eu(this,t,!0)},wrapInner:function(t){return this.each((function(){Wu(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Wu(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Wu(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?Lu(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=_u(r,t);if(o!==e){var i=r.className;o?r.className=Iu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return _u(this[0],t)},each:function(t){return Lu(this,t)},on:function(t,e){return this.each((function(){xu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){xu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?xu.fire(this,t.type,t):xu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Wu(yu.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Wu.find(t,this[e],r);return Wu(r)},filter:function(t){return Wu("function"==typeof t?Hu(this.toArray(),(function(e,n){return t(n,e)})):Wu.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Wu&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Wu(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Wu(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:bu,sort:Array.prototype.sort,splice:Array.prototype.splice},xe.extend(Bu,{extend:xe.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:xe.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:xe.isArray,each:Lu,trim:Iu,grep:Hu,find:ou,expr:ou.selectors,unique:ou.uniqueSort,text:ou.getText,contains:ou.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?Wu.find.matchesSelector(e[0],t)?[e[0]]:[]:Wu.find.matches(t,e)}});var Vu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Wu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Wu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},ju=function(t,e,n,r){var o=[];for(r instanceof Wu&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Wu(t).is(r))break}o.push(t)}return o},Uu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Lu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Vu(t,"parentNode")},next:function(t){return Uu(t,"nextSibling",1)},prev:function(t){return Uu(t,"previousSibling",1)},children:function(t){return ju(t.firstChild,"nextSibling",1)},contents:function(t){return xe.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Bu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Wu.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Cu[t]||(r=Wu.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Wu(r);return n?o.filter(n):o}})),Lu({parentsUntil:function(t,e){return Vu(t,"parentNode",e)},nextUntil:function(t,e){return ju(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return ju(t,"previousSibling",1,e).slice(1)}},(function(t,e){Bu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Wu.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Wu.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Wu(o);return r?i.filter(r):i}})),Bu.fn.is=function(t){return!!t&&this.filter(t).length>0},Bu.fn.init.prototype=Bu.fn,Bu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Wu.extend(n,this),n},Bu.attrHooks=zu,Bu.cssHooks=Du;var Wu=Bu,qu=xe.each,$u=xe.grep,Gu=pe.ie,Xu=/^([a-z0-9],?)+$/i,Ku=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Yu=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function Ju(t,e){var n=this;void 0===e&&(e={});var r={},o=window,i={},u=0,a=Er.forElement(Te(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],l=e.schema?e.schema:Go({}),f=di({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new xi:xi.Event,m=l.getBlockElements(),g=Wu.overrideDefaults((function(){return{context:t,element:W.getRoot()}})),h=function(e){return e&&t&&O(e)?t.getElementById(e):e},p=function(t){return g("string"==typeof t?h(t):t)},v=function(t,e,n){var r,o,i=p(t);return i.length&&(o=(r=q[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=h(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=p(t),i=o.attr(n);if(o.length){var u=q[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return function(t,e,n){var r,o,i=0,u=0,a=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Kn(Te(t),"position"))return{x:i=(o=e.getBoundingClientRect()).left+(a.documentElement.scrollLeft||t.scrollLeft)-a.documentElement.clientLeft,y:u=o.top+(a.documentElement.scrollTop||t.scrollTop)-a.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!er(r,n);)i+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!er(r,n);)i-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=function(t){return Zn.isFirefox()&&"table"===Me(t)?tr(Ge(t)).filter((function(t){return"caption"===Me(t)})).bind((function(t){return tr($e(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Te(e))}return{x:i,y:u}}(t.body,h(e),n)},C=function(t,e,n){var r=p(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=pe.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},S=function(t){var e,n;return t=h(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Xu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return ou(e,i[0].ownerDocument||i[0],null,i).length>0},T=function(t,e,n,r){var o,i=[],u=h(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),xe.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return k(t,o)});u&&!(u===n||R(u.nodeType)||Dn(u)||Bn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},E=function(t,e,r){var o,i="string"==typeof t?h(t):t;if(!i)return!1;if(xe.isArray(i)&&(i.length||0===i.length))return o=[],qu(i,(function(t,n){t&&o.push(e.call(r,"string"==typeof t?h(t):t,n))})),o;var u=r||n;return e.call(u,i)},A=function(t,e){p(t).each((function(t,n){qu(e,(function(t,e){y(n,e,t)}))}))},N=function(t,e){var n=p(t);Gu?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Wu("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},M=function(e,n,r,o,i){return E(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&N(u,o)),i?u:e.appendChild(u)}))},z=function(e,n,r){return M(t.createElement(e),e,n,r,!0)},D=Io.encodeAllRaw,B=function(t,e){var n=p(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){p(t).toggleClass(e,n).each((function(){""===this.className&&Wu(this).attr("class",null)}))},I=function(t,e,n){return E(e,(function(e){return xe.is(e,"array")&&(t=t.cloneNode(!0)),n&&qu($u(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(kn(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,r,i,u){if(xe.isArray(n)){for(var a=n.length,c=[];a--;)c[a]=F(n[a],r,i,u);return c}return!e.collect||n!==t&&n!==o||s.push([n,r,i,u]),d.bind(n,r,i,u||W)},V=function(e,n,r){if(xe.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,r);return u}if(s.length>0&&(e===t||e===o))for(i=s.length;i--;){var a=s[i];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||d.unbind(a[0],a[1],a[2])}return d.unbind(e,n,r)},U=function(t){if(t&&kn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},W={doc:t,settings:e,win:o,files:i,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:s,styles:f,schema:l,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:g,$$:p,root:null,clone:function(e,n){if(!Gu||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return qu(b(e),(function(t){y(r,t.nodeName,v(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=xn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=h(t);var e=x(t),n=S(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:S,getParent:function(t,e,n){var r=T(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:T,get:h,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return ou(n,h(r)||e.root_element||t,[])},is:k,add:M,create:z,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+D(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=O(n)?p(t).css(n,r):p(t).css(n);e.update_styles&&Ku(f,o)},getStyle:C,setStyles:function(t,n){var r=p(t).css(n);e.update_styles&&Ku(f,r)},removeAllAttribs:function(t){return E(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(t){return f.parse(t)},serializeStyle:function(t,e){return f.serialize(t,e)},addStyle:function(e){var n,o;if(W!==Ju.DOM&&t===document){if(r[e])return;r[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(n=t.getElementsByTagName("head")[0]).firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),j(t.split(","),(function(t){i[t]=!0,a.load(t,c)}))},addClass:function(t,e){p(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return p(t).hasClass(e)},toggleClass:P,show:function(t){p(t).show()},hide:function(t){p(t).hide()},isHidden:function(t){return"none"===p(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?h(t):t;return kn(e)?e.outerHTML:Wu("<div></div>").append(Wu(e).clone()).html()},setOuterHTML:function(t,e){p(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Wu(this).html(e),!0)}))},decode:Io.decode,encode:D,insertAfter:function(t,e){var n=h(e);return E(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=z(e),qu(b(t),(function(e){y(n,e.nodeName,v(t,e.nodeName))})),I(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return f.toHex(xe.trim(t))},run:E,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Ar(t,t.parentNode),u=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,kn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!ho(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&ho(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:Yu,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,Yu(t)),u.setEnd(e.parentNode,Yu(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,Yu(e)+1),u.setEnd(t.parentNode,Yu(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(So(W,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(So(W,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:U,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=U(t));t=t.parentNode);return n},destroy:function(){if(s.length>0)for(var t=s.length;t--;){var e=s[t];d.unbind(e[0],e[1],e[2])}it(i,(function(t,e){a.unload(e),delete i[e]})),ou.setDocument&&ou.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},q=function(t,e,n){var r=e.keep_values,o={set:function(t,n,r){e.url_converter&&(n=e.url_converter.call(e.url_converter_scope||W,n,r,t[0])),t.attr("data-mce-"+r,n).attr(r,n)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(f,e);return W}!function(t){t.DOM=t(document),t.nodeIndex=Yu}(Ju||(Ju={}));var Qu=Ju,Zu=Qu.DOM,ta=xe.each,ea=xe.grep,na=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=Zu,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=xe._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),z(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ta(o.scriptLoadedCallbacks[e],(function(e){z(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=ea(t);if(t.length=0,ta(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ta(n,(function(t){0===i.length?z(t.success)&&t.success.call(t.scope):z(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),ra=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},oa={},ia=ra("en"),ua=function(){return dt(oa,ia.get())},aa={getData:function(){return ut(oa,(function(t){return St({},t)}))},setCode:function(t){t&&ia.set(t)},getCode:function(){return ia.get()},add:function(t,e){var n=oa[t];n||(oa[t]=n={}),it(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=ua().getOr({}),r=function(t){return z(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return dt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(T(e=t)&&mt(e,"raw"))return r(t.raw);if(function(t){return _(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return mt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return ua().bind((function(t){return dt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return mt(oa,t)}};function ca(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=W(o,(function(n){return n.name===t&&n.state===e}));j(n,(function(t){return t.callback()}))},u=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},c=function(t,e,o,s,l){if(!n[t]){var f="string"==typeof e?e:e.prefix+e.resource+e.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ca.baseURL+"/"+f),n[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){i(t,"loaded"),function(t,e,n,r){var o=u(t);j(o,(function(t){var n=a(e,t);c(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(na))}(t,e,o,s)};r[t]?d():na.ScriptLoader.add(f,d,s,l)}},s=function(t,e,i){void 0===i&&(i="added"),mt(r,t)&&"added"===i||mt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){if(r[t])return r[t].instance},dependencies:u,requireLangPack:function(t,e){!1!==ca.languageLoad&&s(t,(function(){var r=aa.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||na.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},add:function(t,n,o){var u=n;return e.push(u),r[t]={instance:u,dependencies:o},i(t,"added"),u},remove:function(t){delete n[t],delete r[t]},createUrl:a,addComponents:function(e,n){var r=t.urls[e];j(n,(function(t){na.ScriptLoader.add(r+"/"+t)}))},load:c,waitFor:s}}!function(t){t.PluginManager=t(),t.ThemeManager=t()}(ca||(ca={}));var sa=ca,la=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null===n&&(n=setTimeout((function(){t.apply(null,r),n=null}),e))}}},fa=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},da=function(t,e){var n=$n(t,e);return void 0===n||""===n?[]:n.split(" ")},ma=function(t){return void 0!==t.dom.classList},ga=function(t,e){ma(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=da(t,e).concat([n]);Wn(t,e,r.join(" "))})(t,"class",e)}(t,e)},ha=function(t,e){return ma(t)&&t.dom.classList.contains(e)},pa=function(t,e){var n=[];return j(Ge(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(pa(t,e))})),n},va=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?[]:V(n.querySelectorAll(t),Te)}(e,t)},ba=l("mce-annotation"),ya=l("data-mce-annotation"),wa=l("data-mce-annotation-uid"),xa=function(t,e){var n=t.selection.getRng(),r=Te(n.startContainer),o=Te(t.getBody()),i=e.fold((function(){return"."+ba()}),(function(t){return"["+ya()+'="'+t+'"]'})),u=Xe(r,n.startOffset).getOr(r),a=xr(u,i,(function(t){return Ne(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?x.some($n(t,e)):x.none()};return a.bind((function(e){return c(e,""+wa()).bind((function(n){return c(e,""+ya()).map((function(e){var r=Ca(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ca=function(t,e){var n=Te(t.getBody());return va(n,"["+wa()+'="'+e+'"]')},Sa=0,ka=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Sa+String(e)},Oa=function(t,e){var n,r,o=He(t).dom,i=Te(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ge(Te(r)));cn(i,u),sn(t),an(t,i)},Ta=function(t,e){return Te(t.dom.cloneNode(e))},_a=function(t){return Ta(t,!1)},Ea=function(t){return Ta(t,!0)},Aa=function(t,e,n){void 0===n&&(n=p);var r=new Ar(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Mn(e)&&!n(e));return x.from(e).filter(Mn)};return{current:function(){return x.from(r.current()).filter(Mn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Na=function(t,e){var n=e||function(e){return t.isBlock(e)||Pn(e)||Hn(e)},r=function(t,e,n,o){if(Mn(t)){var i=o(t,e,t.data);if(-1!==i)return x.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Ra=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},Ma=Math.round,za=function(t){return t?{left:Ma(t.left),top:Ma(t.top),bottom:Ma(t.bottom),right:Ma(t.right),width:Ma(t.width),height:Ma(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Da=function(t,e){return t=za(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Ba=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Pa=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Ba(e.top-t.bottom,t,e)},Ia=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Ba(e.bottom-t.top,t,e)},La=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ha=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Fa=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},Va=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),ja=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Va.test(t)},Ua=kn,Wa=lo,qa=Tn("display","block table"),$a=Tn("float","left right"),Ga=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Ua,Wa,m($a)),Xa=m(Tn("white-space","pre pre-line pre-wrap")),Ka=Mn,Ya=Pn,Ja=Qu.nodeIndex,Qa=Fa,Za=function(t){return"createRange"in t?t.createRange():Qu.DOM.createRng()},tc=function(t){return t&&/[\r\n\t ]/.test(t)},ec=function(t){return!!t.setStart&&!!t.setEnd},nc=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(tc(t.toString())&&Xa(n.parentNode)&&Mn(n)&&(e=n.data,tc(e[r-1])||tc(e[r+1])))},rc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},oc=function(t){var e,n=t.getClientRects();return e=n.length>0?za(n[0]):za(t.getBoundingClientRect()),!ec(t)&&Ya(t)&&rc(e)?function(t){var e=t.ownerDocument,n=Za(e),r=e.createTextNode(Vr),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=za(n.getBoundingClientRect());return o.removeChild(r),i}(t):rc(e)&&ec(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Mn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),oc(i)}return null}(t):e},ic=function(t,e){var n=Da(t,e);return n.width=1,n.right=n.left+1,n};function uc(t,e,n){var r=function(){return n||(n=function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(r.length>0&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=Za(t.ownerDocument);if(e<t.data.length){if(ja(t.data[e]))return r;if(ja(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!nc(n)))return o(ic(oc(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),nc(n)||o(ic(oc(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),nc(n)||o(ic(oc(n),!0)))};if(Ka(t.container()))return i(t.container(),t.offset()),r;if(Ua(t.container()))if(t.isAtEnd())n=Qa(t.container(),t.offset()),Ka(n)&&i(n,n.data.length),Ga(n)&&!Ya(n)&&o(ic(oc(n),!1));else{if(n=Qa(t.container(),t.offset()),Ka(n)&&i(n,0),Ga(n)&&t.isAtEnd())return o(ic(oc(n),!1)),r;e=Qa(t.container(),t.offset()-1),Ga(e)&&!Ya(e)&&(qa(e)||qa(n)||!Ga(n))&&o(ic(oc(e),!1)),Ga(n)&&o(ic(oc(n),!0))}return r}(uc(t,e))),n};return{container:l(t),offset:l(e),toRange:function(){var n=Za(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Ka(t),0===e},isAtEnd:function(){return Ka(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return Qa(t,n?e-1:e)}}}!function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,Ja(e)+1)},t.before=function(e){return t(e.parentNode,Ja(e))},t.isAbove=function(t,e){return Ra(tt(e.getClientRects()),et(t.getClientRects()),Pa).getOr(!1)},t.isBelow=function(t,e){return Ra(et(e.getClientRects()),tt(t.getClientRects()),Ia).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&Mn(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}}(uc||(uc={}));var ac,cc=uc,sc=function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)},lc=function(t,e,n){Bn(n)?function(t,e,n){var r=x.from(n.firstChild),o=x.from(n.lastChild);e.insertNode(n),r.each((function(e){return sc(t,e.previousSibling)})),o.each((function(e){return sc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),sc(t,n.previousSibling),sc(t,n.nextSibling)}(t,e,n)},fc=Mn,dc=En,mc=Qu.nodeIndex,gc=function(t){var e=t.parentNode;return dc(e)?gc(e):e},hc=function(t){return t?wt(t.childNodes,(function(t,e){return dc(e)&&"BR"!==e.nodeName?t=t.concat(hc(e)):t.push(e),t}),[]):[]},pc=function(t){return function(e){return t===e}},vc=function(t){return(fc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=hc(gc(t)),n=xt(e,pc(t),t),e=e.slice(0,n+1);var r=wt(e,(function(t,n,r){return fc(n)&&fc(e[r-1])&&t++,t}),0);return e=bt(e,On([t.nodeName])),(n=xt(e,pc(t),t))-r}(t)+"]"},bc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),fc(n)?o=function(t,e){for(;(t=t.previousSibling)&&fc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(vc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode)r.push(e);return r}(t,n),u=bt(u,m(En)),(a=a.concat(vt(u,(function(t){return vc(t)})))).reverse().join("/")+","+o},yc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=wt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=hc(t);return r=bt(r,(function(t,e){return!fc(t)||!fc(r[e-1])})),(r=bt(r,On([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?fc(i)?function(t,e){for(var n,r=t,o=0;fc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!fc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return fc(t)&&e>t.data.length&&(e=t.data.length),cc(t,e)}(i,parseInt(n,10)):(n="after"===n?mc(i)+1:mc(i),cc(i.parentNode,n)):null},wc=Hn,xc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Mn(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Mn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Cc=function(t,e,n){var r=0;return xe.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Sc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],kn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},kc=function(t){return Sc(t,!0),Sc(t,!1),t},Oc=function(t,e){var n;if(kn(t)&&(t=Fa(t,e),wc(t)))return t;if(Kr(t)){if(Mn(t)&&Gr(t)&&(t=t.parentNode),n=t.previousSibling,wc(n))return n;if(n=t.nextSibling,wc(n))return n}},Tc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(wc(r)||"IMG"===o)return{name:o,index:Cc(n.dom,o,r)};var u=function(t){return Oc(t.startContainer,t.startOffset)||Oc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Cc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=xc(o,t,n,r,!0),e.isCollapsed()||(i.end=xc(o,t,n,r,!1)),i}(t,n,e,i)},_c=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},Ec=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Cc(n,a,u)};var c=kc(r.cloneRange());if(!i){c.collapse(!1);var s=_c(n,o+"_end",e);lc(n,c,s)}(r=kc(r)).collapse(!0);var l=_c(n,o+"_start",e);return lc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Ac=d(Tc,f,!0),Nc=Qu.DOM,Rc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},Mc=function(t){return t.getParam("content_security_policy","")},zc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Dc=function(t){return t.getParam("forced_root_block_attrs",{})},Bc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Pc=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Ic=function(t){return t.getParam("icons","","string")},Lc=function(t){return t.getParam("images_upload_url","","string")},Hc=function(t){return t.getParam("images_upload_base_path","","string")},Fc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Vc=function(t){return t.getParam("images_upload_handler",null,"function")},jc=function(t){return t.getParam("content_css_cors",!1,"boolean")},Uc=function(t){return t.getParam("referrer_policy","","string")},Wc=function(t){return t.getParam("language","en","string")},qc=function(t){return t.getParam("indent_use_margin",!1)},$c=function(t){var e=t.getParam("object_resizing");return!1!==e&&!pe.iOS&&(O(e)?e:"table,img,figure.image,div")},Gc=function(t){return t.getParam("event_root")},Xc=function(t){return t.getParam("theme")},Kc=function(t){return t.getParam("validate")},Yc=function(t){return!1!==t.getParam("inline_boundaries")},Jc=function(t){return t.getParam("content_css_cors")},Qc=function(t){return t.getParam("plugins","","string")},Zc=kn,ts=Mn,es=function(t){var e=t.parentNode;e&&e.removeChild(t)},ns=function(t){var e=Wr(t);return{count:t.length-e.length,text:e}},rs=function(t){for(var e;-1!==(e=t.data.lastIndexOf(jr));)t.deleteData(e,1)},os=function(t,e){return us(t),e},is=function(t,e){return cc.isTextPosition(e)?function(t,e){return ts(t)&&e.container()===t?function(t,e){var n=ns(t.data.substr(0,e.offset())),r=ns(t.data.substr(e.offset()));return(n.text+r.text).length>0?(rs(t),cc(t,e.offset()-n.count)):e}(t,e):os(t,e)}(t,e):function(t,e){return e.container()===t.parentNode?function(t,e){var n=e.container(),r=function(t,e){var n=L(t,e);return-1===n?x.none():x.some(n)}(nt(n.childNodes),t).map((function(t){return t<e.offset()?cc(n,e.offset()-1):e})).getOr(e);return us(t),r}(t,e):os(t,e)}(t,e)},us=function(t){Zc(t)&&Kr(t)&&(Yr(t)?t.removeAttribute("data-mce-caret"):es(t)),ts(t)&&(rs(t),0===t.data.length&&es(t))},as=ae().browser,cs=Hn,ss=Vn,ls=Fn,fs=function(t,e,n){var r,o,i,u,a,c=Da(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(a=t.getBoundingClientRect(),o=t.scrollLeft-a.left,i=t.scrollTop-a.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,(u=e.offsetWidth-e.clientWidth)>0&&(n&&(u*=-1),c.left+=u,c.right+=u),c},ds=function(t,e,n,r){var o,i,u=ra(x.none()),a=zc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=va(Te(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;to(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Zr(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(us(i),i=null),u.get().each((function(t){Wu(t.caret).remove(),u.set(x.none())})),o&&(Tr.clearInterval(o),o=null)};return{show:function(t,a){var l,f;if(s(),ls(a))return null;if(!n(a))return i=function(t,e){var n,r=t.ownerDocument.createTextNode(jr),o=t.parentNode;if(e){if(n=t.previousSibling,$r(n)){if(Kr(n))return n;if(to(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,$r(n)){if(Kr(n))return n;if(Zr(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(a,t),f=a.ownerDocument.createRange(),gs(i.nextSibling)?(f.setStart(i,0),f.setEnd(i,0)):(f.setStart(i,1),f.setEnd(i,1)),f;i=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o}(c,a,t),l=fs(e,a,t),Wu(i).css("top",l.top);var d=Wu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(e)[0];return u.set(x.some({caret:d,element:a,before:t})),u.get().each((function(e){t&&Wu(e.caret).addClass("mce-visual-caret-before")})),o=Tr.setInterval((function(){r()?Wu("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Wu("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500),(f=a.ownerDocument.createRange()).setStart(i,0),f.setEnd(i,0),f},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.get().each((function(t){var n=fs(e,t.element,t.before);Wu(t.caret).css(St({},n))}))},destroy:function(){return Tr.clearInterval(o)}}},ms=function(){return as.isIE()||as.isEdge()||as.isFirefox()},gs=function(t){return cs(t)||ss(t)},hs=function(t){return gs(t)||An(t)&&ms()},ps=Hn,vs=Vn,bs=Tn("display","block table table-cell table-caption list-item"),ys=Kr,ws=Gr,xs=kn,Cs=lo,Ss=function(t){return t>0},ks=function(t){return t<0},Os=function(t,e){for(var n;n=t(e);)if(!ws(n))return n;return null},Ts=function(t,e,n,r,o){var i=new Ar(t,r),u=ps(t)||ws(t);if(ks(e)){if(u&&n(t=Os(i.prev,!0)))return t;for(;t=Os(i.prev,o);)if(n(t))return t}if(Ss(e)){if(u&&n(t=Os(i.next,!0)))return t;for(;t=Os(i.next,o);)if(n(t))return t}return null},_s=function(t,e){for(;t&&t!==e;){if(bs(t))return t;t=t.parentNode}return null},Es=function(t,e,n){return _s(t.container(),n)===_s(e.container(),n)},As=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return xs(n)?n.childNodes[r+t]:null},Ns=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Rs=function(t,e,n){return _s(e,t)===_s(n,t)},Ms=function(t,e,n){var r,o;for(o=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[o],ys(r)&&(r=r[o]),ps(r)||vs(r)){if(Rs(e,r,n))return r;break}if(Cs(r))break;n=n.parentNode}return null},zs=d(Ns,!0),Ds=d(Ns,!1),Bs=function(t,e,n){var r,o,i,u=d(Ms,!0,e),a=d(Ms,!1,e);o=n.startContainer;var c=n.startOffset;if(Gr(o)){if(xs(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,hs(r)))return zs(r);if("after"===i&&(r=o.previousSibling,hs(r)))return Ds(r)}if(!n.collapsed)return n;if(Mn(o)){if(ys(o)){if(1===t){if(r=a(o))return zs(r);if(r=u(o))return Ds(r)}if(-1===t){if(r=u(o))return Ds(r);if(r=a(o))return zs(r)}return n}if(to(o)&&c>=o.data.length-1)return 1===t&&(r=a(o))?zs(r):n;if(Zr(o)&&c<=1)return-1===t&&(r=u(o))?Ds(r):n;if(c===o.data.length)return(r=a(o))?zs(r):n;if(0===c)return(r=u(o))?Ds(r):n}return n},Ps=function(t,e){return x.from(As(t?0:-1,e)).filter(ps)},Is=function(t,e,n){var r=Bs(t,e,n);return-1===t?uc.fromRangeStart(r):uc.fromRangeEnd(r)},Ls=function(t){return x.from(t.getNode()).map(Te)},Hs=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Fs=function(t,e){var n=Es(t,e);return!(n||!Pn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(ac||(ac={}));var Vs=Hn,js=Mn,Us=kn,Ws=Pn,qs=lo,$s=function(t){return ao(t)||function(t){return!!fo(t)&&!0!==$(nt(t.getElementsByTagName("*")),(function(t,e){return t||no(e)}),!1)}(t)},Gs=mo,Xs=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Ks=function(t,e){if(Ss(t)){if(qs(e.previousSibling)&&!js(e.previousSibling))return cc.before(e);if(js(e))return cc(e,0)}if(ks(t)){if(qs(e.nextSibling)&&!js(e.nextSibling))return cc.after(e);if(js(e))return cc(e,e.data.length)}return ks(t)?Ws(e)?cc.before(e):cc.after(e):cc.before(e)},Ys=function(t,e,n){var r,o,i,u;if(!Us(n)||!e)return null;if(e.isEqual(cc.after(n))&&n.lastChild){if(u=cc.after(n.lastChild),ks(t)&&qs(n.lastChild)&&Us(n.lastChild))return Ws(n.lastChild)?cc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(js(a)){if(ks(t)&&c>0)return cc(a,--c);if(Ss(t)&&c<a.length)return cc(a,++c);r=a}else{if(ks(t)&&c>0&&(o=Xs(a,c-1),qs(o)))return!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,i.data.length):cc.after(i):js(o)?cc(o,o.data.length):cc.before(o);if(Ss(t)&&c<a.childNodes.length&&(o=Xs(a,c),qs(o)))return Ws(o)?function(t,e){var n=e.nextSibling;return n&&qs(n)?js(n)?cc(n,0):cc.before(n):Ys(ac.Forwards,cc.after(e),t)}(n,o):!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,0):cc.before(i):js(o)?cc(o,0):cc.after(o);r=o||u.getNode()}if((Ss(t)&&u.isAtEnd()||ks(t)&&u.isAtStart())&&(r=Ts(r,t,v,n,!0),Gs(r,n)))return Ks(t,r);o=Ts(r,t,Gs,n);var s=Ct(W(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),Vs));return!s||o&&s.contains(o)?o?Ks(t,o):null:u=Ss(t)?cc.after(s):cc.before(s)},Js=function(t){return{next:function(e){return Ys(ac.Forwards,e,t)},prev:function(e){return Ys(ac.Backwards,e,t)}}},Qs=function(t){return cc.isTextPosition(t)?0===t.offset():lo(t.getNode())},Zs=function(t){if(cc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return lo(t.getNode(!0))},tl=function(t,e){return!cc.isTextPosition(t)&&!cc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},el=function(t,e,n){var r=Js(e);return x.from(t?r.next(n):r.prev(n))},nl=function(t,e,n){return el(t,e,n).bind((function(r){return Es(n,r,e)&&function(t,e,n){return t?!tl(e,n)&&(r=e,!(!cc.isTextPosition(r)&&Pn(r.getNode())))&&Zs(e)&&Qs(n):!tl(n,e)&&Qs(e)&&Zs(n);var r}(t,n,r)?el(t,e,r):x.some(r)}))},rl=function(t,e,n,r){return nl(t,e,n).bind((function(n){return r(n)?rl(t,e,n,r):x.some(n)}))},ol=function(t,e){var n,r=t?e.firstChild:e.lastChild;return Mn(r)?x.some(cc(r,t?0:r.data.length)):r?lo(r)?x.some(t?cc.before(r):Pn(n=r)?cc.before(n):cc.after(n)):function(t,e,n){var r=t?cc.before(n):cc.after(n);return el(t,e,r)}(t,e,r):x.none()},il=d(el,!0),ul=d(el,!1),al=d(ol,!0),cl=d(ol,!1),sl="_mce_caret",ll=function(t){return kn(t)&&t.id===sl},fl=function(t,e){for(;e&&e!==t;){if(e.id===sl)return e;e=e.parentNode}return null},dl=function(t,e){return kn(e)&&t.isBlock(e)&&!e.innerHTML&&!pe.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},ml=function(t,e){return cl(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},gl=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!fl(t,e)||(function(t,e){var n=t.ownerDocument.createTextNode(jr);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),0))},hl=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,gl(s,i,r))return!0;if(c[o]>a.length-1)return!!gl(s,i,r)||ml(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},pl=function(t){return Mn(t)&&t.data.length>0},vl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.nextSibling)?(r=s.nextSibling,o=0):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,xe.each(xe.grep(s.childNodes),(function(t){Mn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&Mn(u)&&!pe.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return x.some(cc(a,c))}return x.none()},bl=function(t,e,n){return function(t,e,n){return 2===e?Tc(Wr,n,t):3===e?function(t){var e=t.getRng();return{start:bc(t.dom.getRoot(),cc.fromRangeStart(e)),end:bc(t.dom.getRoot(),cc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Ec(t,!1)}(t,e,n)},yl=function(t,e){(function(t,e){var n=t.dom;if(e){if(function(t){return xe.isArray(t.start)}(e))return function(t,e){var n=t.createRng();return hl(t,!0,e,n)&&hl(t,!1,e,n)?x.some(n):x.none()}(n,e);if(function(t){return"string"==typeof t.start}(e))return x.some(function(t,e){var n,r=t.createRng();return n=yc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=yc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return t.hasOwnProperty("id")}(e))return function(t,e){var n=vl(t,"start",e),r=vl(t,"end",e);return Ra(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(dl(t,e.container()),e.offset()),r.setEnd(dl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return t.hasOwnProperty("name")}(e))return function(t,e){return x.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return t.hasOwnProperty("rng")}(e))return x.some(e.rng)}return x.none()})(t,e).each((function(e){t.setRng(e)}))},wl=function(t){return kn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},xl=(Vr,function(t){return" "===t}),Cl=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Sl=function(t){return!Cl(t)&&!xl(t)},kl=function(t){return!!t.nodeType},Ol=function(t,e,n){var r,o,i,u=n.startOffset,a=n.startContainer;if((n.startContainer!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===a.nodeType)for(u<(i=a.childNodes).length?(a=i[u],r=new Ar(a,t.getParent(a,t.isBlock))):(a=i[i.length-1],(r=new Ar(a,t.getParent(a,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Al(o))return n.setStart(o,0),void e.setRng(n)},Tl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Al(t))return t}},_l=function(t,e){return kl(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},El=function(t,e,n){return t.schema.isValidChild(e,n)},Al=function(t,e){if(void 0===e&&(e=!1),M(t)&&Mn(t)){var n=e?t.data.replace(/ /g," "):t.data;return ho(n)}return!1},Nl=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Rl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Ml=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},zl=function(t,e,n){return Ml(t,t.getStyle(e,n),n)},Dl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Bl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Pl=function(t){return gt(t,"block")},Il=function(t){return gt(t,"selector")},Ll=function(t){return gt(t,"inline")},Hl=wl,Fl=Bl,Vl=Al,jl=_l,Ul=function(t,e){for(var n=e;n;){if(kn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Wl=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},ql=function(t,e,n){return Wl(t,e,n,(function(t){return xl(t)||Cl(t)}))},$l=function(t,e,n){return Wl(t,e,n,Sl)},Gl=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Na(t),c=o?i.backwards:i.forwards;return x.from(c(e,n,(function(t,e){return Hl(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,ql).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),$l):x.some(t)})).orThunk((function(){return u?x.some({container:u,offset:o?0:u.length}):x.none()}))},Xl=function(t,e,n,r,o){Mn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Fl(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!("collapsed"in c)||c.collapsed===n.collapsed)&&t.is(i[u],c.selector))return i[u]}return r},Kl=function(t,e,n,r){var o,i=t.dom,u=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,u)),!o){var a=i.getParent(n,"LI,TD,TH");o=i.getParent(Mn(n)?n.parentNode:n,(function(e){return e!==u&&jl(t,e)}),a)}if(o&&e[0].wrapper&&(o=Fl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Rl(o,"br")););return o||n},Yl=function(t,e,n,r){var o=n.parentNode;return!M(n[r])&&(!(o!==e&&!R(o)&&!t.isBlock(o))||Yl(t,e,o,r))},Jl=function(t,e,n,r,o){var i,u,a=n,c=o?"previousSibling":"nextSibling",s=t.getRoot();if(Mn(n)&&!Vl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(i=a[c];i;i=i[c]){var l=Mn(i)&&!Yl(t,s,i,c);if(!Hl(i)&&(!Pn(u=i)||!u.getAttribute("data-mce-bogus")||u.nextSibling)&&!Vl(i,l))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n},Ql=function(t){return Hl(t.parentNode)||Hl(t)},Zl=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom;return kn(o)&&o.hasChildNodes()&&(o=Fa(o,i),Mn(o)&&(i=0)),kn(u)&&u.hasChildNodes()&&(u=Fa(u,e.collapsed?a:a-1),Mn(u)&&(a=u.nodeValue.length)),o=Ul(c,o),u=Ul(c,u),Ql(o)&&(o=Hl(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Mn(o)&&(i=e.collapsed?o.length:0)),Ql(u)&&(u=Hl(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,Mn(u)&&(a=e.collapsed?0:u.length)),e.collapsed&&(Gl(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Gl(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n}))),(n[0].inline||n[0].block_expand)&&(n[0].inline&&Mn(o)&&0!==i||(o=Jl(c,n,o,i,!0)),n[0].inline&&Mn(u)&&a!==u.nodeValue.length||(u=Jl(c,n,u,a,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=Xl(c,n,e,o,"previousSibling"),u=Xl(c,n,e,u,"nextSibling")),(n[0].block||n[0].selector)&&(o=Kl(t,n,o,"previousSibling"),u=Kl(t,n,u,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=Jl(c,n,o,i,!0)),c.isBlock(u)||(u=Jl(c,n,u,a,!1)))),kn(o)&&(i=c.nodeIndex(o),o=o.parentNode),kn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},tf=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},ef=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,u=e.endOffset,a=function(t){var e;return 3===(e=t[0]).nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===u&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=tf(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=tf(i,u-1)),r===i)return n(a([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=s(r,f)||r,g=s(i,f)||i;l(r,m,!0);var h=c(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);h.length&&n(a(h)),l(i,g)},nf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},rf=function(t,e){var n=va(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:function(t){return W(function(t){return K(t,(function(t){var e=Ha(t);return e?[Te(e)]:[]}))}(t),Hr)}(t)},of=function(t){return rf(nf(t.selection.getSel()),Te(t.getBody()))},uf=function(t){return Ke(t).fold(l([t]),(function(e){return[t].concat(uf(e))}))},af=function(t){return Ye(t).fold(l([t]),(function(e){return"br"===Me(e)?Ue(e).map((function(e){return[t].concat(af(e))})).getOr([]):[t].concat(af(e))}))},cf=function(t,e){return Ra(function(t){var e=t.startContainer,n=t.startOffset;return Mn(e)?0===n?x.some(Te(e)):x.none():x.from(e.childNodes[n]).map(Te)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Mn(e)?n===e.data.length?x.some(Te(e)):x.none():x.from(e.childNodes[n-1]).map(Te)}(e),(function(e,n){var r=G(uf(t),d(Ne,e)),o=G(af(t),d(Ne,n));return r.isSome()&&o.isSome()})).getOr(!1)},sf=function(t,e,n,r){var o=n,i=new Ar(n,o),u=ft(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!H(["td","th","table"],e.toLowerCase())}));do{if(Mn(n)&&0!==xe.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},lf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},ff=function(t,e){var n=of(t);n.length>0?j(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},df=function(t,e,n){var r=Ec(t,e);n(r),t.moveToBookmark(r)},mf=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(Pe),gf=function(t){return mf.get(t)},hf=function(t,e,n,r){var o=e.uid,i=void 0===o?ka("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=ke("span",t);ga(a,ba()),Wn(a,""+wa(),i),Wn(a,""+ya(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return qn(a,l),function(t,e){j(e,(function(e){ga(t,e)}))}(a,d),a},pf=function(t,e,n,r,o){var i=[],u=hf(t.getDoc(),o,n,r),a=ra(x.none()),c=function(){a.set(x.none())},s=function(t){j(t,l)},l=function(e){switch(function(t,e,n,r){return je(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Pe(t)&&gf(t)===jr}(e)?"valid":function(t){return Be(t)&&ha(t,ba())}(e)?"existing":ll(e.dom)?"caret":El(t,n,r)&&El(t,Me(o),n)?"valid":"invalid-child"}))}(t,e,"span",Me(e))){case"invalid-child":c();var n=Ge(e);s(n),c();break;case"valid":!function(t,e){rn(t,e),an(e,t)}(e,a.get().getOrThunk((function(){var t=_a(u);return i.push(t),a.set(x.some(t)),t})))}};return ef(t.dom,e,(function(t){c(),function(t){var e=V(t,Te);s(e)}(t)})),i},vf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?x.from(e[t]).map((function(t){return t.settings})):x.none()}});!function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){j(t,(function(t){(function(t){return x.from(t.attr(ya())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))}(t,n);var r=function(t,e){var n=ra({}),r=function(t,e){o(t,(function(t){return e(t),t}))},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:ra(x.none())});r[t]=o,n.set(r)},i=fa((function(){var e,i,u=n.get(),a=(e=rt(u),(i=B.call(e,0)).sort(void 0),i);j(a,(function(e){o(e,(function(n){var o=n.previous.get();return xa(t,x.some(e)).fold((function(){o.isSome()&&(function(t){r(t,(function(e){j(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.set(x.none()))}),(function(t){var e=t.uid,i=t.name,u=t.elements;o.is(e)||(function(t,e,n){r(t,(function(r){j(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:V(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(x.some(e)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()})),{addListener:function(t,e){o(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}}(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){!function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=of(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=Zl(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=hf(t.getDoc(),r,e,n.decorate);Oa(a,Vr),o.getRng().insertNode(a.dom),o.select(a.dom)}else df(o,!1,(function(){ff(t,(function(o){pf(t,o,e,n.decorate,r)}))}))}))}(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){xa(t,x.some(e)).each((function(t){var e=t.elements;j(e,fn)}))},getAll:function(e){var n=function(t,e){var n=Te(t.getBody()),r=va(n,"["+ya()+'="'+e+'"]'),o={};return j(r,(function(t){var e=$n(t,wa()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])})),o}(t,e);return ut(n,(function(t){return V(t,(function(t){return t.dom}))}))}}};function bf(t){return{getBookmark:d(bl,t),moveToBookmark:d(yl,t)}}!function(t){t.isBookmarkNode=wl}(bf||(bf={}));var yf=bf,wf=function(t,e){for(;e&&e!==t;){if(Ln(e)||Hn(e))return e;e=e.parentNode}return null},xf=function(t,e,n){if(n.collapsed)return!1;if(pe.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(kn(r))return F(r.getClientRects(),(function(n){return La(n,t,e)}))}return F(n.getClientRects(),(function(n){return La(n,t,e)}))},Cf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return pe.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Sf=Hn,kf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p=e.dom,v=xe.each,b=e.getDoc(),y=document,w=Math.abs,x=Math.round,C=e.getBody(),S={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},k=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},O=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return k(t.target)&&!xf(n.clientX,n.clientY,e)}return k(t.target)&&!xf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},T=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},_=function(t){var n=$c(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&Ee(Te(t),n)},E=function(t,e,n){p.setStyles(T(t),{width:e,height:n})},A=function(t){var v,b,y,S;v=t.screenX-u,b=t.screenY-a,d=v*i[2]+c,m=b*i[3]+s,d=d<5?5:d,m=m<5?5:m,(k(n)&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Cf.modifierPressed(t):Cf.modifierPressed(t))&&(w(v)>w(b)?(m=x(d*l),d=x(m/l)):(d=x(m/l),m=x(d*l))),E(r,d,m),y=(y=i.startPos.x+v)>0?y:0,S=(S=i.startPos.y+b)>0?S:0,p.setStyles(o,{left:y,top:S,display:"block"}),o.innerHTML=d+" × "+m,i[2]<0&&r.clientWidth<=d&&p.setStyle(r,"left",void 0+(c-d)),i[3]<0&&r.clientHeight<=m&&p.setStyle(r,"top",void 0+(s-m)),(v=C.scrollWidth-g)+(b=C.scrollHeight-h)!=0&&p.setStyles(o,{left:y-v,top:S-b}),f||(function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,c,s,"corner-"+i.name),f=!0)},N=function(){var t=f;f=!1;var u=function(t,r){r&&(n.style[t]||!e.schema.isValid(n.nodeName.toLowerCase(),t)?p.setStyle(T(n),t,r):p.setAttrib(T(n),t,""+r))};t&&(u("width",d),u("height",m)),p.unbind(b,"mousemove",A),p.unbind(b,"mouseup",N),y!==b&&(p.unbind(y,"mousemove",A),p.unbind(y,"mouseup",N)),p.remove(r),p.remove(o),R(n),t&&(function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,d,m,"corner-"+i.name),p.setAttrib(n,"style",p.getAttrib(n,"style"))),e.nodeChanged()},R=function(t){M(),B();var f=p.getPos(t,C),w=f.x,x=f.y,k=t.getBoundingClientRect(),O=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==t&&(n=t,d=m=0);var z=e.fire("ObjectSelected",{target:t});_(t)&&!z.isDefaultPrevented()?v(S,(function(t,e){var f;(f=p.get("mceResizeHandle"+e))&&p.remove(f),f=p.add(C,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===pe.ie&&(f.contentEditable=!1),p.bind(f,"mousedown",(function(f){f.stopImmediatePropagation(),f.preventDefault(),function(f){u=f.screenX,a=f.screenY,c=T(n).clientWidth,s=T(n).clientHeight,l=s/c,(i=t).name=e,i.startPos={x:O*t[0]+w,y:R*t[1]+x},g=C.scrollWidth,h=C.scrollHeight,r=n.cloneNode(!0),p.addClass(r,"mce-clonedresizable"),p.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,p.setStyles(r,{left:w,top:x,margin:0}),E(r,O,R),r.removeAttribute("data-mce-selected"),C.appendChild(r),p.bind(b,"mousemove",A),p.bind(b,"mouseup",N),y!==b&&(p.bind(y,"mousemove",A),p.bind(y,"mouseup",N)),o=p.add(C,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" × "+s)}(f)})),t.elm=f,p.setStyles(f,{left:O*t[0]+w-f.offsetWidth/2,top:R*t[1]+x-f.offsetHeight/2})})):M(),n.setAttribute("data-mce-selected","1")},M=function(){B(),n&&n.removeAttribute("data-mce-selected"),it(S,(function(t,e){var n=p.get("mceResizeHandle"+e);n&&(p.unbind(n),p.remove(n))}))},z=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};f||e.removed||(v(p.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=p.$(r).closest("table,img,figure.image,hr")[0],C)&&(P(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):M())},D=function(t){return Sf(wf(e.getBody(),t))},B=function(){it(S,(function(t){t.elm&&(p.unbind(t.elm),delete t.elm)}))},P=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};return e.on("init",(function(){if(P(),pe.browser.isIE()||pe.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;f||!/^(TABLE|IMG|HR)$/.test(r)||D(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Tr.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(D(t.target)||Vn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};p.bind(C,"mscontrolselect",t),e.on("remove",(function(){return p.unbind(C,"mscontrolselect",t)}))}var r=Tr.throttle((function(t){e.composing||z(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",M),e.on("contextmenu longpress",O,!0)})),e.on("remove",B),{isResizable:_,showResizeRect:R,hideResizeRect:M,updateResizeRect:z,destroy:function(){n=r=null}}},Of=function(t){return Ln(t)||Hn(t)},Tf=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=xe.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Hn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Of))?null:t}(r,n.body)}return r},_f=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Ef=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Af=function(t,e,n){return Ef(t,e,(function(t){return t.nodeName===n}))},Nf=function(t){return t&&"TABLE"===t.nodeName},Rf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Mf=function(t,e){return Kr(t)&&!1===Ef(t,e,ll)},zf=function(t,e,n){for(var r=new Ar(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Pn(e))return!0},Df=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Pn(o)&&e&&t.isEmpty(s))return x.some(uc(o.parentNode,t.nodeIndex(o)));for(var l=new Ar(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Mf(u,a))return x.none();if(Mn(u)&&u.nodeValue.length>0)return!1===Af(u,a,"A")?x.some(uc(u,r?u.nodeValue.length:0)):x.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return x.none();i=u}return n&&i?x.some(uc(i,0)):x.none()},Bf=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=kn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,Kr(o))return x.none();if(kn(o)&&i>o.childNodes.length-1&&(a=!1),Dn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(Kr(u))return x.none();if(f[u.nodeName]||Nf(u))return x.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Mn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Nf(o))return x.none();if(function(t,e){for(;e&&e!==t;){if(Hn(e))return!0;e=e.parentNode}return!1}(c,o)||Kr(o))return x.none();if(o.hasChildNodes()&&!1===Nf(o)){u=o;var d=new Ar(o,c);do{if(Hn(u)||Kr(u)){s=!1;break}if(Mn(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Rf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(Mn(o)&&0===i&&Df(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),kn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Pn(u)||function(t,e){return t.previousSibling&&"A"===t.previousSibling.nodeName}(u)||zf(t,u,!1)||zf(t,u,!0)||Df(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&Mn(o)&&i===o.nodeValue.length&&Df(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?x.some(uc(o,i)):x.none()},Pf=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=uc.fromRangeStart(e);return Bf(t,n,!0,r).each((function(t){n&&uc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Bf(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),_f(e,r)?x.none():x.some(r)},If=function(t,e){return t.splitText(e)},Lf=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Mn(e)?n>0&&n<e.nodeValue.length&&(e=(r=If(e,n)).previousSibling,o>n?(e=r=If(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Mn(e)&&n>0&&n<e.nodeValue.length&&(e=If(e,n),n=0),Mn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=If(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}};function Hf(t){return{walk:function(e,n){return ef(t,e,n)},split:Lf,normalize:function(e){return Pf(t,e).fold(p,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}!function(t){t.compareRanges=_f,t.getCaretRangeFromPoint=Tf,t.getSelectedNode=Ha,t.getNode=Fa}(Hf||(Hf={}));var Ff,Vf=Hf,jf=function(t,e){var n=function(e){var n=function(t){var e=t.dom;return dn(t)?e.getBoundingClientRect().height:e.offsetHeight}(e);if(n<=0||null===n){var r=Kn(e,t);return parseFloat(r)||0}return n},r=function(t,e){return $(e,(function(e,n){var r=Kn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!D(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;jn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height"),Uf=function(t,e){return t.view(e).fold(l([]),(function(e){var n=t.owner(e),r=Uf(t,n);return[e].concat(r)}))},Wf=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Te)},owner:function(t){return Fe(t)}}),qf=function(t){return"textarea"===Me(t)},$f=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return gn(n.offsetLeft,n.offsetTop);var i=hn(null==r?void 0:r.pageYOffset,o.scrollTop),u=hn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=hn(o.clientTop,n.clientTop),c=hn(o.clientLeft,n.clientLeft);return pn(t).translate(u-c,i-a)}(t),r=function(t){return jf.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Gf=function(t,e,n,r){Jf(t,(function(o,i){return Kf(t,e,n,r)}),n)},Xf=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,vn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Kf=function(t,e,n,r){var o=Te(t.getBody()),i=Te(t.getDoc());o.dom.offsetWidth;var u,a,c,s,l=(u=Te(n.startContainer),a=n.startOffset,c=function(t,e){var n=Ge(t);if(0===n.length||qf(t))return{element:t,offset:e};if(e<n.length&&!qf(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return qf(r)?{element:t,offset:e}:"img"===Me(r)?{element:r,offset:1}:Pe(r)?{element:r,offset:gf(r).length}:{element:r,offset:Ge(r).length}}(u,a),s=Se('<span data-mce-bogus="all">\ufeff</span>'),rn(c.element,s),$f(s,(function(){return ln(s)})));Xf(t,i,e,l,r),l.cleanup()},Yf=function(t,e,n,r){var o=Te(t.getDoc());Xf(t,o,n,function(t){return $f(Te(t),c)}(e),r)},Jf=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(Te(r),Te(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Qf=function(t,e,n,r){var o=t.pos;if(n)bn(o.left,o.top,r);else{var i=o.top-e+t.height;bn(o.left,i,r)}},Zf=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;u<e?Qf(r,n,!1!==o,t):u>i?Qf(r,n,c?!1!==o:!0===o,t):a>i&&!c&&Qf(r,n,!0===o,t)},td=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r)},ed=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r);var i=function(t){var e=Te(document),n=vn(e),r=function(t,e){var n=e.owner(t);return Uf(e,n)}(t,Wf),o=pn(t),i=q(r,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return gn(i.left+o.left+n.left,i.top+o.top+n.top)}(n.element),u=xn(window);i.top<u.y?yn(n.element,!1!==r):i.top>u.bottom&&yn(n.element,!0===r)},nd=function(t,e,n){return Gf(t,td,e,n)},rd=function(t,e,n){return Yf(t,e,td,n)},od=function(t,e,n){return Gf(t,ed,e,n)},id=function(t,e,n){return Yf(t,e,ed,n)},ud=function(t,e,n){(t.inline?nd:od)(t,e,n)},ad=function(t){var e=tn(t).dom;return t.dom===e.activeElement},cd=function(t){return void 0===t&&(t=Te(document)),x.from(t.dom.activeElement).map(Te)},sd=mr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ld=(sd.before,sd.on,sd.after,mr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),fd=(ld.domRange,ld.relative,ld.exact,function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}}),dd=ae().browser,md=function(t,e){var n=Pe(e)?gf(e).length:Ge(e).length+1;return t>n?n:t<0?0:t},gd=function(t){return fd(t.start,md(t.soffset,t.start),t.finish,md(t.foffset,t.finish))},hd=function(t,e){return!Sn(e.dom)&&(Re(t,e)||Ne(t,e))},pd=function(t){return function(e){return hd(t,e.start)&&hd(t,e.finish)}},vd=function(t){return!0===t.inline||dd.isIE()},bd=function(t){return fd(Te(t.startContainer),t.startOffset,Te(t.endContainer),t.endOffset)},yd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),x.some(e)}catch(t){return x.none()}},wd=function(t){var e,n,r,o=vd(t)?(e=Te(t.getBody()),(n=Ve(e).dom,r=n.getSelection(),(r&&0!==r.rangeCount?x.from(r.getRangeAt(0)):x.none()).map(bd)).filter(pd(e))):x.none();t.bookmark=o.isSome()?o:t.bookmark},xd=function(t){return(t.bookmark?t.bookmark:x.none()).bind((function(e){return n=Te(t.getBody()),r=e,x.from(r).filter(pd(n)).map(gd);var n,r})).bind(yd)},Cd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Sd=function(t){var e=la((function(){wd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};Qu.DOM.bind(document,"mouseup",n),t.on("remove",(function(){Qu.DOM.unbind(document,"mouseup",n)}))}(t,e),function(t,e){ae().browser.isIE()?function(t){t.on("focusout",(function(){wd(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||wd(t)}))}(t,e)})),t.on("remove",(function(){e.cancel()}))},kd=Qu.DOM,Od=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==kd.getParent(e,(function(e){return function(t){return Cd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},Td=function(t,e){var n=e.editor;Sd(n),n.on("focusin",(function(){var e=this,n=t.focusedEditor;n!==e&&(n&&n.fire("blur",{focusedEditor:e}),t.setActive(e),t.focusedEditor=e,e.fire("focus",{blurredEditor:n}),e.focus(!0))})),n.on("focusout",(function(){var e=this;Tr.setEditorTimeout(e,(function(){var n=t.focusedEditor;Od(e,function(t){try{var e=tn(Te(t.getElement()));return cd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(e))||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ff||(Ff=function(e){var n=t.activeEditor;n&&function(t){if(Ze()&&M(t.target)){var e=Te(t.target);if(Be(e)&&M(e.dom.shadowRoot)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return tt(n)}}return x.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Od(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},kd.bind(document,"focusin",Ff))},_d=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(kd.unbind(document,"focusin",Ff),Ff=null)},Ed=function(t,e){(function(t,e){return function(t){return t.collapsed?x.from(Fa(t.startContainer,t.startOffset)).map(Te):x.none()}(e).bind((function(e){return Lr(e)?x.some(e):!1===Re(t,e)?x.some(t):x.none()}))})(Te(t.getBody()),e).bind((function(t){return al(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},Ad=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},Nd=function(t){return t.inline?function(t){var e,n,r=t.getBody();return r&&(e=Te(r),ad(e)||(n=e,cd(tn(n)).filter((function(t){return n.dom.contains(t.dom)}))).isSome())}(t):function(t){return t.iframeElement&&ad(Te(t.iframeElement))}(t)},Rd=function(t){return t.editorManager.setActive(t)},Md=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return x.from(i).map(Te).map((function(t){return r&&e.collapsed?t:Xe(t,o(t,u)).getOr(t)})).bind((function(t){return Be(t)?x.some(t):je(t).filter(Be)})).map((function(t){return t.dom})).getOr(t)},zd=function(t,e,n){return Md(t,e,!0,n,(function(t,e){return Math.min(t.dom.childNodes.length,e)}))},Dd=function(t,e,n){return Md(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Bd=function(t,e){for(var n=t;t&&Mn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Pd=function(t,e){return V(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Id=function(t){return z(t)?t:p},Ld=function(t,e,n){var r=e(t),o=Id(n);return r.orThunk((function(){return o(t)?x.none():function(t,e,n){for(var r=t.dom,o=Id(n);r.parentNode;){r=r.parentNode;var i=Te(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()}(t,e,o)}))},Hd=Rl,Fd=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},Vd=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!Fd(t,e,n)||e.parentNode===o||!!Wd(t,e,n,r,!0)})),Wd(t,e,n,r))},jd=function(t,e,n){return!!Hd(e,n.inline)||!!Hd(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},Ud=function(t,e,n,r,o,i){var u,a,c,s=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(s)if(void 0===s.length){for(u in s)if(s.hasOwnProperty(u)){if(a="attributes"===r?t.getAttrib(e,u):zl(t,e,u),o&&!a&&!n.exact)return;if((!o||n.exact)&&!Hd(a,Ml(t,Nl(s[u],i),u)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?t.getAttrib(e,s[c]):zl(t,e,s[c]))return n;return n},Wd=function(t,e,n,r,o){var i,u,a,c,s=t.formatter.get(n),l=t.dom;if(s&&e)for(u=0;u<s.length;u++)if(i=s[u],jd(t.dom,e,i)&&Ud(l,e,i,"attributes",o,r)&&Ud(l,e,i,"styles",o,r)){if(c=i.classes)for(a=0;a<c.length;a++)if(!t.dom.hasClass(e,c[a]))return;return i}},qd=function(t,e,n,r){if(r)return Vd(t,r,e,n);if(r=t.selection.getNode(),Vd(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!Vd(t,o,e,n))},$d=function(t,e,n){return $(n,(function(n,r){var o=function(t,e){return F(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return F(["styles","attributes"],(function(n){return dt(t,n).exists((function(t){var n=_(t)?t:function(t,e){var n=[];return it(t,(function(t,e){n.push(t)})),n}(t);return F(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Gd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xd=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},Kd=function(t){if(!ho(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Yd=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Jd=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Gd[e]||1);return n&&it(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&it(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Xd(n,this))n.name===t&&e.push(n);return e},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Xd(n,t))e.push(n);for(var r=e.length;r--;)(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Yd(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Yd(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Kd(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&ho(o.value))return!1;if(n&&n(o))return!1}while(o=Xd(o,r));return!0},t.prototype.walk=function(t){return Xd(this,null,t)},t}(),Qd=xe.makeMap,Zd=function(t){var e=[],n=(t=t||{}).indent,r=Qd(t.indent_before||""),o=Qd(t.indent_after||""),i=Io.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tm=function(t,e){void 0===e&&(e=Go());var n=Zd(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r,a,c,s,l,f,d,m,g,h=i[t.type];if(h)h(t);else{if(r=t.name,a=t.shortEnded,c=t.attributes,o&&c&&c.length>1&&((f=[]).map={},g=e.getElementRule(t.name))){for(d=0,m=g.attributesOrder.length;d<m;d++)(s=g.attributesOrder[d])in c.map&&(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));for(d=0,m=c.length;d<m;d++)(s=c[d].name)in f.map||(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));c=f}if(n.start(t.name,c,a),!a){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},em=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return dt(e.uris,t).getOr(t)}))},nm=["img","video"],rm=function(t,e,n){var r,o,i=1,u=t.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(a.lastIndex=r=n;o=a.exec(e);){if(r=a.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in u)continue;i++}if(0===i)break}return r},om=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function im(t,e){void 0===e&&(e=Go());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,u=t.start?t.start:n,a=t.end?t.end:n,c=t.pi?t.pi:n,s=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");for(var f,d,m,g,h,p,v,b,y,w,x,C,S,k,O,T,_,E,A,N=n.html,M=0,z=[],D=0,B=Io.decode,P=xe.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L="html"===l?0:1,F=function(t){var e,n;for(e=z.length;e--&&z[e].name!==t;);if(e>=0){for(n=z.length-1;n>=e;n--)(t=z[n]).valid&&a(t.name);z.length=e}},V=function(t,e){return i(em(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(em(e,n)))},U=function(t,e){var n=t||"",r=!Rt(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length}(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},W=function(e,r,o,i,u){var a,c;if(o=function(t){return dt(n.uris,t).getOr(t)}((r=r.toLowerCase())in K?r:B(o||i||u||"")),Y&&!b&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(r)){if(!(a=k[r])&&O){for(c=O.length;c--&&!(a=O[c]).pattern.test(r););-1===c&&(a=null)}if(!a)return;if(a.validValues&&!(o in a.validValues))return}if(P[r]&&!t.allow_script_urls){var s=o.replace(/[\s\u0000-\u001F]+/g,"");try{s=decodeURIComponent(s)}catch(t){s=unescape(s)}if(I.test(s))return;if(function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return!(R(t)?H(nm,e):t)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))}(t,s,e))return}b&&(r in P||0===r.indexOf("on"))||(g.map[r]=o,g.push({name:r,value:o}))},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),X=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=N+">";f=q.exec(tt);){var et=f[0];if(M<f.index&&V(B(N.substr(M,f.index-M))),d=f[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=f[8]){if(f.index+et.length>N.length){V(B(N.substr(f.index))),M=f.index+et.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in G,Q&&X[d]&&z.length>0&&z[z.length-1].name===d&&F(d);var nt=om($,f[9]);if(null!==nt){if("all"===nt){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}if(!Y||(w=e.getElementRule(d))){if(x=!0,Y&&(k=w.attributes,O=w.attributePatterns),(S=f[9])?((b=-1!==S.indexOf("data-mce-type"))&&J&&(x=!1),(g=[]).map={},S.replace($,(function(t,e,n,r,o){return W(d,e,n,r,o),""}))):(g=[]).map={},Y&&!b){if(T=w.attributesRequired,_=w.attributesDefault,E=w.attributesForced,w.removeEmptyAttrs&&!g.length&&(x=!1),E)for(h=E.length;h--;)v=(C=E[h]).name,"{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A});if(_)for(h=_.length;h--;)(v=(C=_[h]).name)in g.map||("{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A}));if(T){for(h=T.length;h--&&!(T[h]in g.map););-1===h&&(x=!1)}if(C=g.map["data-mce-bogus"]){if("all"===C){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}}x&&u(d,g,y)}else x=!1;if(m=Z[d]){m.lastIndex=M=f.index+et.length,(f=m.exec(N))?(x&&(p=N.substr(M,f.index-M)),M=f.index+f[0].length):(p=N.substr(M),M=N.length),x&&(p.length>0&&V(p,!0),a(d)),q.lastIndex=M;continue}y||(S&&S.indexOf("/")===S.length-1?x&&a(d):z.push({name:d,valid:x}))}else if(d=f[1])j(d);else if(d=f[2]){if(!(1===L||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){M=U("",f.index+2),q.lastIndex=M;continue}o(d)}else if(d=f[3])s(d);else{if((d=f[4])||"<!"===et){M=U(d,f.index+et.length),q.lastIndex=M;continue}if(d=f[5]){if(1!==L){M=U("?",f.index+2),q.lastIndex=M;continue}c(d,f[6])}}M=f.index+et.length}for(M<N.length&&V(B(N.substr(M))),h=z.length-1;h>=0;h--)(d=z[h]).valid&&a(d.name)};return{parse:function(t,e){void 0===e&&(e="html"),l(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=ka("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}return 0===u?{prefix:i,uris:o,html:t}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join("")})}(t),e)}}}!function(t){t.findEndTag=rm}(im||(im={}));var um=im,am=function(t,e){var n,r,o,i,u=e,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=t.schema;u=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),u);for(var s=c.getShortEndedElements();i=a.exec(u);)r=a.lastIndex,o=i[0].length,n=s[i[1]]?r:um.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),a.lastIndex=r-o;return Wr(u)},cm=am,sm=xe.each,lm=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return sm(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||wl(e)||wl(n))}},fm=function(t,e,n){return x.from(n.container()).filter(Mn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},dm=d(fm,!0,Cl),mm=d(fm,!1,Cl),gm=function(t){var e=t.container();return Mn(e)&&(0===e.data.length||Ur(e.data)&&yf.isBookmarkNode(e.parentNode))},hm=function(t,e){return function(n){return x.from(As(t?0:-1,n)).filter(e).isSome()}},pm=function(t){return In(t)&&"block"===Kn(Te(t),"display")},vm=function(t){return Hn(t)&&!function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},bm=hm(!0,pm),ym=hm(!1,pm),wm=hm(!0,Vn),xm=hm(!1,Vn),Cm=hm(!0,An),Sm=hm(!1,An),km=hm(!0,vm),Om=hm(!1,vm),Tm=function(t){sn(t),an(t,Se('<br data-mce-bogus="1">'))},_m=function(t){Ye(t).each((function(e){Ue(e).each((function(n){Mr(t)&&Dr(e)&&Mr(n)&&ln(e)}))}))},Em=function(t,e){return function(t,e,n){return Re(e,t)?function(t,e){for(var n=z(e)?e:p,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Te(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Ne(t,e)})).slice(0,-1):[]}(t,e,p)},Am=function(t,e){return[t].concat(Em(t,e))},Nm=function(t,e,n){return rl(t,e,n,gm)},Rm=function(t,e){return G(Am(Te(e.container()),t),Mr)},Mm=function(t,e,n){return Nm(t,e.dom,n).forall((function(t){return Rm(e,n).fold((function(){return!1===Es(t,n,e.dom)}),(function(r){return!1===Es(t,n,e.dom)&&Re(r,Te(t.container()))}))}))},zm=function(t,e,n){return Rm(e,n).fold((function(){return Nm(t,e.dom,n).forall((function(t){return!1===Es(t,n,e.dom)}))}),(function(e){return Nm(t,e.dom,n).isNone()}))},Dm=d(zm,!1),Bm=d(zm,!0),Pm=d(Mm,!1),Im=d(Mm,!0),Lm=function(t){return Ls(t).exists(Dr)},Hm=function(t,e,n){var r=W(Am(Te(n.container()),e),Mr),o=tt(r).getOr(e);return el(t,o.dom,n).filter(Lm)},Fm=function(t,e){return Ls(e).exists(Dr)||Hm(!0,t,e).isSome()},Vm=function(t,e){return function(t){return x.from(t.getNode(!0)).map(Te)}(e).exists(Dr)||Hm(!1,t,e).isSome()},jm=d(Hm,!1),Um=d(Hm,!0),Wm=function(t){return uc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},qm=function(t,e){var n=W(Am(Te(e.container()),t),Mr);return tt(n).getOr(t)},$m=function(t,e){return Wm(e)?mm(e):mm(e)||ul(qm(t,e).dom,e).exists(mm)},Gm=function(t,e){return Wm(e)?dm(e):dm(e)||il(qm(t,e).dom,e).exists(dm)},Xm=function(t){return Ls(t).bind((function(t){return br(t,Be)})).exists((function(t){return function(t){return H(["pre","pre-wrap"],t)}(Kn(t,"white-space"))}))},Km=function(t,e){return!Xm(e)&&(Dm(t,e)||Pm(t,e)||Vm(t,e)||$m(t,e))},Ym=function(t,e){return!Xm(e)&&(Bm(t,e)||Im(t,e)||Fm(t,e)||Gm(t,e))},Jm=function(t,e){return Km(t,e)||Ym(t,function(t){var e=t.container(),n=t.offset();return Mn(e)&&n<e.data.length?uc(e,n+1):t}(e))},Qm=function(t,e){return xl(t.charAt(e))},Zm=function(t){var e=t.container();return Mn(e)&&Nt(e.data,Vr)},tg=function(t,e){return x.some(e).filter(Zm).bind((function(e){var n,r,o,i=e.container();return function(t,e){var n=e.data,r=uc(e,0);return!(!Qm(n,0)||Jm(t,r)||(e.data=" "+n.slice(1),0))}(t,i)||(r=(n=i).data,(o=function(t){var e=t.split("");return V(e,(function(t,n){return xl(t)&&n>0&&n<e.length-1&&Sl(e[n-1])&&Sl(e[n+1])?" ":t})).join("")}(r))!==r&&(n.data=o,1))||function(t,e){var n=e.data,r=uc(e,n.length-1);return!(!Qm(n,n.length-1)||Jm(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,i)?x.some(e):x.none()}))},eg=function(t){var e=Te(t.getBody());t.selection.isCollapsed()&&tg(e,uc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},ng=function(t,e,n){if(0!==n){var r=Te(t),o=vr(r,Mr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Ym(o,cc(t,t.data.length)),a=0===e&&Km(o,cc(t,0));t.replaceData(e,n,function(t,e,n){return $(t,(function(r,o){return Cl(o)||xl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+Vr}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},rg=function(t,e){var n=t.data.slice(e),r=n.length-Dt(n).length;return ng(t,e,r)},og=function(t,e){var n=t.data.slice(0,e),r=n.length-Bt(n).length;return ng(t,e-r,r)},ig=function(t,e,n,r){void 0===r&&(r=!0);var o=Bt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),ln(Te(u)),n&&rg(i,o),i},ug=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===cc.isTextPosition(t)&&n===e.parentNode&&r>cc.before(e).offset()}(e,t)?cc(e.container(),e.offset()-1):e},ag=function(t){return lo(t.previousSibling)?x.some((e=t.previousSibling,Mn(e)?cc(e,e.data.length):cc.after(e))):t.previousSibling?cl(t.previousSibling):x.none();var e},cg=function(t){return lo(t.nextSibling)?x.some((e=t.nextSibling,Mn(e)?cc(e,0):cc.before(e))):t.nextSibling?al(t.nextSibling):x.none();var e},sg=function(t,e,n){return function(t,e,n){return t?function(t,e){return cg(e).orThunk((function(){return ag(e)})).orThunk((function(){return function(t,e){return il(t,cc.after(e)).fold((function(){return ul(t,cc.before(e))}),x.some)}(t,e)}))}(e,n):function(t,e){return ag(e).orThunk((function(){return cg(e)})).orThunk((function(){return function(t,e){var n=cc.before(e.previousSibling?e.previousSibling:e.parentNode);return ul(t,n).fold((function(){return il(t,cc.after(e))}),x.some)}(t,e)}))}(e,n)}(t,e,n).map(d(ug,n))},lg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},fg=function(t,e){return e&&mt(t.schema.getBlockElements(),Me(e))},dg=function(t){if(wo(t)){var e=Se('<br data-mce-bogus="1">');return sn(t),an(t,e),x.some(cc.before(e.dom))}return x.none()},mg=function(t,e,n,r){void 0===r&&(r=!0);var o,i=sg(e,t.getBody(),n.dom),u=vr(n,d(fg,t),(o=t.getBody(),function(t){return t.dom===o})),a=function(t,e,n){var r,o,i,u,a=Ue(t).filter(Pe),c=We(t).filter(Pe);return ln(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return ig(o,i,n),r.container()===i?cc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?x.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):x.none()).orThunk((function(){return n&&(a.each((function(t){return og(t.dom,t.dom.length)})),c.each((function(t){return rg(t.dom,0)}))),e}))}(n,i,function(t,e){return mt(t.schema.getTextInlineElements(),Me(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(dg).fold((function(){r&&lg(t,e,a)}),(function(n){r&&lg(t,e,x.some(n))}))},gg=function(t,e){return{start:t,end:e}},hg=mr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),pg=function(t,e){return xr(Te(t),"td,th",e)},vg=function(t,e){return yr(t,"table",e)},bg=function(t){return!Ne(t.start,t.end)},yg=function(t,e){return vg(t.start,e).bind((function(n){return vg(t.end,e).bind((function(t){return e=Ne(n,t),r=n,e?x.some(r):x.none();var e,r}))}))},wg=function(t){return va(t,"td,th")},xg=function(t,e){return yg(e,t).isSome()},Cg=function(t,e,n){return t.filter((function(t){return bg(t)&&xg(n,t)})).orThunk((function(){return function(t,e){var n=pg(e.startContainer,t),r=pg(e.endContainer,t);return e.collapsed?x.none():Ra(n,r,gg).fold((function(){return n.fold((function(){return r.bind((function(e){return vg(e,t).bind((function(t){return tt(wg(t)).map((function(t){return gg(t,e)}))}))}))}),(function(e){return vg(e,t).bind((function(t){return et(wg(t)).map((function(t){return gg(e,t)}))}))}))}),(function(e){return xg(t,e)?x.none():function(t,e){return vg(t.start,e).bind((function(e){return et(wg(e)).map((function(e){return gg(t.start,e)}))}))}(e,t)}))}(n,e)})).bind((function(t){return function(t,e){return yg(t,e).map((function(e){return function(t,e,n){return{rng:t,table:e,cells:n}}(t,e,wg(e))}))}(t,n)}))},Sg=function(t,e){return X(t,(function(t){return Ne(t,e)}))},kg=function(t){return function(t){return Ra(Sg(t.cells,t.rng.start),Sg(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))}(t).map((function(e){var n=t.cells;return e.length===n.length?hg.removeTable(t.table):hg.emptyCells(e)}))},Og=function(t,e){var n=function(t){return function(e){return Ne(t,e)}}(t),r=function(t,e){var n=pg(t.startContainer,e),r=pg(t.endContainer,e);return Ra(n,r,gg)}(e,n);return function(t,e,n){return t.filter((function(t){return function(t,e){return!bg(t)&&yg(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&cf(t.start,e)})).map((function(t){return t.start}))}(r,e,n).map((function(t){return hg.deleteCellSelection(e,t)})).orThunk((function(){return Cg(r,e,n).bind(kg)}))},Tg=function(t){var e;return(8===ze(e=t)||"#comment"===Me(e)?Ue(t):Ye(t)).bind(Tg).orThunk((function(){return x.some(t)}))},_g=function(t,e){return j(e,Tm),t.selection.setCursorLocation(e[0].dom,0),!0},Eg=function(t,e,n){e.deleteContents();var r,o=Tg(n).getOr(n),i=Te(t.dom.getParent(o.dom,t.dom.isBlock));if(wo(i)&&(Tm(i),t.selection.setCursorLocation(i.dom,0)),!Ne(n,i)){var u=je(i).is(n)?[]:je(r=i).map(Ge).map((function(t){return W(t,(function(t){return!Ne(r,t)}))})).getOr([]);j(u.concat(Ge(n)),(function(t){Ne(t,i)||Re(t,i)||ln(t)}))}return!0},Ag=function(t,e){return mg(t,!1,e),!0},Ng=function(t,e){return G(Am(e,t),Hr)},Rg=function(t,e){return G(Am(e,t),(function(t){return"caption"===Me(t)}))},Mg=function(t,e){return Tm(e),t.selection.setCursorLocation(e.dom,0),x.some(!0)},zg=function(t,e){return t?Cm(e):Sm(e)},Dg=function(t,e,n){var r=Te(t.getBody());return Rg(r,n).fold((function(){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return Ng(n,r).bind((function(r){return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(t){return Ng(e,Te(t.getNode())).map((function(t){return!1===Ne(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)}(t,e,r,n)||function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return zg(e,n)||el(e,t.getBody(),n).exists((function(t){return zg(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return al(t.dom).bind((function(o){return cl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Mg(t,e)}(t,r):function(t,e,n){return Rg(t,Te(n.getNode())).map((function(t){return!1===Ne(t,e)}))}(e,r,i)})).or(x.some(!0))}(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Bg=function(t,e){var n=Te(t.selection.getStart(!0)),r=of(t);return t.selection.isCollapsed()&&0===r.length?Dg(t,e,n):function(t,e){var n=Te(t.getBody()),r=t.selection.getRng(),o=of(t);return 0!==o.length?_g(t,o):function(t,e,n,r){return Rg(e,r).fold((function(){return function(t,e,n){return Og(e,n).map((function(e){return e.fold(d(Ag,t),d(_g,t),d(Eg,t))}))}(t,e,n)}),(function(e){return function(t,e){return Mg(t,e)}(t,e)})).getOr(!1)}(t,n,r,e)}(t,n)},Pg=function(t){return t.collapsed?t:function(t){var e=cc.fromRangeStart(t),n=cc.fromRangeEnd(t),r=t.commonAncestorContainer;return el(!1,r,n).map((function(o){return!Es(e,n,r)&&Es(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)}(t)},Ig=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===Vr}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Lg=function(t){return t.length>0&&(!(n=t[t.length-1]).firstChild||(e=n)&&e.firstChild&&e.firstChild===e.lastChild&&function(t){return t.data===Vr||Pn(t)}(e.firstChild))?t.slice(0,-1):t;var e,n},Hg=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Fg=function(t,e){var n=cc.after(t),r=Js(e).prev(n);return r?r.toRange():null},Vg=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Hg(e,n.startContainer),a=Lg((o=i.firstChild,xe.grep(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=cc.fromRangeStart(n),o=Js(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Hg(e,i.getNode())!==u};return s(1)?function(t,e,n){var r=t.parentNode;return xe.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=cc.before(t),r=Js(e).next(n);return r?r.toRange():null}(t,n)}(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Fg(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),xe.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Fg(e[e.length-1],n)}(u,a,c,n)},jg=Fn,Ug=function(t,e,n){var r,o,i,u,a,c,s=t.selection,l=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Te(t.getRoot());return n=Km(r,cc.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Ym(r,cc.fromRangeEnd(e))?n.replace(/( | )(<br( \/)>)?$/," "):n.replace(/ (<br( \/)?>)?$/," ")}(l,s.getRng(),e));var f=t.parser,d=n.merge,m=tm({validate:Kc(t)},t.schema),g='<span id="mce_marker" data-mce-type="bookmark"></span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},(i=t.fire("BeforeSetContent",i)).isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=i.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,g);var h=(a=s.getRng()).startContainer||(a.parentElement?a.parentElement():null),p=t.getBody();h===p&&s.isCollapsed()&&l.isBlock(p.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,p.firstChild)&&l.isEmpty(p.firstChild)&&((a=l.createRng()).setStart(p.firstChild,0),a.setEnd(p.firstChild,0),s.setRng(a)),s.isCollapsed()||function(t){var e=t.dom,n=Pg(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,jg);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,jg)&&cf(Te(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Eg(t,n,Te(r))}(t);var v,b={context:(r=s.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},y=f.parse(e,b);if(!0===n.paste&&Ig(t.schema,y)&&function(t,e){return!!Hg(t,e)}(l,r))return a=Vg(m,l,s.getRng(),y),s.setRng(a),void t.fire("SetContent",i);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(y),"mce_marker"===(c=y.lastChild).attr("id"))for(u=c,c=c.prev;c;c=c.walk(!0))if(3===c.type||!l.isBlock(c.name)){t.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(u,c,"br"===c.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),b.invalid){for(t.selection.setContent(g),r=s.getNode(),o=t.getBody(),9===r.nodeType?r=c=o:c=r;c!==o;)r=c,c=c.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return m.serialize(y)})))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=m.serialize(y),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new lm(r);xe.each(r.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)}))}}(t,d),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){i.scrollIntoView(e);var u=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(u)return o.remove(e),void i.select(u);var a=o.createRng(),c=e.previousSibling;c&&3===c.nodeType?(a.setStart(c,c.nodeValue.length),pe.ie||(r=e.nextSibling)&&3===r.nodeType&&(c.appendData(r.data),r.parentNode.removeChild(r))):(a.setStartBefore(e),a.setEndBefore(e));var s=o.getParent(e,o.isBlock);o.remove(e),s&&o.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),jg(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=cc.fromRangeStart(e);if(n=Js(t.getBody()).next(n))return n.toRange()}(a))?o.add(s,o.create("br",{"data-mce-bogus":"1"})):(a=n,o.remove(s))),i.setRng(a)}}(t,l.get("mce_marker")),v=t.getBody(),xe.each(v.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){x.from(t.getParent(e,"td,th")).map(Te).each(_m)}(l,s.getStart()),t.fire("SetContent",i),t.addVisual()}},Wg=function(t,e){e(t),t.firstChild&&Wg(t.firstChild,e),t.next&&Wg(t.next,e)},qg=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Wg(n.firstChild,(function(n){j(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),j(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(u)&&i.push(r[u]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(t,e,n);j(r,(function(t){j(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},$g=function(t){return t instanceof Jd},Gg=function(t,e){t.dom.setHTML(t.getBody(),e),function(t){Nd(t)&&al(t.getBody()).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Xg=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?function(t,e){return G(t.dom.childNodes,(function(t){return e(Te(t))})).map(Te)}(Te(n.parentNode),(function(n){return!Ne(t,n)&&e(n)})):x.none()}(t,e).isSome()},Kg=jr,Yg="_mce_caret",Jg=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Kg||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Qg=function(t){if(t){var e=new Ar(t,t);for(t=e.current();t;t=e.next())if(Mn(t))return t}return null},Zg=function(t){var e=ke("span");return qn(e,{id:Yg,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&an(e,Oe(Kg)),e},th=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Jg(e))mg(t,!1,Te(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Qg(t);return e&&e.nodeValue.charAt(0)===Kg&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&Tm(Te(u)),o.setRng(i)}},eh=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)th(t,e,n);else if(!(e=fl(t.getBody(),o.getStart())))for(;e=r.get(Yg);)th(t,e,!1)},nh=function(t,e){return t.appendChild(e),e},rh=function(t,e){var n=q(t,(function(t,e){return nh(t,e.cloneNode(!1))}),e);return nh(n,n.ownerDocument.createTextNode(Kg))},oh=function(t,e,n,r){var o,i,c,s=t.dom,l=t.selection,f=[],m=l.getRng(),g=m.startContainer,h=m.startOffset;for(i=g,3===g.nodeType&&(h!==g.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Wd(t,i,e,n,r)){c=i;break}i.nextSibling&&(o=!0),f.push(i),i=i.parentNode}if(c)if(o){var p=l.getBookmark();m.collapse(!0);var v=Zl(t,m,t.formatter.get(e),!0);v=Lf(v),t.formatter.remove(e,n,v,r),l.moveToBookmark(p)}else{var b=fl(t.getBody(),c),y=Zg(!1).dom;!function(t,e,n){var r,o,i,u=t.dom,a=u.getParent(n,d(_l,t));a&&u.isEmpty(a)?n.parentNode.replaceChild(e,n):(r=Te(n),o=va(r,"br"),i=W(function(t){for(var e=[],n=t.dom;n;)e.push(Te(n)),n=n.lastChild;return e}(r).slice(-1),Dr),o.length===i.length&&j(i,ln),u.isEmpty(n)?n.parentNode.replaceChild(e,n):u.insertAfter(e,n))}(t,y,null!==b?b:c);var w=function(t,e,n,r,o,i){var c=t.formatter,s=t.dom,l=W(rt(c.get()),(function(t){return t!==r&&!Nt(t,"removeformat")})),f=$d(t,n,l);if(W(f,(function(e){return!function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return ft(t,(function(t,e){return F(r,(function(t){return t===e}))}))};return F(t.formatter.get(e),(function(e){var r=o(e);return F(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=a),u(n).eq(t,e)}(r,e)}))}))}(t,e,r)})).length>0){var d=n.cloneNode(!1);return s.add(e,d),c.remove(r,o,d,i),s.remove(d),x.some(d)}return x.none()}(t,y,c,e,n,r),C=rh(f.concat(w.toArray()),y);th(t,b,!1),l.setCursorLocation(C,1),s.isEmpty(c)&&s.remove(c)}},ih=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(Me(e))&&!ll(e.dom)&&!En(e.dom)},uh={},ah=bt,ch=pt;uh.pre||(uh.pre=[]),uh.pre.push((function(t){var e,n=t.selection.getRng(),r=On(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),ch(ah(ah(e,r),(function(t){return r(t.previousSibling)&&-1!==yt(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Wu(n=t).remove(),Wu(e).append("<br><br>").append(n.childNodes)})))}));var sh=xe.each,lh=function(t){return kn(t)&&!wl(t)&&!ll(t)&&!En(t)},fh=function(t,e){var n;for(n=t;n;n=n[e]){if(Mn(n)&&0!==n.nodeValue.length)return t;if(kn(n)&&!wl(n))return n}return t},dh=function(t,e,n){var r,o,i=new lm(t);if(e&&n&&(e=fh(e,"previousSibling"),n=fh(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),xe.each(xe.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},mh=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=dh(t,Tl(r),r);dh(t,o,Tl(o,!0))}},gh=function(t,e,n){sh(t.childNodes,(function(t){lh(t)&&(e(t)&&n(t),t.hasChildNodes()&&gh(t,e,n))}))},hh=function(t,e){return function(n){return!(!n||!zl(t,n,e))}},ph=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},vh=mr([{keep:[]},{rename:["name"]},{removed:[]}]),bh=/^(src|href|style)$/,yh=xe.each,wh=Rl,xh=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Ch=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],kn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Mn(r)&&n&&o>=r.nodeValue.length&&(r=new Ar(r,t.getBody()).next()||r),Mn(r)&&!n&&0===o&&(r=new Ar(r,t.getBody()).prev()||r),r},Sh=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},kh=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Oh=function(t,e,n,r,o){var i=Te(e),u=Te(t.create(r,o)),a=n?$e(i):qe(i);return cn(u,a),n?(rn(i,u),un(u,i)):(on(i,u),an(u,i)),u.dom},Th=function(t,e,n,r){return!(e=Tl(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},_h=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!!wh(e,n.inline)||!!wh(e,n.block)||(n.selector?kn(e)&&t.is(e,n.selector):void 0)}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return vh.keep();var a=r;if(e.inline&&"all"===e.remove&&_(e.preserve_attributes)){var c=W(u.getAttribs(a),(function(t){return H(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),j(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return vh.rename("span")}if("all"!==e.remove){yh(e.styles,(function(t,r){t=Ml(u,Nl(t,n),r+""),D(r)&&(r=t,o=null),(e.remove_similar||!o||wh(zl(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),yh(e.attributes,(function(t,r){var i;if(t=Nl(t,n),D(r)&&(r=t,o=null),e.remove_similar||!o||wh(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",j(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);"class"===r&&a.removeAttribute("className"),bh.test(r)&&a.removeAttribute("data-mce-"+r),a.removeAttribute(r)}})),yh(e.classes,(function(t){t=Nl(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return vh.keep()}}return"none"!==e.remove?(function(t,e,n){var r,o=e.parentNode,i=t.dom,u=zc(t);n.block&&(u?o===i.getRoot()&&(n.list_block&&wh(e,n.list_block)||j(nt(e.childNodes),(function(e){El(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=kh(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0}))):i.isBlock(e)&&!i.isBlock(o)&&(Th(i,e,!1)||Th(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Th(i,e,!0)||Th(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!wh(n.inline,e)||i.remove(e,!0)}(t,a,e),vh.removed()):vh.keep()},Eh=function(t,e,n,r,o){return _h(t,e,n,r,o).fold(p,(function(e){return t.dom.rename(r,e),!0}),v)},Ah=function(t,e,n,r){return _h(t,e,n,r,r).fold(l(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),l(null))},Nh=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return j(Bl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=Wd(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=Ah(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),u.inline&&mh(f,u,0,s))}return r}(t,i,a,r,r,0,u,n)},f=function(e){var r,o;kn(e)&&c.getContentEditable(e)&&(r=a,a="true"===c.getContentEditable(e),o=!0);var s=nt(e.childNodes);if(a&&!o)for(var l=0;l<i.length&&!Eh(t,i[l],n,e,e);l++);if(u.deep&&s.length){for(l=0;l<s.length;l++)f(s[l]);o&&(a=r)}},d=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return wl(t)&&kn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),Mn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},m=function(e){var n,r,o=Zl(t,e,i,e.collapsed);if(u.split){if(o=Lf(o),(n=Ch(t,o,!0))!==(r=Ch(t,o))){if(n=Sh(n,!0),r=Sh(r,!1),xh(c,n,r)){var a=x.from(n.firstChild).getOr(n);return l(Oh(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(xh(c,r,n))return a=x.from(r.lastChild).getOr(r),l(Oh(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);n=kh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=kh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),ef(c,s,(function(t){j(t,(function(t){wl(t)||wl(t.parentNode)||l(t)}))})),l(n),l(r),n=d(!0),r=d()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}ef(c,o,(function(e){j(e,(function(e){f(e),j(["underline","line-through","overline"],(function(n){kn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Dl(c,e.parentNode)===n&&Eh(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)if(kl(r)){var g=c.createRng();g.setStartBefore(r),g.setEndAfter(r),m(g)}else m(r);else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&u.inline&&!of(t).length?oh(t,e,n,o):(df(s,!0,(function(){ff(t,m)})),u.inline&&qd(t,e,n,s.getStart())&&Ol(c,s,s.getRng()),t.nodeChanged());else{r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!Eh(t,i[h],n,r,r));h++);}},Rh=xe.each,Mh=xe.each,zh=function(t,e){return gt(t,e)},Dh=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(e=e||i,t){if(e.onformat&&e.onformat(t,e,n,r),Mh(e.styles,(function(e,r){a.setStyle(t,r,Nl(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Mh(e.attributes,(function(e,r){a.setAttrib(t,r,Nl(e,n))})),Mh(e.classes,(function(e){e=Nl(e,n),a.hasClass(t,e)||a.addClass(t,e)}))}},l=function(t,e){var n=!1;return!!Il(i)&&(Mh(t,(function(t){if(!("collapsed"in t)||t.collapsed===u)return a.is(e,t.selector)&&!ll(e)?(s(e,t),n=!0,!1):void 0})),n)},f=function(r,u,a,c){var f=[],d=!0,m=i.inline||i.block,g=r.create(m);s(g),ef(r,u,(function(u){var a,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),y=u.parentNode.nodeName.toLowerCase();if(kn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Pn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Ll(e)){var o=St(St({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=Xg(Te(n),(function(t){return ll(t.dom)}));return gt(o,r)&&wo(Te(n.parentNode),!1)&&!i}return!1}(t,i,u,y))return a=null,void(Pl(i)&&r.remove(u));if(i.wrapper&&Wd(t,u,e,n))a=null;else{if(d&&!p&&Pl(i)&&!i.wrapper&&_l(t,b)&&El(t,y,m)){var w=r.rename(u,m);return s(w),f.push(w),void(a=null)}if(Il(i)){var x=l(o,u);if(!zh(i,"inline")||x)return void(a=null)}!d||p||!El(t,m,b)||!El(t,y,m)||!c&&3===u.nodeType&&1===u.nodeValue.length&&65279===u.nodeValue.charCodeAt(0)||ll(u)||zh(i,"inline")&&r.isBlock(u)?(a=null,Mh(xe.grep(u.childNodes),h),p&&(d=v),a=null):(a||(a=r.clone(g,!1),u.parentNode.insertBefore(a,u),f.push(a)),a.appendChild(u))}};Mh(u,h)})),!0===i.links&&Mh(f,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),Mh(xe.grep(t.childNodes),e)};e(t)})),Mh(f,(function(u){var a=function(t){var e=0;return Mh(t.childNodes,(function(t){(function(t){return M(t)&&Mn(t)&&0===t.length})(t)||wl(t)||e++})),e}(u);!(f.length>1)&&r.isBlock(u)||0!==a?(Ll(i)||i.wrapper)&&(i.exact||1!==a||(u=function(t){var e,n=function(t){var e=!1;return Mh(t.childNodes,(function(t){if(function(t){return t&&1===t.nodeType&&!wl(t)&&!ll(t)&&!En(t)}(t))return e=t,!1})),e}(t);return n&&!wl(n)&&jd(r,n,i)&&(e=r.clone(n,!1),s(e),r.replace(e,t,!0),r.remove(n,!0)),e||t}(u)),function(t,e,n,r){Rh(e,(function(e){Rh(t.dom.select(e.inline,r),(function(r){lh(r)&&Eh(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";sh(t.select(r,n),(function(n){lh(n)&&sh(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))}(t,o,n,u),function(t,e,n,r,o){Wd(t,o.parentNode,n,r)&&Eh(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(Wd(t,i,n,r))return Eh(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&gh(r,hh(t,"fontSize"),ph(t,"backgroundColor",Nl(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Dl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(xe.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(gh(r,hh(t,"fontSize"),ph(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),mh(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(kl(r)){if(!l(o,r)){var d=a.createRng();d.setStartBefore(r),d.setEndAfter(r),f(a,Zl(t,d,o),0,!0)}}else f(a,r,0,!0);else if(u&&Ll(i)&&!of(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=fl(t.getBody(),i.getStart()))&&(o=Qg(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=Zl(t,u,t.formatter.get(e));m=Lf(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Kg||(s=t.getDoc(),l=Zg(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)}(t,e,n);else{var m=c.getNode(),g=o[0];t.settings.forced_root_block||!g.defaultBlock||a.getParent(m,a.isBlock)||Dh(t,g.defaultBlock),c.setRng(Pg(c.getRng())),df(c,!0,(function(e){ff(t,(function(e,n){var r=n?e:Zl(t,e,o);f(a,r)}))})),Ol(a,c,c.getRng()),t.nodeChanged()}!function(t,e){ch(uh[t],(function(t){t(e)}))}(e,t)}}else{r=c.getNode();for(var h=0,p=o.length;h<p;h++){var v=o[h];if(v.ceFalseOverride&&Il(v)&&a.is(r,v.selector))return void s(r,v)}}},Bh=function(t,e,n,r){return lt(t,(function(t,o){return!!mt(e,o)||(j(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},Ph=function(t,e,n,r,o){return null===e.get()&&function(t,e){var n=ra({});t.set({}),e.on("NodeChange",(function(r){!function(t,e,n,r){var o=rt(n.get()),i={},u={},a=W(Bl(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));it(r,(function(e,n){xe.each(a,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(j(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:a})})),i[n]=e.callbacks),u[n]=e.callbacks,!1):!Fd(t,r,n)&&void 0}))}));var c=Bh(n.get(),u,e,a);n.set(St(St({},i),c))}(e,r.element,n,t.get())}))}(e,t),function(t,e,n,r){var o=t.get();j(e.split(","),(function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)})),t.set(o)}(e,n,r,o),{unbind:function(){return function(t,e,n){var r=t.get();j(e.split(","),(function(t){r[t].callbacks=W(r[t].callbacks,(function(t){return t!==n})),0===r[t].callbacks.length&&delete r[t]})),t.set(r)}(e,n,r)}}},Ih=function(t,e){var n=(e||document).createDocumentFragment();return j(t,(function(t){n.appendChild(t.dom)})),Te(n)},Lh=function(t,e,n){return{element:t,width:e,rows:n}},Hh=function(t,e){return{element:t,cells:e}},Fh=function(t,e){return{x:t,y:e}},Vh=function(t,e){var n=parseInt($n(t,e),10);return isNaN(n)?1:n},jh=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Uh=function(t){return $(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},Wh=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Ne(o[i],e))return x.some(Fh(i,r));return x.none()},qh=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Hh(u[a].element,s))}return i},$h=function(t){return function(t,e){var n=_a(t.element),r=ke("tbody");return cn(r,e),an(n,r),n}(t,function(t){return V(t.rows,(function(t){var e=V(t.cells,(function(t){var e=Ea(t);return Xn(e,"colspan"),Xn(e,"rowspan"),e})),n=_a(t.element);return cn(n,e),n}))}(t))},Gh=function(t,e){return G(t,(function(t){return"li"===Me(t)&&cf(t,e)})).fold(l([]),(function(e){return function(t){return G(t,(function(t){return"ul"===Me(t)||"ol"===Me(t)}))}(t).map((function(t){var e=ke(Me(t));return function(t,e){var n=t.dom;it(e,(function(t,e){!function(t,e,n){if(!O(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);jn(t)&&t.style.setProperty(e,n)}(n,e,t)}))}(e,ft(Qn(t),(function(t,e){return Rt(e,"list-style")}))),[ke("li"),e]})).getOr([])}))},Xh=function(){return Ih([])},Kh=function(t,e){return n=Te(e.cloneContents()),r=function(t,e){var n=Te(e.commonAncestorContainer),r=Am(n,t),o=W(r,(function(t){return zr(t)||Rr(t)})),i=Gh(r,e),u=o.concat(i.length?i:function(t){return Ir(t)?je(t).filter(Pr).fold(l([]),(function(e){return[t,e]})):Pr(t)?[t]:[]}(n));return V(u,_a)}(t,e),o=$(r,(function(t,e){return an(e,t),e}),n),r.length>0?Ih([o]):o;var n,r,o},Yh=function(t,e){return(n=t,r=e[0],yr(r,"table",d(Ne,n))).bind((function(t){var n,r,o,i=e[0],u=e[e.length-1],a=function(t){var e=Lh(_a(t),0,[]);return j(va(t,"tr"),(function(t,n){j(va(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=Vh(o,"rowspan"),u=Vh(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Hh(Ea(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:_a(o)}}(e,function(t,e,n){for(;jh(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),Lh(e.element,Uh(e.rows),e.rows)}(t);return(n=a,r=i,o=u,Wh(n,r).bind((function(t){return Wh(n,o).map((function(e){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?qh(t,r,o,i,u):qh(t,r,u,i,o);return Lh(t.element,Uh(a),a)}(n,t,e)}))}))).map((function(t){return Ih([$h(t)])}))})).getOrThunk(Xh);var n,r},Jh=function(t,e){return e>=0&&e<t.length&&Cl(t.charAt(e))},Qh=function(t,e){var n=Wr(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Zh=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return x.from(t.selection.getRng()).map((function(e){var n=x.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=pe.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=Qh(u,i),c=Wr(u.textContent);if(t.dom.remove(u),Jh(c,0)||Jh(c,c.length-1)){var s=n.getOr(r),l=Qh(s,i),f=l.indexOf(a);return-1===f?a:(Jh(l,f-1)?" ":"")+a+(Jh(l,f+a.length)?" ":"")}return a})).getOr("")}(t);n.getInner=!0;var r=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=Pd(t,nf(o)),u=e.contextual?function(t,e){var n=rf(e,t);return n.length>0?Yh(t,n):function(t,e){return e.length>0&&e[0].collapsed?Xh():Kh(t,e[0])}(t,e)}(Te(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)},tp=function(t){return kn(t)?t.outerHTML:Mn(t)?Io.encodeRaw(t.data,!1):zn(t)?"\x3c!--"+t.data+"--\x3e":""},ep=function(t,e){var n,r,o,i,u,a,c,s,l,f=V(nt(e.childNodes),tp);return function(t,e){var n=0;j(t,(function(t){0===t[0]?n++:1===t[0]?(function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)}(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},np=ra(x.none()),rp=function(t){var e,n=(e=t.getBody(),W(V(nt(e.childNodes),tp),(function(t){return t.length>0}))),r=K(n,(function(e){var n=am(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},op=function(t,e,n){"fragmented"===e.type?ep(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},ip=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},up=function(t){var e=ke("body",np.get().getOrThunk((function(){var t=document.implementation.createHTMLDocument("undo");return np.set(x.some(t)),t})));return Oa(e,ip(t)),j(va(e,"*[data-mce-bogus]"),fn),e.dom.innerHTML},ap=function(t,e){return!(!t||!e)&&(!!function(t,e){return ip(t)===ip(e)}(t,e)||function(t,e){return up(t)===up(e)}(t,e))},cp=function(t){return 0===t.get()},sp=function(t,e,n){cp(n)&&(t.typing=e)},lp=function(t,e){t.typing&&(sp(t,!1,e),t.add())},fp=function(t){return t instanceof Jd},dp=function(t,e){qg(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},mp=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){cp(e)&&n.set(x.some(Ac(t.selection)))}(t,e,n)},addUndoLevel:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=rp(t);if(i=i||{},i=xe.extend(i,a),!1===cp(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&ap(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Ac(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,sp(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],op(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],op(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!ap(rp(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return lp(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];op(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r){return qd(t,e,n,r)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&Wd(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return Wd(t,e,n,r,o)},canApply:function(e){return function(t,e){var n,r,o,i,u,a=t.formatter.get(e),c=t.dom;if(a)for(n=t.selection.getStart(),r=Bl(c,n),i=a.length-1;i>=0;i--){if(!(u=a[i].selector)||a[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],u))return!0}return!1}(t,e)},closest:function(e){return function(t,e){var n=function(e){return Ne(e,Te(t.getBody()))};return x.from(t.selection.getStart(!0)).bind((function(r){return Ld(Te(r),(function(n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n]);if(r.isSome())return r}return x.none()}(e,(function(e){return function(e,n){return Wd(t,e.dom,n)?x.some(n):x.none()}(n,e)}))}),n)})).getOrNull()}(t,e)},apply:function(e,n,r){return Dh(t,e,n,r)},remove:function(e,n,r,o){return Nh(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!qd(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Dh(t,e,n,r):Nh(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o){return Ph(t,e,n,r,o)}},editor:{getContent:function(e,n){return function(t,e,n){return x.from(t.getBody()).fold(l("tree"===e.format?new Jd("body",11):""),(function(r){return function(t,e,n,r){var o;return e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),o="raw"===e.format?xe.trim(cm(t.serializer,r.innerHTML)):"text"===e.format?t.dom.isEmpty(r)?"":Wr(r.innerText||r.textContent):"tree"===e.format?t.serializer.serialize(r,e):function(t,e){var n=zc(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,e)),H(["text","tree"],e.format)||Fr(Te(r))?e.content=o:e.content=xe.trim(o),e.no_events||t.fire("GetContent",e),e.content}(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=$g(e)?"":e,n.no_events||t.fire("BeforeSetContent",n),$g(e)||(e=n.content),x.from(t.getBody()).fold(l(e),(function(r){return $g(e)?function(t,e,n,r){qg(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tm({validate:t.validate},t.schema).serialize(n);return r.content=Fr(Te(e))?o:xe.trim(o),Gg(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),(o=zc(t))&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,Dc(t),n)):n||(n='<br data-mce-bogus="1">'),Gg(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=tm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=Fr(Te(e))?n:xe.trim(n),Gg(t,r.content),r.no_events||t.fire("SetContent",r)),r.content}(t,r,e,n)}))}(t,e,n)},insertContent:function(e,n){return Ug(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=M(e)?e:t.getBody();N(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),j(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Zh(t,e,n)}},raw:{getModel:function(){return x.none()}}}},gp=function(t){return mt(t.plugins,"rtc")},hp=function(t){return t.rtcInstance?t.rtcInstance:mp(t)},pp=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},vp=function(t){return 0===t.dom.length?(ln(t),x.none()):x.some(t)},bp=function(t,e,n,r){t.bind((function(t){return(r?og:rg)(t.dom,r?t.dom.length:0),e.filter(Pe).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(ig(o,i,!1,!r),n.setStart(i,u)):(ig(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return yf.isBookmarkNode(t.dom)})).bind(e?We:Ue)}(e,r).or(e).filter(Pe).map((function(t){return function(t,e){je(t).each((function(n){var r=t.dom;e&&Km(n,cc(r,0))?rg(r,0):!e&&Ym(n,cc(r,r.length))&&og(r,r.length)}))}(t,r)}))}))},yp=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=W(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}},wp=function(t){return!!t.select},xp=function(t){return!(!t||!t.ownerDocument)&&Re(Te(t.ownerDocument),Te(t))},Cp=function(t,e,n,r){var o,i,u=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};xe.each(n,(function(e,n){xe.each(i,(function(o){if(t.is(o,n))return r[n]||(xe.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),xe.each(r,(function(t,e){u[e]||(delete r[e],xe.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){yp(n,o,i),yp(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return function(t,e,n){void 0===n&&(n={});var r=function(t,e){return St(St({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e);if(r.no_events||!(r=t.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,St(St({isRootContent:!0,forced_root_block:!1},o),e));return tm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,r);var o=t.selection.getRng();!function(t,e){var n=x.from(e.firstChild).map(Te),r=x.from(e.lastChild).map(Te);t.deleteContents(),t.insertNode(e);var o=n.bind(Ue).filter(Pe).bind(vp),i=r.bind(We).filter(Pe).bind(vp);bp(o,n,t,!0),bp(i,r,t,!1),t.collapse(!1)}(o,o.createContextualFragment(n.content)),t.selection.setRng(o),ud(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)}(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var l=e.document;if(null==l)return null;if(void 0!==r.bookmark&&!1===Nd(r)){var f=xd(r);if(f.isSome())return f.map((function(t){return Pd(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Sn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=Pd(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!wp(t)||xp(t.startContainer)&&xp(t.endContainer))}(t)){var u=wp(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||pe.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Sn(n)||Sn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(sf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return pp(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)}(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return x.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(sf(t,o,e,!0),sf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Bd(r.nextSibling,!0):r.parentNode,o=0===u?Bd(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return zd(r.getBody(),l(),t)},getEnd:function(t){return Dd(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||zd(u,e,e.collapsed),t.isBlock),r=t.getParent(r||Dd(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Ar(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(nf(n).length>1)&&lf(r)){var o=Pf(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?rd:id)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(Tf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?cc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=yf(m),h=kf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Sp=function(t,e){var n=di();e.convert_fonts_to_spans&&function(t,e,n){t.addNodeFilter("font",(function(t){j(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){j(["color","face","size"],(function(e){t.attr(e,null)}))}(t)}))}))}(t,n,xe.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){j(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},kp=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Op=function(t,e){var n;try{n=atob(e)}catch(t){return x.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return x.some(new Blob([r],{type:t}))},Tp=function(t){return 0===t.indexOf("blob:")?function(t){return new Cr((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===this.status?e(this.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new Cr((function(t){var n=kp(e),r=n.type,o=n.data;Op(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},_p=0,Ep=function(t){return(t||"blobid")+_p++};function Ap(t,e){var n={};return{findAll:function(r,o){o||(o=v);var i=W(function(t){return t?nt(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!pe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===pe.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),u=V(i,(function(t){if(void 0!==n[t.src])return new Cr((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Cr((function(n,r){!function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=kp(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){(function(t){return new Cr((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=kp(u).data,i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))}(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Cr.all(u)}}}var Np,Rp,Mp=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Jd("br",1)).shortEnded=!0:r.empty().append(new Jd("#text",3)).value=Vr},zp=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Dp=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Bp=xe.makeMap,Pp=xe.each,Ip=xe.explode,Lp=xe.extend,Hp=function(t,e){void 0===e&&(e=Go());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e,u,a;(u=t.name)in n&&((a=o[u])?a.push(t):o[u]=[t]),e=r.length;for(;e--;)(u=r[e].name)in t.attributes.map&&((a=i[u])?a.push(t):i[u]=[t]);return t},a={schema:e,addAttributeFilter:function(t,e){Pp(Ip(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Pp(Ip(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v,b=[];c=c||{},o={},i={};var y=Lp(Bp("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=e.getNonEmptyElements(),x=e.children,C=t.validate,S=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),k=e.getWhiteSpaceElements(),O=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,_=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;p=k.hasOwnProperty(c.context)||k.hasOwnProperty(t.root_name);var A=function(t,e){var r,i=new Jd(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){var n,r,o,i,u=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!u[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},R=um({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(A("#cdata",4)).value=t},text:function(t,e){var n;p||(t=t.replace(_," "),function(t,e){return t&&(e[t.name]||"br"===t.name)}(v.lastChild,y)&&(t=t.replace(O,""))),0!==t.length&&((n=A("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(A("#comment",8)).value=t},pi:function(t,e){v.append(A(t,7)).value=e,N(v)},doctype:function(t){v.append(A("#doctype",10)).value=t,N(v)},start:function(t,n,o){var u,a,c,s,l=C?e.getElementRule(t):{};if(l){for((u=A(l.outputName||t,1)).attributes=n,u.shortEnded=o,v.append(u),(s=x[v.name])&&x[u.name]&&!s[u.name]&&b.push(u),a=r.length;a--;)(c=r[a].name)in n.map&&((g=i[c])?g.push(u):i[c]=[u]);y[t]&&N(u),o||(v=u),!p&&k[t]&&(p=!0)}},end:function(n){var r,o,i,u,a=C?e.getElementRule(n):{};if(a){if(y[n]&&!p){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(O,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(p&&k[n]&&(p=!1),a.removeEmpty&&Dp(e,w,k,v))return u=v.parent,y[v.name]?v.empty().remove():v.unwrap(),void(v=u);a.paddEmpty&&(function(t){return zp(t,"#text")&&t.firstChild.value===Vr}(v)||Dp(e,w,k,v))&&Mp(t,c,y,v),v=v.parent}}},e),M=v=new Jd(c.context||t.root_name,11);if(R.parse(a,c.format),C&&b.length&&(c.context?c.invalid=!0:function(t){var n,r,o,i,a,c,s,l,f,d,m,g=Bp("tr,td,th,tbody,thead,tfoot,table"),h=e.getNonEmptyElements(),p=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if((r=t[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!g[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),a=c=u(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(c.name,i[f].name)?(s=u(i[f].clone()),c.append(s)):s=c,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,s.append(l),l=m;c=s}Dp(e,h,p,a)?o.insert(r,i[0],!0):(o.insert(a,i[0],!0),o.insert(r,a)),o=i[0],(Dp(e,h,p,o)||zp(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ol"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ol"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(u(new Jd("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(u(new Jd("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}}(b)),S&&("body"===M.name||c.isRootContent)&&function(){var n,r,o=M.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(O,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(e.isValidChild(M.name,S.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=A(S,1)).attr(t.forced_root_block_attrs),M.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!c.invalid){for(h in o)if(o.hasOwnProperty(h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return M}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=xe.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Dp(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&Mp(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new Jd("#text",3)).value=Vr,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(void 0,r=(n=i.attr("rel"))?xe.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Jd("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e,r,o,i,u,a,c,s=t.length,l=n.getValidClasses();s--;){for(r=(e=t[s]).attr("class").split(" "),u="",o=0;o<r.length;o++)i=r[o],c=!1,(a=l["*"])&&a[i]&&(c=!0),a=l[e.name],!c&&a&&a[i]&&(c=!0),c&&(u&&(u+=" "),u+=i);u.length||(u=null),e.attr("class",u)}})),function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(function(t){return t.attr("src")===pe.transparentSrc||t.attr("data-mce-placeholder")})(t)||function(t){return t.attr("data-mce-bogus")}(t)||(r=i,o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r),o?x.some({type:o[1],data:decodeURIComponent(o[2])}):x.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),it(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return x.from(n.getByData(r,e)).orThunk((function(){return Op(e,r).map((function(t){var e=n.create(Ep(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return j(t,r)}))}(t,e)}(a,t),function(t,e){e.inline_styles&&Sp(t,e)}(a,t),a},Fp=function(t,e,n){-1===xe.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},Vp=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Qu.DOM,o=e&&e.schema?e.schema:Go(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=Hp(t,o);return function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o,i,u=t.length,a="data-mce-"+r,c=e.url_converter,s=e.url_converter_scope;u--;)void 0!==(i=(o=t[u]).attr(a))?(o.attr(r,i.length>0?i:null),o.attr(a,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))})),t.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r,o=t.length;o--;)"bookmark"!==(r=t[o]).attr("data-mce-type")||n.cleanup||(x.from(r.firstChild).exists((function(t){return!Ur(t.value)}))?r.unwrap():r.remove())})),t.addNodeFilter("noscript",(function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=Io.decode(e.value))})),t.addNodeFilter("script,style",(function(t,n){for(var r,o,i,u=t.length,a=function(t){return t.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,"")};u--;)o=(r=t[u]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+a(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+a(o)+"\n--\x3e")})),t.addNodeFilter("#comment",(function(t){for(var r,o=t.length;o--;)r=t[o],e.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),t.addAttributeFilter("data-mce-type",(function(e){j(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r),{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=St({format:"html"},u),c=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o,i=t.dom;e=e.cloneNode(!0);var u=document.implementation;return u.createHTMLDocument&&(r=u.createHTMLDocument(""),xe.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){r.body.appendChild(r.importNode(t,!0))})),e="BODY"!==e.nodeName?r.body.firstChild:r.body,o=i.doc,i.doc=r),function(t,e){t.fire("PreProcess",e)}(t,St(St({},n),{node:e})),o&&(i.doc=o),e}(t,e,n):e}(e,n,a),s=function(t,e,n){var r=Wr(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||Fr(Te(e))?r:xe.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?St({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,St(St({},e),{content:n})).content:n}(t,o,function(t,e,n){return tm(t,e).serialize(n)}(e,n,r))}(e,t,o,l,a)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:d(Fp,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},jp=function(t,e){var n=Vp(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Up=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return hp(t).editor.setContent(e,n)}(t,e,n)},Wp=Qu.DOM,qp=function(t){return x.from(t).each((function(t){return t.destroy()}))},$p=Object.prototype.hasOwnProperty,Gp=(Np=function(t,e){return T(t)&&T(e)?Gp(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)$p.call(o,i)&&(n[i]=Np(n[i],o[i]))}return n}),Xp=ae().deviceType,Kp=Xp.isTouch(),Yp=Xp.isPhone(),Jp=Xp.isTablet(),Qp=["lists","autolink","autosave"],Zp={table_grid:!1,object_resizing:!1,resize:!1},tv=function(t){var e=_(t)?t.join(" "):t,n=V(O(e)?e.split(" "):[],zt);return W(n,(function(t){return t.length>0}))},ev=function(t,e){return t.sections().hasOwnProperty(e)},nv=function(t,e){return dt(t,"toolbar_mode").orThunk((function(){return dt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},rv=function(t,e){var n={resize:!1,toolbar_mode:nv(t,"scrolling"),toolbar_sticky:!1};return St(St(St({},Zp),n),e?{menubar:!1}:{})},ov=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?xe.extend({},t.external_plugins,n):n},iv=function(t,e,n,r){var o=tv(n.forced_plugins),i=tv(r.plugins),u=function(t,e){return ev(t,e)?t.sections()[e]:{}}(e,"mobile"),a=function(t,e){return[].concat(tv(t)).concat(tv(e))}(o,function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return ev(t,e)&&"mobile"===r[e].theme}(e,"mobile")?W(r,d(H,Qp)):t&&ev(e,"mobile")?r:n}(t,e,i,u.plugins?tv(u.plugins):i));if(pe.browser.isIE()&&H(a,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return xe.extend(r,{plugins:a.join(" ")})},uv=function(t,e,n,r,o){var i=t?{mobile:rv(o.mobile||{},e)}:{},u=function(t,e){var n=lt(e,(function(e,n){return H(t,n)}));return function(t,e){return{sections:l(t),settings:l(e)}}(n.t,n.f)}(["mobile"],Gp(i,o)),a=xe.extend(n,r,u.settings(),function(t,e){return t&&ev(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return xe.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:ov(r,u.settings())});return iv(t,u,r,a)},av=function(t,e,n){return x.from(e.settings[n]).filter(t)},cv=(Rp={},{add:function(t,e){Rp[t]=e},get:function(t){return Rp[t]?Rp[t]:{icons:{}}},has:function(t){return mt(Rp,t)}}),sv=function(t,e){return e.dom[t]},lv=function(t,e){return parseInt(Kn(e,t),10)},fv=d(sv,"clientWidth"),dv=d(sv,"clientHeight"),mv=d(lv,"margin-top"),gv=d(lv,"margin-left"),hv=function(t,e,n){var r=Te(t.getBody()),o=t.inline?r:Te(Fe(r).dom.documentElement),i=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+gv(e):0),y:r-(t?o.top+e.dom.clientTop+mv(e):0)}}(t.inline,o,e,n);return function(t,e,n){var r=fv(t),o=dv(t);return e>=0&&n>=0&&e<=r&&n<=o}(o,i.x,i.y)};function pv(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return x.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){X(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&function(t){var e;return(e=t.inline?t.getBody():t.getContentAreaContainer(),x.from(e).map(Te)).map(dn).getOr(!1)}(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),G(e,(function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(u,(function(){i(a),o(),r().fold((function(){return t.focus()}),(function(t){return Te(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",St({},a)),a}))};return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1)})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Tr.requestAnimationFrame(o)})),t.on("remove",(function(){j(e.slice(),(function(t){n().close(t)}))}))}(t),{open:u,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:function(){return e}}}var vv=sa.PluginManager,bv=sa.ThemeManager,yv=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=W(e,(function(t){return t!==n}))).length&&t.focus()},i=function(n){t.editorManager.setActive(t),wd(t);var r=n();return function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)}(r),r};return t.on("remove",(function(){j(e,(function(t){n().close(t)}))})),{open:function(t,e){return i((function(){return n().open(t,e,o)}))},openUrl:function(t){return i((function(){return n().openUrl(t,o)}))},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){x.from(e[e.length-1]).each((function(t){n().close(t),o(t)}))}}},wv=function(t,e){t.notificationManager.open({type:"error",text:e})},xv=function(t,e){t._skinLoaded?wv(t,e):t.on("SkinLoaded",(function(){wv(t,e)}))},Cv=function(t,e,n){!function(t,e,n){t.fire(e,n)}(t,e,{message:n}),console.error(n)},Sv=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},kv=function(t,e,n){Cv(t,"PluginLoadError",Sv("plugin",e,n))},Ov=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,kt([t],e)):r.log.apply(r,kt([t],e)))};function Tv(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);u&&"string"==typeof u.location?n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o)):r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){xe.each(n[t],(function(t){t(e)})),delete n[t]};return!1===z(e.handler)&&(e.handler=r),{upload:function(a,c){return e.url||e.handler!==r?function(r,a){return r=xe.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Cr.all(xe.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Cr((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new Cr((function(a){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||(c||(c=r()),c.progressBar.value(t))}))}catch(t){a(i(e,t.message,{}))}}))}(r,e.handler,a)})))}(a,c):new Cr((function(t){t([])}))}}}var _v=0,Ev=function(t){return t+_v+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e};var Av,Nv=xe.each,Rv=Qu.DOM,Mv=function(t,e){var n,r,o,i=e&&e.schema||Go({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Rv.create(r.name);return function(t,e){e.classes.length&&Rv.addClass(t,e.classes.join(" ")),Rv.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==xe.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Rv.create("div")).appendChild(t),xe.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Rv.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},zv=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=xe.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==xe.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},Dv=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return O(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=dt(e,"preview");if(c.is(!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),xe.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=xe.map(t.split(/(?:~\+|~|\+)/),zv),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Mv(l,t)):r=Mv([n],t);var f=Rv.select(n,r)[0]||r.firstChild;return Nv(e.styles,(function(t,e){var n=a(t);n&&Rv.setStyle(f,e,n)})),Nv(e.attributes,(function(t,e){var n=a(t);n&&Rv.setAttrib(f,e,n)})),Nv(e.classes,(function(t){var e=a(t);Rv.hasClass(f,e)||Rv.addClass(f,e)})),t.fire("PreviewFormats"),Rv.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Rv.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Nv(u.split(" "),(function(e){var n=Rv.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Rv.getStyle(t.getBody(),e,!0),"#ffffff"===Rv.toHex(n).toLowerCase())||"color"===e&&"#000000"===Rv.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Rv.remove(r),i},Bv=function(t){var e=function(t){var e={},n=function(t,r){t&&("string"!=typeof t?xe.each(t,(function(t,e){n(e,t)})):(_(r)||(r=[r]),xe.each(r,(function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),e[t]=r))};return n(function(t){var e={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",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",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"}],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",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",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:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],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",defaultBlock:"p",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:function(t,e,n){return kn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){xe.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 xe.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return t?e[t]:e},has:function(t){return mt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}}(t),n=ra(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();eh(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Kg||eh(t,fl(r,n.getStart())),37!==e&&39!==e||eh(t,fl(r,n.getStart()))}(t,e.keyCode)}))}(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){pp(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){pp(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){pp(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r){return function(t,e,n,r){return pp(t).formatter.match(e,n,r)}(t,e,n,r)},closest:function(e){return function(t,e){return pp(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return pp(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return pp(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return pp(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o){return function(t,e,n,r,o){return void 0===o&&(o=!1),pp(t).formatter.formatChanged(e,n,r,o)}(t,n,e,r,o)},getCssText:d(Dv,t)}},Pv=function(t){var e=ra(x.none()),n=ra(0),r=ra(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){pp(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return pp(t).undoManager.addUndoLevel(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return pp(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return pp(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){pp(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){pp(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return pp(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return pp(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return pp(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){pp(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){pp(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return gp(t)||function(t,e,n){var r=ra(!1),o=function(t){sp(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(lp(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===ap(rp(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),sp(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Iv=[9,27,Cf.HOME,Cf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Cf.DOWN,Cf.UP,Cf.LEFT,Cf.RIGHT].concat(pe.browser.isFirefox()?[224]:[]),Lv="data-mce-placeholder",Hv=function(t){return"keydown"===t.type||"keyup"===t.type},Fv=function(t){var e=t.keyCode;return e===Cf.BACKSPACE||e===Cf.DELETE},Vv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,jv=function(t,e){return Ee(Te(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Uv=function(t,e,n){var r=function(t,e,n){return W(Qu.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return x.from(r[r.length-1])},Wv=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Xr(n)?Mn(n.nextSibling)?cc(n.nextSibling,0):cc.after(n):Jr(e)?cc(n,r+1):e:Xr(n)?Mn(n.previousSibling)?cc(n.previousSibling,n.previousSibling.data.length):cc.before(n):Qr(e)?cc(n,r-1):e},qv=d(Wv,!0),$v=d(Wv,!1),Gv=function(t,e){return Re(t,e)?br(e,(function(t){return Br(t)||Ir(t)}),function(t){return function(e){return Ne(t,Te(e.dom.parentNode))}}(t)):x.none()},Xv=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Kv=function(t,e){return{from:t,to:e}},Yv=function(t,e){var n=Te(t),r=Te(e.container());return Gv(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},Jv=function(t){var e=Ge(t);return X(e,Mr).fold((function(){return e}),(function(t){return e.slice(0,t)}))},Qv=function(t){var e=Jv(t);return j(e,ln),e},Zv=function(t,e){var n=Am(e,t);return G(n.reverse(),(function(t){return wo(t)})).each(ln)},tb=function(t,e,n,r){if(wo(n))return Tm(n),al(n.dom);0===W(qe(r),(function(t){return!wo(t)})).length&&wo(e)&&rn(r,ke("br"));var o=ul(n.dom,cc.before(r.dom));return j(Qv(e),(function(t){rn(r,t)})),Zv(t,e),o},eb=function(t,e,n){if(wo(n))return ln(n),wo(e)&&Tm(e),al(e.dom);var r=cl(n.dom);return j(Qv(e),(function(t){an(n,t)})),Zv(t,e),r},nb=function(t,e){ol(t,e.dom).map((function(t){return t.getNode()})).map(Te).filter(Dr).each(ln)},rb=function(t,e,n){return nb(!0,e),nb(!1,n),function(t,e){return Re(e,t)?function(t,e){var n=Am(e,t);return x.from(n[n.length-1])}(e,t):x.none()}(e,n).fold(d(eb,t,e,n),d(tb,t,e,n))},ob=function(t,e,n,r){return e?rb(t,r,n):rb(t,n,r)},ib=function(t,e){var n=Te(t.getBody()),r=function(t,e,n){return n.collapsed?function(t,e,n){var r=Yv(t,cc.fromRangeStart(n)),o=r.bind((function(n){return el(e,t,n.position).bind((function(n){return Yv(t,n).map((function(n){return function(t,e,n){return Pn(n.position.getNode())&&!1===wo(n.block)?ol(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?el(e,t,r).bind((function(e){return Yv(t,e)})):x.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Ra(r,o,Kv).filter((function(t){return function(t){return!1===Ne(t.from.block,t.to.block)}(t)&&function(t){return je(t.from.block).bind((function(e){return je(t.to.block).filter((function(t){return Ne(e,t)}))})).isSome()}(t)&&function(t){return!1===Hn(t.from.block.dom)&&!1===Hn(t.to.block.dom)}(t)}))}(t,e,n):x.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ob(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},ub=function(t,e){var n=Te(e),r=d(Ne,t);return vr(n,Hr,r).isSome()},ab=function(t){var e=Te(t.getBody());return function(t,e){var n=ul(t.dom,cc.fromRangeStart(e)).isNone(),r=il(t.dom,cc.fromRangeEnd(e)).isNone();return!function(t,e){return ub(t,e.startContainer)||ub(t,e.endContainer)}(t,e)&&n&&r}(e,t.selection.getRng())?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ra(Gv(t,Te(n.startContainer)),Gv(t,Te(n.endContainer)),(function(r,o){return!1===Ne(r,o)&&(n.deleteContents(),ob(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},cb=function(t,e){return!t.selection.isCollapsed()&&ab(t)},sb=Ln,lb=Hn,fb=function(t,e,n,r,o){return x.from(e._selectionOverrides.showCaret(t,n,r,o))},db=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?x.none():x.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},mb=function(t,e,n){var r=Bs(1,t.getBody(),e),o=cc.fromRangeStart(r),i=o.getNode();if(gs(i))return fb(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(gs(u))return fb(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return lb(t)||sb(t)}));return gs(a)?fb(1,t,a,!1,n):x.none()},gb=function(t,e,n){return e.collapsed?mb(t,e,n).getOr(e):e},hb=function(t){return km(t)||wm(t)},pb=function(t){return Om(t)||xm(t)},vb=function(t,e,n,r,o,i){return fb(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},bb=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Mn(n.commonAncestorContainer))return!1;var r=e?ac.Forwards:ac.Backwards,o=Js(t.getBody()),i=d(Hs,e?o.next:o.prev),u=e?hb:pb,a=Is(r,t.getBody(),n),c=Wv(e,i(a));if(!c||!Fs(a,c))return!1;if(u(c))return vb(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Fs(c,s))&&vb(t,n,a.getNode(),r,e,s)}(t,e)},yb=mr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),wb=function(t,e,n){return el(e,t,n).bind((function(r){return o=r.getNode(),Hr(Te(o))||Ir(Te(o))||function(t,e,n,r){var o=function(e){return zr(Te(e))&&!Es(n,r,t)};return Ps(!e,n).fold((function(){return Ps(e,r).fold(p,o)}),o)}(t,e,n,r)?x.none():e&&Hn(r.getNode())||!1===e&&Hn(r.getNode(!0))?function(t,e,n,r){var o=r.getNode(!1===e);return Gv(Te(t),Te(n.getNode())).map((function(t){return wo(t)?yb.remove(t.dom):yb.moveToElement(o)})).orThunk((function(){return x.some(yb.moveToElement(o))}))}(t,e,n,r):e&&Om(n)||!1===e&&km(n)?x.some(yb.moveToPosition(r)):x.none();var o}))},xb=function(t,e){return x.from(wf(t.getBody(),e))},Cb=function(t,e){var n=t.selection.getNode();return xb(t,n).filter(Hn).fold((function(){return function(t,e,n){var r=Bs(e?1:-1,t,n),o=cc.fromRangeStart(r),i=Te(t);return!1===e&&Om(o)?x.some(yb.remove(o.getNode(!0))):e&&km(o)?x.some(yb.remove(o.getNode())):!1===e&&km(o)&&Vm(i,o)?jm(i,o).map((function(t){return yb.remove(t.getNode())})):e&&Om(o)&&Fm(i,o)?Um(i,o).map((function(t){return yb.remove(t.getNode())})):function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return kn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Hn(e.nextSibling)?x.some(yb.moveToElement(e.nextSibling)):!1===t&&Hn(e.previousSibling)?x.some(yb.moveToElement(e.previousSibling)):x.none()}(e,n.getNode(!1===e)).fold((function(){return wb(t,e,n)}),x.some):wb(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return x.some(yb.remove(t))}),(function(t){return x.some(yb.moveToElement(t))}),(function(n){return Es(e,n,t)?x.none():x.some(yb.moveToPosition(n))}))}(t,n,e)}))}(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0}}(t,e),function(t,e){return function(n){var r=e?cc.before(n):cc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),v)},Sb=function(t){var e=t.dom,n=t.selection,r=wf(t.getBody(),n.getNode());if(Ln(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(cc.before(o).toRange())}return!0},kb=function(t,e){return t.selection.isCollapsed()?Cb(t,e):function(t,e){var n=t.selection.getNode();return!!Hn(n)&&xb(t,n.parentNode).filter(Hn).fold((function(){var n;return n=Te(t.getBody()),j(va(n,".mce-offscreen-selection"),ln),mg(t,e,Te(t.selection.getNode())),Xv(t),!0}),(function(){return!0}))}(t,e)},Ob=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return el(e,t.getBody(),n).filter((function(t){return e?bm(t):ym(t)})).bind((function(t){return x.from(As(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Tb=Mn,_b=function(t){return Tb(t)&&t.data[0]===jr},Eb=function(t){return Tb(t)&&t.data[t.data.length-1]===jr},Ab=function(t){return t.ownerDocument.createTextNode(jr)},Nb=function(t,e){return t?function(t){if(Tb(t.previousSibling))return Eb(t.previousSibling)||t.previousSibling.appendData(jr),t.previousSibling;if(Tb(t))return _b(t)||t.insertData(0,jr),t;var e=Ab(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Tb(t.nextSibling))return _b(t.nextSibling)||t.nextSibling.insertData(0,jr),t.nextSibling;if(Tb(t))return Eb(t)||t.appendData(jr),t;var e=Ab(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Rb=d(Nb,!0),Mb=d(Nb,!1),zb=function(t,e){return Mn(t.container())?Nb(e,t.container()):Nb(e,t.getNode())},Db=function(t,e){var n=e.get();return n&&t.container()===n&&Xr(n)},Bb=function(t,e){return e.fold((function(e){us(t.get());var n=Rb(e);return t.set(n),x.some(cc(n,n.length-1))}),(function(e){return al(e).map((function(e){if(Db(e,t))return cc(t.get(),1);us(t.get());var n=zb(e,!0);return t.set(n),cc(n,1)}))}),(function(e){return cl(e).map((function(e){if(Db(e,t))return cc(t.get(),t.get().length-1);us(t.get());var n=zb(e,!1);return t.set(n),cc(n,n.length-1)}))}),(function(e){us(t.get());var n=Mb(e);return t.set(n),x.some(cc(n,1))}))},Pb=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return x.none()},Ib=mr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Lb=function(t,e){return _s(e,t)||t},Hb=function(t,e,n){var r=qv(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return il(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.before(t)}))}),x.none)},Fb=function(t,e){return null===fl(t,e)},Vb=function(t,e,n){return Uv(t,e,n).filter(d(Fb,e))},jb=function(t,e,n){var r=$v(n);return Vb(t,e,r).bind((function(t){return ul(t,r).isNone()?x.some(Ib.start(t)):x.none()}))},Ub=function(t,e,n){var r=qv(n);return Vb(t,e,r).bind((function(t){return il(t,r).isNone()?x.some(Ib.end(t)):x.none()}))},Wb=function(t,e,n){var r=$v(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return ul(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.after(t)}))}),x.none)},qb=function(t){return!1===(e=Gb(t),"rtl"===Qu.DOM.getStyle(e,"direction",!0)||(n=e.textContent,Vv.test(n)));var e,n},$b=function(t,e,n){return Pb([Hb,jb,Ub,Wb],[t,e,n]).filter(qb)},Gb=function(t){return t.fold(f,f,f,f)},Xb=function(t){return t.fold(l("before"),l("start"),l("end"),l("after"))},Kb=function(t){return t.fold(Ib.before,Ib.before,Ib.after,Ib.after)},Yb=function(t){return t.fold(Ib.start,Ib.start,Ib.end,Ib.end)},Jb=function(t,e,n,r,o,i){return Ra(Uv(e,n,r),Uv(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=_s(e,t),o=_s(n,t);return r&&r===o}(n,e,r)?Ib.after(t?e:r):i})).getOr(i)},Qb=function(t,e){return t.fold(v,(function(t){return r=e,!(Xb(n=t)===Xb(r)&&Gb(n)===Gb(r));var n,r}))},Zb=function(t,e){return t?e.fold(s(x.some,Ib.start),x.none,s(x.some,Ib.after),x.none):e.fold(x.none,s(x.some,Ib.before),x.none,s(x.some,Ib.end))},ty=function(t,e,n,r){var o=Wv(t,r),i=$b(e,n,o);return $b(e,n,o).bind(d(Zb,t)).orThunk((function(){return function(t,e,n,r,o){var i=Wv(t,o);return el(t,n,i).map(d(Wv,t)).fold((function(){return r.map(Kb)}),(function(o){return $b(e,n,o).map(d(Jb,t,e,n,i,o)).filter(d(Qb,r))})).filter(qb)}(t,e,n,i,r)}))},ey=(d(ty,!1),d(ty,!0),function(t,e,n){var r=t?1:-1;return e.setRng(cc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0}),ny=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},ry=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},oy=function(t,e,n){return Bb(e,n).map((function(e){return ny(t,e),n}))},iy=function(t,e,n){return!!Yc(t)&&function(t,e,n){var r=t.getBody(),o=cc.fromRangeStart(t.selection.getRng()),i=d(jv,t);return ty(n,i,r,o).bind((function(n){return oy(t,e,n)}))}(t,e,n).isSome()},uy=function(t,e,n){return!!Yc(e)&&function(t,e){var n=e.selection.getRng(),r=t?cc.fromRangeEnd(n):cc.fromRangeStart(n);return!!function(t){return z(t.selection.getSel().modify)}(e)&&(t&&Jr(r)?ey(!0,e.selection,r):!(t||!Qr(r))&&ey(!1,e.selection,r))}(t,e)},ay=function(t){var e=ra(null),n=d(jv,t);return t.on("NodeChange",(function(r){!Yc(t)||pe.browser.isIE()&&r.initial||(function(t,e,n){var r=V(va(Te(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=W(r,t),i=W(n,t);j(Q(o,i),d(ry,!1)),j(Q(i,o),d(ry,!0))}(n,t.dom,r.parents),function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=cc.fromRangeStart(t.selection.getRng());cc.isTextPosition(n)&&!1===function(t){return Jr(t)||Qr(t)}(n)&&(ny(t,is(e.get(),n)),e.set(null))}}(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=W(r,t);j(o,(function(r){var o=cc.fromRangeStart(e.selection.getRng());$b(t,e.getBody(),o).bind((function(t){return oy(e,n,t)}))}))}}(n,t,e,r.parents))})),e},cy=d(uy,!0),sy=d(uy,!1),ly=function(t,e){return function(n){return Bb(e,n).exists((function(e){return ny(t,e),!0}))}},fy=function(t,e,n,r){var o=t.getBody(),i=d(jv,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),$b(i,o,cc.fromRangeStart(t.selection.getRng())).map(Yb).map(ly(t,e))})),t.nodeChanged()},dy=function(t,e,n){if(t.selection.isCollapsed()&&Yc(t)){var r=cc.fromRangeStart(t.selection.getRng());return function(t,e,n,r){var o=function(t,e){return _s(e,t)||t}(t.getBody(),r.container()),i=d(jv,t),u=$b(i,o,r);return u.bind((function(t){return n?t.fold(l(x.some(Yb(t))),x.none,l(x.some(Kb(t))),x.none):t.fold(x.none,l(x.some(Kb(t))),x.none,l(x.some(Yb(t))))})).map(ly(t,e)).getOrThunk((function(){var a=nl(n,o,r),c=a.bind((function(t){return $b(i,o,t)}));return Ra(u,c,(function(){return Uv(i,o,r).exists((function(e){return!!function(t){return Ra(al(t),cl(t),(function(e,n){var r=Wv(!0,e),o=Wv(!1,n);return il(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(mg(t,n,Te(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?fy(t,e,r,o):fy(t,e,o,r),!0}))}))})).getOr(!1)}))}(t,e,n,r)}return!1},my=function(t){return 1===Ge(t).length},gy=function(t,e){var n=Te(t.getBody()),r=Te(t.selection.getStart()),o=W(function(t,e){var n=Am(e,t);return X(n,Mr).fold(l(n),(function(t){return n.slice(0,t)}))}(n,r),my);return et(o).exists((function(n){var r,i=cc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ra(al(n),cl(n),(function(r,o){var i=Wv(!0,r),u=Wv(!1,o),a=Wv(!1,e);return t?il(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):ul(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,ll(r.dom)&&Jg(r.dom))||(function(t,e,n,r){var o=d(ih,e),i=V(W(r,o),(function(t){return t.dom}));if(0===i.length)mg(e,t,n);else{var u=function(t,e){var n=Zg(!1),r=rh(e,n.dom);return rn(Te(t),n),ln(Te(t)),cc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}}(e,t,n,o),0))}))},hy=function(t,e){return!!t.selection.isCollapsed()&&gy(t,e)},py=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0},vy=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?wm:xm,r=e?ac.Forwards:ac.Backwards,o=Is(r,t.getBody(),t.selection.getRng());return n(o)?py(t,e,o.getNode(!e)):x.from(Wv(e,o)).filter((function(t){return n(t)&&Fs(o,t)})).exists((function(n){return py(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Vn(n)&&py(t,e,n)}(t,e)},by=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},yy=function(t,e){return(t||"table"===Me(e)?"margin":"padding")+("rtl"===Kn(e,"direction")?"-right":"-left")},wy=function(t){var e=Cy(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return Y(e,(function(e){var n=yy(qc(t),e),r=Jn(e,n).map(by).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},xy=function(t){return Pr(t)||Ir(t)},Cy=function(t){return W(V(t.selection.getSelectedBlocks(),Te),(function(t){return!xy(t)&&!function(t){return je(t).map(xy).getOr(!1)}(t)&&br(t,(function(t){return Ln(t.dom)||Hn(t.dom)})).exists((function(t){return Ln(t.dom)}))}))},Sy=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=qc(t),s=zc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),j(Cy(t),(function(t){!function(t,e,n,r,o,i){var u=yy(n,Te(i));if("outdent"===e){var a=Math.max(0,by(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else a=by(i.style[u])+r+o,t.setStyle(i,u,a)}(n,e,c,a,u,t.dom)}))},ky=function(t,e){if(t.selection.isCollapsed()&&wy(t)){var n=t.dom,r=t.selection.getRng(),o=cc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dm(Te(i),o))return Sy(t,"outdent"),!0}return!1},Oy=function(t,e){t.getDoc().execCommand(e,!1,null)},Ty=function(t){return void 0===t.touches||1!==t.touches.length?x.none():x.some(t.touches[0])},_y=function(t,e){return t.hasOwnProperty(e.nodeName)},Ey=function(t,e){return!!Mn(e)||!!kn(e)&&!_y(t,e)&&!wl(e)},Ay=function(t,e){if(Mn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||_y(t,e.nextSibling)))return!0}return!1},Ny=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=zc(t);if(c&&kn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return F(Em(Te(n),Te(e)),(function(e){return _y(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=Nd(t);for(c=s.firstChild;c;)if(Ey(a,c)){if(Ay(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,Dc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},Ry=function(t,e){e.hasAttribute("data-mce-caret")&&(eo(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},My=function(t,e){var n=function(t){return wr(Te(t.getBody()),"*[data-mce-caret]").fold(l(null),(function(t){return t.dom}))}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Ry(t,n)):void(Yr(n)&&(Ry(t,n),t.undoManager.add()))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(Av||(Av={}));var zy,Dy=function(t,e){return t===ac.Backwards?J(e):e},By=function(t,e,n){return t===ac.Forwards?e.next(n):e.prev(n)},Py=function(t,e,n,r){return Pn(r.getNode(e===ac.Forwards))?Av.Br:!1===Es(n,r)?Av.Block:Av.Wrap},Iy=function(t,e,n,r){for(var o,i=Js(n),u=r,a=[];u&&(o=By(e,i,u));){if(Pn(o.getNode(!1)))return e===ac.Forwards?{positions:Dy(e,a).concat([o]),breakType:Av.Br,breakAt:x.some(o)}:{positions:Dy(e,a),breakType:Av.Br,breakAt:x.some(o)};if(o.isVisible()){if(t(u,o)){var c=Py(0,e,u,o);return{positions:Dy(e,a),breakType:c,breakAt:x.some(o)}}a.push(o),u=o}else u=o}return{positions:Dy(e,a),breakType:Av.Eol,breakAt:x.none()}},Ly=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===ac.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Hy=function(t,e){return $(t,(function(t,n){return t.fold((function(){return x.some(n)}),(function(r){return Ra(tt(r.getClientRects()),tt(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),x.none())},Fy=function(t,e){return tt(e.getClientRects()).bind((function(e){return Hy(t,e.left)}))},Vy=d(Iy,uc.isAbove,-1),jy=d(Iy,uc.isBelow,1),Uy=d(Ly,-1,Vy),Wy=d(Ly,1,jy),qy=function(t){var e=function(e){return V(e,(function(e){return(e=za(e)).node=t,e}))};if(kn(t))return e(t.getClientRects());if(Mn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},$y=function(t){return K(t,qy)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(zy||(zy={}));var Gy,Xy,Ky=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i,c,l;for(l=$y([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(c=l[i],!n(c,s)){if(a.length>0&&e(c,Ct(a))&&u++,c.line=u,o(c))return!0;a.push(c)}},s=Ct(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Ts(r,t,mo,e);)if(n(r))return}(t,r,c,l),a},Yy=d(Ky,zy.Up,Pa,Ia),Jy=d(Ky,zy.Down,Ia,Pa),Qy=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Zy=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},tw=Hn,ew=Ts,nw=function(t,e){return Math.abs(t.left-e)},rw=function(t,e){return Math.abs(t.right-e)},ow=function(t,e){return t>=e.left&&t<=e.right},iw=function(t,e){return t>=e.top&&t<=e.bottom},uw=function(t,e){return wt(t,(function(t,n){var r=Math.min(nw(t,e),rw(t,e)),o=Math.min(nw(n,e),rw(n,e));return ow(e,n)?n:ow(e,t)?t:o===r&&tw(n.node)||o<r?n:t}))},aw=function(t,e,n,r,o){var i=ew(r,t,mo,e,!o);do{if(!i||n(i))return}while(i=ew(i,t,mo,e))},cw=function(t,e){t.selection.setRng(e),ud(t,t.selection.getRng())},sw=function(t,e,n){return x.some(gb(t,e,n))},lw=function(t,e,n,r,o,i){var u=e===ac.Forwards,a=Js(t.getBody()),c=d(Hs,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Ha(n);if(i(l))return fb(e,t,l,e===ac.Backwards,!1)}var f=Is(e,t.getBody(),n);if(s(f))return db(t,f.getNode(!u));var m=Wv(u,c(f)),g=function(t){return Gr(t.startContainer)}(n);if(!m)return g?x.some(n):x.none();if(s(m))return fb(e,t,m.getNode(!u),u,!1);var h=c(m);return h&&s(h)&&Fs(m,h)?fb(e,t,h.getNode(!u),u,!1):g?sw(t,m.toRange(),!1):x.none()},fw=function(t,e,n,r,o,i){var u=Is(e,t.getBody(),n),a=Ct(u.getClientRects()),c=e===zy.Down;if(!a)return x.none();var s,l=(c?Jy:Yy)(t.getBody(),Qy(1),u),f=W(l,Zy(1)),d=a.left,m=uw(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return fb(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Ha(n)){var p=function(t,e,n,r){var o,i,u,a,c,s=Js(e),l=[],f=0,d=function(t){return Ct(t.getClientRects())};1===t?(o=s.next,i=Ia,u=Pa,a=cc.after(r)):(o=s.prev,i=Pa,u=Ia,a=cc.before(r));var m=d(a);do{if(a.isVisible()&&!u(c=d(a),m)){if(l.length>0&&i(c,Ct(l))&&f++,(c=za(c)).position=a,c.line=f,n(c))return l;l.push(c)}}while(a=o(a));return l}(e,t.getBody(),Qy(1),s),v=uw(W(p,Zy(1)),d);if(v)return sw(t,v.position.toRange(),!1);if(v=Ct(W(p,Zy(0))))return sw(t,v.position.toRange(),!1)}return 0===f.length?dw(t,c).filter(c?o:r).map((function(e){return gb(t,e.toRange(),!1)})):x.none()},dw=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=cc.fromRangeEnd(n),i=jy(r,o);return et(i.positions)}return o=cc.fromRangeStart(n),i=Vy(r,o),tt(i.positions)},mw=function(t,e,n){return dw(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},gw=Hn,hw=function(t,e,n){var r=Js(t.getBody()),o=d(Hs,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==zc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(cc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(zc(t));return(!pe.ie||pe.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},pw=function(t,e){return function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return function(t,e,n){return lw(e,t,n,km,Om,gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},vw=function(t,e){return function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return fw(e,t,n,(function(t){return km(t)||Cm(t)}),(function(t){return Om(t)||Sm(t)}),gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},bw=function(t,e){return mw(t,e,e?Om:km)},yw=function(t){return H(["figcaption"],Me(t))},ww=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},xw=function(t,e,n){n?an(t,e):un(t,e)},Cw=function(t,e){var n=Te(t.getBody()),r=cc.fromRangeStart(t.selection.getRng()),o=zc(t),i=Dc(t);return function(t,e){var n=d(Ne,e);return br(Te(t.container()),Mr,n).filter(yw)}(r,n).exists((function(){if(function(t,e,n){return e?function(t,e){return jy(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Vy(t,e).breakAt.isNone()}(t.dom,n)}(n,e,r)){var u=function(t,e,n,r){return""===e?function(t,e){var n=ke("br");return xw(t,n,e),ww(n)}(t,r):function(t,e,n,r){var o=ke(n),i=ke("br");return qn(o,r),an(o,i),xw(t,o,e),ww(i)}(t,r,e,n)}(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},Sw=function(t,e){return!!t.selection.isCollapsed()&&Cw(t,e)},kw=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},Ow=function(t,e){return G(function(t,e){return K(function(t){return V(t,(function(t){return St({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:c},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))}(t,e),(function(t){return t.action()}))},Tw=function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return lw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},_w=function(t,e){var n=e?1:-1,r=t.selection.getRng();return fw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},Ew=function(t,e){return mw(t,e,e?xm:wm)},Aw=function(t,e,n,r,o){var i=va(Te(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return $(t,(function(t,r){return t.fold((function(){return x.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return x.some(i<o?r:t)}))}),x.none())}(W(function(t,e){return K(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+-2,bottom:t.bottom+-2,width:t.width+e,height:t.height+e}}(za(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},Nw=d(Aw,(function(t){return t.bottom}),(function(t,e){return t.y<e})),Rw=d(Aw,(function(t){return t.top}),(function(t,e){return t.y>e})),Mw=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===Av.Wrap&&0===t.positions.length}(r)||!Pn(n.getNode())&&function(t){return t.breakType===Av.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},zw=d(Mw,Vy),Dw=d(Mw,jy),Bw=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!ms()||!function(t,e,n){var r=cc.fromRangeStart(e);return ol(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n)||(fb(i,t,n,!e,!1).each((function(e){cw(t,e)})),0))},Pw=function(t,e,n){var r=function(t,e){var n=e.getNode(t);return kn(n)&&"TABLE"===n.nodeName?x.some(n):x.none()}(!!e,n),o=!1===e;r.fold((function(){return cw(t,n.toRange())}),(function(r){return ol(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return cw(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=zc(e);o?e.undoManager.transact((function(){var r=ke(o);qn(r,Dc(e)),an(r,ke("br")),t?on(Te(n),r):rn(Te(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),cw(e,i)})):cw(e,r.toRange())}(e,t,r,n)}))}))},Iw=function(t,e,n,r){var o=t.selection.getRng(),i=cc.fromRangeStart(o),u=t.getBody();if(!e&&zw(r,i)){var a=function(t,e,n){return function(t,e){return tt(e.getClientRects()).bind((function(e){return Nw(t,e.left,e.top)})).bind((function(t){return Fy(cl(n=t).map((function(t){return Vy(n,t).positions.concat(t)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Uy(t,cc.before(e)),n.left)}))})).getOr(cc.before(e))}(u,n,i);return Pw(t,e,a),!0}return!(!e||!Dw(r,i))&&(a=function(t,e,n){return function(t,e){return et(e.getClientRects()).bind((function(e){return Rw(t,e.left,e.top)})).bind((function(t){return Fy(al(n=t).map((function(t){return[t].concat(jy(n,t).positions)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Wy(t,cc.after(e)),n.left)}))})).getOr(cc.after(e))}(u,n,i),Pw(t,e,a),!0)},Lw=function(t,e,n){return x.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return x.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},Hw=function(t,e){return Lw(t,e,Bw)},Fw=function(t,e){return Lw(t,e,Iw)},Vw=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(Vr),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Ar(e,e);n=c.current();){if(Mn(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Pn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),ud(t,a)}},jw=function(t){return x.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},Uw=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},Ww=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},qw=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},$w=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!kn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},Gw=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},Xw=function(t){t.innerHTML='<br data-mce-bogus="1">'},Kw=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},Yw=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},Jw=function(t,e,n){return!1===Mn(e)?n:t?1===n&&e.data.charAt(n-1)===jr?0:n:n===e.data.length-1&&e.data.charAt(n)===jr?e.data.length:n},Qw=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Zw=function(t,e){var n=zc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;x.from(n.style).map(r.parseStyle).each((function(t){var n=Qn(Te(e)),o=St(St({},n),t);r.setStyles(e,o)}));var o=x.from(n.class).map((function(t){return t.split(/\s+/)})),i=x.from(e.className).map((function(t){return W(t.split(/\s+/),(function(t){return""!==t}))}));Ra(o,i,(function(t,n){var o=W(n,(function(e){return!H(t,e)})),i=kt(t,o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=ft(n,(function(t,e){return!H(u,e)}));r.setAttribs(e,a)}(t,e,Dc(t))},tx=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(ll(a)||wl(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return Zw(t,n),Xw(u),n},v=function(t){var e,n,u=Jw(t,r,o);if(Mn(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&kn(r)&&r===i.firstChild)return!0;if(Kw(r,"TABLE")||Kw(r,"HR"))return f&&!t||!f&&t;var a=new Ar(r,i);for(Mn(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(kn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Mn(e)&&!ho(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&Yw(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),Vw(t,u)};Pf(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=zc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);kn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Mn(r)?r.nodeValue.length:0);var x=Qw(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=Qw(d,r);if(!(u=d.getParent(r,d.isBlock))||!Yw(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),Zw(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),Zw(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;Ww(a=n)&&Ww(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if($w(n,r,!0)&&$w(n,r,!1))Uw(n,"LI")?i.insertAfter(c,qw(n)):i.replace(c,n);else if($w(n,r,!0))Uw(n,"LI")?(i.insertAfter(c,qw(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n);else if($w(n,r,!1))i.insertAfter(c,qw(n));else{n=qw(n);var s=u.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var l=s.extractContents();"LI"===o&&function(t,e){return t.firstChild&&"LI"===t.firstChild.nodeName}(l)?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n))}i.remove(r),Vw(t,c)}}(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Gr(i)?(u=eo(i),d.isEmpty(i)&&Xw(i),Zw(t,u),Vw(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),Vw(t,Kw(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,Jw(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,Jw(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){j(pa(Te(t),Pe),(function(t){var e=t.dom;e.nodeValue=Wr(e.nodeValue)}))}(a=n.extractContents()),function(t){do{Mn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;kn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||Gw(t,o))&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&Xw(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(Zw(t,u),Vw(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},ex=function(t,e,n){var r=t.create("span",{}," ");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},nx=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},rx=function(t,e){var n=ke("br");rn(Te(e),n),t.undoManager.add()},ox=function(t,e){ix(t.getBody(),e)||on(Te(e),ke("br"));var n=ke("br");on(Te(e),n),ex(t.dom,t.selection,n.dom),nx(t.dom,t.selection,n.dom,!1),t.undoManager.add()},ix=function(t,e){return n=cc.after(e),!!Pn(n.getNode())||il(t,cc.after(e)).map((function(t){return Pn(t.getNode())})).getOr(!1);var n},ux=function(t){return t&&"A"===t.nodeName&&"href"in t},ax=function(t){return t.fold(p,ux,ux,p)},cx=function(t,e){e.fold(c,d(rx,t),d(ox,t),c)},sx=function(t,e){var n=function(t){var e=d(jv,t),n=cc.fromRangeStart(t.selection.getRng());return $b(e,t.getBody(),n).filter(ax)}(t);n.isSome()?n.each(d(cx,t)):function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();Pf(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Ar(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),lc(i,u,n),ex(i,o,n),nx(i,o,n,r),t.undoManager.add()}(t,e)},lx=function(t,e){return jw(t).filter((function(t){return e.length>0&&Ee(Te(t),e)})).isSome()},fx=mr([{br:[]},{block:[]},{none:[]}]),dx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},mx=function(t){return function(e,n){return""===zc(e)===t}},gx=function(t){return function(e,n){return function(t){return jw(t).filter((function(t){return Ir(Te(t))})).isSome()}(e)===t}},hx=function(t,e){return function(n,r){return function(t){return jw(t).fold(l(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},px=function(t){return hx("pre",t)},vx=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},bx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},yx=function(t,e){return e},wx=function(t){var e=zc(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},xx=function(t,e){return function(n,r){return $(t,(function(t,e){return t&&e(n,r)}),!0)?x.some(e):x.none()}},Cx=function(t,e){(function(t,e){return Pb([xx([dx],fx.none()),xx([hx("summary",!0)],fx.br()),xx([px(!0),vx(!1),yx],fx.br()),xx([px(!0),vx(!1)],fx.block()),xx([px(!0),vx(!0),yx],fx.block()),xx([px(!0),vx(!0)],fx.br()),xx([gx(!0),yx],fx.br()),xx([gx(!0)],fx.block()),xx([mx(!0),yx,wx],fx.block()),xx([mx(!0)],fx.br()),xx([bx],fx.br()),xx([mx(!1),yx],fx.br()),xx([wx],fx.block())],[t,!(!e||!e.shiftKey)]).getOr(fx.none())})(t,e).fold((function(){sx(t,e)}),(function(){tx(t,e)}),c)},Sx=ae().browser,kx=function(t,e){var n=e.container(),r=e.offset();return Mn(n)?(n.insertData(r,t),x.some(uc(n,r+t.length))):Ls(e).map((function(n){var r=Oe(t);return e.isAtEnd()?on(n,r):rn(n,r),uc(r.dom,t.length)}))},Ox=d(kx,Vr),Tx=d(kx," "),_x=function(t,e){return function(n){return function(t,e){return!Xm(e)&&(function(t,e){return function(t,e){return ul(t.dom,e).isNone()}(t,e)||function(t,e){return il(t.dom,e).isNone()}(t,e)||Dm(t,e)||Bm(t,e)||Vm(t,e)||Fm(t,e)}(t,e)||$m(t,e)||Gm(t,e))}(t,n)?Ox(e):Tx(e)}},Ex=function(t){var e=cc.fromRangeStart(t.selection.getRng()),n=Te(t.getBody());if(t.selection.isCollapsed()){var r=d(jv,t),o=cc.fromRangeStart(t.selection.getRng());return $b(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return ul(t.dom,cc.before(e))}),(function(t){return al(t)}),(function(t){return cl(t)}),(function(e){return il(t.dom,cc.after(e))}))}}(n)).bind(_x(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},Ax=function(t){var e=ay(t);return function(t){t.on("keyup compositionstart",d(My,t))}(t),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ae().os;Ow([{keyCode:Cf.RIGHT,action:kw(pw,t,!0)},{keyCode:Cf.LEFT,action:kw(pw,t,!1)},{keyCode:Cf.UP,action:kw(vw,t,!1)},{keyCode:Cf.DOWN,action:kw(vw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Hw,t,!0)},{keyCode:Cf.LEFT,action:kw(Hw,t,!1)},{keyCode:Cf.UP,action:kw(Fw,t,!1)},{keyCode:Cf.DOWN,action:kw(Fw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Tw,t,!0)},{keyCode:Cf.LEFT,action:kw(Tw,t,!1)},{keyCode:Cf.UP,action:kw(_w,t,!1)},{keyCode:Cf.DOWN,action:kw(_w,t,!0)},{keyCode:Cf.RIGHT,action:kw(iy,t,e,!0)},{keyCode:Cf.LEFT,action:kw(iy,t,e,!1)},{keyCode:Cf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(cy,t,e)},{keyCode:Cf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(sy,t,e)},{keyCode:Cf.UP,action:kw(Sw,t,!1)},{keyCode:Cf.DOWN,action:kw(Sw,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))}(t,e),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){Ow([{keyCode:Cf.BACKSPACE,action:kw(ky,t,!1)},{keyCode:Cf.BACKSPACE,action:kw(kb,t,!1)},{keyCode:Cf.DELETE,action:kw(kb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(bb,t,!1)},{keyCode:Cf.DELETE,action:kw(bb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(dy,t,e,!1)},{keyCode:Cf.DELETE,action:kw(dy,t,e,!0)},{keyCode:Cf.BACKSPACE,action:kw(Bg,t,!1)},{keyCode:Cf.DELETE,action:kw(Bg,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(Ob,t,!1)},{keyCode:Cf.DELETE,action:kw(Ob,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(vy,t,!1)},{keyCode:Cf.DELETE,action:kw(vy,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(cb,t,!1)},{keyCode:Cf.DELETE,action:kw(cb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(ib,t,!1)},{keyCode:Cf.DELETE,action:kw(ib,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(hy,t,!1)},{keyCode:Cf.DELETE,action:kw(hy,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.BACKSPACE,action:kw(Sb,t)},{keyCode:Cf.DELETE,action:kw(Sb,t)}],e)}(t,e)}))}(t,e),function(t){t.on("keydown",(function(e){e.keyCode===Cf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Cx(t,e)})))}(t,e)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.SPACEBAR,action:kw(Ex,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),function(t){!function(t){var e=la((function(){t.composing||eg(t)}),0);Sx.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&eg(t)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.END,action:kw(bw,t,!0)},{keyCode:Cf.HOME,action:kw(bw,t,!1)},{keyCode:Cf.END,action:kw(Ew,t,!0)},{keyCode:Cf.HOME,action:kw(Ew,t,!1)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),e},Nx=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&_f(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!pe.range&&t.selection.isCollapsed()||lf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&lf(t)&&("IMG"===t.selection.getNode().nodeName?Tr.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Rx=function(t){return kn(t)&&Br(Te(t))},Mx=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},zx=Hn,Dx=Ln,Bx=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},Px=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},Ix=function(t){t.on((function(t){Px(t.ghost)})),t.clear()},Lx=function(t){var e,n=(e=ra(x.none()),{clear:function(){return e.set(x.none())},set:function(t){return e.set(x.some(t))},isSet:function(){return e.get().isSome()},on:function(t){return e.get().each(t)}}),r=Qu.DOM,o=document,i=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=G(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(zx,Dx)).getOr(null);if(a=e.getBody(),zx(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Bx(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}}(n,t),u=function(t,e){var n=Tr.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,function(t,e){return n=function(t){return t.inline?Mx(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Mx(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o}(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(n,t),a=function(t,e){return function(n){t.on((function(t){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!zx(e)}(e,3===(i=e.selection.getSel().getRangeAt(0).startContainer).nodeType?i.parentNode:i,t.element)){var r=((o=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),o);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Px(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var o,i})),Ix(t)}}(n,t),c=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Ix(t)}}(n,t);t.on("mousedown",i),t.on("mousemove",u),t.on("mouseup",a),r.bind(o,"mousemove",u),r.bind(o,"mouseup",c),t.on("remove",(function(){r.unbind(o,"mousemove",u),r.unbind(o,"mouseup",c)}))},Hx=Ln,Fx=Hn,Vx=function(t,e){return wf(t.getBody(),e)},jx=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=ds(t,i,o,(function(){return Nd(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Fx(t)||Vn(t))&&r.isChildOf(t,i)},l=function(t){t&&n.setRng(t)},f=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},g=function(t){return Kr(t)||Zr(t)||to(t)},h=function(t){return g(t.startContainer)||g(t.endContainer)},p=function(o,u){if(!o)return null;if(o.collapsed){if(!h(o)){var l=u?1:-1,f=Is(l,i,o),d=f.getNode(!u);if(hs(d))return m(l,d,!!u&&!f.isAtEnd(),!1);var g=f.getNode(u);if(hs(g))return m(l,g,!u&&!f.isAtEnd(),!1)}return null}var p=o.startContainer,v=o.startOffset,y=o.endOffset;if(3===p.nodeType&&0===v&&Fx(p.parentNode)&&(p=p.parentNode,v=r.nodeIndex(p),p=p.parentNode),1!==p.nodeType)return null;if(y===v+1&&p===o.endContainer){var w=p.childNodes[v];if(s(w))return function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var s=function(e,o,i){var u=t.$,c=wr(Te(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&pe.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(Vr).append(o).append(Vr),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),l=Te(o);return j(va(Te(t.getBody()),"*[data-mce-selected]"),(function(t){Ne(l,t)||Xn(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,b(),s}(w)}return null},v=function(){e&&e.removeAttribute(c),wr(Te(t.getBody()),"#"+a).each(ln),e=null},b=function(){u.hide()};return pe.ceFalse&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&hv(t,e.clientX,e.clientY)&&mb(t,n,!1).each(l)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Fx(o)&&(e.preventDefault(),t.focus()),Hx(o)&&r.isChildOf(o,n.getNode())&&v())})),t.on("blur NewBlock",v),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var c=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!(!a||e===c||!r.isChildOf(a,c)||!1!==Fx(Vx(t,a)))||a&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=Js(t);if(!t.firstChild)return!1;var n,r=cc.before(t.firstChild),o=e.next(r);return o&&!(km(n=o)||Om(n)||wm(n)||xm(n))}(a)};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Fx(r)?(e.preventDefault(),db(t,r).each(p)):s(n)&&db(t,n).each(p)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hv(t,e.clientX,e.clientY)){var u=Vx(t,o);if(u)Fx(u)?(e.preventDefault(),db(t,u).each(p)):(v(),Hx(u)&&e.shiftKey||xf(e.clientX,e.clientY,n.getRng())||(b(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))db(t,o).each(p);else if(!1===hs(o)){v(),b();var a=function(t,e,n){var r=$y(function(t){return W(nt(t.getElementsByTagName("*")),hs)}(t)),o=W(r,d(iw,n)),i=uw(o,e);if(i){var u=!An(i.node)&&!Vn(i.node);if((i=uw(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=W($y([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),aw(zy.Up,t,d(o,Pa),e.node,n),aw(zy.Down,t,d(o,Ia),e.node,n),r}(t,i,u),e))&&hs(i.node))return function(t,e){return{node:t.node,before:nw(t,e)<rw(t,e)}}(i,e)}return null}(i,e.clientX,e.clientY);if(a&&!c(o,a.node)){e.preventDefault();var f=m(1,a.node,a.before,!1);t.getBody().focus(),l(f)}}}})),t.on("keypress",(function(t){Cf.modifierPressed(t)||Fx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(e){e.range=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return mt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),mt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o}(e.range);var n=p(e.range,e.forward);n&&(e.range=n)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;h(n)||"mcepastebin"===o.id||b(),e=o,r.hasClass(e,"mce-offscreen-selection")||v()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!pe.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),function(t){Lx(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(zx(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.defaultPrevented){var n=e.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&xv(t,"Dropped file type is not supported"))}},n=function(n){Od(t,n.target)&&e(n)},r=function(){var r=Qu.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];j(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){j(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){Tr.setEditorTimeout(t,r,0)}))}(t)}(t),function(t){var e=la((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=gb(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Vn(n)){var r=wf(t.getBody(),n),o=Hn(r)?r:n;t.selection.getNode()!==o&&db(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(eo(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:b,destroy:function(){u.destroy(),e=null}}},Ux=Qu.DOM,Wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},qx=function(t){return ft(t,(function(t){return!1===N(t)}))},$x=function(t){var e=t.settings,n=t.editorUpload.blobCache;return qx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Wx(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},Gx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),function(t){var e=t.dom.getRoot();t.inline||lf(t)&&t.selection.getStart(!0)!==e||al(e).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;pe.browser.isIE()?function(t,e){var n=Te(t.getBody()),r=(vd(t)?x.from(e):x.none()).map(bd).filter(pd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))}(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Tr.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Xx=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,Ux.setAttrib(o,"spellcheck","false")),t.quirks=function(t){var e,n,r,o=xe.each,i=Cf.BACKSPACE,u=Cf.DELETE,a=t.dom,c=t.selection,s=t.parser,l=pe.gecko,f=pe.ie,d=pe.webkit,m="data:text/mce-internal,",g=f?"Text":"URL",h=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},p=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",(function(t){if(!p(t)&&t.keyCode===i&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(pe.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))};return t.on("keydown",(function(e){var n,r;if(!p(e)&&e.keyCode===Cf.BACKSPACE){var o=(n=c.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),c.setRng(n))}}})),e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",(function(n){var r,o,c=n.keyCode;if(!p(n)&&(c===u||c===i)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!a.isEmpty(o))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),o.firstChild&&a.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}})),pe.windowsPhone||t.on("keyup focusin mouseup",(function(t){Cf.modifierPressed(t)||c.normalize()}),!0),d&&(t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Kr(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)})),t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))})),zc(t)&&t.on("init",(function(){h("DefaultParagraphSeparator",zc(t))})),t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))})),b(),s.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),pe.iOS?(t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()})),y(),t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),pe.ie>=11&&(y(),b()),pe.ie&&(v(),h("AutoUrlDetect",!1),t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&c.select(e.target),(n=t.selection.getContent()).length>0&&(r=m+escape(t.id)+","+escape(n),e.dataTransfer.setData(g,r)))}(e)})),t.on("drop",(function(e){if(!p(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(g))&&e.indexOf(m)>=0?(e=e.substr(m.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Tf(e.x,e.y,t.getDoc());c.setRng(r),o=n.html,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:!0}):t.execCommand("mceInsertContent",!1,o)}}var o}))),l&&(t.on("keydown",(function(e){if(!p(e)&&e.keyCode===i){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!p(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Tr.setEditorTimeout(t,(function(){n.focus()}))}})),n=function(){var e=a.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),o(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!c.isCollapsed()&&a.getParent(c.getStart(),a.isBlock)!==a.getParent(c.getEnd(),a.isBlock)},t.on("keypress",(function(e){var o;if(!p(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(e){var o;!p(e)&&r()&&(o=n(),Tr.setEditorTimeout(t,(function(){o()})))})),function(t){return t.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",(function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),$c(t)||h("enableObjectResizing",!1)})),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||o(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))})),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),pe.mac&&t.on("keydown",(function(e){!Cf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})),b()),{refreshContentEditable:function(){},isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}}(t),function(t){t.fire("PostRender")}(t);var i=function(t){return t.getParam("directionality",aa.isRtl()?"rtl":void 0)}(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",(function(t){xe.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),t.contentStyles.length>0){var u="";xe.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}!function(t,e){var n=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader}(t),r=function(){t.on("remove",(function(){return n.unloadAll(e)})),Gx(t)};n.loadAll(e,r,r)}(t,t.contentCSS),n.content_style&&function(t,e){var n=Te(t.getBody()),r=en(tn(n)),o=ke("style");Wn(o,"type","text/css"),an(o,Oe(e)),an(r,o),t.on("remove",(function(){ln(o)}))}(t,n.content_style)},Kx=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Ux.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Ux.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=function(t){var e,n,r,o,i,u=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||Ev("blobid"),r=t.name||n,o=t.blob;return{id:l(n),name:l(r),filename:l(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:l(o),base64:l(t.base64),blobUri:l(t.blobUri||URL.createObjectURL(o)),uri:l(t.uri)}},n=function(e){return G(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(O(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(T(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=W(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){j(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),a=(r={},o=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:i=function(t){return t in r},getResultUri:function(t){var e=r[t];return e?e.resultUri:null},isPending:function(t){return!!i(t)&&1===r[t].status},isUploaded:function(t){return!!i(t)&&2===r[t].status},markPending:function(t){r[t]=o(1,null)},markUploaded:function(t,e){r[t]=o(2,e)},removeFailed:function(t){delete r[t]},destroy:function(){r={}}}),c=[],s=function(t){var e=ra(null);return t.on("change AddUndo",(function(t){e.set(St({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;et(n).filter((function(t){return!ap(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:Z(n,n.length-2).getOrNull()})}))}}}(t),f=function(e){return function(n){return t.selection?e(n):[]}},d=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},m=function(t,e,n){var r='src="'+n+'"'+(n===pe.transparentSrc?' data-mce-placeholder="1"':"");return t=d(t,'src="'+e+'"',r),d(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},g=function(e,n){j(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=V(t.fragments,(function(t){return m(t,e,n)})):t.content=m(t.content,e,n)}))},h=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},p=function(n){return e||(e=Tv(a,{url:Lc(t),basePath:Hc(t),credentials:Fc(t),handler:Vc(t)})),w().then(f((function(r){var o=V(r,(function(t){return t.blobInfo}));return e.upload(o,h).then(f((function(e){var o=[],i=V(e,(function(e,n){var i=r[n].blobInfo,a=r[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(u.removeByUri(a.src),function(e,n){var r,o=t.convertURL(n,"src");g(e.src,n),t.$(e).attr({src:Pc(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(a,e.url)):e.error&&(e.error.options.remove&&(g(a.getAttribute("src"),pe.transparentSrc),o.push(a)),function(t,e){xv(t,aa.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:i}}));return i.length>0&&s.fireIfChanged(),o.length>0&&(gp(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){j(o,(function(e){t.dom.remove(e),u.removeByUri(e.src)}))}))),n&&n(i),i})))})))},b=function(e){if(Bc(t))return p(e)},y=function(e){return!1!==Y(c,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",v,"function")}(t)(e))},w=function(){return n||(n=Ap(a,u)),n.findAll(t.getBody(),y).then(f((function(e){return e=W(e,(function(e){return"string"!=typeof e||(xv(t,e),!1)})),j(e,(function(t){g(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=a.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=$(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){Bc(t)?b():w()})),t.on("RawSaveContent",(function(t){t.content=x(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=x(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){j(t,(function(t){var e=t.attr("src");if(!u.getByUri(e)){var n=a.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:u,addFilter:function(t){c.push(t)},uploadImages:p,uploadImagesAuto:b,scanForImages:w,destroy:function(){u.destroy(),a.destroy(),n=e=null}}}(t),t.schema=Go(n),t.dom=Qu(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:jc(t),referrerPolicy:Uc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Hp($x(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Jd("br",1)).shortEnded=!0)}})),e}(t),t.serializer=jp(function(t){var e=t.settings;return St(St({},$x(t)),qx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=Cp(t.dom,t.getWin(),t.serializer,t),t.annotator=vf(t),t.formatter=Bv(t),t.undoManager=Pv(t),t._nodeChangeDispatcher=new Nx(t),t._selectionOverrides=jx(t),function(t){var e=ra(x.none()),n=ra(!1),r=fa((function(e){t.fire("longpress",St(St({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){Ty(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(x.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),Ty(o).each((function(r){e.get().each((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.set(x.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",St(St({},o),{type:"tap"}))}))}),!0)}(t),function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){j(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){j(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",O(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)}(t),gp(t)||function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=uc.fromRangeStart(e),r=uc.fromRangeEnd(e);if(uc.isElementPosition(n)){var o=n.container();Rx(o)&&al(o).each((function(t){return e.setStart(t.container(),t.offset())}))}uc.isElementPosition(r)&&(o=n.container(),Rx(o)&&cl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))),t.selection.setRng(Pg(e))}(t)}))}(t);var u=function(t){return gp(t)?ra(null):Ax(t)}(t);(function(t,e){t.addCommand("delete",(function(){!function(t,e){ky(t)||kb(t,!1)||bb(t,!1)||dy(t,e,!1)||ib(t,!1)||Bg(t)||Ob(t,!1)||vy(t,!1)||cb(t)||hy(t,!1)||(Oy(t,"Delete"),Xv(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){kb(t,!0)||bb(t,!0)||dy(t,e,!0)||ib(t,!0)||Bg(t)||Ob(t,!0)||vy(t,!0)||cb(t)||hy(t,!0)||Oy(t,"ForwardDelete")}(t,e)}))})(t,u),function(t){zc(t)&&t.on("NodeChange",d(Ny,t))}(t),function(t){var e=t.dom,n=zc(t),r=function(t){return t.getParam("placeholder",Nc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(Hv(t)){var e=t.keyCode;return!Fv(t)&&(Cf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||H(Iv,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return Hv(t)&&!(Fv(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(wo(Te(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,Lv)!==c||u)&&(e.setAttrib(a,Lv,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Tr.setEditorTimeout(t,(function(){return o(e)}))}))}))}(t),function(t){t.fire("PreInit")}(t),function(t){var e=t;return dt(t.plugins,"rtc").fold((function(){return e.rtcInstance=mp(t),x.none()}),(function(n){return x.some(n.setup().then((function(n){return e.rtcInstance=function(t,e){var n=function(t){return T(t)?t:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:c,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{match:function(t,r,o){return e.matchFormat(t,n(r))},matchAll:r,matchNode:r,canApply:function(t){return e.canApplyFormat(t)},closest:function(t){return e.closestFormat(t)},apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))},formatChanged:function(t,n,r,o){return e.formatChanged(n,r,o)}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=tm({inner:!0});return dp(t,o),"tree"===r?o:i.serialize(o)}return mp(t).editor.getContent(n,r)},setContent:function(n,r){var o=fp(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o,i=(o=t,x.from(o.selection.getStart(!0)).map((function(t){return t.nodeName.toLowerCase()}))).fold((function(){return{}}),(function(t){return{context:t}})),u=fp(n)?n:t.parser.parse(n,St(St({},i),{insert:!0}));e.insertContent(u)},addVisual:function(t){}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=tm({});return dp(t,o),"tree"===n?o:i.serialize(o)}return mp(t).selection.getContent(n,r)}},raw:{getModel:function(){return x.some(e.getRawModel())}}}}(t,n),n.isRemote})))}))}(t).fold((function(){Xx(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),Xx(t,e)}))}))},Yx=Qu.DOM,Jx=function(t,e){var n=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),r=function(t,e,n,r){var o=ke("iframe");return qn(o,r),qn(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),ga(o,"tox-edit-area__iframe"),o}(t.id,n,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom;r.onload=function(){r.onload=null,t.fire("load")};var o=function(t,e){if(document.domain!==window.location.hostname&&pe.browser.isIE()){var n=Ev("mce");t[n]=function(){Kx(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Yx.setAttrib(e,"src",r),!0}return!1}(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return Rc(t,"body_id","tinymce")}(t),r=function(t){return Rc(t,"body_class","")}(t);return Mc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Mc(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'}(t),Yx.add(e.iframeContainer,r),o},Qx=Qu.DOM,Zx=function(t,e,n){var r=vv.get(n),o=vv.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=xe.trim(n),r&&-1===xe.inArray(e,n)){if(xe.each(vv.dependencies(n),(function(n){Zx(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=aa.translate(["Failed to initialize plugin: {0}",e]);Ov(r,n),xv(t,r)}(t,n,e)}}},tC=function(t){return t.replace(/^\-/,"")},eC=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},nC=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,O(Xc(t))?function(t){return t.theme.renderUI()}(t):z(Xc(t))?function(t){var e=t.getElement(),n=Xc(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):function(t){var e=t.getElement();return t.inline?eC(null):function(t){var e=Qx.create("div");return Qx.insertAfter(e,t),eC(e)}(e)}(t)},rC=function(t){t.fire("ScriptsLoaded"),function(t){var e=xe.trim(Ic(t)),n=t.ui.registry.getAll().icons,r=St(St({},cv.get("default").icons),cv.get(e).icons);it(r,(function(e,r){mt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=Xc(t);if(O(e)){t.settings.theme=tC(e);var n=bv.get(e);t.theme=new n(t,bv.urls[e]),t.theme.init&&t.theme.init(t,bv.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];xe.each(Qc(t).split(/[ ,]/),(function(n){Zx(t,e,tC(n))}))}(t);var e=nC(t);!function(t,e){var n={show:x.from(e.show).getOr(c),hide:x.from(e.hide).getOr(c),disable:x.from(e.disable).getOr(c),isDisabled:x.from(e.isDisabled).getOr(p),enable:function(){t.mode.isReadOnly()||x.from(e.enable).map(h)}};t.ui=St(St({},t.ui),n)}(t,x.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,function(t){t.contentCSS=t.contentCSS.concat(function(t){var e=function(t){var e=t.getParam("content_css");return O(e)?V(e.split(","),zt):_(e)?e:!1===e||t.inline?[]:["default"]}(t),n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return V(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))}(t))}(t),t.inline?Kx(t):function(t,e){var n=Jx(t,e);e.editorContainer&&(Yx.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Yx.isHidden(e.editorContainer)),t.getElement().style.display="none",Yx.setAttrib(t.id,"aria-hidden","true"),n||Kx(t)}(t,n)},oC=Qu.DOM,iC=function(t){return"-"===t.charAt(0)},uC=function(t,e,n){return x.from(e).filter((function(t){return t.length>0&&!cv.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:x.some(e)}}))},aC=function(t,e){var n=na.ScriptLoader;!function(t,e,n,r){var o=Xc(e);if(O(o)){if(!iC(o)&&!bv.urls.hasOwnProperty(o)){var i=function(t){return t.getParam("theme_url")}(e);i?bv.load(o,e.documentBaseURI.toAbsolute(i)):bv.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){bv.waitFor(o,r)}))}else r()}(n,t,e,(function(){(function(t,e){var n=Wc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===aa.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,c,void 0,(function(){!function(t,e,n){Cv(t,"LanguageLoadError",Sv("language",e,n))}(e,o,n)}))}})(n,t),function(t,e,n){var r=uC(e,"default",n),o=function(t){return x.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:x.none()}}))}(e).orThunk((function(){return uC(e,Ic(e),"")}));j(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,c,void 0,(function(){!function(t,e,n){Cv(t,"IconsLoadError",Sv("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))}(n,t,e),function(t,e){xe.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){vv.load(n,e,c,void 0,(function(){kv(t,e,n)})),t.settings.plugins+=" "+n})),xe.each(Qc(t).split(/[ ,]/),(function(n){if((n=xe.trim(n))&&!vv.urls[n])if(iC(n)){n=n.substr(1,n.length);var r=vv.dependencies(n);xe.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=vv.createUrl(r,n);vv.load(o.resource,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};vv.load(n,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||rC(t)}),t,(function(){t.removed||rC(t)}))}))},cC={"font-size":"size","font-family":"face"},sC=function(t){return function(e,n){return x.from(n).map(Te).filter(Be).bind((function(n){return function(t,e,n){return Ld(Te(n),(function(e){return function(e){return Jn(e,t).orThunk((function(){return"font"===Me(e)?dt(cC,t).bind((function(t){return Gn(e,t)})):x.none()}))}(e)}),(function(t){return Ne(Te(e),t)}))}(t,e,n.dom).or(function(t,e){return x.from(Qu.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},lC=sC("font-size"),fC=s((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),sC("font-family")),dC=function(t){return al(t.getBody()).map((function(t){var e=t.container();return Mn(e)?e.parentNode:e}))},mC=function(t,e){return function(t){return x.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?x.none():x.from(t.selection.getStart(!0))}))}(t).orThunk(d(dC,t)).map(Te).filter(Be).map(e)},gC=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return xe.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return xe.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},hC=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return-1===t.indexOf(" ")||Rt(t,'"')||Rt(t,"'")?t:"'"+t+"'"})).join(",")},pC=xe.each,vC=xe.map,bC=xe.inArray,yC=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,xd(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus(),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(pC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;pC(t,(function(t,r){pC(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");pe.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),pC("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n=gC(t,e);t.formatter.toggle("fontname",{value:hC(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:gC(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.undoManager.transact((function(){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}))}(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){!function(t,e){var n=function(t){var e;return"string"!=typeof t?(e=xe.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}}(e);!function(t,e,n){hp(t).editor.insertContent(e,n)}(t,n.content,n.details)}(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Cx(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Sy(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Ln);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return sx(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=vC(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==bC(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return wy(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return mC(t,(function(e){return fC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return mC(t,(function(e){return lC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return mC(t,(function(e){var n=Te(t.getBody());return Ld(e,(function(t){return Jn(t,"line-height")}),d(Ne,n)).getOrThunk((function(){var t=parseFloat(Kn(e,"line-height")),n=parseFloat(Kn(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),wC="data-mce-contenteditable",xC=function(t,e,n){var r,o;ha(t,e)&&!1===n?(o=e,ma(r=t)?r.dom.classList.remove(o):function(t,e){(function(t,e,n){var r=W(da(t,e),(function(t){return t!==n}));r.length>0?Wn(t,e,r.join(" ")):Xn(t,e)})(t,"class",e)}(r,o),function(t){0===(ma(t)?t.dom.classList:function(t){return da(t,"class")}(t)).length&&Xn(t,"class")}(r)):n&&ga(t,e)},CC=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},SC=function(t,e){t.dom.contentEditable=e?"true":"false"},kC=function(t,e){var n=Te(t.getBody());xC(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){x.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,SC(n,!1),j(va(n,'*[contenteditable="true"]'),(function(t){Wn(t,wC,"true"),SC(t,!1)}))):(t.readonly=!1,SC(n,!0),j(va(n,'*[data-mce-contenteditable="true"]'),(function(t){Xn(t,wC),SC(t,!0)})),CC(t,"StyleWithCSS",!1),CC(t,"enableInlineTableEditing",!1),CC(t,"enableObjectResizing",!1),function(t){return Nd(t)||function(t){return cd().filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&Od(t,e.dom);var n})).isSome()}(t)}(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},OC=function(t){return t.readonly},TC=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){OC(t)&&j(e,(function(t){t.attr(wC,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(wC,(function(e){OC(t)&&j(e,(function(t){t.attr("contenteditable",t.attr(wC))}))})),t.serializer.addTempAttr(wC)},_C=xe.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"," "),EC=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||p}return t.isNative=function(t){return!!_C[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=e||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=v},r.stopPropagation=function(){r.isPropagationStopped=v},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=v},r.isDefaultPrevented=p,r.isPropagationStopped=p,r.isImmediatePropagationStopped=p),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=p),e){var o={func:e};r&&xe.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=this.bindings[a]=[],this.toggleEvent(a,!0)),n?c.unshift(o):c.push(o)}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return it(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e)for(var a=u.length;a--;)u[a].func===e&&(u=u.slice(0,a).concat(u.slice(a+1)),this.bindings[i]=u);else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else it(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),AC=function(t){return t._eventDispatcher||(t._eventDispatcher=new EC({scope:t,toggleEvent:function(e,n){EC.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},NC={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=AC(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return AC(this).on(t,e,n)},off:function(t,e){return AC(this).off(t,e)},once:function(t,e){return AC(this).once(t,e)},hasEventListeners:function(t){return AC(this).has(t)}},RC=Qu.DOM,MC=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=Gc(t);return n?(t.eventRoot||(t.eventRoot=RC.select(n)[0]),t.eventRoot):t.getBody()},zC=function(t,e,n){!function(t){return!t.hidden&&!OC(t)}(t)?OC(t)&&function(t,e){if(function(t){return"click"===t.type}(e)&&!Cf.metaKeyPressed(e)){var n=Te(e.target);(function(t,e){return xr(e,"a",(function(e){return Ne(e,Te(t.getBody()))})).bind((function(t){return Gn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Rt(o=n,"#")?function(t,e){return t.substring(e)}(o,"#".length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o}))}}(t,n):t.fire(e,n)},DC=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=MC(t,e);if(Gc(t)){if(Gy||(Gy={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Gy&&(it(Gy,(function(e,n){t.dom.unbind(MC(t,n))})),Gy=null)}))),Gy[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||RC.isChildOf(r,u))&&zC(o[i],e,n)}},Gy[e]=n,RC.bind(r,e,n)}else n=function(n){zC(t,e,n)},RC.bind(r,e,n),t.delegates[e]=n}},BC=St(St({},NC),{bindPendingEventDelegates:function(){var t=this;xe.each(t._pendingNativeEvents,(function(e){DC(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(e?n.initialized?DC(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(MC(n,t),t,n.delegates[t]),delete n.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(it(t.delegates,(function(e,n){t.dom.unbind(MC(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),PC=["design","readonly"],IC=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&kC(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},LC=xe.each,HC=xe.explode,FC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},VC=xe.makeMap("alt,ctrl,shift,meta,access"),jC=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(LC(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return LC(HC(xe.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:xe.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.parseShortcut=function(t){var e,n={};LC(HC(t.toLowerCase(),"+"),(function(t){t in VC?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=FC[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in VC)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,pe.mac?n.ctrl=!0:n.shift=!0),n.meta&&(pe.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=xe.map(HC(t,">"),this.parseShortcut);return o[o.length-1]=xe.extend(o[o.length-1],{func:n,scope:r||this.editor}),xe.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),UC=xe.each,WC=xe.trim,qC="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),$C={ftp:21,http:80,https:443,mailto:25},GC=function(){function t(e,n){e=WC(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);UC(qC,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=$C[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(UC(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?J(i).join("/"):a.slice(0,n).join("/")+"/"+J(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),XC=Qu.DOM,KC=xe.extend,YC=xe.each,JC=xe.resolve,QC=pe.ie,ZC=function(){function t(t,e,n){var r,o,i,u,a,s,l,f,d,m=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,KC(this,BC),this.settings=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:nv(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"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",indent_after:"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",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return St(St({},i),r?Zp:{})}(o,e,n,Kp,t);return uv(Yp||Jp,Yp,i,r,o)}(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(na.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Qu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),sa.languageLoad=this.settings.language_load,sa.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new GC(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new jC(this),this.editorCommands=new yC(this),this.settings.cache_suffix&&(pe.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:(o={},i={},u={},a={},s={},l={},d={addButton:(f=function(t,e){return function(n,r){return t[n.toLowerCase()]=St(St({},r),{type:e})}})(r={},"button"),addGroupToolbarButton:f(r,"grouptoolbarbutton"),addToggleButton:f(r,"togglebutton"),addMenuButton:f(r,"menubutton"),addSplitButton:f(r,"splitbutton"),addMenuItem:f(o,"menuitem"),addNestedMenuItem:f(o,"nestedmenuitem"),addToggleMenuItem:f(o,"togglemenuitem"),addAutocompleter:f(i,"autocompleter"),addContextMenu:f(a,"contextmenu"),addContextToolbar:f(s,"contexttoolbar"),addContextForm:f(s,"contextform"),addSidebar:f(l,"sidebar"),addIcon:function(t,e){return u[t.toLowerCase()]=e},getAll:function(){return{buttons:r,menuItems:o,icons:u,popups:i,contextMenus:a,contextToolbars:s,sidebars:l}}},{addAutocompleter:d.addAutocompleter,addButton:d.addButton,addContextForm:d.addContextForm,addContextMenu:d.addContextMenu,addContextToolbar:d.addContextToolbar,addIcon:d.addIcon,addMenuButton:d.addMenuButton,addMenuItem:d.addMenuItem,addNestedMenuItem:d.addNestedMenuItem,addSidebar:d.addSidebar,addSplitButton:d.addSplitButton,addToggleButton:d.addToggleButton,addGroupToolbarButton:d.addGroupToolbarButton,addToggleMenuItem:d.addToggleMenuItem,getAll:d.getAll}),styleSheetLoader:void 0,show:c,hide:c,enable:c,disable:c,isDisabled:p};var g,h,v,b=(g=this,h=ra("design"),v=ra({design:{activate:c,deactivate:c,editorReadOnly:!1},readonly:{activate:c,deactivate:c,editorReadOnly:!0}}),function(t){t.serializer?TC(t):t.on("PreInit",(function(){TC(t)}))}(g),function(t){t.on("ShowCaret",(function(e){OC(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){OC(t)&&e.preventDefault()}))}(g),{isReadOnly:function(){return OC(g)},set:function(t){return function(t,e,n,r){if(r!==n.get()){if(!mt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?IC(t,n,e,r):t.on("init",(function(){return IC(t,n,e,r)}))}}(g,v.get(),h,t)},get:function(){return h.get()},register:function(t,e){v.set(function(t,e,n){var r;if(H(PC,e))throw new Error("Cannot override default mode "+e);return St(St({},t),((r={})[e]=St(St({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(v.get(),t,e))}});this.mode=b,this.setMode=b.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Wu.overrideDefaults((function(){return{context:m.inline?m.getBody():m.getDoc(),element:m.getBody()}}))}return t.prototype.render=function(){!function(t){var e=t.id;aa.setCode(Wc(t));var n=function(){oC.unbind(window,"ready",n),t.render()};if(xi.Event.domLoaded){if(t.getElement()&&pe.contentEditable){var r=Te(t.getElement()),o=function(t){return $(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){U(r.dom.attributes,(function(t){return Xn(r,t.name)})),qn(r,o)})),t.ui.styleSheetLoader=function(t,e){return Er.forElement(t,{contentCssCors:Jc(e),referrerPolicy:Uc(e)})}(r,t),function(t){return t.getParam("inline")}(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||oC.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Rn(t.getElement())&&(oC.insertAfter(oC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},oC.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=yv(t),t.notificationManager=pv(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=oC.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),aC(t,t.suffix)}}else oC.bind(window,"ready",n)}(this)},t.prototype.focus=function(t){!function(t,e){t.removed||(e?Rd(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===Nd(t)&&xd(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return Ad(o),Ed(t,r),void Rd(t);t.inline||(pe.opera||Ad(n),t.getWin().focus()),(pe.gecko||t.inline)&&(Ad(n),Ed(t,r)),Rd(t)}(t))}(this,t)},t.prototype.hasFocus=function(){return Nd(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?JC(r):0,i=JC(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return aa.translate(t)},t.prototype.getParam=function(t,e,n){return function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?j(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[xe.trim(n[0])]=xe.trim(n[1]):e[xe.trim(n[0])]=xe.trim(n[0])})):e=t,e}(i):"string"===r?av(O,t,e).getOr(n):"number"===r?av(D,t,e).getOr(n):"boolean"===r?av(A,t,e).getOr(n):"object"===r?av(T,t,e).getOr(n):"array"===r?av(_,t,e).getOr(n):"string[]"===r?av((o=O,function(t){return _(t)&&Y(t,o)}),t,e).getOr(n):"function"===r?av(z,t,e).getOr(n):i}(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!(!H(Qc(this).split(/[ ,]/),t)||e&&void 0===vv.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(XC.show(t.getContainer()),XC.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(QC&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(XC.hide(t.getContainer()),XC.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=Rn(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Rn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=XC.getParent(r.id,"form"))&&YC(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return Up(this,t,e)},t.prototype.getContent=function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return hp(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")}(this,t)},t.prototype.insertContent=function(t,e){e&&(t=KC({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?Up(this,this.startContent,{format:"raw"}):Up(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=XC.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=XC.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){!function(t,e){(function(t,e){pp(t).editor.addVisual(e)})(t,e)}(this,t)},t.prototype.remove=function(){!function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Wp.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Wp.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Wp.remove(t.getContainer()),qp(e),qp(n),t.destroy()}}(this)},t.prototype.destroy=function(t){!function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),qp(n),qp(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Wp.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())}(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),tS=Qu.DOM,eS=xe.explode,nS=xe.each,rS=xe.extend,oS=0,iS=!1,uS=[],aS=[],cS=function(t){var e=t.type;nS(dS.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},sS=function(t){t!==iS&&(t?Wu(window).on("resize scroll",cS):Wu(window).off("resize scroll",cS),iS=t)},lS=function(t){var e=aS;delete uS[t.id];for(var n=0;n<uS.length;n++)if(uS[n]===t){uS.splice(n,1);break}return aS=W(aS,(function(e){return t!==e})),dS.activeEditor===t&&(dS.activeEditor=aS.length>0?aS[0]:null),dS.focusedEditor===t&&(dS.focusedEditor=null),e.length!==aS.length},fS="CSS1Compat"!==document.compatMode,dS=St(St({},NC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Wu,majorVersion:"5",minorVersion:"6.2",releaseDate:"2020-12-08",editors:uS,i18n:aa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=GC.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c;if(""!==(c=u[a].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}!t&&document.currentScript&&(-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/")))}n.baseURL=new GC(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new GC(n.baseURL),n.suffix=r,(o=n).on("AddEditor",d(Td,o)),o.on("RemoveEditor",d(_d,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&it(r,(function(t,e){sa.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=xe.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"," "),o=function(t){var e=t.id;return e||(e=dt(t,"name").filter((function(t){return!tS.get(t)})).getOrThunk(tS.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):tS.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new ZC(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};tS.unbind(window,"ready",a),function(e){var r=t[e];r&&r.apply(n,Array.prototype.slice.call(arguments,2))}("onpageload"),e=Wu.unique(function(t){var e=[];if(pe.browser.isIE()&&pe.browser.version.major<11)return Ov("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(fS)return Ov("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return nS(t.types,(function(t){e=e.concat(tS.select(t.selector))})),e;if(t.selector)return tS.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&nS(eS(n),(function(t){var n=tS.get(t);n?e.push(n):nS(document.forms,(function(n){nS(n.elements,(function(n){n.name===t&&(t="mce_editor_"+oS++,tS.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":nS(tS.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?nS(t.types,(function(n){xe.each(e,(function(e){return!tS.is(e,n.selector)||(l(o(e),rS({},t,n),e),!1)}))})):(xe.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(lS(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=xe.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):nS(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):Ov("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,tS.bind(window,"ready",a),new Cr((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?aS.slice(0):O(t)?G(aS,(function(e){return e.id===t})).getOr(null):D(t)&&aS[t]?aS[t]:null},add:function(t){var e=this;return uS[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(uS[t.id]=t),uS.push(t),aS.push(t)),sS(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Xy||(Xy=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Xy))),t},createEditor:function(t,e){return this.add(new ZC(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!O(t))return n=t,E(r.get(n.id))?null:(lS(n)&&r.fire("RemoveEditor",{editor:n}),0===aS.length&&window.removeEventListener("beforeunload",Xy),n.remove(),sS(aS.length>0),n);nS(tS.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=aS.length-1;e>=0;e--)r.remove(aS[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new ZC(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",0,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){nS(aS,(function(t){t.save()}))},addI18n:function(t,e){aa.add(t,e)},translate:function(t){return aa.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new GC(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new GC(this.baseURL)}});dS.setup();var mS,gS,hS,pS,vS=Math.min,bS=Math.max,yS=Math.round,wS=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=yS(c/2)),"c"===s[1]&&(r+=yS(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=yS(u/2)),"c"===s[4]&&(r-=yS(i/2)),xS(r,o,i,u)},xS=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},CS={inflate:function(t,e,n){return xS(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:wS,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=wS(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=bS(t.x,e.x),r=bS(t.y,e.y),o=vS(t.x+t.w,e.x+e.w),i=vS(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:xS(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=bS(0,e.x-r),l=bS(0,e.y-o),f=bS(0,i-a),d=bS(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),xS(r,o,(i-=f)-r,(u-=d)-o)},create:xS,fromClientRect:function(t){return xS(t.left,t.top,t.width,t.height)}},SS=(mS={},gS={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==mS[t])return mS[t];var o=new Cr((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);gS[t]=u.resolve,na.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return mS[t]=o,o},add:function(t,e){void 0!==gS[t]&&(gS[t](e),delete gS[t]),mS[t]=Cr.resolve(e)}}),kS=xe.each,OS=xe.extend,TS=function(){};TS.extend=hS=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!pS&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};pS=!0;var o=new this;return pS=!1,t.Mixins&&(kS(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&kS(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&kS(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&kS(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=OS({},e.Defaults,t.Defaults)),it(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=hS,n};var _S,ES=Math.min,AS=Math.max,NS=Math.round,RS={serialize:function(t){var e=JSON.stringify(t);return O(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},MS={callbacks:{},count:0,send:function(t){var e=this,n=Qu.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},zS=St(St({},NC),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Tr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",zS.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&xe.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=zS.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Tr.setTimeout(r,10)}}),DS=xe.extend,BS=function(){function t(t){this.settings=DS({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=DS(this.settings,t);r.success=function(t,o){void 0===(t=RS.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=RS.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",zS.send(r)},t}();try{var PS="__storage_test__";(_S=window.localStorage).setItem(PS,PS),_S.removeItem(PS)}catch(t){_S=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var IS={geom:{Rect:CS},util:{Promise:Cr,Delay:Tr,Tools:xe,VK:Cf,URI:GC,Class:TS,EventDispatcher:EC,Observable:NC,I18n:aa,XHR:zS,JSON:RS,JSONRequest:BS,JSONP:MS,LocalStorage:_S,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=AS(0,ES(e,1)),i=AS(0,ES(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=NS(255*(n+s)),r=NS(255*(r+s)),o=NS(255*(o+s))}else n=r=o=NS(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=ES(t/=255,ES(e/=255,n/=255)),u=AS(t,AS(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:NS(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:NS(100*r),v:NS(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:xi,Sizzle:ou,DomQuery:Wu,TreeWalker:Ar,TextSeeker:Na,DOMUtils:Qu,ScriptLoader:na,RangeUtils:Vf,Serializer:jp,StyleSheetLoader:_r,ControlSelection:kf,BookmarkManager:yf,Selection:Cp,Event:xi.Event},html:{Styles:di,Entities:Io,Node:Jd,Schema:Go,SaxParser:um,DomParser:Hp,Writer:Zd,Serializer:tm},Env:pe,AddOnManager:sa,Annotator:vf,Formatter:Bv,UndoManager:Pv,EditorCommands:yC,WindowManager:yv,NotificationManager:pv,EditorObservable:BC,Shortcuts:jC,Editor:ZC,FocusManager:Cd,EditorManager:dS,DOM:Qu.DOM,ScriptLoader:na.ScriptLoader,PluginManager:vv,ThemeManager:bv,IconManager:cv,Resource:SS,trim:xe.trim,isArray:xe.isArray,is:xe.is,toArray:xe.toArray,makeMap:xe.makeMap,each:xe.each,map:xe.map,grep:xe.grep,inArray:xe.inArray,extend:xe.extend,create:xe.create,walk:xe.walk,createNS:xe.createNS,resolve:xe.resolve,explode:xe.explode,_addCacheSuffix:xe._addCacheSuffix,isOpera:pe.opera,isWebKit:pe.webkit,isIE:pe.ie,isGecko:pe.gecko,isMac:pe.mac},LS=xe.extend(dS,IS);!function(t){window.tinymce=t,window.tinyMCE=t}(LS),function(e){try{t.exports=e}catch(t){}}(LS)}()}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{"use strict";n(7575),n(6890),n(8860),n(5209),n(3356),n(2875),n(8619),n(2540),n(8190),n(1295),n(2170),n(2682),n(1236),n(6884),n(4400),n(8208),n(6586),n(5053),n(7259),n(4926),n(5031),n(397),n(1933),n(5187),n.g.current_selection_range=null,n.g.editor=null})()})();\ No newline at end of file+(()=>{var t={2968:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.css"},6202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.min.css"},7286:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.css"},7362:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.min.css"},287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.css"},2271:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.min.css"},5417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.css"},874:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.min.css"},3341:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.css"},8786:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.css"},4243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.min.css"},9702:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.min.css"},1389:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.css"},3513:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.min.css"},1064:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/fonts/tinymce-mobile.woff"},8057:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.css"},6332:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.min.css"},4429:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.css"},18:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.min.css"},7899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.css"},7548:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.min.css"},9506:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.css"},8273:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.css"},7251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.min.css"},6122:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.min.css"},993:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.css"},8215:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.min.css"},9916:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/fonts/tinymce-mobile.woff"},8382:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.css"},4522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.min.css"},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.css"},8537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.min.css"},818:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.css"},6913:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.min.css"},8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-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 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-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 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.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 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 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 01-.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 00-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 010 2H5a1 1 0 010-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 110-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 01-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></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 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 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 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 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.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.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 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.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 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 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 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-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>',"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 01-.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 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-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.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.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 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.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 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-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 010-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 010-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 010-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-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 010-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 010-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 010-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 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.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 010-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.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-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 010-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 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-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.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.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 01-.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 01-.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 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.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 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.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 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 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 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-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 01-1-1v-2H7V9H5a1 1 0 110-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 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 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 017 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 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.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 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 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.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-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 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.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 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-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 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-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-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-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 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.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 0119 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 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.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 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-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 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 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 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-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 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-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 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-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 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 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.7l2.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-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 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.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 00-.8.8.8.8 0 01-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 012.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 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 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 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-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 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.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 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 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.7l-.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>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-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 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.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 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 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.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.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.6L34.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 00-.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 00-.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 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.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 17l-.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 01-.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 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-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 110-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 01-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="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.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 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.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 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 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 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.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 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-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 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-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 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-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 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 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 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.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 012.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 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-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 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.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 11-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 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-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.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-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 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 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 01-.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 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 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 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.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 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-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 01-.2-.6V8H5a1 1 0 110-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 01-.2-.6V13H5a1 1 0 010-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 01-.2-.6V18H5a1 1 0 010-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 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.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 010-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 00-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 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 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 017 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 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.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 00-.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 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.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-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-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 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.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 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.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 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-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 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-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 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-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 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.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.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.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 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-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 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.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 010-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 01-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 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 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 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.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 01-.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 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-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 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.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>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.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 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.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 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},6890:(t,e,n)=>{n(8785)},4400:(t,e,n)=>{n(2242)},2242:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},m=function(t,e,n){var r=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(e.parents,d),o=-1!==r?e.parents.slice(0,r):e.parents,u=i.grep(o,function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&function(t,e){return t.$.contains(t.getBody(),e)}(t,e)}}(t));return u.length>0&&u[0].nodeName===n},g=function(t,e,n,r,u,a){t.ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===u?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(i.map(a,(function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===u?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t)}})))},onAction:function(){return t.execCommand(r)},onItemAction:function(e,n){o(t,u,n)},select:function(e){return function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return function(t){return null==t?l:f(t)}(t.dom.getStyle(e,"listStyleType"))}(t).map((function(t){return e===t})).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(m(t,n,u))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}})},h=function(t,e,n,r,o,i){i.length>1?g(t,e,n,r,o,i):function(t,e,n,r,o,i){t.ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(m(t,n,o))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},onAction:function(){return t.execCommand(r)}})}(t,e,n,r,o)};r.add("advlist",(function(t){t.hasPlugin("lists")&&(function(t){h(t,"numlist","Numbered list","InsertOrderedList","OL",function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]}(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",function(t){var e=t.getParam("advlist_bullet_styles","default,circle,square");return e?e.split(/[ ,]/):[]}(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(e,n){o(t,"UL",n["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(e,n){o(t,"OL",n["list-style-type"])}))}(t))}))}()},6884:(t,e,n)=>{n(7652)},7652:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},r=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,n(e,r)):t.setStartBefore(e)},o=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,n(e,r)):t.setEndAfter(e)},i=function(t,e,n){var i,u,a,c,s,l,f,d=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i)}(t),m=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var g=t.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(l=s.length,r(g,s,l),o(g,s,l),g.endOffset<5)return;i=g.endOffset,u=s}else{if(3!==(u=g.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(r(g,u,0),o(g,u,u.nodeValue.length))}i=1===g.endOffset?2:g.endOffset-1-e}var h=i;do{r(g,u,i>=2?i-2:0),o(g,u,i>=1?i-1:0),i-=1,f=g.toString()}while(" "!==f&&""!==f&&160!==f.charCodeAt(0)&&i-2>=0&&f!==n);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(g.toString(),n)?0===g.startOffset?(r(g,u,0),o(g,u,h)):(r(g,u,i),o(g,u,h)):(r(g,u,i),o(g,u,h),i+=1),"."===(c=g.toString()).charAt(c.length-1)&&o(g,u,h-1);var p=(c=g.toString().trim()).match(d),v=function(t){return t.getParam("link_default_protocol","http","string")}(t);p&&("www."===p[1]?p[1]=v+"://www.":/@$/.test(p[1])&&!/^mailto:/.test(p[1])&&(p[1]="mailto:"+p[1]),a=t.selection.getBookmark(),t.selection.setRng(g),t.execCommand("createlink",!1,p[1]+p[2]),!1!==m&&t.dom.setAttrib(t.selection.getNode(),"target",m),t.selection.moveToBookmark(a),t.nodeChanged())}};t.add("autolink",(function(t){!function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){i(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){i(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){i(t,0,"")}(t)})))}(t)}))}()},5209:(t,e,n)=>{n(8578)},8578:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=tinymce.util.Tools.resolve("tinymce.util.Delay"),r=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},o=function(t,e,r,i,u){n.setEditorTimeout(t,(function(){a(t,e),r--?o(t,e,r,i,u):u&&u()}),i)},i=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},u=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},a=function(t,n){var o=t.dom,c=t.getDoc();if(c)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))i(t,!0);else{var s=c.documentElement,l=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),f=r(t),d=u(o,s,"margin-top",!0),m=u(o,s,"margin-bottom",!0),g=s.offsetHeight+d+m+l;g<0&&(g=0);var h=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;g+h>r(t)&&(f=g+h);var p=function(t){return t.getParam("max_height",0,"number")}(t);if(p&&f>p?(f=p,i(t,!0)):i(t,!1),f!==n.get()){var v=f-n.get();if(o.setStyle(t.getContainer(),"height",f+"px"),n.set(f),function(t){t.fire("ResizeEditor")}(t),e.browser.isSafari()&&e.mac){var b=t.getWin();b.scrollTo(b.pageXOffset,b.pageYOffset)}t.hasFocus()&&t.selection.scrollIntoView(t.selection.getNode()),e.webkit&&v<0&&a(t,n)}}};t.add("autoresize",(function(t){if(t.settings.hasOwnProperty("resize")||(t.settings.resize=!1),!t.inline){var e=(n=0,{get:function(){return n},set:function(t){n=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){a(t,e)}))}(t,e),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(){a(t,e)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){o(t,e,20,100,(function(){o(t,e,5,1e3)}))}))}(t,e)}var n}))}()},8190:(t,e,n)=>{n(7440)},7440:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.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:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})};t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){e(t)}))}(t),function(t){t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return e(t)}}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return e(t)}})}(t),{}}))}()},7259:(t,e,n)=>{n(8492)},8492:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var n,r=t.dom,i=t.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),o.each(i,(function(t){r.getParent(t.parentNode,'*[dir="'+e+'"]',r.getRoot())||r.setAttrib(t,"dir",n!==e?e:null)})),t.nodeChanged())},u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return"function"==typeof t},g=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},h=g,p=("undefined"!=typeof window?window:Function("return this;")(),function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}}),v=p(3),b=p(9),y=p(11),w=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode)?function(t){return h(t.dom.getRootNode())}:function(t){return b(t)?t:h(t.dom.ownerDocument)},x=function(t){return h(t.dom.host)},C=function(t){var e=v(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o,i,u=e.ownerDocument;return(o=h(e),i=w(o),y(i)?d.some(i):d.none()).fold((function(){return u.body.contains(e)}),(n=C,r=x,function(t){return n(r(t))}))},S=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||C(t)?r:function(t,e){return function(t){return void 0!==t.style&&m(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""}(n,e)}(t,"direction")?"rtl":"ltr"},k=function(t,e){return function(n){var r=function(t){var r=h(t.element);n.setActive(S(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};r.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){i(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){i(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:k(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:k(t,"rtl")})}(t)}))}()},4926:(t,e,n)=>{n(755)},755:()=>{!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})}(t)}))}()},2170:(t,e,n)=>{n(3302)},3302:()=>{!function(){"use strict";var t,e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},c=u("string"),s=u("object"),l=u("array"),f=(null,function(t){return null===t}),d=a("boolean"),m=a("number"),g=function(){},h=function(t){return function(){return t}},p=h(!1),v=h(!0),b=function(){return y},y=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:r,orThunk:n,map:b,each:g,bind:b,exists:p,forall:v,filter:b,equals:e,equals_:e,toArray:function(){return[]},toString:h("none()")}),w=function(t){var e=h(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.push,S=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!l(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);C.apply(e,t[n])}return e},k=("undefined"!=typeof window?window:Function("return this;")(),function(t,e,n){!function(t,e,n){if(!(c(n)||d(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)}),O=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},T=O,_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),A=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(t){return t.getParam("image_dimensions",!0,"boolean")},R=function(t){return t.getParam("images_upload_url","","string")},M=function(t){return t.getParam("images_upload_handler",void 0,"function")},z=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},D=function(t){return t&&(t=t.replace(/px$/,"")),t},B=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},P=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},I=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},L=_.DOM,H=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?D(t.style.marginLeft):""},F=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?D(t.style.marginTop):""},V=function(t){return t.style.borderWidth?D(t.style.borderWidth):""},j=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},U=function(t,e){return t.style[e]?t.style[e]:""},W=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},q=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},$=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},G=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=B(r),$(t,e)):q(t,n,r)}},X=function(t,e){return t.style[e]?D(t.style[e]):j(t,e)},K=function(t,e){var n=B(e);t.style.marginLeft=n,t.style.marginRight=n},Y=function(t,e){var n=B(e);t.style.marginTop=n,t.style.marginBottom=n},J=function(t,e){var n=B(e);t.style.borderWidth=n},Q=function(t,e){t.style.borderStyle=e},Z=function(t){return"FIGURE"===t.nodeName},tt=function(t){return 0===L.getAttrib(t,"alt").length&&"presentation"===L.getAttrib(t,"role")},et=function(t){return tt(t)?"":j(t,"alt")},nt=function(t,e){return{src:j(e,"src"),alt:et(e),title:j(e,"title"),width:X(e,"width"),height:X(e,"height"),class:j(e,"class"),style:t(j(e,"style")),caption:W(e),hspace:H(e),vspace:F(e),border:V(e),borderStyle:U(e,"borderStyle"),isDecorative:tt(e)}},rt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},ot=function(t,e,n){if(n){L.setAttrib(t,"role","presentation");var r=T(t);k(r,"alt","")}else f(e)?("alt",(r=T(t)).dom.removeAttribute("alt")):(r=T(t),k(r,"alt",e)),"presentation"===L.getAttrib(t,"role")&&L.setAttrib(t,"role","")},it=function(t,e){return function(n,r,o){t(n,o),$(n,e)}},ut=function(t,e,n){var r=nt(t,n);rt(n,r,e,"caption",(function(t,e,n){return function(t){W(t)?function(t){var e=t.parentNode;L.insertAfter(t,e),L.remove(e)}(t):function(t){var e=L.create("figure",{class:"image"});L.insertAfter(e,t),e.appendChild(t),e.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)}(t)})),rt(n,r,e,"src",q),rt(n,r,e,"title",q),rt(n,r,e,"width",G(0,t)),rt(n,r,e,"height",G(0,t)),rt(n,r,e,"class",q),rt(n,r,e,"style",it((function(t,e){return q(t,"style",e)}),t)),rt(n,r,e,"hspace",it(K,t)),rt(n,r,e,"vspace",it(Y,t)),rt(n,r,e,"border",it(J,t)),rt(n,r,e,"borderStyle",it(Q,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||ot(t,n.alt,n.isDecorative)}(n,r,e)},at=function(t,e){var n=t.dom.styles.parse(e),r=P(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},ct=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||I(e))?null:e},st=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,(function(e){return!!t.schema.getTextBlockElements()[e.nodeName]}),t.getBody());return r?n.split(r,e):e},lt=Object.prototype.hasOwnProperty,ft=(t=function(t,e){return s(t)&&s(e)?ft(t,e):e},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)lt.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}),dt=tinymce.util.Tools.resolve("tinymce.util.Tools"),mt=function(t){return c(t.value)?t.value:""},gt=function(t,e){var n=[];return dt.each(t,(function(t){var r=function(t){return c(t.text)?t.text:c(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=gt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},ht=function(t){return void 0===t&&(t=mt),function(e){return e?x.from(e).map((function(e){return gt(e,t)})):x.none()}},pt=function(t,e){return function(t,n){for(var r=0;r<t.length;r++){var o=function(t){return Object.prototype.hasOwnProperty.call(t,"items")}(i=t[r])?pt(i.items,e):i.value===e?x.some(i):x.none();if(o.isSome())return o}var i;return x.none()}(t)},vt=ht,bt=function(t,e){return t.bind((function(t){return pt(t,e)}))};var yt=function(t){var e,n=vt((function(e){return t.convertURL(e.value||e.url,"src")})),r=new E((function(e){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);"string"==typeof n?A.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}(t,(function(t){e(n(t).map((function(t){return S([[{text:"None",value:""}],t])})))}))})),o=(e=function(t){return t.getParam("image_class_list")}(t),ht(mt)(e)),i=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),u=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return!!R(t)}(t),s=function(t){return!!M(t)}(t),l=function(t){var e=ct(t);return e?nt((function(e){return at(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),f=function(t){return t.getParam("image_description",!0,"boolean")}(t),d=function(t){return t.getParam("image_title",!1,"boolean")}(t),m=N(t),g=function(t){return t.getParam("image_caption",!1,"boolean")}(t),h=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),p=R(t),v=function(t){return t.getParam("images_upload_base_path",void 0,"string")}(t),b=function(t){return t.getParam("images_upload_credentials",!1,"boolean")}(t),y=M(t),w=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),C=x.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return c(t)&&t.length>0}));return r.then((function(t){return{image:l,imageList:t,classList:o,hasAdvTab:i,hasUploadTab:u,hasUploadUrl:a,hasUploadHandler:s,hasDescription:f,hasImageTitle:d,hasDimensions:m,hasImageCaption:g,url:p,basePath:v,credentials:b,handler:y,prependURL:C,hasAccessibilityOptions:h,automaticUploads:w}}))},wt=function(t){var e=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),n={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},r=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[n]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:S([r.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},xt=function(t){return{title:"General",name:"general",items:wt(t)}},Ct=wt,St=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},kt=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Ot=function(t,e,n,r){(function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?x.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?x.some(t+e):x.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))})(e,r),function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=ft({},n);!function(t,e,n){t.hasDescription&&c(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&c(n.title)&&(e.title=n.title),t.hasDimensions&&(c(n.width)&&(e.dimensions.width=n.width),c(n.height)&&(e.dimensions.height=n.height)),c(n.class)&&bt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&d(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(c(n.style)&&(e.style=n.style),c(n.vspace)&&(e.vspace=n.vspace),c(n.border)&&(e.border=n.border),c(n.hspace)&&(e.hspace=n.hspace),c(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}}(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=bt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Tt=function(t,e,n,r){var o,i=r.getData();r.block("Uploading image"),(o=i.fileinput,function(t,e){return 0<t.length?x.some(t[0]):x.none()}(o)).fold((function(){r.unblock()}),(function(o){var i,u,a,c=URL.createObjectURL(o),s=(u={url:e.url,basePath:e.basePath,credentials:e.credentials,handler:e.handler},a=function(t,e,n,r){var o=new XMLHttpRequest;o.open("POST",u.url),o.withCredentials=u.credentials,o.upload.onprogress=function(t){r(t.loaded/t.total*100)},o.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){if(o.status<200||o.status>=300)n("HTTP Error: "+o.status);else{var t,r,i=JSON.parse(o.responseText);i&&"string"==typeof i.location?e((t=u.basePath,r=i.location,t?t.replace(/\/$/,"")+"/"+r.replace(/^\//,""):r)):n("Invalid JSON: "+o.responseText)}};var i=new FormData;i.append("file",t.blob(),t.filename()),o.send(i)},u=dt.extend({credentials:!1,handler:a},u),{upload:function(t){return u.url||u.handler!==a?function(t,e){return new E((function(n,r){try{e(t,n,r,g)}catch(t){r(t.message)}}))}(t,u.handler):E.reject("Upload url missing from the settings.")}}),l=function(){r.unblock(),URL.revokeObjectURL(c)},f=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ot(t,e,n,r)};(i=o,new E((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,c,n);e.automaticUploads?s.upload(i).then((function(t){f(t),l()})).catch((function(e){l(),t.alertErr(e)})):(t.addToBlobCache(i),f(i.blobUri()),r.unblock())}))}))},_t=function(t,e,n){return function(r,o){"src"===o.name?Ot(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=bt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ot(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=function(t,e,n){var r=P(t(n.style)),o=ft({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?D(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?D(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?D(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o}(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=ft(St(e.image),n.getData()),o=function(t,e){var n=document.createElement("img");return q(n,"style",e.style),(H(n)||""!==e.hspace)&&K(n,e.hspace),(F(n)||""!==e.vspace)&&Y(n,e.vspace),(V(n)||""!==e.border)&&J(n,e.border),(function(t){return U(t,"borderStyle")}(n)||""!==e.borderStyle)&&Q(n,e.borderStyle),t(n.getAttribute("style"))}(t.normalizeCss,kt(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?Tt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Et=function(t){return function(){t.open=!1}},At=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:S([[xt(t)],t.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{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"}]}]}]}]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Ct(t)}},Nt=function(t){return function(e){return function(n){var r=ft(St(e.image),n.getData());t.execCommand("mceUpdateImage",!1,kt(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Rt=function(t){return function(e){return function(t){return new E((function(e){var n=document.createElement("img"),r=function(t){n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:z(n.width,n.clientWidth),height:z(n.height,n.clientHeight)};r(E.resolve(t))},n.onerror=function(){r(E.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},Mt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Dt=function(t){return function(e){t.windowManager.alert(e)}},Bt=function(t){return function(e){return at(t,e)}},Pt=function(t){return function(e){return t.dom.parseStyle(e)}},It=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},Lt=function(t){var e={onSubmit:Nt(t),imageSize:Rt(t),addToBlobCache:zt(t),createBlobCache:Mt(t),alertErr:Dt(t),normalizeCss:Bt(t),parseStyle:Pt(t),serializeStyle:It(t)};return{open:function(){yt(t).then(function(t){return function(e){var n=function(t){return{prevImage:bt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:At(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:St(e.image),onSubmit:t.onSubmit(e),onChange:_t(t,e,n),onClose:Et(n)}}}(e)).then(t.windowManager.open)}}},Ht=function(t){t.addCommand("mceImage",Lt(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return function(t,e){var n=ct(t);if(n){var r=nt((function(e){return at(t,e)}),n),o=i(i({},r),e);o.src?function(t,e){var n=ct(t);if(ut((function(e){return at(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),Z(n.parentNode)){var r=n.parentNode;st(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!N(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)}(t,o):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&function(t,e){var n=function(t,e){var n=document.createElement("img");if(ut(t,i(i({},e),{caption:!1}),n),ot(n,e.alt,e.isDecorative),e.caption){var r=L.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return at(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Z(r)){var o=st(t,r);t.selection.select(o)}else t.selection.select(r)}(t,i(i({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))}(t,n)}))}))},Ft=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},Vt=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];Ft(o)&&(o.attr("contenteditable",t?"false":null),dt.each(o.getAll("figcaption"),r))}}};o.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",Vt(!0)),t.serializer.addNodeFilter("figure",Vt(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Lt(t).open,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Lt(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return Z(t)||"IMG"===t.nodeName&&!I(t)?["image"]:[]}})}(t),Ht(t)}))}()},5053:(t,e,n)=>{n(3253)},3253:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return!function(t){return null==t}(t)},g=("function",function(t){return"function"==typeof t});function h(t,e){return b(document.createElement("canvas"),t,e)}function p(t){var e=h(t.width,t.height);return v(e).drawImage(t,0,0),e}function v(t){return t.getContext("2d")}function b(t,e,n){return t.width=e,t.height=n,t}var y=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function w(t){return new y((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}function x(t){return new y((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return d.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,m=Math.min(f+i,a),g=new Array(m-f),h=f,p=0;h<m;++p,++h)g[p]=u[h].charCodeAt(0);s[l]=new Uint8Array(g)}return d.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))}function C(t,e,n){return e=e||"image/png",g(HTMLCanvasElement.prototype.toBlob)?new y((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):x(t.toDataURL(e,n))}var S=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()}(t,e,a)};function k(t,e,n){var r=e.type;function o(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:u(r),toBlob:function(){return y.resolve(e)},toDataURL:u(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return C(t,e,n)}))},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(p)}}}function O(t){return function(t){return new y((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return k(function(t){return w(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=h(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return v(e).drawImage(t,0,0),e}))}(t),t,e)}))}function T(t,e){return C(t,e).then((function(e){return k(y.resolve(t),e,t.toDataURL())}))}var _=Object.keys,E=function(t,e,n){return void 0===n&&(n=!1),new y((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=_(t),r=0,i=n.length;r<i;r++){var u=n[r];a=t[u],c=u,o.setRequestHeader(c,a)}var a,c}(e),o.responseType="blob",o.send()}))},A=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],N=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],R=function(t){var e=function(t){return"ImageProxy HTTP error: "+S(A,(function(e){return t===e.code})).fold(u("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return y.reject(e)},M=function(t){return S(N,(function(e){return e.type===t})).fold(u("Unknown service error"),(function(t){return t.message}))},z=function(t){return function(t){return new y((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=function(t){return"ImageProxy Service error: "+function(t){try{return d.some(JSON.parse(t))}catch(t){return d.none()}}(t).bind((function(t){return(e=t,n=["error","type"],r=function(t,e){return m(t)?t[e]:void 0},o=e,function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(n,(function(t){o=r(o,t)})),i=o,d.from(i)).map(M);var e,n,r,o,i})).getOr("Invalid JSON in service error message")}(t);return y.reject(e)}))},D=function(t){return t<200||t>=300},B=function(t,e,n){return void 0===n&&(n=!1),e?function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return E(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return D(t.status)?function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e=t.status,n=t.blob)?z(n):R(e):y.resolve(t.blob);var e,n}))}(t,e):function(t,e){return E(t,{},e).then((function(t){return D(t.status)?R(t.status):y.resolve(t.blob)}))}(t,n)},P=function(t){return O(t)},I=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},L=I,H=("undefined"!=typeof window?window:Function("return this;")(),function(t,e){return function(t,n){return S(t.dom.childNodes,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(L(t),e)})).map(L)}(t)}),F=tinymce.util.Tools.resolve("tinymce.util.Delay"),V=tinymce.util.Tools.resolve("tinymce.util.Promise"),j=tinymce.util.Tools.resolve("tinymce.util.URI"),U=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},W=function(t){return t.getParam("imagetools_proxy")};function q(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)}function $(t){return{w:t.naturalWidth,h:t.naturalHeight}}var G=0,X=function(t){return H(L(t),"img")},K=function(t,e){return t.dom.is(e,"figure")},Y=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},J=function(t,e){var n=function(e){return Y(t,e)&&(et(t,e)||nt(t,e)||m(W(t)))};return K(t,e)?X(e).bind((function(t){return n(t.dom)?d.some(t.dom):d.none()})):n(e)?d.some(e):d.none()},Q=function(t,e){t.notificationManager.open({text:e,type:"error"})},Z=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&K(t,n)?X(n):Y(t,e)?d.some(L(e)):d.none()},tt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return m(r)?t.dom.encode(r[n]):null},et=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new j(n).host===t.documentBaseURI.host},nt=function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new j(e.src).host)},rt=function(t,e){if(nt(t,e))return B(e.src,null,function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new j(e.src).host)}(t,e));if(!et(t,e)){var n=W(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return B(r,o,!1)}return function(t){var e,n=t.src;return 0===n.indexOf("data:")?x(n):(e=n,new y((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(){200===this.status&&t(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()})))}(e)},ot=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?V.resolve(n.blob()):function(t,e){return function(t){return d.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return rt(t,e)}),(function(t){return t(e)}))}(t,e)},it=function(t){F.clearTimeout(t.get())},ut=function(t,e,n,r,o,i,u){return n.toBlob().then((function(a){var c,s,l,f,d=t.editorUpload.blobCache;c=i.src;var g=e.type===a.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(f=d.getByUri(c),m(f)?(c=f.uri(),s=f.name(),l=f.filename()):(s=tt(t,c,2),l=tt(t,c,1))),f=d.create({id:"imagetools"+G++,blob:a,base64:n.toBase64(),uri:c,name:s,filename:g?l:void 0}),d.add(f),t.undoManager.transact((function(){t.$(i).on("load",(function e(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(it(o),function(t,e){var n=F.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))})),u&&t.$(i).attr({width:u.w,height:u.h}),t.$(i).attr({src:f.blobUri()}).removeAttr("data-mce-src")})),f}))},at=function(t,e,n,r){return function(){return Z(t).fold((function(){Q(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return ot(t,o.dom)})).then((function(i){return P(i).then(n).then((function(n){return ut(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){Q(t,e)}))}))}},ct=function(t,e,n){return function(){var r=Z(t).fold((function(){return null}),(function(t){var e=q(t.dom);return e?{w:e.h,h:e.w}:null}));return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||b(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}),r)()}},st=function(t,e,n){return function(){return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}))()}},lt=function(t,e){return function(){var n=Z(t),r=n.map((function(t){return $(t.dom)}));n.each((function(o){J(t,o.dom).each((function(i){ot(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){!function(t,e,n,r,o){(function(t){return w(t)})(o).then((function(t){var e=$(t);return r.w===e.w&&r.h===e.h||q(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(P).then((function(r){return ut(t,o,r,!0,e,n)})).catch((function(){}))}(t,e,n.dom,r,i)}))})),o.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};o.add("imagetools",(function(t){var e=r(0),n=r(null);!function(t,e){i.each({mceImageRotateLeft:ct(t,e,-90),mceImageRotateRight:ct(t,e,90),mceImageFlipVertical:st(t,e,"v"),mceImageFlipHorizontal:st(t,e,"h"),mceEditImage:lt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:e("mceImageRotateLeft")}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:e("mceImageRotateRight")}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:e("mceImageFlipVertical")}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:e("mceImageFlipHorizontal")}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:e("mceEditImage"),onSetup:function(e){var n=function(){var n=Z(t).forall((function(e){return J(t,e.dom).isNone()}));e.setDisabled(n)};return t.on("NodeChange",n),function(){t.off("NodeChange",n)}}}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:e("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(n){return J(t,n).fold((function(){return[]}),(function(t){return[{text:"Edit image",icon:"edit-image",onAction:e("mceEditImage")}]}))}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:U(t),predicate:function(e){return J(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=J(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(it(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},2682:(t,e,n)=>{n(7384)},7384:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(null,function(t){return null===t}),l=u("boolean"),f=u("function"),d=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},m=function(t){return t.getParam("default_link_target")},g=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},p=function(t){return t.getParam("link_title",!0,"boolean")},v=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},b=function(t){return t.getParam("link_default_protocol","http","string")},y=function(){},w=function(t){return function(){return t}},x=w(!1),C=w(!0),S=function(){return k},k=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:x,isSome:x,isNone:C,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:w(null),getOrUndefined:w(void 0),or:n,orThunk:e,map:S,each:y,bind:S,exists:x,forall:C,filter:S,equals:t,equals_:t,toArray:function(){return[]},toString:w("none()")}),O=function(t){var e=w(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:C,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return O(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:k},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(x,(function(e){return n(t,e)}))}};return o},T={some:O,none:S,from:function(t){return null==t?k:O(t)}},_=Array.prototype.indexOf,E=Array.prototype.push,A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},N=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return T.none()},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},M=function(t,e){return t?T.some(e):T.none()},z=tinymce.util.Tools.resolve("tinymce.util.Tools"),D=function(t){return a(t.value)?t.value:""},B=function(t,e){var n=[];return z.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=B(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},P=function(t){return void 0===t&&(t=D),function(e){return T.from(e).map((function(e){return B(e,t)}))}},I=function(t){return P(D)(t)},L=P,H=function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},F=D,V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=Object.keys,U=Object.hasOwnProperty,W=function(t,e){return U.call(t,e)},q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t){return t&&"a"===t.nodeName.toLowerCase()},G=function(t){return $(t)&&!!Y(t)},X=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new q(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},K=function(t){return/^\w+:/i.test(t)},Y=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},J=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===z.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return z.trim(t.sort().join(" "))}(i):""},Q=function(t,e){return e=e||t.selection.getNode(),nt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},Z=function(t,e){return(e?e.innerText||e.textContent:t.getContent({format:"text"})).replace(/\uFEFF/g,"")},tt=function(t){return z.grep(t,G).length>0},et=function(t){var e=t.schema.getTextInlineElements();return 0===X(t.selection.getRng(),(function(t){return 1===t.nodeType&&!$(t)&&!W(e,t.nodeName.toLowerCase())})).length},nt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},rt=function(t,e,n){var r=t.selection.getNode(),o=Q(t,r),i=function(t,e){var n=V({},e);if(!(h(t).length>0)&&!1===v(t)){var r=J(n.rel,"_blank"===n.target);n.rel=r||null}return T.from(n.target).isNone()&&!1===g(t)&&(n.target=m(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||K(t)?t:e+"://"+t}(n.href,d(t)),n}(t,function(t){return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(e,(function(t){r=n(r,t)})),r;var e,n,r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){nt(e)?ct(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},ot=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return function(t,e,n,r){(function(t,e){for(var n=j(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}})(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,(function(t,e){return!1===s(t)}),(n=r,function(t,e){n[e]=t}),y),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()})},it=function(t,e,n){t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ot(n)):rt(t,e,n)},ut=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();nt(e)?at(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},at=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},ct=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},st=function(t,e){return N(e,(function(e){return function(t){return W(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n}(e)?st(t,e.items):M(e.value===t,e)}))},lt=function(t,e){var n={text:t.text,title:t.title},r=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:T.none()).getOr([]);return function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?st(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:y}},text:i?t:e.text}})):T.none()}(n.text,r.name,u,t)};return{onChange:function(t,e){var o,i,u,a,c=e.name;return"url"===c?(o=t(),i=o.url,u=M(n.text.length<=0,T.from(i.meta.text).getOr(i.value)),a=function(t){return M(n.title.length<=0,T.from(t.meta.title).getOr(""))}(o.url),u.isSome()||a.isSome()?T.some(V(V({},u.map((function(t){return{text:t}})).getOr({})),a.map((function(t){return{title:t}})).getOr({}))):T.none()):function(t,e){return _.call(t,e)}(["anchor","link"],c)>-1?r(t(),e):"text"===c||"title"===c?(n[c]=t()[c],T.none()):T.none()}}},ft=tinymce.util.Tools.resolve("tinymce.util.Delay"),dt=tinymce.util.Tools.resolve("tinymce.util.Promise"),mt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?T.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return V(V({},t),{href:"mailto:"+e})}}):T.none()},gt=function(t,e){return function(n){var r=n.href;return 1===t&&!K(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?T.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return V(V({},t),{href:e+"://"+r})}}):T.none()}},ht=function(t){var e=t.dom.select("a:not([href])"),n=A(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]})));return n.length>0?T.some([{text:"None",value:""}].concat(n)):T.none()},pt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?I(e):T.none()},vt=tinymce.util.Tools.resolve("tinymce.util.XHR"),bt=function(t,e){var n=h(t);if(n.length>0){var r=e.is("_blank");return(!1===v(t)?L((function(t){return J(F(t),r)})):I)(n)}return T.none()},yt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],wt=function(t){var e=g(t);return c(e)?I(e).orThunk((function(){return T.some(yt)})):!1===e?T.none():T.some(yt)},xt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?T.some(r):T.none()},Ct=function(t,e){return function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new dt((function(t){a(n)?vt.send({url:n,success:function(e){return t(function(t){try{return T.some(JSON.parse(t))}catch(t){return T.none()}}(e))},error:function(e){return t(T.none())}}):f(n)?n((function(e){return t(T.some(e))})):t(T.from(n))})).then((function(t){return t.bind(L(e)).map((function(t){return t.length>0?[{text:"None",value:""}].concat(t):t}))}))}(t).then((function(n){var r=function(t,e){var n=t.dom,r=et(t)?T.some(Z(t.selection,e)):T.none(),o=e?T.some(n.getAttrib(e,"href")):T.none(),i=e?T.from(n.getAttrib(e,"target")):T.none(),u=xt(n,e,"rel"),a=xt(n,e,"class");return{url:o,text:r,title:xt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:wt(t),rels:bt(t,r.target),classes:pt(t),anchor:ht(t),link:n},optNode:T.from(e),flags:{titleEnabled:p(t)}}}))},St=function(t){(function(t){var e=Q(t);return Ct(t,e)})(t).then((function(e){var n=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ut(t),void n.close();var o=function(t){return T.from(r[t]).filter((function(n){return!e.anchor[t].is(n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};(function(t,e){return N([mt,gt(d(t),b(t))],(function(t){return t(e)})).fold((function(){return dt.resolve(e)}),(function(n){return new dt((function(r){!function(t,e,n){var r=t.selection.getRng();ft.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))})(t,i).then((function(e){it(t,u,e)})),n.close()}}(t,e);return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,T.from(m(n))),u=t.catalogs,a=lt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:A([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([u.anchor.map(H("anchor","Anchors")),u.rels.map(H("rel","Rel")),u.targets.map(H("target","Open link in...")),u.link.map(H("link","Link list")),u.classes.map(H("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,n,t)})).then((function(e){t.windowManager.open(e)}))},kt=function(t,e){return t.dom.getParent(e,"a[href]")},Ot=function(t){return kt(t,t.selection.getStart())},Tt=function(t,e){if(e){var n=Y(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else!function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)}(e.href)}},_t=function(t){return function(){St(t)}},Et=function(t){return function(){Tt(t,Ot(t))}},At=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Nt=function(t){return function(e){return At(t,(function(){e.setActive(!t.mode.isReadOnly()&&null!==Q(t,t.selection.getNode()))}))}},Rt=function(t){return function(e){var n=function(){return e.setDisabled(null===Q(t,t.selection.getNode()))};return n(),At(t,n)}},Mt=function(t){return function(e){var n=function(e){return tt(e)||(n=t.selection.getRng(),X(n,G).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),At(t,(function(t){return e.setDisabled(!n(t.parents))}))}};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:_t(t),onSetup:Nt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:_t(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return tt(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!Q(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Nt(t)},label:"Link",predicate:function(e){return!!Q(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=Q(t);return e?Y(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!Q(t,n)),Nt(t)(e)},onAction:function(e){var n=Q(t),r=e.getValue();if(n)t.undoManager.transact((function(){t.dom.setAttrib(n,"href",r),function(t){t.selection.collapse(!1)}(t),e.hide()}));else{var o={href:r,attach:function(){}},i=et(t)?T.some(Z(t.selection,n)).filter((function(t){return t.length>0})).or(T.from(r)):T.none();it(t,o,{href:r,text:i,title:T.none(),rel:T.none(),target:T.none(),class:T.none()}),e.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ut(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Et(t)(),e.hide()}}]})}(t),function(t){t.on("click",(function(e){var n=kt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Tt(t,n))})),t.on("keydown",(function(e){var n=Ot(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Tt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?_t(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},1236:(t,e,n)=>{n(7585)},7585:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){},i=function(t){return function(){return t}},u=function(t){return function(e){return!t(e)}},a=i(!1),c=i(!0),s=function(){return l},l=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:s,each:o,bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}}(),f=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},g=function(t){return function(e){return typeof e===t}},h=m("string"),p=m("array"),v=g("boolean"),b=g("function"),y=g("number"),w=Array.prototype.slice,x=Array.prototype.push,C=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},k=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},O=function(t,e,n){return S(t,(function(t){n=e(n,t)})),n},T=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()},_=function(t,e){return T(t,e,a)},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!p(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e}(C(t,e))},A=function(t){var e=w.call(t,0);return e.reverse(),e},N=function(t,e){return e>=0&&e<t.length?d.some(t[e]):d.none()},R=function(t){return N(t,0)},M=function(t){return N(t,t.length-1)},z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(){return B(0,0)},B=function(t,e){return{major:t,minor:e}},P=function(t,e){var n=String(e).toLowerCase();return 0===t.length?D():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return B(r(1),r(2))}(t,n)},I=D,L=function(t,e){var n=String(e).toLowerCase();return _(t,(function(t){return t.search(n)}))},H=function(t,e){return-1!==t.indexOf(e)},F=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,V=function(t){return function(e){return H(e,t)}},j=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return H(t,"edge/")&&H(t,"chrome")&&H(t,"safari")&&H(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,F],search:function(t){return H(t,"chrome")&&!H(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return H(t,"msie")||H(t,"trident")}},{name:"Opera",versionRegexes:[F,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:V("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:V("firefox")},{name:"Safari",versionRegexes:[F,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(H(t,"safari")||H(t,"mobile/"))&&H(t,"applewebkit")}}],U=[{name:"Windows",search:V("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return H(t,"iphone")||H(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:V("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:V("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:V("linux"),versionRegexes:[]},{name:"Solaris",search:V("sunos"),versionRegexes:[]},{name:"FreeBSD",search:V("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:V("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],W={browsers:i(j),oses:i(U)},q="Edge",$="Chrome",G="Opera",X="Firefox",K="Safari",Y=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(q),isChrome:r($),isIE:r("IE"),isOpera:r(G),isFirefox:r(X),isSafari:r(K)}},J=function(){return Y({current:void 0,version:I()})},Q=Y,Z=(i(q),i($),i("IE"),i(G),i(X),i(K),"Windows"),tt="Android",et="Linux",nt="Solaris",rt="FreeBSD",ot="ChromeOS",it=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Z),isiOS:r("iOS"),isAndroid:r(tt),isOSX:r("OSX"),isLinux:r(et),isSolaris:r(nt),isFreeBSD:r(rt),isChromeOS:r(ot)}},ut=function(){return it({current:void 0,version:I()})},at=it,ct=(i(Z),i("iOS"),i(tt),i(et),i("OSX"),i(nt),i(rt),i(ot),function(t,e){var n=W.browsers(),r=W.oses(),o=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(J,Q),u=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ut,at),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}}(u,o,t,e);return{browser:o,os:u,deviceType:a}}),st=function(t){return window.matchMedia(t).matches},lt=(t=function(){return ct(navigator.userAgent,st)},n=!1,function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}),ft=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},dt=function(t,e){var n=(e||document).createElement(t);return ft(n)},mt=ft,gt=function(t,e){return t.dom===e.dom},ht=function(t,e){return lt().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},pt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},vt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),yt=tinymce.util.Tools.resolve("tinymce.util.VK"),wt=Object.keys,xt=function(t,e){for(var n=wt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ct=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),St=(1,function(t){return 1===function(t){return t.dom.nodeType}(t)}),kt=function(t,e){var n=t.dom;xt(e,(function(t,e){!function(t,e,n){if(!(h(n)||v(n)||y(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Ot=function(t){return O(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Tt=function(t){return d.from(t.dom.parentNode).map(mt)},_t=function(t){return C(t.dom.childNodes,mt)},Et=function(t,e){var n=t.dom.childNodes;return d.from(n[e]).map(mt)},At=function(t){return Et(t,0)},Nt=function(t){return Et(t,t.dom.childNodes.length-1)},Rt=function(t,e){Tt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Mt=function(t,e){t.dom.appendChild(e.dom)},zt=function(t,e){S(e,(function(e){Mt(t,e)}))},Dt=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Bt=function(t){return function(t,e){return mt(t.dom.cloneNode(!0))}(t)},Pt=function(t,e){var n=function(t,e){var n=dt(e),r=Ot(t);return kt(n,r),n}(t,e);Rt(t,n);var r=_t(t);return zt(n,r),Dt(t),n},It=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ht=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ft=function(t){return function(e){return e&&t.test(e.nodeName)}},Vt=function(t){return t&&3===t.nodeType},jt=Ft(/^(OL|UL|DL)$/),Ut=Ft(/^(OL|UL)$/),Wt=Ht("ol"),qt=Ft(/^(LI|DT|DD)$/),$t=Ft(/^(DT|DD)$/),Gt=Ft(/^(TH|TD)$/),Xt=Ht("br"),Kt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Yt=function(t,e){return t&&t.nodeName in e},Jt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Qt=function(t,e){return t.isChildOf(e,t.getRoot())},Zt=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Yt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Yt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},te=It.DOM,ee=function(t){pt(t,"dt")&&Pt(t,"dd")},ne=function(t,e){if(Vt(t))return{container:t,offset:e};var n=vt.getNode(t,e);return Vt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Vt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Vt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},re=function(t){var e=t.cloneRange(),n=ne(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=ne(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},oe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ie=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ae(t,n))},ue=function(t){var e=t.selection.getSelectedBlocks();return Lt.grep(function(t,e){var n=Lt.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",ae(t,e))||e}));return oe.unique(n)}(t,e),(function(t){return qt(t)}))},ae=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ce=function(t,e){var n=t.dom.getParents(e,"ol,ul",ae(t,e));return M(n)},se=function(t,e){var n=C(e,(function(e){return ce(t,e).getOr(e)}));return oe.unique(n)},le=function(t,e,n){return t.isSome()&&e.isSome()?d.some(n(t.getOrDie(),e.getOrDie())):d.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!h(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&b(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){Mt(t.item,e.list)},ge=function(t,e){var n={list:dt(e,t),item:dt("li",t)};return Mt(n.list,n.item),n},he=function(t){return pt(t,"OL,UL")},pe=function(t){return At(t).map(he).getOr(!1)},ve=function(t){return t.depth>0},be=function(t){return t.isSelected},ye=function(t){var e=_t(t),n=Nt(t).map(he).getOr(!1)?e.slice(0,-1):e;return C(n,Bt)},we=function(t){return S(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return T(A(t.slice(0,e)),r,o).orThunk((function(){return T(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=function(t,e){var n={};return function(t,e,n,r){xt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),o),n}(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=z({},r.listAttributes));var n,r}))})),t},xe=function(t,e,n,r){return At(r).filter(he).fold((function(){e.each((function(t){gt(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return Tt(t).filter(St).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:ye(t),itemAttributes:Ot(t),listAttributes:Ot(r),listType:Ct(r)}}))}(r,t,n.get());e.each((function(t){gt(t.end,r)&&n.set(!1)}));var i=Nt(r).filter(he).map((function(r){return Ce(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Ce(t,e,n,r)}))},Ce=function(t,e,n,r){return E(_t(r),(function(r){return(he(r)?Ce:xe)(t+1,e,n,r)}))},Se=function(t,e){var n=we(e);return function(t,e){var n=O(e,(function(e,n){return n.depth>e.length?function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item.dom,de(r,"list-style-type","none");var r;M(t).each((function(t){kt(t.list,e.listAttributes),kt(t.item,e.itemAttributes),zt(t.item,e.content)}))}(o,n),r=o,le(M(e),R(r),me),e.concat(o)}(t,e,n):function(t,e,n){var r=e.slice(0,n.depth);return M(r).each((function(e){!function(t,e){Mt(t.list,e),t.item=e}(e,function(t,e,n){var r=dt("li",t);return kt(r,e),zt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){Ct(t.list)!==e.listType&&(t.list=Pt(t.list,e.listType)),kt(t.list,e.listAttributes)}(e,n)})),r}(t,e,n)}),[]);return R(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},ke=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return C(t,(function(t){return{sourceList:t,entries:Ce(0,e,r,t)}}))}(e,function(t){var e=C(ue(t),mt);return le(_(e,u(pe)),_(A(e),u(pe)),(function(t,e){return{start:t,end:e}}))}(t));S(r,(function(e){!function(t,e){S(k(t,be),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return E(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ve),(function(e){return R(e).map(ve).getOr(!1)?Se(t,e):function(t,e){var n=we(e);return C(n,(function(e){var n,r,o=(n=e.content,r=document.createDocumentFragment(),S(n,(function(t){r.appendChild(t.dom)})),mt(r));return mt(Zt(t,o.dom))}))}(t,e)}))}(t,e.entries);S(o,(function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,S(o,(function(t){Rt(r,t)})),Dt(e.sourceList)}))},Oe=function(t,e){var n=C(function(t){var e=function(t){var e=ce(t,t.selection.getStart()),n=k(t.selection.getSelectedBlocks(),Ut);return e.toArray().concat(n)}(t);return se(t,e)}(t),mt),r=C(function(t){return k(ue(t),$t)}(t),mt),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();ke(t,n,e),function(t,e,n){S(n,"Indent"===e?ee:function(e){return function(t,e){pt(e,"dd")?Pt(e,"dt"):pt(e,"dt")&&Tt(e).each((function(n){return function(t,e,n){var r=te.select('span[data-mce-type="bookmark"]',e),o=Zt(t,n),i=te.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){te.remove(c);break}t.dom.isEmpty(a)||te.insertAfter(a,e),te.insertAfter(o,e),Jt(t.dom,n.parentNode)&&(u=n.parentNode,Lt.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),te.remove(u)),te.remove(n),Jt(t.dom,e)&&te.remove(e)}(t,n.dom,e.dom)}))}(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(re(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Te=function(t){return Oe(t,"Indent")},_e=function(t){return Oe(t,"Outdent")},Ee=function(t){return Oe(t,"Flatten")},Ae=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Ne=It.DOM,Re=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=Ne.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):Ne.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},Me=function(t){function e(e){var n,r,o;n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(n),n=n.parentNode,Ne.remove(o),!n.hasChildNodes()&&Ne.isBlock(n)&&n.appendChild(Ne.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Ne.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),re(n)},ze=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},De=function(t){return/\btox\-/.test(t.className)},Be=function(t,e,n){var r=function(t){var r=T(t.parents,jt,Gt).filter((function(t){return t.nodeName===e&&!De(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Pe=function(t,e){Lt.each(e,(function(e,n){t.setAttribute(n,e)}))},Ie=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Pe(e,n["list-attributes"]),Lt.each(t.select("li",e),(function(t){Pe(t,n["list-item-attributes"])}))}(t,e,n)},Le=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Xt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Kt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},He=function(t,e,n){return function(t,e){return t&&e&&jt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Fe=function(t,e){var n,r;if(n=e.nextSibling,He(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,He(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},Ve=function(t){return"list-style-type"in t},je=function(t,e,n){var r=ie(t),o=function(t){var e=ie(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return Lt.grep(t.querySelectorAll("ol,ul,dl"),(function(t){return jt(t)}))}(e):Lt.grep(n,(function(t){return jt(t)&&e!==t}))}(t);n=n||{},r&&o.length>0?function(t,e,n,r,o){if(e.nodeName!==r||Ve(o)){var i=Re(t.selection.getRng(!0));Lt.each([e].concat(n),(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Ie(t.dom,o,r),fe(t,ze(n),o)}else Ie(t.dom,e,r),fe(t,ze(n),e)}(t,e,r,o)})),t.selection.setRng(Me(i))}else Ee(t)}(t,r,o,e,n):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Ve(r)||De(e)){var o=Re(t.selection.getRng(!0));Ie(t.dom,e,r);var i=t.dom.rename(e,n);Fe(t.dom,i),t.selection.setRng(Me(o)),fe(t,ze(n),i)}else Ee(t);else(function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=ae(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=Re(r);Lt.each(function(t,e,n){for(var r,o=[],i=t.dom,u=Le(t,e,!0,n),a=Le(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Lt.each(c,(function(e){if(Kt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Xt(e))return Xt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Ae.isBookmarkNode(e)&&(Kt(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i),(function(r){var i,a=r.previousSibling;a&&jt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Lt.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r),Ie(u,i,n),Fe(t.dom,i)})),t.selection.setRng(Me(a))}})(t,n,r),fe(t,ze(n),e)}(t,r,e,n)},Ue=It.DOM,We=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Vt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=vt.getNode(o,i));var a=new bt(o,r);for(n&&function(t,e){return!!Xt(e)&&t.isBlock(e.nextSibling)&&!Xt(e.previousSibling)}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Vt(o)&&o.data.length>0)return o}},qe=function(t,e){var n=e.childNodes;return 1===n.length&&!jt(n[0])&&t.isBlock(n[0])},$e=function(t,e,n){var r,o=e.parentNode;if(Qt(t,e)&&Qt(t,n)){jt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Xt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Xt(i)&&e.hasChildNodes()&&t.remove(i),Jt(t,n,!0)&&t.$(n).empty(),function(t,e,n){var r,o=qe(t,n)?n.firstChild:n;if(function(t,e){qe(t,e)&&t.remove(e.firstChild,!0)}(t,e),!Jt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)}(t,e,n),r&&n.appendChild(r);var u=ht(mt(n),mt(e))?t.getParents(e,jt,n):[];t.remove(e),S(u,(function(e){Jt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Ge=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ae(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&Jt(n,a))return!0;var c=re(r.getRng()),s=n.getParent(We(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),$e(t.dom,e,n),t.selection.setCursorLocation(n)}(t,n,r);else{var i=Re(e);$e(o,n,r),t.selection.setRng(Me(i))}}(t,c,s,u):(n=u).parentNode.firstChild===n?_e(t):function(t,e,n,r){var o=Re(e);$e(t.dom,n,r);var i=Me(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Ee(t)})),!0}return!1},Xe=function(t,e){return t.selection.isCollapsed()?function(t,e){return Ge(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ae(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=re(t.selection.getRng()),a=n.getParent(We(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Fe(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)}(t,e):function(t){var e=t.selection.getStart(),n=ae(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||ue(t).length>0)&&(t.undoManager.transact((function(){var e,n;t.execCommand("Delete"),e=t.dom,n=t.getBody(),Lt.each(Lt.grep(e.select("ol,ul",n)),(function(t){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),Jt(t,r)&&Ue.remove(r)):Ue.setStyle(r,"listStyleType","none")),jt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(e,t)}))})),!0)}(t)},Ke=function(t){var e=t.dom,n=ie(t);Wt(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact((function(){e.setAttrib(ie(t),"start","1"===r.start?"":r.start)})),n.close()}})},Ye=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}};r.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)&&(function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==yt.TAB||yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?_e(t):Te(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===yt.BACKSPACE?Xe(t,!1)&&e.preventDefault():e.keyCode===yt.DELETE&&Xe(t,!0)&&e.preventDefault()}))}(t)}(t),function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Te(t):"outdent"===n&&_e(t)})),t.addCommand("InsertUnorderedList",(function(e,n){je(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){je(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){je(t,"DL",n)})),t.addCommand("RemoveList",(function(){Ee(t)})),t.addCommand("mceListProps",(function(){Ke(t)})),t.addQueryStateHandler("InsertUnorderedList",Ye(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Ye(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Ye(t,"DL"))}(t)),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Be(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Be(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return Ke(t)},onSetup:function(e){return Be(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ie(t,e);return Wt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){Xe(t,e)}}}(t)}))}()},2540:(t,e,n)=>{n(3167)},3167:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},m=d("string"),g=d("object"),h=d("array"),p=Array.prototype.push,v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!h(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);p.apply(e,t[n])}return e},y=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},w=Object.keys,x=Object.hasOwnProperty,C=function(t,e){return S(t,e)?f.from(t[e]):f.none()},S=function(t,e){return x.call(t,e)},k=function(t){return t.getParam("media_scripts")},O=function(t){return t.getParam("media_live_embeds",!0)},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},N=_.DOM,R=function(t){return t.replace(/px$/,"")},M=function(t,e){var n=y(!1),r={};return E({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(S(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?N.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:C(n,"max-width").map(R).getOr(""),height:C(n,"max-height").map(R).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=T.extend(o.map,r)),"script"===e){var i=A(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=function(t){return{mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()]||""},D=tinymce.util.Tools.resolve("tinymce.html.Schema"),B=tinymce.util.Tools.resolve("tinymce.html.Writer"),P=_.DOM,I=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},L=function(t,e){!function(t,e){for(var n=w(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},H=["source","altsource"],F=function(t,e,n){var r,o=B(),i=y(!1),u=0;return E({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(S(a.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?P.parseStyle(n):{};r["max-width"]=I(t.width),r["max-height"]=I(t.height),L(e,{style:P.serializeStyle(r)})}(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&L(a,{width:e.width,height:e.height})}if(n)switch(t){case"video":L(a,{poster:e.poster,src:""}),e.altsource&&L(a,{src:""});break;case"iframe":L(a,{src:e.source});break;case"source":if(u<2&&(L(a,{src:e[H[u]],type:e[H[u]+"mime"]}),!e[H[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[H[a]]){var c=[];c.map={},u<=a&&(L(c,{src:e[H[a]],type:e[H[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},L(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},D({})).parse(t),o.getContent()},V=[{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&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}],j=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},U=function(t,e){var n=T.extend({},e);if(!n.source&&(T.extend(n,M(k(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=z(n.source),n.altsourcemime=z(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=V.filter((function(t){return t.regex.test(r)}))).length>0?T.extend({},o[0],{url:j(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowFullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return F(n.embed,n,!0);var u=A(k(t),n.source);u&&(n.type="script",n.width=String(u.width),n.height=String(u.height));var a=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",T.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,a):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},W=tinymce.util.Tools.resolve("tinymce.util.Promise"),q={},$=function(t){return function(e){return U(t,e)}},G=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new W((function(r,o){var i=function(n){return n.html&&(q[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};q[t.source]?i(q[t.source]):n({url:t.source},i,o)}))}(e,$(t),n):function(t,e){return new W((function(n){n({html:e(t),url:t.source})}))}(e,$(t))},X=function(t,e){return C(e,t).bind((function(t){return C(t,"meta")}))},K=function(t,e,n){return function(r){var o,i=function(){return C(t,r)},u=function(){return C(e,r)},a=function(t){return C(t,"value").bind((function(t){return t.length>0?f.some(t):f.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return g(t)?a(t).orThunk(u):u().orThunk((function(){return f.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return g(t)?a(t):f.from(t)}))}))).getOr(""),o}},Y=function(t,e){var n={};return C(t,"dimensions").each((function(t){v(["width","height"],(function(r){C(e,r).orThunk((function(){return C(t,r)})).each((function(t){return n[r]=t}))}))})),n},J=function(t,e){var n=e?X(e,t).getOr({}):{},r=K(t,n,e);return o(o(o(o(o({},r("source")),r("altsource")),r("poster")),r("embed")),Y(t,n))},Q=function(t){var e=o(o({},t),{source:{value:C(t,"source").getOr("")},altsource:{value:C(t,"altsource").getOr("")},poster:{value:C(t,"poster").getOr("")}});return v(["width","height"],(function(n){C(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Z=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},tt=function(t,e){return M(k(t),e)},et=function(t,e){return function(n){if(m(n.url)&&n.url.trim().length>0){var r=n.html,i=tt(e,r),u=o(o({},i),{source:n.url,embed:r});t.setData(Q(u))}}},nt=function(t,e){var n=t.dom.select("img[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("img[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},rt=function(t){var e=function(t){var e=t.selection.getNode(),n=function(t){return t.getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")}(e)?t.serializer.serialize(e,{selection:!0}):"";return o({embed:n},M(k(t),n))}(t),n=y(e),r=Q(e),i=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],u={title:"General",name:"general",items:b([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},a=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&a.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&a.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var c={title:"Advanced",name:"advanced",items:a},s=[u,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];a.length>0&&s.push(c);var l={type:"tabpanel",tabs:s},f=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=J(e.getData());(function(t,e,n){var r;e.embed=F(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,q.hasOwnProperty(r)))?nt(n,e.embed):G(n,e).then((function(t){nt(n,t.html)})).catch(Z(n))})(n.get(),r,t),e.close()},onChange:function(e,r){switch(r.name){case"source":!function(e,n){var r=J(n.getData(),"source");e.source!==r.source&&(et(f,t)({url:r.source,html:""}),G(t,r).then(et(f,t)).catch(Z(t)))}(n.get(),e);break;case"embed":!function(e){var n=J(e.getData()),r=tt(t,n.embed);e.setData(Q(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var r=J(e.getData(),n),i=U(t,r);e.setData(Q(o(o({},r),{embed:i})))}(e,r.name)}n.set(J(e.getData()))},initialData:r})},ot=tinymce.util.Tools.resolve("tinymce.html.Node"),it=tinymce.util.Tools.resolve("tinymce.Env"),ut=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=B();return E({validate:!1,allow_conditional_comments:!1,comment:function(t){r.comment(t)},cdata:function(t){r.cdata(t)},text:function(t,e){r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},D({})).parse(e),r.getContent()},at=function(t,e){var n=e.name,r=new ot("img",1);return r.shortEnded=!0,st(t,e,r),r.attr({width:e.attr("width")||"300",height:e.attr("height")||("audio"===n?"30":"150"),style:e.attr("style"),src:it.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},ct=function(t,e){var n=e.name,r=new ot("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),st(t,e,r);var o=new ot(n,1);o.attr({src:e.attr("src"),allowfullscreen:e.attr("allowfullscreen"),style:e.attr("style"),class:e.attr("class"),width:e.attr("width"),height:e.attr("height"),frameborder:"0"});var i=new ot("span",1);return i.attr("class","mce-shim"),r.append(o),r.append(i),r},st=function(t,e,n){var r,o,i,u=e.attributes;for(i=u.length;i--;)r=u[i].name,o=u[i].value,"width"!==r&&"height"!==r&&"style"!==r&&("data"!==r&&"src"!==r||(o=t.convertURL(o,r)),n.attr("data-mce-p-"+r,o));var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(ut(t,a))),n.firstChild=null)},lt=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},ft=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||lt(t))return!0;return!1},dt=function(t,e){return function(n){return t.selection.selectorChangedWithUnbind(e.join(","),n.setActive).unbind}};r.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){rt(t)}))}(t),function(t){t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){t.execCommand("mceMedia")},onSetup:dt(t,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){t.execCommand("mceMedia")}})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();T.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();T.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=A(k(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),"iframe"===n.name&&O(t)&&it.ceFalse?ft(n)||n.replace(ct(t,n)):ft(n)||n.replace(at(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,u,a,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new ot(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(u=r.attributes).length;i--;){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new ot("#text",3)).raw=!0,c.value=ut(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))}(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){var e=t.target.getAttribute("data-mce-object");"audio"!==e&&"script"!==e||t.preventDefault()})),t.on("ObjectResized",(function(t){var e,n=t.target;n.getAttribute("data-mce-object")&&(e=n.getAttribute("data-mce-html"))&&(e=unescape(e),n.setAttribute("data-mce-html",escape(F(e,{width:String(t.width),height:String(t.height)}))))}))}(t),function(t){return{showDialog:function(){rt(t)}}}(t)}))}()},8208:(t,e,n)=>{n(8931)},8931:(t,e,n)=>{const{EventDispatcher:r}=n(7575);!function(){"use strict";tinymce.PluginManager.add("mychecklist",(function(t,e){function n(){t.undoManager.transact((function(){t.insertContent('<ul class="tox-checklist"><li></li></ul>')}))}t.addCommand("InsertCheckList",(function(t,e){n()})),t.ui.registry.addButton("mychecklist",{icon:"checklist",tooltip:"Insert check list",onAction:n});let r=null;t.on("mousedown",(function(e){r=t.selection.getRng();var n=e.target,o=n.parentElement;e.offsetX>0||"tox-checklist"!==o.className||t.undoManager.transact((function(){e.preventDefault(),"tox-checklist"===o.className&&(n.scrollIntoView(!1),"LI"===n.nodeName&&"tox-checklist--checked"===n.className?n.className="":"LI"===n.nodeName&&""===n.className&&(n.className="tox-checklist--checked"))}))}),{capture:!0,passive:!1}),t.on("touchstart",(function(e){r=t.selection.getRng();var n=e.target,o=n.parentElement;e.targetTouches.length>0||e.targetTouches[0].clientX>45||"tox-checklist"!==o.className||t.undoManager.transact((function(){e.preventDefault(),"tox-checklist"===o.className&&(n.scrollIntoView(!1),"LI"===n.nodeName&&"tox-checklist--checked"===n.className?n.className="":"LI"===n.nodeName&&""===n.className&&(n.className="tox-checklist--checked"))}))}),{capture:!0,passive:!1}),t.on("NodeChange",(function(t){var e=t.target,n=e?.parentElement;n&&"tox-checklist"===n.className&&"LI"===e.nodeName&&"tox-checklist--checked"===e.className&&(e.className="")})),t.on("NewBlock",(function(t){"LI"===t.newBlock.nodeName&&"tox-checklist--checked"===t.newBlock.className&&(t.newBlock.className="")}))}))}()},1933:(t,e,n)=>{n(4129)},4129:(t,e,n)=>{"use strict";n.r(e);var r,o,i,u=n(7575);r=n.n(u)().util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){if(e&&e.isActive&&e.isActive())t.execCommand("mceInsertNewLine",!1,{shiftKey:!0});else{var r=t.selection.getContent({format:"text"});r=r.replace(/^\n/gm,""),"shortcut"===n&&(r="<br>"),r.length>0?(t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,`<pre class='codeblock'>${r}</pre>`)})),t.selection.setCursorLocation(),t.nodeChanged()):function(t,e){let n=t.selection.getNode();t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,(t=>`<pre class='codeblock'>${t.innerHTML.replace(/\n/gm,"<br>")}</pre>`)(n))})),n=t.selection.getNode(),t.focus(),t.selection.setCursorLocation(n,5),t.nodeChanged()}(t)}},i=function(t){return function(e){var n=function(t){e.setActive("PRE"===t.element.tagName)},r=function(e){"<pre></pre>"===e.content&&(e.preventDefault(),t.creatingCodeBlock=!0,o(t,void 0,"shortcut"))},i=function(e){console.log(e),t.creatingCodeBlock&&"mceInsertNewLine"===e.command&&(e.preventDefault(),t.creatingCodeBlock=!1)};return t.on("BeforeExecCommand",i),t.on("BeforeSetContent",r),t.on("NodeChange",n),function(){return t.off("BeforeExecCommand",i),t.off("BeforeSetContent",r),t.off("NodeChange",n)}}},r.add("mycode",(function(t){return function(t){t.addCommand("CodeBlock",(function(e){o(t,e)}))}(t),function(t){t.ui.registry.addToggleButton("code",{icon:"sourcecode",tooltip:"Code",onAction:function(e){return o(t,e)},onSetup:i(t)})}(t),{}}))},6586:(t,e,n)=>{n(9586)},9586:()=>{!function(){"use strict";tinymce.PluginManager.add("myimage",(function(t,e){function n(){var e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.onchange=function(){var e=this.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=function(){r(n.result,600,"image/jpeg",(e=>{var r=`<img src="${e}">`;t.insertContent(r),n.onerror=null}),.7),n.onerror=function(t){n.onerror=null}}},e.dispatchEvent(new MouseEvent("click"))}t.ui.registry.addButton("myimage",{icon:"image",tooltip:"Insert image",onAction:n});var r=function(t,e,n="image/jpeg",r,o=.7){var i,u,a,c,s,l;new Promise((function(e){(i=new Image).src=t,e("Done : ")})).then((t=>{u=i.width,a=i.height,c=Math.floor(a/u*e),(s=document.createElement("canvas")).width=e,s.height=c,s.getContext("2d").drawImage(i,0,0,e,c),l=s.toDataURL(n,o),r(l)}))};t.addCommand("InsertImage",(function(t,e){n()}))}))}()},5031:(t,e,n)=>{n(7814)},7814:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return function(e){return-1!==(" "+e.attr("class")+" ").indexOf(t)}},o=function(t,e,n){return function(r){var o=arguments,i=o[o.length-2],u=i>0?e.charAt(i-1):"";if('"'===u)return r;if(">"===u){var a=e.lastIndexOf("<",i);if(-1!==a){var c=e.substring(a,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+t.dom.encode(o[0])+'">'+t.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}};t.add("noneditable",(function(t){!function(t){var i="contenteditable",u=" "+e.trim(function(t){return t.getParam("noneditable_editable_class","mceEditable")}(t))+" ",a=" "+e.trim(n(t))+" ",c=r(u),s=r(a),l=function(t){var e=t.getParam("noneditable_regexp",[]);return e&&e.constructor===RegExp?[e]:e}(t);t.on("PreInit",(function(){l.length>0&&t.on("BeforeSetContent",(function(e){!function(t,e,r){var i=e.length,u=r.content;if("raw"!==r.format){for(;i--;)u=u.replace(e[i],o(t,u,n(t)));r.content=u}}(t,l,e)})),t.parser.addAttributeFilter("class",(function(t){for(var e,n=t.length;n--;)e=t[n],c(e)?e.attr(i,"true"):s(e)&&e.attr(i,"false")})),t.serializer.addAttributeFilter(i,(function(t){for(var e,n=t.length;n--;)e=t[n],(c(e)||s(e))&&(l.length>0&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(i,null))}))}))}(t)}))}()},2875:(t,e,n)=>{n(5103)},5103:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return!function(t){return null==t}(t)},m=("function",function(t){return"function"==typeof t}),g=Array.prototype.slice,h=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},p=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=m(Array.from)?Array.from:function(t){return g.call(t)},y=function(){var t=r(f.none());return{clear:function(){return t.set(f.none())},set:function(e){return t.set(f.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},w=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},x=tinymce.util.Tools.resolve("tinymce.Env"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=tinymce.util.Tools.resolve("tinymce.util.Promise"),k=tinymce.util.Tools.resolve("tinymce.util.VK"),O=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=function(t){return t.getParam("paste_data_images",!1)},E=function(t){return t.getParam("paste_merge_formats",!0)},A=function(t){return t.getParam("paste_retain_style_properties")},N=function(t){return t.getParam("validate")},R=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},M=function(t){return t.getParam("paste_data_images",!1,"boolean")},z=function(t){return T.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},D="\x3c!-- x-tinymce/html --\x3e",B=function(t){return-1!==t.indexOf(D)},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),I=tinymce.util.Tools.resolve("tinymce.html.DomParser"),L=tinymce.util.Tools.resolve("tinymce.html.Serializer"),H=" ",F=tinymce.util.Tools.resolve("tinymce.html.Node"),V=tinymce.util.Tools.resolve("tinymce.html.Schema");function j(t,e){return T.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t}function U(t){return j(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?H:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function W(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}function q(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),T.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e}function $(t){var e,n,r=1;function o(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e}function i(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0}function u(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{u(t)}while(t=t.next)}function a(t,o,a){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new F(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,u(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)}for(var c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){a(t,"ul");continue}if(q(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),a(t,"ol",m);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}function G(t,e,n,r){var o,i={},u=t.dom.parseStyle(r);return T.each(u,(function(u,a){switch(a){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(u)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":a="text-align";break;case"vert-align":a="vertical-align";break;case"font-color":case"mso-foreground":a="color";break;case"mso-background":case"mso-highlight":a="background";break;case"font-weight":case"font-style":return void("normal"!==u&&(i[a]=u));case"mso-element":if(/^(comment|comment-list)$/i.test(u))return void n.remove()}0!==a.indexOf("mso-comment")?0!==a.indexOf("mso-")&&("all"===A(t)||e&&e[a])&&(i[a]=u):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new F("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new F("i",1))),(i=t.dom.serializeStyle(i,n.name))||null}var X,K=function(t,e){return{content:t,cancelled:e}},Y=function(t,e){return t.insertContent(e,{merge:E(t),paste:!0}),!0},J=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},Q=function(t,e){return J(e)&&h(z(t),(function(t){return w(n=e,r="."+t,n.length-r.length);var n,r}))},Z=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!J(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},tt=function(t,e,n){return!!Q(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},et=function(t){return"\n"===t||"\r"===t},nt=function(t,e,n,r){var o=function(t,e,n){var r=W(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?function(t,e){var n,r=A(t);r&&(n=T.makeMap(r.split(/[, ]/))),e=j(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,H],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(H):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=V({valid_elements:o,valid_children:"-li[p]"});T.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var u=I({},i);u.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",G(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),u.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),u.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),u.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var a=u.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&$(a),L({validate:N(t)},i).serialize(a)}(t,e):e}(t,e):e;return function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=I({},t.schema);n.addNodeFilter("meta",(function(t){T.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return L({validate:N(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return K(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):K(i,o.isDefaultPrevented())}(t,o,n,r)}(t,e,n);!1===o.cancelled&&function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?Y(t,e):function(t,e){T.each([Z,tt,Y],(function(n){return!0!==n(t,e,Y)}))}(t,e)}(t,o.content,r)},rt=function(t,e,n){var r=n||B(e);nt(t,function(t){return t.replace(D,"")}(e),r,!1)},ot=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=T.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===u.length?u[0]:T.map(u,(function(t){return o+t+i})).join("")}(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(function(t,e){var n,r,o,i=(n=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(n+1).join(" "),u=e.replace(/\t/g,i);return(r=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===H?t.pcIsSpace||""===t.str||t.str.length===u.length-1||function(t,e){return e<t.length&&e>=0&&et(t[e])}(u,t.str.length+1)?{pcIsSpace:!1,str:t.str+H}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:et(e),str:t.str+e}},o={pcIsSpace:!1,str:""},v(u,(function(t){o=r(o,t)})),o).str}(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));nt(t,r,!1,!0)},it=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},ut=function(t,e){return e in t&&t[e].length>0},at=function(t){return ut(t,"text/html")||ut(t,"text/plain")},ct=("mceclip",X=0,function(){return"mceclip"+X++}),st=function(t,e,n){var r,o="paste"===e.type?e.clipboardData:e.dataTransfer;if(M(t)&&o){var i=function(t,e){var n=e.items?p(b(e.items),(function(t){return t.getAsFile()})):[],r=e.files?b(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,function(t){var e=z(t);return function(t){return n=t.type,w(n,"image/",0)&&h(e,(function(e){return n=e,r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(T.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}));var n}}(t))}(t,o);if(i.length>0)return e.preventDefault(),(r=i,S.all(p(r,(function(t){return new S((function(e){var n=function(t){return d(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))).then((function(e){n&&t.selection.setRng(n),v(e,(function(e){!function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,u=o.type,a=ct(),c=e.blob,s=new Image;if(s.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,s)){var l=t.editorUpload.blobCache,f=void 0,m=l.getByData(i,u);if(m)f=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&d(c.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return d(n)?t.dom.encode(n[1]):null}(t,c.name):a,p=g?c.name:void 0;f=l.create(a,c,i,h,p),l.add(f)}rt(t,'<img src="'+f.blobUri()+'">',!1)}else rt(t,'<img src="'+e.uri+'">',!1)}(t,e)}))})),!0}return!1},lt=function(t){return k.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},ft=function(t){return x.ie&&t.inline?document.body:t.getBody()},dt=function(t){return t.dom.get("mcepastebin")},mt=function(t,e){return e===t},gt=function(t,e){var n,r=dt(t);return(n=r)&&"mcepastebin"===n.id&&mt(e,r.innerHTML)},ht=function(t){var e=r(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(ft(t),"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"},n);(x.ie||x.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),function(t,e,n){(function(t){return ft(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){gt(t,n)||t.fire("paste")}))}(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(dt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return dt(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=T.grep(ft(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();T.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var u=t.dom.create("div");r.insertBefore(u,o[i]),e(u,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return gt(t,n)},isDefaultContent:function(t){return mt(n,t)}}},pt=function(t,e){var n=ht(t);return t.on("PreInit",(function(){return function(t,e,n){var r;(function(t,e,n){var r,o=y(),i=y();function u(t,n,r,o,i){var u;ut(n,"text/html")?u=n["text/html"]:(u=e.getHtml(),i=i||B(u),e.isDefaultContent(u)&&(o=!0)),u=U(u),e.remove();var a,c,s,l,f,d,m,g=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(u),h=Q(t,u);(!u.length||g&&!h)&&(o=!0),(o||h)&&(u=ut(n,"text/plain")&&g?n["text/plain"]:(a=u,c=V(),s=I({},c),l="",f=c.getShortEndedElements(),d=T.makeMap("script noscript style textarea video audio iframe object"," "),m=c.getBlockElements(),a=j(a,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(f[n]&&(l+=" "),d[n])l+=" ";else{if(3===e.type&&(l+=e.value),!e.shortEnded&&(e=e.firstChild))do{t(e)}while(e=e.next);m[n]&&r.next&&(l+="\n","p"===n&&(l+="\n"))}}else l+="\n"}(s.parse(a)),l)),e.isDefaultContent(u)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?ot(t,u):rt(t,u,i)}t.on("keyup",i.clear),t.on("keydown",(function(n){var u=function(t){lt(t)&&!t.isDefaultPrevented()&&e.remove()};if(lt(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&x.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),x.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:!0})}(t);e.remove(),e.create(),t.once("keyup",u),t.once("paste",(function(){t.off("keyup",u)}))}})),t.on("paste",(function(a){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return it(e.clipboardData||t.getDoc().dataTransfer)}(t,a),l="text"===n.get()||r,f=ut(s,"x-tinymce/html");r=!1,a.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(a)?e.remove():at(s)||!st(t,a,e.getLastRng()||t.selection.getRng())?(c||a.preventDefault(),!x.ie||c&&!a.ieFake||ut(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),ut(s,"text/html")?(a.preventDefault(),f||(f=B(s["text/html"])),u(t,s,c,l,f)):C.setEditorTimeout(t,(function(){u(t,s,c,l,f)}),0)):e.remove()}))})(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i,u=function(t){return 0===t.indexOf("webkit-fake-url")},a=function(t){return 0===t.indexOf("data:")};if(!M(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var c=e.length;c--;)(r=e[c].attr("src"))&&(u(r)||!R(t)&&a(r))&&((i=e[c]).attr("data-mce-object")||r===x.transparentSrc||i.remove())}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return rt(t,e,n)},pasteText:function(e){return ot(t,e)},pasteImageData:function(e,n){return st(t,e,n)},getDataTransferItems:it,hasHtmlOrText:at,hasContentType:ut}},vt=function(t,e,n,r){!function(t,e,n){if(!function(t){return!1===x.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData("x-tinymce/html",e),!0}catch(t){return!1}}(t.clipboardData,e.html,e.text)?n(e.html,r):(t.preventDefault(),r())},bt=function(t){return function(e,n){var r=function(t){return D+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var u=t.selection.getRng();i.focus();var a=t.dom.createRng();a.selectNodeContents(i),t.selection.setRng(a),C.setTimeout((function(){t.selection.setRng(u),o.parentNode.removeChild(o),n()}),0)}},yt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},wt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},xt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ct=function(t,e){return xt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},St=function(t,e){t.focus(),t.selection.setRng(e)};function kt(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))}function Ot(t,e){if(!W(e))return e;var n=[];return T.each(t.schema.getBlockElements(),(function(t,e){n.push(e)})),e=j(e,[[new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g"),"$1"]]),j(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Tt(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var u=t.dom,a=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=u.parseStyle(u.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=u.getStyle(a,o[s],!0);/color/.test(o[s])&&(l=u.toHex(l),f=u.toHex(f)),f!==l&&(c[o[s]]=l)}return(c=u.serializeStyle(c,"span"))?e+' style="'+c+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))}function _t(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))}var Et=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};o.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=r(!1),n=r(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),o=pt(t,n),i=function(t){x.webkit&&kt(t,Tt),x.ie&&(kt(t,Ot),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,_t))}(t);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)})}(t,o),function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),O(t,!1)):(e.pasteFormat.set("text"),O(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))}(t,o),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),function(t){t.on("cut",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){if(x.browser.isChrome()||x.browser.isFirefox()){var e=t.selection.getRng();C.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){}))}}(t))}(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),_(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ct(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,u=e.getDataTransferItems(r.dataTransfer),a=e.hasContentType(u,"x-tinymce/html");if((e.hasHtmlOrText(u)&&(!(i=u["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=u["mce-internal"]||u["text/html"]||u["text/plain"];c&&(r.preventDefault(),C.setEditorTimeout(t,(function(){t.undoManager.transact((function(){u["mce-internal"]&&t.execCommand("Delete"),St(t,o),c=U(c),u["text/html"]?e.pasteHtml(c,a):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){_(t)&&!1===n.get()&&(e.preventDefault(),St(t,Ct(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,o,e),function(t,e){return{clipboard:t,quirks:e}}(o,i)}}))}()},1295:(t,e,n)=>{n(6834)},6834:()=>{!function(){"use strict";var t,e,n,r,o,i=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},c=function(t){return function(){return t}},s=c(!1),l=c(!0),f=c("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),d=function(){return m},m=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:s,isSome:s,isNone:l,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:n,orThunk:e,map:d,each:function(){},bind:d,exists:s,forall:l,filter:d,equals:t,equals_:t,toArray:function(){return[]},toString:c("none()")}),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,(function(e){return n(t,e)}))}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=f,v=tinymce.util.Tools.resolve("tinymce.util.Tools"),b=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},y=function(t){return function(e){return typeof e===t}},w=b("string"),x=b("array"),C=y("boolean"),S=y("number"),k=Array.prototype.slice,O=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},_=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},E=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!x(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e}(T(t,e))},N=Object.hasOwnProperty,R=function(t,e){return N.call(t,e)},M=("undefined"!=typeof window?window:Function("return this;")(),3,function(t){return 3===function(t){return t.dom.nodeType}(t)}),z=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},D=z,B=function(t,e){return{element:t,offset:e}},P=function(t,e){(function(t,e){(function(t){return h.from(t.dom.parentNode).map(D)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))})(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},I=(r=M,"text",{get:function(t){if(!r(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o=function(t){return r(t)?h.from(t.dom.nodeValue):h.none()},set:function(t,e){if(!r(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}}),L=function(t){return I.get(t)},H=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),F=function(t,e){return t.isBlock(e)||R(t.schema.getShortEndedElements(),e.nodeName)},V=function(t,e){return"false"===t.getContentEditable(e)},j=function(t,e){return!t.isBlock(e)&&R(t.schema.getWhiteSpaceElements(),e.nodeName)},U=function(t,e){return function(t,e){var n=function(t){return T(t.dom.childNodes,D)}(t);return n.length>0&&e<n.length?B(n[e],0):B(t,e)}(D(t),e)},W=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var u=i?e(!1):n;u;){var a=V(t,u);if(a||j(t,u)){if(a?r.cef(u):r.boundary(u))break;u=e(!0)}else{if(F(t,u)){if(r.boundary(u))break}else 3===u.nodeType&&r.text(u);if(u===o)break;u=e(!1)}}},q=function(t,e,n,r,o){if(!function(t,e){return F(t,e)||V(t,e)||j(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),u=new H(n,i),a=o?u.next:u.prev;W(t,a,n,{boundary:l,cef:l,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(D(t))}})}},$=function(t,e,n,r,o,i){void 0===i&&(i=!0);var u=new H(n,e),a=[],c={sOffset:0,fOffset:0,elements:[]};q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(a.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return W(t,u.next,n,{boundary:s,cef:function(t){return s(),o&&a.push.apply(a,o.cef(t)),!1},text:function(t){c.elements.push(D(t)),o&&o.text(t,c)}},r,i),r&&q(t,c,r,e,!0),s(),a},G=function(t,e){var n=U(e.startContainer,e.startOffset),r=n.element.dom,o=U(e.endContainer,e.endOffset),i=o.element.dom;return $(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i;return n=A((i=D(e),function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),D)}("*[contenteditable=true]",i)),(function(e){var n=e.dom;return $(t,n,n)})),r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=k.call(n,0)).sort(r),o}},!1)},X=function(t,e){return e.collapsed?[]:G(t,e)},K=function(t,e){var n=t.createRng();return n.selectNode(e),X(t,n)},Y=function(t,e){return A(e,(function(e){var n=e.elements,r=T(n,L).join("");return function(t,e){var n,r,o;return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}((n=t,r=function(t,n){var r=L(n),o=t.last,i=o+r.length,u=A(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(u),last:i}},o={results:[],last:0},_(n,(function(t){o=r(o,t)})),o).results,(function(t){return t.matchId}))}(n,function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,u=[];i=o.exec(t);){var a=i[e.matchIndex],c=i.index+i[0].indexOf(a),s=c+a.length;if(s>r)break;u.push({start:c,finish:s}),o.lastIndex=s}return u}(r,t,e.sOffset,r.length-e.fOffset))}))},J=function(t,e){E(t,(function(t,n){E(t,(function(t){var r,o,i=D(e.cloneNode(!1));r="data-mce-index",o=n,function(t,e,n){if(!(w(n)||C(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(i.dom,r,o);var u=t.element.dom;if(u.length===t.finish&&0===t.start)P(t.element,i);else{u.length!==t.finish&&u.splitText(t.finish);var a=u.splitText(t.start);P(D(a),i)}}))}))},Q=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},Z=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return st(t,e,!1),r?function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),u=i.length>0?function(t,e){return A(e,(function(e){return K(t,e)}))}(t,i):X(t,n.getRng()),a=Y(e,u);return J(a,r),n.moveToBookmark(o),a.length}(t.dom,n,t.selection,o):function(t,e,n,r){var o=K(t,n),i=Y(e,o);return J(i,r),i.length}(t.dom,n,i,o)},tt=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},et=function(t,e){var n=[],r=v.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=Q(r[o]);null!==i&&i.length&&i===e.toString()&&n.push(r[o])}return n},nt=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(et(t,r.index),"mce-match-marker-selected");var u=et(t,o);return u.length?(i.addClass(et(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(u[0]),o):-1},rt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},ot=function(t,e,n,r,o,i){var u=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+p()+")"+n+"(?=$|\\s|"+p()+")":n}(n,o),a={regex:new RegExp(u,r?"g":"gi"),matchIndex:1},c=Z(t,e,a,i);if(c){var s=nt(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},it=function(t,e){var n=nt(t,e,!0);e.set(a(a({},e.get()),{index:n}))},ut=function(t,e){var n=nt(t,e,!1);e.set(a(a({},e.get()),{index:n}))},at=function(t){var e=Q(t);return null!==e&&e.length>0},ct=function(t,e,n,r,o){var i,u=e.get(),c=u.index,s=c;r=!1!==r;for(var l=t.getBody(),f=v.grep(v.toArray(l.getElementsByTagName("span")),at),d=0;d<f.length;d++){var m=Q(f[d]),g=i=parseInt(m,10);if(o||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,tt(f[d])):rt(t.dom,f[d]);f[++d];){if((g=parseInt(Q(f[d]),10))!==i){d--;break}rt(t.dom,f[d])}r&&s--}else i>c&&f[d].setAttribute("data-mce-index",String(i-1))}return e.set(a(a({},u),{count:o?0:u.count-1,index:s})),r?it(t,e):ut(t,e),!o&&e.get().count>0},st=function(t,e,n){var r,o,i,u=e.get(),c=v.toArray(t.getBody().getElementsByTagName("span"));for(r=0;r<c.length;r++){var s=Q(c[r]);null!==s&&s.length&&(s===u.index.toString()&&(o||(o=c[r].firstChild),i=c[r].firstChild),tt(c[r]))}if(e.set(a(a({},u),{index:-1,count:0,text:""})),o&&i){var l=t.dom.createRng();return l.setStart(o,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},lt=tinymce.util.Tools.resolve("tinymce.Env"),ft=function(t,e){var n,r=(n=i(h.none()),{clear:function(){return n.set(h.none())},set:function(t){return n.set(h.some(t))},isSet:function(){return n.get().isSome()},on:function(t){return n.get().each(t)}});t.undoManager.add();var o=v.trim(t.selection.getContent({format:"text"}));function u(t){(!function(t,e){return e.get().count>1}(0,e)?t.disable:t.enable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")}var c=function(t,e){var n=e?t.disable:t.enable;_(["replace","replaceall","prev","next"],n)},s=function(t,e){lt.browser.isSafari()&<.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},l=function(n){st(t,e,!1),c(n,!0),u(n)},f=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)it(t,e);else{var i=ot(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);i<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),c(n,0===i)}u(n)}else l(n)},d=e.get(),m={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:o,replacetext:"",wholewords:d.wholeWord,matchcase:d.matchCase,inselection:d.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&l(t)},onAction:function(n,r){var o=n.getData();switch(r.name){case"find":f(n);break;case"replace":ct(t,e,o.replacetext)?u(n):l(n);break;case"replaceall":ct(t,e,o.replacetext,!0,!0),l(n);break;case"prev":ut(t,e),u(n);break;case"next":it(t,e),u(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(a(a({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),l(n)}s(n,r.name)},onSubmit:function(t){f(t),s(t,"find")},onClose:function(){t.focus(),st(t,e),t.undoManager.add()}};r.set(t.windowManager.open(m,{inline:"toolbar"}))},dt=function(t,e){return function(){ft(t,e)}};u.add("searchreplace",(function(t){var e=i({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){ft(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:dt(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:dt(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",dt(t,e))}(t,e),function(t,e){return{done:function(n){return st(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),ot(t,e,n,r,o,i)},next:function(){return it(t,e)},prev:function(){return ut(t,e)},replace:function(n,r,o){return ct(t,e,n,r,o)}}}(t,e)}))}()},8619:(t,e,n)=>{n(2590)},2590:()=>{!function(){"use strict";var t=function(){},e=function(t){return function(){return t}},n=function(t){return t};function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var o,i,u,a=function(t){return function(e){return!t(e)}},c=e(!1),s=e(!0),l=function(){return f},f=(o=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:u=function(t){return t},getOrThunk:i=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:e(null),getOrUndefined:e(void 0),or:u,orThunk:i,map:l,each:t,bind:l,exists:c,forall:s,filter:l,equals:o,equals_:o,toArray:function(){return[]},toString:e("none()")}),d=function(t){var n=e(t),r=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(e){return d(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=function(t){return function(e){return typeof e===t}},p=g("string"),v=g("object"),b=g("array"),y=h("boolean"),w=(void 0,function(t){return undefined===t}),x=function(t){return!function(t){return null==t}(t)},C=h("function"),S=h("number"),k=Array.prototype.slice,O=Array.prototype.indexOf,T=Array.prototype.push,_=function(t,e){return function(t,e){return O.call(t,e)}(t,e)>-1},E=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},N=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},R=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},M=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},z=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},D=function(t,e,n){return R(t,(function(t){n=e(n,t)})),n},B=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,e,c)},P=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return m.some(n);return m.none()},I=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!b(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);T.apply(e,t[n])}return e},L=function(t,e){return I(N(t,e))},H=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},F=function(t){return[t]},V=function(t,e){return e>=0&&e<t.length?m.some(t[e]):m.none()},j=function(t){return V(t,t.length-1)},U=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return m.none()},W=function(){return(W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function q(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var $=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},G=function(){return X(0,0)},X=function(t,e){return{major:t,minor:e}},K=function(t,e){var n=String(e).toLowerCase();return 0===t.length?G():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return X(r(1),r(2))}(t,n)},Y=G,J=function(t,e){var n=String(e).toLowerCase();return B(t,(function(t){return t.search(n)}))},Q=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Z=function(t,e){return-1!==t.indexOf(e)},tt=function(t,e){return Q(t,e,0)},et=function(t,e){return Q(t,e,t.length-e.length)},nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),rt=function(t){return t.length>0},ot=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,it=function(t){return function(e){return Z(e,t)}},ut=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Z(t,"edge/")&&Z(t,"chrome")&&Z(t,"safari")&&Z(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ot],search:function(t){return Z(t,"chrome")&&!Z(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Z(t,"msie")||Z(t,"trident")}},{name:"Opera",versionRegexes:[ot,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:it("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:it("firefox")},{name:"Safari",versionRegexes:[ot,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Z(t,"safari")||Z(t,"mobile/"))&&Z(t,"applewebkit")}}],at=[{name:"Windows",search:it("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Z(t,"iphone")||Z(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:it("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:it("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:it("linux"),versionRegexes:[]},{name:"Solaris",search:it("sunos"),versionRegexes:[]},{name:"FreeBSD",search:it("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:it("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ct={browsers:e(ut),oses:e(at)},st="Edge",lt="Chrome",ft="Opera",dt="Firefox",mt="Safari",gt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(st),isChrome:r(lt),isIE:r("IE"),isOpera:r(ft),isFirefox:r(dt),isSafari:r(mt)}},ht=function(){return gt({current:void 0,version:Y()})},pt=gt,vt=(e(st),e(lt),e("IE"),e(ft),e(dt),e(mt),"Windows"),bt="Android",yt="Linux",wt="Solaris",xt="FreeBSD",Ct="ChromeOS",St=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r("iOS"),isAndroid:r(bt),isOSX:r("OSX"),isLinux:r(yt),isSolaris:r(wt),isFreeBSD:r(xt),isChromeOS:r(Ct)}},kt=function(){return St({current:void 0,version:Y()})},Ot=St,Tt=(e(vt),e("iOS"),e(bt),e(yt),e("OSX"),e(wt),e(xt),e(Ct),function(t,n){var r=ct.browsers(),o=ct.oses(),i=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ht,pt),u=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kt,Ot),a=function(t,n,r,o){var i=t.isiOS()&&!0===/ipad/i.test(r),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),d=!l&&!s&&!f;return{isiPad:e(i),isiPhone:e(u),isTablet:e(s),isPhone:e(l),isTouch:e(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:e(f),isDesktop:e(d)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}}),_t=function(t){return window.matchMedia(t).matches},Et=$((function(){return Tt(navigator.userAgent,_t)})),At=function(){return Et()},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Nt(n)},fromDom:Nt,fromPoint:function(t,e,n){return m.from(t.dom.elementFromPoint(e,n)).map(Nt)}},Mt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Dt=function(t,e){return t.dom===e.dom},Bt=function(t,e){return At().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Pt=Mt,It=Object.keys,Lt=Object.hasOwnProperty,Ht=function(t,e){for(var n=It(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ft=function(t,e){return Vt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Vt=function(t,e){var n={};return Ht(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},jt=function(e,n){var r={};return function(t,e,n,r){Ht(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r},Ut=function(t,e){return Wt(t,e)?m.from(t[e]):m.none()},Wt=function(t,e){return Lt.call(t,e)},qt=["tfoot","thead","tbody","colgroup"],$t=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Gt=function(t,e,n){return{element:t,cells:e,section:n}},Xt=function(t,e){return{element:t,isNew:e}},Kt=function(t,e){return{cells:t,section:e}},Yt=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),Jt=function(t){return t.dom.nodeType},Qt=function(t){return function(e){return Jt(e)===t}},Zt=function(t){return 8===Jt(t)||"#comment"===Yt(t)},te=Qt(1),ee=Qt(3),ne=Qt(9),re=Qt(11),oe=function(t){return Rt.fromDom(t.dom.ownerDocument)},ie=function(t){return ne(t)?t:oe(t)},ue=function(t){return m.from(t.dom.parentNode).map(Rt.fromDom)},ae=function(t,e){for(var n=C(e)?e:c,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Rt.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ce=function(t){return m.from(t.dom.previousSibling).map(Rt.fromDom)},se=function(t){return m.from(t.dom.nextSibling).map(Rt.fromDom)},le=function(t){return N(t.dom.childNodes,Rt.fromDom)},fe=function(t,e){var n=t.dom.childNodes;return m.from(n[e]).map(Rt.fromDom)},de=C(Element.prototype.attachShadow)&&C(Node.prototype.getRootNode),me=e(de),ge=de?function(t){return Rt.fromDom(t.dom.getRootNode())}:ie,he=function(t){return Rt.fromDom(t.dom.host)},pe=function(t){return x(t.dom.shadowRoot)},ve=function(t){var e=ee(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=ge(t);return re(e)?m.some(e):m.none()}(Rt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=ve,r=he,function(t){return n(r(t))}))},be=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Rt.fromDom(e)},ye=function(t,e){var n=[];return R(le(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(ye(t,e))})),n},we=function(t,e,n){return function(t,n,r){return M(ae(t,r),(function(t){return Mt(t,e)}))}(t,0,n)},xe=function(t,e){return function(t,n){return M(le(t),(function(t){return Mt(t,e)}))}(t)},Ce=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:N(n.querySelectorAll(t),Rt.fromDom)}(e,t)};function Se(t,e,n,r,o){return t(n,r)?m.some(n):C(o)&&o(n)?m.none():e(n,r,o)}var ke=function(t,e,n){for(var r=t.dom,o=C(n)?n:c;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(e(i))return m.some(i);if(o(i))break}return m.none()},Oe=function(t,e,n){return ke(t,(function(t){return Mt(t,e)}),n)},Te=function(t,e){return function(t,n){return B(t.dom.childNodes,(function(t){return n=Rt.fromDom(t),Mt(n,e);var n})).map(Rt.fromDom)}(t)},_e=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?m.none():m.from(n.querySelector(t)).map(Rt.fromDom)}(e,t)},Ee=function(t,e,n){return Se((function(t,e){return Mt(t,e)}),Oe,t,e,n)},Ae=function(t,e,n){if(!(p(n)||y(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ne=function(t,e,n){Ae(t.dom,e,n)},Re=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ae(n,e,t)}))},Me=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},ze=function(t,e){return m.from(Me(t,e))},De=function(t,e){t.dom.removeAttribute(e)},Be=function(t){return D(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Pe=function(t){return void 0!==t.style&&C(t.style.getPropertyValue)},Ie=function(t,e,n){if(!p(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Pe(t)&&t.style.setProperty(e,n)},Le=function(t,e,n){var r=t.dom;Ie(r,e,n)},He=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ie(n,e,t)}))},Fe=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||ve(t)?r:Ve(n,e)},Ve=function(t,e){return Pe(t)?t.style.getPropertyValue(e):""},je=function(t,e){var n=t.dom,r=Ve(n,e);return m.from(r).filter((function(t){return t.length>0}))},Ue=function(t,e){!function(t,e){Pe(t)&&t.style.removeProperty(e)}(t.dom,e),ze(t,"style").map(nt).is("")&&De(t,"style")},We=function(t,e,n){return void 0===n&&(n=0),ze(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},qe=function(t,e){return We(t,e,1)},$e=function(t){return qe(t,"colspan")>1},Ge=function(t){return qe(t,"rowspan")>1},Xe=function(t,e){return parseInt(Fe(t,e),10)},Ke=e(10),Ye=e(10),Je=function(t,e){return Qe(t,e,s)},Qe=function(t,e,n){return L(le(t),(function(t){return Mt(t,e)?n(t)?[t]:[]:Qe(t,e,n)}))},Ze=function(t,e){return function(t,e,n){return void 0===n&&(n=c),n(e)?m.none():_(t,Yt(e))?m.some(e):Oe(e,t.join(","),(function(t){return Mt(t,"table")||n(t)}))}(["td","th"],t,e)},tn=function(t){return Je(t,"th,td")},en=function(t){return Mt(t,"colgroup")?xe(t,"col"):L(on(t),(function(t){return xe(t,"col")}))},nn=function(t,e){return Ee(t,"table",e)},rn=function(t){return Je(t,"tr")},on=function(t){return nn(t).fold(e([]),(function(t){return xe(t,"colgroup")}))},un=function(t,e){return N(t,(function(t){if("colgroup"===Yt(t)){var n=N(en(t),(function(t){var e=We(t,"span",1);return $t(t,1,e)}));return Gt(t,n,"colgroup")}return n=N(tn(t),(function(t){var e=We(t,"rowspan",1),n=We(t,"colspan",1);return $t(t,e,n)})),Gt(t,n,e(t))}))},an=function(t){return ue(t).map((function(t){var e=Yt(t);return function(t){return _(qt,t)}(e)?e:"tbody"})).getOr("tbody")},cn=function(t){var e=rn(t),n=q(on(t),e);return un(n,an)},sn=function(t,e){return t+","+e},ln=function(t,e){var n=L(t.all,(function(t){return t.cells}));return M(n,e)},fn=function(t){var e={},n=[],r={},o=0,i=0,u=0;return R(t,(function(t){if("colgroup"===t.section)r=function(t){var e={},n=0;return R(t.cells,(function(t){var r=t.colspan;A(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);else{var a=[];R(t.cells,(function(t){for(var n=0;void 0!==e[sn(u,n)];)n++;for(var r=(f=t.element,d=t.rowspan,m=t.colspan,{element:f,rowspan:d,colspan:m,row:u,column:n}),o=0;o<t.colspan;o++)for(var c=0;c<t.rowspan;c++){var s=n+o,l=sn(u+c,s);e[l]=r,i=Math.max(i,s+1)}var f,d,m;a.push(r)})),o++,n.push(Gt(t.element,a,t.section)),u++}})),{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:r}},dn=function(t){var e=cn(t);return fn(e)},mn=fn,gn=function(t,e,n){var r=t.access[sn(e,n)];return void 0!==r?m.some(r):m.none()},hn=function(t,e,n){var r=ln(t,(function(t){return n(e,t.element)}));return r.length>0?m.some(r[0]):m.none()},pn=ln,vn=function(t){return L(t.all,(function(t){return t.cells}))},bn=function(t){return function(t,e){var n=[];return Ht(t,(function(t,e){n.push(t)})),n}(t.columns)},yn=function(t){return It(t.columns).length>0},wn=function(t,e){return m.from(t.columns[e])},xn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Cn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Sn=function(t,e,n){var r=hn(t,e,Dt),o=hn(t,n,Dt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,{startRow:Math.min(n.row,r.row),startCol:Math.min(n.column,r.column),finishRow:Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),finishCol:Math.max(n.column+n.colspan-1,r.column+r.colspan-1)};var n,r}))}))},kn=function(t,e,n){return Sn(t,e,n).map((function(e){var n=pn(t,r(xn,e));return N(n,(function(t){return t.element}))}))},On=function(t,e){return hn(t,e,(function(t,e){return Bt(e,t)})).map((function(t){return t.element}))},Tn=function(t,e,n){var r=En(t);return kn(r,e,n)},_n=function(t,e,n,r,o){var i=En(t),u=Dt(t,n)?m.some(e):On(i,e),a=Dt(t,o)?m.some(r):On(i,r);return u.bind((function(t){return a.bind((function(e){return kn(i,t,e)}))}))},En=dn,An=function(t,e){ue(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Nn=function(t,e){se(t).fold((function(){ue(t).each((function(t){Mn(t,e)}))}),(function(t){An(t,e)}))},Rn=function(t,e){(function(t){return fe(t,0)})(t).fold((function(){Mn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Mn=function(t,e){t.dom.appendChild(e.dom)},zn=function(t,e){An(t,e),Mn(e,t)},Dn=function(t,e){R(e,(function(n,r){var o=0===r?t:e[r-1];Nn(o,n)}))},Bn=function(t,e){R(e,(function(e){Mn(t,e)}))},Pn=function(t){t.dom.textContent="",R(le(t),(function(t){In(t)}))},In=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ln=function(t){var e,n=le(t);n.length>0&&(e=t,R(n,(function(t){An(e,t)}))),In(t)},Hn=function(t,e){var n=function(e){return t(e)?m.from(e.dom.nodeValue):m.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(ee),Fn=function(t){return Hn.get(t)},Vn=function(t){return Hn.getOption(t)},jn=function(t,e){return Hn.set(t,e)},Un=["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"];function Wn(){return{up:e({selector:Oe,closest:Ee,predicate:ke,all:ae}),down:e({selector:Ce,predicate:ye}),styles:e({get:Fe,getRaw:je,set:Le,remove:Ue}),attrs:e({get:Me,set:Ne,remove:De,copyTo:function(t,e){var n=Be(t);Re(e,n)}}),insert:e({before:An,after:Nn,afterAll:Dn,append:Mn,appendAll:Bn,prepend:Rn,wrap:zn}),remove:e({unwrap:Ln,remove:In}),create:e({nu:Rt.fromTag,clone:function(t){return Rt.fromDom(t.dom.cloneNode(!1))},text:Rt.fromText}),query:e({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ce,nextSibling:se}),property:e({children:le,name:Yt,parent:ue,document:function(t){return ie(t).dom},isText:ee,isComment:Zt,isElement:te,getText:Fn,setText:jn,isBoundary:function(t){return!!te(t)&&("body"===Yt(t)||_(Un,Yt(t)))},isEmptyTag:function(t){return!!te(t)&&_(["br","img","hr","input"],Yt(t))},isNonEditable:function(t){return te(t)&&"false"===Me(t,"contenteditable")}}),eq:Dt,is:Pt}}var qn=function(t,e,n,r){var o=e(t,n);return z(r,(function(n,r){var o=e(t,r);return $n(t,n,o)}),o)},$n=function(t,e,n){return e.bind((function(e){return n.filter(r(t.eq,e))}))},Gn=Wn(),Xn=function(t,e){return function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,qn):m.none()}(Gn,(function(e,n){return t(n)}),e)},Kn=function(t){return Oe(t,"table")},Yn=function(t,e,n){var o=function(t){return function(e){return void 0!==n&&n(e)||Dt(e,t)}};return Dt(t,e)?m.some({boxes:m.some([t]),start:t,finish:e}):Kn(t).bind((function(i){return Kn(e).bind((function(u){if(Dt(i,u))return m.some({boxes:Tn(i,t,e),start:t,finish:e});if(Bt(i,u)){var a=(s=we(e,"td,th",o(i))).length>0?s[s.length-1]:e;return m.some({boxes:_n(i,t,i,e,u),start:t,finish:a})}if(Bt(u,i)){var s,l=(s=we(t,"td,th",o(u))).length>0?s[s.length-1]:t;return m.some({boxes:_n(u,t,i,e,u),start:t,finish:l})}return function(t,e,n){return function(t,e,n,o){void 0===o&&(o=c);var i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return P(t,o).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},s=a(i),l=a(u),f=B(s,(function(e){return E(l,function(t,e){return r(t.eq,e)}(t,e))}));return{firstpath:s,secondpath:l,shared:f}}(Gn,t,e,void 0)}(t,e).shared.bind((function(r){return Ee(r,"table",n).bind((function(n){var r=we(e,"td,th",o(n)),a=r.length>0?r[r.length-1]:e,c=we(t,"td,th",o(n)),s=c.length>0?c[c.length-1]:t;return m.some({boxes:_n(n,t,i,e,u),start:s,finish:a})}))}))}))}))},Jn=function(t,e){var n=Ce(t,e);return n.length>0?m.some(n):m.none()},Qn=function(t,e,n){return _e(t,e).bind((function(e){return _e(t,n).bind((function(t){return Xn(Kn,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Zn=function(t,e,n,r,o){return function(t,e){return B(t,(function(t){return Mt(t,e)}))}(t,o).bind((function(t){return function(t,e,n){return nn(t).bind((function(r){return function(t,e,n,r){return hn(t,e,Dt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return gn(t,o+n,i+r).map((function(t){return t.element}))}))}(En(r),t,e,n)}))}(t,e,n).bind((function(t){return function(t,e){return Oe(t,"table").bind((function(n){return _e(n,e).bind((function(e){return Yn(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},tr=function(t,e){return Jn(t,e)},er=function(t,e,n){return Qn(t,e,n).bind((function(e){var n=function(e){return Dt(t,e)},o="thead,tfoot,tbody,table",i=Oe(e.first,o,n),u=Oe(e.last,o,n);return i.bind((function(t){return u.bind((function(n){return Dt(t,n)?function(t,e,n){return function(t,e,n){return Sn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,o=r(Cn,e),i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)n=n&&gn(t,i,u).exists(o);return n?m.some(e):m.none()}(t,e)}))}(En(t),e,n)}(e.table,e.first,e.last):m.none()}))}))}))},nr=function(t){if(!b(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return R(t,(function(r,o){var i=It(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!b(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=It(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!H(e,(function(t){return _(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},rr=nr([{none:[]},{multiple:["elements"]},{single:["element"]}]),or=function(t,e,n,r){return t.fold(e,n,r)},ir=rr.none,ur=rr.multiple,ar=rr.single,cr=tinymce.util.Tools.resolve("tinymce.PluginManager"),sr=function(t,e,n){var r=t[n].element,o=Rt.fromTag("td");Mn(o,Rt.fromTag("br")),(e?Mn:Rn)(r,o)},lr=function(t,e){var n=function(t){return Mt(t.element,e)},r=cn(t),o=mn(r),i=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0;return Ht(t.access,(function(t){if(e(t)){var n=t.row,a=n+t.rowspan-1,c=t.column,s=c+t.colspan-1;n<r?r=n:a>i&&(i=a),c<o?o=c:s>u&&(u=s)}})),function(t,e,n,r){return{minRow:t,minCol:e,maxRow:n,maxCol:r}}(r,o,i,u)}(o,n),u="th:not("+e+"),td:not("+e+")",a=Qe(t,"th,td",(function(t){return Mt(t,u)}));return R(a,In),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol||(gn(e,u,c).filter(r).isNone()?sr(t,a,u):a=!0)}(r,o,i,n),function(t,e){var n=M(Je(t,"tr"),(function(t){return 0===t.dom.childElementCount}));R(n,In),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||R(Je(t,"th,td"),(function(t){De(t,"rowspan"),De(t,"colspan")})),De(t,"width"),De(t,"height"),Ue(t,"width"),Ue(t,"height")}(t,i),t},fr=function(t){return"img"===Yt(t)?1:Vn(t).fold((function(){return le(t).length}),(function(t){return t.length}))},dr=["img","br"],mr=function(t){return Vn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||_(dr,Yt(t))},gr=function(t){return e=mr,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Rt.fromDom(t.childNodes[r]);if(e(o))return m.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return m.none()})(t.dom);var e,n},hr=function(t){return pr(t,mr)},pr=function(t,e){var n=function(t){for(var r=le(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return m.some(i);var u=n(i);if(u.isSome())return u}return m.none()};return n(t)},vr=function(t,e){return Rt.fromDom(t.dom.cloneNode(e))},br=function(t){return vr(t,!1)},yr=function(t){return vr(t,!0)},wr={scope:["row","col"]},xr=function(){var t=Rt.fromTag("td");return Mn(t,Rt.fromTag("br")),t},Cr=function(){return Rt.fromTag("col")},Sr=function(){return Rt.fromTag("colgroup")},kr=function(t,e,n){var r=function(t,e){var n=function(t,e){var n=Rt.fromTag(e),r=Be(t);return Re(n,r),n}(t,e),r=le(yr(t));return Bn(n,r),n}(t,e);return Ht(n,(function(t,e){null===t?De(r,e):Ne(r,e,t)})),r},Or=function(t){return t},Tr=function(t){return function(){return Rt.fromTag("tr",t.dom)}},_r=function(t,e,n){var r=function(t,e){var n,r,o;n=e,r=t.element.dom,o=n.dom,Pe(r)&&Pe(o)&&(o.style.cssText=r.style.cssText),Ue(e,"height"),1!==t.colspan&&Ue(t.element,"width")};return{col:function(e){var n=oe(e.element),o=Rt.fromTag(Yt(e.element),n.dom);return r(e,o),t(e.element,o),o},colgroup:Sr,row:Tr(e),cell:function(e){var o=oe(e.element),i=Rt.fromTag(Yt(e.element),o.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?function(t,e,n){return gr(t).map((function(r){var o=n.join(","),i=we(r,o,(function(e){return Dt(e,t)}));return z(i,(function(t,e){var n=br(e);return De(n,"contenteditable"),Mn(t,n),n}),e)})).getOr(e)}(e.element,i,u):i;return Mn(a,Rt.fromTag("br")),r(e,i),function(t,e){Ht(wr,(function(n,r){return ze(t,r).filter((function(t){return _(n,t)})).each((function(t){return Ne(e,r,t)}))}))}(e.element,i),t(e.element,i),i},replace:kr,gap:xr}},Er=function(t){return{col:Cr,colgroup:Sr,row:Tr(t),cell:xr,replace:Or,gap:xr}},Ar=function(t){return N(t,Rt.fromDom)},Nr=function(t){return or(t.get(),e([]),n,F)},Rr=function(t){var e=function(t,e){return ze(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Nr(t);return n.length>0&&H(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?m.some(n):m.none()},Mr=function(t,e,n){return or(e.get(),m.none,(function(e){return e.length<=1?m.none():er(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),m.none)},zr={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Dr=function(t){return{element:t,mergable:m.none(),unmergable:m.none(),selection:[t]}},Br=function(t,e,n){return{element:n,mergable:Mr(e,t,zr),unmergable:Rr(t),selection:Nr(t)}},Pr=nr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ir=W({},Pr),Lr=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e};function Hr(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Fe(n,t);return parseFloat(o)||0}return r},r=function(t,e){return D(e,(function(e,n){var r=Fe(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!S(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Pe(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var Fr,Vr,jr,Ur=Hr("width",(function(t){return t.dom.offsetWidth})),Wr=function(t){return Ur.get(t)},qr=function(t){return Ur.getOuter(t)},$r=function(t){var e=t.grid,r=A(e.columns,n),o=A(e.rows,n);return N(r,(function(e){return Gr((function(){return L(o,(function(n){return gn(t,n,e).filter((function(t){return t.column===e})).toArray()}))}),(function(t){return 1===t.colspan}),(function(){return gn(t,0,e)}))}))},Gr=function(t,e,n){var r=t();return B(r,e).orThunk((function(){return m.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Xr=function(t){var r=t.grid,o=A(r.rows,n),i=A(r.columns,n);return N(o,(function(n){return Gr((function(){return L(i,(function(r){return gn(t,n,r).filter((function(t){return t.row===n})).fold(e([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return gn(t,n,0)}))}))},Kr=function(t,e){return function(n){return"rtl"===Yr(n)?e:t}},Yr=function(t){return"rtl"===Fe(t,"direction")?"rtl":"ltr"},Jr=Hr("height",(function(t){var e=t.dom;return ve(t)?e.getBoundingClientRect().height:e.offsetHeight})),Qr=function(t){return Jr.get(t)},Zr=function(t){return Jr.getOuter(t)},to=function(t,e){return{left:t,top:e,translate:function(n,r){return to(t+n,e+r)}}},eo=to,no=function(t,e){return void 0!==t?t:void 0!==e?e:0},ro=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return eo(n.offsetLeft,n.offsetTop);var i=no(null==r?void 0:r.pageYOffset,o.scrollTop),u=no(null==r?void 0:r.pageXOffset,o.scrollLeft),a=no(o.clientTop,n.clientTop),c=no(o.clientLeft,n.clientLeft);return oo(t).translate(u-c,i-a)},oo=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?eo(n.offsetLeft,n.offsetTop):ve(t)?function(t){var e=t.getBoundingClientRect();return eo(e.left,e.top)}(e):eo(0,0)},io=function(t,e){return{row:t,y:e}},uo=function(t,e){return{col:t,x:e}},ao=function(t){return ro(t).left+qr(t)},co=function(t){return ro(t).left},so=function(t,e){return uo(t,co(e))},lo=function(t,e){return uo(t,ao(e))},fo=function(t){return ro(t).top},mo=function(t,e){return io(t,fo(e))},go=function(t,e){return io(t,fo(e)+Zr(e))},ho=function(t,e,n){if(0===n.length)return[];var r=N(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},po={delta:n,positions:function(t){return ho(mo,go,t)},edge:fo},vo=Kr({delta:n,edge:co,positions:function(t){return ho(so,lo,t)}},{delta:function(t){return-t},edge:ao,positions:function(t){return ho(lo,so,t)}}),bo={delta:function(t,e){return vo(e).delta(t,e)},positions:function(t,e){return vo(e).positions(t,e)},edge:function(t){return vo(t).edge(t)}},yo={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:[""]},wo=(Fr="[eE][+-]?[0-9]+",jr=["Infinity","[0-9]+\\."+(Vr=function(t){return"(?:"+t+")?"})("[0-9]+")+Vr(Fr),"\\.[0-9]+"+Vr(Fr),"[0-9]+"+Vr(Fr)].join("|"),new RegExp("^([+-]?(?:"+jr+"))(.*)$")),xo=function(){var t=At().browser;return t.isIE()||t.isEdge()},Co=function(t,e,n){return function(t,e){var n=parseFloat(t);return isNaN(n)?e:n}(Fe(t,e),n)},So=function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().width;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-left",0)-Co(t,"padding-right",0)-(Co(t,"border-left-width",0)+Co(t,"border-right-width",0))}(t):Co(t,"width",Wr(t))},ko=/(\d+(\.\d+)?)%/,Oo=/(\d+(\.\d+)?)px|em/,To=function(t,e){Le(t,"width",e+"px")},_o=function(t,e){Le(t,"width",e+"%")},Eo=function(t,e){Le(t,"height",e+"px")},Ao=function(t){var e=function(t){return je(t,"height").getOrThunk((function(){return function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().height;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-top",0)-Co(t,"padding-bottom",0)-(Co(t,"border-top-width",0)+Co(t,"border-bottom-width",0))}(t):Co(t,"height",Qr(t))}(t)+"px"}))}(t);return e?function(t,e,n,r){var o=parseInt(t,10);return et(t,"%")&&"table"!==Yt(e)?function(t,e,n,r){var o=nn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o}(e,t,Qr,Eo):Qr(t)},No=function(t){return je(t,"width").fold((function(){return m.from(Me(t,"width"))}),(function(t){return m.some(t)}))},Ro=function(t,e){return t/e.pixelWidth()*100},Mo=function(t,e){return No(t).fold((function(){var n=Wr(t);return Ro(n,e)}),(function(n){return function(t,e,n){var r=ko.exec(e);if(null!==r)return parseFloat(r[1]);var o=So(t);return Ro(o,n)}(t,n,e)}))},zo=function(t,e){return No(t).fold((function(){return So(t)}),(function(n){return function(t,e,n){var r=Oo.exec(e);if(null!==r)return parseInt(r[1],10);var o=ko.exec(e);return null!==o?function(t,e){return t/100*e.pixelWidth()}(parseFloat(o[1]),n):So(t)}(t,n,e)}))},Do=function(t){return function(t,e,n){return n(t)/qe(t,"rowspan")}(t,0,Ao)},Bo=function(t,e,n){Le(t,"width",e+n)},Po=function(t){return n=Wr,o=(r=e=t,m.from(r.dom.offsetParent).map(Rt.fromDom)).getOr(be(oe(e))),n(e)/n(o)*100+"%";var e,n,r,o},Io=e(ko),Lo=e(Oo),Ho=("col",function(t){return te(t)&&"col"===Yt(t)}),Fo=function(t,e,n){return je(t,e).fold((function(){return n(t)+"px"}),(function(t){return t}))},Vo=function(t,e){return Fo(t,"width",(function(t){return Ho(t)?Wr(t):zo(t,e)}))},jo=function(t){return Fo(t,"height",Do)},Uo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(function(t,e){if(e<0||e>=t.length-1)return m.none();var n=t[e].fold((function(){var n=function(t){var e=k.call(t,0);return e.reverse(),e}(t.slice(0,e));return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))}(n,e))}),(function(t){return o(t)}))},Wo=function(t,e,r,o,i){var u=$r(t),c=yn(t)?function(t){return N(bn(t),(function(t){return m.from(t.element)}))}(t):u,s=[m.some(bo.edge(e))].concat(N(bo.positions(u,e),(function(t){return t.map((function(t){return t.x}))}))),l=a($e);return N(c,(function(t,e){return Uo(t,e,s,l,(function(t){if(function(t){return!Ho(t)||je(t,"width").isSome()}(t))return r(t,i);var a,c=null!=(a=u[e])?n(a):m.none();return Uo(c,e,s,l,(function(t){return o(m.some(Wr(t)))}),o)}),o)}))},qo=function(t){return t.map((function(t){return t+"px"})).getOr("")},$o=function(t,e,n){return Wo(t,e,zo,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Go=function(t,e,n,r,o){var i=Xr(t),u=[m.some(n.edge(e))].concat(N(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return N(i,(function(t,e){return Uo(t,e,u,a(Ge),r,o)}))},Xo=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ko=function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Yo=function(t,e,n){var r=function(t,e){return yn(t)?function(t,e){var n=bn(t);return N(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)}(t,e);R(r,(function(t){n.setElementWidth(t.element,t.width)}))},Jo=function(t,n,r,o,i){var u=dn(t),a=i.getCellDelta(n),c=i.getWidths(u,i),s=r===u.grid.columns-1,l=o.clampTableDelta(c,r,a,i.minCellWidth(),s),f=function(t,n,r,o,i){var u=t.slice(0),a=function(t,e){return 0===t.length?Ir.none():1===t.length?Ir.only(0):0===e?Ir.left(0,1):e===t.length-1?Ir.right(e-1,e):e>0&&e<t.length-1?Ir.middle(e-1,e,e+1):Ir.none()}(t,n),c=e(N(u,e(0)));return a.fold(c,(function(t){return o.singleColumnWidth(u[t],r)}),(function(t,e){return i.calcLeftEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}),(function(t,e,n){return i.calcMiddleDeltas(u,t,e,n,r,o.minCellWidth(),o.isRelative)}),(function(t,e){return i.calcRightEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}))}(c,r,l,i,o),d=N(f,(function(t,e){return t+c[e]}));Yo(u,d,i),o.resizeTable(i.adjustTableWidth,l,s)},Qo=function(t){return N(t,e(0))},Zo=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},ti=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},ei=ti((function(t){return t<0})),ni=ti(s),ri=function(t,n){var r=m.from(t.dom.documentElement).map(Rt.fromDom).getOr(t);return{parent:e(r),view:e(t),origin:e(eo(0,0)),isResizable:n}},oi=nr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),ii=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):oi.invalid(n)},ui=W(W({},oi),{from:function(t){return et(t,"%")?ii("%",oi.percent,t):et(t,"px")?ii("px",oi.pixels,t):oi.invalid(t)}}),ai=function(t,n,r){var o=ui.from(r),i=H(t,(function(t){return"0px"===t}))?function(t,n){var r=t.fold((function(){return e("")}),(function(t){return e(t/n+"px")}),(function(){return e(100/n+"%")}));return A(n,r)}(o,t.length):function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))}(o,t,n);return li(i)},ci=function(t,r){return 0===t.length?r:z(t,(function(t,r){return ui.from(r).fold(e(0),n,n)+t}),0)},si=function(t,n){return ui.from(t).fold(e(t),(function(t){return t+n+"px"}),(function(t){return t+n+"%"}))},li=function(t){if(0===t.length)return t;var e=z(t,(function(t,e){var n=ui.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+"px",remainder:t-n}}(t)}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([si(n[n.length-1],Math.round(e.remainder))])},fi=ui.from,di=function(t){return fi(t).fold(e("px"),e("px"),e("%"))},mi=function(t,e,n,r){var o=dn(t),i=o.all,u=vn(o),a=bn(o);e.each((function(e){var n=di(e),i=Wr(t),c=function(t,e,n){return Wo(t,e,Vo,qo,n)}(o,t,r),s=ai(c,i,e);yn(o)?function(t,e,n){R(e,(function(e,r){var o=ci([t[r]],Ke());Le(e.element,"width",o+n)}))}(s,a,n):function(t,e,n){R(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=ci(r,Ke());Le(e.element,"width",o+n)}))}(s,u,n),Le(t,"width",e)})),n.each((function(e){var n=di(e),r=Qr(t),a=function(t,e,n){return Go(t,e,n,jo,qo)}(o,t,po);!function(t,e,n,r){R(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=ci(n,Ye());Le(e.element,"height",o+r)})),R(e,(function(e,n){Le(e.element,"height",t[n])}))}(ai(a,r,e),i,u,n),Le(t,"height",e)}))},gi=function(t){return No(t).exists((function(t){return ko.test(t)}))},hi=function(t){return No(t).exists((function(t){return Oo.test(t)}))},pi=function(t){return No(t).isNone()},vi=Po,bi=function(t){return dn(t).grid},yi=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=M(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};R(t,(function(t,e){o[t]=n[e]})),R(e,(function(t){t(o)}))}}},wi=function(t){return{registry:Ft(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Ft(t,(function(t){return t.trigger}))}},xi=function(t){return t.slice(0).sort()},Ci=function(t,e){var n=M(e,(function(e){return!_(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+xi(t).join(", "))}(n)},Si=function(t){return function(t,e){return function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var r;return function(t,e){if(!b(e))throw new Error("The required fields must be an array. Was: "+e+".");R(e,(function(e){if(!p(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),r=xi(e),B(r,(function(t,e){return e<r.length-1&&t===r[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+r.join(", ")+"].")})),function(r){var o=It(r);H(e,(function(t){return _(o,t)}))||function(t,e){throw new Error("All required keys ("+xi(t).join(", ")+") were not specified. Specified keys were: "+xi(e).join(", ")+".")}(e,o),t(e,o);var i=M(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+xi(t).join(", ")+") were not.")}(i,n.label),r}}(t,e,{validate:C,label:"function"})}(Ci,t)},ki=Si(["compare","extract","mutate","sink"]),Oi=Si(["element","start","stop","destroy"]),Ti=Si(["forceDrop","drop","move","delayDrop"]);function _i(){var e,n,r={onEvent:t,reset:t},o=(e=m.none(),{onEvent:function(t,r){r.extract(t).each((function(t){(function(t,n){var r=e.map((function(e){return t.compare(e,n)}));return e=m.some(n),r})(r,t).each((function(t){n.trigger.move(t)}))}))},reset:function(){e=m.none()},events:(n=wi({move:yi(["info"])})).registry}),i=r;return{on:function(){i.reset(),i=o},off:function(){i.reset(),i=r},isOn:function(){return i===o},onEvent:function(t,e){i.onEvent(t,e)},events:o.events}}var Ei=function(t){var e,n,r=Rt.fromDom(function(t){if(me()&&x(t.target)){var e=Rt.fromDom(t.target);if(te(e)&&pe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return V(n,0)}}return m.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Ai=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ni=s,Ri=function(t,e,n){return function(t,e,n,o){return function(t,e,n,o,i){var u=function(t,e){return function(n){t(n)&&e(Ei(n))}}(n,o);return t.dom.addEventListener(e,u,i),{unbind:r(Ai,t,e,u,i)}}(t,e,n,o,!1)}(t,e,Ni,n)},Mi=Ei,zi=function(t){return void 0!==t.dom.classList},Di=function(t,e){return function(t,e,n){var r=function(t,e){var n=Me(t,e);return void 0===n||""===n?[]:n.split(" ")}(t,e).concat([n]);return Ne(t,e,r.join(" ")),!0}(t,"class",e)},Bi=function(t,e){zi(t)?t.dom.classList.add(e):Di(t,e)},Pi=function(t,e){return zi(t)&&t.dom.classList.contains(e)},Ii=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Li=Ii("ephox-dragster"),Hi=Li.resolve,Fi=ki({compare:function(t,e){return eo(e.left-t.left,e.top-t.top)},extract:function(t){return m.some(eo(t.x,t.y))},sink:function(t,e){var n=function(t){var e=W({layerClass:Hi("blocker")},t),n=Rt.fromTag("div");return Ne(n,"role","presentation"),He(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Bi(n,Hi("blocker")),Bi(n,e.layerClass),{element:function(){return n},destroy:function(){In(n)}}}(e),r=Ri(n.element(),"mousedown",t.forceDrop),o=Ri(n.element(),"mouseup",t.drop),i=Ri(n.element(),"mousemove",t.move),u=Ri(n.element(),"mouseout",t.delayDrop);return Oi({element:n.element,start:function(t){Mn(t,n.element())},stop:function(){In(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Vi=function(t){return"true"===Me(t,"contenteditable")},ji=Ii("ephox-snooker"),Ui=ji.resolve,Wi=Ui("resizer-bar"),qi=Ui("resizer-rows"),$i=Ui("resizer-cols"),Gi=function(t){var e=Ce(t.parent(),"."+Wi);R(e,In)},Xi=function(t,e,n){var r=t.origin();R(e,(function(e){e.each((function(e){var o=n(r,e);Bi(o,Wi),Mn(t.parent(),o)}))}))},Ki=function(t,e,n,r,o){var i=ro(n),u=e.isResizable,a=r.length>0?po.positions(r,n):[],c=a.length>0?function(t,e){return L(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Rt.fromTag("div");return He(i,{position:"absolute",left:e+"px",top:n-3.5+"px",height:"7px",width:r+"px"}),Re(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r);return Bi(o,qi),o}))}(e,M(a,(function(t,e){return E(c,(function(t){return e===t}))})),i,qr(n));var s=o.length>0?bo.positions(o,n):[],l=s.length>0?function(t,e){var n=[];return A(t.grid.columns,(function(r){wn(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),M(n,(function(n){var r=pn(t,(function(t){return t.column===n}));return H(r,(function(t){return e(t.element)}))}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o,i,u,a,c,s=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=r,c=Rt.fromTag("div"),He(c,{position:"absolute",left:i-3.5+"px",top:u+"px",height:a+"px",width:"7px"}),Re(c,{"data-column":o,role:"presentation"}),c);return Bi(s,$i),s}))}(e,M(s,(function(t,e){return E(l,(function(t){return e===t}))})),i,Zr(n))},Yi=function(t,e){if(Gi(t),t.isResizable(e)){var n=dn(e),r=Xr(n),o=$r(n);Ki(n,t,e,r,o)}},Ji=function(t,e){var n=Ce(t.parent(),"."+Wi);R(n,e)},Qi=function(t){Ji(t,(function(t){Le(t,"display","none")}))},Zi=function(t){Ji(t,(function(t){Le(t,"display","block")}))},tu=Ui("resizer-bar-dragging"),eu=function(t){var e=function(){var t=wi({drag:yi(["xDelta","yDelta","target"])}),e=m.none(),n=function(){var t=wi({drag:yi(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();return n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))})),{assign:function(t){e=m.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}}(),n=function(t,e){return void 0===e&&(e={}),function(t,e,n){var r,o,i=!1,u=wi({start:yi([]),stop:yi([])}),a=_i(),c=function(){f.stop(),a.isOn()&&(a.off(),u.trigger.stop())},s=(r=c,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout((function(){r.apply(null,t),o=null}),200)}});a.events.move.bind((function(n){e.mutate(t,n.info)}));var l=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i&&t.apply(null,e)}},f=e.sink(Ti({forceDrop:c,drop:l(c),move:l((function(t){s.cancel(),a.onEvent(t,e)})),delayDrop:l(s.throttle)}),n);return{element:f.element,go:function(t){f.start(t),a.on(),u.trigger.start()},on:function(){i=!0},off:function(){i=!1},destroy:function(){f.destroy()},events:u.registry}}(t,void 0!==e.mode?e.mode:Fi,e)}(e,{}),o=m.none(),i=function(t,e){return m.from(Me(t,e))};e.events.drag.bind((function(t){i(t.target,"data-row").each((function(e){var n=Xe(t.target,"top");Le(t.target,"top",n+t.yDelta+"px")})),i(t.target,"data-column").each((function(e){var n=Xe(t.target,"left");Le(t.target,"left",n+t.xDelta+"px")}))}));var u=function(t,e){return Xe(t,e)-We(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){o.each((function(n){i(e,"data-row").each((function(t){var r=u(e,"top");De(e,"data-initial-top"),f.trigger.adjustHeight(n,r,parseInt(t,10))})),i(e,"data-column").each((function(t){var r=u(e,"left");De(e,"data-initial-left"),f.trigger.adjustWidth(n,r,parseInt(t,10))})),Yi(t,n)}))}))}));var a=function(r,o){f.trigger.startAdjust(),e.assign(r),Ne(r,"data-initial-"+o,Xe(r,o)),Bi(r,tu),Le(r,"opacity","0.2"),n.go(t.parent())},c=Ri(t.parent(),"mousedown",(function(t){var e;e=t.target,Pi(e,qi)&&a(t.target,"top"),function(t){return Pi(t,$i)}(t.target)&&a(t.target,"left")})),s=function(e){return Dt(e,t.view())},l=Ri(t.view(),"mouseover",(function(e){var n;(n=e.target,Ee(n,"table",s).filter((function(t){return function(t,e){return Ee(t,"[contenteditable]",e)}(t,s).exists(Vi)}))).fold((function(){ve(e.target)&&Gi(t)}),(function(e){o=m.some(e),Yi(t,e)}))})),f=wi({adjustHeight:yi(["table","delta","row"]),adjustWidth:yi(["table","delta","column"]),startAdjust:yi([])});return{destroy:function(){c.unbind(),l.unbind(),n.destroy(),Gi(t)},refresh:function(e){Yi(t,e)},on:n.on,off:n.off,hideBars:r(Qi,t),showBars:r(Zi,t),events:f.registry}},nu=function(t,e,n){var r=po,o=bo,i=eu(t),u=wi({beforeResize:yi(["table","type"]),afterResize:yi(["table","type"]),startDrag:yi([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row"),function(t,e,n,r){var o=dn(t),i=function(t,e,n){return Go(t,e,n,Do,(function(t){return t.getOrThunk(Ye)}))}(o,t,r),u=N(i,(function(t,r){return n===r?Math.max(e+t,Ye()):t})),a=Ko(o,u),c=function(t,e){return N(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);R(c,(function(t){Eo(t.element,t.height)})),R(a,(function(t){Eo(t.element,t.height)}));var s=z(u,(function(t,e){return t+e}),0);Eo(t,s)}(e,r.delta(t.delta,e),t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Jo(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},ru=function(t,e){return t.fire("newrow",{node:e})},ou=function(t,e){return t.fire("newcell",{node:e})},iu=function(t,e,n){t.fire("TableModified",W(W({},n),{table:e}))},uu={"border-collapse":"collapse",width:"100%"},au={border:"1"},cu="preservetable",su=function(t){return t.getParam("table_sizing_mode","auto")},lu=function(t){return t.getParam("table_responsive_width")},fu=function(t){return t.getParam("table_default_attributes",au,"object")},du=function(t){return t.getParam("table_default_styles",function(t){if(bu(t)){var e=t.getBody().offsetWidth;return W(W({},uu),{width:e+"px"})}return yu(t)?jt(uu,(function(t,e){return"width"!==e})):uu}(t),"object")},mu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},gu=function(t){return t.getParam("table_row_advtab",!0,"boolean")},hu=function(t){return t.getParam("table_advtab",!0,"boolean")},pu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},vu=function(t){return"relative"===su(t)||!0===lu(t)},bu=function(t){return"fixed"===su(t)||!1===lu(t)},yu=function(t){return"responsive"===su(t)},wu=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},xu=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return _(["section","cells","sectionCells","auto"],n)?n:e},Cu=function(t){var e=t.getParam("table_column_resizing",cu,"string");return B(["preservetable","resizetable"],(function(t){return t===e})).getOr(cu)},Su=function(t){return"preservetable"===Cu(t)},ku=function(t){var e=t.getParam("table_clone_elements");return p(e)?m.some(e.split(/[ ,]/)):Array.isArray(e)?m.some(e):m.none()},Ou=function(t){return t.nodeName.toLowerCase()},Tu=function(t){return Rt.fromDom(t.getBody())},_u=function(t){return t.getBoundingClientRect().width},Eu=function(t){return t.getBoundingClientRect().height},Au=function(t){return function(e){return Dt(e,Tu(t))}},Nu=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Ru=function(t){De(t,"data-mce-style");var e=function(t){return De(t,"data-mce-style")};R(tn(t),e),R(en(t),e)},Mu=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return m.from(n).filter(rt)},zu=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},Du=function(t){return Rt.fromDom(t.selection.getStart())},Bu=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Pu=function(t,e){var n=Bu(parseFloat(t)),r=Bu(Wr(e));return{width:n.get,pixelWidth:r.get,getWidths:function(t,n){return function(t,e,n){return Wo(t,e,Mo,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)}(t,e,n)},getCellDelta:function(t){return t/r.get()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Ke()/r.get()*100},setElementWidth:_o,adjustTableWidth:function(t){var o=n.get(),i=o+t/100*o;_o(e,i),n.set(i),r.set(Wr(e))},isRelative:!0,label:"percent"}},Iu=function(t,e){var r=Bu(t),o=r.get;return{width:o,pixelWidth:o,getWidths:function(t,n){return $o(t,e,n)},getCellDelta:n,singleColumnWidth:function(t,e){return[Math.max(Ke(),t+e)-t]},minCellWidth:Ke,setElementWidth:To,adjustTableWidth:function(t){var n=o()+t;To(e,n),r.set(n)},isRelative:!1,label:"pixel"}},Lu=function(n){return No(n).fold((function(){return function(n){var r=function(){return Wr(n)},o=e(0);return{width:r,pixelWidth:r,getWidths:function(t,e){return $o(t,n,e)},getCellDelta:o,singleColumnWidth:e([0]),minCellWidth:o,setElementWidth:t,adjustTableWidth:t,isRelative:!0,label:"none"}}(n)}),(function(t){return function(t,e){var n=Io().exec(e);if(null!==n)return Pu(n[1],t);var r=Lo().exec(e);if(null!==r){var o=parseInt(r[1],10);return Iu(o,t)}var i=Wr(t);return Iu(i,t)}(n,t)}))},Hu=Iu,Fu=Pu,Vu=function(t,e){if(vu(t)){var n=Mu(t,e.dom).filter(zu).getOrThunk((function(){return vi(e)}));return Fu(n,e)}return bu(t)?Hu(Wr(e),e):Lu(e)},ju=function(t){De(t,"width")},Uu=function(t,e){!function(t,e){var n=Po(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},Wu=function(t,e){!function(t,e){var n=function(t){return Wr(t)+"px"}(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},qu=function(t){Ue(t,"width");var e=en(t),n=e.length>0?e:tn(t);R(n,(function(t){Ue(t,"width"),ju(t)})),ju(t)},$u="bar-",Gu=function(t){return"false"!==Me(t,"data-mce-resize")},Xu=function(t){var n,r,o=m.none(),i=m.none(),u=m.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Vu(t,e)},l=function(){return Su(t)?{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=D(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ei(t,e,n,r)},calcLeftEdgeDeltas:n=function(t,e,n,r,o){var i=ni(t,r>=0?n:e,r,o);return Zo(t,e,n+1,[i,-i],Qo)},calcMiddleDeltas:function(t,e,r,o,i,u){return n(t,r,o,i,u)},calcRightEdgeDeltas:function(t,n,r,o,i,u){if(u)return Qo(t);var a=o/t.length;return N(t,e(a))}}:function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return N(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=ei(t,e,r,o);return Zo(t,e,n+1,[i,0],Qo)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ei,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=ei(e,r,o,i);return Qo(e.slice(0,r)).concat([a])}}}();var n};return t.on("init",(function(){var n=function(t,n){return t.inline?function(t,n,r){return{parent:e(n),view:e(t),origin:e(eo(0,0)),isResizable:r}}(Tu(t),(r=Rt.fromTag("div"),He(r,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Mn(be(Rt.fromDom(document)),r),r),n):ri(Rt.fromDom(t.getDoc()),n);var r}(t,Gu);if(u=m.some(n),function(t){var e=t.getParam("object_resizing",!0);return p(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var r=l(),a=nu(n,r,s);a.on(),a.events.startDrag.bind((function(e){o=m.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,_u(n),Eu(n),$u+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Ru(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,_u(r),Eu(r),$u+e.type),t.undoManager.add()})),i=m.some(a)}})),t.on("ObjectResizeStart",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o);R(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Cu(t)+"-columns")})),!hi(i)&&bu(t)?Wu(t,i):!gi(i)&&vu(t)&&Uu(t,i),pi(i)&&tt(e.origin,$u)&&Uu(t,i),n=e.width,r=yu(t)?"":Mu(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o),u=e.origin;tt(u,"corner-")&&function(e,o,i){var u=et(o,"e");if(""===r&&Uu(t,e),i!==n&&""!==r){Le(e,"width",r);var a=l(),c=s(e),f=Su(t)||u?function(t){return bi(t).columns}(e)-1:0;Jo(e,i-n,f,a,c)}else if(zu(r)){var d=parseFloat(r.replace("%",""));Le(e,"width",i*d/n+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(r)&&function(t){var e=dn(t);yn(e)||R(tn(t),(function(t){var e=Fe(t,"width");Le(t,"width",e),De(t,"width")}))}(e)}(i,u,e.width),Ru(i),iu(t,i.dom)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr(ri(Rt.fromDom(t.getBody()),Gu))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&In(e.parent())}(t,e)}))}}},Ku=function(t,e){return{element:t,offset:e}},Yu=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return Yu(t,e,n).orThunk((function(){return m.some(e)}))})):m.none()},Ju=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},Qu=function(t,e){var n=Yu(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return Ku(n,Ju(t,n));var r=t.property().children(n);return r.length>0?Qu(t,r[r.length-1]):Ku(n,Ju(t,n))},Zu=Qu,ta=Wn(),ea=function(t,e){(function(t){return No(t).bind((function(t){return e=t,n=["fixed","relative","empty"],m.from(wo.exec(e)).bind((function(t){var e=Number(t[1]),r=t[2];return function(t,e){return E(e,(function(e){return E(yo[e],(function(e){return t===e}))}))}(r,n)?m.some({value:e,unit:r}):m.none()}));var e,n}))})(t).each((function(n){var r=n.value/2;Bo(t,r,n.unit),Bo(e,r,n.unit)}))},na=function(t,e,n){t.cells[e]=n},ra=function(t,e){return Kt(e,t.section)},oa=function(t,e){var n=t.cells,r=N(n,e);return Kt(r,t.section)},ia=function(t,e){return t.cells[e]},ua=function(t,e){return ia(t,e).element},aa=function(t){return t.cells.length},ca=function(t){var e=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(a=u,"colgroup"===a.section?n:r).push(u)}var a;return{pass:n,fail:r}}(t);return{rows:e.fail,cols:e.pass}},sa=function(t,e,n,r){n===r?De(t,e):Ne(t,e,n)},la=function(t,e,n){j(xe(t,e)).fold((function(){return Rn(t,n)}),(function(t){return Nn(t,n)}))},fa=function(t,e){var n=[],r=[],o=function(t){return N(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return Pn(e),R(t.cells,(function(t){t.isNew&&r.push(t.element),sa(t.element,"colspan",t.colspan,1),sa(t.element,"rowspan",t.rowspan,1),Mn(e,t.element)})),e}))},i=function(t){return L(t,(function(t){return N(t.cells,(function(t){return sa(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Te(t,e).getOrThunk((function(){var n=Rt.fromTag(e,oe(t).dom);return"thead"===e?la(t,"caption,colgroup",n):"colgroup"===e?la(t,"caption",n):Mn(t,n),n}));return Pn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Bn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Te(t,e).each(In)}(n)},c=[],s=[],l=[],f=[];return R(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},da=function(t,e){if(0===t.length)return 0;var n=t[0];return P(t,(function(t){return!e(n.element,t.element)})).fold((function(){return t.length}),(function(t){return t}))},ma=function(t,e){var n=N(t,(function(t){return N(t.cells,c)}));return N(t,(function(r,o){return i=L(r.cells,(function(r,i){if(!1===n[o][i]){var u=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e).cells.slice(n),i=da(o,r),u=function(t,e){return N(t,(function(t){return ia(t,e)}))}(t,n).slice(e);return{colspan:i,rowspan:da(u,r)}}(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l})),u=r.section,{details:i,section:u};var i,u}))},ga=function(t,e,n){var r=[];if(yn(t)){var o=N(bn(t),(function(t){return Xt(t.element,n)}));r.push(Kt(o,"colgroup"))}for(var i=0;i<t.grid.rows;i++){for(var u=[],a=0;a<t.grid.columns;a++){var c=gn(t,i,a).map((function(t){return Xt(t.element,n)})).getOrThunk((function(){return Xt(e.gap(),!0)}));u.push(c)}var s=Kt(u,t.all[i].section);r.push(s)}return r},ha=function(t,e){return function(t,e){return N(t,(function(t){var n=function(t){return U(t,(function(t){return ue(t.element).map((function(t){var e=ue(t).isNone();return Xt(t,e)}))})).getOrThunk((function(){return Xt(e.row(),!0)}))}(t.details);return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(n.element,t.details,t.section,n.isNew)}))}(ma(t,Dt),e)},pa=function(t,e){return U(t.all,(function(t){return B(t.cells,(function(t){return Dt(e,t.element)}))}))},va=function(t,e,n,r,o){return function(i,u,a,c,s){var l=dn(u);return e(l,a).map((function(e){var n=function(t,e){return ga(t,e,!1)}(l,c),r=t(n,e,Dt,o(c));return{grid:ha(r.grid,c),cursor:r.cursor}})).fold((function(){return m.none()}),(function(t){var e=fa(u,t.grid),o=m.from(s).getOrThunk((function(){return Lu(u)}));return n(u,t.grid,o),r(u),Yi(i,u),m.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},ba=function(t,e){return Ze(e.element).bind((function(e){return pa(t,e)}))},ya=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some({cells:r,generators:e.generators,clipboard:e.clipboard}):m.none()},wa=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some(r):m.none()},xa=function(t,e,n,r){for(var o=ca(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<aa(o[0]);a++){var c=n(ua(o[u],a),e);!0===c&&!1===i?na(o[u],a,Xt(r(),!0)):!0===c&&(i=!1)}return t},Ca=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:e(t),getOrThunk:e(t),getOrDie:e(t),or:function(e){return Ca(t)},orThunk:function(e){return Ca(t)},fold:function(e,n){return n(t)},map:function(e){return Ca(e(t))},mapError:function(e){return Ca(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},Sa=function(e){return{is:c,isValue:c,isError:s,getOr:n,getOrThunk:function(t){return t()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return Sa(e)},mapError:function(t){return Sa(t(e))},each:t,bind:function(t){return Sa(e)},exists:c,forall:s,toOptional:m.none}},ka={value:Ca,error:Sa,fromOption:function(t,e){return t.fold((function(){return Sa(e)}),Ca)}},Oa=function(t,e){return{rowDelta:0,colDelta:aa(t[0])-aa(e[0])}},Ta=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},_a=function(t,e,n){var r="colgroup"===e.section?n.col:n.cell;return N(t,(function(){return Xt(r(),!0)}))},Ea=function(t,e,n){return t.concat(A(e,(function(){var e=t[t.length-1];return ra(e,_a(e.cells,e,n))})))},Aa=function(t,e,r){return N(t,(function(t){var o=_a(A(e,n),t,r);return ra(t,t.cells.concat(o))}))},Na=function(t,e,r){var o=e.colDelta<0?Aa:n;return(e.rowDelta<0?Ea:n)(o(t,Math.abs(e.colDelta),r),Math.abs(e.rowDelta),r)},Ra=function(t,e,n,o){var i=r(o,ia(t[e],n).element),u=t[e];return t.length>1&&aa(u)>1&&(n>0&&i(ua(u,n-1))||n<u.cells.length-1&&i(ua(u,n+1))||e>0&&i(ua(t[e-1],n))||e<t.length-1&&i(ua(t[e+1],n)))},Ma=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&R(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&na(t,e,Xt(r(),!0))}))}(e,t,o,r.cell);var i=Ta(n,e),u=Na(n,i,r),a=Ta(e,u),c=Na(e,a,r);return N(c,(function(e,n){var r=e.cells.slice(0,t).concat(u[n].cells).concat(e.cells.slice(t,e.cells.length));return ra(e,r)}))},za=function(t,e,n,r,o){!function(t,e,n,r){var o=ca(t).rows;if(e>0&&e<o.length){var i=function(t,e){return D(t,(function(t,n){return E(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);R(i,(function(t){for(var i=m.none(),u=function(e){for(var u=function(u){var a=o[e].cells[u];n(a.element,t.element)&&(i.isNone()&&(i=m.some(r())),i.each((function(t){na(o[e],u,Xt(t,!0))})))},a=0;a<aa(o[0]);a++)u(a)},a=e;a<o.length;a++)u(a)}))}}(e,t,o,r.cell);var i=Oa(n,e),u=Na(n,i,r),a=Oa(e,u),c=Na(e,a,r),s=ca(c),l=s.cols,f=s.rows;return l.concat(f.slice(0,t)).concat(u).concat(f.slice(t,f.length))},Da=function(t,e,n,r,o){var i=ca(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=oa(u[n],(function(t,n){return e>0&&e<u.length&&r(ua(u[e-1],n),ua(u[e],n))?ia(u[e],n):Xt(o(t.element,r),!0)}));return a.concat(c).concat([l]).concat(s)},Ba=function(t,e,n,r,o){return N(t,(function(t){var i=e>0&&e<aa(t)&&r(ua(t,e-1),ua(t,e)),u=function(t,e,n,r,o,i,u){return"colgroup"!==n&&r?ia(t,e):Xt(u(ua(t,o),i),!0)}(t,e,t.section,i,n,r,o);return function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat([n]).concat(i);return ra(t,u)}(t,e,u)}))},Pa=function(t,e,n,r){return N(t,(function(t){return oa(t,(function(t){return function(t){return E(e,(function(e){return n(t.element,e.element)}))}(t)?Xt(r(t.element,n),!0):t}))}))},Ia=function(t,e,n,r){return void 0!==ua(t[e],n)&&e>0&&r(ua(t[e-1],n),ua(t[e],n))},La=function(t,e,n){return e>0&&n(ua(t,e-1),ua(t,e))},Ha=function(t,e,n,r){var o=L(t,(function(r,o){return Ia(t,o,e,n)||La(r,e,n)?[]:[ia(r,e)]}));return Pa(t,o,n,r)},Fa=function(t,e,n,r){var o=ca(t).rows,i=o[e],u=L(i.cells,(function(t,r){return Ia(o,e,r,n)||La(i,r,n)?[]:[t]}));return Pa(t,u,n,r)},Va=Si(["cell","row","replace","gap","col","colgroup"]),ja=function(t){return{element:t,colspan:We(t,"colspan",1),rowspan:We(t,"rowspan",1)}},Ua=function(t,e){void 0===e&&(e=ja),Va(t);var n=Bu(m.none()),r=function(r){var i=function(n){return function(e){switch(Yt(e.element)){case"col":return t.col(e);default:return t.cell(e)}}(e(n))}(r);return n.get().isNone()&&n.set(m.some(i)),o=m.some({item:r,replacement:i}),i},o=m.none();return{getOrInit:function(t,e){return o.fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.replacement:r(t)}))},cursor:n.get}},Wa=function(t,e){return function(n){var r=Bu(m.none());Va(n);var o=[],i=function(i){var u={scope:t},a=n.replace(i,e,u);return o.push({item:i,sub:a}),r.get().isNone()&&r.set(m.some(a)),a};return{replaceOrInit:function(t,e){return function(t,e){return B(o,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return i(t)}),(function(n){return e(t,n.item)?n.sub:i(t)}))},cursor:r.get}}},qa=function(t){Va(t);var e=Bu(m.none());return{combine:function(n){return e.get().isNone()&&e.set(m.some(n)),function(){var e=t.cell({element:n,colspan:1,rowspan:1});return Ue(e,"width"),Ue(n,"width"),e}},cursor:e.get}},$a=["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"],Ga=Wn(),Xa=function(t){return function(t,e){var n=t.property().name(e);return _($a,n)}(Ga,t)},Ka=function(t){return function(t,e){var n=t.property().name(e);return _(["ol","ul"],n)}(Ga,t)},Ya=function(t){var e,n=function(t){return"br"===Yt(t)},r=function(t){return hr(t).bind((function(e){var r=se(e).map((function(t){return!!Xa(t)||!!function(t,e){return _(["br","img","hr","input"],t.property().name(e))}(Ga,t)&&"img"!==Yt(t)})).getOr(!1);return ue(e).map((function(o){return!0===r||("li"===Yt(i=o)||ke(i,Ka).isSome())||n(e)||Xa(o)&&!Dt(t,o)?[]:[Rt.fromTag("br")];var i}))})).getOr([])},o=0===(e=L(t,(function(t){var e=le(t);return function(t){return H(t,(function(t){return n(t)||ee(t)&&0===Fn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Rt.fromTag("br")]:e;Pn(t[0]),Bn(t[0],o)},Ja=function(t){0===tn(t).length&&In(t)},Qa=function(t,e){return{grid:t,cursor:e}},Za=function(t,e,n){var r=ca(t).rows;return tc(r,e,n).orThunk((function(){return tc(r,0,0)}))},tc=function(t,e,n){return m.from(t[e]).bind((function(t){return m.from(t.cells[n]).bind((function(t){return m.from(t.element)}))}))},ec=function(t,e,n){var r=ca(t).rows;return Qa(t,tc(r,e,n))},nc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},rc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},oc=function(t,e,n){var r,o,i=(r=t,o=n.section,un(r,(function(){return o}))),u=mn(i);return ga(u,e,!0)},ic=function(t,e){var n=M(t,e);return 0===n.length?m.some("td"):n.length===t.length?m.some("th"):m.none()},uc=function(t,e,n){var r=mn(e),o=n.getWidths(r,n);Yo(r,o,n)},ac=va((function(t,e,n,r){var o=e[0].row,i=e[0].row,u=nc(e),a=D(u,(function(t,e){return Da(t,i,o,n,r.getOrInit)}),t);return ec(a,i,e[0].column)}),wa,t,t,Ua),cc=va((function(t,e,n,r){var o=nc(e),i=o[o.length-1].row,u=o[o.length-1].row+o[o.length-1].rowspan,a=D(o,(function(t,e){return Da(t,u,i,n,r.getOrInit)}),t);return ec(a,u,e[0].column)}),wa,t,t,Ua),sc=va((function(t,e,n,r){var o=rc(e),i=o[0].column,u=o[0].column,a=D(o,(function(t,e){return Ba(t,u,i,n,r.getOrInit)}),t);return ec(a,e[0].row,u)}),wa,uc,t,Ua),lc=va((function(t,e,n,r){var o=e[e.length-1].column,i=e[e.length-1].column+e[e.length-1].colspan,u=rc(e),a=D(u,(function(t,e){return Ba(t,i,o,n,r.getOrInit)}),t);return ec(a,e[0].row,i)}),wa,uc,t,Ua),fc=va((function(t,e,n,r){var o=rc(e),i=function(t,e,n){var r=N(t,(function(t){var r=t.cells.slice(0,e).concat(t.cells.slice(n+1));return Kt(r,t.section)}));return M(r,(function(t){return t.cells.length>0}))}(t,o[0].column,o[o.length-1].column),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,uc,Ja,Ua),dc=va((function(t,e,n,r){var o=nc(e),i=function(t,e,n){var r=ca(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,t,Ja,Ua),mc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("row","th")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("row","th"))),gc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td"))),hc=(va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("col","th")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("col","th")),va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td")),va((function(t,n,r,o){var i=n.cells;Ya(i);var u=function(t,e,n,r){var o=ca(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)na(o[i],u,Xt(r(),!1));return t}(t,n.bounds,0,e(i[0]));return Qa(u,m.from(i[0]))}),(function(t,e){return e.mergable}),t,t,qa)),pc=va((function(t,e,n,r){var o=z(e,(function(t,e){return xa(t,e,n,r.combine(e))}),t);return Qa(o,m.from(e[0]))}),(function(t,e){return e.unmergable}),uc,t,qa),vc=va((function(t,e,n,r){var o,i,u=function(t,e){var n=dn(t);return ga(n,e,!0)}(e.clipboard,e.generators);return function(t,e,n,r,o){return function(t,e,n){if(t.row>=e.length||t.column>aa(e[0]))return ka.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=aa(n[0]),u=n.length;return ka.value({rowDelta:r.length-u,colDelta:o.length-i})}(t,e,n).map((function(i){var u=Na(e,i,r);return function(t,e,n,r,o){for(var i=t.row,u=t.column,a=i+n.length,c=u+aa(n[0]),s=i;s<a;s++)for(var l=u;l<c;l++){Ra(e,s,l,o)&&xa(e,ua(e[s],l),o,r.cell);var f=ua(n[s-i],l-u),d=r.replace(f);na(e[s],l,Xt(d,!0))}return e}(t,u,n,r,o)}))}((o=e.row,i=e.column,{row:o,column:i}),t,u,e.generators,n).fold((function(){return Qa(t,m.some(e.element))}),(function(t){var n=Za(t,e.row,e.column);return Qa(t,n)}))}),(function(t,e){return Ze(e.element).bind((function(n){return pa(t,n).map((function(t){return W(W({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),uc,t,Ua),bc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),yc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),wc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].row,u=o[i],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),xc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),Cc=function(t,e){var n=dn(t);return wa(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=I(N(n.all,(function(t){return M(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return ic(i,(function(t){return"th"===Yt(t.element)}))})).getOr("")},Sc=function(t){return Ou(t.parentNode)},kc=function(t,e){var n="thead"===Sc(e),r=!E(e.cells,(function(t){return"th"!==Ou(t)}));return n||r?m.some({thead:n,ths:r}):m.none()},Oc=function(t,e){return"thead"===(n=kc(0,e).fold((function(){return Sc(e)}),(function(t){return"thead"})))?"header":"tfoot"===n?"footer":"body";var n},Tc=function(t,e,n){var r=t.getParent(e,"table"),o=e.parentNode,i=Ou(o);if(n!==i){var u=t.select(n,r)[0];if(!u){u=t.create(n);var a=r.firstChild;"thead"===n?j(xe(Rt.fromDom(r),"caption,colgroup")).fold((function(){return r.insertBefore(u,a)}),(function(e){return t.insertAfter(u,e.dom)})):r.appendChild(u)}"tbody"===n&&"thead"===i&&u.firstChild?u.insertBefore(e,u.firstChild):u.appendChild(e),o.hasChildNodes()||t.remove(o)}},_c=function(t,e,n,r){var o=t.dom,i=function(t,e,n){if(x(n)&&Ou(e)!==n){var r=t.dom.rename(e,n);return ou(t,r),r}return e}(t,e,n);return w(r)||o.setAttrib(i,"scope",r),i},Ec=function(t,e,n,r){return R(e,(function(e){return _c(t,e,n,r)}))},Ac=function(t,e,n){var r,o=t.dom;if("header"===n){var i=xu(t),u="auto"===i?(r=nn(Rt.fromDom(e.cells[0])).map((function(t){return rn(t)})).getOr([]),U(r,(function(t){return kc(0,t.dom)})).map((function(t){return t.thead&&t.ths?"sectionCells":t.thead?"section":"cells"})).getOr("section")):i;Ec(t,e.cells,"section"===u?"td":"th","col"),Tc(o,e,"cells"===u?"tbody":"thead")}else Ec(t,e.cells,"td",null),Tc(o,e,"footer"===n?"tfoot":"tbody")},Nc=function(t){return function(e){var n=Yt(e),r="col"===n||"colgroup"===n?function(t){return nn(t).bind((function(t){return tr(t,zr.firstSelectedSelector)})).fold((function(){return t}),(function(t){return t[0]}))}(e):e;return Ee(r,t)}},Rc=Nc("th,td"),Mc=Nc("th,td,caption"),zc=function(t,e){return Rc(t).map((function(t){return Nr(e)})).getOr([])},Dc=function(t,e){var n,r,o,i=Rc(t),u=i.bind((function(t){return nn(t)})).map((function(t){return rn(t)}));return(n=i,r=u,o=function(t,n){return M(n,(function(n){return E(Ar(n.dom.cells),(function(n){return"1"===Me(n,e)||Dt(n,t)}))}))},n.isSome()&&r.isSome()?m.some(o(n.getOrDie(),r.getOrDie())):m.none()).getOr([])},Bc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Pc=function(t,e,n,r){return A(t,(function(t){return function(t,e,n,r){for(var o=Rt.fromTag("tr"),i=0;i<t;i++){var u=Rt.fromTag(r<e||i<n?"th":"td");i<n&&Ne(u,"scope","row"),r<e&&Ne(u,"scope","col"),Mn(u,Rt.fromTag("br")),Mn(o,u)}return o}(e,n,r,t)}))},Ic=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Lc=function(t,e,n,o,i){var u=du(t),a={styles:u,attributes:fu(t),colGroups:wu(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=Bc);var u=Rt.fromTag("table"),a="cells"!==o;He(u,i.styles),Re(u,i.attributes),i.colGroups&&Mn(u,function(t){var e=Rt.fromTag("colgroup");return A(t,(function(){return Mn(e,Rt.fromTag("col"))})),e}(e));var c=Math.min(t,n);if(a&&n>0){var s=Rt.fromTag("thead");Mn(u,s);var l=Pc(n,e,"sectionCells"===o?c:0,r);Bn(s,l)}var f=Rt.fromTag("tbody");Mn(u,f);var d=Pc(a?t-c:t,e,a?0:n,r);return Bn(f,d),u}(n,e,i,o,xu(t),a);Ne(r,"data-mce-id","__mce");var u=function(t){var e=Rt.fromTag("div"),n=Rt.fromDom(t.dom.cloneNode(!0));return Mn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),_e(Tu(t),'table[data-mce-id="__mce"]').map((function(e){return bu(t)?Wu(t,e):yu(t)?qu(e):(vu(t)||function(t){return p(t)&&-1!==t.indexOf("%")}(u.width))&&Uu(t,e),Ru(e),De(e,"data-mce-id"),function(t,e){R(Ce(e,"tr"),(function(e){ru(t,e.dom),R(Ce(e,"th,td"),(function(e){ou(t,e.dom)}))}))}(t,e),function(t,e){_e(e,"td,th").each(r(Ic,t))}(t,e),e.dom})).getOr(null)},Hc=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return S(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return Lc(t,n,e,a,u)}return console.error(o),null},Fc=function(t){return function(){return t().fold((function(){return[]}),(function(t){return N(t,(function(t){return t.dom}))}))}},Vc=function(t){return function(e){var n=e.length>0?m.some(Ar(e)):m.none();t(n)}},jc=function(t){return function(e,n,r){void 0===r&&(r={});var o=Hc(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Uc=function(t,e,n){var r=We(t,e,1);1===n||r<=1?De(t,e):Ne(t,e,Math.min(n,r))},Wc=tinymce.util.Tools.resolve("tinymce.util.Tools"),qc=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},$c=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Gc=function(t,e){Wc.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Xc=function(t,e){return function(t,e){return e.concat(N(t,(function(t){var e=t.text||t.title;return function(t){return e=t,Wt(e,"menu")&&void 0!==e.menu&&null!==e.menu;var e}(t)?{text:e,items:Xc(t.menu)}:{text:e,value:t.value}})))}(t,e||[])},Kc=function(t){return function(e){return tt(e,"rgb")?t.toHex(e):e}},Yc=function(t,e){var n=Rt.fromDom(e);return{borderwidth:je(n,"border-width").getOr(""),borderstyle:je(n,"border-style").getOr(""),bordercolor:je(n,"border-color").map(Kc(t)).getOr(""),backgroundcolor:je(n,"background-color").map(Kc(t)).getOr("")}},Jc=function(t){var e=t[0],n=t.slice(1);return R(n,(function(t){R(It(e),(function(n){Ht(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},Qc=function(t){var e=[{name:"borderstyle",type:"listbox",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"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(e):e}},Zc=function(t,e,n,r){return B(t,(function(t){return n.formatter.matchNode(r,e+t)})).getOr("")},ts=r(Zc,["left","center","right"],"align"),es=r(Zc,["top","middle","bottom"],"valign"),ns=[{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:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],rs=function(t){return ns.concat(function(t){var e=Xc(function(t){return t.getParam("table_cell_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},os=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},is={normal:os(!1),ifTruthy:os(!0)},us=function(t){return nn(t[0]).map((function(e){var n=dn(e),r=vn(n),o=M(r,(function(e){return E(t,(function(t){return Dt(e.element,t)}))}));return N(o,(function(t){return{element:t.element.dom,column:wn(n,t.column).map((function(t){return t.element.dom}))}}))}))},as=function(t,e,n){var r=n.getData();n.close(),t.undoManager.transact((function(){(function(t,e,n){var r=1===e.length;if(e.length>=1){var o=nn(e[0]);us(e).each((function(e){R(e,(function(e){var o=_c(t,e.element,n.celltype),i=r?is.normal(t,o):is.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Nu(n.height)),e.setStyle("width",Nu(n.width))}(i,e.column.map((function(e){return r?is.normal(t,e):is.ifTruthy(t,e)})).getOr(i),n),mu(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Nu(e.borderwidth))}(i,n),r&&(Gc(t,o),function(t,e){Wc.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&$c(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))})),o.each((function(e){return iu(t,e.dom)}))}})(t,e,r),t.focus()}))},cs=function(t,e){var n=zc(Du(t),e);if(0!==n.length){var o=function(t,e){var n=us(e).map((function(e){return N(e,(function(e){return function(t,e,n,r){var o=t.dom,i=r.getOr(e),u=function(t,e){return o.getStyle(t,e)||o.getAttrib(t,e)};return W({width:u(i,"width"),height:u(e,"height"),scope:o.getAttrib(e,"scope"),celltype:Ou(e),class:o.getAttrib(e,"class",""),halign:ts(t,e),valign:es(t,e)},n?Yc(o,e):{})}(t,e.element,mu(t),e.column)}))}));return Jc(n.getOrDie())}(t,n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:rs(t)},Qc("cell")]},u={type:"panel",items:[{type:"grid",columns:2,items:rs(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:mu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(as,t,n)})}},ss=[{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"}],ls=function(t){return ss.concat(function(t){var e=Xc(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},fs=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){(function(t,e,n,r){var o=1===e.length;R(e,(function(e){r.type!==Ou(e.parentNode)&&Ac(t,e,r.type);var i=o?is.normal(t,e):is.ifTruthy(t,e);!function(t,e){t.setAttrib("scope",e.scope),t.setAttrib("class",e.class),t.setStyle("height",Nu(e.height))}(i,r),gu(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,r),r.align!==n.align&&(Gc(t,e),$c(t,e,r.align))})),nn(Rt.fromDom(e[0])).each((function(e){return iu(t,e.dom)}))})(t,e,n,o),t.focus()}))},ds=function(t){var e=Dc(Du(t),zr.selected);if(0!==e.length){var n=N(e,(function(e){return function(t,e,n){var r=t.dom;return W({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),class:r.getAttrib(e,"class",""),type:Oc(0,e),align:ts(t,e)},n?Yc(r,e):{})}(t,e.dom,gu(t))})),o=Jc(n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:ls(t)},Qc("row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ls(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:gu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(fs,t,N(e,(function(t){return t.dom})),o)})}},ms=tinymce.util.Tools.resolve("tinymce.Env"),gs=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{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"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},hs=function(t,e,n,r){if("TD"===e.tagName||"TH"===e.tagName)p(n)?t.setStyle(e,n,r):t.setStyle(e,n);else if(e.children)for(var o=0;o<e.children.length;o++)hs(t,e.children[o],n,r)},ps=function(t,e,n){var r,o=t.dom,i=n.getData();n.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,u=parseInt(i.rows,10)||1;e=Lc(t,n,u,0,0)}!function(t,e,n){var r,o=t.dom,i={},u={};if(i.class=n.class,u.height=Nu(n.height),o.getAttrib(e,"width")&&!pu(t)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Nu(n.width),pu(t)?(u["border-width"]=Nu(n.border),u["border-spacing"]=Nu(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),pu(t)&&e.children)for(var a=0;a<e.children.length;a++)hs(o,e.children[a],{"border-width":Nu(n.border),padding:Nu(n.cellpadding)}),hu(t)&&hs(o,e.children[a],{"border-color":n.bordercolor});hu(t)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(W(W({},du(t)),u)),o.setAttribs(e,W(W({},fu(t)),i)),iu(t,e)}(t,e,i),(r=o.select("caption",e)[0])&&!i.caption&&o.remove(r),!r&&i.caption&&((r=o.create("caption")).innerHTML=ms.ie?" ":'<br data-mce-bogus="1"/>',e.insertBefore(r,e.firstChild)),""===i.align?Gc(t,e):$c(t,e,i.align),t.focus(),t.addVisual()}))},vs=function(t,e){var n,o=t.dom,i=function(t,e){var n,r,o,i,u=du(t),a=fu(t),c=e?(n=t.dom,{borderstyle:Ut(u,"border-style").getOr(""),bordercolor:Kc(n)(Ut(u,"border-color").getOr("")),backgroundcolor:Kc(n)(Ut(u,"background-color").getOr(""))}):{};return W(W(W(W(W(W({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],pu(t)&&i?{border:i}:Ut(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Ut(u,"border-spacing").or(Ut(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Ut(u,"border-padding").or(Ut(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),W(W({},r),o)))}(t,hu(t));!1===e?(n=o.getParent(t.selection.getStart(),"table"))?i=function(t,e,n){var r=t.dom;return W({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"),cellpadding:r.getAttrib(e,"cellpadding")||qc(t.dom,e,"padding"),border:function(e,n){var r=je(Rt.fromDom(n),"border-width");return pu(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||qc(t.dom,n,"border-width")||qc(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:ts(t,e)},n?Yc(r,e):{})}(t,n,hu(t)):hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""):(i.cols="1",i.rows="1",hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""));var u=Xc(function(t){return t.getParam("table_class_list",[],"array")}(t));u.length>0&&i.class&&(i.class=i.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:gs(t,u,e)},c=hu(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},Qc("table")]}:{type:"panel",items:[a]};t.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:r(ps,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i})},bs=function(t){return Mc(Du(t))},ys=function(t){return Rc(Du(t))},ws=function(e,n,o,i,u){var c=Au(e),s=function(t){return nn(t,c)},l=function(t){return function(n){e.selection.setRng(n),e.focus(),o.clear(t),Ru(t),iu(e,t.dom)}},f=function(t){return ys(e).each((function(e){s(e).each((function(n){var r=Br(i,n,e);t(n,r).each(l(n))}))}))},d=function(){return ys(e).map((function(n){return s(n).bind((function(r){return function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1),o=ca(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan);return function(t){return N(t,(function(t){var e=br(t.element);return R(t.cells,(function(t){var n=yr(t.element);sa(n,"colspan",t.colspan,1),sa(n,"rowspan",t.rowspan,1),Mn(e,n)})),e}))}(ha(o,n))}))}(r,Br(i,r,n),_r(t,Rt.fromDom(e.getDoc()),m.none()))}))}))},g=function(){return ys(e).map((function(t){return s(t).bind((function(e){return function(t,e){var n=dn(t);return wa(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan;return q(function(t,e,n){if(yn(t)){var r=M(bn(t),(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"span",n-e),r})),i=Rt.fromTag("colgroup");return Bn(i,o),[i]}return[]}(n,r,o),function(t,e,n){return N(t.all,(function(t){var r=M(t.cells,(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"colspan",n-e),r})),i=Rt.fromTag("tr");return Bn(i,o),i}))}(n,r,o))}))}(e,Br(i,e,t))}))}))},h=function(t,n){return n().each((function(n){var r=N(n,(function(t){return yr(t)}));ys(e).each((function(n){return s(n).each((function(n){var o=Er(Rt.fromDom(e.getDoc())),u=function(t,e,n,r){return{selection:Nr(t),clipboard:n,generators:r}}(i,0,r,o);t(n,u).each(l(n))}))}))}))};Ht({mceTableSplitCells:function(){return f(n.unmergeCells)},mceTableMergeCells:function(){return f(n.mergeCells)},mceTableInsertRowBefore:function(){return f(n.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(n.insertRowsAfter)},mceTableInsertColBefore:function(){return f(n.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(n.insertColumnsAfter)},mceTableDeleteCol:function(){return f(n.deleteColumn)},mceTableDeleteRow:function(){return f(n.deleteRow)},mceTableCutCol:function(t){return g().each((function(t){u.setColumns(t),f(n.deleteColumn)}))},mceTableCutRow:function(t){return d().each((function(t){u.setRows(t),f(n.deleteRow)}))},mceTableCopyCol:function(t){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(t){return d().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(t){return h(n.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(t){return h(n.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(t){return h(n.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(t){return h(n.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return bs(e).each((function(t){nn(t,c).filter(a(c)).each((function(t){var n=Rt.fromText("");if(Nn(t,n),In(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{var r=e.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),e.selection.setRng(r),e.nodeChanged()}}))}))},mceTableSizingMode:function(t,n){return function(t){return bs(e).each((function(n){yu(e)||bu(e)||vu(e)||nn(n,c).each((function(n){"relative"!==t||gi(n)?"fixed"!==t||hi(n)?"responsive"!==t||pi(n)||qu(n):Wu(e,n):Uu(e,n),Ru(n),iu(e,n.dom)}))}))}(n)}},(function(t,n){return e.addCommand(n,t)}));var b=function(t,e){e.each((function(e){iu(t,e.dom)}))};Ht({mceTableCellType:function(t,r){var o=nn(Du(e),c);n.setTableCellType(e,r),b(e,o)},mceTableRowType:function(t,r){var o=nn(Du(e),c);n.setTableRowType(e,r),b(e,o)}},(function(t,n){return e.addCommand(n,t)})),e.addCommand("mceTableColType",(function(t,e){return Ut(e,"type").each((function(t){return f("th"===t?n.makeColumnsHeader:n.unmakeColumnsHeader)}))})),Ht({mceTableProps:r(vs,e,!1),mceTableRowProps:r(ds,e),mceTableCellProps:r(cs,e,i)},(function(t,n){return e.addCommand(n,(function(){return t()}))})),e.addCommand("mceInsertTable",(function(t,n){v(n)&&It(n).length>0?Hc(e,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):vs(e,!0)})),e.addCommand("mceTableApplyCellStyle",(function(t,n){var r=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(v(n)){var o=zc(Du(e),i);if(0!==o.length){var u=jt(n,(function(t,n){return e.formatter.has(r(n))&&p(t)}));(function(t){for(var e in t)if(Lt.call(t,e))return!1;return!0})(u)||(Ht(u,(function(t,n){R(o,(function(o){is.normal(e,o.dom).setFormat(r(n),t)}))})),s(o[0]).each((function(t){return iu(e,t.dom,{structure:!1,style:!0})})))}}}))},xs={tablecellbackgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},tablecellbordercolor:{selector:"td,th",styles:{borderColor:"%value"},remove_similar:!0},tablecellborderstyle:{selector:"td,th",styles:{borderStyle:"%value"},remove_similar:!0},tablecellborderwidth:{selector:"td,th",styles:{borderWidth:"%value"},remove_similar:!0}},Cs=nr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Ss=W(W({},Cs),{none:function(t){return void 0===t&&(t=void 0),Cs.none(t)}}),ks=function(t,e){return nn(t,e).bind((function(e){var n=tn(e);return P(n,(function(e){return Dt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Os=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ts=nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_s={before:Ts.before,on:Ts.on,after:Ts.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(n,n,n)}},Es=nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),As={domRange:Es.domRange,relative:Es.relative,exact:Es.exact,exactFromRange:function(t){return Es.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Rt.fromDom(t.startContainer)},relative:function(t,e){return _s.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return Rt.fromDom(ie(e).dom.defaultView)},range:Os},Ns=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rs=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ms=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zs=nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ds=function(t,e,n){return e(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},Bs=function(t,n){return r=function(t,n){return n.match({domRange:function(t){return{ltr:e(t),rtl:m.none}},relative:function(e,n){return{ltr:$((function(){return Ns(t,e,n)})),rtl:$((function(){return m.some(Ns(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:$((function(){return Rs(t,e,n,r,o)})),rtl:$((function(){return m.some(Rs(t,r,o,e,n))}))}}})}(t,n),(o=r.ltr()).collapsed?r.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zs.rtl(Rt.fromDom(t.endContainer),t.endOffset,Rt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ds(0,zs.ltr,o)})):Ds(0,zs.ltr,o);var r,o},Ps=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})},Is=(zs.ltr,zs.rtl,function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom}),Ls=function(t,e,n,r){return ee(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return U(i,(function(t){return Is(t,n,r)?m.some(t):m.none()})).map((function(o){return function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Fn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,a=1;a<o;a++){var c=i(a).getBoundingClientRect(),s=Math.abs(e-c.left);if(n<=c.bottom){if(n<c.top||s>u)return a-1;u=s}}return 0}(0,n,r,o.right,u);return i(a)}(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=le(e);return U(i,(function(e){return o.selectNode(e.dom),Is(o.getBoundingClientRect(),n,r)?Ls(t,e,n,r):m.none()}))}(t,e,n,r)},Hs=function(t,e){return e-t.left<t.right-e},Fs=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Vs=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Hs(o,n);return(!0===i?gr:hr)(e).map((function(e){return Fs(t,e,i)}))},js=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Hs(r,n);return m.some(Fs(t,e,o))},Us=document.caretPositionFromPoint?function(t,e,n){return m.from(t.dom.caretPositionFromPoint(e,n)).bind((function(e){if(null===e.offsetNode)return m.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),m.some(n)}))}:document.caretRangeFromPoint?function(t,e,n){return m.from(t.dom.caretRangeFromPoint(e,n))}:function(t,e,n){return Rt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===le(e).length?js:Vs)(t,e,n)}(t,r,e)};return 0===le(r).length?o():function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Ls(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))}(t,r,e,n).orThunk(o)}))},Ws=function(t,e){var n=Yt(t);return"input"===n?_s.after(t):_(["br","img"],n)?0===e?_s.before(t):_s.after(t):_s.on(t,e)},qs=function(t,e){var n=t.fold(_s.before,Ws,_s.after),r=e.fold(_s.before,Ws,_s.after);return As.relative(n,r)},$s=function(t,e,n,r){var o=Ws(t,e),i=Ws(n,r);return As.relative(o,i)},Gs=function(t){return m.from(t.getSelection())},Xs=function(t,e){Gs(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},Ks=function(t,e,n,r,o){var i=Rs(t,e,n,r,o);Xs(t,i)},Ys=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){Ks(t,e,n,r,o)},rtl:function(e,n,r,o){Gs(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Ks(t,r,o,e,n)}else Ks(t,r,o,e,n)}))}})},Js=function(t,e,n,r,o){var i=$s(e,n,r,o);Ys(t,i)},Qs=function(t,e,n){var r=qs(e,n);Ys(t,r)},Zs=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return m.some(Os(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(n.endContainer),n.endOffset))}return m.none()},tl=function(t){if(null===t.anchorNode||null===t.focusNode)return Zs(t);var e=Rt.fromDom(t.anchorNode),n=Rt.fromDom(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=oe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Dt(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?m.some(Os(e,t.anchorOffset,n,t.focusOffset)):Zs(t)},el=function(t){return function(t){return Gs(t).filter((function(t){return t.rangeCount>0})).bind(tl)}(t).map((function(t){return As.exact(t.start,t.soffset,t.finish,t.foffset)}))},nl=tinymce.util.Tools.resolve("tinymce.util.VK"),rl=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none(o)}),(function(t){return t.index+1<t.all.length?Ss.middle(o,t.all[t.index+1]):Ss.last(o)})),r);var o},ol=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none()}),(function(t){return t.index-1>=0?Ss.middle(o,t.all[t.index-1]):Ss.first(o)})),r);var o},il=function(t,e){return function(t){var e=As.getWin(t).dom,n=function(t,n,r,o){return Rs(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Rt.fromDom(t.startContainer),n=Rt.fromDom(t.endContainer);return $s(e,t.startOffset,n,t.endOffset)},relative:qs,exact:$s})}(t);return Bs(e,r).match({ltr:n,rtl:n})}(As.exact(e,0,e,0))},ul=function(t,e,n,r){return n.fold(m.none,m.none,(function(t,e){return gr(e).map((function(t){return il(0,t)}))}),(function(n){return nn(n,e).bind((function(e){var o=Dr(n);return t.undoManager.transact((function(){r.insertRowsAfter(e,o)})),function(t,e){var n=Ce(e,"tr");return j(n).bind((function(t){return _e(t,"td,th").map((function(t){return il(0,t)}))}))}(0,e)}))}))},al=["table","li","dl"],cl=function(t,e){return{selection:t,kill:e}},sl=function(t,e,n,r){return{start:_s.on(t,e),finish:_s.on(n,r)}},ll=function(t,e){var n=Ps(t,e);return Os(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},fl=sl,dl=function(t,e,n,r,o){return Dt(n,r)?m.none():Yn(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>0?(o(t,r,e.start,e.finish),m.some(cl(m.some(fl(n,0,n,fr(n))),!0))):m.none()}))},ml=function(t,e){return{item:t,mode:e}},gl=function(t,e,n,r){return void 0===r&&(r=hl),t.property().parent(e).map((function(t){return ml(t,r)}))},hl=function(t,e,n,r){return void 0===r&&(r=pl),n.sibling(t,e).map((function(t){return ml(t,r)}))},pl=function(t,e,n,r){void 0===r&&(r=pl);var o=t.property().children(e);return n.first(o).map((function(t){return ml(t,r)}))},vl=[{current:gl,next:hl,fallback:m.none()},{current:hl,next:pl,fallback:m.some(gl)},{current:pl,next:pl,fallback:m.some(hl)}],bl=function(t,e,n,r,o){return void 0===o&&(o=vl),B(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return bl(t,e,n,r)}))}))}))},yl=function(t,e,n,r,o,i){return bl(t,e,r,o).bind((function(e){return i(e.item)?m.none():n(e.item)?m.some(e.item):yl(t,e.item,n,e.mode,o,i)}))},wl=function(t){return function(e){return 0===t.property().children(e).length}},xl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?m.some(t[t.length-1]):m.none()}},r)},Cl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?m.some(t[0]):m.none()}},r)},Sl=Wn(),kl=function(t,e){return function(t,e,n){return xl(t,e,wl(t),n)}(Sl,t,e)},Ol=function(t,e){return function(t,e,n){return Cl(t,e,wl(t),n)}(Sl,t,e)},Tl=nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),_l=function(t){return Ee(t,"tr")},El=W(W({},Tl),{verify:function(t,e,n,r,o,i,u){return Ee(r,"td,th",u).bind((function(n){return Ee(e,"td,th",u).map((function(e){return Dt(n,e)?Dt(r,n)&&fr(n)===o?i(e):Tl.none("in same cell"):Xn(_l,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?Tl.success():i(e)}),(function(t){return i(e)}))}))})).getOr(Tl.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Al=function(t){return"br"===Yt(t)},Nl=function(t,e,n){return e(t,n).bind((function(t){return ee(t)&&0===Fn(t).trim().length?Nl(t,e,n):m.some(t)}))},Rl=function(t,e,n,o){return function(t,e){return fe(t,e).filter(Al).orThunk((function(){return fe(t,e-1).filter(Al)}))}(e,n).bind((function(e){return o.traverse(e).fold((function(){return Nl(e,o.gather,t).map(o.relative)}),(function(t){return function(t){return ue(t).bind((function(e){var n=le(e);return function(t,e){return P(t,r(Dt,e))}(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return _s.on(t.parent,t.index)}))}))}))},Ml=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},zl=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},Dl=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Bl=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Pl=function(t,e){return m.some(t.getRect(e))},Il=function(t,e,n){return te(e)?Pl(t,e).map(Bl):ee(e)?function(t,e,n){return n>=0&&n<fr(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):m.none()}(t,e,n).map(Bl):m.none()},Ll=function(t,e){return te(e)?Pl(t,e).map(Bl):ee(e)?t.getRangedRect(e,0,e,fr(e)).map(Bl):m.none()},Hl=nr([{none:[]},{retry:["caret"]}]),Fl=function(t,e,n){return(r=e,o=Xa,Se((function(t,e){return e(t)}),ke,r,o,undefined)).fold(c,(function(e){return Ll(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o},Vl={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=Ml(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?Hl.retry(i):n.top===o.bottom?Hl.retry(Ml(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:Ml,gather:Ol},jl=function(t,e,n,r,o){return 0===o?m.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===Yt(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return jl(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(m.none,(function(i){return Ll(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(m.none,(function(r){return jl(t,e,n,r,o-1)}))})).orThunk((function(){return m.some(r)}))}),m.none)}))},Ul=function(t,e,n){var r=t.move(n,5),o=jl(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?m.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?m.some(-t.point(e)):m.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Wl={tryUp:r(Ul,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=zl(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?Hl.retry(i):n.bottom===o.top?Hl.retry(zl(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:zl,gather:kl}),tryDown:r(Ul,Vl),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:e(5)},ql=function(t,e,n){return t.getSelection().bind((function(r){return function(t,e,n,r){return(Al(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Nl(e,n.gather,t)})).map(n.relative)}(t,e,r):Rl(t,e,n,r)).map((function(t){return{start:t,finish:t}}))}(e,r.finish,r.foffset,n).fold((function(){return m.some(Ku(r.finish,r.foffset))}),(function(o){var i,u=t.fromSitus(o);return i=El.verify(t,r.finish,r.foffset,u.finish,u.foffset,n.failure,e),El.cata(i,(function(t){return m.none()}),(function(){return m.none()}),(function(t){return m.some(Ku(t,0))}),(function(t){return m.some(Ku(t,fr(t)))}))}))}))},$l=function(t,e,n,r,o,i){return 0===i?m.none():Kl(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=El.verify(t,n,r,a.finish,a.foffset,o.failure,e);return El.cata(c,(function(){return m.none()}),(function(){return m.some(u)}),(function(u){return Dt(n,u)&&0===r?Gl(t,n,r,zl,o):$l(t,e,u,0,o,i-1)}),(function(u){return Dt(n,u)&&r===fr(u)?Gl(t,n,r,Ml,o):$l(t,e,u,fr(u),o,i-1)}))}))},Gl=function(t,e,n,r,o){return Il(t,e,n).bind((function(e){return Xl(t,o,r(e,Wl.getJumpSize()))}))},Xl=function(t,e,n){var r=At().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):m.none()},Kl=function(t,e,n,r,o){return Il(t,n,r).bind((function(e){return Xl(t,o,e)}))},Yl=function(t,e,n,r,o){return Ee(r,"td,th",e).bind((function(r){return Ee(r,"table",e).bind((function(i){return function(t,e){return ke(t,(function(t){return ue(t).exists((function(t){return Dt(t,e)}))}),void 0).isSome()}(o,i)?function(t,e,n){return ql(t,e,n).bind((function(r){return $l(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Ee(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):m.none()}))}))},Jl=function(t,e,n,r,o,i){return At().browser.isIE()?m.none():i(r,e).orThunk((function(){return Yl(t,e,n,r,o).map((function(t){var e=t.range;return cl(m.some(fl(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Ql=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[0])?function(t,e,n){return xl(Sl,t,(function(t){return hr(t).isSome()}),n)}(n,0,e).map((function(t){var e=fr(t);return cl(m.some(fl(t,e,t,e)),!0)})):m.none()}))}))},Zl=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[r.length-1])?function(t,e,n){return Cl(Sl,t,(function(t){return gr(t).isSome()}),n)}(n,0,e).map((function(t){return cl(m.some(fl(t,0,t,0)),!0)})):m.none()}))}))},tf=function(t,e,n,r,o,i,u){return Yl(t,n,r,o,i).bind((function(t){return dl(e,n,t.start,t.finish,u)}))},ef=function(t,e){return Ee(t,"td,th",e)};var nf={traverse:se,gather:Ol,relative:_s.before,otherRetry:Wl.tryDown,ieRetry:Wl.ieTryDown,failure:El.failedDown},rf={traverse:ce,gather:kl,relative:_s.before,otherRetry:Wl.tryUp,ieRetry:Wl.ieTryUp,failure:El.failedUp},of=function(t){return function(e){return e===t}},uf=of(38),af=of(40),cf=function(t){return t>=37&&t<=40},sf={isBackward:of(37),isForward:of(39)},lf={isBackward:of(39),isForward:of(37)},ff=function(t){return{elementFromPoint:function(e,n){return Rt.fromPoint(Rt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=As.exact(e,n,r,o);return function(t,e){return n=Ps(t,e),r=n.getClientRects(),(o=r.length>0?r[0]:n.getBoundingClientRect()).width>0||o.height>0?m.some(o).map(Ms):m.none();var n,r,o}(t,i)},getSelection:function(){return el(t).map((function(e){return ll(t,e)}))},fromSitus:function(e){var n=As.relative(e.start,e.finish);return ll(t,n)},situsFromPoint:function(e,n){return function(t,e,n){return function(t,e,n){var r=Rt.fromDom(t.document);return Us(r,e,n).map((function(t){return Os(Rt.fromDom(t.startContainer),t.startOffset,Rt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)}(t,e,n).map((function(t){return sl(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){Gs(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),el(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Qs(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;Js(t,u,a,u,a)}))}))},setSelection:function(e){Js(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Qs(t,e,n)},selectContents:function(e){!function(t,e){var n=function(t,e){var n=t.document.createRange();return function(t,e){t.selectNodeContents(e.dom)}(n,e),n}(t,e);Xs(t,n)}(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Rt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,eo(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Rt.fromDom(t.document))}}},df=function(t,e){return{rows:t,cols:e}},mf=function(t){return!1===Pi(Rt.fromDom(t.target),"ephox-snooker-resizer-bar")};function gf(e,n,o){var i=function(t,e,n){var r=function(e){De(e,t.selected),De(e,t.firstSelected),De(e,t.lastSelected)},o=function(e){Ne(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=Ce(e,t.selectedSelector);R(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),R(r,o),Ne(u,t.firstSelected,"1"),Ne(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}}(zr,(function(n,r,i){o.targets().each((function(o){nn(r).each((function(u){var a=ku(e),c=_r(t,Rt.fromDom(e.getDoc()),a),s=function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1);return{upOrLeftCells:function(t,e,n){var r=t.slice(0,e[e.length-1].row+1),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return N(n,(function(t){return t.element}))}))}(e,t,n),downOrRightCells:function(t,e,n){var r=t.slice(e[0].row+e[0].rowspan-1,t.length),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return N(n,(function(t){return t.element}))}))}(e,t,n)}}))}(u,o,c);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(e,n,r,i,s)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(e)}));return e.on("init",(function(o){var u=e.getWin(),a=Tu(e),c=Au(e),s=function(t,e,n,r){var o=function(t,e,n,r){var o,i=(o=Bu(m.none()),{clear:function(){return o.set(m.none())},set:function(t){return o.set(m.some(t))},isSet:function(){return o.get().isSome()},on:function(t){return o.get().each(t)}}),u=i.clear;return{clearstate:u,mousedown:function(t){r.clear(e),ef(t.target,n).each(i.set)},mouseover:function(o){i.on((function(i){r.clearBeforeUpdate(e),ef(o.target,n).each((function(o){Yn(i,o,n).each((function(n){var u=n.boxes.getOr([]);(u.length>1||1===u.length&&!Dt(i,o))&&(r.selectRange(e,u,n.start,n.finish),t.selectContents(o))}))}))}))},mouseup:function(t){u()}}}(ff(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}}(u,a,c,i),l=function(t,e,n,o){var i=ff(t),u=function(){return o.clear(e),m.none()};return{keydown:function(t,a,c,s,l,f){var d=t.raw,g=d.which,h=!0===d.shiftKey;return Jn(e,o.selectedSelector).fold((function(){return af(g)&&h?r(tf,i,e,n,nf,s,a,o.selectRange):uf(g)&&h?r(tf,i,e,n,rf,s,a,o.selectRange):af(g)?r(Jl,i,n,nf,s,a,Zl):uf(g)?r(Jl,i,n,rf,s,a,Ql):m.none}),(function(t){var n=function(n){return function(){return U(n,(function(n){return function(t,e,n,r,o){return Zn(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,o)})).fold((function(){return Qn(e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){var n=af(g)||f.isForward(g)?_s.after:_s.before;return i.setRelativeSelection(_s.on(t.first,0),n(t.table)),o.clear(e),cl(m.none(),!0)}))}),(function(t){return m.some(cl(m.none(),!0))}))}};return af(g)&&h?n([df(1,0)]):uf(g)&&h?n([df(-1,0)]):f.isBackward(g)&&h?n([df(0,-1),df(-1,0)]):f.isForward(g)&&h?n([df(0,1),df(1,0)]):cf(g)&&!1===h?u:m.none}))()},keyup:function(t,r,i,u,a){return Jn(e,o.selectedSelector).fold((function(){var c=t.raw,s=c.which;return 0==(!0===c.shiftKey)?m.none():cf(s)?function(t,e,n,r,o,i,u){return Dt(n,o)&&r===i?m.none():Ee(n,"td,th",e).bind((function(n){return Ee(o,"td,th",e).bind((function(r){return dl(t,e,n,r,u)}))}))}(e,n,r,i,u,a,o.selectRange):m.none()}),m.none)}}}(u,a,c,i),f=function(t,e,n,r){var o=ff(t);return function(t,i){r.clearBeforeUpdate(e),Yn(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(u,a,c,i);e.on("TableSelectorChange",(function(t){return f(t.start,t.finish)}));var d,g,h=function(t,n){(function(t){return!0===t.raw.shiftKey})(t)&&(n.kill&&t.kill(),n.selection.each((function(t){var n=As.relative(t.start,t.finish),r=Ps(u,n);e.selection.setRng(r)})))},p=function(t){return 0===t.button},v=(d=Bu(Rt.fromDom(a)),g=Bu(0),{touchEnd:function(t){var e=Rt.fromDom(t.target);if("td"===Yt(e)||"th"===Yt(e)){var n=d.get(),r=g.get();Dt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),f(e,e))}d.set(e),g.set(t.timeStamp)}});e.on("dragstart",(function(t){s.clearstate()})),e.on("mousedown",(function(t){p(t)&&mf(t)&&s.mousedown(Mi(t))})),e.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||ms.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&mf(t)&&s.mouseover(Mi(t))})),e.on("mouseup",(function(t){p(t)&&mf(t)&&s.mouseup(Mi(t))})),e.on("touchend",v.touchEnd),e.on("keyup",(function(t){var n=Mi(t);if(n.raw.shiftKey&&cf(n.raw.which)){var r=e.selection.getRng(),o=Rt.fromDom(r.startContainer),i=Rt.fromDom(r.endContainer);l.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){h(n,t)}))}})),e.on("keydown",(function(t){var r=Mi(t);n().each((function(t){return t.hideBars()}));var o=e.selection.getRng(),i=Rt.fromDom(o.startContainer),u=Rt.fromDom(o.endContainer),a=Kr(sf,lf)(Rt.fromDom(e.selection.getStart()));l.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){h(r,t)})),n().each((function(t){return t.showBars()}))})),e.on("NodeChange",(function(){var n=e.selection,r=Rt.fromDom(n.getStart()),o=Rt.fromDom(n.getEnd());Xn(nn,[r,o]).fold((function(){return i.clear(a)}),t)}))})),{clear:i.clear}}cr.add("table",(function(e){var n,r=(n=zr.selectedSelector,{get:function(){return tr(Tu(e),n).fold((function(){return Mc(Du(e)).map(ar).getOrThunk(ir)}),(function(t){return ur(t)}))}}),o=function(t,e){var n=Bu(m.none()),r=Bu([]),o=function(){return Mc(Du(t)).bind((function(t){return nn(t).map((function(n){return"caption"===Yt(t)?Dr(t):Br(e,n,t)}))}))},i=function(){n.set($(o)()),R(r.get(),(function(t){return t()}))},u=function(t,e){var o=function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))};return o(),r.set(r.get().concat([o])),function(){r.set(M(r.get(),(function(t){return t!==o})))}};return t.on("NodeChange ExecCommand TableSelectorChange",i),{onSetupTable:function(t){return u(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return u(t,(function(t){return"caption"===Yt(t.element)}))},onSetupPasteable:function(t){return function(e){return u(e,(function(e){return"caption"===Yt(e.element)||t().isNone()}))}},onSetupMergeable:function(t){return u(t,(function(t){return t.mergable.isNone()}))},onSetupUnmergeable:function(t){return u(t,(function(t){return t.unmergable.isNone()}))},resetTargets:i,targets:function(){return n.get()}}}(e,r),i=Xu(e),u=gf(e,i.lazyResize,o),a=function(e,n,r){var o=function(t){return"table"===Yt(Tu(t))},i=ku(e),u=function(t,n,r,o){return function(u,a){Ru(u);var c=o(),s=Rt.fromDom(e.getDoc()),l=_r(r,s,i),f=Vu(e,u);return n(u)?t(c,u,a,l,f).bind((function(t){return R(t.newRows,(function(t){ru(e,t.dom)})),R(t.newCells,(function(t){ou(e,t.dom)})),t.cursor.map((function(t){var n=Zu(ta,t),r=e.dom.createRng();return r.setStart(n.element.dom,n.offset),r.setEnd(n.element.dom,n.offset),r}))})):m.none()}},a=u(dc,(function(t){return!1===o(e)||bi(t).rows>1}),t,n),c=u(fc,(function(t){return!1===o(e)||bi(t).columns>1}),t,n),l=u(ac,s,t,n),f=u(cc,s,t,n),d=u(sc,s,ea,n),g=u(lc,s,ea,n),h=u(hc,s,t,n),p=u(pc,s,t,n),v=u(bc,s,t,n),b=u(yc,s,t,n),y=u(wc,s,t,n),w=u(xc,s,t,n),x=u(vc,s,t,n),C=function(t,e){return Ut(t,"type").filter((function(t){return _(e,t)}))};return{deleteRow:a,deleteColumn:c,insertRowsBefore:l,insertRowsAfter:f,insertColumnsBefore:d,insertColumnsAfter:g,mergeCells:h,unmergeCells:p,pasteColsBefore:v,pasteColsAfter:b,pasteRowsBefore:y,pasteRowsAfter:w,pasteCells:x,setTableCellType:function(t,e){return C(e,["td","th"]).each((function(e){var n=N(zc(Du(t),r),(function(t){return t.dom}));Ec(t,n,e,null)}))},setTableRowType:function(t,e){return C(e,["header","body","footer"]).each((function(e){N(Dc(Du(t),zr.selected),(function(n){return Ac(t,n.dom,e)}))}))},makeColumnsHeader:u(mc,s,t,n),unmakeColumnsHeader:u(gc,s,t,n),getTableRowType:function(t){var e=Dc(Du(t),zr.selected);if(e.length>0){var n=N(e,(function(t){return Oc(0,t.dom)})),r=_(n,"header"),o=_(n,"footer");if(r||o){var i=_(n,"body");return!r||i||o?r||i||!o?"":"footer":"header"}return"body"}},getTableCellType:function(t){return ic(zc(Du(t),r),(function(t){return"th"===Yt(t)})).getOr("")},getTableColType:Cc}}(e,i.lazyWire,r),c=function(){var t=Bu(m.none()),e=Bu(m.none()),n=function(t){t.set(m.none())};return{getRows:t.get,setRows:function(r){t.set(r),n(e)},clearRows:function(){return n(t)},getColumns:e.get,setColumns:function(r){e.set(r),n(t)},clearColumns:function(){return n(e)}}}();return ws(e,a,u,r,c),function(t,e,n){var r=Au(t);Ht({mceTableRowType:function(){return e.getTableRowType(t)},mceTableCellType:function(){return e.getTableCellType(t)},mceTableColType:function(){return Rc(Du(t)).bind((function(t){return function(t){return nn(t,r)}(t).map((function(r){var o=Br(n,r,t);return e.getTableColType(r,o)}))})).getOr("")}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(e,a,r),function(e,n,r,o){e.on("BeforeGetContent",(function(r){!0===r.selection&&or(n.get(),t,(function(t){r.preventDefault(),function(t){return nn(t[0]).map(yr).map((function(t){return[lr(t,"[data-mce-selected]")]}))}(t).each((function(t){r.content="text"===r.format?function(t){return N(t,(function(t){return t.dom.innerText})).join("")}(t):function(t,e){return N(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(e,t)}))}),t)})),e.on("BeforeSetContent",(function(t){!0===t.selection&&!0===t.paste&&m.from(e.dom.getParent(e.selection.getStart(),"th,td")).each((function(n){var i=Rt.fromDom(n);nn(i).each((function(n){var u,a,c,s=M((u=t.content,(a=document.createElement("div")).innerHTML=u,le(Rt.fromDom(a))),(function(t){return"meta"!==Yt(t)}));if(1===s.length&&(c=s[0],"table"===Yt(c))){t.preventDefault();var l=Rt.fromDom(e.getDoc()),f=Er(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(i,s[0],f);r.pasteCells(n,d).each((function(t){e.selection.setRng(t),e.focus(),o.clear(n)}))}}))}))}))}(e,r,a,u),function(t,e,n){var r=function(e){return function(){return t.execCommand(e)}},o=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},i={text:"Table properties",onSetup:e.onSetupTable,onAction:r("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:r("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:e.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}),!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",i),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}}),t.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter"}}),t.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}}),t.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold((function(){return""}),(function(t){return"caption"===Yt(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}})}(e,o,c),function(t,e,n){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})}(e,o,c),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(e),e.on("PreInit",(function(){e.serializer.addTempAttr(zr.firstSelected),e.serializer.addTempAttr(zr.lastSelected),function(t){t.formatter.register(xs)}(e)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(e)&&e.on("keydown",(function(t){!function(t,e,n){if(t.keyCode===nl.TAB){var r=Tu(e),o=function(t){var e=Yt(t);return Dt(t,r)||_(al,e)},i=e.selection.getRng();if(i.collapsed){var u=Rt.fromDom(i.startContainer);Ze(u,o).each((function(r){t.preventDefault(),(t.shiftKey?ol:rl)(e,o,r,n).each((function(t){e.selection.setRng(t)}))}))}}}(t,e,a)})),e.on("remove",(function(){i.destroy()})),function(t,e,n,r){return{insertTable:jc(t),setClipboardRows:Vc(e.setRows),getClipboardRows:Fc(e.getRows),setClipboardCols:Vc(e.setColumns),getClipboardCols:Fc(e.getColumns),resizeHandler:n,selectionTargets:r}}(e,c,i,o)}))}()},397:(t,e,n)=>{n(2738)},2738:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(){},u=function(t){return function(){return t}},a=function(t){return t},c=u(!1),s=u(!0),l=function(){return f},f=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:l,each:i,bind:l,exists:c,forall:s,filter:l,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),d=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=g("string"),p=g("object"),v=g("array"),b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(t,e){return n=t,r=e,y.call(n,r)>-1;var n,r},x=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},C=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},S=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},k=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},O=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},T=Object.keys,_=Object.hasOwnProperty,E=(function(t){if(!v(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};C(t,(function(r,o){var i=T(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!v(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=T(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!O(e,(function(t){return w(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}}))}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var e=[],n=[];return C(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}),A=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:u(t),getOrThunk:u(t),getOrDie:u(t),or:function(e){return A(t)},orThunk:function(e){return A(t)},fold:function(e,n){return n(t)},map:function(e){return A(e(t))},mapError:function(e){return A(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},N=function(t){return{is:c,isValue:c,isError:s,getOr:a,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return N(t)},mapError:function(e){return N(e(t))},each:i,bind:function(e){return N(t)},exists:c,forall:s,toOptional:m.none}},R={value:A,error:N,fromOption:function(t,e){return t.fold((function(){return N(e)}),A)}},M=function(t){return"inline-command"===t.type||"inline-format"===t.type},z=function(t){return"block-command"===t.type||"block-format"===t.type},D=function(t){return e=t,n=function(t,e){return t.start.length===e.start.length?0:t.start.length>e.start.length?-1:1},(r=b.call(e,0)).sort(n),r;var e,n,r},B=function(t){var e=function(e){return R.error({message:e,pattern:t})},n=function(n,r,o){if(void 0!==t.format){var i=void 0;if(v(t.format)){if(!O(t.format,h))return e(n+" pattern has non-string items in the `format` array");i=t.format}else{if(!h(t.format))return e(n+" pattern has non-string `format` parameter");i=[t.format]}return R.value(r(i))}return void 0!==t.cmd?h(t.cmd)?R.value(o(t.cmd,t.value)):e(n+" pattern has non-string `cmd` parameter"):e(n+" pattern is missing both `format` and `cmd` parameters")};if(!p(t))return e("Raw pattern is not an object");if(!h(t.start))return e("Raw pattern is missing `start` parameter");if(void 0!==t.end){if(!h(t.end))return e("Inline pattern has non-string `end` parameter");if(0===t.start.length&&0===t.end.length)return e("Inline pattern has empty `start` and `end` parameters");var r=t.start,o=t.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(t){return{type:"inline-format",start:r,end:o,format:t}}),(function(t,e){return{type:"inline-command",start:r,end:o,cmd:t,value:e}}))}return void 0!==t.replacement?h(t.replacement)?0===t.start.length?e("Replacement pattern has empty `start` parameter"):R.value({type:"inline-command",start:"",end:t.start,cmd:"mceInsertContent",value:t.replacement}):e("Replacement pattern has non-string `replacement` parameter"):0===t.start.length?e("Block pattern has empty `start` parameter"):n("Block",(function(e){return{type:"block-format",start:t.start,format:e[0]}}),(function(e,n){return{type:"block-command",start:t.start,cmd:e,value:n}}))},P=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},I=function(t){return{inlinePatterns:S(t,M),blockPatterns:D(S(t,z))}},L="undefined"!=typeof window?window:Function("return this;")(),H=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=L.console;n&&(n.error?n.error.apply(n,t):n.log.apply(n,t))},F=[{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"}],V=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},j=tinymce.util.Tools.resolve("tinymce.util.Delay"),U=tinymce.util.Tools.resolve("tinymce.util.VK"),W=tinymce.util.Tools.resolve("tinymce.util.Tools"),q=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),G=function(t,e){return{container:t,offset:e}},X=function(t){return t.nodeType===Node.TEXT_NODE},K=function(t,e,n){if(e&&t.isEmpty(e)&&!n(e)){var r=e.parentNode;t.remove(e),K(t,r,n)}},Y=function(t,e,n,r){void 0===r&&(r=!0);var o=e.startContainer.parentNode,i=e.endContainer.parentNode;e.deleteContents(),r&&!n(e.startContainer)&&(X(e.startContainer)&&0===e.startContainer.data.length&&t.remove(e.startContainer),X(e.endContainer)&&0===e.endContainer.data.length&&t.remove(e.endContainer),K(t,o,n),o!==i&&K(t,i,n))},J=function(t,e){var n,r=e.get(t);return v(r)&&(n=r,function(t,e){return 0<t.length?m.some(t[0]):m.none()}(n)).exists((function(t){return e=t,"block",_.call(e,"block");var e}))},Q=function(t){return 0===t.start.length},Z=function(t,e){var n=m.from(t.dom.getParent(e.startContainer,t.dom.isBlock));return""===V(t)?n.orThunk((function(){return m.some(t.getBody())})):n},tt=q.DOM,et=function(t){return function(e){return t===e?-1:0}},nt=function(t,e,n){if(X(t)&&e>=0)return m.some(G(t,e));var r=$(tt);return m.from(r.backwards(t,e,et(t),n)).map((function(t){return G(t.container,t.container.data.length)}))},rt=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e>=0&&e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.backwards(t,e,et(t),n)).bind((function(t){var r=t.container.data;return rt(t.container,e+r.length,n)}))},ot=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.forwards(t,e,et(t),n)).bind((function(t){return ot(t.container,e-r.length,n)}))},it=function(t,e,n){if(X(e)&&(n<0||n>e.data.length))return[];for(var r=[n],o=e;o!==t&&o.parentNode;){for(var i=o.parentNode,u=0;u<i.childNodes.length;u++)if(i.childNodes[u]===o){r.push(u);break}o=i}return o===t?r.reverse():[]},ut=function(t,e,n,r,o){return{start:it(t,e,n),end:it(t,r,o)}},at=function(t,e){var n,r,o,i=e.slice(),u=i.pop();return(n=i,r=function(t,e){return t.bind((function(t){return m.from(t.childNodes[e])}))},o=m.some(t),C(n,(function(t){o=r(o,t)})),o).bind((function(t){return X(t)&&(u<0||u>t.data.length)?m.none():m.some({node:t,offset:u})}))},ct=function(t,e){return at(t,e.start).bind((function(n){var r=n.node,o=n.offset;return at(t,e.end).map((function(t){var e=t.node,n=t.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(e,n),i}))}))},st=function(t,e,n){(function(t,e,n){if(X(t)&&0>=t.length)return m.some(G(t,0));var r=$(tt);return m.from(r.forwards(t,0,et(t),n)).map((function(t){return G(t.container,0)}))})(e,0,e).each((function(r){var o=r.container;ot(o,n.start.length,e).each((function(n){var r=t.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Y(t,r,(function(t){return t===e}))}))}))},lt=function(t,e){var n=t.dom,r=t.selection.getRng();return Z(t,r).filter((function(e){var r=V(t),o=""===r&&n.is(e,"body")||n.is(e,r);return null!==e&&o})).bind((function(t){var r=t.textContent;return function(t,e){var n=e.replace(" "," ");return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,(function(t){return 0===e.indexOf(t.start)||0===n.indexOf(t.start)}),c)}(e,r).map((function(e){return W.trim(r).length===e.start.length?[]:[{pattern:e,range:ut(n.getRoot(),t,0,t,0)}]}))})).getOr([])},ft=0,dt=function(t,e){return t.create("span",{"data-mce-type":"bookmark",id:e})},mt=function(t,e){var n=t.createRng();return n.setStartAfter(e.start),n.setEndBefore(e.end),n},gt=function(t,e,n){var r=ct(t.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,u=0===r.endOffset?i:i.splitText(r.endOffset),a=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:e,end:u.parentNode.insertBefore(dt(t,e+"-end"),u),start:a.parentNode.insertBefore(dt(t,e+"-start"),a)}},ht=function(t,e,n){K(t,t.get(e.prefix+"-end"),n),K(t,t.get(e.prefix+"-start"),n)},pt=function(t,e,n,r){var o,i=e.start;return function(t,e,n,r,o){var i=$(t,function(t){return function(e){return t.isBlock(e)||w(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}}(t));return m.from(i.backwards(e,n,r,o))}(t,r.container,r.offset,(o=i,function(t,e){var n=t.data.substring(0,e),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=t.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),m.some(o)}var u=r.offset-i.length;return rt(r.container,u,n).map((function(e){var n=t.createRng();return n.setStart(e.container,e.offset),n.setEnd(r.container,r.offset),n})).filter((function(t){return t.toString()===i})).orThunk((function(){return pt(t,e,n,G(r.container,0))}))}))},vt=function(t,e,n){var r=t.dom,o=r.getRoot(),i=n.pattern,u=n.position.container,a=n.position.offset;return rt(u,a-n.pattern.end.length,e).bind((function(c){var s=ut(o,c.container,c.offset,u,a);if(Q(i))return m.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=bt(t,n.remainingPatterns,c.container,c.offset,e),f=l.getOr({matches:[],position:c}),d=f.position;return function(t,e,n,r,o,i){if(void 0===i&&(i=!1),0===e.start.length&&!i){var u=t.createRng();return u.setStart(n,r),u.setEnd(n,r),m.some(u)}return nt(n,r,o).bind((function(n){return pt(t,e,o,n).bind((function(t){if(i){if(t.endContainer===n.container&&t.endOffset===n.offset)return m.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return m.none()}return m.some(t)}))}))}(r,i,d.container,d.offset,e,l.isNone()).map((function(t){var e=function(t,e){return ut(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}(o,t);return{matches:f.matches.concat([{pattern:i,startRng:e,endRng:s}]),position:G(t.startContainer,t.startOffset)}}))}))},bt=function(t,e,n,r,o){var i=t.dom;return nt(n,r,i.getRoot()).bind((function(u){var a=i.createRng();a.setStart(o,0),a.setEnd(n,r);for(var c,s,l=a.toString(),f=0;f<e.length;f++){var d=e[f];if(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(c=l,s=d.end,c.length-s.length)){var g=e.slice();g.splice(f,1);var h=vt(t,o,{pattern:d,remainingPatterns:g,position:u});if(h.isSome())return h}}return m.none()}))},yt=function(t,e,n){t.selection.setRng(n),"inline-format"===e.type?C(e.format,(function(e){t.formatter.apply(e)})):t.execCommand(e.cmd,!1,e.value)},wt=function(t,e,n){var r=t.selection.getRng();return!1===r.collapsed?[]:Z(t,r).bind((function(o){var i=r.startOffset-(n?1:0);return bt(t,e,r.startContainer,i,o)})).fold((function(){return[]}),(function(t){return t.matches}))},xt=function(t,e){if(0!==e.length){var n=t.dom,r=t.selection.getBookmark(),i=function(t,e){var n,r=(n=(new Date).getTime(),"mce_textpattern_"+Math.floor(1e9*Math.random())+ ++ft+String(n)),i=k(e,(function(e,n){var i=gt(t,r+"_end"+e.length,n.endRng);return e.concat([o(o({},n),{endMarker:i})])}),[]);return k(i,(function(e,n){var u=i.length-e.length-1,a=Q(n.pattern)?n.endMarker:gt(t,r+"_start"+u,n.startRng);return e.concat([o(o({},n),{startMarker:a})])}),[])}(n,e);C(i,(function(e){var r=n.getParent(e.startMarker.start,n.isBlock),o=function(t){return t===r};Q(e.pattern)?function(t,e,n,r){var o=mt(t.dom,n);Y(t.dom,o,r),yt(t,e,o)}(t,e.pattern,e.endMarker,o):function(t,e,n,r,o){var i=t.dom,u=mt(i,r),a=mt(i,n);Y(i,a,o),Y(i,u,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=mt(i,c);yt(t,e,s)}(t,e.pattern,e.startMarker,e.endMarker,o),ht(n,e.endMarker,o),ht(n,e.startMarker,o)})),t.selection.moveToBookmark(r)}},Ct=function(t,e){var n=wt(t,e.inlinePatterns,!0);n.length>0&&t.undoManager.transact((function(){xt(t,n)}))},St=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0},kt=function(t,e){var n=[",",".",";",":","!","?"],r=[32];t.on("keydown",(function(n){13!==n.keyCode||U.modifierPressed(n)||function(t,e){if(!t.selection.isCollapsed())return!1;var n=wt(t,e.inlinePatterns,!1),r=lt(t,e.blockPatterns);return(r.length>0||n.length>0)&&(t.undoManager.add(),t.undoManager.extra((function(){t.execCommand("mceInsertNewLine")}),(function(){t.insertContent("\ufeff"),xt(t,n),function(t,e){if(0!==e.length){var n=t.selection.getBookmark();C(e,(function(e){return function(t,e){var n=t.dom,r=e.pattern,o=ct(n.getRoot(),e.range).getOrDie("Unable to resolve path range");return Z(t,o).each((function(e){"block-format"===r.type?J(r.format,t.formatter)&&t.undoManager.transact((function(){st(t.dom,e,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((function(){st(t.dom,e,r),t.execCommand(r.cmd,!1,r.value)}))})),!0}(t,e)})),t.selection.moveToBookmark(n)}}(t,r);var e=t.selection.getRng(),o=nt(e.startContainer,e.startOffset,t.dom.getRoot());t.execCommand("mceInsertNewLine"),o.each((function(e){var n=e.container;"\ufeff"===n.data.charAt(e.offset-1)&&(n.deleteData(e.offset-1,1),K(t.dom,n.parentNode,(function(e){return e===t.dom.getRoot()})))}))})),!0)}(t,e.get())&&n.preventDefault()}),!0),t.on("keyup",(function(n){St(r,n,(function(t,e){return t===e.keyCode&&!1===U.modifierPressed(e)}))&&Ct(t,e.get())})),t.on("keypress",(function(r){St(n,r,(function(t,e){return t.charCodeAt(0)===e.charCode}))&&j.setEditorTimeout(t,(function(){Ct(t,e.get())}))}))};r.add("textpattern",(function(t){var e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(function(t){var e=t.getParam("textpattern_patterns",F,"array");if(!v(e))return H("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=E(x(e,B));return C(n.errors,(function(t){return H(t.message,t.pattern)})),I(n.values)}(t));return kt(t,e),function(t){return{setPatterns:function(e){var n=E(x(e,B));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}t.set(I(n.values))},getPatterns:function(){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}(x(t.get().inlinePatterns,P),x(t.get().blockPatterns,P))}}}(e)}))}()},3356:(t,e,n)=>{n(3562)},3562:()=>{!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp("[-'\\.‘’․﹒'.]"),new RegExp("[:··״‧︓﹕:]"),new RegExp("[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]"),new RegExp("[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]"),new RegExp("\\r"),new RegExp("\\n"),new RegExp("[\v\f \u2028\u2029]"),new RegExp("[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]"),new RegExp("[-឴឵---\ufeff-]"),new RegExp("[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]"),new RegExp("[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]"),new RegExp("@")],i=new RegExp("^[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]$"),u=o,a=function(t){for(var e=13,n=u.length,r=0;r<n;++r){var o=u[r];if(o&&o.test(t)){e=r;break}}return e},c=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(0===n&&0===r)return!1;var o=t[e+2];if(0===n&&(2===r||1===r||12===r)&&0===o)return!1;var i=t[e-1];return(2!==n&&1!==n&&12!==r||0!==r||0!==i)&&(4!==n&&0!==n||4!==r&&0!==r)&&(3!==n&&1!==n||4!==r||4!==i)&&(4!==n||3!==r&&1!==r||4!==o)&&8!==n&&9!==n&&8!==i&&9!==i&&8!==r&&9!==r&&(5!==n||6!==r)&&(7===n||5===n||6===n||7===r||5===r||6===r||(10!==n||10!==r)&&(11!==r||0!==n&&4!==n&&10!==n&&11!==n)&&(11!==n||0!==r&&4!==r&&10!==r)&&12!==n)},s=/^\s+$/,l=i,f=function(t){return"http"===t||"https"===t},d=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],u=0;u<t.length;u++){var d=e(t[u]);"\ufeff"!==d&&(o.push(t[u]),i.push(d))}return function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),c(n,u)){var a=e[u];if((r.includeWhitespace||!s.test(a))&&(r.includePunctuation||!l.test(a))){var d=u-i.length+1,m=u+1,g=e.slice(d,m).join("");if(f(g)){var h=(y=void 0,y=function(t,e){var n;for(n=e;n<t.length&&!s.test(t[n]);n++);return n}(v=e,(b=u)+1),"://"===v.slice(b+1,y).join("").substr(0,3)?y:b),p=t.slice(m,h);Array.prototype.push.apply(i,p),u=h}o.push(i)}i=[]}var v,b,y;return o}(o,i,function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(i,(m=a,g={},function(t){if(g[t])return g[t];var e=m(t);return g[t]=e,e})),n);var m,g},m=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),g=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],u="",a=new m(t,t);t=a.next();)3===t.nodeType?u+=t.data.replace(/\uFEFF/g,""):o(t)&&u.length&&(i.push(u),u="");return u.length&&i.push(u),i},h=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},p=function(t,e){var r=g(t,e).join("\n");return d(r.split(""),n).length},v=function(t,e){var n=g(t,e).join("");return h(n)},b=function(t,e){var n=g(t,e).join("").replace(/\s/g,"");return h(n)},y=function(t,e){return function(){return e(t.getBody(),t.schema)}},w=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},x=function(t){return y(t,p)},C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)},k=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};void 0===t&&(t=300),e.add("wordcount",(function(e){var n=function(t){return{body:{getWordCount:x(t),getCharacterCount:y(t,v),getCharacterCountWithoutSpaces:y(t,b)},selection:{getWordCount:w(t,p),getCharacterCount:w(t,v),getCharacterCountWithoutSpaces:w(t,b)},getCount:x(t)}}(e);return function(t,e){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return k(t,e)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return k(t,e)}})}(e,n),function(t,e,n){var r=C.debounce((function(){return S(t,e)}),n);t.on("init",(function(){S(t,e),C.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)}),0)}))}(e,n,t),n}))}()},5187:(t,e,n)=>{var r={"./content/dark/content.css":2968,"./content/dark/content.min.css":6202,"./content/default/content.css":7286,"./content/default/content.min.css":7362,"./content/document/content.css":287,"./content/document/content.min.css":2271,"./content/writer/content.css":5417,"./content/writer/content.min.css":874,"./ui/oxide-dark/content.css":3341,"./ui/oxide-dark/content.inline.css":8786,"./ui/oxide-dark/content.inline.min.css":4243,"./ui/oxide-dark/content.min.css":9702,"./ui/oxide-dark/content.mobile.css":1389,"./ui/oxide-dark/content.mobile.min.css":3513,"./ui/oxide-dark/fonts/tinymce-mobile.woff":1064,"./ui/oxide-dark/skin.css":8057,"./ui/oxide-dark/skin.min.css":6332,"./ui/oxide-dark/skin.mobile.css":4429,"./ui/oxide-dark/skin.mobile.min.css":18,"./ui/oxide-dark/skin.shadowdom.css":7899,"./ui/oxide-dark/skin.shadowdom.min.css":7548,"./ui/oxide/content.css":9506,"./ui/oxide/content.inline.css":8273,"./ui/oxide/content.inline.min.css":7251,"./ui/oxide/content.min.css":6122,"./ui/oxide/content.mobile.css":993,"./ui/oxide/content.mobile.min.css":8215,"./ui/oxide/fonts/tinymce-mobile.woff":9916,"./ui/oxide/skin.css":8382,"./ui/oxide/skin.min.css":4522,"./ui/oxide/skin.mobile.css":108,"./ui/oxide/skin.mobile.min.css":8537,"./ui/oxide/skin.shadowdom.css":818,"./ui/oxide/skin.shadowdom.min.css":6913};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=5187},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(){},e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},r=function(t){return function(){return t}},o=function(t){return t};function i(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var u=function(t){return function(e){return!t(e)}},a=function(t){return function(){throw new Error(t)}},c=r(!1),s=r(!0),l=tinymce.util.Tools.resolve("tinymce.ThemeManager"),f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var g,h,p,v,b=function(){return y},y=(h=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:v=function(t){return t},getOrThunk:p=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:v,orThunk:p,map:b,each:t,bind:b,exists:c,forall:s,filter:b,equals:h,equals_:h,toArray:function(){return[]},toString:r("none()")}),w=function(t){var e=r(t),n=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=C("string"),O=C("object"),T=C("array"),_=S("boolean"),E=function(t){return void 0===t},A=function(t){return!function(t){return null==t}(t)},N=S("function"),R=S("number"),M=function(t,e){if(T(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},z=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,P=function(t,e){return D.call(t,e)},I=function(t,e){return P(t,e)>-1},L=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},H=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},F=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=z.call(t,r,r+e);n.push(o)}return n},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,c)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!T(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},Y=function(t,e){return K(V(t,e))},J=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},Q=function(t){var e=z.call(t,0);return e.reverse(),e},Z=function(t,e){return W(t,(function(t){return!I(e,t)}))},tt=function(t,e){var n=z.call(t,0);return n.sort(e),n},et=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},nt=function(t){return et(t,0)},rt=function(t){return et(t,t.length-1)},ot=N(Array.from)?Array.from:function(t){return z.call(t)},it=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},ut=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:r(t),getOrThunk:r(t),getOrDie:r(t),or:function(e){return ut(t)},orThunk:function(e){return ut(t)},fold:function(e,n){return n(t)},map:function(e){return ut(e(t))},mapError:function(e){return ut(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},at=function(e){return{is:c,isValue:c,isError:s,getOr:o,getOrThunk:function(t){return t()},getOrDie:function(){return a(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return at(e)},mapError:function(t){return at(t(e))},each:t,bind:function(t){return at(e)},exists:c,forall:s,toOptional:x.none}},ct={value:ut,error:at,fromOption:function(t,e){return t.fold((function(){return at(e)}),ut)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(g||(g={}));var st=function(t,e,n){return t.stype===g.Error?e(t.serror):n(t.svalue)},lt=function(t){return{stype:g.Value,svalue:t}},ft=function(t){return{stype:g.Error,serror:t}},dt=lt,mt=function(t){var e=[],n=[];return j(t,(function(t){st(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},gt=ft,ht=function(t,e){return t.stype===g.Value?e(t.svalue):t},pt=function(t,e){return t.stype===g.Value?{stype:g.Value,svalue:e(t.svalue)}:t},vt=Object.keys,bt=Object.hasOwnProperty,yt=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},wt=function(t,e){return xt(t,(function(t,n){return{k:n,v:e(t,n)}}))},xt=function(t,e){var n={};return yt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ct=function(t,e){var n=[];return yt(t,(function(t,r){n.push(e(t,r))})),n},St=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return x.some(u)}return x.none()},kt=function(t){return Ct(t,(function(t){return t}))},Ot=function(t,e){return Tt(t,e)?x.from(t[e]):x.none()},Tt=function(t,e){return bt.call(t,e)},_t=function(t,e){return Tt(t,e)&&void 0!==t[e]&&null!==t[e]},Et=function(t){if(!T(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=vt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!T(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=vt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!J(e,(function(t){return I(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},At=Object.prototype.hasOwnProperty,Nt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)At.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Rt=Nt((function(t,e){return O(t)&&O(e)?Rt(t,e):e})),Mt=Nt((function(t,e){return e})),zt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Dt=Et([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Bt=function(t){return Dt.defaultedThunk(r(t))},Pt=Dt.strict,It=Dt.asOption,Lt=Dt.defaultedThunk,Ht=(Dt.asDefaultedOptionThunk,Dt.mergeWithThunk),Ft=(Et([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){var n;return(n={})[t]=e,n}),Vt=function(t,e){return Ft(t,e)},jt=function(t){return function(t){var e={};return j(t,(function(t){e[t.key]=t.value})),e}(t)},Ut=function(t){return e(gt,K)(t)},Wt=function(t){var e=mt(t);return e.errors.length>0?Ut(e.errors):dt(e.values)},qt=function(t){return O(t)&&vt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},$t=function(t,e){return gt([{path:t,getErrorInfo:e}])},Gt=Et([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Xt=function(t,e,n){var r=Ot(t,e).fold((function(){return n(t)}),o);return dt(r)},Kt=function(t,e,n,o){return n.fold((function(n,i,u,a){var c=function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(t))}))},s=function(e){return e.fold((function(){var t=Ft(i,o(x.none()));return dt(t)}),(function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(x.some(t)))}))}))};return u.fold((function(){return ht(function(t,e,n){return Ot(e,n).fold((function(){return function(t,e,n){return $t(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+qt(n)}))}(t,n,e)}),dt)}(t,e,n),c)}),(function(t){return ht(Xt(e,n,t),c)}),(function(){return ht(function(t,e){return dt(Ot(t,e))}(e,n),s)}),(function(t){return ht(function(t,e,n){var r=Ot(t,e).map((function(e){return!0===e?n(t):e}));return dt(r)}(e,n,t),s)}),(function(t){var o=t(e),i=pt(Xt(e,n,r({})),(function(t){return Rt(o,t)}));return ht(i,c)}))}),(function(t,n){var r=n(e);return dt(Ft(t,o(r)))}))},Yt=function(t){return{extract:function(e,n,r){return o=t(r,n),i=function(t){return function(t,e){return $t(t,(function(){return e}))}(e,t)},o.stype===g.Error?i(o.serror):o;var o,i},toString:function(){return"val"}}},Jt=function(e){return vt(function(e,n){var r={};return function(t,e,n,r){yt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r}(e,(function(t){return null!=t})))},Qt=function(t){var e=Zt(t),n=q(t,(function(t,e){return e.fold((function(e){return Rt(t,Vt(e,!0))}),r(t))}),{});return{extract:function(t,r,o){var i=_(o)?[]:Jt(o),u=W(i,(function(t){return!_t(n,t)}));return 0===u.length?e.extract(t,r,o):function(t,e){return $t(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,u)},toString:e.toString}},Zt=function(t){return{extract:function(e,n,r){return function(t,e,n,r){return function(t,e){var n=mt(t);return n.errors.length>0?Ut(n.errors):function(t,e){return t.length>0?dt(Rt(e,Mt.apply(void 0,t))):dt(e)}(n.values,e)}(V(n,(function(n){return Kt(t,e,n,r)})),{})}(e,r,t,n)},toString:function(){return"obj{\n"+V(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},te=function(t){return{extract:function(e,n,r){var o=V(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return Wt(o)},toString:function(){return"array("+t.toString()+")"}}},ee=function(t){return{extract:function(e,n,r){for(var o=[],i=0,u=t;i<u.length;i++){var a=u[i].extract(e,n,r);if(a.stype===g.Value)return a;o.push(a)}return Wt(o)},toString:function(){return"oneOf("+V(t,(function(t){return t.toString()})).join(", ")+")"}}},ne=r(Yt(dt)),re=e(te,Zt),oe=Gt.state,ie=Gt.field,ue=function(t,e){return{extract:function(n,r,o){return Ot(o,t).fold((function(){return function(t,e){return $t(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return function(t,e,n,r,o){return Ot(r,o).fold((function(){return function(t,e,n){return $t(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+qt(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))}(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+vt(e)}}},ae=Yt(dt),ce=function(t){return re(t)},se=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}},le=function(t){return Yt((function(e){return t(e).fold(gt,dt)}))},fe=function(t,e){return function(t,e){return{extract:function(n,r,i){var u=vt(i),a=function(e,n){return te(Yt(t)).extract(e,o,n)}(n,u);return ht(a,(function(t){var o=V(t,(function(t){return Gt.field(t,t,Pt(),e)}));return Zt(o).extract(n,r,i)}))},toString:function(){return"setOf("+e.toString()+")"}}}((function(e){return t(e).fold(ft,lt)}),e)},de=function(t,e,n){return r=function(t,e,n,r){return function(t,e){return t.stype===g.Error?{stype:g.Error,serror:e(t.serror)}:t}(e.extract([t],n,r),(function(t){return{input:r,errors:t}}))}(t,e,o,n),st(r,ct.error,ct.value);var r},me=function(t){return t.fold((function(t){throw new Error(he(t))}),o)},ge=function(t,e,n){return me(de(t,e,n))},he=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,V(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+qt(t.input);var e,n},pe=function(t,e){return ue(t,e)},ve=function(t,e){return ue(t,wt(e,Zt))},be=r(ae),ye=function(t,e){return Yt((function(n){var r=typeof n;return t(n)?dt(n):gt("Expected type: "+e+" but got: "+r)}))},we=ye(R,"number"),xe=ye(k,"string"),Ce=ye(_,"boolean"),Se=ye(N,"function"),ke=function(t){var e=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every((function(e){return ke(t[e])}));case"Map":return e(t.keys(),ke)&&e(t.values(),ke);case"Set":return e(t.keys(),ke);default:return!1}},Oe=Yt((function(t){return ke(t)?dt(t):gt("Expected value to be acceptable for sending via postMessage")})),Te=function(t){return le((function(e){return I(t,e)?ct.value(e):ct.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},_e=function(t){return ie(t,t,Pt(),ne())},Ee=function(t,e){return ie(t,t,Pt(),e)},Ae=function(t){return Ee(t,we)},Ne=function(t){return Ee(t,xe)},Re=function(t,e){return ie(t,t,Pt(),Te(e))},Me=function(t){return Ee(t,Se)},ze=function(t,e){return ie(t,t,Pt(),Zt(e))},De=function(t,e){return ie(t,t,Pt(),re(e))},Be=function(t,e){return ie(t,t,Pt(),te(e))},Pe=function(t){return ie(t,t,It(),ne())},Ie=function(t,e){return ie(t,t,It(),e)},Le=function(t){return Ie(t,we)},He=function(t){return Ie(t,xe)},Fe=function(t){return Ie(t,Se)},Ve=function(t,e){return Ie(t,Zt(e))},je=function(t,e){return ie(t,t,Bt(e),ne())},Ue=function(t,e,n){return ie(t,t,Bt(e),n)},We=function(t,e){return Ue(t,e,we)},qe=function(t,e){return Ue(t,e,xe)},$e=function(t,e,n){return Ue(t,e,Te(n))},Ge=function(t,e){return Ue(t,e,Ce)},Xe=function(t,e){return Ue(t,e,Se)},Ke=function(t,e,n){return Ue(t,e,te(n))},Ye=function(t,e,n){return Ue(t,e,Zt(n))},Je=function(t,e){return oe(t,e)},Qe=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Ze=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},tn=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ze(n.childNodes[0])},en=function(t,e){var n=(e||document).createElement(t);return Ze(n)},nn=function(t,e){var n=(e||document).createTextNode(t);return Ze(n)},rn=Ze,on=function(){return un(0,0)},un=function(t,e){return{major:t,minor:e}},an=function(t,e){var n=String(e).toLowerCase();return 0===t.length?on():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return un(r(1),r(2))}(t,n)},cn=on,sn=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},ln=function(t,e){return-1!==t.indexOf(e)},fn=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,t.length-e.length)},dn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),mn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,gn=function(t){return function(e){return ln(e,t)}},hn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ln(t,"edge/")&&ln(t,"chrome")&&ln(t,"safari")&&ln(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,mn],search:function(t){return ln(t,"chrome")&&!ln(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ln(t,"msie")||ln(t,"trident")}},{name:"Opera",versionRegexes:[mn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:gn("firefox")},{name:"Safari",versionRegexes:[mn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ln(t,"safari")||ln(t,"mobile/"))&&ln(t,"applewebkit")}}],pn=[{name:"Windows",search:gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ln(t,"iphone")||ln(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:gn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:gn("linux"),versionRegexes:[]},{name:"Solaris",search:gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:gn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:gn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],vn={browsers:r(hn),oses:r(pn)},bn="Edge",yn="Chrome",wn="Opera",xn="Firefox",Cn="Safari",Sn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(bn),isChrome:r(yn),isIE:r("IE"),isOpera:r(wn),isFirefox:r(xn),isSafari:r(Cn)}},kn=function(){return Sn({current:void 0,version:cn()})},On=Sn,Tn=(r(bn),r(yn),r("IE"),r(wn),r(xn),r(Cn),"Windows"),_n="Android",En="Linux",An="Solaris",Nn="FreeBSD",Rn="ChromeOS",Mn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Tn),isiOS:r("iOS"),isAndroid:r(_n),isOSX:r("OSX"),isLinux:r(En),isSolaris:r(An),isFreeBSD:r(Nn),isChromeOS:r(Rn)}},zn=function(){return Mn({current:void 0,version:cn()})},Dn=Mn,Bn=(r(Tn),r("iOS"),r(_n),r(En),r("OSX"),r(An),r(Nn),r(Rn),function(t,e){var n=vn.browsers(),o=vn.oses(),i=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(kn,On),u=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(zn,Dn),a=function(t,e,n,o){var i=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:r(i),isiPhone:r(u),isTablet:r(s),isPhone:r(l),isTouch:r(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:r(f),isDesktop:r(d)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}}),Pn=function(t){return window.matchMedia(t).matches},In=zt((function(){return Bn(navigator.userAgent,Pn)})),Ln=function(){return In()},Hn=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Fn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Vn=function(t,e){return t.dom===e.dom},jn=function(t,e){return Ln().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Un=function(t){return N(t)?t:c},Wn=function(t,e,n){for(var r=t.dom,o=Un(n);r.parentNode;){r=r.parentNode;var i=rn(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()},qn=function(t,e,n){var r=e(t),o=Un(n);return r.orThunk((function(){return o(t)?x.none():Wn(t,e,o)}))},$n=function(t,e){return Vn(t.element,e.event.target)},Gn=function(e){if(!_t(e,"can")&&!_t(e,"abort")&&!_t(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return ge("Extracting event.handler",Qt([je("can",s),je("abort",c),je("run",t)]),e)},Xn=r,Kn=Xn("touchstart"),Yn=Xn("touchmove"),Jn=Xn("touchend"),Qn=Xn("touchcancel"),Zn=Xn("mousedown"),tr=Xn("mousemove"),er=Xn("mouseout"),nr=Xn("mouseup"),rr=Xn("mouseover"),or=Xn("focusin"),ir=Xn("focusout"),ur=Xn("keydown"),ar=Xn("keyup"),cr=Xn("input"),sr=Xn("change"),lr=Xn("click"),fr=Xn("transitionend"),dr=Xn("selectstart"),mr=function(t){return r("alloy."+t)},gr={tap:mr("tap")},hr=mr("focus"),pr=mr("blur.post"),vr=mr("paste.post"),br=mr("receive"),yr=mr("execute"),wr=mr("focus.item"),xr=gr.tap,Cr=mr("longpress"),Sr=mr("sandbox.close"),kr=mr("typeahead.cancel"),Or=mr("system.init"),Tr=mr("system.touchmove"),_r=mr("system.touchend"),Er=mr("system.scroll"),Ar=mr("system.resize"),Nr=mr("system.attached"),Rr=mr("system.detached"),Mr=mr("system.dismissRequested"),zr=mr("system.repositionRequested"),Dr=mr("focusmanager.shifted"),Br=mr("slotcontainer.visibility"),Pr=mr("change.tab"),Ir=mr("dismiss.tab"),Lr=mr("highlight"),Hr=mr("dehighlight"),Fr=function(t,e){Wr(t,t.element,e,{})},Vr=function(t,e,n){Wr(t,t.element,e,n)},jr=function(t){Fr(t,yr())},Ur=function(t,e,n){Wr(t,e,n,{})},Wr=function(t,e,n,r){var o=f({target:e},r);t.getSystem().triggerEvent(n,e,o)},qr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},$r=function(t){return jt(t)},Gr=function(t,e){return{key:t,value:Gn({abort:e})}},Xr=function(t){return{key:t,value:Gn({run:function(t,e){e.event.prevent()}})}},Kr=function(t,e){return{key:t,value:Gn({run:e})}},Yr=function(t,e,n){return{key:t,value:Gn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Jr=function(t){return function(e){return{key:t,value:Gn({run:function(t,n){$n(t,n)&&e(t,n)}})}}},Qr=function(t,e,n){return function(t,e){return Kr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){qr(e,e.element,t,r)}))}))}(t,e.partUids[n])},Zr=function(t,e){return Kr(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).fold((function(){return qn(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),c).getOr(t)}),(function(t){return t}));e(t,o,n)}))},to=function(t){return Kr(t,(function(t,e){e.cut()}))},eo=function(t){return Kr(t,(function(t,e){e.stop()}))},no=function(t,e){return Jr(t)(e)},ro=Jr(Nr()),oo=Jr(Rr()),io=Jr(Or()),uo=function(t){return function(e){return Kr(t,e)}}(yr()),ao=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),co=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},so=co(1),lo=co(3),fo=co(9),mo=co(11),go=function(t){return rn(t.dom.ownerDocument)},ho=function(t){return fo(t)?t:go(t)},po=function(t){return rn(ho(t).dom.documentElement)},vo=function(t){return rn(ho(t).dom.defaultView)},bo=function(t){return x.from(t.dom.parentNode).map(rn)},yo=function(t){return x.from(t.dom.offsetParent).map(rn)},wo=function(t){return V(t.dom.childNodes,rn)},xo=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rn)},Co=function(t,e){bo(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},So=function(t,e){(function(t){return x.from(t.dom.nextSibling).map(rn)})(t).fold((function(){bo(t).each((function(t){Oo(t,e)}))}),(function(t){Co(t,e)}))},ko=function(t,e){(function(t){return xo(t,0)})(t).fold((function(){Oo(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Oo=function(t,e){t.dom.appendChild(e.dom)},To=function(t,e){j(e,(function(e){Oo(t,e)}))},_o=function(t){t.dom.textContent="",j(wo(t),(function(t){Eo(t)}))},Eo=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ao=function(t){var e,n=wo(t);n.length>0&&(e=t,j(n,(function(t){Co(e,t)}))),Eo(t)},No=function(t){return t.dom.innerHTML},Ro=function(t,e){var n,r,o=go(t).dom,i=rn(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,wo(rn(r)));To(i,u),_o(t),Oo(t,i)},Mo=function(t,e,n){if(!(k(n)||_(n)||R(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},zo=function(t,e,n){Mo(t.dom,e,n)},Do=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Bo=function(t,e){return x.from(Do(t,e))},Po=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Io=function(t,e){t.dom.removeAttribute(e)},Lo=function(t){return function(t){var e=en("div"),n=rn(t.dom.cloneNode(!0));return Oo(e,n),No(e)}(function(t){return function(t,e){return rn(t.dom.cloneNode(!1))}(t)}(t))},Ho=function(t){return Lo(t)},Fo=$r([function(t,e){return{key:t,value:Gn({can:function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return Vn(e,t.element)&&!Vn(e,n)}(t,r,o)||(console.warn(hr()+" did not get interpreted by the desired target. \nOriginator: "+Ho(r)+"\nTarget: "+Ho(o)+"\nCheck the "+hr()+" event handlers"),!1)}})}}(hr())]),Vo=Object.freeze({__proto__:null,events:Fo}),jo=0,Uo=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++jo+String(e)},Wo=r("alloy-id-"),qo=r("data-alloy-id"),$o=Wo(),Go=qo(),Xo=function(t,e){Object.defineProperty(t.dom,Go,{value:e,writable:!0})},Ko=function(t){var e=so(t)?t.dom[Go]:null;return x.from(e)},Yo=function(t){return Uo(t)},Jo=o,Qo=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Ho(t().element)+" is not in context.":""))}};return{debugInfo:r("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:c}},Zo=Qo(),ti=function(t){return V(t,(function(t){return fn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},ei=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(i)}},t},ni=Uo("alloy-premade"),ri=function(t){return Vt(ni,t)},oi=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ti(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,m([e.getApis(),e],n))}),t)},ii={init:function(){return ui({readState:function(){return"No State required"}})}},ui=function(t){return t},ai=function(t,e){var n={};return yt(t,(function(t,r){yt(t,(function(t,o){var i=Ot(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},ci=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},si=function(t){return t.cHandler},li=function(t,e){return{name:t,handler:e}},fi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=tt(n,(function(e,n){var o=e.name,i=n.name,u=r.indexOf(o),a=r.indexOf(i);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));return u<a?-1:a<u?1:0}));return ct.value(o)}catch(t){return ct.error([t])}}("Event: "+n,0,t,r).map((function(t){return function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return Gn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,(function(t){t.run.apply(void 0,e)}))}})}(V(t,(function(t){return t.handler})))})):function(t,e){return ct.error(["The event ("+t+') 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(V(e,(function(t){return t.name})),null,2)])}(n,t)},di=function(t,e){var n,o,i,u=Ct(t,(function(t,n){return(1===t.length?ct.value(t[0].handler):fi(t,e,n)).map((function(o){var i=function(t){var e=function(t){return N(t)?{can:r(!0),abort:r(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}}(o),u=t.length>1?W(e[n],(function(e){return L(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Vt(n,function(t,e){return{handler:t,purpose:e}}(i,u))}))}));return n={},(i=function(t){var e=[],n=[];return j(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(u)).errors.length>0?(o=i.errors,ct.error(K(o))):function(t,e){return 0===t.length?ct.value(e):ct.value(Rt(e,Mt.apply(void 0,t)))}(i.values,n)},mi="alloy.base.behaviour",gi=function(t){return t.events},hi=function(t,e){var n=Do(t,e);return void 0===n||""===n?[]:n.split(" ")},pi=function(t){return void 0!==t.dom.classList},vi=function(t,e){pi(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=hi(t,e).concat([n]);zo(t,e,r.join(" "))})(t,"class",e)}(t,e)},bi=function(t,e){pi(t)?t.dom.classList.remove(e):function(t,e){(function(t,e,n){var r=W(hi(t,e),(function(t){return t!==n}));r.length>0?zo(t,e,r.join(" ")):Io(t,e)})(t,"class",e)}(t,e),function(t){0===(pi(t)?t.dom.classList:function(t){return hi(t,"class")}(t)).length&&Io(t,"class")}(t)},yi=function(t,e){return pi(t)&&t.dom.classList.contains(e)},wi=function(t,e){j(e,(function(e){vi(t,e)}))},xi=function(t,e){j(e,(function(e){bi(t,e)}))},Ci=function(t){return void 0!==t.style&&N(t.style.getPropertyValue)},Si=function(t){return mo(t)},ki=N(Element.prototype.attachShadow)&&N(Node.prototype.getRootNode),Oi=r(ki),Ti=ki?function(t){return rn(t.dom.getRootNode())}:ho,_i=function(t){return Si(t)?t:rn(ho(t).dom.body)},Ei=function(t){var e=Ti(t);return Si(e)?x.some(e):x.none()},Ai=function(t){return rn(t.dom.host)},Ni=function(t){var e=lo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Ei(rn(e)).fold((function(){return o.body.contains(e)}),(n=Ni,r=Ai,function(t){return n(r(t))}))},Ri=function(){return Mi(rn(document))},Mi=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return rn(e)},zi=function(t,e,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ci(t)&&t.style.setProperty(e,n)},Di=function(t,e){Ci(t)&&t.style.removeProperty(e)},Bi=function(t,e,n){var r=t.dom;zi(r,e,n)},Pi=function(t,e){var n=t.dom;yt(e,(function(t,e){zi(n,e,t)}))},Ii=function(t,e){var n=t.dom;yt(e,(function(t,e){t.fold((function(){Di(n,e)}),(function(t){zi(n,e,t)}))}))},Li=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ni(t)?r:Hi(n,e)},Hi=function(t,e){return Ci(t)?t.style.getPropertyValue(e):""},Fi=function(t,e){var n=t.dom,r=Hi(n,e);return x.from(r).filter((function(t){return t.length>0}))},Vi=function(t){var e={},n=t.dom;if(Ci(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},ji=function(t,e,n){var r=en(t);return Bi(r,e,n),Fi(r,e).isSome()},Ui=function(t,e){var n=t.dom;Di(n,e),Bo(t,"style").map(dn).is("")&&Io(t,"style")},Wi=function(t){return t.dom.offsetWidth},qi=function(t){return t.dom.value},$i=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Gi=function(t){return function(t,e){return function(t,e){var n=V(e,(function(t){return Ve(t.name(),[_e("config"),je("state",ii)])})),r=de("component.behaviours",Zt(n),t.behaviours).fold((function(e){throw new Error(he(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:wt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)}(t,function(t){var e=Ot(t,"behaviours").getOr({}),n=W(vt(e),(function(t){return void 0!==e[t]}));return V(n,(function(t){return e[t].me}))}(t))},Xi=function(t,e,n){var r={"alloy.base.behaviour":gi(t)};return function(t,e,n,r){var o=function(t,e,n){var r=f(f({},n),function(t,e){var n={};return j(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return ai(r,li)}(t,n,r);return di(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ki=function(t){var e=function(){return d},n=Qe(Zo),o=me(function(t){var e,n;return de("custom.definition",Zt([ie("dom","dom",Pt(),Zt([_e("tag"),je("styles",{}),je("classes",[]),je("attributes",{}),Pe("value"),Pe("innerHtml")])),_e("components"),_e("uid"),je("events",{}),je("apis",{}),ie("eventOrder","eventOrder",(e={},e[yr()]=["disabling",mi,"toggling","typeaheadevents"],e[hr()]=[mi,"focusing","keying"],e[Or()]=[mi,"disabling","toggling","representing"],e[cr()]=[mi,"representing","streaming","invalidating"],e[Rr()]=[mi,"representing","item-events","tooltipping"],e[Zn()]=["focusing",mi,"item-type-events"],e[Kn()]=["focusing",mi,"item-type-events"],e[rr()]=["item-type-events","tooltipping"],e[br()]=["receiving","reflecting","tooltipping"],n=e,Dt.mergeWithThunk(r(n))),be()),Pe("domModification")]),t)}(t)),i=Gi(t),u=function(t){return t.list}(i),a=function(t){return t.data}(i),c=function(t){var e=en(t.tag);!function(t,e){var n=t.dom;yt(e,(function(t,e){Mo(n,e,t)}))}(e,t.attributes),wi(e,t.classes),Pi(e,t.styles),t.innerHtml.each((function(t){return Ro(e,t)}));var n=t.domChildren;return To(e,n),t.value.each((function(t){$i(e,t)})),t.uid,Xo(e,t.uid),e}(function(t,e,n){var r,o,i,u=f(f({},(r=t).dom),{uid:r.uid,domChildren:V(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return ci({})}),ci)}(t),c={"alloy.base.modification":a};return i=e.length>0?function(t,e,n,r){var o=f({},e);j(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=ai(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return q(t,(function(t,e){return f(f({},e.modification),t)}),{})},a=q(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return ci({classes:a,attributes:c,styles:s})}(n,c,e,u):a,f(f({},o=u),{attributes:f(f({},o.attributes),i.attributes),styles:f(f({},o.styles),i.styles),classes:o.classes.concat(i.classes)})}(o,u,a)),s=Xi(o,u,a),l=Qe(o.components),d={getSystem:n.get,config:function(e){var n=a;return(N(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return N(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Qo(e))},element:c,syncComponents:function(){var t=wo(c),e=Y(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));l.set(e)},components:l.get,events:s};return d},Yi=function(t){var e=nn(t);return Ji({element:e})},Ji=function(e){var n=ge("external.component",Qt([_e("element"),Pe("uid")]),e),o=Qe(Qo());n.uid.each((function(t){Xo(n.element,t)}));var i={getSystem:o.get,config:x.none,hasConfigured:c,connect:function(t){o.set(t)},disconnect:function(){o.set(Qo((function(){return i})))},getApis:function(){return{}},element:n.element,spec:e,readState:r("No state"),syncComponents:t,components:r([]),events:{}};return ri(i)},Qi=Yo,Zi=function(t){return function(t){return Ot(t,ni)}(t).fold((function(){return function(t){var e=Jo(t),n=e.events,r=d(e,["events"]),o=function(t){var e=Ot(t,"components").getOr([]);return V(e,Zi)}(r),i=f(f({},r),{events:f(f({},Vo),n),components:o});return ct.value(Ki(i))}(t.hasOwnProperty("uid")?t:f({uid:Qi("")},t)).getOrDie()}),(function(t){return t}))},tu=ri;function eu(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Li(n,t);return parseFloat(o)||0}return r},r=function(t,e){return $(e,(function(e,n){var r=Li(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!R(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ci(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var nu=eu("height",(function(t){var e=t.dom;return Ni(t)?e.getBoundingClientRect().height:e.offsetHeight})),ru=function(t){return nu.get(t)},ou=function(t){return nu.getOuter(t)},iu=function(t,e){return{left:t,top:e,translate:function(n,r){return iu(t+n,e+r)}}},uu=iu,au=function(t,e){return void 0!==t?t:void 0!==e?e:0},cu=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return uu(n.offsetLeft,n.offsetTop);var i=au(null==r?void 0:r.pageYOffset,o.scrollTop),u=au(null==r?void 0:r.pageXOffset,o.scrollLeft),a=au(o.clientTop,n.clientTop),c=au(o.clientLeft,n.clientLeft);return su(t).translate(u-c,i-a)},su=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?uu(n.offsetLeft,n.offsetTop):Ni(t)?function(t){var e=t.getBoundingClientRect();return uu(e.left,e.top)}(e):uu(0,0)},lu=eu("width",(function(t){return t.dom.offsetWidth})),fu=function(t){return lu.get(t)},du=function(t){return lu.getOuter(t)},mu=function(t){var n=rn(function(t){if(Oi()&&A(t.target)){var e=rn(t.target);if(so(e)&&function(t){return A(t.dom.shadowRoot)}(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return nt(n)}}return x.from(t.target)}(t).getOr(t.target)),r=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=e(o,r);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(n,t.clientX,t.clientY,r,o,i,t)},gu=function(t,e,n,r,o){var u=function(t,e){return function(n){t(n)&&e(mu(n))}}(n,r);return t.dom.addEventListener(e,u,o),{unbind:i(hu,t,e,u,o)}},hu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},pu=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return uu(n,r)},vu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},bu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},yu=function(t){var e=void 0===t?window:t,n=e.document,r=pu(rn(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return bu(r.left,r.top,n,o)}),(function(t){return bu(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},wu=function(t,e){return t.view(e).fold(r([]),(function(e){var n=t.owner(e),r=wu(t,n);return[e].concat(r)}))},xu=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(rn)},owner:function(t){return go(t)}}),Cu=function(t){var e=rn(document),n=pu(e);return function(t,e){var n=e.owner(t),r=wu(e,n);return x.some(r)}(t,xu).fold(i(cu,t),(function(e){var r=su(t),o=q(e,(function(t,e){var n=su(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return uu(o.left+r.left+n.left,o.top+r.top+n.top)}))},Su=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ku=function(t){var e=cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Ou=function(t){var e=Cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Tu=function(){return yu(window)};function _u(t,e,n,r,o){return t(n,r)?x.some(n):N(o)&&o(n)?x.none():e(n,r,o)}var Eu,Au=function(t,e,n){for(var r=t.dom,o=N(n)?n:c;r.parentNode;){r=r.parentNode;var i=rn(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},Nu=function(t,e,n){return _u((function(t,e){return e(t)}),Au,t,e,n)},Ru=function(t,e,n){return Nu(t,e,n).isSome()},Mu=function(t,e,n){return Au(t,(function(t){return Hn(t,e)}),n)},zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?x.none():x.from(n.querySelector(t)).map(rn)}(e,t)},Du=function(t,e,n){return _u((function(t,e){return Hn(t,e)}),Mu,t,e,n)},Bu=function(){var t=Uo("aria-owns");return{id:t,link:function(e){zo(e,"aria-owns",t)},unlink:function(t){Io(t,"aria-owns")}}},Pu=function(t,e){return Ru(e,(function(e){return Vn(e,t.element)}),c)||function(t,e){return function(t){return Nu(t,(function(t){if(!so(t))return!1;var e=Do(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Do(t,"id"),n=Ti(t);return zu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return Pu(t,e)}))}(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Eu||(Eu={}));var Iu,Lu=Qe({}),Hu=["alloy/data/Fields","alloy/debugging/Debugging"],Fu=function(t,e,n){return function(t,e,n){switch(Ot(Lu.get(),t).orThunk((function(){var e=vt(Lu.get());return it(e,(function(e){return t.indexOf(e)>-1?x.some(Lu.get()[e]):x.none()}))})).getOr(Eu.NORMAL)){case Eu.NORMAL:return n(Vu());case Eu.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();I(["mousemove","mouseover","mouseout",Or()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:V(n,(function(t){return I(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ho(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case Eu.STOP:return!0}}(t,e,n)},Vu=r({logEventCut:t,logEventStopped:t,logNoParent:t,logEventNoHandlers:t,logEventResponse:t,write:t}),ju=r([_e("menu"),_e("selectedMenu")]),Uu=r([_e("item"),_e("selectedItem")]),Wu=(r(Zt(Uu().concat(ju()))),r(Zt(Uu()))),qu=ze("initSize",[_e("numColumns"),_e("numRows")]),$u=function(){return ze("markers",[_e("backgroundMenu")].concat(ju()).concat(Uu()))},Gu=function(t){return ze("markers",V(t,_e))},Xu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");G(e,(function(t){return t.indexOf("alloy")>0&&!L(Hu,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),ie(e,e,n,le((function(t){return ct.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},Ku=function(e){return Xu(0,e,Bt(t))},Yu=function(t){return Xu(0,t,Bt(x.none))},Ju=function(t){return Xu(0,t,Pt())},Qu=function(t){return Xu(0,t,Pt())},Zu=function(t,e){return Je(t,r(e))},ta=function(t){return Je(t,o)},ea=r(qu),na=function(t,e,n,r,o,i){return{x:t,y:e,bubble:n,direction:r,boundsRestriction:o,label:i}},ra=Et([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),oa=ra.southeast,ia=ra.southwest,ua=ra.northeast,aa=ra.northwest,ca=ra.south,sa=ra.north,la=ra.east,fa=ra.west,da=function(t,e){return function(n,r){for(var o={},i=0,u=n.length;i<u;i++){var a=n[i];o[String(a)]=Ot(e,a).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}return o}(["left","right","top","bottom"])},ma=function(t){return t.x},ga=function(t,e){return t.x+t.width/2-e.width/2},ha=function(t,e){return t.x+t.width-e.width},pa=function(t,e){return t.y-e.height},va=function(t){return t.y+t.height},ba=function(t,e){return t.y+t.height/2-e.height/2},ya=function(t,e,n){return na(ma(t),va(t),n.southeast(),oa(),da(t,{left:1,top:3}),"layout-se")},wa=function(t,e,n){return na(ha(t,e),va(t),n.southwest(),ia(),da(t,{right:0,top:3}),"layout-sw")},xa=function(t,e,n){return na(ma(t),pa(t,e),n.northeast(),ua(),da(t,{left:1,bottom:2}),"layout-ne")},Ca=function(t,e,n){return na(ha(t,e),pa(t,e),n.northwest(),aa(),da(t,{right:0,bottom:2}),"layout-nw")},Sa=function(t,e,n){return na(ga(t,e),pa(t,e),n.north(),sa(),da(t,{bottom:2}),"layout-n")},ka=function(t,e,n){return na(ga(t,e),va(t),n.south(),ca(),da(t,{top:3}),"layout-s")},Oa=function(t,e,n){return na(function(t){return t.x+t.width}(t),ba(t,e),n.east(),la(),da(t,{left:0}),"layout-e")},Ta=function(t,e,n){return na(function(t,e){return t.x-e.width}(t,e),ba(t,e),n.west(),fa(),da(t,{right:1}),"layout-w")},_a=function(){return[ya,wa,xa,Ca,ka,Sa,Oa,Ta]},Ea=function(){return[wa,ya,Ca,xa,ka,Sa,Oa,Ta]},Aa=function(){return[xa,Ca,ya,wa,Sa,ka]},Na=function(){return[Ca,xa,wa,ya,Sa,ka]},Ra=function(){return[ya,wa,xa,Ca,ka,Sa]},Ma=function(){return[wa,ya,Ca,xa,ka,Sa]},za=Object.freeze({__proto__:null,events:function(t){return $r([Kr(br(),(function(e,n){var r=t.channels,o=vt(r),i=n,u=function(t,e){return e.universal?t:W(t,(function(t){return I(e.channels,t)}))}(o,i);j(u,(function(t){var n=r[t],o=n.schema,u=ge("channel["+t+"] data\nReceiver: "+Ho(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),Da=[Ee("channels",fe(ct.value,Qt([Ju("onReceive"),je("schema",be())])))],Ba=function(t,e,n){return io((function(r,o){n(r,t,e)}))},Pa=function(t){return{key:t,value:void 0}},Ia=function(t,e,n,o,u,a,c){var s=function(t){return _t(t,n)?t[n]():x.none()},l=wt(u,(function(t,e){return function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(u.slice(0,1).concat(u.slice(3)))}},t}((function(o){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:r(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[o,t.config,t.state].concat(n))}))}),n,e)}(n,t,e)})),d=wt(a,(function(t,e){return ei(t,e)})),m=f(f(f({},d),l),{revoke:i(Pa,n),config:function(e){var r=ge(n+"-config",t,e);return{key:n,value:{config:r,me:m,configAsRaw:zt((function(){return ge(n+"-config",t,e)})),initialConfig:e,state:c}}},schema:function(){return e},exhibit:function(t,e){return s(t).bind((function(t){return Ot(o,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(ci({}))},name:function(){return n},handlers:function(t){return s(t).map((function(t){return Ot(o,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return m},La=function(t){return jt(t)},Ha=Qt([_e("fields"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),Fa=function(t){var e=ge("Creating behaviour: "+t.name,Ha,t);return function(t,e,n,r,o,i){var u,a=Qt(t),c=Ve(e,[("config",u=t,Ie("config",Qt(u)))]);return Ia(a,c,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Va=Qt([_e("branchKey"),_e("branches"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),ja=function(t){var e=ge("Creating behaviour: "+t.name,Va,t);return function(t,e,n,r,o,i){var u=t,a=Ve(e,[Ie("config",t)]);return Ia(u,a,e,n,r,o,i)}(ve(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Ua=r(void 0),Wa=Fa({fields:Da,name:"receiving",active:za}),qa=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),$a=function(t){return t.dom.focus()},Ga=function(t){return void 0===t&&(t=rn(document)),x.from(t.dom.activeElement).map(rn)},Xa=function(t){return Ga(Ti(t)).filter((function(e){return t.dom.contains(e.dom)}))},Ka=function(e,n){var r=Ti(n),o=Ga(r).bind((function(t){var e,r,o=function(e){return Vn(t,e)};return o(n)?x.some(n):(e=o,(r=function(t){for(var n=0;n<t.childNodes.length;n++){var o=rn(t.childNodes[n]);if(e(o))return x.some(o);var i=r(t.childNodes[n]);if(i.isSome())return i}return x.none()})(n.dom))})),i=e(n);return o.each((function(e){Ga(r).filter((function(t){return Vn(t,e)})).fold((function(){$a(e)}),t)})),i},Ya=function(t,e,n,r,o){return{position:t,left:e,top:n,right:r,bottom:o}},Ja=function(t,e){var n=function(t){return t+"px"};Ii(t,{position:x.some(e.position),left:e.left.map(n),top:e.top.map(n),right:e.right.map(n),bottom:e.bottom.map(n)})},Qa=Et([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Za=function(t,e,n,r,o,i){var u=e.x-n,a=e.y-r,c=o-(u+e.width),s=i-(a+e.height),l=x.some(u),f=x.some(a),d=x.some(c),m=x.some(s),g=x.none();return e.direction.fold((function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,g,g,d,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}))},tc=function(t,e){var n=i(Cu,e),r=t.fold(n,n,(function(){var t=pu();return Cu(e).translate(-t.left,-t.top)})),o=du(e),u=ou(e);return Su(r.left,r.top,o,u)},ec=function(t,e){return e.fold((function(){return t.fold(Tu,Tu,Su)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=nc(t,n.x,n.y);return Su(r.left,r.top,n.width,n.height)}))}))},nc=function(t,e,n){var o=uu(e,n);return t.fold(r(o),r(o),(function(){var t=pu();return o.translate(-t.left,-t.top)}))},rc=(Qa.none,Qa.relative),oc=Qa.fixed,ic=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},uc=function(t,e,n){return Math.min(Math.max(t,e),n)},ac=Et([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),cc=function(t,e,n,u){Ui(e,"max-height"),Ui(e,"max-width");var a,c={width:du(a=e),height:ou(a)};return function(t,e,n,u,a){var c=n.width,s=n.height,l=function(t,i,l,f){return function(t,e,n,i){var u=t.x,a=t.y,c=t.bubble.offset,s=c.left,l=c.top,f=function(t,e,n){var r=function(t,r){var i="top"===t||"bottom"===t?n.top:n.left;return Ot(e,t).bind(o).bind((function(e){return"left"===t||"top"===t?e>=r?x.some(e):x.none():e<=r?x.some(e):x.none()})).map((function(t){return t+i})).getOr(r)},i=r("left",t.x),u=r("top",t.y),a=r("right",t.right),c=r("bottom",t.bottom);return Su(i,u,a-i,c-u)}(i,t.boundsRestriction,c),d=f.y,m=f.bottom,g=f.x,h=f.right,p=a+l,v=function(t,e,n,r,o){var i=o.x,u=o.y,a=o.width,c=o.height,s=t>=i,l=e>=u,f=s&&l,d=t+n<=i+a&&e+r<=u+c,m=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),g=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),h=Math.max(o.x,o.right-n),p=Math.max(o.y,o.bottom-r);return{originInBounds:f,sizeInBounds:d,limitX:uc(t,o.x,h),limitY:uc(e,o.y,p),deltaW:m,deltaH:g}}(u+s,p,e,n,f),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,C=v.limitY,S=v.deltaW,k=v.deltaH,O=r(C+k-d),T=r(m-C),_=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction,T,T,O),E=r(w+S-g),A=r(h-w),N={x:w,y:C,width:S,height:k,maxHeight:_,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction,A,A,E),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:p};return b&&y?ac.fit(N):ac.nofit(N,S,k)}(t(e,n,u),c,s,a).fold(ac.fit,(function(t,e,n){return n>f||e>l?ac.nofit(t,e,n):ac.nofit(i,l,f)}))};return $(t,(function(t,e){var n=i(l,e);return t.fold(ac.fit,n)}),ac.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:oa(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(o,o)}(u.preference,t,c,n,u.bounds)},sc=function(t,e){!function(t,e){var n=nu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Bi(t,"max-height",n+"px")}(t,Math.floor(e))},lc=r((function(t,e){sc(t,e),Pi(t,{"overflow-x":"hidden","overflow-y":"auto"})})),fc=r((function(t,e){sc(t,e)})),dc=function(t,e,n){return void 0===t[e]?n:t[e]},mc=function(t,e,n,r){var o=cc(t,e,n,r);(function(t,e,n){Ja(t,function(t,e){return t.fold((function(){return Ya("absolute",x.some(e.x),x.some(e.y),x.none(),x.none())}),(function(t,n,r,o){return Za("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Za("fixed",e,t,n,r,o)}))}(n.origin,e))})(e,o,r),function(t,e){var n=e.classes;xi(t,n.off),wi(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r)},gc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],hc=function(t,e,n){var r=function(t){return Ot(n,t).getOr([])},o=function(t,e,n){var o=Z(gc,n);return{offset:uu(t,e),classesOn:Y(n,r),classesOff:Y(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},pc=function(){return hc(0,0,{})},vc=function(t,e){return function(n){return"rtl"===bc(n)?e:t}},bc=function(t){return"rtl"===Li(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Iu||(Iu={}));var yc="data-alloy-vertical-dir",wc=function(t){return Ru(t,(function(t){return so(t)&&Do(t,"data-alloy-vertical-dir")===Iu.BottomToTop}))},xc=function(){return Ve("layouts",[_e("onLtr"),_e("onRtl"),Pe("onBottomLtr"),Pe("onBottomRtl")])},Cc=function(t,e,n,r,o,i,u){var a=u.map(wc).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return vc(l,f)(t)},Sc=[_e("hotspot"),Pe("bubble"),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=e.hotspot,o=tc(n,r.element),i=Cc(t.element,e,Ra(),Ma(),Aa(),Na(),x.some(e.hotspot.element));return x.some({anchorBox:o,bubble:e.bubble.getOr(pc()),overrides:e.overrides,layouts:i,placer:x.none()})}))],kc=[_e("x"),_e("y"),je("height",0),je("width",0),je("bubble",pc()),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=nc(n,e.x,e.y),o=Su(r.left,r.top,e.width,e.height),i=Cc(t.element,e,_a(),Ea(),_a(),Ea(),x.none());return x.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:x.none()})}))],Oc=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Tc=Et([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_c=(Tc.before,Tc.on,Tc.after,function(t){return t.fold(o,o,o)}),Ec=Et([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ac={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(t){return Ec.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return rn(t.startContainer)},relative:function(t,e){return _c(t)},exact:function(t,e,n,r){return t}})}(t);return vo(e)},range:Oc},Nc=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rc=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Mc=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zc=Et([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Dc=function(t,e,n){return e(rn(n.startContainer),n.startOffset,rn(n.endContainer),n.endOffset)};zc.ltr,zc.rtl;var Bc,Pc=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(lo),Ic=function(t){return Pc.getOption(t)},Lc=["img","br"],Hc=function(t){return Ic(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||I(Lc,ao(t))},Fc=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?[]:V(n.querySelectorAll(t),rn)}(e,t)},Vc=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return x.some(Oc(rn(e.startContainer),e.startOffset,rn(n.endContainer),n.endOffset))}return x.none()},jc=function(t){if(null===t.anchorNode||null===t.focusNode)return Vc(t);var e=rn(t.anchorNode),n=rn(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=go(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Vn(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?x.some(Oc(e,t.anchorOffset,n,t.focusOffset)):Vc(t)},Uc=function(t,e){return n=function(t,e){return function(t,e){return n=function(t,e){return e.match({domRange:function(t){return{ltr:r(t),rtl:x.none}},relative:function(e,n){return{ltr:zt((function(){return Nc(t,e,n)})),rtl:zt((function(){return x.some(Nc(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:zt((function(){return Rc(t,e,n,r,o)})),rtl:zt((function(){return x.some(Rc(t,r,o,e,n))}))}}})}(t,e),(o=n.ltr()).collapsed?n.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zc.rtl(rn(t.endContainer),t.endOffset,rn(t.startContainer),t.startOffset)})).getOrThunk((function(){return Dc(0,zc.ltr,o)})):Dc(0,zc.ltr,o);var n,o}(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e),o=n.getClientRects(),(i=o.length>0?o[0]:n.getBoundingClientRect()).width>0||i.height>0?x.some(i).map(Mc):x.none();var n,o,i},Wc=function(t,e){return{element:t,offset:e}},qc=Et([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$c=function(t){return t.fold(o,(function(t,e,n){return t.translate(-e,-n)}))},Gc=function(t){return t.fold(o,o)},Xc=function(t){return $(t,(function(t,e){return t.translate(e.left,e.top)}),uu(0,0))},Kc=function(t){var e=V(t,Gc);return Xc(e)},Yc=qc.screen,Jc=qc.absolute,Qc=function(t,e,n){var r=go(t.element),o=pu(r),i=function(t,e,n){var r=vo(n.root).dom;return x.from(r.frameElement).map(rn).filter((function(e){var n=go(e),r=go(t.element);return Vn(n,r)})).map(cu)}(t,0,n).getOr(o);return Jc(i,o.left,o.top)},Zc=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=Yc(uu(o,i));return x.some(function(t,e,n){return{point:t,width:e,height:n}}(c,u,a))},ts=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c,s,l,f,d=[e,t.point],m=(i=function(){return Kc(d)},u=function(){return Kc(d)},a=function(){return function(t){var e=V(t,$c);return Xc(e)}(d)},r.fold(i,u,a)),g=(c=m.left,s=m.top,l=t.width,f=t.height,{x:c,y:s,width:l,height:f}),h=n.showAbove?Aa():Ra(),p=n.showAbove?Na():Ma(),v=Cc(o,n,h,p,h,p,x.none());return{anchorBox:g,bubble:n.bubble.getOr(pc()),overrides:n.overrides,layouts:v,placer:x.none()}}))},es=function(t,e){return lo(t)?Wc(t,e):function(t,e){var n=wo(t);if(0===n.length)return Wc(t,e);if(e<n.length)return Wc(n[e],0);var r=n[n.length-1],o=lo(r)?function(t){return Pc.get(t)}(r).length:wo(r).length;return Wc(r,o)}(t,e)},ns=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return function(t){return function(t){return x.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(jc)}(t)}}))().map((function(t){var e=es(t.start,t.soffset),n=es(t.finish,t.foffset);return Ac.range(e.element,e.offset,n.element,n.offset)}))},rs=[Pe("getSelection"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=vo(e.root).dom,o=Qc(t,0,e),i=ns(r,e).bind((function(t){return Uc(r,Ac.exactFromRange(t)).orThunk((function(){var e=nn("\ufeff");return Co(t.start,e),Uc(r,Ac.exact(e,0,e,1)).map((function(t){return Eo(e),t}))})).bind((function(t){return Zc(t.left,t.top,t.width,t.height)}))})),u=ns(r,e).bind((function(t){return so(t.start)?x.some(t.start):function(t){return bo(t)}(t.start)})).getOr(t.element);return ts(i,o,e,n,u)}))],os=[_e("node"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=Qc(t,0,e);return e.node.bind((function(o){var i=o.dom.getBoundingClientRect(),u=Zc(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return ts(u,r,e,n,a)}))}))],is=function(t){return t.x+t.width},us=function(t,e){return t.x-e.width},as=function(t,e){return t.y-e.height+t.height},cs=function(t){return t.y},ss=function(t,e,n){return na(is(t),cs(t),n.southeast(),oa(),da(t,{left:0,top:2}),"link-layout-se")},ls=function(t,e,n){return na(us(t,e),cs(t),n.southwest(),ia(),da(t,{right:1,top:2}),"link-layout-sw")},fs=function(t,e,n){return na(is(t),as(t,e),n.northeast(),ua(),da(t,{left:0,bottom:3}),"link-layout-ne")},ds=function(t,e,n){return na(us(t,e),as(t,e),n.northwest(),aa(),da(t,{right:1,bottom:3}),"link-layout-nw")},ms=function(){return[ss,ls,fs,ds]},gs=function(){return[ls,ss,ds,fs]},hs=[_e("item"),xc(),je("overrides",{}),Zu("placement",(function(t,e,n){var r=tc(n,e.item.element),o=Cc(t.element,e,ms(),gs(),ms(),gs(),x.none());return x.some({anchorBox:r,bubble:pc(),overrides:e.overrides,layouts:o,placer:x.none()})}))],ps=ve("anchor",{selection:rs,node:os,hotspot:Sc,submenu:hs,makeshift:kc}),vs=function(e,n,r,o,i){!function(e,n,r,o,i,u){var a=dc(u,"maxHeightFunction",lc()),c=dc(u,"maxWidthFunction",t),s=e.anchorBox,l=e.origin,f={bounds:ec(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};mc(s,n,r,f)}(function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)}(r.anchorBox,n),i.element,r.bubble,r.layouts,o,r.overrides)},bs=function(t,e,n,r,o,i){var u=i.map(ku);return ys(t,e,n,r,o,u)},ys=function(t,e,n,o,i,u){var a=ge("positioning anchor.info",ps,o);Ka((function(){Bi(i.element,"position","fixed");var n=Fi(i.element,"visibility");Bi(i.element,"visibility","hidden");var o,c=e.useFixed()?(o=document.documentElement,oc(0,0,o.clientWidth,o.clientHeight)):function(t){var e=cu(t.element),n=t.element.dom.getBoundingClientRect();return rc(e.left,e.top,n.width,n.height)}(t),s=a.placement,l=u.map(r).or(e.getBounds);s(t,a,c).each((function(e){e.placer.getOr(vs)(t,c,e,l,i)})),n.fold((function(){Ui(i.element,"visibility")}),(function(t){Bi(i.element,"visibility",t)})),Fi(i.element,"left").isNone()&&Fi(i.element,"top").isNone()&&Fi(i.element,"right").isNone()&&Fi(i.element,"bottom").isNone()&&Fi(i.element,"position").is("fixed")&&Ui(i.element,"position")}),i.element)},ws=Object.freeze({__proto__:null,position:function(t,e,n,r,o){bs(t,e,n,r,o,x.none())},positionWithin:bs,positionWithinBounds:ys,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),xs=[je("useFixed",c),Pe("getBounds")],Cs=Fa({fields:xs,name:"positioning",active:qa,apis:ws}),Ss=function(t){Fr(t,Rr());var e=t.components();j(e,Ss)},ks=function(t){var e=t.components();j(e,ks),Fr(t,Nr())},Os=function(t,e){Oo(t.element,e.element)},Ts=function(t,e){var n=t.components();!function(t){j(t.components(),(function(t){return Eo(t.element)})),_o(t.element),t.syncComponents()}(t);var r=Z(n,e);j(r,(function(e){Ss(e),t.getSystem().removeFromWorld(e)})),j(e,(function(e){e.getSystem().isConnected()?Os(t,e):(t.getSystem().addToWorld(e),Os(t,e),Ni(t.element)&&ks(e)),t.syncComponents()}))},_s=function(t,e){Es(t,e,Oo)},Es=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ni(t.element)&&ks(e),t.syncComponents()},As=function(t){Ss(t),Eo(t.element),t.getSystem().removeFromWorld(t)},Ns=function(t){var e=bo(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));As(t),e.each((function(t){t.syncComponents()}))},Rs=function(t){var e=t.components();j(e,As),_o(t.element),t.syncComponents()},Ms=function(t,e){zs(t,e,Oo)},zs=function(t,e,n){n(t,e.element);var r=wo(e.element);j(r,(function(t){e.getByDom(t).each(ks)}))},Ds=function(t){var e=wo(t.element);j(e,(function(e){t.getByDom(e).each(Ss)})),Eo(t.element)},Bs=function(t,e,n,r){n.get().each((function(e){Rs(t)}));var o=e.getAttachPoint(t);_s(o,t);var i=t.getSystem().build(r);return _s(t,i),n.set(i),i},Ps=function(t,e,n,r){var o=Bs(t,e,n,r);return e.onOpen(t,o),o},Is=function(t,e,n){n.get().each((function(r){Rs(t),Ns(t),e.onClose(t,r),n.clear()}))},Ls=function(t,e,n){return n.isOpen()},Hs=function(t,e,n){var r=e.getAttachPoint(t);Bi(t.element,"position",Cs.getMode(r)),function(t,e,n,r){Fi(t.element,e).fold((function(){Io(t.element,n)}),(function(e){zo(t.element,n,e)})),Bi(t.element,e,"hidden")}(t,"visibility",e.cloakVisibilityAttr)},Fs=function(t,e,n){(function(t){return L(["top","left","right","bottom"],(function(e){return Fi(t,e).isSome()}))})(t.element)||Ui(t.element,"position"),function(t,e,n){Bo(t.element,n).fold((function(){return Ui(t.element,e)}),(function(n){return Bi(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Vs=Object.freeze({__proto__:null,cloak:Hs,decloak:Fs,open:Ps,openWhileCloaked:function(t,e,n,r,o){Hs(t,e),Ps(t,e,n,r),o(),Fs(t,e)},close:Is,isOpen:Ls,isPartOf:function(t,e,n,r){return Ls(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Bs(t,e,n,r)}))}}),js=Object.freeze({__proto__:null,events:function(t,e){return $r([Kr(Sr(),(function(n,r){Is(n,t,e)}))])}}),Us=[Ku("onOpen"),Ku("onClose"),_e("isPartOf"),_e("getAttachPoint"),je("cloakVisibilityAttr","data-precloak-visibility")],Ws=Fa({fields:Us,name:"sandboxing",active:js,apis:Vs,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=r("not-implemented");return ui({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(x.none())},set:function(e){t.set(x.some(e))},get:function(){return t.get()}})}})}),qs=r("dismiss.popups"),$s=r("reposition.popups"),Gs=r("mouse.released"),Xs=Qt([je("isExtraPart",c),Ve("fireEventInstead",[je("event",Mr())])]),Ks=function(t){var e,n=ge("Dismissal",Xs,t);return(e={})[qs()]={schema:Qt([_e("target")]),onReceive:function(t,e){Ws.isOpen(t)&&(Ws.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Ws.close(t)}),(function(e){return Fr(t,e.event)})))}},e},Ys=Qt([Ve("fireEventInstead",[je("event",zr())]),Me("doReposition")]),Js=function(t){var e,n=ge("Reposition",Ys,t);return(e={})[$s()]={onReceive:function(t){Ws.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Fr(t,e.event)}))}},e},Qs=function(t,e,n){e.store.manager.onLoad(t,e,n)},Zs=function(t,e,n){e.store.manager.onUnload(t,e,n)},tl=Object.freeze({__proto__:null,onLoad:Qs,onUnload:Zs,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),el=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[ro((function(n,r){Qs(n,t,e)})),oo((function(n,r){Zs(n,t,e)}))]:[Ba(t,e,Qs)];return $r(n)}}),nl=function(){var t=Qe(null);return ui({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},rl=function(){var t=Qe({}),e=Qe({});return ui({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Ot(t.get(),n).orThunk((function(){return Ot(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};j(n,(function(t){i[t.value]=t,Ot(t,"meta").each((function(e){Ot(e,"text").each((function(e){u[e]=t}))}))})),t.set(f(f({},r),i)),e.set(f(f({},o),u))},clear:function(){t.set({}),e.set({})}})},ol=Object.freeze({__proto__:null,memory:nl,dataset:rl,manual:function(){return ui({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),il=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},ul=[Pe("initialValue"),_e("getFallbackEntry"),_e("getDataKey"),_e("setValue"),Zu("manager",{setValue:il,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){il(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:rl})],al=[_e("getValue"),je("setValue",t),Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:t,state:ii.init})],cl=[Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:nl})],sl=[Ue("store",{mode:"memory"},ve("mode",{memory:cl,manual:al,dataset:ul})),Ku("onSetValue"),je("resetOnDom",!1)],ll=Fa({fields:sl,name:"representing",active:el,apis:tl,extra:{setValueFrom:function(t,e){var n=ll.getValue(e);ll.setValue(t,n)}},state:ol}),fl=function(t,e){return Ye(t,{},V(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,ie(n,n,It(),Yt((function(t){return gt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Je("dump",o)]))},dl=function(t){return t.dump},ml=function(t,e){return f(f({},t.dump),La(e))},gl=fl,hl=ml,pl="placeholder",vl=Et([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),bl=function(t){return Tt(t,"uiType")},yl=function(t,e,n,i){return function(t,e,n,o){return bl(n)&&n.uiType===pl?function(t,e,n,o){return t.exists((function(t){return t!==n.owner}))?vl.single(!0,r(n)):Ot(o,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+vt(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,o):vl.single(!1,r(n))}(t,0,n,i).fold((function(r,o){var u=bl(n)?o(e,n.config,n.validated):o(e),a=Ot(u,"components").getOr([]),c=Y(a,(function(n){return yl(t,e,n,i)}));return[f(f({},u),{components:c})]}),(function(t,r){if(bl(n)){var i=r(e,n.config,n.validated);return n.validated.preprocess.getOr(o)(i)}return r(e)}))},wl=vl.single,xl=vl.multiple,Cl=r(pl),Sl=Et([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),kl=je("factory",{sketch:o}),Ol=je("schema",[]),Tl=_e("name"),_l=ie("pname","pname",Lt((function(t){return"<alloy."+Uo(t.name)+">"})),be()),El=Je("schema",(function(){return[Pe("preprocess")]})),Al=je("defaults",r({})),Nl=je("overrides",r({})),Rl=Zt([kl,Ol,Tl,_l,Al,Nl]),Ml=Zt([kl,Ol,Tl,Al,Nl]),zl=Zt([kl,Ol,Tl,_l,Al,Nl]),Dl=Zt([kl,El,Tl,_e("unit"),_l,Al,Nl]),Bl=function(t){return t.fold(x.some,x.none,x.some,x.some)},Pl=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Il=function(t,e){return function(n){var r=ge("Converting part type",e,n);return t(r)}},Ll=Il(Sl.required,Rl),Hl=Il(Sl.external,Ml),Fl=Il(Sl.optional,zl),Vl=Il(Sl.group,Dl),jl=r("entirety"),Ul=Object.freeze({__proto__:null,required:Ll,external:Hl,optional:Fl,group:Vl,asNamedPart:Bl,name:Pl,asCommon:function(t){return t.fold(o,o,o,o)},original:jl}),Wl=function(t,e,n,r){return Rt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},ql=function(t,e){var n={};return j(e,(function(e){Bl(e).each((function(e){var r=$l(t,e.pname);n[e.name]=function(n){var o=ge("Part: "+e.name+" in "+t,Zt(e.schema),n);return f(f({},r),{config:n,validated:o})}}))})),n},$l=function(t,e){return{uiType:Cl(),owner:t,name:e}},Gl=function(t,e,n){return{uiType:Cl(),owner:t,name:e,config:n,validated:{}}},Xl=function(t){return Y(t,(function(t){return t.fold(x.none,x.some,x.none,x.none).map((function(t){return ze(t.name,t.schema.concat([ta(jl())]))})).toArray()}))},Kl=function(t){return V(t,Pl)},Yl=function(t,e,n){return function(t,e,n){var o={},i={};return j(n,(function(t){t.fold((function(t){o[t.pname]=wl(!0,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];i[t.name]=r(t.factory.sketch(Wl(e,t,n[jl()]),n))}),(function(t){o[t.pname]=wl(!1,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){o[t.pname]=xl(!0,(function(e,n,r){var o=e[t.name];return V(o,(function(n){return t.factory.sketch(Rt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:r(o),externals:r(i)}}(0,e,n)},Jl=function(t,e,n){return function(t,e,n,o){var i=wt(o,(function(t,e){return o=t,i=!1,{name:r(n=e),required:function(){return o.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+n);return i=!0,o}};var n,o,i})),u=function(t,e,n,r){return Y(n,(function(n){return yl(t,e,n,r)}))}(t,e,n,i);return yt(i,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),u}(x.some(t),e,e.components,n)},Ql=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Zl=function(t,e,n){return Ql(t,e,n).getOrDie("Could not find part: "+n)},tf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]))})),o},ef=function(t,e){var n=t.getSystem();return wt(e.partUids,(function(t,e){return r(n.getByUid(t))}))},nf=function(t){return vt(t.partUids)},rf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]).getOrDie())})),o},of=function(t,e){var n=Kl(e);return jt(V(n,(function(e){return{key:e,value:t+"-"+e}})))},uf=function(t){return ie("partUids","partUids",Ht((function(e){return of(e.uid,t)})),be())},af=Object.freeze({__proto__:null,generate:ql,generateOne:Gl,schemas:Xl,names:Kl,substitutes:Yl,components:Jl,defaultUids:of,defaultUidsSchema:uf,getAllParts:ef,getAllPartNames:nf,getPart:Ql,getPartOrDie:Zl,getParts:tf,getPartsOrDie:rf}),cf=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[ze("parts",t)]:[]).concat([_e("uid"),je("dom",{}),je("components",[]),ta("originalSpec"),je("debug.sketcher",{})]).concat(e)}(r,o);return ge(t+" [SpecSchema]",Qt(i.concat(e)),n)},sf=function(t,e,n,r,o){var i=lf(o),u=Xl(n),a=uf(n),c=cf(t,e,i,u,[a]),s=Yl(0,c,n);return r(c,Jl(t,c,s.internals()),i,s.externals())},lf=function(t){return function(t){return Tt(t,"uid")}(t)?t:f(f({},t),{uid:Yo("uid")})},ff=Qt([_e("name"),_e("factory"),_e("configFields"),je("apis",{}),je("extraApis",{})]),df=Qt([_e("name"),_e("factory"),_e("configFields"),_e("partFields"),je("apis",{}),je("extraApis",{})]),mf=function(t){var e=ge("Sketcher for "+t.name,ff,t),n=wt(e.apis,oi),r=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=lf(r);return n(cf(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},gf=function(t){var e=ge("Sketcher for "+t.name,df,t),n=ql(e.name,e.partFields),r=wt(e.apis,oi),o=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return sf(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},hf=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},pf=function(t,e){return t?x.some(e):x.none()},vf=function(t){return"input"===ao(t)&&"radio"!==Do(t,"type")||"textarea"===ao(t)},bf=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),yf=[_e("find")],wf=Fa({fields:yf,name:"composing",apis:bf}),xf=function(t,e,n,r){var o=Fc(t.element,"."+e.highlightClass);j(o,(function(n){L(r,(function(t){return t.element===n}))||(bi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Fr(n,Hr())})))}))},Cf=function(t,e,n,r){xf(t,e,0,[r]),Sf(t,e,n,r)||(vi(r.element,e.highlightClass),e.onHighlight(t,r),Fr(r,Lr()))},Sf=function(t,e,n,r){return yi(r.element,e.highlightClass)},kf=function(t,e,n){return zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Of=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return(r.length>0?x.some(r[r.length-1]):x.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Tf=function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return X(o,(function(t){return yi(t,e.highlightClass)})).bind((function(e){var n=ic(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},_f=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return hf(V(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ef=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return xf(t,e,0,[])},dehighlight:function(t,e,n,r){Sf(t,e,n,r)&&(bi(r.element,e.highlightClass),e.onDehighlight(t,r),Fr(r,Hr()))},highlight:Cf,highlightFirst:function(t,e,n){kf(t,e).each((function(r){Cf(t,e,n,r)}))},highlightLast:function(t,e,n){Of(t,e).each((function(r){Cf(t,e,n,r)}))},highlightAt:function(t,e,n,r){(function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return x.from(o[r]).fold((function(){return ct.error("No element found with index "+r)}),t.getSystem().getByDom)})(t,e,0,r).fold((function(t){throw new Error(t)}),(function(r){Cf(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=_f(t,e);G(o,r).each((function(r){Cf(t,e,n,r)}))},isHighlighted:Sf,getHighlighted:function(t,e,n){return zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:kf,getLast:Of,getPrevious:function(t,e,n){return Tf(t,e,0,-1)},getNext:function(t,e,n){return Tf(t,e,0,1)},getCandidates:_f}),Af=[_e("highlightClass"),_e("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],Nf=Fa({fields:Af,name:"highlighting",apis:Ef}),Rf=[8],Mf=[9],zf=[13],Df=[27],Bf=[32],Pf=[37],If=[38],Lf=[39],Hf=[40],Ff=function(t,e,n){var r=Q(t.slice(0,e)),o=Q(t.slice(e+1));return G(r.concat(o),n)},Vf=function(t,e,n){var r=Q(t.slice(0,e));return G(r,n)},jf=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return G(o.concat(r),n)},Uf=function(t,e,n){var r=t.slice(e+1);return G(r,n)},Wf=function(t){return function(e){var n=e.raw;return I(t,n.which)}},qf=function(t){return function(e){return J(t,(function(t){return t(e)}))}},$f=function(t){return!0===t.raw.shiftKey},Gf=function(t){return!0===t.raw.ctrlKey},Xf=u($f),Kf=function(t,e){return{matches:t,classification:e}},Yf=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Vn(e,t)}))}))||Vr(t,Dr(),{prevFocus:e,newFocus:n})},Jf=function(){var t=function(t){return Xa(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Yf(e,r,o)}}},Qf=function(){var e=function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))};return{get:e,set:function(n,r){var o=e(n);n.getSystem().getByDom(r).fold(t,(function(t){Nf.highlight(n,t)}));var i=e(n);Yf(n,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Bc||(Bc={}));var Zf=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u;return(i=n(t,e,r,o),u=e.event,G(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([je("focusManager",Jf()),Ue("focusInside","onFocus",le((function(t){return I(["onFocus","onEnterOrSpace","onApi"],t)?ct.value(t):ct.error("Invalid value for focusInside")}))),Zu("handler",u),Zu("state",e),Zu("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Bc.OnFocusMode?x.none():o(t).map((function(n){return Kr(hr(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Kr(ur(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=Wf(Bf.concat(zf))(r.event);t.focusInside===Bc.OnEnterOrSpaceMode&&i&&$n(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Kr(ar(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return $r(u.toArray().concat(a))}};return u},td=function(t){var e=[Pe("onEscape"),Pe("onEnter"),je("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),je("firstTabstop",0),je("useTabstopAt",s),Pe("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Du(e,t)})).getOr(e);return ru(n)>0},o=function(t,e,r){(function(t,e){var r=Fc(t.element,e.selector),o=W(r,(function(t){return n(e,t)}));return x.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},u=function(t,e,r,o){var u=Fc(t.element,r.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,r).bind((function(e){return X(u,i(Vn,e)).bind((function(e){return function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?x.some(!0):x.none()}),(function(e){return o.focusManager.set(t,e),x.some(!0)}))}(t,u,e,r,o)}))}))},a=r([Kf(qf([$f,Wf(Mf)]),(function(t,e,n){var r=n.cyclic?Ff:Vf;return u(t,0,n,r)})),Kf(Wf(Mf),(function(t,e,n){var r=n.cyclic?jf:Uf;return u(t,0,n,r)})),Kf(Wf(Df),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Kf(qf([Xf,Wf(zf)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),c=r([]);return Zf(e,ii.init,a,c,(function(){return x.some(o)}))},ed=td(Je("cyclic",c)),nd=td(Je("cyclic",s)),rd=function(t,e,n){return vf(n)&&Wf(Bf)(e.event)?x.none():function(t,e,n){return Ur(t,n,yr()),x.some(!0)}(t,0,n)},od=function(t,e){return x.some(!0)},id=[je("execute",rd),je("useSpace",!1),je("useEnter",!0),je("useControlEnter",!1),je("useDown",!1)],ud=function(t,e,n){return n.execute(t,e,t.element)},ad=Zf(id,ii.init,(function(t,e,n,r){var o=n.useSpace&&!vf(t.element)?Bf:[],i=n.useEnter?zf:[],u=n.useDown?Hf:[],a=o.concat(i).concat(u);return[Kf(Wf(a),ud)].concat(n.useControlEnter?[Kf(qf([Gf,Wf(zf)]),ud)]:[])}),(function(t,e,n,r){return n.useSpace&&!vf(t.element)?[Kf(Wf(Bf),od)]:[]}),(function(){return x.none()})),cd=function(){var t=Qe(x.none());return ui({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(x.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},sd=Object.freeze({__proto__:null,flatgrid:cd,init:function(t){return t.state(t)}}),ld=function(t){return function(e,n,r,o){var i=t(e.element);return gd(i,e,n,r,o)}},fd=function(t,e){var n=vc(t,e);return ld(n)},dd=function(t,e){var n=vc(e,t);return ld(n)},md=function(t){return function(e,n,r,o){return gd(t,e,n,r,o)}},gd=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},hd=md,pd=md,vd=md,bd=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},yd=function(t,e,n){var r=Fc(t,n);return function(t,n){return X(t,(function(t){return Vn(t,e)})).map((function(e){return{index:e,candidates:t}}))}(W(r,bd))},wd=function(t,e){return X(t,(function(t){return Vn(e,t)}))},xd=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?x.some(t[r]):x.none()}))},Cd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=ic(i,o,0,u-1);return x.some({row:e,column:a})}))},Sd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=ic(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=uc(i,0,a-1);return x.some({row:u,column:c})}))},kd=[_e("selector"),je("execute",rd),Yu("onEscape"),je("captureTab",!1),ea()],Od=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Td=function(t){return function(e,n,r,o){return yd(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},_d=function(t,e,n){return n.captureTab?x.some(!0):x.none()},Ed=Td((function(t,e,n,r){return Cd(t,e,n,r,-1)})),Ad=Td((function(t,e,n,r){return Cd(t,e,n,r,1)})),Nd=Td((function(t,e,n,r){return Sd(t,e,n,r,-1)})),Rd=Td((function(t,e,n,r){return Sd(t,e,n,r,1)})),Md=r([Kf(Wf(Pf),fd(Ed,Ad)),Kf(Wf(Lf),dd(Ed,Ad)),Kf(Wf(If),hd(Nd)),Kf(Wf(Hf),pd(Rd)),Kf(qf([$f,Wf(Mf)]),_d),Kf(qf([Xf,Wf(Mf)]),_d),Kf(Wf(Df),(function(t,e,n){return n.onEscape(t,e)})),Kf(Wf(Bf.concat(zf)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),zd=r([Kf(Wf(Bf),od)]),Dd=Zf(kd,cd,Md,zd,(function(){return x.some(Od)})),Bd=function(t,e,n,r){var o=function(t,e,n){var i,u=ic(e,r,0,n.length-1);return u===t?x.none():(i=n[u],"button"===ao(i)&&"disabled"===Do(i,"disabled")?o(t,u,n):x.from(n[u]))};return yd(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Pd=[_e("selector"),je("getInitial",x.none),je("execute",rd),Yu("onEscape"),je("executeOnMove",!1),je("allowVertical",!0)],Id=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Ld=function(t,e,n){e.getInitial(t).orThunk((function(){return zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Hd=function(t,e,n){return Bd(t,n.selector,e,-1)},Fd=function(t,e,n){return Bd(t,n.selector,e,1)},Vd=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Id(e,n,r):x.some(!0)}))}},jd=function(t,e,n){return n.onEscape(t,e)},Ud=r([Kf(Wf(Bf),od)]),Wd=Zf(Pd,ii.init,(function(t,e,n,r){var o=Pf.concat(n.allowVertical?If:[]),i=Lf.concat(n.allowVertical?Hf:[]);return[Kf(Wf(o),Vd(fd(Hd,Fd))),Kf(Wf(i),Vd(dd(Hd,Fd))),Kf(Wf(zf),Id),Kf(Wf(Bf),Id),Kf(Wf(Df),jd)]}),Ud,(function(){return x.some(Ld)})),qd=function(t,e,n){return x.from(t[e]).bind((function(t){return x.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},$d=function(t,e,n,r){var o=t[e].length,i=ic(n,r,0,o-1);return qd(t,e,i)},Gd=function(t,e,n,r){var o=ic(n,r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Xd=function(t,e,n,r){var o=t[e].length,i=uc(n+r,0,o-1);return qd(t,e,i)},Kd=function(t,e,n,r){var o=uc(n+r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Yd=[ze("selectors",[_e("row"),_e("cell")]),je("cycles",!0),je("previousSelector",x.none),je("execute",rd)],Jd=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return zu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Qd=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Du(r,o.selectors.row).bind((function(t){var e=Fc(t,o.selectors.cell);return wd(e,r).bind((function(e){var r=Fc(n,o.selectors.row);return wd(r,t).bind((function(t){var n=function(t,e){return V(t,(function(t){return Fc(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Zd=Qd((function(t,e,n){return $d(t,e,n,-1)}),(function(t,e,n){return Xd(t,e,n,-1)})),tm=Qd((function(t,e,n){return $d(t,e,n,1)}),(function(t,e,n){return Xd(t,e,n,1)})),em=Qd((function(t,e,n){return Gd(t,n,e,-1)}),(function(t,e,n){return Kd(t,n,e,-1)})),nm=Qd((function(t,e,n){return Gd(t,n,e,1)}),(function(t,e,n){return Kd(t,n,e,1)})),rm=r([Kf(Wf(Pf),fd(Zd,tm)),Kf(Wf(Lf),dd(Zd,tm)),Kf(Wf(If),hd(em)),Kf(Wf(Hf),pd(nm)),Kf(Wf(Bf.concat(zf)),(function(t,e,n){return Xa(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),om=r([Kf(Wf(Bf),od)]),im=Zf(Yd,ii.init,rm,om,(function(){return x.some(Jd)})),um=[_e("selector"),je("execute",rd),je("moveOnTab",!1)],am=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},cm=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},sm=function(t,e,n){return Bd(t,n.selector,e,-1)},lm=function(t,e,n){return Bd(t,n.selector,e,1)},fm=r([Kf(Wf(If),vd(sm)),Kf(Wf(Hf),vd(lm)),Kf(qf([$f,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(sm)(t,e,n,r):x.none()})),Kf(qf([Xf,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(lm)(t,e,n,r):x.none()})),Kf(Wf(zf),am),Kf(Wf(Bf),am)]),dm=r([Kf(Wf(Bf),od)]),mm=Zf(um,ii.init,fm,dm,(function(){return x.some(cm)})),gm=[Yu("onSpace"),Yu("onEnter"),Yu("onShiftEnter"),Yu("onLeft"),Yu("onRight"),Yu("onTab"),Yu("onShiftTab"),Yu("onUp"),Yu("onDown"),Yu("onEscape"),je("stopSpaceKeyup",!1),Pe("focusIn")],hm=Zf(gm,ii.init,(function(t,e,n){return[Kf(Wf(Bf),n.onSpace),Kf(qf([Xf,Wf(zf)]),n.onEnter),Kf(qf([$f,Wf(zf)]),n.onShiftEnter),Kf(qf([$f,Wf(Mf)]),n.onShiftTab),Kf(qf([Xf,Wf(Mf)]),n.onTab),Kf(Wf(If),n.onUp),Kf(Wf(Hf),n.onDown),Kf(Wf(Pf),n.onLeft),Kf(Wf(Lf),n.onRight),Kf(Wf(Bf),n.onSpace),Kf(Wf(Df),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Kf(Wf(Bf),od)]:[]}),(function(t){return t.focusIn})),pm=ed.schema(),vm=nd.schema(),bm=Wd.schema(),ym=Dd.schema(),wm=im.schema(),xm=ad.schema(),Cm=mm.schema(),Sm=hm.schema(),km=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:pm,cyclic:vm,flow:bm,flatgrid:ym,matrix:wm,execution:xm,menu:Cm,special:Sm}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return _t(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:sd}),Om=function(t,e,n,r){var o=t.getSystem().build(r);Es(t,o,n)},Tm=function(t,e,n,r){var o=_m(t);G(o,(function(t){return Vn(r.element,t.element)})).each(Ns)},_m=function(t,e){return t.components()},Em=function(t,e,n,r,o){var i=_m(t);return x.from(i[r]).map((function(e){return Tm(t,0,0,e),o.each((function(e){Om(t,0,(function(t,e){!function(t,e,n){xo(t,n).fold((function(){Oo(t,e)}),(function(t){Co(t,e)}))}(t,e,r)}),e)})),e}))},Am=Fa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Om(t,0,Oo,r)},prepend:function(t,e,n,r){Om(t,0,ko,r)},remove:Tm,replaceAt:Em,replaceBy:function(t,e,n,r,o){var i=_m(t);return X(i,r).bind((function(e){return Em(t,0,0,e,o)}))},set:function(t,e,n,r){Ka((function(){var e=V(r,t.getSystem().build);Ts(t,e)}),t.element)},contents:_m})}),Nm=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=$r(e);return Fa({fields:[_e("enabled")],name:t,active:{events:r(n)}})}(t,e),configAsRaw:r({}),initialConfig:{},state:ii}}},Rm=function(t,e){e.ignore||($a(t.element),e.onFocus(t))},Mm=Object.freeze({__proto__:null,focus:Rm,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return function(t){var e=Ti(t).dom;return t.dom===e.activeElement}(t.element)}}),zm=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return ci(n)},events:function(t){return $r([Kr(hr(),(function(e,n){Rm(e,t),n.stop()}))].concat(t.stopMousedown?[Kr(Zn(),(function(t,e){e.event.prevent()}))]:[]))}}),Dm=[Ku("onFocus"),je("stopMousedown",!1),je("ignore",!1)],Bm=Fa({fields:Dm,name:"focusing",active:zm,apis:Mm}),Pm=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Im=function(t,e,n){e.toggleClass.each((function(e){n.get()?vi(t.element,e):bi(t.element,e)}))},Lm=function(t,e,n){Vm(t,e,n,!n.get())},Hm=function(t,e,n){n.set(!0),Im(t,e,n),Pm(t,e,n)},Fm=function(t,e,n){n.set(!1),Im(t,e,n),Pm(t,e,n)},Vm=function(t,e,n,r){(r?Hm:Fm)(t,e,n)},jm=function(t,e,n){Vm(t,e,n,e.selected)},Um=Object.freeze({__proto__:null,onLoad:jm,toggle:Lm,isOn:function(t,e,n){return n.get()},on:Hm,off:Fm,set:Vm}),Wm=Object.freeze({__proto__:null,exhibit:function(){return ci({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Lm,uo((function(t){o(t,n,r)}))),u=Ba(t,e,jm);return $r(K([t.toggleOnExecute?[i]:[],[u]]))}}),qm=function(t,e,n){zo(t.element,"aria-expanded",n)},$m=[je("selected",!1),Pe("toggleClass"),je("toggleOnExecute",!0),Ue("aria",{mode:"none"},ve("mode",{pressed:[je("syncWithExpanded",!1),Zu("update",(function(t,e,n){zo(t.element,"aria-pressed",n),e.syncWithExpanded&&qm(t,0,n)}))],checked:[Zu("update",(function(t,e,n){zo(t.element,"aria-checked",n)}))],expanded:[Zu("update",qm)],selected:[Zu("update",(function(t,e,n){zo(t.element,"aria-selected",n)}))],none:[Zu("update",t)]}))],Gm=Fa({fields:$m,name:"toggling",active:Wm,apis:Um,state:(!1,{init:function(){var t=Qe(false);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(false)},readState:function(){return t.get()}}}})}),Xm=function(){var t=function(t,e){e.stop(),jr(t)};return[Kr(lr(),t),Kr(xr(),t),to(Kn()),to(Zn())]},Km=function(t){return $r(K([t.map((function(t){return uo((function(e,n){t(e),n.stop()}))})).toArray(),Xm()]))},Ym="alloy.item-hover",Jm="alloy.item-focus",Qm=function(t){(Xa(t.element).isNone()||Bm.isFocused(t))&&(Bm.isFocused(t)||Bm.focus(t),Vr(t,Ym,{item:t}))},Zm=function(t){Vr(t,Jm,{item:t})},tg=r(Ym),eg=r(Jm),ng=[_e("data"),_e("components"),_e("dom"),je("hasSubmenu",!1),Pe("toggling"),gl("itemBehaviours",[Gm,Bm,km,ll]),je("ignoreFocus",!1),je("domModification",{}),Zu("builder",(function(t){return{dom:t.dom,domModification:f(f({},t.domModification),{attributes:f(f(f({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:hl(t.itemBehaviours,[t.toggling.fold(Gm.revoke,(function(t){return Gm.config(f({aria:{mode:"checked"}},t))})),Bm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"execution"}),ll.config({store:{mode:"memory",initialValue:t.data}}),Nm("item-type-events",m(Xm(),[Kr(rr(),Qm),Kr(wr(),Bm.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),je("eventOrder",{})],rg=[_e("dom"),_e("components"),Zu("builder",(function(t){return{dom:t.dom,components:t.components,events:$r([eo(wr())])}}))],og=r([Ll({name:"widget",overrides:function(t){return{behaviours:La([ll.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),ig=[_e("uid"),_e("data"),_e("components"),_e("dom"),je("autofocus",!1),je("ignoreFocus",!1),gl("widgetBehaviours",[ll,Bm,km]),je("domModification",{}),uf(og()),Zu("builder",(function(t){var e=Yl(0,t,og()),n=Jl("item-widget",t,e.internals()),r=function(e){return Ql(e,t,"widget").map((function(t){return km.focusIn(t),t}))},o=function(e,n){return vf(n.event.target)?x.none():t.autofocus?(n.setSource(e.element),x.none()):x.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:$r([uo((function(t,e){r(t).each((function(t){e.stop()}))})),Kr(rr(),Qm),Kr(wr(),(function(e,n){t.autofocus?r(e):Bm.focus(e)}))]),behaviours:hl(t.widgetBehaviours,[ll.config({store:{mode:"memory",initialValue:t.data}}),Bm.config({ignore:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Ua(),onLeft:o,onRight:o,onEscape:function(e,n){return Bm.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),x.none()):x.none():(Bm.focus(e),x.some(!0))}})])}}))],ug=ve("type",{widget:ig,item:ng,separator:rg}),ag=r([Vl({factory:{sketch:function(t){var e=ge("menu.spec item",ug,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:f(f({},e),{uid:Yo("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),cg=r([_e("value"),_e("items"),_e("dom"),_e("components"),je("eventOrder",{}),fl("menuBehaviours",[Nf,ll,wf,km]),Ue("movement",{mode:"menu",moveOnTab:!0},ve("mode",{grid:[ea(),Zu("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Zu("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),_e("rowSelector")],menu:[je("moveOnTab",!0),Zu("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Ee("markers",Wu()),je("fakeFocus",!1),je("focusManager",Jf()),Ku("onHighlight")]),sg=r("alloy.menu-focus"),lg=gf({name:"Menu",configFields:cg(),partFields:ag(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.menuBehaviours,[Nf.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),ll.config({store:{mode:"memory",initialValue:t.value}}),wf.config({find:x.some}),km.config(t.movement.config(t,t.movement))]),events:$r([Kr(eg(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Nf.highlight(t,n),e.stop(),Vr(t,sg(),{menu:t,item:n})}))})),Kr(tg(),(function(t,e){var n=e.event.item;Nf.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),fg=function(t,e,n,r){return Ot(n,r).bind((function(r){return Ot(t,r).bind((function(r){var o=fg(t,e,n,r);return x.some([r].concat(o))}))})).getOr([])},dg=function(t){return"prepared"===t.type?x.some(t.menu):x.none()},mg=function(){var t=Qe({}),e=Qe({}),n=Qe({}),r=Qe(x.none()),o=Qe({}),i=function(t){return u(t).bind(dg)},u=function(t){return Ot(e.get(),t)},a=function(e){return Ot(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(f(f({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(x.some(i)),t.set(a),e.set(u),o.set(c);var s=function(t,e){var n={};yt(t,(function(t,e){j(t,(function(t){n[t]=e}))}));var r=e,o=xt(e,(function(t,e){return{k:t,v:e}})),i=wt(o,(function(t,e){return[e].concat(fg(n,r,o,e))}));return wt(n,(function(t){return Ot(i,t).getOr([t])}))}(c,a);n.set(s)},expand:function(e){return Ot(t.get(),e).map((function(t){var r=Ot(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Ot(n.get(),t)},collapse:function(t){return Ot(n.get(),t).bind((function(t){return t.length>1?x.some(t.slice(1)):x.none()}))},lookupMenu:u,lookupItem:a,otherMenus:function(t){var e=o.get();return Z(vt(e),t)},getPrimary:function(){return r.get().bind(i)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(x.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(e,o){var u=W(a(e).toArray(),(function(t){return i(t).isSome()}));return Ot(n.get(),e).bind((function(e){var n=Q(u.concat(e));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return x.none();e.push(r.getOrDie())}return x.some(e)}(Y(n,(function(e,u){return function(e,n,r){return i(e).bind((function(o){return function(e){return St(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))}(e,o,n.slice(0,u+1)).fold((function(){return r.get().is(e)?[]:[x.none()]}),(function(t){return[x.some(t)]}))})))}))}}},gg=dg,hg=r("collapse-item"),pg=mf({name:"TieredMenu",configFields:[Qu("onExecute"),Qu("onEscape"),Ju("onOpenMenu"),Ju("onOpenSubmenu"),Ku("onRepositionMenu"),Ku("onCollapseMenu"),je("highlightImmediately",!0),ze("data",[_e("primary"),_e("menus"),_e("expansions")]),je("fakeFocus",!1),Ku("onHighlight"),Ku("onHover"),$u(),_e("dom"),je("navigateOnHover",!0),je("stayInDom",!1),fl("tmenuBehaviours",[km,Nf,wf,Am]),je("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Qe(x.none()),o=mg(),i=function(t){return ll.getValue(t).value},u=function(e){return wt(t.data.menus,(function(t,e){return Y(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},a=function(t,e){Nf.highlight(t,e),Nf.getHighlighted(e).orThunk((function(){return Nf.getFirst(e)})).each((function(e){Ur(t,e.element,wr())}))},c=function(t,e){return hf(V(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?x.some(t.menu):x.none()}))})))},s=function(e,n,r){var o=c(n,n.otherMenus(r));j(o,(function(n){xi(n.element,[t.markers.backgroundMenu]),t.stayInDom||Am.remove(e,n)}))},l=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=Fc(e.element,"."+t.markers.item),u=W(o,(function(t){return"true"===Do(t,"aria-haspopup")}));return j(u,(function(t){e.getSystem().getByDom(t).each((function(t){var e=i(t);n[e]=t}))})),r.set(x.some(n)),n}))}(e);yt(o,(function(t,e){var r=I(n,e);zo(t.element,"aria-expanded",r)}))},d=function(e,n,r){return x.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return x.none();var i=o.menu,u=c(n,r.slice(1));return j(u,(function(e){vi(e.element,t.markers.backgroundMenu)})),Ni(i.element)||Am.append(e,tu(i)),xi(i.element,[t.markers.backgroundMenu]),a(e,i),s(e,n,r),x.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,u){void 0===u&&(u=n.HighlightSubmenu);var a=i(r);return o.expand(a).bind((function(i){return l(e,i),x.from(i[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ni(s.element)||Am.append(e,tu(s)),t.onOpenSubmenu(e,r,s,Q(i)),u===n.HighlightSubmenu?(Nf.highlightFirst(s),d(e,o,i)):(Nf.dehighlightAll(s),x.some(r))}))}))}))},g=function(e,n){var r=i(n);return o.collapse(r).bind((function(r){return l(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},h=function(e){return function(n,r){return Du(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},p=$r([Kr(sg(),(function(t,e){var n=e.event.item;o.lookupItem(i(n)).each((function(){var n=e.event.menu;Nf.highlight(t,n);var r=i(e.event.item);o.refresh(r).each((function(e){return s(t,o,e)}))}))})),uo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===i(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),ro((function(e,n){(function(e){var n=function(e,n,r){return wt(r,(function(r,o){var i=function(){return lg.sketch(f(f({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Qf():Jf()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()})(e).each((function(n){Am.append(e,tu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&a(e,n)}))}))].concat(t.navigateOnHover?[Kr(tg(),(function(e,r){var u=r.event.item;!function(t,e){var n=i(e);o.refresh(n).bind((function(e){return l(t,e),d(t,o,e)}))}(e,u),m(e,u,n.HighlightParent),t.onHover(e,u)}))]:[])),v=function(t){return Nf.getHighlighted(t).bind(Nf.getHighlighted)},b={collapseMenu:function(t){v(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){a(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return v(e).bind((function(t){var e=i(t),n=kt(o.getMenus()),r=hf(V(n,gg));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return it(e,(function(t){if(!t.getSystem().isConnected())return x.none();var e=Nf.getCandidates(t);return G(e,(function(t){return i(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return x.from(t.components()[0]).filter((function(t){return"menu"===Do(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.tmenuBehaviours,[km.config({mode:"special",onRight:h((function(t,e){return vf(e.element)?x.none():m(t,e,n.HighlightSubmenu)})),onLeft:h((function(t,e){return vf(e.element)?x.none():g(t,e)})),onEscape:h((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ur(t,e.element,wr())}))}}),Nf.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),wf.config({find:function(t){return Nf.getHighlighted(t)}}),Am.config({})]),eventOrder:t.eventOrder,apis:b,events:p}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Vt(t,e),expansions:{}}},collapseItem:function(t){return{value:Uo(hg()),meta:{text:t}}}}}),vg=mf({name:"InlineView",configFields:[_e("lazySink"),Ku("onShow"),Ku("onHide"),Fe("onEscape"),fl("inlineBehaviours",[Ws,ll,Wa]),Ve("fireDismissalEventInstead",[je("event",Mr())]),Ve("fireRepositionEventInstead",[je("event",zr())]),je("getRelated",x.none),je("isExtraPart",c),je("eventOrder",x.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return ku(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Ws.openWhileCloaked(e,r,(function(){return Cs.positionWithinBounds(i,n,e,o())})),ll.setValue(e,x.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Ra()},onRtl:function(){return Ma()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return pg.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Ws.close(e),t.onEscape.map((function(t){return t(e)})),x.some(!0)},onExecute:function(){return x.some(!0)},onOpenMenu:function(t,e){Cs.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Cs.position(o,f({anchor:"submenu",item:e},a(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Cs.positionWithinBounds(u,n,e,o()),j(r,(function(t){var e=a(t.triggeringPath);Cs.position(u,f({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})}(t,e,n,r,o);Ws.open(e,i),ll.setValue(e,x.some({mode:"menu",menu:i}))},i=function(e){Ws.isOpen(e)&&ll.getValue(e).each((function(n){switch(n.mode){case"menu":Ws.getState(e).each((function(t){pg.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Cs.positionWithinBounds(r,n.anchor,e,n.getBounds())}}))},u={setContent:function(t,e){Ws.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,x.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,(function(){return x.none()}))},showMenuWithinBounds:o,hide:function(t){Ws.isOpen(t)&&(ll.setValue(t,x.none()),Ws.close(t))},getContent:function(t){return Ws.getState(t)},reposition:i,isOpen:Ws.isOpen};return{uid:t.uid,dom:t.dom,behaviours:ml(t.inlineBehaviours,[Ws.config({isPartOf:function(e,n,r){return Pu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return Pu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),ll.config({store:{mode:"memory",initialValue:x.none()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js(f(f({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),bg=function(t){return t.x},yg=function(t,e){return t.x+t.width/2-e.width/2},wg=function(t,e){return t.x+t.width-e.width},xg=function(t){return t.y},Cg=function(t,e){return t.y+t.height-e.height},Sg=function(t,e,n){return na(wg(t,e),Cg(t,e),n.innerSoutheast(),aa(),da(t,{right:0,bottom:3}),"layout-inner-se")},kg=function(t,e,n){return na(bg(t),Cg(t,e),n.innerSouthwest(),ua(),da(t,{left:1,bottom:3}),"layout-inner-sw")},Og=function(t,e,n){return na(wg(t,e),xg(t),n.innerNortheast(),ia(),da(t,{right:0,top:2}),"layout-inner-ne")},Tg=function(t,e,n){return na(bg(t),xg(t),n.innerNorthwest(),oa(),da(t,{left:1,top:2}),"layout-inner-nw")},_g=function(t,e,n){return na(yg(t,e),xg(t),n.innerNorth(),ca(),da(t,{top:2}),"layout-inner-n")},Eg=function(t,e,n){return na(yg(t,e),Cg(t,e),n.innerSouth(),sa(),da(t,{bottom:3}),"layout-inner-s")},Ag=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ng=mf({name:"Button",factory:function(t){var e=Km(t.action),n=t.dom.tag,r=function(e){return Ot(t.dom,"attributes").bind((function(t){return Ot(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:hl(t.buttonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return f({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[je("uid",void 0),_e("dom"),je("components",[]),gl("buttonBehaviours",[Bm,km]),Pe("action"),Pe("role"),je("eventOrder",{})]}),Rg=function(t){var e=function(t){return void 0!==t.uid}(t)&&_t(t,"uid")?t.uid:Yo("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return f(f({},t),{uid:e})}}},Mg=function(t){return x.from(t()["temporary-placeholder"]).getOr("!not found!")},zg=function(t,e){return x.from(e()[t.toLowerCase()]).getOrThunk((function(){return Mg(e)}))},Dg=function(t,e){return it(t,(function(t){return x.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Mg(e)}))},Bg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Pg=mf({name:"Notification",factory:function(t){var e=Rg({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:La([Am.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Rg({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:La([Am.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Am.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Am.set(r,[Yi(n)])}}},u=K([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return x.from(Bg[t])})).toArray()]),a=Rg(Ng.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),c=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Dg(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:La([Am.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:La([Bm.config({}),Nm("notification-events",[Kr(or(),(function(t){a.getOpt(t).each(Bm.focus)}))])]),components:c.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[a.asSpec()]:[]),apis:i}},configFields:[Pe("level"),_e("progress"),_e("icon"),_e("onAction"),_e("text"),_e("iconProvider"),_e("translationProvider"),Ge("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});var Ig,Lg=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Hg=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Fg=function(t,e,n,r,o){var i=Hg(t,(function(e){return function(t,e){return t.isBlock(e)||I(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return x.from(i.backwards(e,n,r,o))},Vg=function(t,e){return jg(rn(t.selection.getNode())).getOrThunk((function(){var n=tn('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Oo(n,rn(e.extractContents())),e.insertNode(n.dom),bo(n).each((function(t){return t.dom.normalize()})),function(t){return e=Hc,(n=function(t){for(var r=wo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return x.some(i);var u=n(i);if(u.isSome())return u}return x.none()})(t);var e,n}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===ao(t)?1:Ic(t).fold((function(){return wo(t).length}),(function(t){return t.length}))}(e))})),n}))},jg=function(t){return Du(t,"[data-mce-autocompleter]")},Ug=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Wg=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},qg=function(t,e){return t.substring(e.length)},$g=function(t,e,n,r){return void 0===r&&(r=0),jg(rn(e.startContainer)).fold((function(){return function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return x.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Fg(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Wg(o))return x.none();if(o===n)break}return x.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return x.none();var i=Ug(o);return 0!==i.lastIndexOf(n)||qg(i,n).length<r?x.none():x.some({text:qg(i,n),range:o,triggerChar:n})}))}(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Ug(r);return x.some({range:r,text:qg(o,n),triggerChar:n})}))},Gg=tinymce.util.Tools.resolve("tinymce.util.Promise"),Xg=function(t,e){return{container:t,offset:e}},Kg=function(t){if(function(t){return 3===t.nodeType}(t))return Xg(t,t.data.length);var e=t.childNodes;return e.length>0?Kg(e[e.length-1]):Xg(t,e.length)},Yg=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Yg(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Kg(n[n.length-1]):Xg(t,e)},Jg=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=W(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return function(t){return function(e){var n=Yg(e.startContainer,e.startOffset);return!function(t,e){return Fg(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Wg(e)})).isSome()}(t,n)}}(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return x.none();var a=Gg.all(V(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return x.some({lookupData:a,context:n})},Qg=Zt([Ne("type"),He("text")]),Zg=Zt([je("type","autocompleteitem"),je("active",!1),je("disabled",!1),je("meta",{}),Ne("value"),He("text"),He("icon")]),th=Zt([Ne("type"),Ne("ch"),We("minChars",1),je("columns",1),We("maxResults",10),Fe("matches"),Me("fetch"),Me("onAction"),Ke("highlightOn",[],xe)]),eh=[Ge("disabled",!1),He("tooltip"),He("icon"),He("text"),Xe("onSetup",(function(){return t}))],nh=Zt([Ne("type"),Me("onAction")].concat(eh)),rh=function(t){return de("toolbarbutton",nh,t)},oh=[Ge("active",!1)].concat(eh),ih=Zt(oh.concat([Ne("type"),Me("onAction")])),uh=function(t){return de("ToggleButton",ih,t)},ah=[Xe("predicate",(function(){return!1})),$e("scope","node",["node","editor"]),$e("position","selection",["node","selection","line"])],ch=eh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),sh=oh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),lh=eh.concat([je("type","contextformbutton")]),fh=oh.concat([je("type","contextformtogglebutton")]),dh=ve("type",{contextformbutton:ch,contextformtogglebutton:sh}),mh=Zt([je("type","contextform"),Xe("initValue",(function(){return""})),He("label"),Be("commands",dh),Ie("launch",ve("type",{contextformbutton:lh,contextformtogglebutton:fh}))].concat(ah)),gh=Zt([je("type","contexttoolbar"),Ne("items")].concat(ah));!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ig||(Ig={}));var hh,ph=Ig,vh="tox-menu-nav__js",bh="tox-collection__item",yh={normal:vh,color:"tox-swatch"},wh="tox-collection__item--enabled",xh="tox-collection__item-label",Ch="tox-collection__item-caret",Sh="tox-collection__item--active",kh="tox-collection__item-container",Oh="tox-collection__item-container--row",Th=function(t){return Ot(yh,t).getOr(vh)},_h=function(t){return"color"===t?"tox-swatches":"tox-menu"},Eh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:_h(t),tieredMenu:"tox-tiered-menu"}},Ah=function(t){var e=Eh(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Th(t)}},Nh=function(t,e,n){var r=Eh(n);return{tag:"div",classes:K([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Rh=[lg.parts.items({})],Mh=function(t,e,n){var r=Eh(n);return{dom:{tag:"div",classes:K([[r.tieredMenu]])},markers:Ah(n)}},zh=function(t,e){return function(n){var r=F(n,e);return V(r,(function(e){return{dom:t,components:e}}))}},Dh=function(t,e){var n=[],r=[];return j(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Tt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),V(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Bh=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[lg.parts.items({preprocess:function(n){return"auto"!==t&&t>1?zh({tag:"div",classes:["tox-collection__group"]},t)(n):Dh(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ph=function(t){return L(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Ih=function(t){return console.error(he(t)),console.log(t),x.none()},Lh=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[lg.parts.items({preprocess:function(t){return Dh(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},Hh=function(t,e,n,r,i){var u;return"color"===i?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[lg.parts.items({preprocess:"auto"!==t?zh({tag:"div",classes:["tox-swatches__row"]},t):o})]}]}}(r)).dom,components:u.components,items:n}:"normal"===i&&"auto"===r?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"normal"===i&&1===r?{value:t,dom:(u=Bh(1,n)).dom,components:u.components,items:n}:"normal"===i?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"listpreview"===i&&"auto"!==r?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[lg.parts.items({preprocess:zh({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:u.components,items:n}:{value:t,dom:Nh(e,r,i),components:Rh,items:n}},Fh=[Ne("type"),Ne("src"),He("alt"),Ke("classes",[],xe)],Vh=Zt(Fh),jh=[Ne("type"),Ne("text"),He("name"),Ke("classes",["tox-collection__item-label"],xe)],Uh=Zt(jh),Wh=se((function(){return pe("type",{cardimage:Vh,cardtext:Uh,cardcontainer:qh})})),qh=Zt([Ne("type"),qe("direction","horizontal"),qe("align","left"),qe("valign","middle"),Be("items",Wh)]),$h=[Ge("disabled",!1),He("text"),He("shortcut"),ie("value","value",Lt((function(){return Uo("menuitem-value")})),be()),je("meta",{})],Gh=Zt([Ne("type"),He("label"),Be("items",Wh),Xe("onSetup",(function(){return t})),Xe("onAction",t)].concat($h)),Xh=Zt([Ne("type"),Ge("active",!1),He("icon")].concat($h)),Kh=Zt([Ne("type"),Re("fancytype",["inserttable","colorswatch"]),Xe("onAction",t)]),Yh=Zt([Ne("type"),Xe("onSetup",(function(){return t})),Xe("onAction",t),He("icon")].concat($h)),Jh=Zt([Ne("type"),Me("getSubmenuItems"),Xe("onSetup",(function(){return t})),He("icon")].concat($h)),Qh=Zt([Ne("type"),He("icon"),Ge("active",!1),Xe("onSetup",(function(){return t})),Me("onAction")].concat($h)),Zh=function(t,e,n){var r=Fc(t.element,"."+n);if(r.length>0){var o=X(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return x.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return x.none()},tp=function(t){return function(t,e){return La([Nm(t,e)])}(Uo("unnamed-events"),t)},ep=[_e("lazySink"),_e("tooltipDom"),je("exclusive",!0),je("tooltipComponents",[]),je("delay",300),$e("mode","normal",["normal","follow-highlight"]),je("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:r([ka,Sa,ya,xa,wa,Ca]),onRtl:r([ka,Sa,ya,xa,wa,Ca])}}})),Ku("onHide"),Ku("onShow")],np=Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=Qe(x.none()),n=function(){t.get().each((function(t){clearTimeout(t)}))},o=r("not-implemented");return ui({getTooltip:function(){return e.get()},isShowing:function(){return e.get().isSome()},setTooltip:function(t){e.set(x.some(t))},clearTooltip:function(){e.set(x.none())},clearTimer:n,resetTimer:function(e,r){n(),t.set(x.some(setTimeout((function(){e()}),r)))},readState:o})}}),rp=Uo("tooltip.exclusive"),op=Uo("tooltip.show"),ip=Uo("tooltip.hide"),up=function(t,e,n){t.getSystem().broadcastOn([rp],{})},ap=Object.freeze({__proto__:null,hideAllExclusive:up,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Am.set(t,r)}))}}),cp=Fa({fields:ep,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Ns(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return $r(K([[Kr(op,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){up(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:$r("normal"===t.mode?[Kr(rr(),(function(t){Fr(n,op)})),Kr(er(),(function(t){Fr(n,ip)}))]:[]),behaviours:La([Am.config({})])});e.setTooltip(o),_s(r,o),t.onShow(n,o),Cs.position(r,t.anchor(n),o)}}(n)}),t.delay)})),Kr(ip,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Kr(br(),(function(t,e){var r=e;r.universal||I(r.channels,rp)&&n(t)})),oo((function(t){n(t)}))],"normal"===t.mode?[Kr(or(),(function(t){Fr(t,op)})),Kr(pr(),(function(t){Fr(t,ip)})),Kr(rr(),(function(t){Fr(t,op)})),Kr(er(),(function(t){Fr(t,ip)}))]:[Kr(Lr(),(function(t,e){Fr(t,op)})),Kr(Hr(),(function(t){Fr(t,ip)}))]]))}}),state:np,apis:ap}),sp=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),lp=tinymce.util.Tools.resolve("tinymce.util.I18n"),fp=["input","button","textarea","select"],dp=function(t,e,n){(e.disabled()?bp:yp)(t,e)},mp=function(t,e){return!0===e.useNative&&I(fp,ao(t.element))},gp=function(t){zo(t.element,"disabled","disabled")},hp=function(t){Io(t.element,"disabled")},pp=function(t){zo(t.element,"aria-disabled","true")},vp=function(t){zo(t.element,"aria-disabled","false")},bp=function(t,e,n){e.disableClass.each((function(e){vi(t.element,e)})),(mp(t,e)?gp:pp)(t),e.onDisabled(t)},yp=function(t,e,n){e.disableClass.each((function(e){bi(t.element,e)})),(mp(t,e)?hp:vp)(t),e.onEnabled(t)},wp=function(t,e){return mp(t,e)?function(t){return Po(t.element,"disabled")}(t):function(t){return"true"===Do(t.element,"aria-disabled")}(t)},xp=Object.freeze({__proto__:null,enable:yp,disable:bp,isDisabled:wp,onLoad:dp,set:function(t,e,n,r){(r?bp:yp)(t,e)}}),Cp=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return $r([Gr(yr(),(function(e,n){return wp(e,t)})),Ba(t,e,dp)])}}),Sp=[Xe("disabled",c),je("useNative",!0),Pe("disableClass"),Ku("onDisabled"),Ku("onEnabled")],kp=Fa({fields:Sp,name:"disabling",active:Cp,apis:xp}),Op=tinymce.util.Tools.resolve("tinymce.EditorManager"),Tp=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},_p=function(t){return t.getParam("width",sp.DOM.getStyle(t.getElement(),"width"))},Ep=function(t){return x.from(t.getParam("min_width")).filter(R)},Ap=function(t){return x.from(t.getParam("min_height")).filter(R)},Np=function(t){return x.from(t.getParam("max_width")).filter(R)},Rp=function(t){return x.from(t.getParam("max_height")).filter(R)},Mp=function(t){return!1!==t.getParam("menubar",!0,"boolean")},zp=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=k(e),o=T(e)&&e.length>0;return!Bp(t)&&(o||r||n)},Dp=function(t){var e=H(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=W(e,(function(t){return"string"==typeof t}));return n.length>0?x.some(n):x.none()},Bp=function(t){return Dp(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),(function(){return!0}))};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(hh||(hh={}));var Pp,Ip=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Pp||(Pp={}));var Lp,Hp,Fp=function(t){return t.getParam("toolbar_location",Pp.auto,"string")},Vp=function(t){return Fp(t)===Pp.bottom},jp=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?zu(Ri(),e):x.none()},Up=function(t){return t.inline&&jp(t).isSome()},Wp=function(t){return jp(t).getOrThunk((function(){return _i(Ti(rn(t.getElement())))}))},qp=function(t){return t.inline&&!Mp(t)&&!zp(t)&&!Bp(t)},$p=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Up(t)&&!qp(t)},Gp=function(t){var e=t.getParam("menu");return e?wt(e,(function(t){return f(f({},t),{items:t.items})})):{}},Xp=function(t){return t.getParam("menubar")},Kp=function(t){return t.getParam("anchor_top","#top")},Yp=function(t){return t.getParam("anchor_bottom","#bottom")},Jp="silver.readonly",Qp=Zt([("readonly",Ee("readonly",Ce))]),Zp=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([qs()],{target:n}),t.uiMothership.broadcastOn([qs()],{target:n})),t.mothership.broadcastOn([Jp],{readonly:e}),t.uiMothership.broadcastOn([Jp],{readonly:e})},tv=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Zp(e,!0)})),t.on("SwitchMode",(function(){return Zp(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},ev=function(){var t;return Wa.config({channels:(t={},t[Jp]={schema:Qp,onReceive:function(t,e){kp.set(t,e.readonly)}},t)})},nv=function(t){return kp.config({disabled:t})},rv=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},ov=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},iv=function(t,e){var n=t.getApi(e);return function(t){t(n)}},uv=function(t,e){return ro((function(n){iv(t,n)((function(n){var r=t.onSetup(n);null!=r&&e.set(r)}))}))},av=function(t,e){return oo((function(n){return iv(t,n)(e.get())}))},cv=function(t,e){return uo((function(n,r){iv(t,n)(t.onAction),t.triggersSubmenu||e!==ph.CLOSE_ON_EXECUTE||(Fr(n,Sr()),r.stop())}))},sv=((Lp={})[yr()]=["disabling","alloy.base.behaviour","toggling","item-events"],Lp),lv=function(t){return Y(t,(function(t){return t.toArray()}))},fv=function(e,n,r,o){var i,u=Qe(t);return{type:"item",dom:n.dom,components:lv(n.optComponents),data:e.data,eventOrder:sv,hasSubmenu:e.triggersSubmenu,itemBehaviours:La([Nm("item-events",[cv(e,r),uv(e,u),av(e,u)]),(i=function(){return e.disabled||o.isDisabled()},kp.config({disabled:i,disableClass:"tox-collection__item--state-disabled"})),ev(),Am.config({})].concat(e.itemBehaviours))}},dv=function(t){return{value:t.value,meta:f({text:t.text.getOr("")},t.meta)}},mv=tinymce.util.Tools.resolve("tinymce.Env"),gv=function(t){var e=mv.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=V(n,(function(t){var n=t.toLowerCase().trim();return Tt(e,n)?e[n]:t}));return mv.mac?r.join(""):r.join("+")},hv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},pv=function(t){return{dom:{tag:"div",classes:[xh]},components:[Yi(lp.translate(t))]}},vv=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},bv=function(t,e){return{dom:{tag:"div",classes:[xh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(lp.translate(e))]}]}},yv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:gv(t)}}},wv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:zg("checkmark",t)}}},xv=function(t,e){var n=e.map((function(t){return{attributes:{title:lp.translate(t)}}})).getOr({});return f({tag:"div",classes:[vh,bh].concat(t?["tox-collection__item-icon-rtl"]:[])},n)},Cv=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Sv=["list-bull-circle","list-bull-default","list-bull-square"],kv=function(t,e,n,r){void 0===r&&(r=x.none());var o,u=lp.isRtl()&&t.iconContent.exists((function(t){return I(Sv,t)})),a=(o=t.iconContent,o.map((function(t){return lp.isRtl()&&I(Cv,t)?t+"-rtl":t}))).map((function(t){return function(t,e,n){return x.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Mg(e)}))}(t,e.icons,r)})),c=x.from(t.meta).fold((function(){return pv}),(function(t){return Tt(t,"style")?i(bv,t.style):pv}));return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=n.getOr(""),i={tag:"div",attributes:t.map((function(t){return{title:r.translate(t)}})).getOr({}),classes:["tox-swatch"]},f(f({},i),"custom"===e?{tag:"button",classes:m(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:m(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:f(f({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,a,e):function(t,e,n,r,o){var i=n?e.or(x.some("")).map(hv):x.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return x.some(vv(t,[xh]))}));return{dom:xv(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(yv),u,t.caret]}}(t,a,n,c,u)},Ov=function(t,e){return Ot(t,"tooltipWorker").map((function(t){return[cp.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:fc}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){cp.setComponents(e,[Ji({element:rn(t)})])}))}})]})).getOr([])},Tv=function(t,e){var n=function(t){return sp.DOM.encode(t)}(lp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},_v=ql("item-widget",og()),Ev=function(t){return{value:t}},Av=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Nv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Rv=function(t){return Av.test(t)||Nv.test(t)},Mv=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},zv=function(t){var e=Mv(t.red)+Mv(t.green)+Mv(t.blue);return Ev(e)},Dv=Math.min,Bv=Math.max,Pv=Math.round,Iv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Lv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Hv=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Fv=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Vv=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Bv(0,Dv(i,1)),u=Bv(0,Dv(u,1)),0===i)return e=n=r=Pv(255*u),Hv(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Pv(255*(e+l)),n=Pv(255*(n+l)),r=Pv(255*(r+l)),Hv(e,n,r,1)},jv=function(t){var e,n,r=(e=function(t){return{value:t.value.replace(Av,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),null===(n=Nv.exec(e.value))?["FFFFFF","FF","FF","FF"]:n),o=parseInt(r[1],16),i=parseInt(r[2],16),u=parseInt(r[3],16);return Hv(o,i,u,1)},Uv=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Hv(o,i,u,a)},Wv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},qv=Hv(255,0,0,1),$v=function(t,e){return t.fire("ResizeContent",e)},Gv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Xv="tinymce-custom-colors",Kv="choiceitem",Yv=[{type:Kv,text:"Light Green",value:"#BFEDD2"},{type:Kv,text:"Light Yellow",value:"#FBEEB8"},{type:Kv,text:"Light Red",value:"#F8CAC6"},{type:Kv,text:"Light Purple",value:"#ECCAFA"},{type:Kv,text:"Light Blue",value:"#C2E0F4"},{type:Kv,text:"Green",value:"#2DC26B"},{type:Kv,text:"Yellow",value:"#F1C40F"},{type:Kv,text:"Red",value:"#E03E2D"},{type:Kv,text:"Purple",value:"#B96AD9"},{type:Kv,text:"Blue",value:"#3598DB"},{type:Kv,text:"Dark Turquoise",value:"#169179"},{type:Kv,text:"Orange",value:"#E67E23"},{type:Kv,text:"Dark Red",value:"#BA372A"},{type:Kv,text:"Dark Purple",value:"#843FA1"},{type:Kv,text:"Dark Blue",value:"#236FA1"},{type:Kv,text:"Light Gray",value:"#ECF0F1"},{type:Kv,text:"Medium Gray",value:"#CED4D9"},{type:Kv,text:"Gray",value:"#95A5A6"},{type:Kv,text:"Dark Gray",value:"#7E8C8D"},{type:Kv,text:"Navy Blue",value:"#34495E"},{type:Kv,text:"Black",value:"#000000"},{type:Kv,text:"White",value:"#ffffff"}],Jv=function(t){void 0===t&&(t=10);var e,n=Gv.getItem(Xv),r=k(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=P(t,e);return-1===n?x.none():x.some(n)})(o,e).each(i),o.unshift(e),o.length>t&&o.pop(),Gv.setItem(Xv,JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),Qv=function(t){return!1!==t.getParam("custom_colors")},Zv=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u<t.length;u+=2)e.push({text:t[u+1],value:i(t[u]),type:"choiceitem"});return e}(e):Yv},tb=function(t){Jv.add(t)},eb=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,(e=Zv(t).length,Math.max(5,Math.ceil(Math.sqrt(e)))));var e},nb=function(t,e,n,r){"custom"===n?cb(t)((function(n){n.each((function(n){tb(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},rb=function(t,e){return t.concat(V(Jv.state(),(function(t){return{type:Kv,text:t,value:t}})).concat(function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]}(e)))},ob=function(t,e){return function(n){n(rb(t,e))}},ib=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},ub=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return x.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return function(t){if("transparent"===t)return x.some(Hv(0,0,0,0));var e=Iv.exec(t);if(null!==e)return x.some(Uv(e[1],e[2],e[3],"1"));var n=Lv.exec(t);return null!==n?x.some(Uv(n[1],n[2],n[3],n[4])):x.none()}(t).map((function(t){var n=zv(t).value;return ln(e.toLowerCase(),n)}))})).getOr(!1)},columns:eb(t),fetch:ob(Zv(t),Qv(t)),onAction:function(e){null!==o.get()&&nb(t,n,o.get(),(function(){}))},onItemAction:function(r,i){nb(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&ib(n,e,o.get());var r=function(t){t.name===e&&ib(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},ab=function(e,n,r,o){e.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){nb(e,r,n.value,t)}}]}})},cb=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(x.from(n.colorpicker)),e.close()}}(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(x.none())}})}},sb=function(t,e,n,r,o,i,u,a){var c=Ph(e),s=lb(e,n,r,"color"!==o?"normal":"color",i,u,a);return Hh(t,c,s,r,o)},lb=function(t,e,n,r,o,i,u){return hf(V(t,(function(a){return"choiceitem"===a.type?(c=a,de("choicemenuitem",Xh,c)).fold(Ih,(function(c){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:n,textContent:e?t.text:x.none(),htmlContent:x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:x.none(),checkMark:e?x.some(wv(u.icons)):x.none(),caret:x.none(),value:t.value},u,a);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,Ph(t)))})):x.none();var c})))},fb=function(t,e){var n=Ah(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},db=Uo("cell-over"),mb=Uo("cell-execute"),gb=function(t,e,n){var r,o=function(n){return Vr(n,mb,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Zi({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:La([Nm("insert-table-picker-cell",[Kr(rr(),Bm.focus),Kr(yr(),o),Kr(lr(),i),Kr(xr(),i)]),Gm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Bm.config({onFocus:function(n){return Vr(n,db,{row:t,col:e})}})])})},hb=function(t){return Y(t,(function(t){return V(t,tu)}))},pb=function(t,e){return Yi(e+1+"x"+(t+1))},vb={inserttable:function(t){var e=Uo("size-label"),n=function(t,e,n){for(var r=[],o=0;o<10;o++){for(var i=[],u=0;u<10;u++)i.push(gb(o,u,t));r.push(i)}return r}(e),r=Rg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Yi("0x0")],behaviours:La([Am.config({})])});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:hb(n).concat(r.asSpec()),behaviours:La([Nm("insert-table-picker",[Zr(db,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<10;i++)for(var u=0;u<10;u++)Gm.set(t[i][u],i<=e&&u<=n)}(n,i,u),Am.set(r.get(t),[pb(i,u)])})),Zr(mb,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Fr(e,Sr())}))]),km.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=rb(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o="color",i=sb(Uo("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),u=f(f({},i),{markers:Ah(o),movement:fb(r,o)});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget(lg.sketch(u))]}}},bb=function(t,e){return V(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Oh,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[kh,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,bb(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return I(e.cardText.highlightOn,t)}))?x.from(e.cardText.matchText).getOr(""):"";return vv(Tv(t.text,n),t.classes)}}))},yb=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:f({tag:"div",classes:[bh,"tox-collection__group-heading"]},e),components:[]}};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Hp||(Hp={}));var wb=function(e,n,r,o,i){var u,a=r.shared.providers,c=function(t){return i?f(f({},t),{shortcut:x.none(),icon:t.text.isSome()?x.none():t.icon}):t};switch(e.type){case"menuitem":return(u=e,de("menuitem",Yh,u)).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,caret:x.none(),checkMark:x.none(),shortcutContent:t.shortcut},n,r);return fv({data:dv(t),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)}(c(t),n,a,o))}));case"nestedmenuitem":return function(t){return de("nestedmenuitem",Jh,t)}(e).fold(Ih,(function(e){return x.some(function(e,n,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var u,a=i?(u=r.icons,{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-down",u)}}):function(t){return{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-right",t)}}}(r.icons),c=kv({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:x.none(),ariaLabel:e.text,caret:x.some(a),checkMark:x.none(),shortcutContent:e.shortcut},r,o);return fv({data:dv(e),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:e.disabled,onAction:t,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,r)}(c(e),n,a,o,i))}));case"togglemenuitem":return function(t){return de("togglemenuitem",Qh,t)}(e).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,checkMark:x.some(wv(n.icons)),caret:x.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c(t),n,a,o))}));case"separator":return function(t){return de("separatormenuitem",Qg,t)}(e).fold(Ih,(function(t){return x.some(yb(t))}));case"fancymenuitem":return function(t){return de("fancymenuitem",Kh,t)}(e).fold(Ih,(function(t){return function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?x.some(t[e]):x.none()}(vb,t.fancytype).map((function(n){return n(t,e)}))}(c(t),r)}));default:return console.error("Unknown item in general menu",e),x.none()}},xb=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Ph(t);return hf(V(t,(function(t){switch(t.type){case"separator":return(r=t,de("Autocompleter.Separator",Qg,r)).fold(Ih,(function(t){return x.some(yb(t))}));case"cardmenuitem":return function(t){return de("cardmenuitem",Gh,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r){var o={dom:xv(!1,t.label),optComponents:[x.some({dom:{tag:"div",classes:[kh,Oh]},components:bb(t.items,r)})]};return fv({data:dv(f({text:x.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){kp.set(t,e),j(Fc(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(kp)&&kp.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:x.from(r.itemBehaviours).getOr([])},o,e,n.providers)}(f(f({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Ov(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return de("Autocompleter.Item",Zg,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:r,textContent:x.none(),htmlContent:n?t.text.map((function(t){return Tv(t,e)})):x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:x.none(),checkMark:x.none(),caret:x.none(),value:t.value},u.providers,a,t.icon);return fv({data:dv(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:Ov(t.meta,u)},c,i,u.providers)}(t,e,a,"normal",n,o,i,c))}))}var r})))},Cb=function(t,e,n,r,o){var i=Ph(e),u=hf(V(e,(function(t){var e=function(t){return wb(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(f(f({},t),{disabled:!0})):e(t)})));return(o?Lh:Hh)(t,i,u,1,"normal")},Sb=function(t){return pg.singleData(t.value,t)},kb=function(t,e){var n=Qe(x.none()),r=Qe(!1),o=Zi(vg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissAutocompleter",[Kr(Mr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&vg.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));jg(e.getOr(rn(t.selection.getNode()))).each(Ao),u(),n.set(x.none()),r.set(!1)}},c=zt((function(){return function(t){var e,n,r=t.ui.registry.getAll().popups,o=wt(r,(function(t){return(e=t,de("Autocompleter",th,e)).fold((function(t){throw new Error(he(t))}),(function(t){return t}));var e})),i=(e=Ct(o,(function(t){return t.ch})),n={},j(e,(function(t){n[t]={}})),vt(n)),u=kt(o);return{dataset:o,triggerChars:i,lookupByChar:function(t){return W(u,(function(e){return e.ch===t}))}}}(t)})),s=function(l){(function(e){return n.get().map((function(n){return $g(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Jg(t,c,n,e)}))})).getOrThunk((function(){return function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return it(n.triggerChars,(function(n){return $g(t,e,n)}))}(t.dom,r,n).bind((function(n){return Jg(t,e,n)}))}(t,c)}))})(l).fold(a,(function(c){!function(e){if(!i()){var o=Vg(t,e.range);n.set(x.some({triggerChar:e.triggerChar,element:o,matchLength:e.text.length})),r.set(!1)}}(c.context),c.lookupData.then((function(i){n.get().map((function(n){var l,f,d,m=c.context;if(n.triggerChar===m.triggerChar){var g=(l=m.triggerChar,d=it(f=i,(function(t){return x.from(t.columns)})).getOr(1),Y(f,(function(n){var o=n.items;return xb(o,n.matchText,(function(e,o){var i=t.selection.getRng();$g(t.dom,i,l).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),s(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,ph.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?function(e,n,r,i){e.matchLength=n.text.length;var u=it(r,(function(t){return x.from(t.columns)})).getOr(1);vg.showAt(o,{anchor:"node",root:rn(t.getBody()),node:x.from(e.element)},lg.sketch(function(t,e,n,r){var o=n===Hp.ContentFocus?Qf():Jf(),i=fb(e,r),u=Ah(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===Hp.ContentFocus,focusManager:o,menuBehaviours:tp("auto"!==e?[]:[ro((function(t,e){Zh(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;km.setGridSize(t,r,n)}))}))])}}(Hh("autocompleter-value",!0,i,u,"normal"),u,Hp.ContentFocus,"normal"))),vg.getContent(o).each(Nf.highlightFirst)}(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},l={onKeypress:Lg((function(t){27!==t.which&&s()}),50),cancelIfNecessary:a,isMenuOpen:function(){return vg.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return vg.getContent(o)}};!1===t.hasPlugin("rtc")&&function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Vr(t,ur(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Nf.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(jr),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Nf.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&jg(rn(e.element)).isNone()&&t.cancelIfNecessary()}))}(l,t)},Ob=s,Tb=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!1)}(t,e,Ob,n)},_b=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!0)}(t,e,Ob,n)},Eb=mu,Ab=function(t,e,n){return Du(t,e,n).isSome()};function Nb(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}}var Rb=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?x.none():x.some(e.touches[0])},Mb=function(){return Ln().browser.isFirefox()},zb=Qt([Me("triggerEvent"),je("stopBackspace",!0)]),Db=function(t,e){var n=ge("Getting GUI events settings",zb,e),r=function(t){var e=Qe(x.none()),n=Qe(!1),r=Nb((function(e){t.triggerEvent(Cr(),e),n.set(!0)}),400),o=jt([{key:Kn(),value:function(t){return Rb(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(x.some(i))})),x.none()}},{key:Yn(),value:function(t){return r.cancel(),Rb(t).each((function(t){e.get().each((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(x.none())}))})),x.none()}},{key:Jn(),value:function(o){return r.cancel(),e.get().filter((function(t){return Vn(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(xr(),o)}))}}]);return{fireIfReady:function(t,e){return Ot(o,e).bind((function(e){return e(t)}))}}}(n),o=V(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return Tb(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Qe(x.none()),u=Tb(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(x.some(setTimeout((function(){n.triggerEvent(vr(),t)}),0)))})),a=Tb(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===Rf[0]&&!I(["input","textarea"],ao(t.target))&&!Ab(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Mb()?_b(t,"focus",e):Tb(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Qe(x.none()),l=function(t,e){return Mb()?_b(t,"blur",e):Tb(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(x.some(setTimeout((function(){n.triggerEvent(pr(),t)}),0)))}));return{unbind:function(){j(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.get().each(clearTimeout),s.get().each(clearTimeout)}}},Bb=function(t,e){var n=Ot(t,"target").getOr(e);return Qe(n)},Pb=Et([{stopped:[]},{resume:["element"]},{complete:[]}]),Ib=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=Qe(!1),r=Qe(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),Pb.complete()}),(function(t){var n=t.descHandler;return si(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Pb.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Pb.complete()):bo(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Pb.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Pb.resume(r)}))}))},Lb=function(t,e,n,r,o,i){return Ib(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return Lb(t,e,n,r,o,i)}),(function(){return!1}))},Hb=function(t,e,n,r,o){var i=Bb(n,r);return Lb(t,e,n,r,i,o)};function Fb(){var t,e=(t={},{registerId:function(e,n,r){yt(r,(function(r,o){var u=void 0!==t[o]?t[o]:{};u[n]=function(t,e){return{cHandler:i.apply(void 0,[t.handler].concat(e)),purpose:t.purpose}}(r,e),t[o]=u}))},unregisterId:function(e){yt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return Ot(t,e).map((function(t){return Ct(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Ot(t,n);return qn(r,(function(t){return function(t,e){return Ko(e).fold((function(){return x.none()}),(function(n){return t.bind((function(t){return Ot(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}),n={},r=function(t){Ko(t.element).each((function(t){delete n[t],e.unregisterId(t)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(t){var o=function(t){var e=t.element;return Ko(e).fold((function(){return function(t,e){var n=Uo($o+"uid-");return Xo(e,n),n}(0,t.element)}),(function(t){return t}))}(t);_t(n,o)&&function(t,e){var o=n[e];if(o!==t)throw new Error('The tagId "'+e+'" is already used by: '+Ho(o.element)+"\nCannot use it for: "+Ho(t.element)+"\nThe conflicting element is"+(Ni(o.element)?" ":" not ")+"already in the DOM");r(t)}(t,o);var i=[t];e.registerId(i,o,t.events),n[o]=t},unregister:r,getById:function(t){return Ot(n,t)}}}var Vb=mf({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=d(e,["attributes"]);return{uid:t.uid,dom:f({tag:"div",attributes:f({role:"presentation"},n)},r),components:t.components,behaviours:dl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[je("components",[]),fl("containerBehaviours",[]),je("events",{}),je("domModification",{}),je("eventOrder",{})]}),jb=function(e){var n=function(t){return bo(e.element).fold((function(){return!0}),(function(e){return Vn(t,e)}))},o=Fb(),i=function(t,e){return o.find(n,t,e)},u=Db(e.element,{triggerEvent:function(t,e){return Fu(t,e.target,(function(n){return function(t,e,n,r){return Hb(t,e,n,n.target,r)}(i,t,e,n)}))}}),l={debugInfo:r("real"),triggerEvent:function(t,e,n){Fu(t,e,(function(r){return Hb(i,t,n,e,r)}))},triggerFocus:function(e,n){Ko(e).fold((function(){$a(e)}),(function(r){Fu(hr(),e,(function(r){return function(t,e,n,r,o){var i=Bb(n,r);Ib(t,e,n,r,i,o)}(i,hr(),{originator:n,kill:t,prevent:t,target:e},e,r),!1}))}))},triggerEscape:function(t,e){l.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return y(t)},getByDom:function(t){return w(t)},build:Zi,addToGui:function(t){m(t)},removeFromGui:function(t){g(t)},addToWorld:function(t){f(t)},removeFromWorld:function(t){d(t)},broadcast:function(t){p(t)},broadcastOn:function(t,e){v(t,e)},broadcastEvent:function(t,e){b(t,e)},isConnected:s},f=function(t){t.connect(l),lo(t.element)||(o.register(t),j(t.components(),f),l.triggerEvent(Or(),t.element,{target:t.element}))},d=function(t){lo(t.element)||(j(t.components(),d),o.unregister(t)),t.disconnect()},m=function(t){_s(e,t)},g=function(t){Ns(t)},h=function(t){var e=o.filter(br());j(e,(function(e){var n=e.descHandler;si(n)(t)}))},p=function(t){h({universal:!0,data:t})},v=function(t,e){h({universal:!1,channels:t,data:e})},b=function(e,n){return function(e,n,r){var o=function(e){var n=Qe(!1);return{stop:function(){n.set(!0)},cut:t,isStopped:n.get,isCut:c,event:e,setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")}}(n);return j(e,(function(t){var e=t.descHandler;si(e)(o)})),o.isStopped()}(o.filter(e),n)},y=function(t){return o.getById(t).fold((function(){return ct.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ct.value)},w=function(t){var e=Ko(t).getOr("not found");return y(e)};return f(e),{root:e,element:e.element,destroy:function(){u.unbind(),Eo(e.element)},add:m,remove:g,getByUid:y,getByDom:w,addToWorld:f,removeFromWorld:d,broadcast:p,broadcastOn:v,broadcastEvent:b}},Ub=r([je("prefix","form-field"),fl("fieldBehaviours",[wf,ll])]),Wb=r([Fl({schema:[_e("dom")],name:"label"}),Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Ll({factory:{sketch:function(t){var e=function(t,e){var n={};return yt(t,(function(t,r){I(e,r)||(n[r]=t)})),n}(t,["factory"]);return t.factory.sketch(e)}},schema:[_e("factory")],name:"field"})]),qb=gf({name:"FormField",configFields:Ub(),partFields:Wb(),factory:function(t,e,n,r){var o=ml(t.fieldBehaviours,[wf.config({find:function(e){return Ql(e,t,"field")}}),ll.config({store:{mode:"manual",getValue:function(t){return wf.getCurrent(t).bind(ll.getValue)},setValue:function(t,e){wf.getCurrent(t).each((function(t){ll.setValue(t,e)}))}}})]),i=$r([ro((function(e,n){var r=tf(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Uo(t.prefix);r.label().each((function(t){zo(t.element,"for",n),zo(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Uo(t.prefix);zo(n.element,"id",r),zo(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Ql(e,t,"field")},getLabel:function(e){return Ql(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),$b=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({attributes:jt([{key:e.tabAttr,value:"true"}])})}}),Gb=[je("tabAttr","data-alloy-tabstop")],Xb=Fa({fields:Gb,name:"tabstopping",active:$b}),Kb=tinymce.util.Tools.resolve("tinymce.html.Entities"),Yb=function(t,e,n,r){var o=Jb(t,e,n,r);return qb.sketch(o)},Jb=function(t,e,n,r){return{dom:Qb(n),components:t.toArray().concat([e]),fieldBehaviours:La(r)}},Qb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Zb=function(t,e){return qb.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ty=Uo("form-component-change"),ey=Uo("form-close"),ny=Uo("form-cancel"),ry=Uo("form-action"),oy=Uo("form-submit"),iy=Uo("form-block"),uy=Uo("form-unblock"),ay=Uo("form-tabchange"),cy=Uo("form-resize"),sy=r([Pe("data"),je("inputAttributes",{}),je("inputStyles",{}),je("tag","input"),je("inputClasses",[]),Ku("onSetValue"),je("styles",{}),je("eventOrder",{}),fl("inputBehaviours",[ll,Bm]),je("selectOnFocus",!0)]),ly=function(e){return La([Bm.config({onFocus:e.selectOnFocus?function(t){var e=t.element,n=qi(e);e.dom.setSelectionRange(0,n.length)}:t})])},fy=function(t){return f(f({},ly(t)),ml(t.inputBehaviours,[ll.config({store:f(f({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return qi(t.element)},setValue:function(t,e){qi(t.element)!==e&&$i(t.element,e)}}),onSetValue:t.onSetValue})]))},dy=function(t){return{tag:t.tag,attributes:f({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},my=mf({name:"Input",configFields:sy(),factory:function(t,e){return{uid:t.uid,dom:dy(t),components:[],behaviours:fy(t),eventOrder:t.eventOrder}}}),gy={},hy={exports:gy};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,gy,hy);var py,vy=hy.exports.boltExport,by=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return by((function(e){r((function(n){e(t(n))}))}))},isReady:o}},yy={nu:by,pure:function(t){return by((function(e){e(t)}))}},wy=function(t){setTimeout((function(){throw t}),0)},xy=function(t){var e=function(e){t().then(e,wy)};return{map:function(e){return xy((function(){return t().then(e)}))},bind:function(e){return xy((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return xy((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return yy.nu(e)},toCached:function(){var e=null;return xy((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Cy=function(t){return xy((function(){return new vy(t)}))},Sy=function(t){return xy((function(){return vy.resolve(t)}))},ky=["input","textarea"],Oy=function(t){var e=ao(t);return I(ky,e)},Ty=function(t,e){var n=e.getRoot(t).getOr(t.element);bi(n,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ro(t,e.validHtml)})),e.onValid(t)}))},_y=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);vi(o,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ro(t,r)})),e.onInvalid(t,r)}))},Ey=function(t,e,n){return e.validator.fold((function(){return Sy(ct.value(!0))}),(function(e){return e.validate(t)}))},Ay=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Ey(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return _y(t,e,0,n),ct.error(n)}),(function(n){return Ty(t,e),ct.value(n)})):ct.error("No longer in system")}))},Ny=Object.freeze({__proto__:null,markValid:Ty,markInvalid:_y,query:Ey,run:Ay,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return yi(n,e.invalidClass)}}),Ry=Object.freeze({__proto__:null,events:function(e,n){return e.validator.map((function(n){return $r([Kr(n.onEvent,(function(t){Ay(t,e).get(o)}))].concat(n.validateOnLoad?[ro((function(n){Ay(n,e).get(t)}))]:[]))})).getOr({})}}),My=[_e("invalidClass"),je("getRoot",x.none),Ve("notify",[je("aria","alert"),je("getContainer",x.none),je("validHtml",""),Ku("onValid"),Ku("onInvalid"),Ku("onValidate")]),Ve("validator",[_e("validate"),je("onEvent","input"),je("validateOnLoad",!0)])],zy=Fa({fields:My,name:"invalidating",active:Ry,apis:Ny,extra:{validation:function(t){return function(e){var n=ll.getValue(e);return Sy(t(n))}}}}),Dy=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),By=[Ee("others",fe(ct.value,be()))],Py=Fa({fields:By,name:"coupling",apis:Dy,state:Object.freeze({__proto__:null,init:function(){var t={},e=r({});return ui({readState:e,getOrCreate:function(e,n,r){var o=vt(n.others);if(o)return Ot(t,r).getOrThunk((function(){var o=Ot(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),Iy=r("sink"),Ly=r(Fl({name:Iy(),overrides:r({dom:{tag:"div"},behaviours:La([Cs.config({useFixed:s})]),events:$r([to(ur()),to(Zn()),to(lr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(py||(py={}));var Hy=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},Fy=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Uy(r,t);return a.map((function(t){return t.bind((function(t){return x.from(pg.sketch(f(f({},i.menu()),{uid:Yo(""),data:t,highlightImmediately:u===py.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Cs.position(r,n,e),Ws.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Cs.position(r,{anchor:"submenu",item:e},n),Ws.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Cs.position(o,n,e),j(r,(function(t){Cs.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Bm.focus(r),Ws.close(o),x.some(!0)}})))}))}))}(t,e,Hy(t,n),n,r,o,u).map((function(t){return t.fold((function(){Ws.isOpen(r)&&Ws.close(r)}),(function(t){Ws.cloak(r),Ws.open(r,t),i(r)})),r}))},Vy=function(t,e,n,r,o,i,u){return Ws.close(r),Sy(r)},jy=function(t,e,n,r,o,i){var u=Py.getCoupled(n,"sandbox");return(Ws.isOpen(u)?Vy:Fy)(t,e,n,u,r,o,i)},Uy=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Iy()).map((function(t){return function(){return ct.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return ct.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Wy=function(t){Ws.getState(t).each((function(t){pg.repositionMenus(t)}))},qy=function(t,e,n){var r=Bu(),o=Uy(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:hl(t.sandboxBehaviours,[ll.config({store:{mode:"memory",initialValue:e}}),Ws.config({onOpen:function(o,i){var u=Hy(t,e);r.link(e.element),t.matchWidth&&function(t,e,n){var r=wf.getCurrent(e).getOr(e),o=fu(t.element);n?Bi(r.element,"min-width",o+"px"):function(t,e){lu.set(t,e)}(r.element,o)}(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return Pu(n,r)||Pu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),wf.config({find:function(t){return Ws.getState(t).bind((function(t){return wf.getCurrent(t)}))}}),Wa.config({channels:f(f({},Ks({isExtraPart:c})),Js({doReposition:Wy}))})])}},$y=function(t){var e=Py.getCoupled(t,"sandbox");Wy(e)},Gy=function(){return[je("sandboxClasses",[]),gl("sandboxBehaviours",[wf,Wa,Ws,ll])]},Xy=r([_e("dom"),_e("fetch"),Ku("onOpen"),Yu("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),fl("dropdownBehaviours",[Gm,Py,km,Bm]),_e("toggleClass"),je("eventOrder",{}),Pe("lazySink"),je("matchWidth",!1),je("useMinWidth",!1),Pe("role")].concat(Gy())),Ky=r([Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Ly()]),Yy=gf({name:"Dropdown",configFields:Xy(),partFields:Ky(),factory:function(e,n,r,o){var i,u=function(t){Ws.getState(t).each((function(t){pg.highlightPrimary(t)}))},a={expand:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightNone).get(t)},open:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},isOpen:Gm.isOn,close:function(n){Gm.isOn(n)&&jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},repositionMenus:function(t){Gm.isOn(t)&&$y(t)}},c=function(t,e){return jr(t),x.some(!0)};return{uid:e.uid,dom:e.dom,components:n,behaviours:ml(e.dropdownBehaviours,[Gm.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){Gm.on(t)},onClose:function(){Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Yy.isOpen(t)){var n=Py.getCoupled(t,"sandbox");u(n)}else Yy.open(t);return x.some(!0)},onEscape:function(t,e){return Yy.isOpen(t)?(Yy.close(t),x.some(!0)):x.none()}}),Bm.config({})]),events:Km(x.some((function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)}))),eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:a,domModification:{attributes:f(f({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===e.dom.tag?{type:("type",Ot(e.dom,"attributes").bind((function(t){return Ot(t,"type")}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Jy=Fa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return $r([Gr(dr(),s)])},exhibit:function(){return ci({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Qy=Uo("color-input-change"),Zy=Uo("color-swatch-change"),tw=Uo("color-picker-cancel"),ew=function(t,e,n){return{hue:t,saturation:e,value:n}},nw=Uo("rgb-hex-update"),rw=Uo("slider-update"),ow=Uo("palette-update"),iw=Fl({schema:[_e("dom")],name:"label"}),uw=function(t){return Fl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:$r([Yr(Kn(),(function(e,n,r){return t(e,r)}),[e]),Yr(Zn(),(function(e,n,r){return t(e,r)}),[e]),Yr(tr(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},aw=uw("top-left"),cw=uw("top"),sw=uw("top-right"),lw=uw("right"),fw=uw("bottom-right"),dw=uw("bottom"),mw=uw("bottom-left"),gw=[iw,uw("left"),lw,cw,dw,aw,sw,mw,fw,Ll({name:"thumb",defaults:r({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:$r([Qr(Kn(),t,"spectrum"),Qr(Yn(),t,"spectrum"),Qr(Jn(),t,"spectrum"),Qr(Zn(),t,"spectrum"),Qr(tr(),t,"spectrum"),Qr(nr(),t,"spectrum")])}}}),Ll({schema:[Je("mouseIsDown",(function(){return Qe(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:La([km.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Bm.config({})]),events:$r([Kr(Kn(),n),Kr(Yn(),n),Kr(Zn(),n),Kr(tr(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],hw=r("slider.change.value"),pw=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?x.some(n.touches[0]).map((function(t){return uu(t.clientX,t.clientY)})):x.none()}var r=e;return void 0!==r.clientX?x.some(r).map((function(t){return uu(t.clientX,t.clientY)})):x.none()},vw=function(t){return t.model.minX},bw=function(t){return t.model.minY},yw=function(t){return t.model.minX-1},ww=function(t){return t.model.minY-1},xw=function(t){return t.model.maxX},Cw=function(t){return t.model.maxY},Sw=function(t){return t.model.maxX+1},kw=function(t){return t.model.maxY+1},Ow=function(t,e,n){return e(t)-n(t)},Tw=function(t){return Ow(t,xw,vw)},_w=function(t){return Ow(t,Cw,bw)},Ew=function(t){return Tw(t)/2},Aw=function(t){return _w(t)/2},Nw=function(t){return t.stepSize},Rw=function(t){return t.snapToGrid},Mw=function(t){return t.snapStart},zw=function(t){return t.rounded},Dw=function(t,e){return void 0!==t[e+"-edge"]},Bw=function(t){return Dw(t,"left")},Pw=function(t){return Dw(t,"right")},Iw=function(t){return Dw(t,"top")},Lw=function(t){return Dw(t,"bottom")},Hw=function(t){return t.model.value.get()},Fw=function(t){return{x:t}},Vw=function(t){return{y:t}},jw=function(t,e){return{x:t,y:e}},Uw=function(t,e){Vr(t,hw(),{value:e})},Ww=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},qw=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},$w=function(t,e,n){return Math.max(e,Math.min(n,t))},Gw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=$w(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return $w(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},Xw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},Kw="top",Yw="right",Jw="bottom",Qw="left",Zw=function(t){return t.element.dom.getBoundingClientRect()},tx=function(t,e){return t[e]},ex=function(t){var e=Zw(t);return tx(e,Qw)},nx=function(t){var e=Zw(t);return tx(e,Yw)},rx=function(t){var e=Zw(t);return tx(e,Kw)},ox=function(t){var e=Zw(t);return tx(e,Jw)},ix=function(t){var e=Zw(t);return tx(e,"width")},ux=function(t){var e=Zw(t);return tx(e,"height")},ax=function(t,e,n){return(t+e)/2-n},cx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Qw),i=tx(n,Yw),u=tx(r,Qw);return ax(o,i,u)},sx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Kw),i=tx(n,Jw),u=tx(r,Kw);return ax(o,i,u)},lx=function(t,e){Vr(t,hw(),{value:e})},fx=function(t){return{x:t}},dx=function(t,e,n){var r={min:vw(e),max:xw(e),range:Tw(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),maxBound:nx(t),screenRange:ix(t)};return Gw(r)},mx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).x,vw(n),xw(n),Nw(n));return lx(e,fx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},gx=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ix(t),u=r.bind((function(e){return x.some(cx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(cx(e,t))})).getOr(i),c={min:vw(e),max:xw(e),range:Tw(e),value:n,hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),minOffset:0,maxBound:nx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return ex(e)-ex(t)+u},hx=mx(-1),px=mx(1),vx=x.none,bx=x.none,yx={"top-left":x.none(),top:x.none(),"top-right":x.none(),right:x.some((function(t,e){Uw(t,Fw(Sw(e)))})),"bottom-right":x.none(),bottom:x.none(),"bottom-left":x.none(),left:x.some((function(t,e){Uw(t,Fw(yw(e)))}))},wx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n),o=fx(r);return lx(t,o),r},setToMin:function(t,e){var n=vw(e);lx(t,fx(n))},setToMax:function(t,e){var n=xw(e);lx(t,fx(n))},findValueOfOffset:dx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.left}))},findPositionOfValue:gx,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=fu(e.element)/2;Bi(e.element,"left",i-u+"px")},onLeft:hx,onRight:px,onUp:vx,onDown:bx,edgeActions:yx}),xx=function(t,e){Vr(t,hw(),{value:e})},Cx=function(t){return{y:t}},Sx=function(t,e,n){var r={min:bw(e),max:Cw(e),range:_w(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),maxBound:ox(t),screenRange:ux(t)};return Gw(r)},kx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).y,bw(n),Cw(n),Nw(n));return xx(e,Cx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},Ox=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ux(t),u=r.bind((function(e){return x.some(sx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(sx(e,t))})).getOr(i),c={min:bw(e),max:Cw(e),range:_w(e),value:n,hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),minOffset:0,maxBound:ox(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return rx(e)-rx(t)+u},Tx=x.none,_x=x.none,Ex=kx(-1),Ax=kx(1),Nx={"top-left":x.none(),top:x.some((function(t,e){Uw(t,Vw(ww(e)))})),"top-right":x.none(),right:x.none(),"bottom-right":x.none(),bottom:x.some((function(t,e){Uw(t,Vw(kw(e)))})),"bottom-left":x.none(),left:x.none()},Rx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Sx(t,e,n),o=Cx(r);return xx(t,o),r},setToMin:function(t,e){var n=bw(e);xx(t,Cx(n))},setToMax:function(t,e){var n=Cw(e);xx(t,Cx(n))},findValueOfOffset:Sx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.top}))},findPositionOfValue:Ox,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ru(e.element)/2;Bi(e.element,"top",i-u+"px")},onLeft:Tx,onRight:_x,onUp:Ex,onDown:Ax,edgeActions:Nx}),Mx=function(t,e){Vr(t,hw(),{value:e})},zx=function(t,e){return{x:t,y:e}},Dx=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?qw:Ww,i=e?Hw(r).x:o(Hw(r).x,vw(r),xw(r),Nw(r)),u=e?o(Hw(r).y,bw(r),Cw(r),Nw(r)):Hw(r).y;return Mx(n,zx(i,u)),x.some(i)}(t,e,n,r).map((function(){return!0}))}},Bx=Dx(-1,!1),Px=Dx(1,!1),Ix=Dx(-1,!0),Lx=Dx(1,!0),Hx={"top-left":x.some((function(t,e){Uw(t,jw(yw(e),ww(e)))})),top:x.some((function(t,e){Uw(t,jw(Ew(e),ww(e)))})),"top-right":x.some((function(t,e){Uw(t,jw(Sw(e),ww(e)))})),right:x.some((function(t,e){Uw(t,jw(Sw(e),Aw(e)))})),"bottom-right":x.some((function(t,e){Uw(t,jw(Sw(e),kw(e)))})),bottom:x.some((function(t,e){Uw(t,jw(Ew(e),kw(e)))})),"bottom-left":x.some((function(t,e){Uw(t,jw(yw(e),kw(e)))})),left:x.some((function(t,e){Uw(t,jw(yw(e),Aw(e)))}))},Fx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n.left),o=Sx(t,e,n.top),i=zx(r,o);return Mx(t,i),i},setToMin:function(t,e){var n=vw(e),r=bw(e);Mx(t,zx(n,r))},setToMax:function(t,e){var n=xw(e),r=Cw(e);Mx(t,zx(n,r))},getValueFromEvent:function(t){return pw(t)},setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=fu(e.element)/2,c=ru(e.element)/2;Bi(e.element,"left",i-a+"px"),Bi(e.element,"top",u-c+"px")},onLeft:Bx,onRight:Px,onUp:Ix,onDown:Lx,edgeActions:Hx}),Vx=gf({name:"Slider",configFields:[je("stepSize",1),je("onChange",t),je("onChoose",t),je("onInit",t),je("onDragStart",t),je("onDragEnd",t),je("snapToGrid",!1),je("rounded",!0),Pe("snapStart"),Ee("model",ve("mode",{x:[je("minX",0),je("maxX",100),Je("value",(function(t){return Qe(t.mode.minX)})),_e("getInitialValue"),Zu("manager",wx)],y:[je("minY",0),je("maxY",100),Je("value",(function(t){return Qe(t.mode.minY)})),_e("getInitialValue"),Zu("manager",Rx)],xy:[je("minX",0),je("maxX",100),je("minY",0),je("maxY",100),Je("value",(function(t){return Qe({x:t.mode.minX,y:t.mode.minY})})),_e("getInitialValue"),Zu("manager",Fx)]})),fl("sliderBehaviours",[km,ll]),Je("mouseIsDown",(function(){return Qe(!1)}))],partFields:gw,factory:function(t,e,n,r){var o,i=function(e){return Zl(e,t,"thumb")},u=function(e){return Zl(e,t,"spectrum")},a=function(e){return Ql(e,t,"left-edge")},c=function(e){return Ql(e,t,"right-edge")},l=function(e){return Ql(e,t,"top-edge")},f=function(e){return Ql(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:l,getBottomEdge:f,getSpectrum:u})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),x.some(!0)},p=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Ql(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},b=function(e,n){n.stop(),t.onDragEnd(e,i(e)),p(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.sliderBehaviours,[km.config({mode:"special",focusIn:function(e){return Ql(e,t,"spectrum").map(km.focusIn).map(s)}}),ll.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),Wa.config({channels:(o={},o[Gs()]={onReceive:p},o)})]),events:$r([Kr(hw(),(function(t,e){h(t,e.event.value)})),ro((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),Kr(Kn(),v),Kr(Jn(),b),Kr(Zn(),v),Kr(nr(),b)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),jx=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Vx.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return Vx.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:r({y:0})},components:[n,o],sliderBehaviours:La([Bm.config({})]),onChange:function(t,e,n){Vr(t,rw,{value:n})}})},Ux="form",Wx=[fl("formBehaviours",[ll])],qx=function(t){return"<alloy.field."+t+">"},$x=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.formBehaviours,[ll.config({store:{mode:"manual",getValue:function(e){var n=ef(e,t);return wt(n,(function(t,e){return t().bind((function(t){var n,r;return n=wf.getCurrent(t),r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ho(t.element)),n.fold((function(){return ct.error(r)}),ct.value)})).map(ll.getValue)}))},setValue:function(e,n){yt(n,(function(n,r){Ql(e,t,r).each((function(t){wf.getCurrent(t).each((function(t){ll.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Ql(e,t,n).bind(wf.getCurrent)}}}},Gx={getField:oi((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),Gl(Ux,qx(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:qx(t)})}));return sf(Ux,Wx,o,$x,n)}},Xx=Uo("valid-input"),Kx=Uo("invalid-input"),Yx=Uo("validating-input"),Jx="colorcustom.rgb.",Qx=function(e,n,r,o){var i=function(t,r){return zy.config({invalidClass:n("invalid"),notify:{onValidate:function(e){Vr(e,Yx,{type:t})},onValid:function(e){Vr(e,Xx,{type:t,value:ll.getValue(e)})},onInvalid:function(e){Vr(e,Kx,{type:t,value:ll.getValue(e)})}},validator:{validate:function(t){var n=ll.getValue(t),o=r(n)?ct.value(!0):ct.error(e("aria.input.invalid"));return Sy(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=e("colorcustom.rgb.range"),l=[qb.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),qb.parts.field({data:c,factory:my,inputAttributes:f({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:La([i(o,r),Xb.config({})]),onSetValue:function(e){zy.isInvalid(e)&&zy.run(e).get(t)}})],d="hex"!==o?[qb.parts["aria-descriptor"]({text:s})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(d)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;ll.setValue(t,{red:n,green:r,blue:o})},c=Rg({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Bi(t.element,"background-color","#"+e.value)}))};return mf({factory:function(){var t={red:Qe(x.some(255)),green:Qe(x.some(255)),blue:Qe(x.some(255)),hex:Qe(x.some("ffffff"))},i=function(e){return t[e].get()},l=function(e,n){t[e].set(n)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",x.some(e)),l("green",x.some(n)),l("blue",x.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,x.none()):o(t)},m=function(t,e){var n=e.event;!function(t){return"hex"===t.type}(n)?function(t,e,n){var r=parseInt(n,10);l(e,x.some(r)),i("red").bind((function(t){return i("green").bind((function(e){return i("blue").map((function(n){return Hv(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=zv(e);return Gx.getField(t,"hex").each((function(e){Bm.isFocused(e)||ll.setValue(t,{hex:n.value})})),n}(t,e);s(t,n)}))}(t,n.type,n.value):function(t,e){r(t);var n=Ev(e);l("hex",x.some(e));var o=jv(n);a(t,o),f(o),Vr(t,nw,{hex:n}),s(t,n)}(t,n.value)},g=function(t){return{label:e(Jx+t+".label"),description:e(Jx+t+".description")}},h=g("red"),p=g("green"),v=g("blue"),b=g("hex");return Rt(Gx.sketch((function(t){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[t.field("red",qb.sketch(u(Fv,"red",h.label,h.description,255))),t.field("green",qb.sketch(u(Fv,"green",p.label,p.description,255))),t.field("blue",qb.sketch(u(Fv,"blue",v.label,v.description,255))),t.field("hex",qb.sketch(u(Rv,"hex",b.label,b.description,"ffffff"))),c.asSpec()],formBehaviours:La([zy.config({invalidClass:n("form-invalid")}),Nm("rgb-form-events",[Kr(Xx,m),Kr(Kx,d),Kr(Yx,d)])])}})),{apis:{updateHex:function(t,e){ll.setValue(t,{hex:e.value}),function(t,e){var n=jv(e);a(t,n),f(n)}(t,e),s(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Zx=function(e,n){return mf({name:"ColourPicker",configFields:[_e("dom"),je("onValidHex",t),je("onInvalidHex",t)],factory:function(t){var o,i=Qx(e,n,t.onValidHex,t.onInvalidHex),u=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),o=Vx.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return mf({factory:function(t){var u=r({x:0,y:0}),a=La([wf.config({find:x.some}),Bm.config({})]);return Vx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[n,o],onChange:function(t,e,n){Vr(t,ow,{value:n})},onInit:function(t,e,n,r){i(n.element.dom,Wv(qv))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom;i(n,Wv(e))}(e,n)}},extraApis:{}})}(0,n),a={paletteRgba:Qe(qv)},c=Rg(u.sketch({})),s=Rg(i.sketch({})),l=function(t,e){c.getOpt(t).each((function(t){var n=jv(e);a.paletteRgba.set(n),u.setRgba(t,n)}))},f=function(t,e){s.getOpt(t).each((function(t){i.updateHex(t,e)}))},d=function(t,e,n){j(n,(function(n){n(t,e)}))};return{uid:t.uid,dom:t.dom,components:[c.asSpec(),jx(0,n),s.asSpec()],behaviours:La([Nm("colour-picker-events",[Kr(ow,(o=[f],function(t,e){var n=e.event.value,r=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?ew(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,ew(Math.round(n),Math.round(100*e),Math.round(100*r)))}(a.paletteRgba.get()),i=ew(r.hue,n.x,100-n.y),u=Vv(i),c=zv(u);d(t,c,o)})),Kr(rw,function(){var t=[l,f];return function(e,n){var r=function(t){var e=ew((100-t)/100*360,100,100),n=Vv(e);return zv(n)}(n.event.value.y);d(e,r,t)}}())]),wf.config({find:function(t){return s.getOpt(t)}}),km.config({mode:"acyclic"})])}}})},tC=function(){return wf.config({find:x.some})},eC=function(t){return wf.config({find:function(e){return xo(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},nC={"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","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},rC=function(t){return function(t){return nC[t]}(t)},oC=tinymce.util.Tools.resolve("tinymce.Resource"),iC=tinymce.util.Tools.resolve("tinymce.util.Tools"),uC=Zt([je("preprocess",o),je("postprocess",o)]),aC=function(t,e,n){return ll.config(Rt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},cC=function(t,e){var n=ge("RepresentingConfigs.memento processors",uC,e);return ll.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=ll.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);ll.setValue(i,o)}}})},sC=aC,lC=function(t){return e=No,n=Ro,aC(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}));var e,n},fC=function(t){return ll.config({store:{mode:"memory",initialValue:t}})},dC=Uo("alloy-fake-before-tabstop"),mC=Uo("alloy-fake-after-tabstop"),gC=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:La([Bm.config({ignore:!0}),Xb.config({})])}},hC=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[gC([dC]),t,gC([mC])],behaviours:La([eC(1)])}},pC=function(t,e){Vr(t,ur(),{raw:{which:9,shiftKey:e}})},vC=function(t,e){var n=e.element;yi(n,dC)?pC(t,!0):yi(n,mC)&&pC(t,!1)},bC=function(t){return Ab(t,["."+dC,"."+mC].join(","),c)},yC=!(Ln().browser.isIE()||Ln().browser.isEdge());function wC(t,e){return SC(document.createElement("canvas"),t,e)}function xC(t){var e=wC(t.width,t.height);return CC(e).drawImage(t,0,0),e}function CC(t){return t.getContext("2d")}function SC(t,e,n){return t.width=e,t.height=n,t}function kC(t){return t.naturalWidth||t.width}function OC(t){return t.naturalHeight||t.height}var TC=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function _C(t,e,n){return e=e||"image/png",N(HTMLCanvasElement.prototype.toBlob)?new TC((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):(r=t.toDataURL(e,n),new TC((function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return x.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,a),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=u[g].charCodeAt(0);s[l]=new Uint8Array(m)}return x.some(new Blob(s,{type:r}))})(r).fold((function(){e("uri is not base64: "+r)}),t)})));var r}function EC(t,e,n){var o=e.type;function i(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:r(o),toBlob:function(){return TC.resolve(e)},toDataURL:r(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return _C(t,e,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(xC)}}}function AC(t){return function(t){return new TC((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return EC(function(t){return function(t){return new TC((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=wC(kC(t),OC(t));return CC(e).drawImage(t,0,0),e}))}(t),t,e)}))}function NC(t,e){return _C(t,e).then((function(e){return EC(TC.resolve(t),e,t.toDataURL())}))}function RC(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var MC=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function zC(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o}function DC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t);var o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*O+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),NC(t,e)}(n,t.getType(),e)}))}function BC(t){return function(e,n){return DC(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var PC,IC,LC=function(t){return function(e){return DC(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),HC=BC((function(t,e){return zC(t,[1,0,0,0,e=RC(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),FC=BC((function(t,e){var n;return e=RC(e,-1,1),zC(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?MC[e]:MC[Math.floor(e)]*(1-n)+MC[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),VC=(PC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),NC(t,e)}(n,t.getType(),e)}))}(t,PC)}),jC=(IC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=CC(t),o=new Array(256),i=0;i<o.length;i++)o[i]=IC(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),NC(t,e)}(n,t.getType(),e)}))});function UC(t,e,n){var r=kC(t),o=OC(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=function(t,e,n){return new TC((function(r){var o=kC(t),i=OC(t),u=Math.floor(o*e),a=Math.floor(i*n),c=wC(u,a);CC(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}(t,i,u);return a?c.then((function(t){return UC(t,e,n)})):c}var WC,qC=function(t){return LC(t)},$C=function(t){return VC(t)},GC=function(t,e){return jC(t,e)},XC=function(t,e){return HC(t,e)},KC=function(t,e){return FC(t,e)},YC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),NC(r,e)}(n,t.getType(),e)}))}(t,e)},JC=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return UC(r,e,n).then((function(e){return NC(e,t.getType())}))}))}(t,e,n)},QC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||SC(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),NC(r,e)}(n,t.getType(),e)}))}(t,e)},ZC=function(t,e){return f({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},tS=function(t,e){return ZC(zg(t,e),{})},eS=function(t,e){return ZC(zg(t,e),{behaviours:La([Am.config({})])})},nS=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:La([Am.config({})])}},rS=Uo("toolbar.button.execute"),oS=((WC={})[yr()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],WC),iS=Uo("update-menu-text"),uS=Uo("update-menu-icon"),aS=function(e,n,r){var o=Qe(t),u=e.text.map((function(t){return Rg(nS(t,n,r.providers))})),a=e.icon.map((function(t){return Rg(eS(t,r.providers.icons))})),c=function(t,e){var n=ll.getValue(t);return Bm.focus(n),Vr(n,"keydown",{raw:e.event.raw}),Yy.close(n),x.some(!0)},s=e.role.fold((function(){return{}}),(function(t){return{role:t}})),l=e.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}}));return Rg(Yy.sketch(f(f(f({},e.uid?{uid:e.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(V(e.classes,(function(t){return n+"--"+t}))),attributes:f({},l)},components:lv([a.map((function(t){return t.asSpec()})),u.map((function(t){return t.asSpec()})),x.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:zg("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:La(m(e.dropdownBehaviours,[nv((function(){return e.disabled||r.providers.isDisabled()})),ev(),Jy.config({}),Am.config({}),Nm("dropdown-events",[uv(e,o),av(e,o)]),Nm("menubutton-update-display-text",[Kr(iS,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[Yi(r.providers.translate(e.event.text))])}))})),Kr(uS,(function(t,e){a.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[eS(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Rt(oS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:La([km.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:Mh(0,e.columns,e.presets)},fetch:function(t){return Cy(i(e.fetch,t))}}))).asSpec()},cS=function(t){return"separator"===t.type},sS={type:"separator"},lS=function(t,e){var n=function(t,e){var n=$(t,(function(t,n){return function(t){return k(t)}(n)?""===n?t:"|"===n?t.length>0&&!cS(t[t.length-1])?t.concat([sS]):t:Tt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&cS(n[n.length-1])&&n.pop(),n}(k(t)?t.split(" "):t,e);return q(n,(function(t,n){var r=function(t,e){return function(t){return Tt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=lS(n,e);return{item:t,menus:Rt(r.menus,Vt(t.value,r.items)),expansions:Rt(r.expansions,Vt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}}(function(t){if(cS(t))return t;var e=Ot(t,"value").getOrThunk((function(){return Uo("generated-menu-item")}));return Rt({value:e},t)}(n),e);return{menus:Rt(t.menus,r.menus),items:[r.item].concat(t.items),expansions:Rt(t.expansions,r.expansions)}}),{menus:{},expansions:{},items:[]})},fS=function(t,e,n,r){var o=Uo("primary-menu"),i=lS(t,n.shared.providers.menuItems());if(0===i.items.length)return x.none();var u=Cb(o,i.items,e,n,r),a=wt(i.menus,(function(t,r){return Cb(r,t,e,n,!1)})),c=Rt(a,Vt(o,u));return x.from(pg.tieredData(o,c,i.expansions))},dS=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setActive:function(e){var n=t.element;e?(vi(n,"tox-tbtn--enabled"),zo(n,"aria-pressed",!0)):(bi(n,"tox-tbtn--enabled"),Io(n,"aria-pressed"))},isActive:function(){return yi(t.element,"tox-tbtn--enabled")}}},mS=function(t,e,n,r){return aS({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(fS(t,ph.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:dS,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({})]},e,n.shared)},gS=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){$a(e.element),Vr(e,ry,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(V(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return f(f({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},hS=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=f({buttonBehaviours:La([nv((function(){return t.disabled||i.isDisabled()})),ev(),Xb.config({}),Nm("button press",[Xr("click"),Xr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Rt(a,{dom:r});return Rt(c,{components:o})},pS=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return tS(t,n.icons)})),u=lv([i]);return hS(t,e,r,o,u,n)},vS=function(t,e,n,r){void 0===r&&(r=[]);var o=pS(t,x.some(e),n,r);return Ng.sketch(o)},bS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return tS(t,n.icons)})):x.none(),a=u.isSome()?lv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=m(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=f(f({tag:"button",classes:s},c),{attributes:{title:i}});return hS(t,e,r,l,a,n)},yS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=bS(t,x.some(e),n,r,o);return Ng.sketch(i)},wS=function(t,e){return function(n){"custom"===e?Vr(n,ry,{name:t,value:{}}):"submit"===e?Fr(n,oy):"cancel"===e?Fr(n,ny):console.error("Unknown button type: ",e)}},xS=function(e,n,r){if(function(t,e){return"menu"===e}(0,n)){var o=e,i=f(f({},e),{onSetup:function(n){return n.setDisabled(e.disabled),t},fetch:gS(o.items,(function(){return u}),r)}),u=Rg(mS(i,"tox-tbtn",r,x.none()));return u.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,n)){var a=wS(e.name,n),c=f(f({},e),{borderless:!1});return yS(c,a,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},CS=r([je("field1Name","field1"),je("field2Name","field2"),Ju("onLockedChange"),Gu(["lockClass"]),je("locked",!1),gl("coupledFieldBehaviours",[wf,ll])]),SS=function(t,e){return Ll({factory:qb,name:t,overrides:function(t){return{fieldBehaviours:La([Nm("coupled-input-behaviour",[Kr(cr(),(function(n){(function(t,e,n){return Ql(t,e,n).bind(wf.getCurrent)})(n,t,e).each((function(e){Ql(n,t,"lock").each((function(r){Gm.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},kS=r([SS("field1","field2"),SS("field2","field1"),Ll({factory:Ng,schema:[_e("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:La([Gm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),OS=gf({name:"FormCoupledInputs",configFields:CS(),partFields:kS(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hl(t.coupledFieldBehaviours,[wf.config({find:x.some}),ll.config({store:{mode:"manual",getValue:function(e){var n,r=rf(e,t,["field1","field2"]);return(n={})[t.field1Name]=ll.getValue(r.field1()),n[t.field2Name]=ll.getValue(r.field2()),n},setValue:function(e,n){var r=rf(e,t,["field1","field2"]);_t(n,t.field1Name)&&ll.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&ll.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Ql(e,t,"field1")},getField2:function(e){return Ql(e,t,"field2")},getLock:function(e){return Ql(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),TS=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return ct.value({value:n,unit:r})}return ct.error(t)},_S=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?x.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?x.some(t.value):x.some(t.value/n[t.unit]*n[e]):x.none()},ES=function(t){return x.none()},AS=function(t,e){var n=ES,r=Uo("ratio-event"),o=OS.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:zg("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:zg("unlock",e.icons)}}],buttonBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return qb.parts.field({factory:my,inputClasses:["tox-textfield"],inputBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({}),Nm("size-input-events",[Kr(or(),(function(t,e){Vr(t,r,{isField1:n})})),Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=OS.parts.field1(i([qb.parts.label(a("Width")),u(!0)])),s=OS.parts.field2(i([qb.parts.label(a("Height")),u(!1)]));return OS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){TS(ll.getValue(t)).each((function(t){n(t).each((function(t){ll.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.disable),OS.getField2(t).bind(qb.getField).each(kp.disable),OS.getLock(t).each(kp.disable)},onEnabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.enable),OS.getField2(t).bind(qb.getField).each(kp.enable),OS.getLock(t).each(kp.enable)}}),ev(),Nm("size-input-events2",[Kr(r,(function(t,e){var r,o,i,u,a=e.event.isField1,c=a?OS.getField1(t):OS.getField2(t),s=a?OS.getField2(t):OS.getField1(t),l=c.map(ll.getValue).getOr(""),f=s.map(ll.getValue).getOr("");r=f,n=(o=TS(l).toOptional(),i=TS(r).toOptional(),u=function(t,e){return _S(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return _S(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(ES)},o.isSome()&&i.isSome()?x.some(u(o.getOrDie(),i.getOrDie())):x.none()).getOr(ES)}))])])})},NS={undo:r(Uo("undo")),redo:r(Uo("redo")),zoom:r(Uo("zoom")),back:r(Uo("back")),apply:r(Uo("apply")),swap:r(Uo("swap")),transform:r(Uo("transform")),tempTransform:r(Uo("temp-transform")),transformApply:r(Uo("transform-apply"))},RS=r("save-state"),MS=r("disable"),zS=r("enable"),DS={formActionEvent:ry,saveState:RS,disable:MS,enable:zS},BS=function(e,n){var o=function(t,e,r,o){return Rg(yS({name:t,text:t,disabled:r,primary:o,icon:x.none(),borderless:!1},e,n))},i=function(t,e,r,o){return Rg(vS({name:t,icon:x.some(t),tooltip:x.some(e),disabled:o,primary:!1,borderless:!1},r,n))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=t,l=function(t,e,n){Vr(t,e,n)},f=function(t){return Fr(t,DS.disable())},d=function(t){return Fr(t,DS.enable())},m=function(t,e){f(t),l(t,NS.transform(),{transform:e}),d(t)},g=function(t){return function(){et.getOpt(t).each((function(t){Am.set(t,[Z])}))}},h=function(t,e){f(t),l(t,NS.transformApply(),{transform:e,swap:g(t)}),d(t)},p=function(){return o("Back",(function(t){return l(t,NS.back(),{swap:g(t)})}),!1,!1)},v=function(){return Rg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:La([kp.config({})])})},b=function(){return o("Apply",(function(t){return l(t,NS.apply(),{swap:g(t)})}),!0,!0)},y=function(){return function(t){var n=e.getRect();return function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return function(t,e,n,r,o,i){var u=wC(o,i);return CC(u).drawImage(t,-n,-r),NC(u,e)}(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)}(t,n.x,n.y,n.w,n.h)}},w=[p(),v(),o("Apply",(function(t){var n=y();h(t,n),e.hideCrop()}),!1,!0)],C=Vb.sketch({dom:c,components:w.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-crop-buttons-events",[Kr(DS.disable(),(function(t,e){u(w,t)})),Kr(DS.enable(),(function(t,e){a(w,t)}))])])}),S=Rg(AS({name:"size",label:x.none(),constrain:!0,disabled:!1},n)),k=[p(),v(),S,v(),o("Apply",(function(t){S.getOpt(t).each((function(e){var n,r,o=ll.getValue(e),i=(n=parseInt(o.width,10),r=parseInt(o.height,10),function(t){return JC(t,n,r)});h(t,i)}))}),!1,!0)],O=Vb.sketch({dom:c,components:k.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-resize-buttons-events",[Kr(DS.disable(),(function(t,e){u(k,t)})),Kr(DS.enable(),(function(t,e){a(k,t)}))])])}),T=function(t,e){return function(n){return t(n,e)}},_=T(YC,"h"),E=T(YC,"v"),A=T(QC,-90),N=T(QC,90),R=function(t,e){!function(t,e){f(t),l(t,NS.tempTransform(),{transform:e}),d(t)}(t,e)},M=[p(),v(),i("flip-horizontally","Flip horizontally",(function(t){R(t,_)}),!1),i("flip-vertically","Flip vertically",(function(t){R(t,E)}),!1),i("rotate-left","Rotate counterclockwise",(function(t){R(t,A)}),!1),i("rotate-right","Rotate clockwise",(function(t){R(t,N)}),!1),v(),b()],z=Vb.sketch({dom:c,components:M.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-fliprotate-buttons-events",[Kr(DS.disable(),(function(t,e){u(M,t)})),Kr(DS.enable(),(function(t,e){a(M,t)}))])])}),D=function(t,e,o,i,u){var a=Vx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}),c=Vx.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=Vx.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Rg(Vx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:u,getInitialValue:r({x:i})},components:[a,c,s],sliderBehaviours:La([Bm.config({})]),onChoose:e}))},B=function(t,e,n,r,o){return D(t,(function(t,n,r){var o=T(e,r.x/100);m(t,o)}),n,r,o)},P=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[p(),B(t,e,n,r,o),b()]}(t,e,n,r,o);return Vb.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-filter-panel-buttons-events",[Kr(DS.disable(),(function(t,e){u(i,t)})),Kr(DS.enable(),(function(t,e){a(i,t)}))])])})},I=[p(),v(),b()],L=Vb.sketch({dom:c,components:I.map((function(t){return t.asSpec()}))}),H=P("Brightness",XC,-100,0,100),F=P("Contrast",KC,-100,0,100),V=P("Gamma",GC,-100,0,100),j=function(t,e,n){return function(r){return function(t,e,n,r){return function(t,e,n,r){return DC(t,function(t,e,n,r){return zC([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[e=RC(e,0,2),0,0,0,0,0,n=RC(n,0,2),0,0,0,0,0,r=RC(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}(0,e,n,r))}(t,e,n,r)}(r,t,e,n)}},U=function(t){return D(t,(function(t,e,n){var r=W.getOpt(t),o=$.getOpt(t),i=q.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=ll.getValue(e).x/100,i=ll.getValue(r).x/100,u=ll.getValue(n).x/100,a=j(o,i,u);m(t,a)}))}))}))}),0,100,200)},W=U("R"),q=U("G"),$=U("B"),G=[p(),W,q,$,b()],X=Vb.sketch({dom:c,components:G.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){l(r,NS.swap(),{transform:e,swap:function(){et.getOpt(r).each((function(e){Am.set(e,[t]),n(e)}))}})}},Y=x.some($C),J=x.some(qC),Q=[i("crop","Crop",K(C,x.none(),(function(t){e.showCrop()})),!1),i("resize","Resize",K(O,x.none(),(function(t){S.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;ll.setValue(t,{width:r,height:o})}))})),!1),i("orientation","Orientation",K(z,x.none(),s),!1),i("brightness","Brightness",K(H,x.none(),s),!1),i("sharpen","Sharpen",K(L,Y,s),!1),i("contrast","Contrast",K(F,x.none(),s),!1),i("color-levels","Color levels",K(X,x.none(),s),!1),i("gamma","Gamma",K(V,x.none(),s),!1),i("invert","Invert",K(L,J,s),!1)],Z=Vb.sketch({dom:c,components:Q.map((function(t){return t.asSpec()}))}),tt=Vb.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:La([Am.config({})])}),et=Rg(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},PS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),IS=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),LS=tinymce.util.Tools.resolve("tinymce.util.Observable"),HS=tinymce.util.Tools.resolve("tinymce.util.VK");function FS(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function VS(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(FS(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){FS(t),IS(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};this.destroy=function(){IS(a).off()},IS(a).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);FS(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=IS("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(u.body),IS(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)}))}var jS,US=0,WS=function(t){var e=Rg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=Qe(1),r=Qe(x.none()),o=Qe({x:0,y:0,w:1,h:1}),i=Qe({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=fu(t.element),c=ru(t.element),s=i.dom.naturalWidth*u,l=i.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Pi(i,m),e.getOpt(t).each((function(t){Pi(t.element,m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=en("img");return zo(a,"src",e),(r=a.dom,new Gg((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){return s.getOpt(t).map((function(t){var e=Ji({element:a});Am.replaceAt(t,1,x.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=PS.inflate(c,-20,-20);return o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=fu(t.element),o=ru(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a),a}))}))},c=Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:La([Nm("image-panel-crop-events",[ro((function(t){s.getOpt(t).each((function(t){var e=function(t,e,n,r,o){var i,u="tox-crid-"+US++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function l(e,r,o,i){var u,a,c,l,f;u=r.x,a=r.y,c=r.w,l=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=PS.clamp({x:u,y:a,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)}function f(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),IS("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}iC.each(a,(function(e){IS("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){f(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}IS('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),iC.each(c,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),iC.each(a,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=iC.map(a,(function(e){var n;return new VS(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),IS(r).on("focusin focusout",(function(t){IS(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),IS(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)}switch(iC.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1})),e.keyCode){case HS.LEFT:r(e,0,t,-10,0);break;case HS.RIGHT:r(e,0,t,10,0);break;case HS.UP:r(e,0,t,0,-10);break;case HS.DOWN:r(e,0,t,0,10);break;case HS.ENTER:case HS.SPACEBAR:e.preventDefault(),o()}}));var g=iC.extend({toggleVisibility:function(t){var e=iC.map(a,(function(t){return"#"+u+"-"+t.name})).concat(iC.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?IS(e,r).show():IS(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){iC.each(i,(function(t){t.destroy()})),i=[]}},LS);return g}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element.dom,(function(){}));e.toggleVisibility(!1),e.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(x.some(e))}))}))])])}],containerBehaviours:La([Am.config({}),Nm("image-panel-events",[ro((function(e){a(e,t)}))])])}),s=Rg(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.get().each((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.get().each((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},qS=function(t,e,n,r,o){return vS({name:t,icon:x.some(e),disabled:n,tooltip:x.some(t),primary:!1,borderless:!1},r,o)},$S=function(t,e){e?kp.enable(t):kp.disable(t)},GS=function(e,n){var r=function(t){var e=Qe(t),n=Qe(x.none()),r=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();r.add(t);var o=function(t){e.set(t)},i=function(t){return{blob:t,url:URL.createObjectURL(t)}},u=function(t){URL.revokeObjectURL(t.url)},a=function(){n.get().each(u),n.set(x.none())},c=function(t){var e,n=i(t);return o(n),e=r.add(n).removed,iC.each(e,u),n.url};return{getBlobState:function(){return e.get()},setBlobState:o,addBlobState:c,getTempState:function(){return n.get().fold((function(){return e.get()}),(function(t){return t}))},updateTempState:function(t){var e=i(t);return a(),n.set(x.some(e)),e.url},addTempState:function(t){var e=i(t);return n.set(x.some(e)),e.url},applyTempState:function(t){return n.get().fold((function(){}),(function(e){c(e.blob),t()}))},destroyTempState:a,undo:function(){var t=r.undo();return o(t),t.url},redo:function(){var t=r.redo();return o(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}}(e.currentState),o=function(t){var e=r.getHistoryStates();m.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Vr(t,DS.formActionEvent,{name:DS.saveState(),value:e.undoEnabled})},i=function(t){return t.toBlob()},u=function(t){Vr(t,DS.formActionEvent,{name:DS.disable(),value:{}})},a=function(t){g.getApplyButton(t).each((function(t){kp.enable(t)})),Vr(t,DS.formActionEvent,{name:DS.enable(),value:{}})},c=function(t,e){return u(t),d.updateSrc(t,e)},s=function(t,e,n,r,s){return u(t),function(t){return AC(t)}(e).then(n).then(i).then(r).then((function(e){return c(t,e).then((function(e){return o(t),s(),a(t),e}))})).catch((function(e){return console.log(e),a(t),e}))},l=function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(t){return r.updateTempState(t)}),n)},f=function(t){var e=r.getBlobState().url;return r.destroyTempState(),o(t),e},d=WS(e.currentState.url),m=function(t){var e=Rg(qS("Undo","undo",!0,(function(t){Vr(t,NS.undo(),{direction:1})}),t)),n=Rg(qS("Redo","redo",!0,(function(t){Vr(t,NS.redo(),{direction:1})}),t));return{container:Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),qS("Zoom in","zoom-in",!1,(function(t){Vr(t,NS.zoom(),{direction:1})}),t),qS("Zoom out","zoom-out",!1,(function(t){Vr(t,NS.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){$S(t,r)})),n.getOpt(t).each((function(t){$S(t,o)}))}}}(n),g=BS(d,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[g.memContainer.asSpec(),d.memContainer.asSpec(),m.container],behaviours:La([ll.config({store:{mode:"manual",getValue:function(){return r.getBlobState()}}}),Nm("image-tools-events",[Kr(NS.undo(),(function(t,e){var n=r.undo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.redo(),(function(t,e){var n=r.redo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.zoom(),(function(t,e){var n=e.event.direction;d.zoom(t,n)})),Kr(NS.back(),(function(t,e){!function(t){var e=f(t);c(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),d.hideCrop()})),Kr(NS.apply(),(function(t,e){r.applyTempState((function(){f(t),(0,e.event.swap)()}))})),Kr(NS.transform(),(function(e,n){return l(e,n.event.transform,t)})),Kr(NS.tempTransform(),(function(e,n){return function(e,n){var o=r.getTempState().blob;s(e,o,n,(function(t){return r.addTempState(t)}),t)}(e,n.event.transform)})),Kr(NS.transformApply(),(function(t,e){return function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(e){var n=r.addBlobState(e);return f(t),n}),n)}(t,e.event.transform,e.event.swap)})),Kr(NS.swap(),(function(t,e){!function(t){m.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){l(t,e,r)}))}))]),tC()])}},XS=function(t){return!Tt(t,"items")},KS="data-value",YS=function(t,e,n,r){return V(n,(function(n){return XS(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){ll.setValue(t,n.value),Vr(t,ty,{name:e}),Bm.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return YS(t,e,n.items,r)}}}))},JS=function(t,e){return it(t,(function(t){return XS(t)?pf(t.value===e,t):JS(t.items,e)}))},QS=mf({name:"HtmlSelect",configFields:[_e("options"),fl("selectBehaviours",[Bm,ll]),je("selectClasses",[]),je("selectAttributes",{}),Pe("data")],factory:function(t,e){var n=V(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Vt("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:ml(t.selectBehaviours,[Bm.config({}),ll.config({store:f({mode:"manual",getValue:function(t){return qi(t.element)},setValue:function(e,n){G(t.options,(function(t){return t.value===n})).isSome()&&$i(e.element,n)}},r)})])}}}),ZS=function(t,e){var n=t.label.map((function(t){return Zb(t,e)})),o=[kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),km.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Fr(t,oy),x.some(!0)}}),Nm("textfield-change",[Kr(cr(),(function(e,n){Vr(e,ty,{name:t.name})})),Kr(vr(),(function(e,n){Vr(e,ty,{name:t.name})}))]),Xb.config({})],i=t.validation.map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=ll.getValue(e),r=t.validator(n);return Sy(!0===r?ct.value(n):ct.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),u=t.placeholder.fold(r({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(r({}),(function(t){return{inputmode:t}})),c=f(f({},u),a),s=qb.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:c,inputClasses:[t.classname],inputBehaviours:La(K([o,i])),selectOnFocus:!1,factory:my}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),d=[kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()];return Yb(n,s,l,d)},tk=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return $r([Kr(t.event,n),oo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Kr(t,(function(){return e.cancel()}))]})).getOr([])))}}),ek=function(t){var e=Qe(null);return ui({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},nk=Object.freeze({__proto__:null,throttle:ek,init:function(t){return t.stream.streams.state(t)}}),rk=[Ee("stream",ve("mode",{throttle:[_e("delay"),je("stopEvent",!0),Zu("streams",{setup:function(t,e){var n=t.stream,r=Lg(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:ek})]})),je("event","input"),Pe("cancelEvent"),Ju("onStream")],ok=Fa({fields:rk,name:"streaming",active:tk,state:nk}),ik=function(t,e,n){var r=ll.getValue(n);ll.setValue(e,r),ak(e)},uk=function(t,e){var n=t.element,r=qi(n),o=n.dom;"number"!==Do(n,"type")&&e(o,r)},ak=function(t){uk(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},ck=r("alloy.typeahead.itemexecute"),sk=r([Pe("lazySink"),_e("fetch"),je("minChars",5),je("responseTime",1e3),Ku("onOpen"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),je("layouts",x.none()),je("eventOrder",{}),Ye("model",{},[je("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),je("selectsOver",!0),je("populateFromBrowse",!0)]),Ku("onSetValue"),Yu("onExecute"),Ku("onItemExecute"),je("inputClasses",[]),je("inputAttributes",{}),je("inputStyles",{}),je("matchWidth",!0),je("useMinWidth",!1),je("dismissOnBlur",!0),Gu(["openClass"]),Pe("initialData"),fl("typeaheadBehaviours",[Bm,ll,ok,km,Gm,Py]),Je("previewing",(function(){return Qe(!0)}))].concat(sy()).concat(Gy())),lk=r([Hl({schema:[$u()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){(function(t,e,n){if(t.selectsOver){var r=ll.getValue(e),o=t.getDisplayText(r),i=ll.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?x.some((function(){ik(0,e,n),function(t,e){uk(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):x.none()}return x.none()})(t.model,r,n).fold((function(){return Nf.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Vr(t,ck(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)}))}}}})]),fk=gf({name:"Typeahead",configFields:sk(),partFields:lk(),factory:function(e,n,r,o){var i=function(n,r,i){e.previewing.set(!1);var u=Py.getCoupled(n,"sandbox");Ws.isOpen(u)?wf.getCurrent(u).each((function(t){Nf.getHighlighted(t).fold((function(){i(t)}),(function(){qr(u,t.element,"keydown",r)}))})):Fy(e,a(n),n,u,o,(function(t){wf.getCurrent(t).each(i)}),py.HighlightFirst).get(t)},u=ly(e),a=function(t){return function(e){return e.map((function(e){var n=kt(e.menus),r=Y(n,(function(t){return W(t.items,(function(t){return"item"===t.type}))}));return ll.getState(t).update(V(r,(function(t){return t.data}))),e}))}},c=[Bm.config({}),ll.config({onSetValue:e.onSetValue,store:f({mode:"dataset",getDataKey:function(t){return qi(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){$i(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(t){return Vt("initialValue",t)})).getOr({}))}),ok.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(n,r){var i=Py.getCoupled(n,"sandbox");if(Bm.isFocused(n)&&qi(n.element).length>=e.minChars){var u=wf.getCurrent(i).bind((function(t){return Nf.getHighlighted(t).map(ll.getValue)}));e.previewing.set(!0),Fy(e,a(n),n,i,o,(function(t){wf.getCurrent(i).each((function(t){u.fold((function(){e.model.selectsOver&&Nf.highlightFirst(t)}),(function(e){Nf.highlightBy(t,(function(t){return ll.getValue(t).value===e.value})),Nf.getHighlighted(t).orThunk((function(){return Nf.highlightFirst(t),x.none()}))}))}))}),py.HighlightFirst).get(t)}},cancelEvent:kr()}),km.config({mode:"special",onDown:function(t,e){return i(t,e,Nf.highlightFirst),x.some(!0)},onEscape:function(t){var e=Py.getCoupled(t,"sandbox");return Ws.isOpen(e)?(Ws.close(e),x.some(!0)):x.none()},onUp:function(t,e){return i(t,e,Nf.highlightLast),x.some(!0)},onEnter:function(t){var n=Py.getCoupled(t,"sandbox"),r=Ws.isOpen(n);if(r&&!e.previewing.get())return wf.getCurrent(n).bind((function(t){return Nf.getHighlighted(t)})).map((function(e){return Vr(t,ck(),{item:e}),!0}));var o=ll.getValue(t);return Fr(t,kr()),e.onExecute(n,t,o),r&&Ws.close(n),x.some(!0)}}),Gm.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){return Gm.on(t)},onClose:function(){return Gm.off(t)}})}}}),Nm("typeaheadevents",[uo((function(n){var r=t;jy(e,a(n),n,o,r,py.HighlightFirst).get(t)})),Kr(ck(),(function(t,n){var r=Py.getCoupled(t,"sandbox");ik(e.model,t,n.event.item),Fr(t,kr()),e.onItemExecute(t,r,n.event.item,ll.getValue(t)),Ws.close(r),ak(t)}))].concat(e.dismissOnBlur?[Kr(pr(),(function(t){var e=Py.getCoupled(t,"sandbox");Xa(e.element).isNone()&&Ws.close(e)}))]:[]))];return{uid:e.uid,dom:dy(Rt(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:f(f({},u),ml(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}}}),dk=function(t){return f(f({},t),{toCached:function(){return dk(t.toCached())},bindFuture:function(e){return dk(t.bind((function(t){return t.fold((function(t){return Sy(ct.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return dk(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return dk(t.map((function(t){return t.map(e)})))},mapError:function(e){return dk(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return dk(Cy((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ct.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},mk=function(t){return dk(Cy(t))},gk={type:"separator"},hk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},pk=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},vk=function(t,e){return function(t){return V(t,hk)}(function(t,e){return W(e,(function(e){return e.type===t}))}(t,e))},bk=function(t){return vk("header",t.targets)},yk=function(t){return vk("anchor",t.targets)},wk=function(t){return x.from(t.anchorTop).map((function(t){return pk("<top>",t)})).toArray()},xk=function(t){return x.from(t.anchorBottom).map((function(t){return pk("<bottom>",t)})).toArray()},Ck=function(t,e){var n=t.toLowerCase();return W(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return ln(e.toLowerCase(),n)||ln(t.value.toLowerCase(),n)}))},Sk=Uo("aria-invalid"),kk=function(t){return function(e,n,r){return Ot(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},Ok={bar:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),collection:kk((function(t,e){return function(t,e){var n,r,i=t.label.map((function(t){return Zb(t,e)})),u=function(t){return function(e,n){Du(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Do(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||Vr(n,ry,{name:t.name,value:i})})),c=[Kr(rr(),u((function(t,e,n){$a(n)}))),Kr(lr(),a),Kr(xr(),a),Kr(or(),u((function(t,e,n){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)})),vi(n,Sh)}))),Kr(ir(),u((function(t){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)}))}))),uo(u((function(e,n,r,o){Vr(e,ry,{name:t.name,value:o})})))],s=function(t,e){return V(Fc(t.element,".tox-collection__item"),e)},l=qb.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:o},behaviours:La([kp.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){vi(t,"tox-collection__item--state-disabled"),zo(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){bi(t,"tox-collection__item--state-disabled"),Io(t,"aria-disabled")}))}}),ev(),Am.config({}),ll.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=V(r,(function(n){var r=lp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Kb.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?F(o,t.columns):[o],u=V(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ro(n.element,u.join(""))}(n,r),"auto"===t.columns&&Zh(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;km.setGridSize(n,e,r)})),Fr(n,cy)}}),Xb.config({}),km.config((r=t.columns,1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+bh}})),Nm("collection-events",c)]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Yb(i,l,["tox-form__group--collection"],[])}(t,e.shared.providers)})),alertbanner:kk((function(t,e){return function(t,e){return Vb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:zg(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Vr(e,ry,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!0,label:t.label,inputMode:x.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:kk((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=V(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:La([tC(),Am.config({}),lC(x.none()),km.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Rt(n,{source:"dynamic"});return kk(t)(e,o,r)}}((function(t,e){return function(t,e){var n=yC&&t.sandboxed,r=f(f({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=Qe("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)zo(n.element,"srcdoc",r);else{zo(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Zb(t,e)})),u=qb.parts.field({factory:{sketch:function(t){return hC({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:La([Xb.config({}),Bm.config({}),sC(x.none(),o.getValue,o.setValue)])})}}});return Yb(i,u,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),button:kk((function(t,e){return function(t,e){var n,r,o=wS(t.name,"custom");return n=x.none(),r=qb.parts.field(f({factory:Ng},bS(t,x.some(o),e,[fC(""),tC()]))),Yb(n,r,[],[])}(t,e.shared.providers)})),checkbox:kk((function(t,e){return function(t,e){var n=ll.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),x.some(!0)},i=qb.parts.field({factory:{sketch:o},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:La([tC(),kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Bm.config({}),n,km.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Nm("checkbox-events",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),u=qb.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:La([Jy.config({})])}),a=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:zg("checked"===t?"selected":"unselected",e.icons)}}},c=Rg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return qb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,c.asSpec(),u],fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),colorinput:kk((function(t,e){return function(t,e,n){var r=qb.parts.field({factory:my,inputClasses:["tox-textfield"],onSetValue:function(t){return zy.run(t).get((function(){}))},inputBehaviours:La([kp.config({disabled:e.providers.isDisabled}),ev(),Xb.config({}),zy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return bo(t.element)},notify:{onValid:function(t){var e=ll.getValue(t);Vr(t,Qy,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=ll.getValue(t);if(0===e.length)return Sy(ct.value(!0));var n=en("span");Bi(n,"background-color",e);var r=Fi(n,"background-color").fold((function(){return ct.error("blah")}),(function(t){return ct.value(e)}));return Sy(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Zb(t,e.providers)})),i=function(t,e){Vr(t,Zy,{value:e})},u=Rg(function(t,e){return Yy.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:La([nv(e.providers.isDisabled),ev(),Jy.config({}),Xb.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Cy((function(e){return t.fetch(e)})).map((function(r){return x.from(Sb(Rt(sb(Uo("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:fb(t.columns,t.presets)})))}))},parts:{menu:Mh(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[wa,ya,ka]},onLtr:function(){return[ya,wa,ka]}},components:[],fetch:ob(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Fr(t,tw)}),(function(e){i(t,e),tb(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:La([Nm("form-field-events",[Kr(Qy,(function(e,n){u.getOpt(e).each((function(t){Bi(t.element,"background-color",n.event.color)})),Vr(e,ty,{name:t.name})})),Kr(Zy,(function(t,e){qb.getField(t).each((function(n){ll.setValue(n,e.event.value),wf.getCurrent(t).each(Bm.focus)}))})),Kr(tw,(function(t,e){qb.getField(t).each((function(e){wf.getCurrent(t).each(Bm.focus)}))}))])])})}(t,e.shared,e.colorinput)})),colorpicker:kk((function(t){var e=function(t){return"tox-"+t},n=Zx(rC,e),r=Rg(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:La([ll.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return wf.getCurrent(e).bind((function(t){return ll.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);wf.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){ll.setValue(t,{hex:x.from(n[1]).getOr("")}),Gx.getField(t,"hex").each((function(t){Fr(t,cr())}))}))}}}),tC()])}})),dropzone:kk((function(t,e){return function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,(function(t){t(e,n)}))}},o=function(t,e){if(!kp.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){ll.setValue(n,function(t,e){var n=iC.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return W(ot(t),(function(t){return L(n,(function(e){return fn(t.name,"."+e)}))}))}(r,e)),Vr(n,ty,{name:t.name})},a=Rg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:La([Nm("input-file-events",[to(lr()),to(xr())])])}),c=t.label.map((function(t){return Zb(t,e)})),s=qb.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:La([fC([]),tC(),kp.config({}),Gm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Nm("dropzone-events",[Kr("dragenter",r([n,Gm.toggle])),Kr("dragleave",r([n,Gm.toggle])),Kr("dragover",n),Kr("drop",r([n,o])),Kr(sr(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Ng.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:La([Xb.config({}),nv(e.isDisabled),ev()])})]}]}}}});return Yb(c,s,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),grid:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),listbox:kk((function(e,n){return function(e,n){var o=n.shared.providers,i=nt(e.items).filter(XS),u=e.label.map((function(t){return Zb(t,o)})),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[qb.parts.field({dom:{},factory:{sketch:function(o){return aS({uid:o.uid,text:i.map((function(t){return t.text})),icon:x.none(),tooltip:e.label,role:x.none(),fetch:function(t,r){var o=YS(t,e.name,e.items,ll.getValue(t));r(fS(o,ph.CLOSE_ON_EXECUTE,n,!1))},onSetup:r(t),getApi:r({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({}),ll.config({store:{mode:"manual",initialValue:i.map((function(t){return t.value})).getOr(""),getValue:function(t){return Do(t.element,KS)},setValue:function(t,n){JS(e.items,n).each((function(e){zo(t.element,KS,e.value),Vr(t,iS,{text:e.text})}))}}})]},"tox-listbox",n.shared)}}})]};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([u.toArray(),[a]]),fieldBehaviours:La([kp.config({disabled:r(e.disabled),onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}})])})}(e,n)})),selectbox:kk((function(t,e){return function(t,e){var n=V(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Zb(t,e)})),o=qb.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:QS,selectBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Nm("selectbox-change",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),i=t.size>1?x.none():x.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:zg("chevron-down",e.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:K([[o],i.toArray()])};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([r.toArray(),[u]]),fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),sizeinput:kk((function(t,e){return AS(t,e.shared.providers)})),urlinput:kk((function(e,n){return function(e,n,r){var o,i=n.shared.providers,u=function(t){var n=ll.getValue(t);r.addToHistory(n.value,e.filetype)},a=qb.parts.field({factory:fk,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":Sk,type:"url"},minChars:0,responseTime:0,fetch:function(t){var o=function(t,e,n){var r=ll.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=Ck(o,function(t){return V(t,(function(t){return pk(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,Ck(o,bk(e)),Ck(o,K([wk(e),yk(e),xk(e)]))],$(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(gk,e)}),[])):i}))}(e.filetype,t,r),i=fS(o,ph.BUBBLE_TO_SANDBOX,n,!1);return Sy(i)},getHotspot:function(t){return g.getOpt(t)},onSetValue:function(e,n){e.hasConfigured(zy)&&zy.run(e).get(t)},typeaheadBehaviours:La(K([r.getValidationHandler().map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){zo(t.element,"title",i.translate(e))}))}},validator:{validate:function(n){var r=ll.getValue(n);return mk((function(n){t({type:e.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ct.error(t.message);n(e)}else{var r=ct.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[kp.config({disabled:function(){return e.disabled||i.isDisabled()}}),Xb.config({}),Nm("urlinput-events",K(["file"===e.filetype?[Kr(cr(),(function(t){Vr(t,ty,{name:e.name})}))]:[],[Kr(sr(),(function(t){Vr(t,ty,{name:e.name}),u(t)})),Kr(vr(),(function(t){Vr(t,ty,{name:e.name}),u(t)}))]]))]])),eventOrder:(o={},o[cr()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:Mh(0,0,"normal")},onExecute:function(t,e,n){Vr(e,oy,{})},onItemExecute:function(t,n,r,o){u(t),Vr(t,ty,{name:e.name})}}),c=e.label.map((function(t){return Zb(t,i)})),s=Rg(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:zg(n,i.icons),attributes:f({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}}("invalid",x.some(Sk),"warning")),l=Rg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),d=r.getUrlPicker(e.filetype),m=Uo("browser.url.event"),g=Rg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()}})])}),h=Rg(yS({name:e.name,icon:x.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(t){return Fr(t,m)}),i,[],["tox-browse-url"]));return qb.sketch({dom:Qb([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:K([[g.asSpec()],d.map((function(){return h.asSpec()})).toArray()])}]),fieldBehaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable),h.getOpt(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable),h.getOpt(t).each(kp.enable)}}),ev(),Nm("url-input-events",[Kr(m,(function(t){wf.getCurrent(t).each((function(n){var r=ll.getValue(n),o=f({fieldname:e.name},r);d.each((function(r){r(o).get((function(r){ll.setValue(n,r),Vr(t,ty,{name:e.name})}))}))}))}))])])})}(e,n,n.urlinput)})),customeditor:kk((function(t){var e=Qe(x.none()),n=Rg({dom:{tag:t.tag}}),r=Qe(x.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:La([Nm("custom-editor-events",[ro((function(o){n.getOpt(o).each((function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?oC.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(x.none()),e.set(x.some(t))}))}))}))]),ll.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(x.some(n))}),(function(t){return t.setValue(n)}))}}}),tC()]),components:[n.asSpec()]}})),htmlpanel:kk((function(t){return"presentation"===t.presets?Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:La([Xb.config({}),Bm.config({})])})})),imagetools:kk((function(t,e){return GS(t,e.shared.providers)})),table:kk((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(r,(function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}}))}]}),(n=t.cells,{dom:{tag:"tbody"},components:V(n,(function(t){return{dom:{tag:"tr"},components:V(t,o)}}))})],behaviours:La([Xb.config({}),Bm.config({})])}}(t,e.shared.providers)})),panel:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:V(t.items,e.shared.interpreter)}}(t,e)}))},Tk={field:function(t,e){return e}},_k=function(t,e,n){var r=Rt(n,{shared:{interpreter:function(e){return Ek(t,e,r)}}});return Ek(t,e,r)},Ek=function(t,e,n){return Ot(Ok,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},Ak={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Nk=function(t,e,n){var r=hc(-12,12,Ak),o={maxHeightFunction:fc()};return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),bubble:r,layouts:{onRtl:function(){return[Tg]},onLtr:function(){return[Og]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[ya]},onLtr:function(){return[wa]}},overrides:o}}},Rk=function(t,e,n){return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),layouts:{onRtl:function(){return[_g]},onLtr:function(){return[_g]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ka]},onLtr:function(){return[ka]}}}}},Mk=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return x.some(Ac.range(rn(e.startContainer),e.startOffset,rn(e.endContainer),e.endOffset))}}}},zk=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},Dk=function(t,e,n){var r=Up(t),o=function(){return rn(t.getBody())},i=function(){return rn(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:Nk(i,e,u),banner:Rk(i,e,u),cursor:Mk(t,o),node:zk(o)}},Bk=function(t){return function(e,n){cb(t)(e,n)}},Pk=function(t){return function(){return Qv(t)}},Ik=function(t){return function(){return Zv(t)}},Lk=function(t){return function(){return eb(t)}},Hk=function(t){return{colorPicker:Bk(t),hasCustomColors:Pk(t),getColors:Ik(t),getColorCols:Lk(t)}},Fk=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},Vk=function(t){return{isDraggableModal:Fk(t)}},jk=[{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"}]}],Uk=function(t){return $(t,(function(t,e){if(Tt(e,"items")){var n=Uk(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(Tt(e,"inline")||function(t){return Tt(t,"block")}(e)||function(t){return Tt(t,"selector")}(e)){var r="custom-"+(k(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return f(f({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},Wk=function(t){return function(t){return x.from(t.getParam("style_formats")).filter(T)}(t).map((function(e){var n=function(t,e){var n=Uk(e),r=function(e){j(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?jk.concat(n):n})).getOr(jk)},qk=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Rt(t,r)},$k=function(t,e,n,r){var o=function(e){return V(e,(function(e){var i=vt(e);if(_t(e,"items")){var u=o(e.items);return Rt(function(t){return Rt(t,{type:"submenu"})}(e),{getStyleItems:function(){return u}})}return _t(e,"format")?function(t){return qk(t,n,r)}(e):1===i.length&&I(i,"title")?Rt(e,{type:"separator"}):function(e){var o=k(e.name)?e.name:Uo(e.title),i="custom-"+o,u={type:"formatter",format:i,isSelected:n(i),getStylePreview:r(i)},a=Rt(e,u);return t.formatter.register(o,a),a}(e)}))};return o(e)},Gk=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,r):[t.format]},o=Qe([]),i=Qe([]),u=Qe([]),a=Qe([]),c=Qe(!1);return t.on("PreInit",(function(u){var a=Wk(t),c=$k(t,a,e,n);o.set(c),i.set(Y(c,r))})),t.on("addStyleModifications",(function(o){var i=$k(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Y(i,r))})),{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},Xk=iC.trim,Kk=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Yk=Kk("true"),Jk=Kk("false"),Qk=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},Zk=function(t){return t.innerText||t.textContent},tO=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&nO(t)},eO=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},nO=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Yk(t)}return!1}(t)&&!Jk(t)},rO=function(t){return eO(t)&&nO(t)},oO=function(t){var e=function(t){return t.id?t.id:Uo("h")}(t);return Qk("header",Zk(t),"#"+e,function(t){return eO(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},iO=function(e){var n=e.id||e.name,r=Zk(e);return Qk("anchor",r||"#"+n,"#"+n,0,t)},uO=function(t){return Xk(t.title).length>0},aO=function(t){var e=function(t){return V(Fc(rn(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),(function(t){return t.dom}))}(t);return W(function(t){return V(W(t,rO),oO)}(e).concat(function(t){return V(W(t,tO),iO)}(e)),uO)},cO="tinymce-url-history",sO=function(t){return k(t)&&/^https?/.test(t)},lO=function(t){return O(t)&&St(t,(function(t){return!(T(e=t)&&e.length<=5&&J(e,sO));var e})).isNone()},fO=function(){var t,e=Gv.getItem(cO);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+cO+" was not valid JSON",t),{};throw t}return lO(t)?t:(console.log("Local storage "+cO+" was not valid format",t),{})},dO=function(t){var e=fO();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},mO=function(t,e){if(sO(t)){var n=fO(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=W(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!lO(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Gv.setItem(cO,JSON.stringify(t))}(n)}},gO=function(t){return!!t},hO=function(t){return wt(iC.makeMap(t,/[, ]/),gO)},pO=function(t){return x.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(N)},vO=function(t){return x.from(t).filter(k).getOrUndefined()},bO=function(t){return{getHistory:dO,addToHistory:mO,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?x.none():x.some({targets:aO(t.getBody()),anchorTop:vO(Kp(t)),anchorBottom:vO(Yp(t))})}(t)},getValidationHandler:function(){return function(t){return x.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return function(t,e){var n=function(t){var e=x.some(function(t){return t.getParam("file_picker_types")}(t)).filter(gO),n=x.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(gO),r=e.or(n).map(hO);return pO(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return vt(t).length>0&&t}))}))}(t);return _(n)?n?pO(t):x.none():n[e]?pO(t):x.none()}(t,e).map((function(n){return function(r){return Cy((function(o){var i=f({filetype:e,fieldname:r.fieldname},x.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!k(t))throw new Error("Expected value to be string");if(void 0!==e&&!O(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})}),r.value,i)}))}}))}(t,e)}}},yO=r((function(t,e){!function(t,e){var n=lu.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Bi(t,"max-width",n+"px")}(t,Math.floor(e))})),wO="contexttoolbar-hide",xO=r([_e("dom"),je("shell",!0),fl("toolbarBehaviours",[Am])]),CO=r([Fl({name:"groups",overrides:function(){return{behaviours:La([Am.config({})])}}})]),SO=gf({name:"Toolbar",configFields:xO(),partFields:CO(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.toolbarBehaviours,o.behaviours),apis:{setGroups:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"groups")).fold((function(){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")}),(function(t){Am.set(t,n)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),kO=function(t,e,n){return{within:t,extra:e,withinWidth:n}},OO=function(t,e,n){var o,i=(o=function(t,e){var r=n(t);return x.some({element:t,start:e,finish:e+r,width:r})},$(t,(function(t,e){return o(e,t.len).fold(r(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),u=W(i,(function(t){return t.finish<=e})),a=q(u,(function(t,e){return t+e.width}),0);return{within:u,extra:i.slice(u.length),withinWidth:a}},TO=function(t){return V(t,(function(t){return t.element}))},_O=function(t,e){var n=V(e,(function(t){return tu(t)}));SO.setGroups(t,n)},EO=function(t,e,n){var r=Zl(t,e,"primary"),o=Py.getCoupled(t,"overflowGroup");Bi(r.element,"visibility","hidden");var i=e.builtGroups.get().concat([o]),u=it(i,(function(t){return Xa(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),_O(r,i);var a=function(t,e,n,r){var o=function(t,e,n){var r=OO(e,t,n);return 0===r.extra.length?x.some(r):x.none()}(t,e,n).getOrThunk((function(){return OO(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=TO(t.concat(e));return kO(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=TO(t).concat([n]);return kO(o,TO(e),r)}(i,u,r,a):function(t,e,n){return kO(TO(t),[],n)}(i,0,a)}(fu(r.element),e.builtGroups.get(),(function(t){return fu(t.element)}),o);0===a.extra.length?(Am.remove(r,o),n([])):(_O(r,a.within),n(a.extra)),Ui(r.element,"visibility"),Wi(r.element),u.each(Bm.focus)},AO=r([fl("splitToolbarBehaviours",[Py]),Je("builtGroups",(function(){return Qe([])}))]),NO=r([Gu(["overflowToggledClass"]),Fe("getOverflowBounds"),_e("lazySink"),Je("overflowGroups",(function(){return Qe([])}))].concat(AO())),RO=r([Ll({factory:SO,schema:xO(),name:"primary"}),Hl({schema:xO(),name:"overflow"}),Hl({name:"overflow-button"}),Hl({name:"overflow-group"})]),MO=r([Gu(["toggledClass"]),_e("lazySink"),Me("fetch"),Fe("getBounds"),Ve("fireDismissalEventInstead",[je("event",Mr())]),xc()]),zO=r([Hl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:La([Gm.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Hl({factory:SO,schema:xO(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:La([km.config({mode:"cyclic",onEscape:function(e){return Ql(e,t,"button").each(Bm.focus),x.none()}})])}}})]),DO=function(t,e){var n=Py.getCoupled(t,"toolbarSandbox");Ws.isOpen(n)?Ws.close(n):Ws.open(n,e.toolbar())},BO=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Cs.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:yO()}},e,o)},PO=function(t,e,n,r,o){SO.setGroups(e,o),BO(t,e,n,r),Gm.on(t)},IO=gf({name:"FloatingToolbarButton",factory:function(t,e,n,r){return f(f({},Ng.sketch(f(f({},r.button()),{action:function(t){DO(t,r)},buttonBehaviours:hl({dump:r.button().buttonBehaviours},[Py.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Bu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:La([km.config({mode:"special",onEscape:function(t){return Ws.close(t),x.some(!0)}}),Ws.config({onOpen:function(o,i){n.fetch().get((function(o){PO(t,i,n,e.layouts,o),r.link(t.element),km.focusIn(i)}))},onClose:function(){Gm.off(t),Bm.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return Pu(n,r)||Pu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:c},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js({doReposition:function(){Ws.getState(Py.getCoupled(t,"toolbarSandbox")).each((function(r){BO(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(o){PO(e,o,t,n.layouts,r)}))},reposition:function(e){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(r){BO(e,r,t,n.layouts)}))},toggle:function(t){DO(t,r)},getToolbar:function(t){return Ws.getState(Py.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Ws.isOpen(Py.getCoupled(t,"toolbarSandbox"))}}})},configFields:MO(),partFields:zO(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),LO=r([_e("items"),Gu(["itemSelector"]),fl("tgroupBehaviours",[km])]),HO=r([Vl({name:"items",unit:"item"})]),FO=gf({name:"ToolbarGroup",configFields:LO(),partFields:HO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.tgroupBehaviours,[km.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),VO=function(t){return V(t,(function(t){return tu(t)}))},jO=function(t,e,n){EO(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){IO.setGroups(t,VO(r))}))}))},UO=gf({name:"SplitFloatingToolbar",configFields:NO(),partFields:RO(),factory:function(t,e,n,r){var o=Rg(IO.sketch({fetch:function(){return Cy((function(e){e(VO(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[wa,ya]},onRtl:function(){return[ya,wa]},onBottomLtr:function(){return[Ca,xa]},onBottomRtl:function(){return[xa,Ca]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(){return FO.sketch(f(f({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(V(n,e.getSystem().build)),jO(e,o,t)},refresh:function(e){return jO(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){IO.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(IO.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){IO.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(IO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),WO=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},qO=function(t){return t.dimension.property},$O=function(t,e){return t.dimension.getDimension(e)},GO=function(t,e){var n=WO(t,e);xi(n,[e.shrinkingClass,e.growingClass])},XO=function(t,e){bi(t.element,e.openClass),vi(t.element,e.closedClass),Bi(t.element,qO(e),"0px"),Wi(t.element)},KO=function(t,e){bi(t.element,e.closedClass),vi(t.element,e.openClass),Ui(t.element,qO(e))},YO=function(t,e,n,r){n.setCollapsed(),Bi(t.element,qO(e),$O(e,t.element)),Wi(t.element),GO(t,e),XO(t,e),e.onStartShrink(t),e.onShrunk(t)},JO=function(t,e,n,r){var o=r.getOrThunk((function(){return $O(e,t.element)}));n.setCollapsed(),Bi(t.element,qO(e),o),Wi(t.element);var i=WO(t,e);bi(i,e.growingClass),vi(i,e.shrinkingClass),XO(t,e),e.onStartShrink(t)},QO=function(t,e,n){var r=$O(e,t.element);("0px"===r?YO:JO)(t,e,n,x.some(r))},ZO=function(t,e,n){var r=WO(t,e),o=yi(r,e.shrinkingClass),i=$O(e,t.element);KO(t,e);var u=$O(e,t.element);(o?function(){Bi(t.element,qO(e),i),Wi(t.element)}:function(){XO(t,e)})(),bi(r,e.shrinkingClass),vi(r,e.growingClass),KO(t,e),Bi(t.element,qO(e),u),n.setExpanded(),e.onStartGrow(t)},tT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.growingClass)},eT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.shrinkingClass)},nT=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Ui(t.element,qO(e));var r=$O(e,t.element);Bi(t.element,qO(e),r)}},grow:function(t,e,n){n.isExpanded()||ZO(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&QO(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&YO(t,e,n,x.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:tT,isShrinking:eT,isTransitioning:function(t,e,n){return!0===tT(t,e)||!0===eT(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?QO:ZO)(t,e,n)},disableTransitions:GO}),rT=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return ci(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Vt(e.dimension.property,"0px")})},events:function(t,e){return $r([no(fr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(GO(n,t),e.isExpanded()&&Ui(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),oT=[_e("closedClass"),_e("openClass"),_e("shrinkingClass"),_e("growingClass"),Pe("getAnimationRoot"),Ku("onShrunk"),Ku("onStartShrink"),Ku("onGrown"),Ku("onStartGrow"),je("expanded",!1),Ee("dimension",ve("property",{width:[Zu("property","width"),Zu("getDimension",(function(t){return fu(t)+"px"}))],height:[Zu("property","height"),Zu("getDimension",(function(t){return ru(t)+"px"}))]}))],iT=Fa({fields:oT,name:"sliding",active:rT,apis:nT,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(t.expanded);return ui({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:i(e.set,!1),setExpanded:i(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),uT=r([Gu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ku("onOpened"),Ku("onClosed")].concat(AO())),aT=r([Ll({factory:SO,schema:xO(),name:"primary"}),Ll({factory:SO,schema:xO(),name:"overflow",overrides:function(t){return{toolbarBehaviours:La([iT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Ql(e,t,"overflow-button").each((function(t){Gm.off(t),Bm.focus(t)})),t.onClosed(e)},onGrown:function(e){km.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Ql(e,t,"overflow-button").each(Gm.on)}}),km.config({mode:"acyclic",onEscape:function(e){return Ql(e,t,"overflow-button").each(Bm.focus),x.some(!0)}})])}}}),Hl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:La([Gm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Hl({name:"overflow-group"})]),cT=function(t,e){Ql(t,e,"overflow-button").bind((function(){return Ql(t,e,"overflow")})).each((function(n){sT(t,e),iT.toggleGrow(n)}))},sT=function(t,e){Ql(t,e,"overflow").each((function(n){EO(t,e,(function(t){var e=V(t,(function(t){return tu(t)}));SO.setGroups(n,e)})),Ql(t,e,"overflow-button").each((function(t){iT.hasGrown(n)&&Gm.on(t)})),iT.refresh(n)}))},lT=gf({name:"SplitSlidingToolbar",configFields:uT(),partFields:aT(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(t){return FO.sketch(f(f({},r["overflow-group"]()),{items:[Ng.sketch(f(f({},r["overflow-button"]()),{action:function(e){Fr(t,o)}}))]}))}}}),Nm("toolbar-toggle-events",[Kr(o,(function(e){cT(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=V(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),sT(e,t)},refresh:function(e){return sT(e,t)},toggle:function(e){return cT(e,t)},isOpen:function(e){return function(t,e){return Ql(t,e,"overflow").map(iT.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),fT=r(Uo("toolbar-height-change")),dT=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:f({tag:"div",classes:["tox-toolbar__group"]},e),components:[FO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:La([Xb.config({}),Bm.config({})])}},mT=function(t){return FO.sketch(dT(t))},gT=function(t,e){var n=ro((function(e){var n=V(t.initGroups,mT);SO.setGroups(e,n)}));return La([ov(t.providers.isDisabled),ev(),km.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Nm("toolbar-events",[n])])},hT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":dT({title:x.none(),items:[]}),"overflow-button":pS({name:"more",icon:x.some("more-drawer"),disabled:!1,tooltip:x.some("More..."),primary:!1,borderless:!1},x.none(),t.providers)},splitToolbarBehaviours:gT(t,e)}},pT=function(t){var e=hT(t),n=UO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return UO.sketch(f(f({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Ou(e),r=po(e),o=Ou(r),i=Math.max(r.dom.scrollHeight,o.height);return Su(n.x+4,o.y,n.width-8,i)},parts:f(f({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},vT=function(t){var e=lT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=lT.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=hT(t);return lT.sketch(f(f({},r),{components:[e,n],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:function(t){t.getSystem().broadcastOn([fT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([fT()],{type:"closed"})}}))},bT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return SO.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===hh.scrolling?["tox-toolbar--scrolling"]:[])},components:[SO.parts.groups({})],toolbarBehaviours:gT(t,e)})},yT=Zt([Ne("type"),Ee("items",ee([ce([Ne("name"),Be("items",xe)]),xe]))].concat(eh)),wT=[He("text"),He("tooltip"),He("icon"),Me("fetch"),Xe("onSetup",(function(){return t}))],xT=Zt(m([Ne("type")],wT)),CT=function(t){return de("menubutton",xT,t)},ST=Zt([Ne("type"),He("tooltip"),He("icon"),He("text"),Fe("select"),Me("fetch"),Xe("onSetup",(function(){return t})),$e("presets","normal",["normal","color","listpreview"]),je("columns",1),Me("onAction"),Me("onItemAction")]),kT=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=V(o,n.getSystem().build);Ts(n,i)}))};return $r([Kr(br(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;I(o.channels,i)&&n(e,o.data)}})),ro((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),OT=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),TT=[_e("channel"),Pe("renderComponents"),Pe("updateState"),Pe("initialData")],_T=Fa({fields:TT,name:"reflecting",active:kT,apis:OT,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(t){return t}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(x.none())}}}})}),ET=r([_e("toggleClass"),_e("fetch"),Ju("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),Ju("onItemExecute"),Pe("lazySink"),_e("dom"),Ku("onOpen"),fl("splitDropdownBehaviours",[Py,km,Bm]),je("matchWidth",!1),je("useMinWidth",!1),je("eventOrder",{}),Pe("role")].concat(Gy())),AT=Ll({factory:Ng,schema:[_e("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(jr)},buttonBehaviours:La([Gm.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),NT=Ll({factory:Ng,schema:[_e("dom")],name:"button",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),RT=r([AT,NT,Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Ly()]),MT=gf({name:"SplitDropdown",configFields:ET(),partFields:RT(),factory:function(e,n,r,o){var i,u=function(t){wf.getCurrent(t).each((function(t){Nf.highlightFirst(t),km.focusIn(t)}))},a=function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)},c=function(t){var n=Zl(t,e,"button");return jr(n),x.some(!0)},s=f(f({},$r([ro((function(t,n){Ql(t,e,"aria-descriptor").each((function(e){var n=Uo("aria");zo(e.element,"id",n),zo(t.element,"aria-describedby",n)}))}))])),Km(x.some(a))),l={repositionMenus:function(t){Gm.isOn(t)&&$y(t)}};return{uid:e.uid,dom:e.dom,components:n,apis:l,eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),events:s,behaviours:ml(e.splitDropdownBehaviours,[Py.config({others:{sandbox:function(t){var n=Zl(t,e,"arrow");return qy(e,t,{onOpen:function(){Gm.on(n),Gm.on(t)},onClose:function(){Gm.off(n),Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t){return a(t),x.some(!0)}}),Bm.config({}),Gm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),zT=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},DT=function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},BT=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},PT=Uo("focus-button"),IT=["checklist","ordered-list"],LT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],HT=function(t,e,n,r,o,i){var u,a=function(t){return lp.isRtl()&&I(IT,t)?t+"-rtl":t},c=lp.isRtl()&&t.exists((function(t){return I(LT,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:BT(n,i)},components:lv([t.map((function(t){return tS(a(t),i.icons)})),e.map((function(t){return nS(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Zn()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:La([ov(i.isDisabled),ev(),Nm("common-button-display-events",[Kr(Zn(),(function(t,e){e.event.prevent(),Fr(t,PT)}))])].concat(r.map((function(n){return _T.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return lv([t.icon.map((function(t){return tS(a(t),i.icons)})),t.text.map((function(t){return nS(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},FT=function(e,n,r){var o,i=Qe(t),u=HT(e.icon,e.text,e.tooltip,x.none(),x.none(),r);return Ng.sketch({dom:u.dom,components:u.components,eventOrder:oS,buttonBehaviours:La([Nm("toolbar-button-events",[(o={onAction:e.onAction,getApi:n.getApi},uo((function(t,e){iv(o,t)((function(e){Vr(t,rS,{buttonApi:e}),o.onAction(e)}))}))),uv(n,i),av(n,i)]),ov((function(){return e.disabled||r.isDisabled()})),ev()].concat(n.toolbarButtonBehaviours))})},VT=function(t,e,n){return FT(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Nm("toolbarButtonWith",n)]:[]),getApi:zT,onSetup:t.onSetup},e)},jT=function(t,e,n){return Rt(FT(t,{toolbarButtonBehaviours:[Am.config({}),Gm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Nm("toolbarToggleButtonWith",n)]:[]),getApi:DT,onSetup:t.onSetup},e))},UT=function(t,e,n){return function(r){return Cy((function(t){return e.fetch(t)})).map((function(o){return x.from(Sb(Rt(sb(Uo("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,ph.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:fb(e.columns,e.presets),menuBehaviours:tp("auto"!==e.columns?[]:[ro((function(t,n){Zh(t,4,Th(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;km.setGridSize(t,n,r)}))}))])})))}))}},WT=function(t,e){return Kr(rS,(function(n,r){var o=function(t){return{hide:function(){return Fr(t,Sr())},getValue:function(){return ll.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},qT=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Rg(my.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:La([km.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return jr(t),!0}))},onLeft:function(t,e){return e.cut(),x.none()},onRight:function(t,e){return e.cut(),x.none()}})])})),o=function(t,e,n){var r=V(e,(function(e){return Rg(function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(uh(f(f({},o),{type:"togglebutton",onAction:function(){}})));return jT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(rh(f(f({},o),{type:"button",onAction:function(){}})));return VT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r)}(t,e,n))}));return{asSpecs:function(){return V(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return it(e,(function(e,n){return e.primary?x.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(u(kp.isDisabled)):x.none()}))}}}(r,t.commands,e);return[{title:x.none(),items:[r.asSpec()]},{title:x.none(),items:o.asSpecs()}]},$T=function(t,e){var n=yu(window),r=ku(rn(t.getContentAreaContainer())),o=Mp(t)||zp(t)||Bp(t),i=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(r,n),u=i.x,a=i.width;if(t.inline&&!o)return Su(u,n.y,a,n.height);var c=function(t,e,n,r){var o=rn(t.getContainer()),i=zu(o,".tox-editor-header").getOr(o),u=ku(i),a=u.y>=e.bottom,c=r&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,n.y),bottom:n.bottom};if(t.inline&&!c)return{y:n.y,bottom:Math.min(u.y,n.bottom)};var s=ku(o);return c?{y:Math.max(u.bottom,n.y),bottom:Math.min(s.bottom,n.bottom)}:{y:Math.max(s.y,n.y),bottom:Math.min(u.y,n.bottom)}}(t,r,n,e.header.isPositionedAtTop()),s=c.y,l=c.bottom;return Su(u,s,a,l-s)},GT=function(t,e){var n=W(e,(function(e){return e.predicate(t.dom)})),r=U(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},XT=function(t,e){var n={},r=[],o=[],i={},u={},a=vt(t);return j(a,(function(a){var c=t[a];"contextform"===c.type?function(t,a){var c=me(de("ContextForm",mh,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=f(f({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c}(a,c):"contexttoolbar"===c.type&&function(t,e){var n;(n=e,de("ContextToolbar",gh,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))}(a,c)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},KT=Uo("forward-slide"),YT=Uo("backward-slide"),JT=Uo("change-slide-event"),QT="tox-pop--resizing",ZT=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return x.some({type:"separator",text:a});if("submenu"===t.type){var c=Y(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?x.none():x.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Y(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return x.some(f({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Y(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(fS(u,ph.CLOSE_ON_EXECUTE,t,!1))}}}},t_=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return V(r.data,(function(t){return qk(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:ZT(0,e,n),getStyleItems:o}},e_=function(e,n,r){var o=t_(0,n,r),i=o.items,u=o.getStyleItems;return aS({text:r.icon.isSome()?x.none():x.some(""),icon:r.icon,tooltip:x.from(r.tooltip),role:x.none(),fetch:i.getFetch(n,u),onSetup:function(n){return r.setInitialValue.each((function(t){return t(n.getComponent())})),r.nodeChangeHandler.map((function(t){var r=t(n.getComponent());return e.on("NodeChange",r),function(){e.off("NodeChange",r)}})).getOr(t)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(jS||(jS={}));var n_,r_,o_,i_,u_=function(t,e,n,r){return{type:"basic",data:(o=function(t,e){return e===jS.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r),V(o,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}})))};var o},a_=[{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"}],c_=function(t){var e=function(e){var n=G(a_,(function(e){return t.formatter.match(e.format)})).fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));Vr(e,uS,{icon:"align-"+n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o={type:"basic",data:a_};return{tooltip:"Align",icon:x.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(t){return function(){return x.none()}},onAction:function(e){return function(){return G(a_,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},s_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],l_=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},f_=function(t){var e=function(){var e=function(t){return t?l_(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:G(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return function(t){var e;return 0===t.indexOf("-apple-system")&&(e=l_(t.toLowerCase()),J(s_,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(o)?x.from({title:"System Font",format:o}):x.none()})),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)})),i=u_(t,"font_formats","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",jS.SemiColon);return{tooltip:"Fonts",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return x.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},d_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},m_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},g_=function(t){var e=function(){var e=x.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":Ot(m_,t).getOr(t)}(r,t),i=function(t){return Ot(d_,t).getOr("")}(o);e=G(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=r(x.none),o=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},i=x.some((function(t){return function(){return o(t)}})),u=x.some((function(t){return o(t)})),a=u_(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",jS.Space);return{tooltip:"Font sizes",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},setInitialValue:u,nodeChangeHandler:i,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},h_=function(t,e){var n=e(),r=V(n,(function(t){return t.format}));return x.from(t.formatter.closest(r)).bind((function(t){return G(n,(function(e){return e.format===t}))})).orThunk((function(){return pf(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},p_=function(t){var e=Qe(x.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(x.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(x.some(t))}}},v_=function(){return p_((function(t){return t.destroy()}))},b_=function(){return p_((function(t){return t.unbind()}))},y_=function(t,e){return function(n){var r=b_(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.on("init",o),r.clear}},w_=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},x_=function(t){var e=function(e){var n=h_(t,(function(){return o.data})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o=u_(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",jS.SemiColon);return{tooltip:"Blocks",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:w_(t),setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},C_=function(t,e){var n=function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,n):[{title:t.title,format:t.format}]},r=Y(Wk(t),n),o=h_(t,(function(){return r})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:o})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)}));return{tooltip:"Formats",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},onAction:w_(t),setInitialValue:o,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},S_=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{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"]}],k_=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return he(t)})).getOrDie();return e(i,r,o)}},O_={button:k_(rh,(function(t,e){return n=t,r=e.backstage.shared.providers,VT(n,r,[]);var n,r})),togglebutton:k_(uh,(function(t,e){return n=t,r=e.backstage.shared.providers,jT(n,r,[]);var n,r})),menubutton:k_(CT,(function(t,e){return mS(t,"tox-tbtn",e.backstage,x.none())})),splitbutton:k_((function(t){return de("SplitButton",ST,t)}),(function(e,n){return function(e,n){var r,o=Uo("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setIconFill:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"fill",n)}))},setIconStroke:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"stroke",n)}))},setActive:function(e){zo(t.element,"aria-pressed",e),zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Gm.set(t,e)}))}))},isActive:function(){return zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(Gm.isOn)}))}}},u=Qe(t),a={getApi:i,onSetup:e.onSetup};return MT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:f({"aria-pressed":!1},BT(e.tooltip,n.providers))},onExecute:function(t){e.onAction(i(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:La([rv(n.providers.isDisabled),ev(),Nm("split-dropdown-events",[Kr(PT,Bm.focus),uv(a,u),av(a,u)]),Jy.config({})]),eventOrder:(r={},r[Nr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:UT(i,e,n.providers),parts:{menu:Mh(0,e.columns,e.presets)},components:[MT.parts.button(HT(e.icon,e.text,x.none(),x.some(o),x.some([Gm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),MT.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:zg("chevron-down",n.providers.icons)},buttonBehaviours:La([rv(n.providers.isDisabled),ev()])}),MT.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(e,n.backstage.shared)})),grouptoolbarbutton:k_((function(t){return de("GroupToolbarButton",yT,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[yc]=e.backstage.shared.header.isPositionedAtTop()?Iu.TopToBottom:Iu.BottomToTop,r);switch(Ip(n)){case hh.floating:return function(t,e,n,r){var o=e.shared;return IO.sketch({lazySink:o.getSink,fetch:function(){return Cy((function(e){e(V(n(t.items),mT))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:HT(t.icon,t.text,t.tooltip,x.none(),x.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return __(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,x.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=f({type:"advanced"},e.styleselect);return e_(t,e,C_(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return e_(t,e,g_(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return e_(t,e,f_(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return e_(t,e,x_(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return e_(t,e,c_(t))}(t,e.backstage)}},T_={styleselect:O_.styleSelectButton,fontsizeselect:O_.fontsizeSelectButton,fontselect:O_.fontSelectButton,formatselect:O_.formatButton,align:O_.alignMenuButton},__=function(t,e,n,r){var o=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=V(S_,(function(e){var n=W(e.items,(function(e){return Tt(t,e)||Tt(T_,e)}));return{name:e.name,items:n}}));return W(e,(function(t){return t.items.length>0}))}(r):k(n)?(e=n.split("|"),V(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return M(t,(function(t){return Tt(t,"name")&&Tt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}(e),i=V(o,(function(o){var i=Y(o.items,(function(o){return 0===o.trim().length?[]:function(t,e,n,r,o,i){return Ot(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return it(t,(function(t){return Ot(e,t+n.toLowerCase())}))}))})).fold((function(){return Ot(T_,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return x.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return Ot(O_,t.type).fold((function(){return console.error("skipping button defined by",t),x.none()}),(function(r){return x.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),x.none())}))}(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:x.from(t.translate(o.name)),items:i}}));return W(i,(function(t){return t.items.length>0}))},E_={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"]},A_={maxHeightFunction:fc(),maxWidthFunction:yO()},N_={onLtr:function(){return[Sa,ka,xa,ya,Ca,wa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[Sa,ka,Ca,wa,xa,ya,_g,Eg,Tg,kg,Og,Sg]}},R_={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},M_=function(t,e,n,r){var o,i,u=Ln().deviceType.isTouch,a=Zi((o={sink:n,onEscape:function(){return t.focus(),x.some(!0)}},i=Qe([]),vg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),vg.getContent(t).each((function(t){Ui(t.element,"visibility")})),bi(t.element,QT),Ui(t.element,"width")},inlineBehaviours:La([Nm("context-toolbar-events",[no(fr(),(function(t,e){bi(t.element,QT),Ui(t.element,"width")})),Kr(JT,(function(t,e){Ui(t.element,"width");var n=fu(t.element);vg.setContent(t,e.event.contents),vi(t.element,QT);var r=fu(t.element);Bi(t.element,"width",n+"px"),vg.getContent(t).each((function(n){e.event.focus.bind((function(e){return $a(e),Xa(t.element)})).orThunk((function(){return km.focusIn(n),Ga()}))})),Ag.setTimeout((function(){Bi(t.element,"width",r+"px")}),0)})),Kr(KT,(function(t,e){vg.getContent(t).each((function(t){i.set(i.get().concat([{bar:t,focus:Ga()}]))})),Vr(t,JT,{contents:e.event.forwardContents,focus:x.none()})})),Kr(YT,(function(t,e){rt(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Vr(t,JT,{contents:tu(e.bar),focus:e.focus})}))}))]),km.config({mode:"special",onEscape:function(t){return rt(i.get()).fold((function(){return o.onEscape()}),(function(e){return Fr(t,YT),x.some(!0)}))}})]),lazySink:function(){return ct.value(o.sink)}}))),c=function(){return $T(t,r.backstage.shared)},s=function(){if(u()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,a,s,l=(e=g.get().filter((function(t){return Ni(rn(t))})).map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?pu().top:Ou(rn(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),f=c();return o=l.y,i=l.bottom,a=f.y,s=f.bottom,!(Math.max(o,a)<=Math.min(i,s))},l=function(){vg.hide(a)},d=function(){m.get().each((function(t){var e=a.element;Ui(e,"display"),s()?Bi(e,"display","none"):Cs.positionWithinBounds(n,t,a,x.some(c()))}))},m=Qe(x.none()),g=Qe(x.none()),h=Qe(null),p=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:La([km.config({mode:"acyclic"}),Nm("pop-dialog-wrap-events",[ro((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return km.focusIn(e)}))})),oo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},v=zt((function(){return XT(e,(function(t){var e=b([t]);Vr(a,KT,{forwardContents:p(e)})}))})),b=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=f(f({},n),o.formNavigators),u=Ip(t)===hh.scrolling?hh.scrolling:hh.default,a=K(V(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return __(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,x.some(["form:"]))}(i,e):function(t,e){return qT(t,e)}(e,r.backstage.shared.providers)})));return bT({type:u,uid:Uo("context-toolbar"),initGroups:a,onEscape:x.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",(function(e){var n=v();Ot(n.lookupTable,e.toolbarKey).each((function(n){y([n],e.target===t?x.none():x.some(e)),vg.getContent(a).each(km.focusIn)}))}));var y=function(t,e){if(C(),!u()||!r.backstage.isContextMenuOpen()){var n=b(t),o=e.map(rn),i=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Rt(n,function(t,e){return"line"===t?{bubble:hc(12,0,E_),layouts:{onLtr:function(){return[Oa]},onRtl:function(){return[Ta]}},overrides:A_}:{bubble:hc(0,12,E_),layouts:e?R_:N_,overrides:A_}}(t,u()))}(t[0].position,o);m.set(x.some(i)),g.set(e);var l=a.element;Ui(l,"display"),vg.showWithinBounds(a,i,p(n),(function(){return x.some(c())})),s()&&Bi(l,"display","none")}},w=function(){t.hasFocus()&&function(t,e){var n=rn(e.getBody()),r=function(t){return Vn(t,n)},o=rn(e.selection.getNode());return function(t){return!r(t)&&!jn(n,t)}(o)?x.none():function(t,e,n){var r=GT(t,e);if(r.contextForms.length>0)return x.some({elem:t,toolbars:[r.contextForms[0]]});var o=GT(t,n);if(o.contextForms.length>0)return x.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return L(t,(function(t){return t.position===e}))},n=function(e){return W(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=V(n("selection"),(function(t){return f(f({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return x.some({elem:t,toolbars:i})}return x.none()}(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return function(t,e,n){return t(e)?x.none():Wn(e,(function(t){var e=GT(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return G(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return W(t,(function(t){return t.position===e}))}))}(r);return i.length>0?x.some({elem:t,toolbars:i}):x.none()}),t)}(r,o,t)}))}(v(),t).fold((function(){m.set(x.none()),vg.hide(a)}),(function(t){y(t.toolbars,x.some(t.elem.dom))}))},C=function(){var t=h.get();null!==t&&(Ag.clearTimeout(t),h.set(null))},S=function(t){C(),h.set(t)};t.on("init",(function(){t.on(wO,l),t.on("ScrollContent ScrollWindow longpress",d),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){S(Ag.setEditorTimeout(t,w,0))})),t.on("focusout",(function(e){Ag.setEditorTimeout(t,(function(){Xa(n.element).isNone()&&Xa(a.element).isNone()&&(m.set(x.none()),vg.hide(a))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(m.set(x.none()),vg.hide(a))})),t.on("NodeChange",(function(e){Xa(a.element).fold((function(){S(Ag.setEditorTimeout(t,w,0))}),(function(t){}))}))}))},z_=af,D_=Ul,B_=r([je("shell",!1),_e("makeItem"),je("setupItem",t),gl("listBehaviours",[Am])]),P_=Fl({name:"items",overrides:function(){return{behaviours:La([Am.config({})])}}}),I_=r([P_]),L_=gf({name:r("CustomList")(),configFields:B_(),partFields:I_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"items")).fold((function(){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")}),(function(r){var o=Am.contents(r),i=n.length,u=i-o.length,a=u>0?H(u,(function(){return t.makeItem()})):[],c=o.slice(i);j(c,(function(t){return Am.remove(r,t)})),j(a,(function(t){return Am.append(r,t)}));var s=Am.contents(r);j(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),H_=t,F_=c,V_=r([]),j_=Object.freeze({__proto__:null,setup:H_,isDocked:F_,getBehaviours:V_}),U_=function(t){return(Fi(t,"position").is("fixed")?x.none():yo(t)).orThunk((function(){var e=en("span");return bo(t).bind((function(t){Oo(t,e);var n=yo(e);return Eo(e),n}))}))},W_=function(t){return U_(t).map(cu).getOrThunk((function(){return uu(0,0)}))},q_=Et([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),$_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeOutClass),vi(n,e.fadeInClass),e.onShow(t)},G_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeInClass),vi(n,e.fadeOutClass),e.onHide(t)},X_=function(t,e,n){return J(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},K_=function(t,e){return e.getInitialPosition().map((function(e){return Su(e.bounds.x,e.bounds.y,fu(t),ru(t))}))},Y_=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(x.none()),r.position){case"static":return x.some(q_.static());case"absolute":var o=U_(t).map(ku).getOrThunk((function(){return ku(Ri())}));return x.some(q_.absolute(Ya("absolute",Ot(r.style,"left").map((function(t){return e.x-o.x})),Ot(r.style,"top").map((function(t){return e.y-o.y})),Ot(r.style,"right").map((function(t){return o.right-e.right})),Ot(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return x.none()}}))},J_=function(t,e,n){var r=t.element;return Fi(r,"position").is("fixed")?function(t,e,n){return K_(t,n).filter((function(t){return X_(n.getModes(),t,e)})).bind((function(e){return Y_(t,e,n)}))}(r,e,n):function(t,e,n){var r=ku(t);if(X_(n.getModes(),r,e))return x.none();!function(t,e,n){n.setInitialPosition(x.some({style:Vi(t),position:Li(t,"position")||"static",bounds:e}))}(t,r,n);var o=Tu(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return x.some(q_.fixed(Ya("fixed",x.some(i),c?x.some(u):x.none(),x.none(),c?x.none():x.some(a))))}(r,e,n)},Q_=function(t,e){j(["left","right","top","bottom","position"],(function(e){return Ui(t.element,e)})),e.onUndocked(t)},Z_=function(t,e,n){Ja(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},tE=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(wi(t.element,[e.fadeOutClass]),e.onHide(t)):(u?$_:G_)(t,e))}))}))},eE=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&tE(t,e,n,r),J_(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return Q_(t,e)}),(function(n){return Z_(t,e,n)}),(function(o){tE(t,e,n,r,!0),Z_(t,e,o)}))}))}(t,e,n)},nE=function(e,n,r){r.isDocked()&&function(e,n,r){var o=e.element;r.setDocked(!1),function(t,e){var n=t.element;return K_(n,e).bind((function(t){return Y_(n,t,e)}))}(e,r).each((function(r){r.fold((function(){return Q_(e,n)}),(function(t){return Z_(e,n,t)}),t)})),r.setVisible(!0),n.contextual.each((function(t){xi(o,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),eE(e,n,r)}(e,n,r)},rE=Object.freeze({__proto__:null,refresh:eE,reset:nE,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),oE=Object.freeze({__proto__:null,events:function(t,e){return $r([no(fr(),(function(n,r){t.contextual.each((function(t){yi(n.element,t.transitionClass)&&(xi(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n)),r.stop()}))})),Kr(Er(),(function(n,r){eE(n,t,e)})),Kr(Ar(),(function(n,r){nE(n,t,e)}))])}}),iE=[Ve("contextual",[Ne("fadeInClass"),Ne("fadeOutClass"),Ne("transitionClass"),Me("lazyContext"),Ku("onShow"),Ku("onShown"),Ku("onHide"),Ku("onHidden")]),Xe("lazyViewport",Tu),Ke("modes",["top","bottom"],xe),Ku("onDocked"),Ku("onUndocked")],uE=Fa({fields:iE,name:"docking",active:oE,apis:rE,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(!1),n=Qe(!0),r=Qe(x.none()),o=Qe(t.modes);return ui({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),aE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},cE="tox-tinymce--toolbar-sticky-on",sE="tox-tinymce--toolbar-sticky-off",lE=function(t){var e=t.element;bo(e).each((function(n){var r="padding-"+uE.getModes(t)[0];if(uE.isDocked(t)){var o=fu(n);Bi(e,"width",o+"px"),Bi(n,r,function(t){return ou(t)+(parseInt(Li(t,"margin-top"),10)||0)+(parseInt(Li(t,"margin-bottom"),10)||0)}(e)+"px")}else Ui(e,"width"),Ui(n,r)}))},fE=function(t,e){e?(bi(t,aE.fadeOutClass),wi(t,[aE.transitionClass,aE.fadeInClass])):(bi(t,aE.fadeInClass),wi(t,[aE.fadeOutClass,aE.transitionClass]))},dE=function(t,e){var n=rn(t.getContainer());e?(vi(n,cE),bi(n,sE)):(vi(n,sE),bi(n,cE))},mE=function(t,e){var n=Qe(x.none()),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||lE(e),dE(t,uE.isDocked(e)),e.getSystem().broadcastOn([$s()],{}),r().each((function(t){return t.getSystem().broadcastOn([$s()],{})}))},u=t.inline?[]:function(){var t;return[Wa.config({channels:(t={},t[fT()]={onReceive:lE},t)})]}();return m([Bm.config({}),uE.config({contextual:f({lazyContext:function(e){var n,r=ou(e.element),o=t.inline?t.getContentAreaContainer():t.getContainer(),i=ku(rn(o)),u=i.height-r,a=i.y+(n=e,"top",I(uE.getModes(n),"top")?0:r);return x.some(Su(i.x,a,i.width,u))},onShow:function(){o((function(t){return fE(t,!0)}))},onShown:function(t){o((function(t){return xi(t,[aE.transitionClass,aE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=go(o=e),Ga(i).filter((function(t){return!Vn(o,t)})).filter((function(t){return Vn(t,rn(i.dom.body))||jn(r,t)})).each((function(){return $a(o)})),n.set(x.none())}))},onHide:function(t){n.set(function(t,e){return Xa(t).orThunk((function(){return e().toOptional().bind((function(t){return Xa(t.element)}))}))}(t.element,r)),o((function(t){return fE(t,!1)}))},onHidden:function(){o((function(t){return xi(t,[aE.transitionClass])}))}},aE),modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},gE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(uE.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(lE)})),t.on("SkinLoaded",(function(){n().each((function(t){uE.isDocked(t)?uE.reset(t):uE.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(uE.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){uE.refresh(e);var n=e.element;bd(n)&&function(t,e){var n=go(e),r=n.dom.defaultView.innerHeight,o=pu(n),i=rn(t.elm),u=Ou(i),a=ru(i),c=u.y,s=c+a,l=cu(e),f=ru(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)vu(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;vu(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){dE(t,!1)}))},isDocked:function(t){return t().map(uE.isDocked).getOr(!1)},getBehaviours:mE}),hE=mf({factory:function(t,e){var n={focus:km.focusIn,setMenus:function(t,n){var r=V(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=CT(n).mapError((function(t){return he(t)})).getOrDie();return mS(r,"tox-mbtn",e.backstage,x.some("menuitem"))}));Am.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:La([Am.config({}),Nm("menubar-events",[ro((function(e){t.onSetup(e)})),Kr(rr(),(function(t,e){zu(t.element,".tox-mbtn--active").each((function(n){Du(e.event.target,".tox-mbtn").each((function(e){Vn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Yy.expand(t),Yy.close(n),Bm.focus(t)}))}))}))}))})),Kr(Dr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Yy.isOpen(n)&&(Yy.expand(t),Yy.close(n))}))}))}))]),km.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),x.some(!0)}}),Xb.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[_e("dom"),_e("uid"),_e("onEscape"),_e("backstage"),je("onSetup",t)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),pE="container",vE=[fl("slotBehaviours",[])],bE=function(t){return"<alloy.field."+t+">"},yE=function(t,e){var n,r=function(e){return nf(t)},o=function(e,n){return function(r,o){return Ql(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Do(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Bi(n,"display","none"),zo(n,"aria-hidden","true"),Vr(t,Br(),{name:e,visible:!1})}})),c=(n=a,function(t,e){j(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;Ui(n,"display"),Io(n,"aria-hidden"),Vr(t,Br(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return Ql(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.slotBehaviours),apis:l}},wE=wt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return oi(t)})),xE=f(f({},wE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Gl(pE,bE(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:bE(t)})}));return sf(pE,vE,o,yE,n)}}),CE=Zt([He("icon"),He("tooltip"),Xe("onShow",t),Xe("onHide",t),Xe("onSetup",(function(){return t}))]),SE=function(t){return{element:function(){return t.element.dom}}},kE=function(e,n){var r=V(vt(n),(function(t){var e=n[t],r=me(function(t){return de("sidebar",CE,t)}(e));return{name:t,getApi:SE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return V(r,(function(n){var o=Qe(t);return e.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:tp([uv(n,o),av(n,o),Kr(Br(),(function(t,e){var n=e.event;G(r,(function(t){return t.name===n.name})).each((function(e){(n.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},OE=function(t){return xE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:kE(e,t),slotBehaviours:tp([ro((function(t){return xE.hideAllSlots(t)}))])}}))},TE=function(t){return wf.getCurrent(t).bind((function(t){return iT.isGrowing(t)||iT.hasGrown(t)?wf.getCurrent(t).bind((function(t){return G(xE.getSlotNames(t),(function(e){return xE.isShowing(t,e)}))})):x.none()}))},_E=Uo("FixSizeEvent"),EE=Uo("AutoSizeEvent"),AE=function(t){var e=tn(t),n=wo(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return $(e,(function(t,e){var n;return"class"===e.name?t:f(f({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:No(e)};return f({tag:ao(e),classes:o,attributes:r},i)},NE=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})])}},RE=D_.optional({factory:hE,name:"menubar",schema:[_e("backstage")]}),ME=D_.optional({factory:{sketch:function(t){return L_.sketch({uid:t.uid,dom:t.dom,listBehaviours:La([km.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return bT({type:t.type,uid:Uo("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),x.some(!0)}})},setupItem:function(t,e,n,r){SO.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[_e("dom"),_e("onEscape")]}),zE=D_.optional({factory:{sketch:function(t){return function(t){return t.type===hh.sliding?vT:t.type===hh.floating?pT:bT}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),x.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[_e("dom"),_e("onEscape"),_e("getSink")]}),DE=D_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?mE:V_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:La(n(e,t.sharedBackstage))}}},name:"header",schema:[_e("dom")]}),BE=D_.optional({name:"socket",schema:[_e("dom")]}),PE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:La([Xb.config({}),Bm.config({}),iT.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:function(t){wf.getCurrent(t).each(xE.hideAllSlots),Fr(t,EE)},onGrown:function(t){Fr(t,EE)},onStartGrow:function(t){Vr(t,_E,{width:Fi(t.element,"width").getOr("")})},onStartShrink:function(t){Vr(t,_E,{width:fu(t.element)+"px"})}}),Am.config({}),wf.config({find:function(t){var e=Am.contents(t);return nt(e)}})])}],behaviours:La([eC(0),Nm("sidebar-sliding-events",[Kr(_E,(function(t,e){Bi(t.element,"width",e.event.width)})),Kr(EE,(function(t,e){Ui(t.element,"width")}))])])}}},name:"sidebar",schema:[_e("dom")]}),IE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:La([Am.config({})]),components:[]}}},name:"throbber",schema:[_e("dom")]}),LE=gf({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return z_.getPart(e,t,"socket")},setSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){return Am.set(t,[OE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){wf.getCurrent(t).each((function(n){iT.hasGrown(t)?xE.isShowing(n,e)?iT.shrink(t):(xE.hideAllSlots(n),xE.showSlot(n,e)):(xE.hideAllSlots(n),xE.showSlot(n,e),iT.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return z_.getPart(e,t,"sidebar").bind(TE).getOrNull()},getHeader:function(e){return z_.getPart(e,t,"header")},getToolbar:function(e){return z_.getPart(e,t,"toolbar")},setToolbar:function(e,n){z_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){z_.getPart(e,t,"multiple-toolbar").each((function(t){L_.setItems(t,n)}))},refreshToolbar:function(e){z_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){z_.getPart(e,t,"toolbar").each((function(t){var e,n;n=function(e){return e(t)},null!=(e=t.getApis().toggle)?x.some(n(e)):x.none()}))},isToolbarDrawerToggled:function(e){return z_.getPart(e,t,"toolbar").bind((function(t){return x.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return z_.getPart(e,t,"throbber")},focusToolbar:function(e){z_.getPart(e,t,"toolbar").orThunk((function(){return z_.getPart(e,t,"multiple-toolbar")})).each((function(t){km.focusIn(t)}))},setMenubar:function(e,n){z_.getPart(e,t,"menubar").each((function(t){hE.setMenus(t,n)}))},focusMenubar:function(e){z_.getPart(e,t,"menubar").each((function(t){hE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[_e("dom"),_e("behaviours")],partFields:[DE,RE,zE,ME,BE,PE,IE],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=V(n,(function(t){return mT(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=V(n,(function(t){return V(t,mT)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),HE={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 toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},FE=function(t){return"string"==typeof t?t.split(" "):t},VE=function(t,e){var n=f(f({},HE),e.menus),r=vt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?FE("file edit view insert format tools table help"):FE(!1===e.menubar?"":e.menubar),i=W(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||HE.hasOwnProperty(t)})),u=V(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Y(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||L(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:FE(o.items)},e,t)}));return W(u,(function(t){return t.getItems().length>0&&L(t.getItems(),(function(t){return"separator"!==t.type}))}))},jE=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},UE=function(t,e,n){return new Gg((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},WE=function(t,e){return UE(t,e+"/skin.min.css",t.ui.styleSheetLoader)},qE=function(t,e){var n;return n=rn(t.getElement()),Ei(n).isSome()?UE(t,e+"/skin.shadowdom.min.css",sp.DOM.styleSheetLoader):Gg.resolve()},$E=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Op.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&k(n)?Gg.all([WE(e,n),qE(e,n)]).then(jE(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:"Skin could not be loaded"})}}(e)):jE(e)()},GE=i($E,!1),XE=i($E,!0),KE=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,u=n.buttons;if(M(i,k)){var a=i.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return __(t,o,{backstage:r},x.none())}));LE.setToolbars(o,a)}else LE.setToolbar(o,__(t,n,{backstage:r},x.none()))},YE=Ln(),JE=YE.os.isiOS()&&YE.os.version.major<=12,QE=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=Qe(0),u=e.outerContainer;GE(t);var a=rn(o.targetNode),c=_i(Ti(a));!function(t,e){zs(t,e,So)}(a,e.mothership),Ms(c,e.uiMothership),t.on("PostRender",(function(){KE(t,e,n,r),i.set(t.getWin().innerWidth),LE.setMenubar(u,VE(t,n)),LE.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=Qe(uu(r.innerWidth,r.innerHeight)),u=Qe(uu(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(uu(r.innerWidth,r.innerHeight)),$v(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(uu(e.offsetWidth,e.offsetHeight)),$v(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=_b(rn(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Bi(f,"display","none")})),t.on("show",(function(){Ui(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var s,l,f=LE.getSocket(u).getOrDie("Could not find expected socket element");if(JE){Pi(f.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var d=(s=function(){t.fire("ScrollContent")},20,l=null,{cancel:function(){null!==l&&(clearTimeout(l),l=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===l&&(l=setTimeout((function(){s.apply(null,t),l=null}),20))}}),m=Tb(f.element,"scroll",d.throttle);t.on("remove",m.unbind)}tv(t,e),t.addCommand("ToggleSidebar",(function(e,n){LE.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return LE.whichSidebar(u)}));var g=Ip(t);g!==hh.sliding&&g!==hh.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(LE.refreshToolbar(e.outerContainer),i.set(n))}));var h={enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(u)}};return{iframeContainer:f.element.dom,editorContainer:u.element.dom,api:h}}}),ZE=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?x.some(parseInt(""+t,10)):x.none()},tA=function(t){return R(t)?t+"px":t},eA=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},nA=function(t){var e=_p(t),n=Ep(t),r=Np(t);return ZE(e).map((function(t){return eA(t,n,r)}))},rA=function(t,e){var n=ku(t);return{pos:e?n.y:n.bottom,bounds:n}},oA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=Qe(null),s=rn(o.targetNode),l=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=sp.DOM,c=Up(t),s=$p(t),l=Np(t).or(nA(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Ip(t),g=m===hh.sliding||m===hh.floating,h=Qe(!1),p=function(){return h.get()&&!t.removed},v=function(t){return g?t.fold((function(){return 0}),(function(t){return t.components().length>1?ru(t.components()[1].element):0})):0},b=function(){i.broadcastOn([$s()],{})},y=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=ZE(Li(Ri(),"margin-left")).getOr(0);return fu(Ri())-cu(e).left+t})),Bi(o.get().element,"max-width",n+"px")),g&&LE.refreshToolbar(u),c||function(){var t=LE.getToolbar(u),n=v(t),r=ku(e),i=d()?Math.max(r.y-ru(o.get().element)+n,0):r.bottom;Pi(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?uE.reset(r):uE.refresh(r)}b()}},w=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Fp(t)){case Pp.auto:var r=LE.getToolbar(u),o=v(r),i=ru(n.element)-o,a=ku(e);if(a.y>i)return"top";var c=po(e),s=Math.max(c.dom.scrollHeight,ru(c));return a.bottom<s-i||Tu().bottom<a.bottom-i?"bottom":"top";case Pp.bottom:return"bottom";case Pp.top:default:return"top"}}(o.get());i!==r&&(function(t){var e=o.get();uE.setModes(e,[t]),f.setDockingMode(t);var n=d()?Iu.TopToBottom:Iu.BottomToTop;zo(e.element,yc,n)}(i),n&&y(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Bi(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Ui(i.element,"display"),w(!1),y()},hide:function(){h.set(!1),n.outerContainer&&(Bi(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Bi(i.element,"display","none")},update:y,updateMode:w,repositionPopups:b}}(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);XE(t);var d=function(){if(c.get())l.show();else{c.set(LE.getHeader(a).getOrDie());var o=Wp(t);Ms(o,i),Ms(o,u),KE(t,e,n,r),LE.setMenubar(a,VE(t,n)),l.show(),function(t,e,n,r){var o=Qe(rA(e,n.isPositionedAtTop())),i=function(r){var i=rA(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&$v(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Ag.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=b_();u.set(_b(rn(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&d()})),tv(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),iA=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},uA=function(t){(function(t){!function(t){iC.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"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:y_(t,e.name),onAction:iA(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:y_(t,n),onAction:iA(t,n)})}}(t),function(t){iC.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"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))}(t),function(t){iC.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:y_(t,e.name)})}))}(t)})(t),function(t){iC.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",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{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"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:iA(t,"code")})}(t)},aA=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},cA={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:[""]},sA=(n_="[eE][+-]?[0-9]+",o_=["Infinity","[0-9]+\\."+(r_=function(t){return"(?:"+t+")?"})("[0-9]+")+r_(n_),"\\.[0-9]+"+r_(n_),"[0-9]+"+r_(n_)].join("|"),new RegExp("^([+-]?(?:"+o_+"))(.*)$")),lA=function(t){return function(t,e){return function(t,e){return x.from(sA.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return L(e,(function(e){return L(cA[e],(function(e){return t===e}))}))}(r,e)?x.some({value:n,unit:r}):x.none()}))}(t,["fixed","relative","empty"]).map((function(t){return t.value+t.unit}))}(t).getOr(t)},fA=function(t){var e=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")}(t),n=new Map,r=v_(),o=function(){var e=lA(t.queryCommandValue("LineHeight"));x.from(n.get(e)).fold((function(){return r.clear()}),(function(t){r.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)}))};return t.on("nodeChange",o),V(e,(function(i,u){return{type:"togglemenuitem",text:i,onSetup:function(a){return n.set(lA(i),a),u+1===e.length&&o(),function(){0===u&&(t.off("nodeChange",o),r.clear())}},onAction:function(){return t.execCommand("LineHeight",!1,i)}}}))},dA=function(t,e){!function(t){iC.each([{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"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:y_(t,e.name)})}));t.ui.registry.addButton("alignnone",{tooltip:"No alignment",onAction:function(){return t.execCommand("JustifyNone")},icon:"align-none"})}(t),uA(t),function(t,e){!function(t,e){var n=t_(0,e,c_(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,f_(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=f({type:"advanced"},e.styleselect),r=t_(0,e,C_(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,x_(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,g_(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)}(t,e),function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)}(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=Qe(null),n=Qe(null);ub(t,"forecolor","forecolor","Text color",e),ub(t,"backcolor","hilitecolor","Background color",n),ab(t,"forecolor","forecolor","Text color"),ab(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t),function(t){!function(t){t.ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return fA(t)}})}(t),function(t){t.ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(e){return e(fA(t))}})}(t)}(t)},mA=function(t,e){return{anchor:"makeshift",x:t,y:e}},gA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},hA=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(gA(t)){var e=t.touches[0];return mA(e.pageX,e.pageY)}return mA(t.pageX,t.pageY)}(e):function(t,e){var n=sp.DOM.getPos(t);return function(t,e,n){return mA(t.x+e,t.y+n)}(e,n.x,n.y)}(t.getContentAreaContainer(),function(t){if(gA(t)){var e=t.touches[0];return mA(e.clientX,e.clientY)}return mA(t.clientX,t.clientY)}(e)):pA(t)},pA=function(t){return{anchor:"selection",root:rn(t.selection.getNode())}},vA=function(t){return{anchor:"node",node:x.some(rn(t.selection.getNode())),root:rn(t.getBody())}},bA=function(t,e,n,r,o,i){var u=n(),a=i?vA(t):hA(t,e);fS(u,ph.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),vg.showMenuAt(o,a,{menu:{markers:Ah("normal")},data:t})}))},yA={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},wA={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"]},xA=function(t,e,n,r,o,i){var u=Ln(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),d=function(){var u=n();!function(t,e,n,r,o,i,u){var a=i?vA(t):function(t,e){return f({bubble:hc(0,12,wA),layouts:yA,overrides:{maxWidthFunction:yO(),maxHeightFunction:fc()}},hA(t,e))}(t,e);fS(n,ph.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),vg.showMenuWithinBounds(o,a,{menu:{markers:Ah("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return x.some($T(t,r.shared))})),t.fire(wO)}))}(t,e,u,r,o,i,!(s||a||c&&l))};if(!c&&!a||i)s&&!i&&t.selection.setCursorLocation(e.target,0),d();else{var m=function(){!function(t){var e=t.selection.getRng(),n=function(){Ag.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),d()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Uc(t.getWin(),Ac.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)}))):m()}},CA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},SA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},kA=function(t){return k(t)?"|"===t:"separator"===t.type},OA={type:"separator"},TA=function(t){if(k(t))return t;switch(t.type){case"separator":return OA;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return k(e)?e:V(e,TA)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(e=t.onAction,function(){return e()})}}var e},_A=function(t,e){if(0===e.length)return t;var n=rt(t).filter((function(t){return!kA(t)})).fold((function(){return[]}),(function(t){return[OA]}));return t.concat(n).concat(e).concat([OA])},EA=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},AA=function(t,e){return EA(t,e)?t.selection.getStart(!0):e.target},NA=function(t,e,n){var r=Ln().deviceType.isTouch,o=Zi(vg.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissContextMenu",[Kr(Mr(),(function(e,n){Ws.close(e),t.focus()}))])])})),i=function(t){return vg.hide(o)},u=function(e){if(SA(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!SA(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t);if(EA(t,e))return!0;if(n){var r=AA(t,e);return Ab(rn(r),n)}return!1}(t,e);(r()?xA:bA)(t,e,(function(){var n=AA(t,e),r=t.ui.registry.getAll(),o=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return x.from(t.getParam("contextmenu")).map(CA).getOrThunk((function(){return W(CA("link linkchecker image imagetools table spellchecker configurepermanentpen"),(function(t){return Tt(r,t)}))}))}(t)}(t);return function(t,e,n){var r=$(e,(function(e,r){if(Tt(t,r)){var o=t[r].update(n);if(k(o))return _A(e,o.split(" "));if(o.length>0){var i=V(o,TA);return _A(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&kA(r[r.length-1])&&r.pop(),r}(r.contextMenus,o,n)}),n,o,i)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",u)}))},RA=Et([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),MA=function(t){return function(e){return e.translate(-t.left,-t.top)}},zA=function(t){return function(e){return e.translate(t.left,t.top)}},DA=function(t){return function(e,n){return $(t,(function(t,e){return e(t)}),uu(e,n))}},BA=function(t,e,n){return t.fold(DA([zA(n),MA(e)]),DA([MA(e)]),DA([]))},PA=function(t,e,n){return t.fold(DA([zA(n)]),DA([]),DA([zA(e)]))},IA=function(t,e,n){return t.fold(DA([]),DA([MA(n)]),DA([zA(e),MA(n)]))},LA=function(t,e,n){var r=t.fold((function(t,e){return{position:x.some("absolute"),left:x.some(t+"px"),top:x.some(e+"px")}}),(function(t,e){return{position:x.some("absolute"),left:x.some(t-n.left+"px"),top:x.some(e-n.top+"px")}}),(function(t,e){return{position:x.some("fixed"),left:x.some(t+"px"),top:x.some(e+"px")}}));return f({right:x.none(),bottom:x.none()},r)},HA=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(IA,FA),o(PA,VA),o(BA,jA))},FA=RA.offset,VA=RA.absolute,jA=RA.fixed,UA=function(t,e){var n=Do(t,e);return E(n)?NaN:parseInt(n,10)},WA=function(t,e,n,r,o,i){var u=function(t,e,n,r){return function(t,e){var n=t.element,r=UA(n,e.leftAttr),o=UA(n,e.topAttr);return isNaN(r)||isNaN(o)?x.none():x.some(uu(r,o))}(t,e).fold((function(){return n}),(function(t){return jA(t.left+r.left,t.top+r.top)}))}(t,e,n,r),a=e.mustSnap?$A(t,e,u,o,i):GA(t,e,u,o,i),c=BA(u,o,i);return function(t,e,n){var r=t.element;zo(r,e.leftAttr,n.left+"px"),zo(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:jA(c.left,c.top),extra:x.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},qA=function(t,e,n,r){return it(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?x.some({output:HA(t.output,e,n,r),extra:t.extra}):x.none()}))},$A=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o).orThunk((function(){return $(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return uu(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:x.some(u),snap:x.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:x.some(u),snap:x.some(e)}:t}))}),{deltas:x.none(),snap:x.none()}).snap.map((function(t){return{output:HA(t.output,n,r,o),extra:t.extra}}))}))},GA=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o)},XA=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t,e,n){return{coord:HA(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=LA(c.coord,0,a);Ii(o,s)}}}),KA="data-initial-z-index",YA=function(t,e){t.getSystem().addToGui(e),function(t){bo(t.element).filter(so).each((function(e){Fi(e,"z-index").each((function(t){zo(e,KA,t)})),Bi(e,"z-index",Li(t.element,"z-index"))}))}(e)},JA=function(t){!function(t){bo(t.element).filter(so).each((function(t){Bo(t,KA).fold((function(){return Ui(t,"z-index")}),(function(e){return Bi(t,"z-index",e)})),Io(t,KA)}))}(t),t.getSystem().removeFromGui(t)},QA=function(t,e,n){return t.getSystem().build(Vb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},ZA=Ve("snaps",[_e("getSnapPoints"),Ku("onSensor"),_e("leftAttr"),_e("topAttr"),je("lazyViewport",Tu),je("mustSnap",!1)]),tN=[je("useFixed",c),_e("blockerClass"),je("getTarget",o),je("onDrag",t),je("repositionTarget",!0),je("onDrop",t),Xe("getBounds",Tu),ZA],eN=function(t,e){return{bounds:t.getBounds(),height:ou(e.element),width:du(e.element)}},nN=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return eN(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t){return(e=Fi(t,"left"),n=Fi(t,"top"),r=Fi(t,"position"),o=function(t,e,n){return("fixed"===n?jA:FA)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?x.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):x.none()).getOrThunk((function(){var e=cu(t);return VA(e.left,e.top)}));var e,n,r,o}(o),s=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=PA(e,n,r),a=uc(u.left,i.x,i.x+i.width-o.width),c=uc(u.top,i.y,i.y+i.height-o.height),s=VA(a,c);return e.fold((function(){var t=IA(s,n,r);return FA(t.left,t.top)}),(function(){return s}),(function(){var t=BA(s,n,r);return jA(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return FA(t+e,n+u)}),(function(t,n){return VA(t+e,n+u)}),(function(t,n){return jA(t+e,n+u)}))),c=BA(a,r,o);return jA(c.left,c.top)}),(function(e){var u=WA(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)}(t,e.snaps,c,u,a,r,n),l=LA(s,0,a);Ii(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},rN=function(t,e,n,r){e.each(JA),n.snaps.each((function(e){!function(t,e){!function(t,e){var n=t.element;Io(n,e.leftAttr),Io(n,e.topAttr)}(t,e)}(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},oN=function(t){return function(e,n){var r=function(t){n.setStartData(eN(e,t))};return $r(m([Kr(Er(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},iN=Object.freeze({__proto__:null,getData:function(t){return x.from(uu(t.x,t.y))},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),uN=function(t,e,n){return[Kr(Zn(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return rN(r,x.some(c),t,e)},u=Nb(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),nN(r,t,e,iN,n)}},c=QA(r,t.blockerClass,function(t){return $r([Kr(Zn(),t.forceDrop),Kr(nr(),t.drop),Kr(tr(),(function(e,n){t.move(n.event)})),Kr(er(),t.delayDrop)])}(a));n(r),YA(r,c)}}))]},aN=m(tN,[Zu("dragger",{handlers:oN(uN)})]),cN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return x.some(uu(e.clientX,e.clientY))}(e):x.none()},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),sN=function(t,e,n){var r=Qe(x.none());return[Kr(Kn(),(function(o,i){i.stop();var u=function(){rN(o,r.get(),t,e),r.set(x.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(n){nN(o,t,e,cN,n)}},c=QA(o,t.blockerClass,function(t){return $r([Kr(Kn(),t.forceDrop),Kr(Jn(),t.drop),Kr(Qn(),t.drop),Kr(Yn(),(function(e,n){t.move(n.event)}))])}(a));r.set(x.some(c)),n(o),YA(o,c)})),Kr(Yn(),(function(n,r){r.stop(),nN(n,t,e,cN,r.event)})),Kr(Jn(),(function(n,o){o.stop(),rN(n,r.get(),t,e),r.set(x.none())})),Kr(Qn(),(function(n){rN(n,r.get(),t,e),r.set(x.none())}))]},lN=aN,fN=m(tN,[Zu("dragger",{handlers:oN(sN)})]),dN=m(tN,[Zu("dragger",{handlers:oN((function(t,e,n){return m(uN(t,e,n),sN(t,e,n))}))})]),mN=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:lN,touch:fN,mouseOrTouch:dN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:x.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=x.none(),e=x.none(),n=r({});return ui({readState:n,reset:function(){t=x.none(),e=x.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=x.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=x.some(t)}})}}),apis:XA}),gN=function(t,e,n,r,o,i){return t.fold((function(){return mN.snap({sensor:VA(n-20,r-20),range:uu(o,i),output:VA(x.some(n),x.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return mN.snap({sensor:VA(o,i),range:uu(40,40),output:VA(x.some(n-u.width/2),x.some(r-u.height/2)),extra:{td:e}})}))},hN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Vn(t,e)}))})(e.get(),o)||(e.set(x.some(o)),n(o))},mustSnap:!0}},pN=function(t){return Rg(Ng.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:La([mN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Jy.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},vN=function(t,e){var n=Qe([]),r=Qe([]),o=Qe(!1),i=Qe(x.none()),u=Qe(x.none()),a=function(t){var n=Ou(t);return gN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Ou(t);return gN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=hN((function(){return V(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=hN((function(){return V(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=pN(s),d=pN(l),m=Zi(f.asSpec()),g=Zi(d.asSpec()),h=function(e,n,r,o){var i=r(n);mN.snapTo(e,i),function(e,n,r,i){var u=n.dom.getBoundingClientRect();Ui(e.element,"display");var a=vo(rn(t.getBody())).dom.innerHeight,c=u[o]<0,s=function(t,e){return t[o]>e}(u,a);(c||s)&&Bi(e.element,"display","none")}(e,n)},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};Ln().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(_s(e,m),_s(e,g),o.set(!0)),i.set(x.some(t.start)),u.set(x.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Ns(m),Ns(g),o.set(!1)),i.set(x.none()),u.set(x.none())})))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(i_||(i_={}));var bN,yN,wN,xN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},CN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(function(t,e,n){return e.delimiter||(e.delimiter="»"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:La([km.config({mode:"flow",selector:"div[role=button]"}),kp.config({disabled:n.isDisabled}),ev(),Xb.config({}),Am.config({}),Nm("elementPathEvents",[ro((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return km.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!xN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?Am.set(r,(i=V(a||[],(function(e,r){return Ng.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:La([nv(n.isDisabled),ev()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},$(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):Am.set(r,[])}))}))])]),components:[]}}(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Am.set(t,[Yi(e.translate(["{0} "+r,n[r]]))])};return Ng.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:La([nv(e.isDisabled),ev(),Xb.config({}),Am.config({}),ll.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Nm("wordcount-events",[uo((function(t){var e=ll.getValue(t),n="words"===e.mode?"characters":"words";ll.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),ro((function(e){t.on("wordCountUpdate",(function(t){var n=ll.getValue(e).mode;ll.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=lp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?i_.None:"both"===n?i_.Both:i_.Vertical}(t);return o!==i_.None&&r.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:zg("resize-handle",e.icons)},behaviours:La([mN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){!function(t,e,n){var r=rn(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=eA(r+e.top,Ap(t),Rp(t)),n===i_.Both&&(i.width=eA(o+e.left,Ep(t),Np(t))),i}(t,e,n,ru(r),fu(r));yt(o,(function(t,e){return Bi(r,e,tA(t))})),function(t){t.fire("ResizeEditor")}(t)}(t,o,n)},blockerClass:"tox-blocker"})])}}(o)),r}()}},SN=function(t){var e,n,r,o,i=t.inline,u=i?oA:QE,a=$p(t)?gE:j_,c=x.none(),s=Ln(),l=s.browser.isIE()?["tox-platform-ie"]:[],d=s.deviceType.isTouch()?["tox-platform-touch"]:[],m=Vp(t),g=Wp(t),h=lp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[yc]=m?Iu.BottomToTop:Iu.TopToBottom,e)},v=function(){return c.bind(LE.getHeader)},b=Zi((n=Vn(Ri(),g)&&"grid"===Li(g,"display"),r={dom:f({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(d)},h),behaviours:La([Cs.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:$r([Kr(Ar(),(function(){Bi(q.element,"width",document.body.clientWidth+"px")}))])},Rt(r,n?o:{}))),y=function(){return ct.value(b)},w=Rg({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return LE.getThrobber(t)})).getOrDie("Could not find throbber element")},S=function(t,e,n){var r=Qe(!1),o=function(t){var e=Qe(Vp(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:lp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return Ek(Tk,t,e)}(t,i)},anchors:Dk(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ct.value(t)}},urlinput:bO(e),styleselect:Gk(e),colorinput:Hk(e),dialog:Vk(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i}(b,t,(function(){return c.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=LE.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=Ip(t),T=LE.parts.toolbar(f({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind((function(t){return LE.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),_=LE.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),E=LE.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),A=LE.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),N=LE.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),M=t.getParam("statusbar",!0,"boolean")&&!i?x.some(CN(t,S.shared.providers)):x.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[E,A]},D=Bp(t),B=zp(t),P=Mp(t),I=LE.parts.header({dom:f({tag:"div",classes:["tox-editor-header"]},p),components:K([P?[k]:[],D?[_]:B?[T]:[],Up(t)?[]:[w.asSpec()]]),sticky:$p(t),editor:t,sharedBackstage:S.shared}),L=K([m?[]:[I],i?[]:[z],m?[I]:[]]),H=K([[{dom:{tag:"div",classes:["tox-editor-container"]},components:L}],i?[]:M.toArray(),[N]]),F=qp(t),V=f(f({role:"application"},lp.isRtl()?{dir:"rtl"}:{}),F?{"aria-hidden":"true"}:{}),U=Zi(LE.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d).concat(l),styles:f({visibility:"hidden"},F?{opacity:"0",border:"0"}:{}),attributes:V},components:H,behaviours:La([ev(),kp.config({disableClass:"tox-tinymce--disabled"}),km.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"})])}));c=x.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){LE.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){LE.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){LE.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return LE.isToolbarDrawerToggled(U)}));var W=jb(U),q=jb(b);!function(t,e,n){var r=function(t,r){j([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){j([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(qs(),{target:t.target})},u=Tb(rn(document),"touchstart",i),a=Tb(rn(document),"touchmove",(function(t){return r(Tr(),t)})),c=Tb(rn(document),"touchend",(function(t){return r(_r(),t)})),s=Tb(rn(document),"mousedown",i),l=Tb(rn(document),"mouseup",(function(t){0===t.raw.button&&o(Gs(),{target:t.target})})),f=function(t){return o(qs(),{target:rn(t.target)})},d=function(t){0===t.button&&o(Gs(),{target:rn(t.target)})},m=function(t){return r(Er(),Eb(t))},g=function(t){o($s(),{}),r(Ar(),Eb(t))},h=function(){return o($s(),{})};t.on("PostRender",(function(){t.on("click",f),t.on("tap",f),t.on("mouseup",d),t.on("ScrollWindow",m),t.on("ResizeWindow",g),t.on("ResizeEditor",h)})),t.on("remove",(function(){t.off("click",f),t.off("tap",f),t.off("mouseup",d),t.off("ScrollWindow",m),t.off("ResizeWindow",g),t.off("ResizeEditor",h),s.unbind(),u.unbind(),a.unbind(),c.unbind(),l.unbind()})),t.on("detach",(function(){Ds(e),Ds(n),e.destroy(),n.destroy()}))}(t,W,q);var $=function(){var e=tA(function(t){return function(t){var e=Tp(t),n=Ap(t),r=Rp(t);return ZE(e).map((function(t){return eA(t,n,r)}))}(t).getOr(Tp(t))}(t)),n=tA(function(t){return nA(t).getOr(_p(t))}(t));return t.inline||(ji("div","width",n)&&Bi(U.element,"width",n),ji("div","height",e)?Bi(U.element,"height",e):Bi(U.element,"height","200px")),e};return{mothership:W,uiMothership:q,backstage:S,renderUI:function(){a.setup(t,S.shared,v),dA(t,S),NA(t,y,S),function(t){var e=t.ui.registry.getAll().sidebars;j(vt(e),(function(n){var r=e[n],o=function(){return x.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),function(t,e,n){var r=Qe(!1),o=Qe(x.none()),i=function(t){t!==r.get()&&(function(t,e,n){var r=t.element;!0===e?(Am.set(t,[NE(n)]),Ui(r,"display"),Io(r,"aria-hidden")):(Am.set(t,[]),Bi(r,"display","none"),zo(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(Ag.clearTimeout),R(e.time)){var n=Ag.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(x.some(n))}else i(e.state),o.set(x.none())}))}(t,C,S.shared),wt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Dp(t),s={menuItems:r,menus:Gp(t),menubar:Xp(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===hh.floating,buttons:n,sidebar:i};M_(t,o,b,{backstage:S}),vN(t,b);var l=t.getElement(),f=$(),d={mothership:W,uiMothership:q,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:q.broadcast,broadcastOn:q.broadcastOn,register:function(){}}}}}},kN=r([_e("lazySink"),Pe("dragBlockClass"),Xe("getBounds",Tu),je("useTabstopAt",s),je("eventOrder",{}),fl("modalBehaviours",[km]),Yu("onExecute"),Qu("onEscape")]),ON={sketch:o},TN=r([Fl({name:"draghandle",overrides:function(t,e){return{behaviours:La([mN.config({mode:"mouse",getTarget:function(t){return Mu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Ll({schema:[_e("dom")],name:"title"}),Ll({factory:ON,schema:[_e("dom")],name:"close"}),Ll({factory:ON,schema:[_e("dom")],name:"body"}),Fl({factory:ON,schema:[_e("dom")],name:"footer"}),Hl({factory:{sketch:function(t,e){return f(f({},t),{dom:e.dom,components:e.components})}},schema:[je("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),je("components",[])],name:"blocker"})]),_N=Object.freeze({__proto__:null,block:function(t,e,n,r){zo(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})]),u=r(o,i),a=o.getSystem().build(u);Am.append(o,tu(a)),a.hasConfigured(km)&&km.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Am.remove(o,a)}))},unblock:function(t,e,n){Io(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),EN=[Xe("getRoot",x.none),Ku("onBlock"),Ku("onUnblock")],AN=Fa({fields:EN,name:"blocking",apis:_N,state:Object.freeze({__proto__:null,init:function(){var t=v_();return ui({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NN=gf({name:"ModalDialog",configFields:kN(),partFields:TN(),factory:function(t,e,n,r){var i,u=Qe(x.none()),a=Uo("modal-events"),c=f(f({},t.eventOrder),((i={})[Nr()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),i));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){u.set(x.some(e));var n=t.lazySink(e).getOrDie(),o=r.blocker(),i=n.getSystem().build(f(f({},o),{components:o.components.concat([tu(e)]),behaviours:La([Bm.config({}),Nm("dialog-blocker-events",[no(or(),(function(){km.focusIn(e)}))])])}));_s(n,i),km.focusIn(e)},hide:function(t){u.set(x.none()),bo(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Ns(t)}))}))},getBody:function(e){return Zl(e,t,"body")},getFooter:function(e){return Zl(e,t,"footer")},setIdle:function(t){AN.unblock(t)},setBusy:function(t,e){AN.block(t,e)}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:ml(t.modalBehaviours,[Am.config({}),km.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),AN.config({getRoot:u.get}),Nm(a,[ro((function(e){var n,r,i,u,a,c;n=e.element,r=Zl(e,t,"title").element,i=Bo(n,"id").fold((function(){var t=Uo("dialog-label");return zo(r,"id",t),t}),o),zo(n,"aria-labelledby",i),u=e.element,a=Zl(e,t,"body").element,c=x.from(Do(u,"id")).fold((function(){var t=Uo("dialog-describe");return zo(a,"id",t),t}),o),zo(u,"aria-describedby",c)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),RN=Zt([Ne("type"),Ne("name")].concat($h)),MN=Ce,zN=[ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),$e("align","end",["start","end"]),Ge("primary",!1),Ge("disabled",!1)],DN=m(zN,[Ne("text")]),BN=m([Re("type",["submit","cancel","custom"])],DN),PN=m([Re("type",["menu"]),He("text"),He("tooltip"),He("icon"),Be("items",RN)],zN),IN=ve("type",{submit:BN,cancel:BN,custom:BN,menu:PN}),LN=[Ne("type"),Ne("text"),Re("level",["info","warn","error","success"]),Ne("icon"),je("url","")],HN=Zt(LN),FN=[Ne("type"),Ne("text"),Ge("disabled",!1),Ge("primary",!1),ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),Ge("borderless",!1)],VN=Zt(FN),jN=[Ne("type"),Ne("name"),Ne("label"),Ge("disabled",!1)],UN=Zt(jN),WN=Ce,qN=[Ne("type"),Ne("name")],$N=qN.concat([He("label")]),GN=$N.concat([je("columns","auto")]),XN=Zt(GN),KN=ce([Ne("value"),Ne("text"),Ne("icon")]),YN=Zt($N),JN=xe,QN=Zt($N),ZN=xe,tR=qN.concat([qe("tag","textarea"),Ne("scriptId"),Ne("scriptUrl"),Ue("settings",void 0,Oe)]),eR=qN.concat([qe("tag","textarea"),Me("init")]),nR=le((function(t){return de("customeditor.old",Qt(eR),t).orThunk((function(){return de("customeditor.new",Qt(tR),t)}))})),rR=xe,oR=Zt($N),iR=te(ae),uR=function(t){return[Ne("type"),Ae("columns"),t]},aR=[Ne("type"),Ne("html"),$e("presets","presentation",["presentation","document"])],cR=Zt(aR),sR=$N.concat([Ge("sandboxed",!0)]),lR=Zt(sR),fR=xe,dR=$N.concat([Ee("currentState",Zt([_e("blob"),Ne("url")]))]),mR=Zt(dR),gR=$N.concat([He("inputMode"),He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),hR=Zt(gR),pR=xe,vR=function(t){return[Ne("type"),Ne("label"),t]},bR=[Ne("text"),Ne("value")],yR=[Ne("text"),Be("items",(yN=function(){return wR},wN=zt((function(){return yN()})),{extract:function(t,e,n){return wN().extract(t,e,n)},toString:function(){return wN().toString()}}))],wR=ee([Zt(bR),Zt(yR)]),xR=$N.concat([Be("items",wR),Ge("disabled",!1)]),CR=Zt(xR),SR=xe,kR=$N.concat([De("items",[Ne("text"),Ne("value")]),We("size",1),Ge("disabled",!1)]),OR=Zt(kR),TR=xe,_R=$N.concat([Ge("constrain",!0),Ge("disabled",!1)]),ER=Zt(_R),AR=Zt([Ne("width"),Ne("height")]),NR=[Ne("type"),Be("header",xe),Be("cells",te(xe))],RR=Zt(NR),MR=$N.concat([He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),zR=Zt(MR),DR=xe,BR=$N.concat([$e("filetype","file",["image","media","file"]),je("disabled",!1)]),PR=Zt(BR),IR=Zt([Ne("value"),je("meta",{})]),LR=function(t){return ie("items","items",Pt(),te(le((function(e){return de("Checking item of "+t,HR,e).fold((function(t){return ct.error(he(t))}),(function(t){return ct.value(t)}))}))))},HR=se((function(){return pe("type",{alertbanner:HN,bar:Zt((t=LR("bar"),[Ne("type"),t])),button:VN,checkbox:UN,colorinput:YN,colorpicker:QN,dropzone:oR,grid:Zt(uR(LR("grid"))),iframe:lR,input:hR,listbox:CR,selectbox:OR,sizeinput:ER,textarea:zR,urlinput:PR,customeditor:nR,htmlpanel:cR,imagetools:mR,collection:XN,label:Zt(vR(LR("label"))),table:RR,panel:VR});var t})),FR=[Ne("type"),je("classes",[]),Be("items",HR)],VR=Zt(FR),jR=[ie("name","name",Lt((function(){return Uo("tab-name")})),xe),Ne("title"),Be("items",HR)],UR=[Ne("type"),De("tabs",jR)],WR=Zt(UR),qR=DN,$R=IN,GR=Zt([Ne("title"),Ee("body",pe("type",{panel:VR,tabpanel:WR})),qe("size","normal"),Be("buttons",$R),je("initialData",{}),Xe("onAction",t),Xe("onChange",t),Xe("onSubmit",t),Xe("onClose",t),Xe("onCancel",t),je("onTabChange",t)]),XR=Zt(m([Re("type",["cancel","custom"])],qR)),KR=Zt([Ne("title"),Ne("url"),Le("height"),Le("width"),(bN=XR,Ie("buttons",te(bN))),Xe("onAction",t),Xe("onCancel",t),Xe("onClose",t),Xe("onMessage",t)]),YR=function(t){return O(t)?[t].concat(Y(kt(t),YR)):T(t)?Y(t,YR):[]},JR=function(t){return k(t.type)&&k(t.name)},QR={checkbox:WN,colorinput:JN,colorpicker:ZN,dropzone:iR,input:pR,iframe:fR,sizeinput:AR,selectbox:TR,listbox:SR,size:AR,textarea:DR,urlinput:IR,customeditor:rR,collection:KN,togglemenuitem:MN},ZR=function(t){var e=function(t){return W(YR(t),JR)}(t),n=Y(e,(function(t){return function(t){return x.from(QR[t.type])}(t).fold((function(){return[]}),(function(e){return[Ee(t.name,e)]}))}));return Zt(n)},tM=function(t){return{internalDialog:me(de("dialog",GR,t)),dataValidator:ZR(t),initialData:t.initialData}},eM={open:function(t,e){var n=tM(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(me(de("dialog",KR,e)))},redial:function(t){return tM(t)}},nM=function(t){var e=[],n={};return yt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ct.error(e):ct.value(n)},rM=function(t,e){var n,r=Rg(Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:V(t.items,(function(t){return _k(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),(n=r,wf.config({find:n.getOpt})),cC(r,{postprocess:function(t){return nM(t).fold((function(t){return console.error(t),{}}),(function(t){return t}))}})])}},oM=mf({name:"TabButton",configFields:[je("uid",void 0),_e("value"),ie("dom","dom",Ht((function(){return{attributes:{role:"tab",id:Uo("aria"),"aria-selected":"false"}}})),be()),Pe("action"),je("domModification",{}),fl("tabButtonBehaviours",[Bm,km,ll]),_e("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Km(t.action),behaviours:ml(t.tabButtonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0}),ll.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),iM=r([_e("tabs"),_e("dom"),je("clickToDismiss",!1),fl("tabbarBehaviours",[Nf,km]),Gu(["tabClass","selectedClass"])]),uM=Vl({factory:oM,name:"tabs",unit:"tab",overrides:function(e){var n=function(t,e){Nf.dehighlight(t,e),Vr(t,Ir(),{tabbar:t,button:e})},r=function(t,e){Nf.highlight(t,e),Vr(t,Pr(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(e.uid).getOrDie(),u=Nf.isHighlighted(i,o);(u&&e.clickToDismiss?n:u?t:r)(i,o)},domModification:{classes:[e.markers.tabClass]}}}}),aM=r([uM]),cM=gf({name:"Tabbar",configFields:iM(),partFields:aM(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:ml(t.tabbarBehaviours,[Nf.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){zo(e.element,"aria-selected","true")},onDehighlight:function(t,e){zo(e.element,"aria-selected","false")}}),km.config({mode:"flow",getInitial:function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),sM=mf({name:"Tabview",configFields:[fl("tabviewBehaviours",[Am])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:ml(t.tabviewBehaviours,[Am.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),lM=r([je("selectFirst",!0),Ku("onChangeTab"),Ku("onDismissTab"),je("tabs",[]),fl("tabSectionBehaviours",[])]),fM=Ll({factory:cM,schema:[_e("dom"),ze("markers",[_e("tabClass"),_e("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),dM=Ll({factory:sM,name:"tabview"}),mM=r([fM,dM]),gM=gf({name:"TabSection",configFields:lM(),partFields:mM(),factory:function(t,e,n,r){var o=function(e,n){Ql(e,t,"tabbar").each((function(t){n(t).each(jr)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.tabSectionBehaviours),events:$r(K([t.selectFirst?[ro((function(t,e){o(t,Nf.getFirst)}))]:[],[Kr(Pr(),(function(e,n){var r,o;r=n.event.button,o=ll.getValue(r),Ql(r,t,"tabview").each((function(e){G(t.tabs,(function(t){return t.value===o})).each((function(n){var o=n.view();Bo(r.element,"id").each((function(t){zo(e.element,"aria-labelledby",t)})),Am.set(e,o),t.onChangeTab(e,r,o)}))}))})),Kr(Ir(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Ql(e,t,"tabview").map((function(t){return Am.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Nf.getCandidates(t);return G(n,(function(t){return ll.getValue(t)===e})).filter((function(e){return!Nf.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),hM=function(t,e){Bi(t,"height",e+"px"),Ln().browser.isIE()?Ui(t,"flex-basis"):Bi(t,"flex-basis",e+"px")},pM=function(t,e,n){Mu(t,'[role="dialog"]').each((function(t){zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Bi(e,"height","0"),Bi(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=po(t).dom,i=Mu(t,".tox-dialog-wrap").getOr(t);r="fixed"===Li(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=ru(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+fu(n)?Math.max(ru(n),u):u,c=parseInt(Li(t,"margin-top"),10)||0,s=parseInt(Li(t,"margin-bottom"),10)||0;return r-(ru(t)+c+s-a)}(t,e,r))})).each((function(t){hM(e,t)}))}))}))},vM=function(t){return zu(t,'[role="tabpanel"]')},bM="send-data-to-section",yM="send-data-to-view",wM=function(t,e){var n=Qe({}),r=function(t){var e=ll.getValue(t),r=nM(e).getOr({}),o=n.get(),i=Rt(o,r);n.set(i)},o=function(t){var e=n.get();ll.setValue(t,e)},i=Qe(null),a=V(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,(function(t){return _k(n,t,e)})),formBehaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),Nm("TabView.form.events",[ro(o),oo(r)]),Wa.config({channels:jt([{key:bM,value:{onReceive:r}},{key:yM,value:{onReceive:o}}])})])}}))]}}})),c=function(t){var e;return{smartTabHeight:(e=Qe(x.none()),{extraEvents:[ro((function(n){var r=n.element;vM(r).each((function(o){Bi(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r,i=(r=function(t,e,n){return V(t,(function(r,o){Am.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Am.set(n,[]),i.height}))}(t,o,n),nt(tt(r,(function(t,e){return t>e?-1:t<e?1:0}))));e.set(i)})),pM(r,o,e),Ui(o,"visibility"),function(t,e){nt(t).each((function(t){return gM.showTab(e,t.value)}))}(t,n),Ag.requestAnimationFrame((function(){pM(r,o,e)}))}))})),Kr(Ar(),(function(t){var n=t.element;vM(n).each((function(t){pM(n,t,e)}))})),Kr(cy,(function(t,n){var r=t.element;vM(r).each((function(t){var n=Ga();Bi(t,"visibility","hidden");var o=Fi(t,"height").map((function(t){return parseInt(t,10)}));Ui(t,"height"),Ui(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(x.from(i)),pM(r,t,e)):o.each((function(e){hM(t,e)})),Ui(t,"visibility"),n.each($a)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}(a).smartTabHeight;return gM.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=ll.getValue(e);Vr(t,ay,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[gM.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[cM.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:La([Xb.config({})])}),gM.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:La([Nm("tabpanel",c.extraEvents),km.config({mode:"acyclic"}),wf.config({find:function(t){return nt(gM.getViewItems(t))}}),ll.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([bM],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([yM],{})}}})])})},xM=Uo("update-dialog"),CM=Uo("update-title"),SM=Uo("update-body"),kM=Uo("update-footer"),OM=Uo("body-send-message"),TM=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:f(f({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:La([eC(0),_T.config({channel:SM,updateState:function(t,e){return x.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[wM(t.body,n)];default:return[rM(t.body,n)]}},initialData:t})])}},_M=mv.deviceType.isTouch(),EM=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},AM=function(t,e){return NN.parts.close(Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:La([Xb.config({})])}))},NM=function(){return NN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},RM=function(t,e){return NN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:AE("<p>"+e.translate(t)+"</p>")}]}]})},MM=function(t){return NN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},zM=function(t,e){return[Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},DM=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return NN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),x.some(!0)},useTabstopAt:function(t){return!bC(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:f({position:"relative"},t.extraStyles)},components:m([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:AE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:_M?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:La(m([Bm.config({}),Nm("dialog-events",t.dialogEvents.concat([no(or(),(function(t,e){km.focusIn(t)}))])),Nm("scroll-lock",[ro((function(){vi(Ri(),i)})),oo((function(){bi(Ri(),i)}))])],t.extraBehaviours)),eventOrder:f((e={},e[yr()]=["dialog-events"],e[Nr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Rr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},BM=function(t){return Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.icons)}}],action:function(t){Fr(t,ny)}})},PM=function(t,e,n){var r=function(t){return[Yi(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:f({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:La([_T.config({channel:CM,renderComponents:r})])}},IM=function(){return{dom:AE('<div class="tox-dialog__draghandle"></div>')}},LM=function(t,e){return function(t,e){var n=NN.parts.title(PM(t,x.none(),e)),r=NN.parts.draghandle(IM()),o=NN.parts.close(BM(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},HM=function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},FM=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){NN.setBusy(t(),(function(t,n){return HM(e.message,n)}))},onUnblock:function(){NN.setIdle(t())}}},VM=function(t,e,n,r){var o;return Zi(DM(f(f({},t),{lazySink:r.shared.getSink,extraBehaviours:m([_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:e}),fC({})],t.extraBehaviours),onEscape:function(t){Fr(t,ny)},dialogEvents:n,eventOrder:(o={},o[br()]=[_T.name(),Wa.name()],o[Nr()]=["scroll-lock",_T.name(),"messages","dialog-events","alloy.base.behaviour"],o[Rr()]=["alloy.base.behaviour","dialog-events","messages",_T.name(),"scroll-lock"],o)})))},jM=function(t){return V(t,(function(t){return"menu"===t.type?function(t){var e=V(t.items,(function(t){var e=Qe(!1);return f(f({},t),{storage:e})}));return f(f({},t),{items:e})}(t):t}))},UM=function(t){return $(t,(function(t,e){return"menu"===e.type?$(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},WM=function(t,e){return[Zr(or(),vC),t(ey,(function(t,n){e.onClose(),n.onClose()})),t(ny,(function(t,e,n,r){e.onCancel(t),Fr(r,ey)})),Kr(uy,(function(t,n){return e.onUnblock()})),Kr(iy,(function(t,n){return e.onBlock(n.event)}))]},qM=function(t,e,n){var r=function(e,n){return Kr(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){_T.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return m(WM(r,e),[r(oy,(function(t,e){return e.onSubmit(t)})),r(ty,(function(t,e,n){e.onChange(t,{name:n.name})})),r(ry,(function(t,e,r,o){var i=function(){return km.focusIn(o)},u=function(t){return Po(t,"disabled")||Bo(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Ti(o.element),c=Ga(a);e.onAction(t,{name:r.name,value:r.value}),Ga(a).fold(i,(function(t){u(t)||c.exists((function(e){return jn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!jn(e.element,t)})).each(i)}))})),r(ay,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),oo((function(e){var n=t();ll.setValue(e,n.getData())}))])},$M=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=U(n,(function(t){return"start"===t.align})),o=function(t,e){return Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},GM=function(t,e){return{dom:AE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:La([_T.config({channel:kM,initialData:t,updateState:function(t,n){var r=V(n.buttons,(function(t){var n=Rg(function(t,e){return xS(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return x.some({lookupByName:function(t,e){return function(t,e,n){return G(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:$M})])}},XM=function(t,e){return NN.parts.footer(GM(t,e))},KM=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=wf.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return Gx.getField(n,e).fold((function(){var r=t.getFooter();return _T.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return x.some(t)}))}return x.none()},YM=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=ll.getValue(r),i=wt(n,(function(t){return t.get()}));return f(f({},o),i)},setData:function(e){r((function(r){var i=o.getData(),u=f(f({},i),e),a=function(t,e){var n=t.getRoot();return _T.getState(n).get().map((function(t){return me(de("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();ll.setValue(c,a),yt(n,(function(t,e){Tt(u,e)&&t.set(u[e])}))}))},disable:function(e){KM(t,e).each(kp.disable)},enable:function(e){KM(t,e).each(kp.enable)},focus:function(e){KM(t,e).each(Bm.focus)},block:function(t){if(!k(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Vr(e,iy,{message:t})}))},unblock:function(){r((function(t){Fr(t,uy)}))},showTab:function(e){r((function(n){var r=t.getBody();_T.getState(r).get().exists((function(t){return t.isTabPanel()}))&&wf.getCurrent(r).each((function(t){gM.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([xM],r),n.getSystem().broadcastOn([CM],r.internalDialog),n.getSystem().broadcastOn([SM],r.internalDialog),n.getSystem().broadcastOn([kM],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(t){Fr(t,ey)}))}};return o},JM=tinymce.util.Tools.resolve("tinymce.util.URI"),QM=["insertContent","setContent","execCommand","close","block","unblock"],ZM=function(t){return O(t)&&-1!==QM.indexOf(t.mceAction)},tz=function(t,e,n,r){var o,i,a,c,s,l,d,g,h=LM(t.title,r),p=(g={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[hC({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:La([Xb.config({}),Bm.config({})])})]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)})])},NN.parts.body(g)),v=t.buttons.bind((function(t){return 0===t.length?x.none():x.some(XM({buttons:t},r))})),b=(c=function(){return N},s=FM((function(){return A}),e),l=function(t,e){return Kr(t,(function(t,n){d(t,(function(r,o){e(c(),r,n.event,t)}))}))},d=function(t,e){_T.getState(t).get().each((function(n){e(n,t)}))},m(WM(l,s),[l(ry,(function(t,e,n){e.onAction(t,{name:n.name})}))])),y=f(f({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),w=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],C=new JM(t.url,{base_uri:new JM(window.location.href)}),S=C.protocol+"://"+C.host+(C.port?":"+C.port:""),T=Qe(x.none()),E=[Nm("messages",[ro((function(){var e=Tb(rn(window),"message",(function(e){if(C.isSameOrigin(new JM(e.raw.origin))){var r=e.raw.data;ZM(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!_(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,N,r):function(t){return!ZM(t)&&O(t)&&Tt(t,"mceAction")}(r)&&t.onMessage(N,r)}}));T.set(x.some(e))})),oo((function(){T.get().each((function(t){return t.unbind()}))}))]),Wa.config({channels:(o={},o[OM]={onReceive:function(t,e){zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,S)}))}},o)})],A=VM({header:h,body:p,footer:v,extraClasses:w,extraBehaviours:E,extraStyles:y},t,b,r),N=(i=A,a=function(t){i.getSystem().isConnected()&&t(i)},{block:function(t){if(!k(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a((function(e){Vr(e,iy,{message:t})}))},unblock:function(){a((function(t){Fr(t,uy)}))},close:function(){a((function(t){Fr(t,ey)}))},sendMessage:function(t){a((function(e){e.getSystem().broadcastOn([OM],t)}))}});return{dialog:A,instanceApi:N}},ez=function(t,e,n){return e&&n?[]:[uE.config({contextual:{lazyContext:function(){return x.some(ku(rn(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},nz=function(t){var e=t.backstage,n=t.editor,r=$p(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){NN.hide(c),r()},i=Rg(xS({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage)),u=NM(),a=AM(o,e.providers),c=Zi(DM({lazySink:function(){return e.getSink()},header:EM(u,a),body:RM(n,e.providers),footer:x.some(MM(zM([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,o)],eventOrder:{}}));NN.show(c);var s=i.get(c);Bm.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){NN.hide(s),r(t)},i=Rg(xS({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:x.none()},"submit",t.backstage)),u=xS({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage),a=NM(),c=AM((function(){return o(!1)}),e.providers),s=Zi(DM({lazySink:function(){return e.getSink()},header:EM(a,c),body:RM(n,e.providers),footer:x.some(MM(zM([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,(function(){return o(!1)})),Kr(oy,(function(){return o(!0)}))],eventOrder:{}}));NN.show(s);var l=i.get(s);Bm.focus(l)}}}(t),u=function(t,n){return eM.open((function(t,r,o){var i=r,u=function(t,e,n){var r=LM(t.internalDialog.title,n),o=function(t,e){var n=TM(t,x.none(),e,!1);return NN.parts.body(n)}({body:t.internalDialog.body},n),i=jM(t.internalDialog.buttons),u=UM(i),a=XM({buttons:i},n),c=qM((function(){return d}),FM((function(){return f}),e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:x.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=VM(l,t,c,n),d=YM({getRoot:function(){return f},getBody:function(){return NN.getBody(f)},getFooter:function(){return NN.getFooter(f)},getFormWrapper:function(){var t=NN.getBody(f);return wf.getCurrent(t).getOr(t)}},e.redial,u);return{dialog:f,instanceApi:d}}({dataValidator:o,initialData:i,internalDialog:t},{redial:eM.redial,closeWindow:function(){NN.hide(u.dialog),n(u.instanceApi)}},e);return NN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},a=function(t,o,i,u){return eM.open((function(t,a,c){var s,l=me(de("data",c,a)),d=(s=Qe(x.none()),{clear:function(){return s.set(x.none())},set:function(t){return s.set(x.some(t))},isSet:function(){return s.get().isSome()},on:function(t){return s.get().each(t)}}),g=e.shared.header.isPositionedAtTop(),h=function(){return d.on((function(t){vg.reposition(t),uE.refresh(t)}))},p=function(t,e,n,r){var o,i,u,a,c,s=Uo("dialog-label"),l=Uo("dialog-content"),f=Rg((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:[PM(u,x.some(a),c),IM(),BM(c)],containerBehaviours:La([mN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Du(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Rg(function(t,e,n,r){return TM(t,x.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=jM(t.internalDialog.buttons),g=UM(m),h=Rg(function(t,e){return GM(t,e)}({buttons:m},n)),p=qM((function(){return b}),{onBlock:function(t){AN.block(v,(function(e,n){return HM(t.message,n)}))},onUnblock:function(){AN.unblock(v)},onClose:function(){return e.closeWindow()}},n.shared.getSink),v=Zi({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=""+l,o)},eventOrder:(i={},i[br()]=[_T.name(),Wa.name()],i[yr()]=["execute-on-form"],i[Nr()]=["reflecting","execute-on-form"],i),behaviours:La([km.config({mode:"cyclic",onEscape:function(t){return Fr(t,ey),x.some(!0)},useTabstopAt:function(t){return!bC(t)&&("button"!==ao(t)||"disabled"!==Do(t,"disabled"))}}),_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:t}),Bm.config({}),Nm("execute-on-form",p.concat([no(or(),(function(t,e){km.focusIn(t)}))])),AN.config({getRoot:function(){return x.some(v)}}),Am.config({}),fC({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),b=YM({getRoot:function(){return v},getFooter:function(){return h.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var t=d.get(v);return wf.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:v,instanceApi:b}}({dataValidator:c,initialData:l,internalDialog:t},{redial:eM.redial,closeWindow:function(){d.on(vg.hide),n.off("ResizeEditor",h),d.clear(),i(p.instanceApi)}},e,u),v=Zi(vg.sketch(f(f({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},g?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:La(m([Nm("window-manager-inline-events",[Kr(Mr(),(function(t,e){Fr(p.dialog,ny)}))])],ez(n,r,g))),isExtraPart:function(t,e){return function(t){return Ab(t,".tox-alert-dialog")||Ab(t,".tox-confirm-dialog")}(e)}})));return d.set(v),vg.showWithin(v,o,tu(p.dialog),x.some(Ri())),r&&g||(uE.refresh(v),n.on("ResizeEditor",h)),p.instanceApi.setData(l),km.focusIn(p.dialog),p.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?a(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?a(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,r){return function(t,r){return eM.openUrl((function(t){var o=tz(t,{closeWindow:function(){NN.hide(o.dialog),r(o.instanceApi)}},n,e);return NN.show(o.dialog),o.instanceApi}),t)}(t,r)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};l.add("silver",(function(t){var e=SN(t),n=e.uiMothership,o=e.backstage,i=e.renderUI,u=e.getUi;kb(t,o.shared);var a=nz({editor:t,backstage:o});return{renderUI:i,getWindowManagerImpl:r(a),getNotificationManagerImpl:function(){return function(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),u=function(){o(),vg.hide(c)},a=Zi(Pg.sketch({text:t.text,level:I(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:x.from(t.icon),closeButton:!i,onAction:u,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),c=Zi(vg.sketch(f({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(c),t.timeout>0&&Ag.setTimeout((function(){u()}),t.timeout),{close:u,moveTo:function(t,e){vg.showAt(c,{anchor:"makeshift",x:t,y:e},tu(a))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(t){case"bc-bc":return Eg;case"tc-tc":return _g;case"tc-bc":return Sa;case"bc-tc":default:return ka}}(n),o={anchor:"node",root:Ri(),node:x.some(rn(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};vg.showAt(c,o,tu(a))}else vg.showAt(c,e.backstage.shared.anchors.banner(),tu(a))},text:function(t){Pg.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){Pg.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){j(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(nt(t).each((function(t){return t.moveRel(null,"banner")})),j(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}(0,{backstage:o},n)},ui:u()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t){return r((function(e,n){var u=Object.keys(e),a=Object.keys(n);if(!function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))}(o).eq(u,a))return!1;for(var c=u.length,s=0;s<c;s++){var l=u[s];if(!t.eq(e[l],n[l]))return!1}return!0}))},a=r((function(t,n){if(t===n)return!0;var r=e(t);return r===e(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===n:"array"===r?i(a).eq(t,n):"object"===r&&u(a).eq(t,n))})),c=function(){},s=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},l=function(t){return function(){return t}},f=function(t){return t};function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var m=function(t){return function(e){return!t(e)}},g=function(t){return function(){throw new Error(t)}},h=function(t){t()},p=l(!1),v=l(!0),b=function(){return y},y=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:e,map:b,each:c,bind:b,exists:p,forall:v,filter:b,equals:t,equals_:t,toArray:function(){return[]},toString:l("none()")}}(),w=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=function(t){return function(e){return t===e}},O=C("string"),T=C("object"),_=C("array"),E=k(null),A=S("boolean"),N=k(void 0),R=function(t){return null==t},M=function(t){return!R(t)},z=S("function"),D=S("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(t,e){return P.call(t,e)},H=function(t,e){return L(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return U(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,p)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!_(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);I.apply(e,t[n])}return e}(V(t,e))},Y=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},J=function(t){var e=B.call(t,0);return e.reverse(),e},Q=function(t,e){return W(t,(function(t){return!H(e,t)}))},Z=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},tt=function(t){return Z(t,0)},et=function(t){return Z(t,t.length-1)},nt=z(Array.from)?Array.from:function(t){return B.call(t)},rt=Object.keys,ot=Object.hasOwnProperty,it=function(t,e){for(var n=rt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ut=function(t,e){return at(t,(function(t,n){return{k:n,v:e(t,n)}}))},at=function(t,e){var n={};return it(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ct=function(t){return function(e,n){t[n]=e}},st=function(t,e,n,r){return it(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},lt=function(t,e){var n={},r={};return st(t,e,ct(n),ct(r)),{t:n,f:r}},ft=function(t,e){var n={};return st(t,e,ct(n),c),n},dt=function(t,e){return mt(t,e)?x.from(t[e]):x.none()},mt=function(t,e){return ot.call(t,e)},gt=function(t,e){return mt(t,e)&&void 0!==t[e]&&null!==t[e]},ht=Array.isArray,pt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return!1;return!0},vt=function(t,e){var n=[];return pt(t,(function(r,o){n.push(e(r,o,t))})),n},bt=function(t,e){var n=[];return pt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},yt=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},wt=function(t,e,n,r){for(var o=N(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},xt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Ct=function(t){return t[t.length-1]},St=function(){return(St=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function kt(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var Ot=function(){return Tt(0,0)},Tt=function(t,e){return{major:t,minor:e}},_t=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ot():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Tt(r(1),r(2))}(t,n)},Et=Ot,At=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},Nt=function(t,e){return-1!==t.indexOf(e)},Rt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(0,0+e.length)===e}(t,e)},Mt=function(t){return function(e){return e.replace(t,"")}},zt=Mt(/^\s+|\s+$/g),Dt=Mt(/^\s+/g),Bt=Mt(/\s+$/g),Pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,It=function(t){return function(e){return Nt(e,t)}},Lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Nt(t,"edge/")&&Nt(t,"chrome")&&Nt(t,"safari")&&Nt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pt],search:function(t){return Nt(t,"chrome")&&!Nt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Nt(t,"msie")||Nt(t,"trident")}},{name:"Opera",versionRegexes:[Pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:It("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:It("firefox")},{name:"Safari",versionRegexes:[Pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Nt(t,"safari")||Nt(t,"mobile/"))&&Nt(t,"applewebkit")}}],Ht=[{name:"Windows",search:It("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Nt(t,"iphone")||Nt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:It("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:It("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:It("linux"),versionRegexes:[]},{name:"Solaris",search:It("sunos"),versionRegexes:[]},{name:"FreeBSD",search:It("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:It("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ft={browsers:l(Lt),oses:l(Ht)},Vt="Edge",jt="Chrome",Ut="Opera",Wt="Firefox",qt="Safari",$t=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Vt),isChrome:r(jt),isIE:r("IE"),isOpera:r(Ut),isFirefox:r(Wt),isSafari:r(qt)}},Gt=function(){return $t({current:void 0,version:Et()})},Xt=$t,Kt=(l(Vt),l(jt),l("IE"),l(Ut),l(Wt),l(qt),"Windows"),Yt="Android",Jt="Linux",Qt="Solaris",Zt="FreeBSD",te="ChromeOS",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Kt),isiOS:r("iOS"),isAndroid:r(Yt),isOSX:r("OSX"),isLinux:r(Jt),isSolaris:r(Qt),isFreeBSD:r(Zt),isChromeOS:r(te)}},ne=function(){return ee({current:void 0,version:Et()})},re=ee,oe=(l(Kt),l("iOS"),l(Yt),l(Jt),l("OSX"),l(Qt),l(Zt),l(te),function(t,e){var n=Ft.browsers(),r=Ft.oses(),o=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(Gt,Xt),i=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ne,re),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,t,e);return{browser:o,os:i,deviceType:u}}),ie=function(t){return window.matchMedia(t).matches},ue=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return oe(navigator.userAgent,ie)})),ae=function(){return ue()},ce=navigator.userAgent,se=ae(),le=se.browser,fe=se.os,de=se.deviceType,me=/WebKit/.test(ce)&&!le.isEdge(),ge="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,he=-1!==ce.indexOf("Windows Phone"),pe={opera:le.isOpera(),webkit:me,ie:!(!le.isIE()&&!le.isEdge())&&le.version.major,gecko:le.isFirefox(),mac:fe.isOSX()||fe.isiOS(),iOS:de.isiPad()||de.isiPhone(),android:fe.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:le.isIE()?document.documentMode||7:10,fileApi:ge,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!le.isIE(),desktop:de.isDesktop(),windowsPhone:he,browser:{current:le.current,version:le.version,isChrome:le.isChrome,isEdge:le.isEdge,isFirefox:le.isFirefox,isIE:le.isIE,isOpera:le.isOpera,isSafari:le.isSafari},os:{current:fe.current,version:fe.version,isAndroid:fe.isAndroid,isChromeOS:fe.isChromeOS,isFreeBSD:fe.isFreeBSD,isiOS:fe.isiOS,isLinux:fe.isLinux,isOSX:fe.isOSX,isSolaris:fe.isSolaris,isWindows:fe.isWindows},deviceType:{isDesktop:de.isDesktop,isiPad:de.isiPad,isiPhone:de.isiPhone,isPhone:de.isPhone,isTablet:de.isTablet,isTouch:de.isTouch,isWebView:de.isWebView}},ve=/^\s*|\s*$/g,be=function(t){return null==t?"":(""+t).replace(ve,"")},ye=function(t,e){return e?!("array"!==e||!ht(t))||typeof t===e:void 0!==t},we=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),pt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;we(t,e,n,r)})))},xe={trim:be,isArray:ht,is:ye,toArray:function(t){if(ht(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:pt,map:vt,grep:bt,inArray:yt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=this,a=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},walk:we,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||ye(t,"array")?t:vt(t.split(e||","),be)},_addCacheSuffix:function(t){var e=pe.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Ce=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Se=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ce(n.childNodes[0])},ke=function(t,e){var n=(e||document).createElement(t);return Ce(n)},Oe=function(t,e){var n=(e||document).createTextNode(t);return Ce(n)},Te=Ce,_e=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Ee=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ae=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ne=function(t,e){return t.dom===e.dom},Re=function(t,e){return ae().browser.isIE()?function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t.dom,e.dom,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Me=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),ze=function(t){return t.dom.nodeType},De=function(t){return function(e){return ze(e)===t}},Be=De(1),Pe=De(3),Ie=De(9),Le=De(11),He=function(t){return Te(t.dom.ownerDocument)},Fe=function(t){return Ie(t)?t:He(t)},Ve=function(t){return Te(Fe(t).dom.defaultView)},je=function(t){return x.from(t.dom.parentNode).map(Te)},Ue=function(t){return x.from(t.dom.previousSibling).map(Te)},We=function(t){return x.from(t.dom.nextSibling).map(Te)},qe=function(t){return J(_e(t,Ue))},$e=function(t){return _e(t,We)},Ge=function(t){return V(t.dom.childNodes,Te)},Xe=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(Te)},Ke=function(t){return Xe(t,0)},Ye=function(t){return Xe(t,t.dom.childNodes.length-1)},Je=function(t){return Le(t)},Qe=z(Element.prototype.attachShadow)&&z(Node.prototype.getRootNode),Ze=l(Qe),tn=Qe?function(t){return Te(t.dom.getRootNode())}:Fe,en=function(t){return Je(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Te(e)}(Fe(t))},nn=function(t){return Te(t.dom.host)},rn=function(t,e){je(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},on=function(t,e){We(t).fold((function(){je(t).each((function(t){an(t,e)}))}),(function(t){rn(t,e)}))},un=function(t,e){Ke(t).fold((function(){an(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},an=function(t,e){t.dom.appendChild(e.dom)},cn=function(t,e){j(e,(function(e){an(t,e)}))},sn=function(t){t.dom.textContent="",j(Ge(t),(function(t){ln(t)}))},ln=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},fn=function(t){var e,n=Ge(t);n.length>0&&(e=t,j(n,(function(t){rn(e,t)}))),ln(t)},dn=function(t){var e=Pe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=tn(t);return Je(e)?x.some(e):x.none()}(Te(e)).fold((function(){return o.body.contains(e)}),(n=dn,r=nn,function(t){return n(r(t))}))},mn=function(t,e){return{left:t,top:e,translate:function(n,r){return mn(t+n,e+r)}}},gn=mn,hn=function(t,e){return void 0!==t?t:void 0!==e?e:0},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?gn(n.offsetLeft,n.offsetTop):dn(t)?function(t){var e=t.getBoundingClientRect();return gn(e.left,e.top)}(e):gn(0,0)},vn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return gn(n,r)},bn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},yn=function(t,e){ae().browser.isSafari()&&z(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},wn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},xn=function(t){var e=void 0===t?window:t,n=e.document,r=vn(Te(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return wn(r.left,r.top,n,o)}),(function(t){return wn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Cn=function(t){return function(e){return!!e&&e.nodeType===t}},Sn=function(t){return!!t&&!Object.getPrototypeOf(t)},kn=Cn(1),On=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return H(e,n)}return!1}},Tn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(kn(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},_n=function(t){return function(e){return kn(e)&&e.hasAttribute(t)}},En=function(t){return kn(t)&&t.hasAttribute("data-mce-bogus")},An=function(t){return kn(t)&&"TABLE"===t.tagName},Nn=function(t){return function(e){if(kn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Rn=On(["textarea","input"]),Mn=Cn(3),zn=Cn(8),Dn=Cn(9),Bn=Cn(11),Pn=On(["br"]),In=On(["img"]),Ln=Nn("true"),Hn=Nn("false"),Fn=On(["td","th"]),Vn=On(["video","audio","object","embed"]),jn=function(t){return void 0!==t.style&&z(t.style.getPropertyValue)},Un=function(t,e,n){if(!(O(n)||A(n)||D(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Wn=function(t,e,n){Un(t.dom,e,n)},qn=function(t,e){var n=t.dom;it(e,(function(t,e){Un(n,e,t)}))},$n=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Gn=function(t,e){return x.from($n(t,e))},Xn=function(t,e){t.dom.removeAttribute(e)},Kn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||dn(t)?r:Yn(n,e)},Yn=function(t,e){return jn(t)?t.style.getPropertyValue(e):""},Jn=function(t,e){var n=t.dom,r=Yn(n,e);return x.from(r).filter((function(t){return t.length>0}))},Qn=function(t){var e={},n=t.dom;if(jn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Zn=ae().browser,tr=function(t){return G(t,Be)},er=function(t,e){return t.children&&H(t.children,e)},nr={},rr={exports:nr};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,nr,rr);var or=rr.exports.boltExport,ir=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return ir((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ur={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ar=function(t){setTimeout((function(){throw t}),0)},cr=function(t){var e=function(e){t().then(e,ar)};return{map:function(e){return cr((function(){return t().then(e)}))},bind:function(e){return cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sr=function(t){return cr((function(){return new or(t)}))},lr=function(t){return{is:function(e){return t===e},isValue:v,isError:p,getOr:l(t),getOrThunk:l(t),getOrDie:l(t),or:function(e){return lr(t)},orThunk:function(e){return lr(t)},fold:function(e,n){return n(t)},map:function(e){return lr(e(t))},mapError:function(e){return lr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},fr=function(t){return{is:p,isValue:p,isError:v,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return g(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return fr(t)},mapError:function(e){return fr(e(t))},each:c,bind:function(e){return fr(t)},exists:p,forall:v,toOptional:x.none}},dr={value:lr,error:fr,fromOption:function(t,e){return t.fold((function(){return fr(e)}),lr)}},mr=function(t){if(!_(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=rt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!_(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=rt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!Y(e,(function(t){return H(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},gr=(mr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(f,f)});function hr(t,e,n,r,o){return t(n,r)?x.some(n):z(o)&&o(n)?x.none():e(n,r,o)}var pr,vr=function(t,e,n){for(var r=t.dom,o=z(n)?n:p;r.parentNode;){r=r.parentNode;var i=Te(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},br=function(t,e,n){return hr((function(t,e){return e(t)}),vr,t,e,n)},yr=function(t,e,n){return vr(t,(function(t){return Ee(t,e)}),n)},wr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?x.none():x.from(n.querySelector(t)).map(Te)}(e,t)},xr=function(t,e,n){return hr((function(t,e){return Ee(t,e)}),yr,t,e,n)},Cr=window.Promise?window.Promise:function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(e,t(i,this),t(u,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};function o(t){var e=this;null!==this._state?r((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function i(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void s(t(n,e),t(i,this),t(u,this))}this._state=!0,this._value=e,a.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n((function(n,i){o.call(r,new c(t,e,n,i))}))},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new n((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}t[i]=u,0==--r&&e(t)}catch(t){n(t)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.race=function(t){return new n((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},n}(),Sr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},kr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Or=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Sr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Tr={requestAnimationFrame:function(t,e){pr?pr.then(t):pr=new Cr((function(t){e||(e=document.body),function(t,e){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(t){window.setTimeout(t,0)}),r(t,e)}(t,e)})).then(t)},setTimeout:Sr,setInterval:kr,setEditorTimeout:function(t,e,n){return Sr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=kr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Or,throttle:Or,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}};function _r(t,e){void 0===e&&(e={});var n=0,r={},o=Te(t),i=Fe(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=xe._addCacheSuffix(a),d=function(t){return dt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?Tr.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=ke("link",i.dom);qn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Wn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Wn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,an(en(o),b),Wn(v,"href",f)}else h();else g()},c=function(t){return sr((function(e){a(t,s(e,l(dr.value(t))),s(e,l(dr.error(t))))}))},f=function(t){var e=xe._addCacheSuffix(t);dt(r,e).each((function(t){var n,i;0==--t.count&&(delete r[e],n=t.id,i=en(o),wr(i,"#"+n).each(ln))}))};return{load:a,loadAll:function(t,e,n){var r;(r=V(t,c),function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):j(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))}(r,sr)).get((function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(gr)):e(r.pass.map(gr))}))},unload:f,unloadAll:function(t){j(t,(function(t){f(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var Er=function(){var t=new WeakMap;return{forElement:function(e,n){var r=tn(e).dom;return x.from(t.get(r)).getOrThunk((function(){var e=_r(r,n);return t.set(r,e),e}))}}}(),Ar=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Nr=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,v)).hasOwnProperty(Me(n))}},Rr=Nr(["h1","h2","h3","h4","h5","h6"]),Mr=Nr(["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"]),zr=function(t){return Be(t)&&!Mr(t)},Dr=function(t){return Be(t)&&"br"===Me(t)},Br=Nr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Pr=Nr(["ul","ol","dl"]),Ir=Nr(["li","dd","dt"]),Lr=Nr(["thead","tbody","tfoot"]),Hr=Nr(["td","th"]),Fr=Nr(["pre","script","textarea","style"]),Vr=" ",jr="\ufeff",Ur=function(t){return"\ufeff"===t},Wr=function(t){return t.replace(/\uFEFF/g,"")},qr=kn,$r=Mn,Gr=function(t){return $r(t)&&(t=t.parentNode),qr(t)&&t.hasAttribute("data-mce-caret")},Xr=function(t){return $r(t)&&Ur(t.data)},Kr=function(t){return Gr(t)||Xr(t)},Yr=function(t){return t.firstChild!==t.lastChild||!Pn(t.firstChild)},Jr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset())===jr||t.isAtStart()&&Xr(e.previousSibling))},Qr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset()-1)===jr||t.isAtEnd()&&Xr(e.nextSibling))},Zr=function(t){return $r(t)&&t.data[0]===jr},to=function(t){return $r(t)&&t.data[t.data.length-1]===jr},eo=function(t){return t&&t.hasAttribute("data-mce-caret")?(n=(e=t.getElementsByTagName("br"))[e.length-1],En(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},no=Ln,ro=Hn,oo=Pn,io=Mn,uo=On(["script","style","textarea"]),ao=On(["img","input","textarea","hr","iframe","video","audio","object","embed"]),co=On(["table"]),so=Kr,lo=function(t){return!so(t)&&(io(t)?!uo(t.parentNode):ao(t)||oo(t)||co(t)||fo(t))},fo=function(t){return!1===function(t){return kn(t)&&"true"===t.getAttribute("unselectable")}(t)&&ro(t)},mo=function(t,e){return lo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(fo(t))return!1;if(no(t))return!0}return!0}(t,e)},go=/^[ \t\r\n]*$/,ho=function(t){return go.test(t)},po=function(t,e){return lo(t)&&!1===function(t,e){return Mn(t)&&ho(t.data)&&!1===function(t,e){var n,r,o=Te(e);return n=Te(t),r=d(Ne,o),yr(n,"pre,code",r).isSome()}(t,e)}(t,e)||function(t){return kn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||vo(t)},vo=_n("data-mce-bookmark"),bo=_n("data-mce-bogus"),yo=("data-mce-bogus","all",function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}),wo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(po(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new Ar(n,t);do{if(e){if(yo(n)){n=o.next(!0);continue}if(bo(n)){n=o.next();continue}}if(Pn(n))r++,n=o.next();else{if(po(n,t))return!1;n=o.next()}}while(n);return r<=1}(t.dom,e)},xo=function(t,e){return M(t)&&(po(t,e)||zr(Te(t)))},Co=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},So=function(t,e,n){var r=n||e;if(kn(e)&&Co(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)So(t,o[i],r);if(kn(e)){var u=e.childNodes;1===u.length&&Co(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Bn(t)||Dn(t)}(e)||po(e,r)||function(t){return!!kn(t)&&t.childNodes.length>0}(e)||function(t,e){return Mn(t)&&t.data.length>0&&function(t,e){var n=new Ar(t,e).prev(!1),r=new Ar(t,e).next(!1),o=N(n)||xo(n,e),i=N(r)||xo(r,e);return o&&i}(t,e)}(e,r)||t.remove(e),e},ko=xe.makeMap,Oo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,To=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_o=/[<>&\"\']/g,Eo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ao={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:"Ÿ"},No={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Ro={"<":"<",">":">","&":"&",""":'"',"'":"'"},Mo=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),No[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},zo=Mo("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),Do=function(t,e){return t.replace(e?Oo:To,(function(t){return No[t]||t}))},Bo=function(t,e){return t.replace(e?Oo:To,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":No[t]||"&#"+t.charCodeAt(0)+";"}))},Po=function(t,e,n){return n=n||zo,t.replace(e?Oo:To,(function(t){return No[t]||n[t]||t}))},Io={encodeRaw:Do,encodeAllRaw:function(t){return(""+t).replace(_o,(function(t){return No[t]||t}))},encodeNumeric:Bo,encodeNamed:Po,getEncodeFunc:function(t,e){var n=Mo(e)||zo,r=ko(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Oo:To,(function(t){return void 0!==No[t]?No[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Po(t,e,n)}:Po:r.numeric?Bo:Do},decode:function(t){return t.replace(Eo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Ao[e]||String.fromCharCode(e):Ro[t]||zo[t]||function(t){var e=ke("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},Lo={},Ho={},Fo=xe.makeMap,Vo=xe.each,jo=xe.extend,Uo=xe.explode,Wo=xe.inArray,qo=function(t,e){return(t=xe.trim(t))?t.split(e||" "):[]},$o=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Vo(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Fo(t,/[, ]/):Uo(t,/[, ]/)}))),n};function Go(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=Fo(o,/[, ]/,Fo(o.toUpperCase(),/[, ]/)):(o=Lo[e])||(o=Fo(n," ",Fo(n.toUpperCase()," ")),o=jo(o,r),Lo[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=qo(r));var s=qo(t);for(o=s.length;o--;)u={attributes:c(i=qo([e,n].join(" "))),attributesOrder:i,children:c(r,Ho)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=qo(t);n=u.length;for(var c=qo(e);n--;)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return Lo[t]?Lo[t]:(e="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"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),Vo(qo(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Vo(qo(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("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),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("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"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Vo(qo("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,Lo[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=$o(t.valid_styles),s=$o(t.invalid_styles,"map"),l=$o(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h="td th iframe video audio object script code",p=u("non_empty_elements",h+" pre",m),v=u("move_caret_before_on_enter_elements",h+" table",m),b=u("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"),y=u("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",b),w=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");Vo((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=qo(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(p=a[1],f=a[2],v=a[3],l=a[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(it(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=qo(l,"|")).length;i<u;i++)if(a=S.exec(l[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],w=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(Wo(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===p&&(s.validValues=Fo(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=x(f),r.push(c)):e[f]=c}}},S=function(t){e={},r=[],C(t),Vo(a,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(Lo.text_block_elements=Lo.block_elements=null,Vo(qo(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[a];delete(s=jo({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Vo(n,(function(t,e){t[a]&&(n[e]=t=jo({},n[e]),t[c]=t[a])}))})))},O=function(e){var r=/^([+\-]?)([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]+)\[([^\]]+)]$/;Lo[t.schema]=null,e&&Vo(qo(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Vo(qo(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},T=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};return t.valid_elements?S(t.valid_elements):(Vo(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Vo(qo("strong/b em/i"),(function(t){var n=qo(t,"/");e[n[1]].outputName=n[0]})),Vo(qo("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Vo(qo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Vo(qo("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Vo({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"},(function(t,n){e[n]&&(e[n].parentsRequired=qo(t))})),t.invalid_elements&&Vo(Uo(t.invalid_elements),(function(t){e[t]&&delete e[t]})),T("span")||C("span[!data-mce-type|*]"),{children:n,elements:e,getValidStyles:function(){return c},getValidClasses:function(){return l},getBlockElements:function(){return y},getInvalidStyles:function(){return s},getShortEndedElements:function(){return m},getTextBlockElements:function(){return b},getTextInlineElements:function(){return w},getBoolAttrs:function(){return g},getElementRule:T,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return p},getMoveCaretBeforeOnEnterElements:function(){return v},getWhiteSpaceElements:function(){return f},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=T(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}}var Xo,Ko,Yo,Jo,Qo,Zo,ti,ei,ni,ri,oi,ii,ui,ai,ci,si,li,fi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},di=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,a=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<l.length;n++)s[l[n]]="\ufeff"+n,s["\ufeff"+n]=l[n];return{toHex:function(t){return t.replace(i,fi)},parse:function(e){var r,o,l,f,d,m,g,h={},p=t.url_converter,v=t.url_converter_scope||this,b=function(t,e,r){var o=h[t+"-top"+e];if(o){var i=h[t+"-right"+e];if(i){var u=h[t+"-bottom"+e];if(u){var a=h[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(h[t+e]=-1===n?c[0]:c.join(" "),delete h[t+"-top"+e],delete h[t+"-right"+e],delete h[t+"-bottom"+e],delete h[t+"-left"+e])}}}}},y=function(t){var e,n=h[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return h[t]=n[0],!0}},w=function(t){return f=!0,s[t]},x=function(t,e){return f&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return s[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},C=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},S=function(t){return t.replace(/\\[0-9a-f]+/gi,C)},k=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=x(i)).replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return p&&(n=p.call(v,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));r=a.exec(e);)if(a.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),l=r[2].replace(c,""),o&&l){if(o=S(o),l=S(l),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===o&&"700"===l?l="bold":"color"!==o&&"background-color"!==o||(l=l.toLowerCase()),l=(l=l.replace(i,fi)).replace(u,k),h[o]=f?x(l,!0):l}b("border","",!0),b("border","-width"),b("border","-color"),b("border","-style"),b("padding",""),b("margin",""),"border",m="border-style",g="border-color",y(d="border-width")&&y(m)&&y(g)&&(h.border=h[d]+" "+h[m]+" "+h[g],delete h[d],delete h[m],delete h[g]),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):it(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},mi=/^(?:mouse|contextmenu)|click/,gi={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},hi=function(){return!1},pi=function(){return!0},vi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},bi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},yi=function(t,e){var n,r=e||{};for(n in t)gi[n]||(r[n]=t[n]);if(r.target||(r.target=r.srcElement||document),r.composedPath&&(r.composedPath=function(){return t.composedPath()}),t&&function(t){return mi.test(t.type)}(t)&&void 0===t.pageX&&void 0!==t.clientX){var o=r.target.ownerDocument||document,i=o.documentElement,u=o.body;r.pageX=t.clientX+(i&&i.scrollLeft||u&&u.scrollLeft||0)-(i&&i.clientLeft||u&&u.clientLeft||0),r.pageY=t.clientY+(i&&i.scrollTop||u&&u.scrollTop||0)-(i&&i.clientTop||u&&u.clientTop||0)}return r.preventDefault=function(){r.isDefaultPrevented=pi,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},r.stopPropagation=function(){r.isPropagationStopped=pi,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=pi,r.stopPropagation()},!1===function(t){return t.isDefaultPrevented===pi||t.isDefaultPrevented===hi}(r)&&(r.isDefaultPrevented=hi,r.isPropagationStopped=hi,r.isImmediatePropagationStopped=hi),void 0===r.metaKey&&(r.metaKey=!1),r},wi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){bi(t,"DOMContentLoaded",i),bi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():vi(t,"DOMContentLoaded",i),n.domLoaded||vi(t,"load",i)}},xi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(yi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,yi({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=yi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=yi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(yi({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?wi(t,s,f):vi(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],bi(t,r.fakeName||u,r.nativeHandler,r.capture))}}else it(a,(function(e,n){bi(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(mt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=yi(null,n);o.type=e,o.target=t;do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Ci="sizzle"+-new Date,Si=window.document,ki=0,Oi=0,Ti=iu(),_i=iu(),Ei=iu(),Ai=function(t,e){return t===e&&(ri=!0),0},Ni="undefined",Ri=1<<31,Mi={}.hasOwnProperty,zi=[],Di=zi.pop,Bi=zi.push,Pi=zi.push,Ii=zi.slice,Li=zi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Hi="[\\x20\\t\\r\\n\\f]",Fi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Vi="\\[[\\x20\\t\\r\\n\\f]*("+Fi+")(?:"+Hi+"*([*^$|!~]?=)"+Hi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Fi+"))|)"+Hi+"*\\]",ji=":("+Fi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Vi+")*)|.*)\\)|)",Ui=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),Wi=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),qi=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),$i=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),Gi=new RegExp(ji),Xi=new RegExp("^"+Fi+"$"),Ki={ID:new RegExp("^#("+Fi+")"),CLASS:new RegExp("^\\.("+Fi+")"),TAG:new RegExp("^("+Fi+"|[*])"),ATTR:new RegExp("^"+Vi),PSEUDO:new RegExp("^"+ji),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Yi=/^(?:input|select|textarea|button)$/i,Ji=/^h\d$/i,Qi=/^[^{]+\{\s*\[native \w/,Zi=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tu=/[+~]/,eu=/'|\\/g,nu=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ru=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Pi.apply(zi=Ii.call(Si.childNodes),Si.childNodes),zi[Si.childNodes.length].nodeType}catch(t){Pi={apply:zi.length?function(t,e){Bi.apply(t,Ii.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var ou=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Si)!==ii&&oi(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||ii).nodeType)&&9!==a)return[];if(ai&&!r){if(o=Zi.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&li(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Pi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&Xo.getElementsByClassName)return Pi.apply(n,e.getElementsByClassName(u)),n}if(Xo.qsa&&(!ci||!ci.test(t))){if(f=l=Ci,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Qo(t),(l=e.getAttribute("id"))?f=l.replace(eu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+fu(s[c]);d=tu.test(t)&&su(e.parentNode)||e,m=s.join(",")}if(m)try{return Pi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return ti(t.replace(Ui,"$1"),e,n,r)};function iu(){var t=[];return function e(n,r){return t.push(n+" ")>Ko.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function uu(t){return t[Ci]=!0,t}function au(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Ri)-(~t.sourceIndex||Ri);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function cu(t){return uu((function(e){return e=+e,uu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function su(t){return t&&typeof t.getElementsByTagName!==Ni&&t}function lu(){}function fu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function du(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Oi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[ki,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Ci]||(e[Ci]={}))[r])&&a[0]===ki&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function mu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function gu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function hu(t,e,n,r,o,i){return r&&!r[Ci]&&(r=hu(r)),o&&!o[Ci]&&(o=hu(o,i)),uu((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ou(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:gu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=gu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?Li.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=gu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Pi.apply(u,v)}))}function pu(t){for(var e,n,r,o=t.length,i=Ko.relative[t[0].type],u=i||Ko.relative[" "],a=i?1:0,c=du((function(t){return t===e}),u,!0),s=du((function(t){return Li.call(e,t)>-1}),u,!0),l=[function(t,n,r){return!i&&(r||n!==ei)||((e=n).nodeType?c(t,n,r):s(t,n,r))}];a<o;a++)if(n=Ko.relative[t[a].type])l=[du(mu(l),n)];else{if((n=Ko.filter[t[a].type].apply(null,t[a].matches))[Ci]){for(r=++a;r<o&&!Ko.relative[t[r].type];r++);return hu(a>1&&mu(l),a>1&&fu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Ui,"$1"),n,a<r&&pu(t.slice(a,r)),r<o&&pu(t=t.slice(r)),r<o&&fu(t))}l.push(n)}return mu(l)}Xo=ou.support={},Jo=ou.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},oi=ou.setDocument=function(t){var e,n=t?t.ownerDocument||t:Si,r=n.defaultView;return n!==ii&&9===n.nodeType&&n.documentElement?(ii=n,ui=n.documentElement,ai=!Jo(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){oi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){oi()}))),Xo.attributes=!0,Xo.getElementsByTagName=!0,Xo.getElementsByClassName=Qi.test(n.getElementsByClassName),Xo.getById=!0,Ko.find.ID=function(t,e){if(typeof e.getElementById!==Ni&&ai){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Ko.filter.ID=function(t){var e=t.replace(nu,ru);return function(t){return t.getAttribute("id")===e}},Ko.find.TAG=Xo.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Ni)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Ko.find.CLASS=Xo.getElementsByClassName&&function(t,e){if(ai)return e.getElementsByClassName(t)},si=[],ci=[],Xo.disconnectedMatch=!0,ci=ci.length&&new RegExp(ci.join("|")),si=si.length&&new RegExp(si.join("|")),e=Qi.test(ui.compareDocumentPosition),li=e||Qi.test(ui.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ai=e?function(t,e){if(t===e)return ri=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Xo.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Si&&li(Si,t)?-1:e===n||e.ownerDocument===Si&&li(Si,e)?1:ni?Li.call(ni,t)-Li.call(ni,e):0:4&r?-1:1)}:function(t,e){if(t===e)return ri=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:ni?Li.call(ni,t)-Li.call(ni,e):0;if(i===u)return au(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?au(a[o],c[o]):a[o]===Si?-1:c[o]===Si?1:0},n):ii},ou.matches=function(t,e){return ou(t,null,null,e)},ou.matchesSelector=function(t,e){if((t.ownerDocument||t)!==ii&&oi(t),e=e.replace($i,"='$1']"),Xo.matchesSelector&&ai&&(!si||!si.test(e))&&(!ci||!ci.test(e)))try{var n=(void 0).call(t,e);if(n||Xo.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return ou(e,ii,null,[t]).length>0},ou.contains=function(t,e){return(t.ownerDocument||t)!==ii&&oi(t),li(t,e)},ou.attr=function(t,e){(t.ownerDocument||t)!==ii&&oi(t);var n=Ko.attrHandle[e.toLowerCase()],r=n&&Mi.call(Ko.attrHandle,e.toLowerCase())?n(t,e,!ai):void 0;return void 0!==r?r:Xo.attributes||!ai?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},ou.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ou.uniqueSort=function(t){var e,n=[],r=0,o=0;if(ri=!Xo.detectDuplicates,ni=!Xo.sortStable&&t.slice(0),t.sort(Ai),ri){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return ni=null,t},Yo=ou.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Yo(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Yo(e);return n},(Ko=ou.selectors={cacheLength:50,createPseudo:uu,match:Ki,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(nu,ru),t[3]=(t[3]||t[4]||t[5]||"").replace(nu,ru),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ou.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ou.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Ki.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Gi.test(n)&&(e=Qo(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(nu,ru).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Ti[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+Hi+"|$)"))&&Ti(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Ni&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=ou.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[Ci]||(p[Ci]={}))[t]||[])[0]===ki&&s[1],d=s[0]===ki&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[ki,m,d];break}}else if(b&&(s=(e[Ci]||(e[Ci]={}))[t])&&s[0]===ki)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ci]||(f[Ci]={}))[t]=[ki,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Ko.pseudos[t]||Ko.setFilters[t.toLowerCase()]||ou.error("unsupported pseudo: "+t);return r[Ci]?r(e):r.length>1?(n=[t,t,"",e],Ko.setFilters.hasOwnProperty(t.toLowerCase())?uu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Li.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:uu((function(t){var e=[],n=[],r=Zo(t.replace(Ui,"$1"));return r[Ci]?uu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:uu((function(t){return function(e){return ou(t,e).length>0}})),contains:uu((function(t){return t=t.replace(nu,ru),function(e){return(e.textContent||e.innerText||Yo(e)).indexOf(t)>-1}})),lang:uu((function(t){return Xi.test(t||"")||ou.error("unsupported lang: "+t),t=t.replace(nu,ru).toLowerCase(),function(e){var n;do{if(n=ai?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===ui},focus:function(t){return t===ii.activeElement&&(!ii.hasFocus||ii.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Ko.pseudos.empty(t)},header:function(t){return Ji.test(t.nodeName)},input:function(t){return Yi.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:cu((function(){return[0]})),last:cu((function(t,e){return[e-1]})),eq:cu((function(t,e,n){return[n<0?n+e:n]})),even:cu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:cu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:cu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:cu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Ko.pseudos.eq,j(["radio","checkbox","file","password","image"],(function(t){Ko.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),j(["submit","reset"],(function(t){Ko.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),lu.prototype=Ko.filters=Ko.pseudos,Ko.setFilters=new lu,Qo=ou.tokenize=function(t,e){var n,r,o,i,u,a,c,s=_i[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=Ko.preFilter;u;){for(i in n&&!(r=Wi.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=qi.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Ui," ")}),u=u.slice(n.length)),Ko.filter)Ko.filter.hasOwnProperty(i)&&(!(r=Ki[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?ou.error(t):_i(t,a).slice(0)},Zo=ou.compile=function(t,e){var n,r=[],o=[],i=Ei[t+" "];if(!i){for(e||(e=Qo(t)),n=e.length;n--;)(i=pu(e[n]))[Ci]?r.push(i):o.push(i);(i=Ei(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=ei,v=o||r&&Ko.find.TAG("*",c),b=ki+=null==p?1:Math.random()||.1,y=v.length;for(c&&(ei=i!==ii&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(ki=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Di.call(a));h=gu(h)}Pi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&ou.uniqueSort(a)}return c&&(ki=b,ei=p),g};return n?uu(o):o}(o,r))).selector=t}return i},ti=ou.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Qo(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&Xo.getById&&9===e.nodeType&&ai&&Ko.relative[i[1].type]){if(!(e=(Ko.find.ID(u.matches[0].replace(nu,ru),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=Ki.needsContext.test(t)?0:i.length;o--&&(u=i[o],!Ko.relative[a=u.type]);)if((c=Ko.find[a])&&(r=c(u.matches[0].replace(nu,ru),tu.test(i[0].type)&&su(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&fu(i)))return Pi.apply(n,r),n;break}}return(s||Zo(t,l))(r,e,!ai,n,tu.test(t)&&su(e.parentNode)||e),n},Xo.sortStable=Ci.split("").sort(Ai).join("")===Ci,Xo.detectDuplicates=!!ri,oi(),Xo.sortDetached=!0;var vu=document,bu=Array.prototype.push,yu=Array.prototype.slice,wu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,xu=xi.Event,Cu=xe.makeMap("children,contents,next,prev"),Su=function(t){return void 0!==t},ku=function(t){return"string"==typeof t},Ou=function(t,e){var n,r=(e=e||vu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Tu=function(t,e,n,r){var o;if(ku(e))e=Ou(e,Fu(t[0]));else if(e.length&&!e.nodeType){if(e=Wu.makeArray(e),r)for(o=e.length-1;o>=0;o--)Tu(t,e[o],n,r);else for(o=0;o<e.length;o++)Tu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},_u=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Eu=function(t,e,n){var r,o;return e=Wu(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Au=xe.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Nu=xe.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ru={for:"htmlFor",class:"className",readonly:"readOnly"},Mu={float:"cssFloat"},zu={},Du={},Bu=function(t,e){return new Wu.fn.init(t,e)},Pu=/^\s*|\s*$/g,Iu=function(t){return null==t?"":(""+t).replace(Pu,"")},Lu=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Hu=function(t,e){var n=[];return Lu(t,(function(t,r){e(r,t)&&n.push(r)})),n},Fu=function(t){return t?9===t.nodeType?t:t.ownerDocument:vu};Bu.fn=Bu.prototype={constructor:Bu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return Wu(t).attr(e);o.context=e=document}if(ku(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:wu.exec(t)))return Wu(e).find(t);if(n[1])for(r=Ou(t,Fu(e)).firstChild;r;)bu.call(o,r),r=r.nextSibling;else{if(!(r=Fu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return xe.toArray(this)},add:function(t,e){var n,r,o=this;if(ku(t))return o.add(Wu(t));if(!1!==e)for(n=Wu.unique(o.toArray().concat(Wu.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else bu.apply(o,Wu.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)Lu(t,(function(t,e){r.attr(t,e)}));else{if(!Su(e)){if(r[0]&&1===r[0].nodeType){if((n=zu[t])&&n.get)return n.get(r[0],t);if(Nu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=zu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ru[t]||t))Lu(t,(function(t,e){n.prop(t,e)}));else{if(!Su(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)Lu(t,(function(t,e){o.css(t,e)}));else if(Su(e))t=i(t),"number"!=typeof e||Au[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Du[t])&&r.set)r.set(this,e);else{try{this.style[Mu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Du[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],xu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if(Su(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){Wu(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(Su(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Wu(t).append(this),this},prependTo:function(t){return Wu(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Eu(this,t)},wrapAll:function(t){return Eu(this,t,!0)},wrapInner:function(t){return this.each((function(){Wu(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Wu(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Wu(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?Lu(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=_u(r,t);if(o!==e){var i=r.className;o?r.className=Iu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return _u(this[0],t)},each:function(t){return Lu(this,t)},on:function(t,e){return this.each((function(){xu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){xu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?xu.fire(this,t.type,t):xu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Wu(yu.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Wu.find(t,this[e],r);return Wu(r)},filter:function(t){return Wu("function"==typeof t?Hu(this.toArray(),(function(e,n){return t(n,e)})):Wu.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Wu&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Wu(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Wu(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:bu,sort:Array.prototype.sort,splice:Array.prototype.splice},xe.extend(Bu,{extend:xe.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:xe.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:xe.isArray,each:Lu,trim:Iu,grep:Hu,find:ou,expr:ou.selectors,unique:ou.uniqueSort,text:ou.getText,contains:ou.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?Wu.find.matchesSelector(e[0],t)?[e[0]]:[]:Wu.find.matches(t,e)}});var Vu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Wu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Wu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},ju=function(t,e,n,r){var o=[];for(r instanceof Wu&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Wu(t).is(r))break}o.push(t)}return o},Uu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Lu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Vu(t,"parentNode")},next:function(t){return Uu(t,"nextSibling",1)},prev:function(t){return Uu(t,"previousSibling",1)},children:function(t){return ju(t.firstChild,"nextSibling",1)},contents:function(t){return xe.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Bu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Wu.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Cu[t]||(r=Wu.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Wu(r);return n?o.filter(n):o}})),Lu({parentsUntil:function(t,e){return Vu(t,"parentNode",e)},nextUntil:function(t,e){return ju(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return ju(t,"previousSibling",1,e).slice(1)}},(function(t,e){Bu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Wu.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Wu.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Wu(o);return r?i.filter(r):i}})),Bu.fn.is=function(t){return!!t&&this.filter(t).length>0},Bu.fn.init.prototype=Bu.fn,Bu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Wu.extend(n,this),n},Bu.attrHooks=zu,Bu.cssHooks=Du;var Wu=Bu,qu=xe.each,$u=xe.grep,Gu=pe.ie,Xu=/^([a-z0-9],?)+$/i,Ku=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Yu=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function Ju(t,e){var n=this;void 0===e&&(e={});var r={},o=window,i={},u=0,a=Er.forElement(Te(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],l=e.schema?e.schema:Go({}),f=di({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new xi:xi.Event,m=l.getBlockElements(),g=Wu.overrideDefaults((function(){return{context:t,element:W.getRoot()}})),h=function(e){return e&&t&&O(e)?t.getElementById(e):e},p=function(t){return g("string"==typeof t?h(t):t)},v=function(t,e,n){var r,o,i=p(t);return i.length&&(o=(r=q[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=h(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=p(t),i=o.attr(n);if(o.length){var u=q[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return function(t,e,n){var r,o,i=0,u=0,a=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Kn(Te(t),"position"))return{x:i=(o=e.getBoundingClientRect()).left+(a.documentElement.scrollLeft||t.scrollLeft)-a.documentElement.clientLeft,y:u=o.top+(a.documentElement.scrollTop||t.scrollTop)-a.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!er(r,n);)i+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!er(r,n);)i-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=function(t){return Zn.isFirefox()&&"table"===Me(t)?tr(Ge(t)).filter((function(t){return"caption"===Me(t)})).bind((function(t){return tr($e(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Te(e))}return{x:i,y:u}}(t.body,h(e),n)},C=function(t,e,n){var r=p(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=pe.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},S=function(t){var e,n;return t=h(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Xu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return ou(e,i[0].ownerDocument||i[0],null,i).length>0},T=function(t,e,n,r){var o,i=[],u=h(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),xe.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return k(t,o)});u&&!(u===n||R(u.nodeType)||Dn(u)||Bn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},E=function(t,e,r){var o,i="string"==typeof t?h(t):t;if(!i)return!1;if(xe.isArray(i)&&(i.length||0===i.length))return o=[],qu(i,(function(t,n){t&&o.push(e.call(r,"string"==typeof t?h(t):t,n))})),o;var u=r||n;return e.call(u,i)},A=function(t,e){p(t).each((function(t,n){qu(e,(function(t,e){y(n,e,t)}))}))},N=function(t,e){var n=p(t);Gu?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Wu("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},M=function(e,n,r,o,i){return E(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&N(u,o)),i?u:e.appendChild(u)}))},z=function(e,n,r){return M(t.createElement(e),e,n,r,!0)},D=Io.encodeAllRaw,B=function(t,e){var n=p(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){p(t).toggleClass(e,n).each((function(){""===this.className&&Wu(this).attr("class",null)}))},I=function(t,e,n){return E(e,(function(e){return xe.is(e,"array")&&(t=t.cloneNode(!0)),n&&qu($u(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(kn(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,r,i,u){if(xe.isArray(n)){for(var a=n.length,c=[];a--;)c[a]=F(n[a],r,i,u);return c}return!e.collect||n!==t&&n!==o||s.push([n,r,i,u]),d.bind(n,r,i,u||W)},V=function(e,n,r){if(xe.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,r);return u}if(s.length>0&&(e===t||e===o))for(i=s.length;i--;){var a=s[i];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||d.unbind(a[0],a[1],a[2])}return d.unbind(e,n,r)},U=function(t){if(t&&kn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},W={doc:t,settings:e,win:o,files:i,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:s,styles:f,schema:l,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:g,$$:p,root:null,clone:function(e,n){if(!Gu||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return qu(b(e),(function(t){y(r,t.nodeName,v(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=xn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=h(t);var e=x(t),n=S(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:S,getParent:function(t,e,n){var r=T(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:T,get:h,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return ou(n,h(r)||e.root_element||t,[])},is:k,add:M,create:z,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+D(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=O(n)?p(t).css(n,r):p(t).css(n);e.update_styles&&Ku(f,o)},getStyle:C,setStyles:function(t,n){var r=p(t).css(n);e.update_styles&&Ku(f,r)},removeAllAttribs:function(t){return E(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(t){return f.parse(t)},serializeStyle:function(t,e){return f.serialize(t,e)},addStyle:function(e){var n,o;if(W!==Ju.DOM&&t===document){if(r[e])return;r[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(n=t.getElementsByTagName("head")[0]).firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),j(t.split(","),(function(t){i[t]=!0,a.load(t,c)}))},addClass:function(t,e){p(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return p(t).hasClass(e)},toggleClass:P,show:function(t){p(t).show()},hide:function(t){p(t).hide()},isHidden:function(t){return"none"===p(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?h(t):t;return kn(e)?e.outerHTML:Wu("<div></div>").append(Wu(e).clone()).html()},setOuterHTML:function(t,e){p(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Wu(this).html(e),!0)}))},decode:Io.decode,encode:D,insertAfter:function(t,e){var n=h(e);return E(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=z(e),qu(b(t),(function(e){y(n,e.nodeName,v(t,e.nodeName))})),I(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return f.toHex(xe.trim(t))},run:E,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Ar(t,t.parentNode),u=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,kn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!ho(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&ho(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:Yu,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,Yu(t)),u.setEnd(e.parentNode,Yu(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,Yu(e)+1),u.setEnd(t.parentNode,Yu(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(So(W,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(So(W,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:U,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=U(t));t=t.parentNode);return n},destroy:function(){if(s.length>0)for(var t=s.length;t--;){var e=s[t];d.unbind(e[0],e[1],e[2])}it(i,(function(t,e){a.unload(e),delete i[e]})),ou.setDocument&&ou.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},q=function(t,e,n){var r=e.keep_values,o={set:function(t,n,r){e.url_converter&&(n=e.url_converter.call(e.url_converter_scope||W,n,r,t[0])),t.attr("data-mce-"+r,n).attr(r,n)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(f,e);return W}!function(t){t.DOM=t(document),t.nodeIndex=Yu}(Ju||(Ju={}));var Qu=Ju,Zu=Qu.DOM,ta=xe.each,ea=xe.grep,na=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=Zu,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=xe._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),z(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ta(o.scriptLoadedCallbacks[e],(function(e){z(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=ea(t);if(t.length=0,ta(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ta(n,(function(t){0===i.length?z(t.success)&&t.success.call(t.scope):z(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),ra=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},oa={},ia=ra("en"),ua=function(){return dt(oa,ia.get())},aa={getData:function(){return ut(oa,(function(t){return St({},t)}))},setCode:function(t){t&&ia.set(t)},getCode:function(){return ia.get()},add:function(t,e){var n=oa[t];n||(oa[t]=n={}),it(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=ua().getOr({}),r=function(t){return z(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return dt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(T(e=t)&&mt(e,"raw"))return r(t.raw);if(function(t){return _(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return mt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return ua().bind((function(t){return dt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return mt(oa,t)}};function ca(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=W(o,(function(n){return n.name===t&&n.state===e}));j(n,(function(t){return t.callback()}))},u=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},c=function(t,e,o,s,l){if(!n[t]){var f="string"==typeof e?e:e.prefix+e.resource+e.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ca.baseURL+"/"+f),n[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){i(t,"loaded"),function(t,e,n,r){var o=u(t);j(o,(function(t){var n=a(e,t);c(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(na))}(t,e,o,s)};r[t]?d():na.ScriptLoader.add(f,d,s,l)}},s=function(t,e,i){void 0===i&&(i="added"),mt(r,t)&&"added"===i||mt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){if(r[t])return r[t].instance},dependencies:u,requireLangPack:function(t,e){!1!==ca.languageLoad&&s(t,(function(){var r=aa.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||na.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},add:function(t,n,o){var u=n;return e.push(u),r[t]={instance:u,dependencies:o},i(t,"added"),u},remove:function(t){delete n[t],delete r[t]},createUrl:a,addComponents:function(e,n){var r=t.urls[e];j(n,(function(t){na.ScriptLoader.add(r+"/"+t)}))},load:c,waitFor:s}}!function(t){t.PluginManager=t(),t.ThemeManager=t()}(ca||(ca={}));var sa=ca,la=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null===n&&(n=setTimeout((function(){t.apply(null,r),n=null}),e))}}},fa=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},da=function(t,e){var n=$n(t,e);return void 0===n||""===n?[]:n.split(" ")},ma=function(t){return void 0!==t.dom.classList},ga=function(t,e){ma(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=da(t,e).concat([n]);Wn(t,e,r.join(" "))})(t,"class",e)}(t,e)},ha=function(t,e){return ma(t)&&t.dom.classList.contains(e)},pa=function(t,e){var n=[];return j(Ge(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(pa(t,e))})),n},va=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?[]:V(n.querySelectorAll(t),Te)}(e,t)},ba=l("mce-annotation"),ya=l("data-mce-annotation"),wa=l("data-mce-annotation-uid"),xa=function(t,e){var n=t.selection.getRng(),r=Te(n.startContainer),o=Te(t.getBody()),i=e.fold((function(){return"."+ba()}),(function(t){return"["+ya()+'="'+t+'"]'})),u=Xe(r,n.startOffset).getOr(r),a=xr(u,i,(function(t){return Ne(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?x.some($n(t,e)):x.none()};return a.bind((function(e){return c(e,""+wa()).bind((function(n){return c(e,""+ya()).map((function(e){var r=Ca(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ca=function(t,e){var n=Te(t.getBody());return va(n,"["+wa()+'="'+e+'"]')},Sa=0,ka=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Sa+String(e)},Oa=function(t,e){var n,r,o=He(t).dom,i=Te(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ge(Te(r)));cn(i,u),sn(t),an(t,i)},Ta=function(t,e){return Te(t.dom.cloneNode(e))},_a=function(t){return Ta(t,!1)},Ea=function(t){return Ta(t,!0)},Aa=function(t,e,n){void 0===n&&(n=p);var r=new Ar(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Mn(e)&&!n(e));return x.from(e).filter(Mn)};return{current:function(){return x.from(r.current()).filter(Mn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Na=function(t,e){var n=e||function(e){return t.isBlock(e)||Pn(e)||Hn(e)},r=function(t,e,n,o){if(Mn(t)){var i=o(t,e,t.data);if(-1!==i)return x.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Ra=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},Ma=Math.round,za=function(t){return t?{left:Ma(t.left),top:Ma(t.top),bottom:Ma(t.bottom),right:Ma(t.right),width:Ma(t.width),height:Ma(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Da=function(t,e){return t=za(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Ba=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Pa=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Ba(e.top-t.bottom,t,e)},Ia=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Ba(e.bottom-t.top,t,e)},La=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ha=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Fa=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},Va=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),ja=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Va.test(t)},Ua=kn,Wa=lo,qa=Tn("display","block table"),$a=Tn("float","left right"),Ga=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Ua,Wa,m($a)),Xa=m(Tn("white-space","pre pre-line pre-wrap")),Ka=Mn,Ya=Pn,Ja=Qu.nodeIndex,Qa=Fa,Za=function(t){return"createRange"in t?t.createRange():Qu.DOM.createRng()},tc=function(t){return t&&/[\r\n\t ]/.test(t)},ec=function(t){return!!t.setStart&&!!t.setEnd},nc=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(tc(t.toString())&&Xa(n.parentNode)&&Mn(n)&&(e=n.data,tc(e[r-1])||tc(e[r+1])))},rc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},oc=function(t){var e,n=t.getClientRects();return e=n.length>0?za(n[0]):za(t.getBoundingClientRect()),!ec(t)&&Ya(t)&&rc(e)?function(t){var e=t.ownerDocument,n=Za(e),r=e.createTextNode(Vr),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=za(n.getBoundingClientRect());return o.removeChild(r),i}(t):rc(e)&&ec(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Mn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),oc(i)}return null}(t):e},ic=function(t,e){var n=Da(t,e);return n.width=1,n.right=n.left+1,n};function uc(t,e,n){var r=function(){return n||(n=function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(r.length>0&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=Za(t.ownerDocument);if(e<t.data.length){if(ja(t.data[e]))return r;if(ja(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!nc(n)))return o(ic(oc(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),nc(n)||o(ic(oc(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),nc(n)||o(ic(oc(n),!0)))};if(Ka(t.container()))return i(t.container(),t.offset()),r;if(Ua(t.container()))if(t.isAtEnd())n=Qa(t.container(),t.offset()),Ka(n)&&i(n,n.data.length),Ga(n)&&!Ya(n)&&o(ic(oc(n),!1));else{if(n=Qa(t.container(),t.offset()),Ka(n)&&i(n,0),Ga(n)&&t.isAtEnd())return o(ic(oc(n),!1)),r;e=Qa(t.container(),t.offset()-1),Ga(e)&&!Ya(e)&&(qa(e)||qa(n)||!Ga(n))&&o(ic(oc(e),!1)),Ga(n)&&o(ic(oc(n),!0))}return r}(uc(t,e))),n};return{container:l(t),offset:l(e),toRange:function(){var n=Za(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Ka(t),0===e},isAtEnd:function(){return Ka(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return Qa(t,n?e-1:e)}}}!function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,Ja(e)+1)},t.before=function(e){return t(e.parentNode,Ja(e))},t.isAbove=function(t,e){return Ra(tt(e.getClientRects()),et(t.getClientRects()),Pa).getOr(!1)},t.isBelow=function(t,e){return Ra(et(e.getClientRects()),tt(t.getClientRects()),Ia).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&Mn(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}}(uc||(uc={}));var ac,cc=uc,sc=function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)},lc=function(t,e,n){Bn(n)?function(t,e,n){var r=x.from(n.firstChild),o=x.from(n.lastChild);e.insertNode(n),r.each((function(e){return sc(t,e.previousSibling)})),o.each((function(e){return sc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),sc(t,n.previousSibling),sc(t,n.nextSibling)}(t,e,n)},fc=Mn,dc=En,mc=Qu.nodeIndex,gc=function(t){var e=t.parentNode;return dc(e)?gc(e):e},hc=function(t){return t?wt(t.childNodes,(function(t,e){return dc(e)&&"BR"!==e.nodeName?t=t.concat(hc(e)):t.push(e),t}),[]):[]},pc=function(t){return function(e){return t===e}},vc=function(t){return(fc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=hc(gc(t)),n=xt(e,pc(t),t),e=e.slice(0,n+1);var r=wt(e,(function(t,n,r){return fc(n)&&fc(e[r-1])&&t++,t}),0);return e=bt(e,On([t.nodeName])),(n=xt(e,pc(t),t))-r}(t)+"]"},bc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),fc(n)?o=function(t,e){for(;(t=t.previousSibling)&&fc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(vc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode)r.push(e);return r}(t,n),u=bt(u,m(En)),(a=a.concat(vt(u,(function(t){return vc(t)})))).reverse().join("/")+","+o},yc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=wt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=hc(t);return r=bt(r,(function(t,e){return!fc(t)||!fc(r[e-1])})),(r=bt(r,On([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?fc(i)?function(t,e){for(var n,r=t,o=0;fc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!fc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return fc(t)&&e>t.data.length&&(e=t.data.length),cc(t,e)}(i,parseInt(n,10)):(n="after"===n?mc(i)+1:mc(i),cc(i.parentNode,n)):null},wc=Hn,xc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Mn(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Mn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Cc=function(t,e,n){var r=0;return xe.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Sc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],kn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},kc=function(t){return Sc(t,!0),Sc(t,!1),t},Oc=function(t,e){var n;if(kn(t)&&(t=Fa(t,e),wc(t)))return t;if(Kr(t)){if(Mn(t)&&Gr(t)&&(t=t.parentNode),n=t.previousSibling,wc(n))return n;if(n=t.nextSibling,wc(n))return n}},Tc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(wc(r)||"IMG"===o)return{name:o,index:Cc(n.dom,o,r)};var u=function(t){return Oc(t.startContainer,t.startOffset)||Oc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Cc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=xc(o,t,n,r,!0),e.isCollapsed()||(i.end=xc(o,t,n,r,!1)),i}(t,n,e,i)},_c=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},Ec=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Cc(n,a,u)};var c=kc(r.cloneRange());if(!i){c.collapse(!1);var s=_c(n,o+"_end",e);lc(n,c,s)}(r=kc(r)).collapse(!0);var l=_c(n,o+"_start",e);return lc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Ac=d(Tc,f,!0),Nc=Qu.DOM,Rc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},Mc=function(t){return t.getParam("content_security_policy","")},zc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Dc=function(t){return t.getParam("forced_root_block_attrs",{})},Bc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Pc=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Ic=function(t){return t.getParam("icons","","string")},Lc=function(t){return t.getParam("images_upload_url","","string")},Hc=function(t){return t.getParam("images_upload_base_path","","string")},Fc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Vc=function(t){return t.getParam("images_upload_handler",null,"function")},jc=function(t){return t.getParam("content_css_cors",!1,"boolean")},Uc=function(t){return t.getParam("referrer_policy","","string")},Wc=function(t){return t.getParam("language","en","string")},qc=function(t){return t.getParam("indent_use_margin",!1)},$c=function(t){var e=t.getParam("object_resizing");return!1!==e&&!pe.iOS&&(O(e)?e:"table,img,figure.image,div")},Gc=function(t){return t.getParam("event_root")},Xc=function(t){return t.getParam("theme")},Kc=function(t){return t.getParam("validate")},Yc=function(t){return!1!==t.getParam("inline_boundaries")},Jc=function(t){return t.getParam("content_css_cors")},Qc=function(t){return t.getParam("plugins","","string")},Zc=kn,ts=Mn,es=function(t){var e=t.parentNode;e&&e.removeChild(t)},ns=function(t){var e=Wr(t);return{count:t.length-e.length,text:e}},rs=function(t){for(var e;-1!==(e=t.data.lastIndexOf(jr));)t.deleteData(e,1)},os=function(t,e){return us(t),e},is=function(t,e){return cc.isTextPosition(e)?function(t,e){return ts(t)&&e.container()===t?function(t,e){var n=ns(t.data.substr(0,e.offset())),r=ns(t.data.substr(e.offset()));return(n.text+r.text).length>0?(rs(t),cc(t,e.offset()-n.count)):e}(t,e):os(t,e)}(t,e):function(t,e){return e.container()===t.parentNode?function(t,e){var n=e.container(),r=function(t,e){var n=L(t,e);return-1===n?x.none():x.some(n)}(nt(n.childNodes),t).map((function(t){return t<e.offset()?cc(n,e.offset()-1):e})).getOr(e);return us(t),r}(t,e):os(t,e)}(t,e)},us=function(t){Zc(t)&&Kr(t)&&(Yr(t)?t.removeAttribute("data-mce-caret"):es(t)),ts(t)&&(rs(t),0===t.data.length&&es(t))},as=ae().browser,cs=Hn,ss=Vn,ls=Fn,fs=function(t,e,n){var r,o,i,u,a,c=Da(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(a=t.getBoundingClientRect(),o=t.scrollLeft-a.left,i=t.scrollTop-a.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,(u=e.offsetWidth-e.clientWidth)>0&&(n&&(u*=-1),c.left+=u,c.right+=u),c},ds=function(t,e,n,r){var o,i,u=ra(x.none()),a=zc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=va(Te(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;to(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Zr(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(us(i),i=null),u.get().each((function(t){Wu(t.caret).remove(),u.set(x.none())})),o&&(Tr.clearInterval(o),o=null)};return{show:function(t,a){var l,f;if(s(),ls(a))return null;if(!n(a))return i=function(t,e){var n,r=t.ownerDocument.createTextNode(jr),o=t.parentNode;if(e){if(n=t.previousSibling,$r(n)){if(Kr(n))return n;if(to(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,$r(n)){if(Kr(n))return n;if(Zr(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(a,t),f=a.ownerDocument.createRange(),gs(i.nextSibling)?(f.setStart(i,0),f.setEnd(i,0)):(f.setStart(i,1),f.setEnd(i,1)),f;i=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o}(c,a,t),l=fs(e,a,t),Wu(i).css("top",l.top);var d=Wu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(e)[0];return u.set(x.some({caret:d,element:a,before:t})),u.get().each((function(e){t&&Wu(e.caret).addClass("mce-visual-caret-before")})),o=Tr.setInterval((function(){r()?Wu("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Wu("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500),(f=a.ownerDocument.createRange()).setStart(i,0),f.setEnd(i,0),f},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.get().each((function(t){var n=fs(e,t.element,t.before);Wu(t.caret).css(St({},n))}))},destroy:function(){return Tr.clearInterval(o)}}},ms=function(){return as.isIE()||as.isEdge()||as.isFirefox()},gs=function(t){return cs(t)||ss(t)},hs=function(t){return gs(t)||An(t)&&ms()},ps=Hn,vs=Vn,bs=Tn("display","block table table-cell table-caption list-item"),ys=Kr,ws=Gr,xs=kn,Cs=lo,Ss=function(t){return t>0},ks=function(t){return t<0},Os=function(t,e){for(var n;n=t(e);)if(!ws(n))return n;return null},Ts=function(t,e,n,r,o){var i=new Ar(t,r),u=ps(t)||ws(t);if(ks(e)){if(u&&n(t=Os(i.prev,!0)))return t;for(;t=Os(i.prev,o);)if(n(t))return t}if(Ss(e)){if(u&&n(t=Os(i.next,!0)))return t;for(;t=Os(i.next,o);)if(n(t))return t}return null},_s=function(t,e){for(;t&&t!==e;){if(bs(t))return t;t=t.parentNode}return null},Es=function(t,e,n){return _s(t.container(),n)===_s(e.container(),n)},As=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return xs(n)?n.childNodes[r+t]:null},Ns=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Rs=function(t,e,n){return _s(e,t)===_s(n,t)},Ms=function(t,e,n){var r,o;for(o=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[o],ys(r)&&(r=r[o]),ps(r)||vs(r)){if(Rs(e,r,n))return r;break}if(Cs(r))break;n=n.parentNode}return null},zs=d(Ns,!0),Ds=d(Ns,!1),Bs=function(t,e,n){var r,o,i,u=d(Ms,!0,e),a=d(Ms,!1,e);o=n.startContainer;var c=n.startOffset;if(Gr(o)){if(xs(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,hs(r)))return zs(r);if("after"===i&&(r=o.previousSibling,hs(r)))return Ds(r)}if(!n.collapsed)return n;if(Mn(o)){if(ys(o)){if(1===t){if(r=a(o))return zs(r);if(r=u(o))return Ds(r)}if(-1===t){if(r=u(o))return Ds(r);if(r=a(o))return zs(r)}return n}if(to(o)&&c>=o.data.length-1)return 1===t&&(r=a(o))?zs(r):n;if(Zr(o)&&c<=1)return-1===t&&(r=u(o))?Ds(r):n;if(c===o.data.length)return(r=a(o))?zs(r):n;if(0===c)return(r=u(o))?Ds(r):n}return n},Ps=function(t,e){return x.from(As(t?0:-1,e)).filter(ps)},Is=function(t,e,n){var r=Bs(t,e,n);return-1===t?uc.fromRangeStart(r):uc.fromRangeEnd(r)},Ls=function(t){return x.from(t.getNode()).map(Te)},Hs=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Fs=function(t,e){var n=Es(t,e);return!(n||!Pn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(ac||(ac={}));var Vs=Hn,js=Mn,Us=kn,Ws=Pn,qs=lo,$s=function(t){return ao(t)||function(t){return!!fo(t)&&!0!==$(nt(t.getElementsByTagName("*")),(function(t,e){return t||no(e)}),!1)}(t)},Gs=mo,Xs=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Ks=function(t,e){if(Ss(t)){if(qs(e.previousSibling)&&!js(e.previousSibling))return cc.before(e);if(js(e))return cc(e,0)}if(ks(t)){if(qs(e.nextSibling)&&!js(e.nextSibling))return cc.after(e);if(js(e))return cc(e,e.data.length)}return ks(t)?Ws(e)?cc.before(e):cc.after(e):cc.before(e)},Ys=function(t,e,n){var r,o,i,u;if(!Us(n)||!e)return null;if(e.isEqual(cc.after(n))&&n.lastChild){if(u=cc.after(n.lastChild),ks(t)&&qs(n.lastChild)&&Us(n.lastChild))return Ws(n.lastChild)?cc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(js(a)){if(ks(t)&&c>0)return cc(a,--c);if(Ss(t)&&c<a.length)return cc(a,++c);r=a}else{if(ks(t)&&c>0&&(o=Xs(a,c-1),qs(o)))return!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,i.data.length):cc.after(i):js(o)?cc(o,o.data.length):cc.before(o);if(Ss(t)&&c<a.childNodes.length&&(o=Xs(a,c),qs(o)))return Ws(o)?function(t,e){var n=e.nextSibling;return n&&qs(n)?js(n)?cc(n,0):cc.before(n):Ys(ac.Forwards,cc.after(e),t)}(n,o):!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,0):cc.before(i):js(o)?cc(o,0):cc.after(o);r=o||u.getNode()}if((Ss(t)&&u.isAtEnd()||ks(t)&&u.isAtStart())&&(r=Ts(r,t,v,n,!0),Gs(r,n)))return Ks(t,r);o=Ts(r,t,Gs,n);var s=Ct(W(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),Vs));return!s||o&&s.contains(o)?o?Ks(t,o):null:u=Ss(t)?cc.after(s):cc.before(s)},Js=function(t){return{next:function(e){return Ys(ac.Forwards,e,t)},prev:function(e){return Ys(ac.Backwards,e,t)}}},Qs=function(t){return cc.isTextPosition(t)?0===t.offset():lo(t.getNode())},Zs=function(t){if(cc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return lo(t.getNode(!0))},tl=function(t,e){return!cc.isTextPosition(t)&&!cc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},el=function(t,e,n){var r=Js(e);return x.from(t?r.next(n):r.prev(n))},nl=function(t,e,n){return el(t,e,n).bind((function(r){return Es(n,r,e)&&function(t,e,n){return t?!tl(e,n)&&(r=e,!(!cc.isTextPosition(r)&&Pn(r.getNode())))&&Zs(e)&&Qs(n):!tl(n,e)&&Qs(e)&&Zs(n);var r}(t,n,r)?el(t,e,r):x.some(r)}))},rl=function(t,e,n,r){return nl(t,e,n).bind((function(n){return r(n)?rl(t,e,n,r):x.some(n)}))},ol=function(t,e){var n,r=t?e.firstChild:e.lastChild;return Mn(r)?x.some(cc(r,t?0:r.data.length)):r?lo(r)?x.some(t?cc.before(r):Pn(n=r)?cc.before(n):cc.after(n)):function(t,e,n){var r=t?cc.before(n):cc.after(n);return el(t,e,r)}(t,e,r):x.none()},il=d(el,!0),ul=d(el,!1),al=d(ol,!0),cl=d(ol,!1),sl="_mce_caret",ll=function(t){return kn(t)&&t.id===sl},fl=function(t,e){for(;e&&e!==t;){if(e.id===sl)return e;e=e.parentNode}return null},dl=function(t,e){return kn(e)&&t.isBlock(e)&&!e.innerHTML&&!pe.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},ml=function(t,e){return cl(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},gl=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!fl(t,e)||(function(t,e){var n=t.ownerDocument.createTextNode(jr);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),0))},hl=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,gl(s,i,r))return!0;if(c[o]>a.length-1)return!!gl(s,i,r)||ml(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},pl=function(t){return Mn(t)&&t.data.length>0},vl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.nextSibling)?(r=s.nextSibling,o=0):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,xe.each(xe.grep(s.childNodes),(function(t){Mn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&Mn(u)&&!pe.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return x.some(cc(a,c))}return x.none()},bl=function(t,e,n){return function(t,e,n){return 2===e?Tc(Wr,n,t):3===e?function(t){var e=t.getRng();return{start:bc(t.dom.getRoot(),cc.fromRangeStart(e)),end:bc(t.dom.getRoot(),cc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Ec(t,!1)}(t,e,n)},yl=function(t,e){(function(t,e){var n=t.dom;if(e){if(function(t){return xe.isArray(t.start)}(e))return function(t,e){var n=t.createRng();return hl(t,!0,e,n)&&hl(t,!1,e,n)?x.some(n):x.none()}(n,e);if(function(t){return"string"==typeof t.start}(e))return x.some(function(t,e){var n,r=t.createRng();return n=yc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=yc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return t.hasOwnProperty("id")}(e))return function(t,e){var n=vl(t,"start",e),r=vl(t,"end",e);return Ra(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(dl(t,e.container()),e.offset()),r.setEnd(dl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return t.hasOwnProperty("name")}(e))return function(t,e){return x.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return t.hasOwnProperty("rng")}(e))return x.some(e.rng)}return x.none()})(t,e).each((function(e){t.setRng(e)}))},wl=function(t){return kn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},xl=(Vr,function(t){return" "===t}),Cl=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Sl=function(t){return!Cl(t)&&!xl(t)},kl=function(t){return!!t.nodeType},Ol=function(t,e,n){var r,o,i,u=n.startOffset,a=n.startContainer;if((n.startContainer!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===a.nodeType)for(u<(i=a.childNodes).length?(a=i[u],r=new Ar(a,t.getParent(a,t.isBlock))):(a=i[i.length-1],(r=new Ar(a,t.getParent(a,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Al(o))return n.setStart(o,0),void e.setRng(n)},Tl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Al(t))return t}},_l=function(t,e){return kl(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},El=function(t,e,n){return t.schema.isValidChild(e,n)},Al=function(t,e){if(void 0===e&&(e=!1),M(t)&&Mn(t)){var n=e?t.data.replace(/ /g," "):t.data;return ho(n)}return!1},Nl=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Rl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Ml=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},zl=function(t,e,n){return Ml(t,t.getStyle(e,n),n)},Dl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Bl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Pl=function(t){return gt(t,"block")},Il=function(t){return gt(t,"selector")},Ll=function(t){return gt(t,"inline")},Hl=wl,Fl=Bl,Vl=Al,jl=_l,Ul=function(t,e){for(var n=e;n;){if(kn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Wl=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},ql=function(t,e,n){return Wl(t,e,n,(function(t){return xl(t)||Cl(t)}))},$l=function(t,e,n){return Wl(t,e,n,Sl)},Gl=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Na(t),c=o?i.backwards:i.forwards;return x.from(c(e,n,(function(t,e){return Hl(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,ql).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),$l):x.some(t)})).orThunk((function(){return u?x.some({container:u,offset:o?0:u.length}):x.none()}))},Xl=function(t,e,n,r,o){Mn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Fl(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!("collapsed"in c)||c.collapsed===n.collapsed)&&t.is(i[u],c.selector))return i[u]}return r},Kl=function(t,e,n,r){var o,i=t.dom,u=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,u)),!o){var a=i.getParent(n,"LI,TD,TH");o=i.getParent(Mn(n)?n.parentNode:n,(function(e){return e!==u&&jl(t,e)}),a)}if(o&&e[0].wrapper&&(o=Fl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Rl(o,"br")););return o||n},Yl=function(t,e,n,r){var o=n.parentNode;return!M(n[r])&&(!(o!==e&&!R(o)&&!t.isBlock(o))||Yl(t,e,o,r))},Jl=function(t,e,n,r,o){var i,u,a=n,c=o?"previousSibling":"nextSibling",s=t.getRoot();if(Mn(n)&&!Vl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(i=a[c];i;i=i[c]){var l=Mn(i)&&!Yl(t,s,i,c);if(!Hl(i)&&(!Pn(u=i)||!u.getAttribute("data-mce-bogus")||u.nextSibling)&&!Vl(i,l))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n},Ql=function(t){return Hl(t.parentNode)||Hl(t)},Zl=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom;return kn(o)&&o.hasChildNodes()&&(o=Fa(o,i),Mn(o)&&(i=0)),kn(u)&&u.hasChildNodes()&&(u=Fa(u,e.collapsed?a:a-1),Mn(u)&&(a=u.nodeValue.length)),o=Ul(c,o),u=Ul(c,u),Ql(o)&&(o=Hl(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Mn(o)&&(i=e.collapsed?o.length:0)),Ql(u)&&(u=Hl(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,Mn(u)&&(a=e.collapsed?0:u.length)),e.collapsed&&(Gl(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Gl(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n}))),(n[0].inline||n[0].block_expand)&&(n[0].inline&&Mn(o)&&0!==i||(o=Jl(c,n,o,i,!0)),n[0].inline&&Mn(u)&&a!==u.nodeValue.length||(u=Jl(c,n,u,a,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=Xl(c,n,e,o,"previousSibling"),u=Xl(c,n,e,u,"nextSibling")),(n[0].block||n[0].selector)&&(o=Kl(t,n,o,"previousSibling"),u=Kl(t,n,u,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=Jl(c,n,o,i,!0)),c.isBlock(u)||(u=Jl(c,n,u,a,!1)))),kn(o)&&(i=c.nodeIndex(o),o=o.parentNode),kn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},tf=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},ef=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,u=e.endOffset,a=function(t){var e;return 3===(e=t[0]).nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===u&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=tf(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=tf(i,u-1)),r===i)return n(a([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=s(r,f)||r,g=s(i,f)||i;l(r,m,!0);var h=c(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);h.length&&n(a(h)),l(i,g)},nf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},rf=function(t,e){var n=va(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:function(t){return W(function(t){return K(t,(function(t){var e=Ha(t);return e?[Te(e)]:[]}))}(t),Hr)}(t)},of=function(t){return rf(nf(t.selection.getSel()),Te(t.getBody()))},uf=function(t){return Ke(t).fold(l([t]),(function(e){return[t].concat(uf(e))}))},af=function(t){return Ye(t).fold(l([t]),(function(e){return"br"===Me(e)?Ue(e).map((function(e){return[t].concat(af(e))})).getOr([]):[t].concat(af(e))}))},cf=function(t,e){return Ra(function(t){var e=t.startContainer,n=t.startOffset;return Mn(e)?0===n?x.some(Te(e)):x.none():x.from(e.childNodes[n]).map(Te)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Mn(e)?n===e.data.length?x.some(Te(e)):x.none():x.from(e.childNodes[n-1]).map(Te)}(e),(function(e,n){var r=G(uf(t),d(Ne,e)),o=G(af(t),d(Ne,n));return r.isSome()&&o.isSome()})).getOr(!1)},sf=function(t,e,n,r){var o=n,i=new Ar(n,o),u=ft(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!H(["td","th","table"],e.toLowerCase())}));do{if(Mn(n)&&0!==xe.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},lf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},ff=function(t,e){var n=of(t);n.length>0?j(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},df=function(t,e,n){var r=Ec(t,e);n(r),t.moveToBookmark(r)},mf=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(Pe),gf=function(t){return mf.get(t)},hf=function(t,e,n,r){var o=e.uid,i=void 0===o?ka("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=ke("span",t);ga(a,ba()),Wn(a,""+wa(),i),Wn(a,""+ya(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return qn(a,l),function(t,e){j(e,(function(e){ga(t,e)}))}(a,d),a},pf=function(t,e,n,r,o){var i=[],u=hf(t.getDoc(),o,n,r),a=ra(x.none()),c=function(){a.set(x.none())},s=function(t){j(t,l)},l=function(e){switch(function(t,e,n,r){return je(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Pe(t)&&gf(t)===jr}(e)?"valid":function(t){return Be(t)&&ha(t,ba())}(e)?"existing":ll(e.dom)?"caret":El(t,n,r)&&El(t,Me(o),n)?"valid":"invalid-child"}))}(t,e,"span",Me(e))){case"invalid-child":c();var n=Ge(e);s(n),c();break;case"valid":!function(t,e){rn(t,e),an(e,t)}(e,a.get().getOrThunk((function(){var t=_a(u);return i.push(t),a.set(x.some(t)),t})))}};return ef(t.dom,e,(function(t){c(),function(t){var e=V(t,Te);s(e)}(t)})),i},vf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?x.from(e[t]).map((function(t){return t.settings})):x.none()}});!function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){j(t,(function(t){(function(t){return x.from(t.attr(ya())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))}(t,n);var r=function(t,e){var n=ra({}),r=function(t,e){o(t,(function(t){return e(t),t}))},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:ra(x.none())});r[t]=o,n.set(r)},i=fa((function(){var e,i,u=n.get(),a=(e=rt(u),(i=B.call(e,0)).sort(void 0),i);j(a,(function(e){o(e,(function(n){var o=n.previous.get();return xa(t,x.some(e)).fold((function(){o.isSome()&&(function(t){r(t,(function(e){j(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.set(x.none()))}),(function(t){var e=t.uid,i=t.name,u=t.elements;o.is(e)||(function(t,e,n){r(t,(function(r){j(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:V(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(x.some(e)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()})),{addListener:function(t,e){o(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}}(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){!function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=of(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=Zl(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=hf(t.getDoc(),r,e,n.decorate);Oa(a,Vr),o.getRng().insertNode(a.dom),o.select(a.dom)}else df(o,!1,(function(){ff(t,(function(o){pf(t,o,e,n.decorate,r)}))}))}))}(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){xa(t,x.some(e)).each((function(t){var e=t.elements;j(e,fn)}))},getAll:function(e){var n=function(t,e){var n=Te(t.getBody()),r=va(n,"["+ya()+'="'+e+'"]'),o={};return j(r,(function(t){var e=$n(t,wa()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])})),o}(t,e);return ut(n,(function(t){return V(t,(function(t){return t.dom}))}))}}};function bf(t){return{getBookmark:d(bl,t),moveToBookmark:d(yl,t)}}!function(t){t.isBookmarkNode=wl}(bf||(bf={}));var yf=bf,wf=function(t,e){for(;e&&e!==t;){if(Ln(e)||Hn(e))return e;e=e.parentNode}return null},xf=function(t,e,n){if(n.collapsed)return!1;if(pe.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(kn(r))return F(r.getClientRects(),(function(n){return La(n,t,e)}))}return F(n.getClientRects(),(function(n){return La(n,t,e)}))},Cf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return pe.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Sf=Hn,kf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p=e.dom,v=xe.each,b=e.getDoc(),y=document,w=Math.abs,x=Math.round,C=e.getBody(),S={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},k=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},O=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return k(t.target)&&!xf(n.clientX,n.clientY,e)}return k(t.target)&&!xf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},T=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},_=function(t){var n=$c(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&Ee(Te(t),n)},E=function(t,e,n){p.setStyles(T(t),{width:e,height:n})},A=function(t){var v,b,y,S;v=t.screenX-u,b=t.screenY-a,d=v*i[2]+c,m=b*i[3]+s,d=d<5?5:d,m=m<5?5:m,(k(n)&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Cf.modifierPressed(t):Cf.modifierPressed(t))&&(w(v)>w(b)?(m=x(d*l),d=x(m/l)):(d=x(m/l),m=x(d*l))),E(r,d,m),y=(y=i.startPos.x+v)>0?y:0,S=(S=i.startPos.y+b)>0?S:0,p.setStyles(o,{left:y,top:S,display:"block"}),o.innerHTML=d+" × "+m,i[2]<0&&r.clientWidth<=d&&p.setStyle(r,"left",void 0+(c-d)),i[3]<0&&r.clientHeight<=m&&p.setStyle(r,"top",void 0+(s-m)),(v=C.scrollWidth-g)+(b=C.scrollHeight-h)!=0&&p.setStyles(o,{left:y-v,top:S-b}),f||(function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,c,s,"corner-"+i.name),f=!0)},N=function(){var t=f;f=!1;var u=function(t,r){r&&(n.style[t]||!e.schema.isValid(n.nodeName.toLowerCase(),t)?p.setStyle(T(n),t,r):p.setAttrib(T(n),t,""+r))};t&&(u("width",d),u("height",m)),p.unbind(b,"mousemove",A),p.unbind(b,"mouseup",N),y!==b&&(p.unbind(y,"mousemove",A),p.unbind(y,"mouseup",N)),p.remove(r),p.remove(o),R(n),t&&(function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,d,m,"corner-"+i.name),p.setAttrib(n,"style",p.getAttrib(n,"style"))),e.nodeChanged()},R=function(t){M(),B();var f=p.getPos(t,C),w=f.x,x=f.y,k=t.getBoundingClientRect(),O=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==t&&(n=t,d=m=0);var z=e.fire("ObjectSelected",{target:t});_(t)&&!z.isDefaultPrevented()?v(S,(function(t,e){var f;(f=p.get("mceResizeHandle"+e))&&p.remove(f),f=p.add(C,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===pe.ie&&(f.contentEditable=!1),p.bind(f,"mousedown",(function(f){f.stopImmediatePropagation(),f.preventDefault(),function(f){u=f.screenX,a=f.screenY,c=T(n).clientWidth,s=T(n).clientHeight,l=s/c,(i=t).name=e,i.startPos={x:O*t[0]+w,y:R*t[1]+x},g=C.scrollWidth,h=C.scrollHeight,r=n.cloneNode(!0),p.addClass(r,"mce-clonedresizable"),p.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,p.setStyles(r,{left:w,top:x,margin:0}),E(r,O,R),r.removeAttribute("data-mce-selected"),C.appendChild(r),p.bind(b,"mousemove",A),p.bind(b,"mouseup",N),y!==b&&(p.bind(y,"mousemove",A),p.bind(y,"mouseup",N)),o=p.add(C,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" × "+s)}(f)})),t.elm=f,p.setStyles(f,{left:O*t[0]+w-f.offsetWidth/2,top:R*t[1]+x-f.offsetHeight/2})})):M(),n.setAttribute("data-mce-selected","1")},M=function(){B(),n&&n.removeAttribute("data-mce-selected"),it(S,(function(t,e){var n=p.get("mceResizeHandle"+e);n&&(p.unbind(n),p.remove(n))}))},z=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};f||e.removed||(v(p.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=p.$(r).closest("table,img,figure.image,hr")[0],C)&&(P(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):M())},D=function(t){return Sf(wf(e.getBody(),t))},B=function(){it(S,(function(t){t.elm&&(p.unbind(t.elm),delete t.elm)}))},P=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};return e.on("init",(function(){if(P(),pe.browser.isIE()||pe.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;f||!/^(TABLE|IMG|HR)$/.test(r)||D(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Tr.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(D(t.target)||Vn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};p.bind(C,"mscontrolselect",t),e.on("remove",(function(){return p.unbind(C,"mscontrolselect",t)}))}var r=Tr.throttle((function(t){e.composing||z(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",M),e.on("contextmenu longpress",O,!0)})),e.on("remove",B),{isResizable:_,showResizeRect:R,hideResizeRect:M,updateResizeRect:z,destroy:function(){n=r=null}}},Of=function(t){return Ln(t)||Hn(t)},Tf=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=xe.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Hn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Of))?null:t}(r,n.body)}return r},_f=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Ef=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Af=function(t,e,n){return Ef(t,e,(function(t){return t.nodeName===n}))},Nf=function(t){return t&&"TABLE"===t.nodeName},Rf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Mf=function(t,e){return Kr(t)&&!1===Ef(t,e,ll)},zf=function(t,e,n){for(var r=new Ar(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Pn(e))return!0},Df=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Pn(o)&&e&&t.isEmpty(s))return x.some(uc(o.parentNode,t.nodeIndex(o)));for(var l=new Ar(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Mf(u,a))return x.none();if(Mn(u)&&u.nodeValue.length>0)return!1===Af(u,a,"A")?x.some(uc(u,r?u.nodeValue.length:0)):x.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return x.none();i=u}return n&&i?x.some(uc(i,0)):x.none()},Bf=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=kn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,Kr(o))return x.none();if(kn(o)&&i>o.childNodes.length-1&&(a=!1),Dn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(Kr(u))return x.none();if(f[u.nodeName]||Nf(u))return x.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Mn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Nf(o))return x.none();if(function(t,e){for(;e&&e!==t;){if(Hn(e))return!0;e=e.parentNode}return!1}(c,o)||Kr(o))return x.none();if(o.hasChildNodes()&&!1===Nf(o)){u=o;var d=new Ar(o,c);do{if(Hn(u)||Kr(u)){s=!1;break}if(Mn(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Rf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(Mn(o)&&0===i&&Df(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),kn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Pn(u)||function(t,e){return t.previousSibling&&"A"===t.previousSibling.nodeName}(u)||zf(t,u,!1)||zf(t,u,!0)||Df(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&Mn(o)&&i===o.nodeValue.length&&Df(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?x.some(uc(o,i)):x.none()},Pf=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=uc.fromRangeStart(e);return Bf(t,n,!0,r).each((function(t){n&&uc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Bf(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),_f(e,r)?x.none():x.some(r)},If=function(t,e){return t.splitText(e)},Lf=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Mn(e)?n>0&&n<e.nodeValue.length&&(e=(r=If(e,n)).previousSibling,o>n?(e=r=If(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Mn(e)&&n>0&&n<e.nodeValue.length&&(e=If(e,n),n=0),Mn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=If(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}};function Hf(t){return{walk:function(e,n){return ef(t,e,n)},split:Lf,normalize:function(e){return Pf(t,e).fold(p,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}!function(t){t.compareRanges=_f,t.getCaretRangeFromPoint=Tf,t.getSelectedNode=Ha,t.getNode=Fa}(Hf||(Hf={}));var Ff,Vf=Hf,jf=function(t,e){var n=function(e){var n=function(t){var e=t.dom;return dn(t)?e.getBoundingClientRect().height:e.offsetHeight}(e);if(n<=0||null===n){var r=Kn(e,t);return parseFloat(r)||0}return n},r=function(t,e){return $(e,(function(e,n){var r=Kn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!D(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;jn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height"),Uf=function(t,e){return t.view(e).fold(l([]),(function(e){var n=t.owner(e),r=Uf(t,n);return[e].concat(r)}))},Wf=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Te)},owner:function(t){return Fe(t)}}),qf=function(t){return"textarea"===Me(t)},$f=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return gn(n.offsetLeft,n.offsetTop);var i=hn(null==r?void 0:r.pageYOffset,o.scrollTop),u=hn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=hn(o.clientTop,n.clientTop),c=hn(o.clientLeft,n.clientLeft);return pn(t).translate(u-c,i-a)}(t),r=function(t){return jf.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Gf=function(t,e,n,r){Jf(t,(function(o,i){return Kf(t,e,n,r)}),n)},Xf=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,vn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Kf=function(t,e,n,r){var o=Te(t.getBody()),i=Te(t.getDoc());o.dom.offsetWidth;var u,a,c,s,l=(u=Te(n.startContainer),a=n.startOffset,c=function(t,e){var n=Ge(t);if(0===n.length||qf(t))return{element:t,offset:e};if(e<n.length&&!qf(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return qf(r)?{element:t,offset:e}:"img"===Me(r)?{element:r,offset:1}:Pe(r)?{element:r,offset:gf(r).length}:{element:r,offset:Ge(r).length}}(u,a),s=Se('<span data-mce-bogus="all">\ufeff</span>'),rn(c.element,s),$f(s,(function(){return ln(s)})));Xf(t,i,e,l,r),l.cleanup()},Yf=function(t,e,n,r){var o=Te(t.getDoc());Xf(t,o,n,function(t){return $f(Te(t),c)}(e),r)},Jf=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(Te(r),Te(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Qf=function(t,e,n,r){var o=t.pos;if(n)bn(o.left,o.top,r);else{var i=o.top-e+t.height;bn(o.left,i,r)}},Zf=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;u<e?Qf(r,n,!1!==o,t):u>i?Qf(r,n,c?!1!==o:!0===o,t):a>i&&!c&&Qf(r,n,!0===o,t)},td=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r)},ed=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r);var i=function(t){var e=Te(document),n=vn(e),r=function(t,e){var n=e.owner(t);return Uf(e,n)}(t,Wf),o=pn(t),i=q(r,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return gn(i.left+o.left+n.left,i.top+o.top+n.top)}(n.element),u=xn(window);i.top<u.y?yn(n.element,!1!==r):i.top>u.bottom&&yn(n.element,!0===r)},nd=function(t,e,n){return Gf(t,td,e,n)},rd=function(t,e,n){return Yf(t,e,td,n)},od=function(t,e,n){return Gf(t,ed,e,n)},id=function(t,e,n){return Yf(t,e,ed,n)},ud=function(t,e,n){(t.inline?nd:od)(t,e,n)},ad=function(t){var e=tn(t).dom;return t.dom===e.activeElement},cd=function(t){return void 0===t&&(t=Te(document)),x.from(t.dom.activeElement).map(Te)},sd=mr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ld=(sd.before,sd.on,sd.after,mr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),fd=(ld.domRange,ld.relative,ld.exact,function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}}),dd=ae().browser,md=function(t,e){var n=Pe(e)?gf(e).length:Ge(e).length+1;return t>n?n:t<0?0:t},gd=function(t){return fd(t.start,md(t.soffset,t.start),t.finish,md(t.foffset,t.finish))},hd=function(t,e){return!Sn(e.dom)&&(Re(t,e)||Ne(t,e))},pd=function(t){return function(e){return hd(t,e.start)&&hd(t,e.finish)}},vd=function(t){return!0===t.inline||dd.isIE()},bd=function(t){return fd(Te(t.startContainer),t.startOffset,Te(t.endContainer),t.endOffset)},yd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),x.some(e)}catch(t){return x.none()}},wd=function(t){var e,n,r,o=vd(t)?(e=Te(t.getBody()),(n=Ve(e).dom,r=n.getSelection(),(r&&0!==r.rangeCount?x.from(r.getRangeAt(0)):x.none()).map(bd)).filter(pd(e))):x.none();t.bookmark=o.isSome()?o:t.bookmark},xd=function(t){return(t.bookmark?t.bookmark:x.none()).bind((function(e){return n=Te(t.getBody()),r=e,x.from(r).filter(pd(n)).map(gd);var n,r})).bind(yd)},Cd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Sd=function(t){var e=la((function(){wd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};Qu.DOM.bind(document,"mouseup",n),t.on("remove",(function(){Qu.DOM.unbind(document,"mouseup",n)}))}(t,e),function(t,e){ae().browser.isIE()?function(t){t.on("focusout",(function(){wd(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||wd(t)}))}(t,e)})),t.on("remove",(function(){e.cancel()}))},kd=Qu.DOM,Od=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==kd.getParent(e,(function(e){return function(t){return Cd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},Td=function(t,e){var n=e.editor;Sd(n),n.on("focusin",(function(){var e=this,n=t.focusedEditor;n!==e&&(n&&n.fire("blur",{focusedEditor:e}),t.setActive(e),t.focusedEditor=e,e.fire("focus",{blurredEditor:n}),e.focus(!0))})),n.on("focusout",(function(){var e=this;Tr.setEditorTimeout(e,(function(){var n=t.focusedEditor;Od(e,function(t){try{var e=tn(Te(t.getElement()));return cd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(e))||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ff||(Ff=function(e){var n=t.activeEditor;n&&function(t){if(Ze()&&M(t.target)){var e=Te(t.target);if(Be(e)&&M(e.dom.shadowRoot)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return tt(n)}}return x.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Od(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},kd.bind(document,"focusin",Ff))},_d=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(kd.unbind(document,"focusin",Ff),Ff=null)},Ed=function(t,e){(function(t,e){return function(t){return t.collapsed?x.from(Fa(t.startContainer,t.startOffset)).map(Te):x.none()}(e).bind((function(e){return Lr(e)?x.some(e):!1===Re(t,e)?x.some(t):x.none()}))})(Te(t.getBody()),e).bind((function(t){return al(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},Ad=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},Nd=function(t){return t.inline?function(t){var e,n,r=t.getBody();return r&&(e=Te(r),ad(e)||(n=e,cd(tn(n)).filter((function(t){return n.dom.contains(t.dom)}))).isSome())}(t):function(t){return t.iframeElement&&ad(Te(t.iframeElement))}(t)},Rd=function(t){return t.editorManager.setActive(t)},Md=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return x.from(i).map(Te).map((function(t){return r&&e.collapsed?t:Xe(t,o(t,u)).getOr(t)})).bind((function(t){return Be(t)?x.some(t):je(t).filter(Be)})).map((function(t){return t.dom})).getOr(t)},zd=function(t,e,n){return Md(t,e,!0,n,(function(t,e){return Math.min(t.dom.childNodes.length,e)}))},Dd=function(t,e,n){return Md(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Bd=function(t,e){for(var n=t;t&&Mn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Pd=function(t,e){return V(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Id=function(t){return z(t)?t:p},Ld=function(t,e,n){var r=e(t),o=Id(n);return r.orThunk((function(){return o(t)?x.none():function(t,e,n){for(var r=t.dom,o=Id(n);r.parentNode;){r=r.parentNode;var i=Te(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()}(t,e,o)}))},Hd=Rl,Fd=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},Vd=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!Fd(t,e,n)||e.parentNode===o||!!Wd(t,e,n,r,!0)})),Wd(t,e,n,r))},jd=function(t,e,n){return!!Hd(e,n.inline)||!!Hd(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},Ud=function(t,e,n,r,o,i){var u,a,c,s=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(s)if(void 0===s.length){for(u in s)if(s.hasOwnProperty(u)){if(a="attributes"===r?t.getAttrib(e,u):zl(t,e,u),o&&!a&&!n.exact)return;if((!o||n.exact)&&!Hd(a,Ml(t,Nl(s[u],i),u)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?t.getAttrib(e,s[c]):zl(t,e,s[c]))return n;return n},Wd=function(t,e,n,r,o){var i,u,a,c,s=t.formatter.get(n),l=t.dom;if(s&&e)for(u=0;u<s.length;u++)if(i=s[u],jd(t.dom,e,i)&&Ud(l,e,i,"attributes",o,r)&&Ud(l,e,i,"styles",o,r)){if(c=i.classes)for(a=0;a<c.length;a++)if(!t.dom.hasClass(e,c[a]))return;return i}},qd=function(t,e,n,r){if(r)return Vd(t,r,e,n);if(r=t.selection.getNode(),Vd(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!Vd(t,o,e,n))},$d=function(t,e,n){return $(n,(function(n,r){var o=function(t,e){return F(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return F(["styles","attributes"],(function(n){return dt(t,n).exists((function(t){var n=_(t)?t:function(t,e){var n=[];return it(t,(function(t,e){n.push(t)})),n}(t);return F(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Gd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xd=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},Kd=function(t){if(!ho(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Yd=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Jd=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Gd[e]||1);return n&&it(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&it(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Xd(n,this))n.name===t&&e.push(n);return e},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Xd(n,t))e.push(n);for(var r=e.length;r--;)(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Yd(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Yd(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Kd(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&ho(o.value))return!1;if(n&&n(o))return!1}while(o=Xd(o,r));return!0},t.prototype.walk=function(t){return Xd(this,null,t)},t}(),Qd=xe.makeMap,Zd=function(t){var e=[],n=(t=t||{}).indent,r=Qd(t.indent_before||""),o=Qd(t.indent_after||""),i=Io.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tm=function(t,e){void 0===e&&(e=Go());var n=Zd(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r,a,c,s,l,f,d,m,g,h=i[t.type];if(h)h(t);else{if(r=t.name,a=t.shortEnded,c=t.attributes,o&&c&&c.length>1&&((f=[]).map={},g=e.getElementRule(t.name))){for(d=0,m=g.attributesOrder.length;d<m;d++)(s=g.attributesOrder[d])in c.map&&(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));for(d=0,m=c.length;d<m;d++)(s=c[d].name)in f.map||(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));c=f}if(n.start(t.name,c,a),!a){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},em=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return dt(e.uris,t).getOr(t)}))},nm=["img","video"],rm=function(t,e,n){var r,o,i=1,u=t.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(a.lastIndex=r=n;o=a.exec(e);){if(r=a.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in u)continue;i++}if(0===i)break}return r},om=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function im(t,e){void 0===e&&(e=Go());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,u=t.start?t.start:n,a=t.end?t.end:n,c=t.pi?t.pi:n,s=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");for(var f,d,m,g,h,p,v,b,y,w,x,C,S,k,O,T,_,E,A,N=n.html,M=0,z=[],D=0,B=Io.decode,P=xe.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L="html"===l?0:1,F=function(t){var e,n;for(e=z.length;e--&&z[e].name!==t;);if(e>=0){for(n=z.length-1;n>=e;n--)(t=z[n]).valid&&a(t.name);z.length=e}},V=function(t,e){return i(em(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(em(e,n)))},U=function(t,e){var n=t||"",r=!Rt(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length}(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},W=function(e,r,o,i,u){var a,c;if(o=function(t){return dt(n.uris,t).getOr(t)}((r=r.toLowerCase())in K?r:B(o||i||u||"")),Y&&!b&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(r)){if(!(a=k[r])&&O){for(c=O.length;c--&&!(a=O[c]).pattern.test(r););-1===c&&(a=null)}if(!a)return;if(a.validValues&&!(o in a.validValues))return}if(P[r]&&!t.allow_script_urls){var s=o.replace(/[\s\u0000-\u001F]+/g,"");try{s=decodeURIComponent(s)}catch(t){s=unescape(s)}if(I.test(s))return;if(function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return!(R(t)?H(nm,e):t)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))}(t,s,e))return}b&&(r in P||0===r.indexOf("on"))||(g.map[r]=o,g.push({name:r,value:o}))},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),X=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=N+">";f=q.exec(tt);){var et=f[0];if(M<f.index&&V(B(N.substr(M,f.index-M))),d=f[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=f[8]){if(f.index+et.length>N.length){V(B(N.substr(f.index))),M=f.index+et.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in G,Q&&X[d]&&z.length>0&&z[z.length-1].name===d&&F(d);var nt=om($,f[9]);if(null!==nt){if("all"===nt){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}if(!Y||(w=e.getElementRule(d))){if(x=!0,Y&&(k=w.attributes,O=w.attributePatterns),(S=f[9])?((b=-1!==S.indexOf("data-mce-type"))&&J&&(x=!1),(g=[]).map={},S.replace($,(function(t,e,n,r,o){return W(d,e,n,r,o),""}))):(g=[]).map={},Y&&!b){if(T=w.attributesRequired,_=w.attributesDefault,E=w.attributesForced,w.removeEmptyAttrs&&!g.length&&(x=!1),E)for(h=E.length;h--;)v=(C=E[h]).name,"{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A});if(_)for(h=_.length;h--;)(v=(C=_[h]).name)in g.map||("{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A}));if(T){for(h=T.length;h--&&!(T[h]in g.map););-1===h&&(x=!1)}if(C=g.map["data-mce-bogus"]){if("all"===C){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}}x&&u(d,g,y)}else x=!1;if(m=Z[d]){m.lastIndex=M=f.index+et.length,(f=m.exec(N))?(x&&(p=N.substr(M,f.index-M)),M=f.index+f[0].length):(p=N.substr(M),M=N.length),x&&(p.length>0&&V(p,!0),a(d)),q.lastIndex=M;continue}y||(S&&S.indexOf("/")===S.length-1?x&&a(d):z.push({name:d,valid:x}))}else if(d=f[1])j(d);else if(d=f[2]){if(!(1===L||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){M=U("",f.index+2),q.lastIndex=M;continue}o(d)}else if(d=f[3])s(d);else{if((d=f[4])||"<!"===et){M=U(d,f.index+et.length),q.lastIndex=M;continue}if(d=f[5]){if(1!==L){M=U("?",f.index+2),q.lastIndex=M;continue}c(d,f[6])}}M=f.index+et.length}for(M<N.length&&V(B(N.substr(M))),h=z.length-1;h>=0;h--)(d=z[h]).valid&&a(d.name)};return{parse:function(t,e){void 0===e&&(e="html"),l(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=ka("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}return 0===u?{prefix:i,uris:o,html:t}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join("")})}(t),e)}}}!function(t){t.findEndTag=rm}(im||(im={}));var um=im,am=function(t,e){var n,r,o,i,u=e,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=t.schema;u=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),u);for(var s=c.getShortEndedElements();i=a.exec(u);)r=a.lastIndex,o=i[0].length,n=s[i[1]]?r:um.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),a.lastIndex=r-o;return Wr(u)},cm=am,sm=xe.each,lm=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return sm(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||wl(e)||wl(n))}},fm=function(t,e,n){return x.from(n.container()).filter(Mn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},dm=d(fm,!0,Cl),mm=d(fm,!1,Cl),gm=function(t){var e=t.container();return Mn(e)&&(0===e.data.length||Ur(e.data)&&yf.isBookmarkNode(e.parentNode))},hm=function(t,e){return function(n){return x.from(As(t?0:-1,n)).filter(e).isSome()}},pm=function(t){return In(t)&&"block"===Kn(Te(t),"display")},vm=function(t){return Hn(t)&&!function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},bm=hm(!0,pm),ym=hm(!1,pm),wm=hm(!0,Vn),xm=hm(!1,Vn),Cm=hm(!0,An),Sm=hm(!1,An),km=hm(!0,vm),Om=hm(!1,vm),Tm=function(t){sn(t),an(t,Se('<br data-mce-bogus="1">'))},_m=function(t){Ye(t).each((function(e){Ue(e).each((function(n){Mr(t)&&Dr(e)&&Mr(n)&&ln(e)}))}))},Em=function(t,e){return function(t,e,n){return Re(e,t)?function(t,e){for(var n=z(e)?e:p,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Te(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Ne(t,e)})).slice(0,-1):[]}(t,e,p)},Am=function(t,e){return[t].concat(Em(t,e))},Nm=function(t,e,n){return rl(t,e,n,gm)},Rm=function(t,e){return G(Am(Te(e.container()),t),Mr)},Mm=function(t,e,n){return Nm(t,e.dom,n).forall((function(t){return Rm(e,n).fold((function(){return!1===Es(t,n,e.dom)}),(function(r){return!1===Es(t,n,e.dom)&&Re(r,Te(t.container()))}))}))},zm=function(t,e,n){return Rm(e,n).fold((function(){return Nm(t,e.dom,n).forall((function(t){return!1===Es(t,n,e.dom)}))}),(function(e){return Nm(t,e.dom,n).isNone()}))},Dm=d(zm,!1),Bm=d(zm,!0),Pm=d(Mm,!1),Im=d(Mm,!0),Lm=function(t){return Ls(t).exists(Dr)},Hm=function(t,e,n){var r=W(Am(Te(n.container()),e),Mr),o=tt(r).getOr(e);return el(t,o.dom,n).filter(Lm)},Fm=function(t,e){return Ls(e).exists(Dr)||Hm(!0,t,e).isSome()},Vm=function(t,e){return function(t){return x.from(t.getNode(!0)).map(Te)}(e).exists(Dr)||Hm(!1,t,e).isSome()},jm=d(Hm,!1),Um=d(Hm,!0),Wm=function(t){return uc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},qm=function(t,e){var n=W(Am(Te(e.container()),t),Mr);return tt(n).getOr(t)},$m=function(t,e){return Wm(e)?mm(e):mm(e)||ul(qm(t,e).dom,e).exists(mm)},Gm=function(t,e){return Wm(e)?dm(e):dm(e)||il(qm(t,e).dom,e).exists(dm)},Xm=function(t){return Ls(t).bind((function(t){return br(t,Be)})).exists((function(t){return function(t){return H(["pre","pre-wrap"],t)}(Kn(t,"white-space"))}))},Km=function(t,e){return!Xm(e)&&(Dm(t,e)||Pm(t,e)||Vm(t,e)||$m(t,e))},Ym=function(t,e){return!Xm(e)&&(Bm(t,e)||Im(t,e)||Fm(t,e)||Gm(t,e))},Jm=function(t,e){return Km(t,e)||Ym(t,function(t){var e=t.container(),n=t.offset();return Mn(e)&&n<e.data.length?uc(e,n+1):t}(e))},Qm=function(t,e){return xl(t.charAt(e))},Zm=function(t){var e=t.container();return Mn(e)&&Nt(e.data,Vr)},tg=function(t,e){return x.some(e).filter(Zm).bind((function(e){var n,r,o,i=e.container();return function(t,e){var n=e.data,r=uc(e,0);return!(!Qm(n,0)||Jm(t,r)||(e.data=" "+n.slice(1),0))}(t,i)||(r=(n=i).data,(o=function(t){var e=t.split("");return V(e,(function(t,n){return xl(t)&&n>0&&n<e.length-1&&Sl(e[n-1])&&Sl(e[n+1])?" ":t})).join("")}(r))!==r&&(n.data=o,1))||function(t,e){var n=e.data,r=uc(e,n.length-1);return!(!Qm(n,n.length-1)||Jm(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,i)?x.some(e):x.none()}))},eg=function(t){var e=Te(t.getBody());t.selection.isCollapsed()&&tg(e,uc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},ng=function(t,e,n){if(0!==n){var r=Te(t),o=vr(r,Mr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Ym(o,cc(t,t.data.length)),a=0===e&&Km(o,cc(t,0));t.replaceData(e,n,function(t,e,n){return $(t,(function(r,o){return Cl(o)||xl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+Vr}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},rg=function(t,e){var n=t.data.slice(e),r=n.length-Dt(n).length;return ng(t,e,r)},og=function(t,e){var n=t.data.slice(0,e),r=n.length-Bt(n).length;return ng(t,e-r,r)},ig=function(t,e,n,r){void 0===r&&(r=!0);var o=Bt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),ln(Te(u)),n&&rg(i,o),i},ug=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===cc.isTextPosition(t)&&n===e.parentNode&&r>cc.before(e).offset()}(e,t)?cc(e.container(),e.offset()-1):e},ag=function(t){return lo(t.previousSibling)?x.some((e=t.previousSibling,Mn(e)?cc(e,e.data.length):cc.after(e))):t.previousSibling?cl(t.previousSibling):x.none();var e},cg=function(t){return lo(t.nextSibling)?x.some((e=t.nextSibling,Mn(e)?cc(e,0):cc.before(e))):t.nextSibling?al(t.nextSibling):x.none();var e},sg=function(t,e,n){return function(t,e,n){return t?function(t,e){return cg(e).orThunk((function(){return ag(e)})).orThunk((function(){return function(t,e){return il(t,cc.after(e)).fold((function(){return ul(t,cc.before(e))}),x.some)}(t,e)}))}(e,n):function(t,e){return ag(e).orThunk((function(){return cg(e)})).orThunk((function(){return function(t,e){var n=cc.before(e.previousSibling?e.previousSibling:e.parentNode);return ul(t,n).fold((function(){return il(t,cc.after(e))}),x.some)}(t,e)}))}(e,n)}(t,e,n).map(d(ug,n))},lg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},fg=function(t,e){return e&&mt(t.schema.getBlockElements(),Me(e))},dg=function(t){if(wo(t)){var e=Se('<br data-mce-bogus="1">');return sn(t),an(t,e),x.some(cc.before(e.dom))}return x.none()},mg=function(t,e,n,r){void 0===r&&(r=!0);var o,i=sg(e,t.getBody(),n.dom),u=vr(n,d(fg,t),(o=t.getBody(),function(t){return t.dom===o})),a=function(t,e,n){var r,o,i,u,a=Ue(t).filter(Pe),c=We(t).filter(Pe);return ln(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return ig(o,i,n),r.container()===i?cc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?x.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):x.none()).orThunk((function(){return n&&(a.each((function(t){return og(t.dom,t.dom.length)})),c.each((function(t){return rg(t.dom,0)}))),e}))}(n,i,function(t,e){return mt(t.schema.getTextInlineElements(),Me(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(dg).fold((function(){r&&lg(t,e,a)}),(function(n){r&&lg(t,e,x.some(n))}))},gg=function(t,e){return{start:t,end:e}},hg=mr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),pg=function(t,e){return xr(Te(t),"td,th",e)},vg=function(t,e){return yr(t,"table",e)},bg=function(t){return!Ne(t.start,t.end)},yg=function(t,e){return vg(t.start,e).bind((function(n){return vg(t.end,e).bind((function(t){return e=Ne(n,t),r=n,e?x.some(r):x.none();var e,r}))}))},wg=function(t){return va(t,"td,th")},xg=function(t,e){return yg(e,t).isSome()},Cg=function(t,e,n){return t.filter((function(t){return bg(t)&&xg(n,t)})).orThunk((function(){return function(t,e){var n=pg(e.startContainer,t),r=pg(e.endContainer,t);return e.collapsed?x.none():Ra(n,r,gg).fold((function(){return n.fold((function(){return r.bind((function(e){return vg(e,t).bind((function(t){return tt(wg(t)).map((function(t){return gg(t,e)}))}))}))}),(function(e){return vg(e,t).bind((function(t){return et(wg(t)).map((function(t){return gg(e,t)}))}))}))}),(function(e){return xg(t,e)?x.none():function(t,e){return vg(t.start,e).bind((function(e){return et(wg(e)).map((function(e){return gg(t.start,e)}))}))}(e,t)}))}(n,e)})).bind((function(t){return function(t,e){return yg(t,e).map((function(e){return function(t,e,n){return{rng:t,table:e,cells:n}}(t,e,wg(e))}))}(t,n)}))},Sg=function(t,e){return X(t,(function(t){return Ne(t,e)}))},kg=function(t){return function(t){return Ra(Sg(t.cells,t.rng.start),Sg(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))}(t).map((function(e){var n=t.cells;return e.length===n.length?hg.removeTable(t.table):hg.emptyCells(e)}))},Og=function(t,e){var n=function(t){return function(e){return Ne(t,e)}}(t),r=function(t,e){var n=pg(t.startContainer,e),r=pg(t.endContainer,e);return Ra(n,r,gg)}(e,n);return function(t,e,n){return t.filter((function(t){return function(t,e){return!bg(t)&&yg(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&cf(t.start,e)})).map((function(t){return t.start}))}(r,e,n).map((function(t){return hg.deleteCellSelection(e,t)})).orThunk((function(){return Cg(r,e,n).bind(kg)}))},Tg=function(t){var e;return(8===ze(e=t)||"#comment"===Me(e)?Ue(t):Ye(t)).bind(Tg).orThunk((function(){return x.some(t)}))},_g=function(t,e){return j(e,Tm),t.selection.setCursorLocation(e[0].dom,0),!0},Eg=function(t,e,n){e.deleteContents();var r,o=Tg(n).getOr(n),i=Te(t.dom.getParent(o.dom,t.dom.isBlock));if(wo(i)&&(Tm(i),t.selection.setCursorLocation(i.dom,0)),!Ne(n,i)){var u=je(i).is(n)?[]:je(r=i).map(Ge).map((function(t){return W(t,(function(t){return!Ne(r,t)}))})).getOr([]);j(u.concat(Ge(n)),(function(t){Ne(t,i)||Re(t,i)||ln(t)}))}return!0},Ag=function(t,e){return mg(t,!1,e),!0},Ng=function(t,e){return G(Am(e,t),Hr)},Rg=function(t,e){return G(Am(e,t),(function(t){return"caption"===Me(t)}))},Mg=function(t,e){return Tm(e),t.selection.setCursorLocation(e.dom,0),x.some(!0)},zg=function(t,e){return t?Cm(e):Sm(e)},Dg=function(t,e,n){var r=Te(t.getBody());return Rg(r,n).fold((function(){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return Ng(n,r).bind((function(r){return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(t){return Ng(e,Te(t.getNode())).map((function(t){return!1===Ne(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)}(t,e,r,n)||function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return zg(e,n)||el(e,t.getBody(),n).exists((function(t){return zg(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return al(t.dom).bind((function(o){return cl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Mg(t,e)}(t,r):function(t,e,n){return Rg(t,Te(n.getNode())).map((function(t){return!1===Ne(t,e)}))}(e,r,i)})).or(x.some(!0))}(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Bg=function(t,e){var n=Te(t.selection.getStart(!0)),r=of(t);return t.selection.isCollapsed()&&0===r.length?Dg(t,e,n):function(t,e){var n=Te(t.getBody()),r=t.selection.getRng(),o=of(t);return 0!==o.length?_g(t,o):function(t,e,n,r){return Rg(e,r).fold((function(){return function(t,e,n){return Og(e,n).map((function(e){return e.fold(d(Ag,t),d(_g,t),d(Eg,t))}))}(t,e,n)}),(function(e){return function(t,e){return Mg(t,e)}(t,e)})).getOr(!1)}(t,n,r,e)}(t,n)},Pg=function(t){return t.collapsed?t:function(t){var e=cc.fromRangeStart(t),n=cc.fromRangeEnd(t),r=t.commonAncestorContainer;return el(!1,r,n).map((function(o){return!Es(e,n,r)&&Es(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)}(t)},Ig=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===Vr}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Lg=function(t){return t.length>0&&(!(n=t[t.length-1]).firstChild||(e=n)&&e.firstChild&&e.firstChild===e.lastChild&&function(t){return t.data===Vr||Pn(t)}(e.firstChild))?t.slice(0,-1):t;var e,n},Hg=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Fg=function(t,e){var n=cc.after(t),r=Js(e).prev(n);return r?r.toRange():null},Vg=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Hg(e,n.startContainer),a=Lg((o=i.firstChild,xe.grep(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=cc.fromRangeStart(n),o=Js(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Hg(e,i.getNode())!==u};return s(1)?function(t,e,n){var r=t.parentNode;return xe.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=cc.before(t),r=Js(e).next(n);return r?r.toRange():null}(t,n)}(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Fg(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),xe.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Fg(e[e.length-1],n)}(u,a,c,n)},jg=Fn,Ug=function(t,e,n){var r,o,i,u,a,c,s=t.selection,l=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Te(t.getRoot());return n=Km(r,cc.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Ym(r,cc.fromRangeEnd(e))?n.replace(/( | )(<br( \/)>)?$/," "):n.replace(/ (<br( \/)?>)?$/," ")}(l,s.getRng(),e));var f=t.parser,d=n.merge,m=tm({validate:Kc(t)},t.schema),g='<span id="mce_marker" data-mce-type="bookmark"></span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},(i=t.fire("BeforeSetContent",i)).isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=i.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,g);var h=(a=s.getRng()).startContainer||(a.parentElement?a.parentElement():null),p=t.getBody();h===p&&s.isCollapsed()&&l.isBlock(p.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,p.firstChild)&&l.isEmpty(p.firstChild)&&((a=l.createRng()).setStart(p.firstChild,0),a.setEnd(p.firstChild,0),s.setRng(a)),s.isCollapsed()||function(t){var e=t.dom,n=Pg(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,jg);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,jg)&&cf(Te(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Eg(t,n,Te(r))}(t);var v,b={context:(r=s.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},y=f.parse(e,b);if(!0===n.paste&&Ig(t.schema,y)&&function(t,e){return!!Hg(t,e)}(l,r))return a=Vg(m,l,s.getRng(),y),s.setRng(a),void t.fire("SetContent",i);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(y),"mce_marker"===(c=y.lastChild).attr("id"))for(u=c,c=c.prev;c;c=c.walk(!0))if(3===c.type||!l.isBlock(c.name)){t.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(u,c,"br"===c.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),b.invalid){for(t.selection.setContent(g),r=s.getNode(),o=t.getBody(),9===r.nodeType?r=c=o:c=r;c!==o;)r=c,c=c.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return m.serialize(y)})))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=m.serialize(y),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new lm(r);xe.each(r.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)}))}}(t,d),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){i.scrollIntoView(e);var u=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(u)return o.remove(e),void i.select(u);var a=o.createRng(),c=e.previousSibling;c&&3===c.nodeType?(a.setStart(c,c.nodeValue.length),pe.ie||(r=e.nextSibling)&&3===r.nodeType&&(c.appendData(r.data),r.parentNode.removeChild(r))):(a.setStartBefore(e),a.setEndBefore(e));var s=o.getParent(e,o.isBlock);o.remove(e),s&&o.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),jg(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=cc.fromRangeStart(e);if(n=Js(t.getBody()).next(n))return n.toRange()}(a))?o.add(s,o.create("br",{"data-mce-bogus":"1"})):(a=n,o.remove(s))),i.setRng(a)}}(t,l.get("mce_marker")),v=t.getBody(),xe.each(v.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){x.from(t.getParent(e,"td,th")).map(Te).each(_m)}(l,s.getStart()),t.fire("SetContent",i),t.addVisual()}},Wg=function(t,e){e(t),t.firstChild&&Wg(t.firstChild,e),t.next&&Wg(t.next,e)},qg=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Wg(n.firstChild,(function(n){j(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),j(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(u)&&i.push(r[u]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(t,e,n);j(r,(function(t){j(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},$g=function(t){return t instanceof Jd},Gg=function(t,e){t.dom.setHTML(t.getBody(),e),function(t){Nd(t)&&al(t.getBody()).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Xg=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?function(t,e){return G(t.dom.childNodes,(function(t){return e(Te(t))})).map(Te)}(Te(n.parentNode),(function(n){return!Ne(t,n)&&e(n)})):x.none()}(t,e).isSome()},Kg=jr,Yg="_mce_caret",Jg=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Kg||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Qg=function(t){if(t){var e=new Ar(t,t);for(t=e.current();t;t=e.next())if(Mn(t))return t}return null},Zg=function(t){var e=ke("span");return qn(e,{id:Yg,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&an(e,Oe(Kg)),e},th=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Jg(e))mg(t,!1,Te(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Qg(t);return e&&e.nodeValue.charAt(0)===Kg&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&Tm(Te(u)),o.setRng(i)}},eh=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)th(t,e,n);else if(!(e=fl(t.getBody(),o.getStart())))for(;e=r.get(Yg);)th(t,e,!1)},nh=function(t,e){return t.appendChild(e),e},rh=function(t,e){var n=q(t,(function(t,e){return nh(t,e.cloneNode(!1))}),e);return nh(n,n.ownerDocument.createTextNode(Kg))},oh=function(t,e,n,r){var o,i,c,s=t.dom,l=t.selection,f=[],m=l.getRng(),g=m.startContainer,h=m.startOffset;for(i=g,3===g.nodeType&&(h!==g.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Wd(t,i,e,n,r)){c=i;break}i.nextSibling&&(o=!0),f.push(i),i=i.parentNode}if(c)if(o){var p=l.getBookmark();m.collapse(!0);var v=Zl(t,m,t.formatter.get(e),!0);v=Lf(v),t.formatter.remove(e,n,v,r),l.moveToBookmark(p)}else{var b=fl(t.getBody(),c),y=Zg(!1).dom;!function(t,e,n){var r,o,i,u=t.dom,a=u.getParent(n,d(_l,t));a&&u.isEmpty(a)?n.parentNode.replaceChild(e,n):(r=Te(n),o=va(r,"br"),i=W(function(t){for(var e=[],n=t.dom;n;)e.push(Te(n)),n=n.lastChild;return e}(r).slice(-1),Dr),o.length===i.length&&j(i,ln),u.isEmpty(n)?n.parentNode.replaceChild(e,n):u.insertAfter(e,n))}(t,y,null!==b?b:c);var w=function(t,e,n,r,o,i){var c=t.formatter,s=t.dom,l=W(rt(c.get()),(function(t){return t!==r&&!Nt(t,"removeformat")})),f=$d(t,n,l);if(W(f,(function(e){return!function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return ft(t,(function(t,e){return F(r,(function(t){return t===e}))}))};return F(t.formatter.get(e),(function(e){var r=o(e);return F(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=a),u(n).eq(t,e)}(r,e)}))}))}(t,e,r)})).length>0){var d=n.cloneNode(!1);return s.add(e,d),c.remove(r,o,d,i),s.remove(d),x.some(d)}return x.none()}(t,y,c,e,n,r),C=rh(f.concat(w.toArray()),y);th(t,b,!1),l.setCursorLocation(C,1),s.isEmpty(c)&&s.remove(c)}},ih=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(Me(e))&&!ll(e.dom)&&!En(e.dom)},uh={},ah=bt,ch=pt;uh.pre||(uh.pre=[]),uh.pre.push((function(t){var e,n=t.selection.getRng(),r=On(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),ch(ah(ah(e,r),(function(t){return r(t.previousSibling)&&-1!==yt(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Wu(n=t).remove(),Wu(e).append("<br><br>").append(n.childNodes)})))}));var sh=xe.each,lh=function(t){return kn(t)&&!wl(t)&&!ll(t)&&!En(t)},fh=function(t,e){var n;for(n=t;n;n=n[e]){if(Mn(n)&&0!==n.nodeValue.length)return t;if(kn(n)&&!wl(n))return n}return t},dh=function(t,e,n){var r,o,i=new lm(t);if(e&&n&&(e=fh(e,"previousSibling"),n=fh(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),xe.each(xe.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},mh=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=dh(t,Tl(r),r);dh(t,o,Tl(o,!0))}},gh=function(t,e,n){sh(t.childNodes,(function(t){lh(t)&&(e(t)&&n(t),t.hasChildNodes()&&gh(t,e,n))}))},hh=function(t,e){return function(n){return!(!n||!zl(t,n,e))}},ph=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},vh=mr([{keep:[]},{rename:["name"]},{removed:[]}]),bh=/^(src|href|style)$/,yh=xe.each,wh=Rl,xh=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Ch=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],kn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Mn(r)&&n&&o>=r.nodeValue.length&&(r=new Ar(r,t.getBody()).next()||r),Mn(r)&&!n&&0===o&&(r=new Ar(r,t.getBody()).prev()||r),r},Sh=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},kh=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Oh=function(t,e,n,r,o){var i=Te(e),u=Te(t.create(r,o)),a=n?$e(i):qe(i);return cn(u,a),n?(rn(i,u),un(u,i)):(on(i,u),an(u,i)),u.dom},Th=function(t,e,n,r){return!(e=Tl(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},_h=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!!wh(e,n.inline)||!!wh(e,n.block)||(n.selector?kn(e)&&t.is(e,n.selector):void 0)}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return vh.keep();var a=r;if(e.inline&&"all"===e.remove&&_(e.preserve_attributes)){var c=W(u.getAttribs(a),(function(t){return H(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),j(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return vh.rename("span")}if("all"!==e.remove){yh(e.styles,(function(t,r){t=Ml(u,Nl(t,n),r+""),D(r)&&(r=t,o=null),(e.remove_similar||!o||wh(zl(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),yh(e.attributes,(function(t,r){var i;if(t=Nl(t,n),D(r)&&(r=t,o=null),e.remove_similar||!o||wh(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",j(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);"class"===r&&a.removeAttribute("className"),bh.test(r)&&a.removeAttribute("data-mce-"+r),a.removeAttribute(r)}})),yh(e.classes,(function(t){t=Nl(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return vh.keep()}}return"none"!==e.remove?(function(t,e,n){var r,o=e.parentNode,i=t.dom,u=zc(t);n.block&&(u?o===i.getRoot()&&(n.list_block&&wh(e,n.list_block)||j(nt(e.childNodes),(function(e){El(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=kh(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0}))):i.isBlock(e)&&!i.isBlock(o)&&(Th(i,e,!1)||Th(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Th(i,e,!0)||Th(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!wh(n.inline,e)||i.remove(e,!0)}(t,a,e),vh.removed()):vh.keep()},Eh=function(t,e,n,r,o){return _h(t,e,n,r,o).fold(p,(function(e){return t.dom.rename(r,e),!0}),v)},Ah=function(t,e,n,r){return _h(t,e,n,r,r).fold(l(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),l(null))},Nh=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return j(Bl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=Wd(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=Ah(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),u.inline&&mh(f,u,0,s))}return r}(t,i,a,r,r,0,u,n)},f=function(e){var r,o;kn(e)&&c.getContentEditable(e)&&(r=a,a="true"===c.getContentEditable(e),o=!0);var s=nt(e.childNodes);if(a&&!o)for(var l=0;l<i.length&&!Eh(t,i[l],n,e,e);l++);if(u.deep&&s.length){for(l=0;l<s.length;l++)f(s[l]);o&&(a=r)}},d=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return wl(t)&&kn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),Mn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},m=function(e){var n,r,o=Zl(t,e,i,e.collapsed);if(u.split){if(o=Lf(o),(n=Ch(t,o,!0))!==(r=Ch(t,o))){if(n=Sh(n,!0),r=Sh(r,!1),xh(c,n,r)){var a=x.from(n.firstChild).getOr(n);return l(Oh(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(xh(c,r,n))return a=x.from(r.lastChild).getOr(r),l(Oh(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);n=kh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=kh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),ef(c,s,(function(t){j(t,(function(t){wl(t)||wl(t.parentNode)||l(t)}))})),l(n),l(r),n=d(!0),r=d()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}ef(c,o,(function(e){j(e,(function(e){f(e),j(["underline","line-through","overline"],(function(n){kn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Dl(c,e.parentNode)===n&&Eh(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)if(kl(r)){var g=c.createRng();g.setStartBefore(r),g.setEndAfter(r),m(g)}else m(r);else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&u.inline&&!of(t).length?oh(t,e,n,o):(df(s,!0,(function(){ff(t,m)})),u.inline&&qd(t,e,n,s.getStart())&&Ol(c,s,s.getRng()),t.nodeChanged());else{r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!Eh(t,i[h],n,r,r));h++);}},Rh=xe.each,Mh=xe.each,zh=function(t,e){return gt(t,e)},Dh=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(e=e||i,t){if(e.onformat&&e.onformat(t,e,n,r),Mh(e.styles,(function(e,r){a.setStyle(t,r,Nl(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Mh(e.attributes,(function(e,r){a.setAttrib(t,r,Nl(e,n))})),Mh(e.classes,(function(e){e=Nl(e,n),a.hasClass(t,e)||a.addClass(t,e)}))}},l=function(t,e){var n=!1;return!!Il(i)&&(Mh(t,(function(t){if(!("collapsed"in t)||t.collapsed===u)return a.is(e,t.selector)&&!ll(e)?(s(e,t),n=!0,!1):void 0})),n)},f=function(r,u,a,c){var f=[],d=!0,m=i.inline||i.block,g=r.create(m);s(g),ef(r,u,(function(u){var a,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),y=u.parentNode.nodeName.toLowerCase();if(kn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Pn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Ll(e)){var o=St(St({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=Xg(Te(n),(function(t){return ll(t.dom)}));return gt(o,r)&&wo(Te(n.parentNode),!1)&&!i}return!1}(t,i,u,y))return a=null,void(Pl(i)&&r.remove(u));if(i.wrapper&&Wd(t,u,e,n))a=null;else{if(d&&!p&&Pl(i)&&!i.wrapper&&_l(t,b)&&El(t,y,m)){var w=r.rename(u,m);return s(w),f.push(w),void(a=null)}if(Il(i)){var x=l(o,u);if(!zh(i,"inline")||x)return void(a=null)}!d||p||!El(t,m,b)||!El(t,y,m)||!c&&3===u.nodeType&&1===u.nodeValue.length&&65279===u.nodeValue.charCodeAt(0)||ll(u)||zh(i,"inline")&&r.isBlock(u)?(a=null,Mh(xe.grep(u.childNodes),h),p&&(d=v),a=null):(a||(a=r.clone(g,!1),u.parentNode.insertBefore(a,u),f.push(a)),a.appendChild(u))}};Mh(u,h)})),!0===i.links&&Mh(f,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),Mh(xe.grep(t.childNodes),e)};e(t)})),Mh(f,(function(u){var a=function(t){var e=0;return Mh(t.childNodes,(function(t){(function(t){return M(t)&&Mn(t)&&0===t.length})(t)||wl(t)||e++})),e}(u);!(f.length>1)&&r.isBlock(u)||0!==a?(Ll(i)||i.wrapper)&&(i.exact||1!==a||(u=function(t){var e,n=function(t){var e=!1;return Mh(t.childNodes,(function(t){if(function(t){return t&&1===t.nodeType&&!wl(t)&&!ll(t)&&!En(t)}(t))return e=t,!1})),e}(t);return n&&!wl(n)&&jd(r,n,i)&&(e=r.clone(n,!1),s(e),r.replace(e,t,!0),r.remove(n,!0)),e||t}(u)),function(t,e,n,r){Rh(e,(function(e){Rh(t.dom.select(e.inline,r),(function(r){lh(r)&&Eh(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";sh(t.select(r,n),(function(n){lh(n)&&sh(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))}(t,o,n,u),function(t,e,n,r,o){Wd(t,o.parentNode,n,r)&&Eh(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(Wd(t,i,n,r))return Eh(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&gh(r,hh(t,"fontSize"),ph(t,"backgroundColor",Nl(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Dl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(xe.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(gh(r,hh(t,"fontSize"),ph(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),mh(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(kl(r)){if(!l(o,r)){var d=a.createRng();d.setStartBefore(r),d.setEndAfter(r),f(a,Zl(t,d,o),0,!0)}}else f(a,r,0,!0);else if(u&&Ll(i)&&!of(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=fl(t.getBody(),i.getStart()))&&(o=Qg(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=Zl(t,u,t.formatter.get(e));m=Lf(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Kg||(s=t.getDoc(),l=Zg(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)}(t,e,n);else{var m=c.getNode(),g=o[0];t.settings.forced_root_block||!g.defaultBlock||a.getParent(m,a.isBlock)||Dh(t,g.defaultBlock),c.setRng(Pg(c.getRng())),df(c,!0,(function(e){ff(t,(function(e,n){var r=n?e:Zl(t,e,o);f(a,r)}))})),Ol(a,c,c.getRng()),t.nodeChanged()}!function(t,e){ch(uh[t],(function(t){t(e)}))}(e,t)}}else{r=c.getNode();for(var h=0,p=o.length;h<p;h++){var v=o[h];if(v.ceFalseOverride&&Il(v)&&a.is(r,v.selector))return void s(r,v)}}},Bh=function(t,e,n,r){return lt(t,(function(t,o){return!!mt(e,o)||(j(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},Ph=function(t,e,n,r,o){return null===e.get()&&function(t,e){var n=ra({});t.set({}),e.on("NodeChange",(function(r){!function(t,e,n,r){var o=rt(n.get()),i={},u={},a=W(Bl(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));it(r,(function(e,n){xe.each(a,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(j(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:a})})),i[n]=e.callbacks),u[n]=e.callbacks,!1):!Fd(t,r,n)&&void 0}))}));var c=Bh(n.get(),u,e,a);n.set(St(St({},i),c))}(e,r.element,n,t.get())}))}(e,t),function(t,e,n,r){var o=t.get();j(e.split(","),(function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)})),t.set(o)}(e,n,r,o),{unbind:function(){return function(t,e,n){var r=t.get();j(e.split(","),(function(t){r[t].callbacks=W(r[t].callbacks,(function(t){return t!==n})),0===r[t].callbacks.length&&delete r[t]})),t.set(r)}(e,n,r)}}},Ih=function(t,e){var n=(e||document).createDocumentFragment();return j(t,(function(t){n.appendChild(t.dom)})),Te(n)},Lh=function(t,e,n){return{element:t,width:e,rows:n}},Hh=function(t,e){return{element:t,cells:e}},Fh=function(t,e){return{x:t,y:e}},Vh=function(t,e){var n=parseInt($n(t,e),10);return isNaN(n)?1:n},jh=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Uh=function(t){return $(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},Wh=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Ne(o[i],e))return x.some(Fh(i,r));return x.none()},qh=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Hh(u[a].element,s))}return i},$h=function(t){return function(t,e){var n=_a(t.element),r=ke("tbody");return cn(r,e),an(n,r),n}(t,function(t){return V(t.rows,(function(t){var e=V(t.cells,(function(t){var e=Ea(t);return Xn(e,"colspan"),Xn(e,"rowspan"),e})),n=_a(t.element);return cn(n,e),n}))}(t))},Gh=function(t,e){return G(t,(function(t){return"li"===Me(t)&&cf(t,e)})).fold(l([]),(function(e){return function(t){return G(t,(function(t){return"ul"===Me(t)||"ol"===Me(t)}))}(t).map((function(t){var e=ke(Me(t));return function(t,e){var n=t.dom;it(e,(function(t,e){!function(t,e,n){if(!O(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);jn(t)&&t.style.setProperty(e,n)}(n,e,t)}))}(e,ft(Qn(t),(function(t,e){return Rt(e,"list-style")}))),[ke("li"),e]})).getOr([])}))},Xh=function(){return Ih([])},Kh=function(t,e){return n=Te(e.cloneContents()),r=function(t,e){var n=Te(e.commonAncestorContainer),r=Am(n,t),o=W(r,(function(t){return zr(t)||Rr(t)})),i=Gh(r,e),u=o.concat(i.length?i:function(t){return Ir(t)?je(t).filter(Pr).fold(l([]),(function(e){return[t,e]})):Pr(t)?[t]:[]}(n));return V(u,_a)}(t,e),o=$(r,(function(t,e){return an(e,t),e}),n),r.length>0?Ih([o]):o;var n,r,o},Yh=function(t,e){return(n=t,r=e[0],yr(r,"table",d(Ne,n))).bind((function(t){var n,r,o,i=e[0],u=e[e.length-1],a=function(t){var e=Lh(_a(t),0,[]);return j(va(t,"tr"),(function(t,n){j(va(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=Vh(o,"rowspan"),u=Vh(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Hh(Ea(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:_a(o)}}(e,function(t,e,n){for(;jh(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),Lh(e.element,Uh(e.rows),e.rows)}(t);return(n=a,r=i,o=u,Wh(n,r).bind((function(t){return Wh(n,o).map((function(e){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?qh(t,r,o,i,u):qh(t,r,u,i,o);return Lh(t.element,Uh(a),a)}(n,t,e)}))}))).map((function(t){return Ih([$h(t)])}))})).getOrThunk(Xh);var n,r},Jh=function(t,e){return e>=0&&e<t.length&&Cl(t.charAt(e))},Qh=function(t,e){var n=Wr(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Zh=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return x.from(t.selection.getRng()).map((function(e){var n=x.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=pe.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=Qh(u,i),c=Wr(u.textContent);if(t.dom.remove(u),Jh(c,0)||Jh(c,c.length-1)){var s=n.getOr(r),l=Qh(s,i),f=l.indexOf(a);return-1===f?a:(Jh(l,f-1)?" ":"")+a+(Jh(l,f+a.length)?" ":"")}return a})).getOr("")}(t);n.getInner=!0;var r=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=Pd(t,nf(o)),u=e.contextual?function(t,e){var n=rf(e,t);return n.length>0?Yh(t,n):function(t,e){return e.length>0&&e[0].collapsed?Xh():Kh(t,e[0])}(t,e)}(Te(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)},tp=function(t){return kn(t)?t.outerHTML:Mn(t)?Io.encodeRaw(t.data,!1):zn(t)?"\x3c!--"+t.data+"--\x3e":""},ep=function(t,e){var n,r,o,i,u,a,c,s,l,f=V(nt(e.childNodes),tp);return function(t,e){var n=0;j(t,(function(t){0===t[0]?n++:1===t[0]?(function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)}(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},np=ra(x.none()),rp=function(t){var e,n=(e=t.getBody(),W(V(nt(e.childNodes),tp),(function(t){return t.length>0}))),r=K(n,(function(e){var n=am(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},op=function(t,e,n){"fragmented"===e.type?ep(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},ip=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},up=function(t){var e=ke("body",np.get().getOrThunk((function(){var t=document.implementation.createHTMLDocument("undo");return np.set(x.some(t)),t})));return Oa(e,ip(t)),j(va(e,"*[data-mce-bogus]"),fn),e.dom.innerHTML},ap=function(t,e){return!(!t||!e)&&(!!function(t,e){return ip(t)===ip(e)}(t,e)||function(t,e){return up(t)===up(e)}(t,e))},cp=function(t){return 0===t.get()},sp=function(t,e,n){cp(n)&&(t.typing=e)},lp=function(t,e){t.typing&&(sp(t,!1,e),t.add())},fp=function(t){return t instanceof Jd},dp=function(t,e){qg(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},mp=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){cp(e)&&n.set(x.some(Ac(t.selection)))}(t,e,n)},addUndoLevel:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=rp(t);if(i=i||{},i=xe.extend(i,a),!1===cp(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&ap(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Ac(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,sp(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],op(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],op(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!ap(rp(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return lp(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];op(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r){return qd(t,e,n,r)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&Wd(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return Wd(t,e,n,r,o)},canApply:function(e){return function(t,e){var n,r,o,i,u,a=t.formatter.get(e),c=t.dom;if(a)for(n=t.selection.getStart(),r=Bl(c,n),i=a.length-1;i>=0;i--){if(!(u=a[i].selector)||a[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],u))return!0}return!1}(t,e)},closest:function(e){return function(t,e){var n=function(e){return Ne(e,Te(t.getBody()))};return x.from(t.selection.getStart(!0)).bind((function(r){return Ld(Te(r),(function(n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n]);if(r.isSome())return r}return x.none()}(e,(function(e){return function(e,n){return Wd(t,e.dom,n)?x.some(n):x.none()}(n,e)}))}),n)})).getOrNull()}(t,e)},apply:function(e,n,r){return Dh(t,e,n,r)},remove:function(e,n,r,o){return Nh(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!qd(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Dh(t,e,n,r):Nh(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o){return Ph(t,e,n,r,o)}},editor:{getContent:function(e,n){return function(t,e,n){return x.from(t.getBody()).fold(l("tree"===e.format?new Jd("body",11):""),(function(r){return function(t,e,n,r){var o;return e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),o="raw"===e.format?xe.trim(cm(t.serializer,r.innerHTML)):"text"===e.format?t.dom.isEmpty(r)?"":Wr(r.innerText||r.textContent):"tree"===e.format?t.serializer.serialize(r,e):function(t,e){var n=zc(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,e)),H(["text","tree"],e.format)||Fr(Te(r))?e.content=o:e.content=xe.trim(o),e.no_events||t.fire("GetContent",e),e.content}(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=$g(e)?"":e,n.no_events||t.fire("BeforeSetContent",n),$g(e)||(e=n.content),x.from(t.getBody()).fold(l(e),(function(r){return $g(e)?function(t,e,n,r){qg(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tm({validate:t.validate},t.schema).serialize(n);return r.content=Fr(Te(e))?o:xe.trim(o),Gg(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),(o=zc(t))&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,Dc(t),n)):n||(n='<br data-mce-bogus="1">'),Gg(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=tm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=Fr(Te(e))?n:xe.trim(n),Gg(t,r.content),r.no_events||t.fire("SetContent",r)),r.content}(t,r,e,n)}))}(t,e,n)},insertContent:function(e,n){return Ug(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=M(e)?e:t.getBody();N(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),j(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Zh(t,e,n)}},raw:{getModel:function(){return x.none()}}}},gp=function(t){return mt(t.plugins,"rtc")},hp=function(t){return t.rtcInstance?t.rtcInstance:mp(t)},pp=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},vp=function(t){return 0===t.dom.length?(ln(t),x.none()):x.some(t)},bp=function(t,e,n,r){t.bind((function(t){return(r?og:rg)(t.dom,r?t.dom.length:0),e.filter(Pe).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(ig(o,i,!1,!r),n.setStart(i,u)):(ig(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return yf.isBookmarkNode(t.dom)})).bind(e?We:Ue)}(e,r).or(e).filter(Pe).map((function(t){return function(t,e){je(t).each((function(n){var r=t.dom;e&&Km(n,cc(r,0))?rg(r,0):!e&&Ym(n,cc(r,r.length))&&og(r,r.length)}))}(t,r)}))}))},yp=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=W(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}},wp=function(t){return!!t.select},xp=function(t){return!(!t||!t.ownerDocument)&&Re(Te(t.ownerDocument),Te(t))},Cp=function(t,e,n,r){var o,i,u=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};xe.each(n,(function(e,n){xe.each(i,(function(o){if(t.is(o,n))return r[n]||(xe.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),xe.each(r,(function(t,e){u[e]||(delete r[e],xe.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){yp(n,o,i),yp(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return function(t,e,n){void 0===n&&(n={});var r=function(t,e){return St(St({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e);if(r.no_events||!(r=t.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,St(St({isRootContent:!0,forced_root_block:!1},o),e));return tm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,r);var o=t.selection.getRng();!function(t,e){var n=x.from(e.firstChild).map(Te),r=x.from(e.lastChild).map(Te);t.deleteContents(),t.insertNode(e);var o=n.bind(Ue).filter(Pe).bind(vp),i=r.bind(We).filter(Pe).bind(vp);bp(o,n,t,!0),bp(i,r,t,!1),t.collapse(!1)}(o,o.createContextualFragment(n.content)),t.selection.setRng(o),ud(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)}(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var l=e.document;if(null==l)return null;if(void 0!==r.bookmark&&!1===Nd(r)){var f=xd(r);if(f.isSome())return f.map((function(t){return Pd(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Sn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=Pd(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!wp(t)||xp(t.startContainer)&&xp(t.endContainer))}(t)){var u=wp(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||pe.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Sn(n)||Sn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(sf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return pp(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)}(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return x.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(sf(t,o,e,!0),sf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Bd(r.nextSibling,!0):r.parentNode,o=0===u?Bd(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return zd(r.getBody(),l(),t)},getEnd:function(t){return Dd(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||zd(u,e,e.collapsed),t.isBlock),r=t.getParent(r||Dd(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Ar(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(nf(n).length>1)&&lf(r)){var o=Pf(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?rd:id)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(Tf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?cc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=yf(m),h=kf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Sp=function(t,e){var n=di();e.convert_fonts_to_spans&&function(t,e,n){t.addNodeFilter("font",(function(t){j(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){j(["color","face","size"],(function(e){t.attr(e,null)}))}(t)}))}))}(t,n,xe.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){j(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},kp=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Op=function(t,e){var n;try{n=atob(e)}catch(t){return x.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return x.some(new Blob([r],{type:t}))},Tp=function(t){return 0===t.indexOf("blob:")?function(t){return new Cr((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===this.status?e(this.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new Cr((function(t){var n=kp(e),r=n.type,o=n.data;Op(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},_p=0,Ep=function(t){return(t||"blobid")+_p++};function Ap(t,e){var n={};return{findAll:function(r,o){o||(o=v);var i=W(function(t){return t?nt(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!pe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===pe.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),u=V(i,(function(t){if(void 0!==n[t.src])return new Cr((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Cr((function(n,r){!function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=kp(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){(function(t){return new Cr((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=kp(u).data,i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))}(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Cr.all(u)}}}var Np,Rp,Mp=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Jd("br",1)).shortEnded=!0:r.empty().append(new Jd("#text",3)).value=Vr},zp=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Dp=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Bp=xe.makeMap,Pp=xe.each,Ip=xe.explode,Lp=xe.extend,Hp=function(t,e){void 0===e&&(e=Go());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e,u,a;(u=t.name)in n&&((a=o[u])?a.push(t):o[u]=[t]),e=r.length;for(;e--;)(u=r[e].name)in t.attributes.map&&((a=i[u])?a.push(t):i[u]=[t]);return t},a={schema:e,addAttributeFilter:function(t,e){Pp(Ip(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Pp(Ip(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v,b=[];c=c||{},o={},i={};var y=Lp(Bp("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=e.getNonEmptyElements(),x=e.children,C=t.validate,S=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),k=e.getWhiteSpaceElements(),O=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,_=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;p=k.hasOwnProperty(c.context)||k.hasOwnProperty(t.root_name);var A=function(t,e){var r,i=new Jd(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){var n,r,o,i,u=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!u[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},R=um({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(A("#cdata",4)).value=t},text:function(t,e){var n;p||(t=t.replace(_," "),function(t,e){return t&&(e[t.name]||"br"===t.name)}(v.lastChild,y)&&(t=t.replace(O,""))),0!==t.length&&((n=A("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(A("#comment",8)).value=t},pi:function(t,e){v.append(A(t,7)).value=e,N(v)},doctype:function(t){v.append(A("#doctype",10)).value=t,N(v)},start:function(t,n,o){var u,a,c,s,l=C?e.getElementRule(t):{};if(l){for((u=A(l.outputName||t,1)).attributes=n,u.shortEnded=o,v.append(u),(s=x[v.name])&&x[u.name]&&!s[u.name]&&b.push(u),a=r.length;a--;)(c=r[a].name)in n.map&&((g=i[c])?g.push(u):i[c]=[u]);y[t]&&N(u),o||(v=u),!p&&k[t]&&(p=!0)}},end:function(n){var r,o,i,u,a=C?e.getElementRule(n):{};if(a){if(y[n]&&!p){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(O,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(p&&k[n]&&(p=!1),a.removeEmpty&&Dp(e,w,k,v))return u=v.parent,y[v.name]?v.empty().remove():v.unwrap(),void(v=u);a.paddEmpty&&(function(t){return zp(t,"#text")&&t.firstChild.value===Vr}(v)||Dp(e,w,k,v))&&Mp(t,c,y,v),v=v.parent}}},e),M=v=new Jd(c.context||t.root_name,11);if(R.parse(a,c.format),C&&b.length&&(c.context?c.invalid=!0:function(t){var n,r,o,i,a,c,s,l,f,d,m,g=Bp("tr,td,th,tbody,thead,tfoot,table"),h=e.getNonEmptyElements(),p=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if((r=t[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!g[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),a=c=u(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(c.name,i[f].name)?(s=u(i[f].clone()),c.append(s)):s=c,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,s.append(l),l=m;c=s}Dp(e,h,p,a)?o.insert(r,i[0],!0):(o.insert(a,i[0],!0),o.insert(r,a)),o=i[0],(Dp(e,h,p,o)||zp(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ol"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ol"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(u(new Jd("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(u(new Jd("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}}(b)),S&&("body"===M.name||c.isRootContent)&&function(){var n,r,o=M.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(O,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(e.isValidChild(M.name,S.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=A(S,1)).attr(t.forced_root_block_attrs),M.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!c.invalid){for(h in o)if(o.hasOwnProperty(h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return M}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=xe.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Dp(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&Mp(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new Jd("#text",3)).value=Vr,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(void 0,r=(n=i.attr("rel"))?xe.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Jd("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e,r,o,i,u,a,c,s=t.length,l=n.getValidClasses();s--;){for(r=(e=t[s]).attr("class").split(" "),u="",o=0;o<r.length;o++)i=r[o],c=!1,(a=l["*"])&&a[i]&&(c=!0),a=l[e.name],!c&&a&&a[i]&&(c=!0),c&&(u&&(u+=" "),u+=i);u.length||(u=null),e.attr("class",u)}})),function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(function(t){return t.attr("src")===pe.transparentSrc||t.attr("data-mce-placeholder")})(t)||function(t){return t.attr("data-mce-bogus")}(t)||(r=i,o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r),o?x.some({type:o[1],data:decodeURIComponent(o[2])}):x.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),it(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return x.from(n.getByData(r,e)).orThunk((function(){return Op(e,r).map((function(t){var e=n.create(Ep(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return j(t,r)}))}(t,e)}(a,t),function(t,e){e.inline_styles&&Sp(t,e)}(a,t),a},Fp=function(t,e,n){-1===xe.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},Vp=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Qu.DOM,o=e&&e.schema?e.schema:Go(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=Hp(t,o);return function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o,i,u=t.length,a="data-mce-"+r,c=e.url_converter,s=e.url_converter_scope;u--;)void 0!==(i=(o=t[u]).attr(a))?(o.attr(r,i.length>0?i:null),o.attr(a,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))})),t.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r,o=t.length;o--;)"bookmark"!==(r=t[o]).attr("data-mce-type")||n.cleanup||(x.from(r.firstChild).exists((function(t){return!Ur(t.value)}))?r.unwrap():r.remove())})),t.addNodeFilter("noscript",(function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=Io.decode(e.value))})),t.addNodeFilter("script,style",(function(t,n){for(var r,o,i,u=t.length,a=function(t){return t.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,"")};u--;)o=(r=t[u]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+a(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+a(o)+"\n--\x3e")})),t.addNodeFilter("#comment",(function(t){for(var r,o=t.length;o--;)r=t[o],e.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),t.addAttributeFilter("data-mce-type",(function(e){j(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r),{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=St({format:"html"},u),c=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o,i=t.dom;e=e.cloneNode(!0);var u=document.implementation;return u.createHTMLDocument&&(r=u.createHTMLDocument(""),xe.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){r.body.appendChild(r.importNode(t,!0))})),e="BODY"!==e.nodeName?r.body.firstChild:r.body,o=i.doc,i.doc=r),function(t,e){t.fire("PreProcess",e)}(t,St(St({},n),{node:e})),o&&(i.doc=o),e}(t,e,n):e}(e,n,a),s=function(t,e,n){var r=Wr(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||Fr(Te(e))?r:xe.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?St({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,St(St({},e),{content:n})).content:n}(t,o,function(t,e,n){return tm(t,e).serialize(n)}(e,n,r))}(e,t,o,l,a)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:d(Fp,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},jp=function(t,e){var n=Vp(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Up=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return hp(t).editor.setContent(e,n)}(t,e,n)},Wp=Qu.DOM,qp=function(t){return x.from(t).each((function(t){return t.destroy()}))},$p=Object.prototype.hasOwnProperty,Gp=(Np=function(t,e){return T(t)&&T(e)?Gp(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)$p.call(o,i)&&(n[i]=Np(n[i],o[i]))}return n}),Xp=ae().deviceType,Kp=Xp.isTouch(),Yp=Xp.isPhone(),Jp=Xp.isTablet(),Qp=["lists","autolink","autosave"],Zp={table_grid:!1,object_resizing:!1,resize:!1},tv=function(t){var e=_(t)?t.join(" "):t,n=V(O(e)?e.split(" "):[],zt);return W(n,(function(t){return t.length>0}))},ev=function(t,e){return t.sections().hasOwnProperty(e)},nv=function(t,e){return dt(t,"toolbar_mode").orThunk((function(){return dt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},rv=function(t,e){var n={resize:!1,toolbar_mode:nv(t,"scrolling"),toolbar_sticky:!1};return St(St(St({},Zp),n),e?{menubar:!1}:{})},ov=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?xe.extend({},t.external_plugins,n):n},iv=function(t,e,n,r){var o=tv(n.forced_plugins),i=tv(r.plugins),u=function(t,e){return ev(t,e)?t.sections()[e]:{}}(e,"mobile"),a=function(t,e){return[].concat(tv(t)).concat(tv(e))}(o,function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return ev(t,e)&&"mobile"===r[e].theme}(e,"mobile")?W(r,d(H,Qp)):t&&ev(e,"mobile")?r:n}(t,e,i,u.plugins?tv(u.plugins):i));if(pe.browser.isIE()&&H(a,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return xe.extend(r,{plugins:a.join(" ")})},uv=function(t,e,n,r,o){var i=t?{mobile:rv(o.mobile||{},e)}:{},u=function(t,e){var n=lt(e,(function(e,n){return H(t,n)}));return function(t,e){return{sections:l(t),settings:l(e)}}(n.t,n.f)}(["mobile"],Gp(i,o)),a=xe.extend(n,r,u.settings(),function(t,e){return t&&ev(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return xe.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:ov(r,u.settings())});return iv(t,u,r,a)},av=function(t,e,n){return x.from(e.settings[n]).filter(t)},cv=(Rp={},{add:function(t,e){Rp[t]=e},get:function(t){return Rp[t]?Rp[t]:{icons:{}}},has:function(t){return mt(Rp,t)}}),sv=function(t,e){return e.dom[t]},lv=function(t,e){return parseInt(Kn(e,t),10)},fv=d(sv,"clientWidth"),dv=d(sv,"clientHeight"),mv=d(lv,"margin-top"),gv=d(lv,"margin-left"),hv=function(t,e,n){var r=Te(t.getBody()),o=t.inline?r:Te(Fe(r).dom.documentElement),i=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+gv(e):0),y:r-(t?o.top+e.dom.clientTop+mv(e):0)}}(t.inline,o,e,n);return function(t,e,n){var r=fv(t),o=dv(t);return e>=0&&n>=0&&e<=r&&n<=o}(o,i.x,i.y)};function pv(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return x.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){X(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&function(t){var e;return(e=t.inline?t.getBody():t.getContentAreaContainer(),x.from(e).map(Te)).map(dn).getOr(!1)}(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),G(e,(function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(u,(function(){i(a),o(),r().fold((function(){return t.focus()}),(function(t){return Te(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",St({},a)),a}))};return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1)})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Tr.requestAnimationFrame(o)})),t.on("remove",(function(){j(e.slice(),(function(t){n().close(t)}))}))}(t),{open:u,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:function(){return e}}}var vv=sa.PluginManager,bv=sa.ThemeManager,yv=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=W(e,(function(t){return t!==n}))).length&&t.focus()},i=function(n){t.editorManager.setActive(t),wd(t);var r=n();return function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)}(r),r};return t.on("remove",(function(){j(e,(function(t){n().close(t)}))})),{open:function(t,e){return i((function(){return n().open(t,e,o)}))},openUrl:function(t){return i((function(){return n().openUrl(t,o)}))},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){x.from(e[e.length-1]).each((function(t){n().close(t),o(t)}))}}},wv=function(t,e){t.notificationManager.open({type:"error",text:e})},xv=function(t,e){t._skinLoaded?wv(t,e):t.on("SkinLoaded",(function(){wv(t,e)}))},Cv=function(t,e,n){!function(t,e,n){t.fire(e,n)}(t,e,{message:n}),console.error(n)},Sv=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},kv=function(t,e,n){Cv(t,"PluginLoadError",Sv("plugin",e,n))},Ov=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,kt([t],e)):r.log.apply(r,kt([t],e)))};function Tv(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);u&&"string"==typeof u.location?n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o)):r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){xe.each(n[t],(function(t){t(e)})),delete n[t]};return!1===z(e.handler)&&(e.handler=r),{upload:function(a,c){return e.url||e.handler!==r?function(r,a){return r=xe.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Cr.all(xe.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Cr((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new Cr((function(a){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||(c||(c=r()),c.progressBar.value(t))}))}catch(t){a(i(e,t.message,{}))}}))}(r,e.handler,a)})))}(a,c):new Cr((function(t){t([])}))}}}var _v=0,Ev=function(t){return t+_v+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e};var Av,Nv=xe.each,Rv=Qu.DOM,Mv=function(t,e){var n,r,o,i=e&&e.schema||Go({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Rv.create(r.name);return function(t,e){e.classes.length&&Rv.addClass(t,e.classes.join(" ")),Rv.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==xe.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Rv.create("div")).appendChild(t),xe.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Rv.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},zv=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=xe.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==xe.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},Dv=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return O(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=dt(e,"preview");if(c.is(!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),xe.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=xe.map(t.split(/(?:~\+|~|\+)/),zv),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Mv(l,t)):r=Mv([n],t);var f=Rv.select(n,r)[0]||r.firstChild;return Nv(e.styles,(function(t,e){var n=a(t);n&&Rv.setStyle(f,e,n)})),Nv(e.attributes,(function(t,e){var n=a(t);n&&Rv.setAttrib(f,e,n)})),Nv(e.classes,(function(t){var e=a(t);Rv.hasClass(f,e)||Rv.addClass(f,e)})),t.fire("PreviewFormats"),Rv.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Rv.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Nv(u.split(" "),(function(e){var n=Rv.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Rv.getStyle(t.getBody(),e,!0),"#ffffff"===Rv.toHex(n).toLowerCase())||"color"===e&&"#000000"===Rv.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Rv.remove(r),i},Bv=function(t){var e=function(t){var e={},n=function(t,r){t&&("string"!=typeof t?xe.each(t,(function(t,e){n(e,t)})):(_(r)||(r=[r]),xe.each(r,(function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),e[t]=r))};return n(function(t){var e={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",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",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"}],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",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",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:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],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",defaultBlock:"p",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:function(t,e,n){return kn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){xe.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 xe.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return t?e[t]:e},has:function(t){return mt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}}(t),n=ra(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();eh(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Kg||eh(t,fl(r,n.getStart())),37!==e&&39!==e||eh(t,fl(r,n.getStart()))}(t,e.keyCode)}))}(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){pp(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){pp(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){pp(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r){return function(t,e,n,r){return pp(t).formatter.match(e,n,r)}(t,e,n,r)},closest:function(e){return function(t,e){return pp(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return pp(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return pp(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return pp(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o){return function(t,e,n,r,o){return void 0===o&&(o=!1),pp(t).formatter.formatChanged(e,n,r,o)}(t,n,e,r,o)},getCssText:d(Dv,t)}},Pv=function(t){var e=ra(x.none()),n=ra(0),r=ra(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){pp(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return pp(t).undoManager.addUndoLevel(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return pp(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return pp(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){pp(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){pp(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return pp(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return pp(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return pp(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){pp(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){pp(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return gp(t)||function(t,e,n){var r=ra(!1),o=function(t){sp(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(lp(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===ap(rp(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),sp(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Iv=[9,27,Cf.HOME,Cf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Cf.DOWN,Cf.UP,Cf.LEFT,Cf.RIGHT].concat(pe.browser.isFirefox()?[224]:[]),Lv="data-mce-placeholder",Hv=function(t){return"keydown"===t.type||"keyup"===t.type},Fv=function(t){var e=t.keyCode;return e===Cf.BACKSPACE||e===Cf.DELETE},Vv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,jv=function(t,e){return Ee(Te(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Uv=function(t,e,n){var r=function(t,e,n){return W(Qu.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return x.from(r[r.length-1])},Wv=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Xr(n)?Mn(n.nextSibling)?cc(n.nextSibling,0):cc.after(n):Jr(e)?cc(n,r+1):e:Xr(n)?Mn(n.previousSibling)?cc(n.previousSibling,n.previousSibling.data.length):cc.before(n):Qr(e)?cc(n,r-1):e},qv=d(Wv,!0),$v=d(Wv,!1),Gv=function(t,e){return Re(t,e)?br(e,(function(t){return Br(t)||Ir(t)}),function(t){return function(e){return Ne(t,Te(e.dom.parentNode))}}(t)):x.none()},Xv=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Kv=function(t,e){return{from:t,to:e}},Yv=function(t,e){var n=Te(t),r=Te(e.container());return Gv(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},Jv=function(t){var e=Ge(t);return X(e,Mr).fold((function(){return e}),(function(t){return e.slice(0,t)}))},Qv=function(t){var e=Jv(t);return j(e,ln),e},Zv=function(t,e){var n=Am(e,t);return G(n.reverse(),(function(t){return wo(t)})).each(ln)},tb=function(t,e,n,r){if(wo(n))return Tm(n),al(n.dom);0===W(qe(r),(function(t){return!wo(t)})).length&&wo(e)&&rn(r,ke("br"));var o=ul(n.dom,cc.before(r.dom));return j(Qv(e),(function(t){rn(r,t)})),Zv(t,e),o},eb=function(t,e,n){if(wo(n))return ln(n),wo(e)&&Tm(e),al(e.dom);var r=cl(n.dom);return j(Qv(e),(function(t){an(n,t)})),Zv(t,e),r},nb=function(t,e){ol(t,e.dom).map((function(t){return t.getNode()})).map(Te).filter(Dr).each(ln)},rb=function(t,e,n){return nb(!0,e),nb(!1,n),function(t,e){return Re(e,t)?function(t,e){var n=Am(e,t);return x.from(n[n.length-1])}(e,t):x.none()}(e,n).fold(d(eb,t,e,n),d(tb,t,e,n))},ob=function(t,e,n,r){return e?rb(t,r,n):rb(t,n,r)},ib=function(t,e){var n=Te(t.getBody()),r=function(t,e,n){return n.collapsed?function(t,e,n){var r=Yv(t,cc.fromRangeStart(n)),o=r.bind((function(n){return el(e,t,n.position).bind((function(n){return Yv(t,n).map((function(n){return function(t,e,n){return Pn(n.position.getNode())&&!1===wo(n.block)?ol(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?el(e,t,r).bind((function(e){return Yv(t,e)})):x.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Ra(r,o,Kv).filter((function(t){return function(t){return!1===Ne(t.from.block,t.to.block)}(t)&&function(t){return je(t.from.block).bind((function(e){return je(t.to.block).filter((function(t){return Ne(e,t)}))})).isSome()}(t)&&function(t){return!1===Hn(t.from.block.dom)&&!1===Hn(t.to.block.dom)}(t)}))}(t,e,n):x.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ob(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},ub=function(t,e){var n=Te(e),r=d(Ne,t);return vr(n,Hr,r).isSome()},ab=function(t){var e=Te(t.getBody());return function(t,e){var n=ul(t.dom,cc.fromRangeStart(e)).isNone(),r=il(t.dom,cc.fromRangeEnd(e)).isNone();return!function(t,e){return ub(t,e.startContainer)||ub(t,e.endContainer)}(t,e)&&n&&r}(e,t.selection.getRng())?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ra(Gv(t,Te(n.startContainer)),Gv(t,Te(n.endContainer)),(function(r,o){return!1===Ne(r,o)&&(n.deleteContents(),ob(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},cb=function(t,e){return!t.selection.isCollapsed()&&ab(t)},sb=Ln,lb=Hn,fb=function(t,e,n,r,o){return x.from(e._selectionOverrides.showCaret(t,n,r,o))},db=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?x.none():x.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},mb=function(t,e,n){var r=Bs(1,t.getBody(),e),o=cc.fromRangeStart(r),i=o.getNode();if(gs(i))return fb(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(gs(u))return fb(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return lb(t)||sb(t)}));return gs(a)?fb(1,t,a,!1,n):x.none()},gb=function(t,e,n){return e.collapsed?mb(t,e,n).getOr(e):e},hb=function(t){return km(t)||wm(t)},pb=function(t){return Om(t)||xm(t)},vb=function(t,e,n,r,o,i){return fb(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},bb=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Mn(n.commonAncestorContainer))return!1;var r=e?ac.Forwards:ac.Backwards,o=Js(t.getBody()),i=d(Hs,e?o.next:o.prev),u=e?hb:pb,a=Is(r,t.getBody(),n),c=Wv(e,i(a));if(!c||!Fs(a,c))return!1;if(u(c))return vb(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Fs(c,s))&&vb(t,n,a.getNode(),r,e,s)}(t,e)},yb=mr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),wb=function(t,e,n){return el(e,t,n).bind((function(r){return o=r.getNode(),Hr(Te(o))||Ir(Te(o))||function(t,e,n,r){var o=function(e){return zr(Te(e))&&!Es(n,r,t)};return Ps(!e,n).fold((function(){return Ps(e,r).fold(p,o)}),o)}(t,e,n,r)?x.none():e&&Hn(r.getNode())||!1===e&&Hn(r.getNode(!0))?function(t,e,n,r){var o=r.getNode(!1===e);return Gv(Te(t),Te(n.getNode())).map((function(t){return wo(t)?yb.remove(t.dom):yb.moveToElement(o)})).orThunk((function(){return x.some(yb.moveToElement(o))}))}(t,e,n,r):e&&Om(n)||!1===e&&km(n)?x.some(yb.moveToPosition(r)):x.none();var o}))},xb=function(t,e){return x.from(wf(t.getBody(),e))},Cb=function(t,e){var n=t.selection.getNode();return xb(t,n).filter(Hn).fold((function(){return function(t,e,n){var r=Bs(e?1:-1,t,n),o=cc.fromRangeStart(r),i=Te(t);return!1===e&&Om(o)?x.some(yb.remove(o.getNode(!0))):e&&km(o)?x.some(yb.remove(o.getNode())):!1===e&&km(o)&&Vm(i,o)?jm(i,o).map((function(t){return yb.remove(t.getNode())})):e&&Om(o)&&Fm(i,o)?Um(i,o).map((function(t){return yb.remove(t.getNode())})):function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return kn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Hn(e.nextSibling)?x.some(yb.moveToElement(e.nextSibling)):!1===t&&Hn(e.previousSibling)?x.some(yb.moveToElement(e.previousSibling)):x.none()}(e,n.getNode(!1===e)).fold((function(){return wb(t,e,n)}),x.some):wb(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return x.some(yb.remove(t))}),(function(t){return x.some(yb.moveToElement(t))}),(function(n){return Es(e,n,t)?x.none():x.some(yb.moveToPosition(n))}))}(t,n,e)}))}(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0}}(t,e),function(t,e){return function(n){var r=e?cc.before(n):cc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),v)},Sb=function(t){var e=t.dom,n=t.selection,r=wf(t.getBody(),n.getNode());if(Ln(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(cc.before(o).toRange())}return!0},kb=function(t,e){return t.selection.isCollapsed()?Cb(t,e):function(t,e){var n=t.selection.getNode();return!!Hn(n)&&xb(t,n.parentNode).filter(Hn).fold((function(){var n;return n=Te(t.getBody()),j(va(n,".mce-offscreen-selection"),ln),mg(t,e,Te(t.selection.getNode())),Xv(t),!0}),(function(){return!0}))}(t,e)},Ob=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return el(e,t.getBody(),n).filter((function(t){return e?bm(t):ym(t)})).bind((function(t){return x.from(As(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Tb=Mn,_b=function(t){return Tb(t)&&t.data[0]===jr},Eb=function(t){return Tb(t)&&t.data[t.data.length-1]===jr},Ab=function(t){return t.ownerDocument.createTextNode(jr)},Nb=function(t,e){return t?function(t){if(Tb(t.previousSibling))return Eb(t.previousSibling)||t.previousSibling.appendData(jr),t.previousSibling;if(Tb(t))return _b(t)||t.insertData(0,jr),t;var e=Ab(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Tb(t.nextSibling))return _b(t.nextSibling)||t.nextSibling.insertData(0,jr),t.nextSibling;if(Tb(t))return Eb(t)||t.appendData(jr),t;var e=Ab(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Rb=d(Nb,!0),Mb=d(Nb,!1),zb=function(t,e){return Mn(t.container())?Nb(e,t.container()):Nb(e,t.getNode())},Db=function(t,e){var n=e.get();return n&&t.container()===n&&Xr(n)},Bb=function(t,e){return e.fold((function(e){us(t.get());var n=Rb(e);return t.set(n),x.some(cc(n,n.length-1))}),(function(e){return al(e).map((function(e){if(Db(e,t))return cc(t.get(),1);us(t.get());var n=zb(e,!0);return t.set(n),cc(n,1)}))}),(function(e){return cl(e).map((function(e){if(Db(e,t))return cc(t.get(),t.get().length-1);us(t.get());var n=zb(e,!1);return t.set(n),cc(n,n.length-1)}))}),(function(e){us(t.get());var n=Mb(e);return t.set(n),x.some(cc(n,1))}))},Pb=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return x.none()},Ib=mr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Lb=function(t,e){return _s(e,t)||t},Hb=function(t,e,n){var r=qv(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return il(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.before(t)}))}),x.none)},Fb=function(t,e){return null===fl(t,e)},Vb=function(t,e,n){return Uv(t,e,n).filter(d(Fb,e))},jb=function(t,e,n){var r=$v(n);return Vb(t,e,r).bind((function(t){return ul(t,r).isNone()?x.some(Ib.start(t)):x.none()}))},Ub=function(t,e,n){var r=qv(n);return Vb(t,e,r).bind((function(t){return il(t,r).isNone()?x.some(Ib.end(t)):x.none()}))},Wb=function(t,e,n){var r=$v(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return ul(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.after(t)}))}),x.none)},qb=function(t){return!1===(e=Gb(t),"rtl"===Qu.DOM.getStyle(e,"direction",!0)||(n=e.textContent,Vv.test(n)));var e,n},$b=function(t,e,n){return Pb([Hb,jb,Ub,Wb],[t,e,n]).filter(qb)},Gb=function(t){return t.fold(f,f,f,f)},Xb=function(t){return t.fold(l("before"),l("start"),l("end"),l("after"))},Kb=function(t){return t.fold(Ib.before,Ib.before,Ib.after,Ib.after)},Yb=function(t){return t.fold(Ib.start,Ib.start,Ib.end,Ib.end)},Jb=function(t,e,n,r,o,i){return Ra(Uv(e,n,r),Uv(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=_s(e,t),o=_s(n,t);return r&&r===o}(n,e,r)?Ib.after(t?e:r):i})).getOr(i)},Qb=function(t,e){return t.fold(v,(function(t){return r=e,!(Xb(n=t)===Xb(r)&&Gb(n)===Gb(r));var n,r}))},Zb=function(t,e){return t?e.fold(s(x.some,Ib.start),x.none,s(x.some,Ib.after),x.none):e.fold(x.none,s(x.some,Ib.before),x.none,s(x.some,Ib.end))},ty=function(t,e,n,r){var o=Wv(t,r),i=$b(e,n,o);return $b(e,n,o).bind(d(Zb,t)).orThunk((function(){return function(t,e,n,r,o){var i=Wv(t,o);return el(t,n,i).map(d(Wv,t)).fold((function(){return r.map(Kb)}),(function(o){return $b(e,n,o).map(d(Jb,t,e,n,i,o)).filter(d(Qb,r))})).filter(qb)}(t,e,n,i,r)}))},ey=(d(ty,!1),d(ty,!0),function(t,e,n){var r=t?1:-1;return e.setRng(cc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0}),ny=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},ry=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},oy=function(t,e,n){return Bb(e,n).map((function(e){return ny(t,e),n}))},iy=function(t,e,n){return!!Yc(t)&&function(t,e,n){var r=t.getBody(),o=cc.fromRangeStart(t.selection.getRng()),i=d(jv,t);return ty(n,i,r,o).bind((function(n){return oy(t,e,n)}))}(t,e,n).isSome()},uy=function(t,e,n){return!!Yc(e)&&function(t,e){var n=e.selection.getRng(),r=t?cc.fromRangeEnd(n):cc.fromRangeStart(n);return!!function(t){return z(t.selection.getSel().modify)}(e)&&(t&&Jr(r)?ey(!0,e.selection,r):!(t||!Qr(r))&&ey(!1,e.selection,r))}(t,e)},ay=function(t){var e=ra(null),n=d(jv,t);return t.on("NodeChange",(function(r){!Yc(t)||pe.browser.isIE()&&r.initial||(function(t,e,n){var r=V(va(Te(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=W(r,t),i=W(n,t);j(Q(o,i),d(ry,!1)),j(Q(i,o),d(ry,!0))}(n,t.dom,r.parents),function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=cc.fromRangeStart(t.selection.getRng());cc.isTextPosition(n)&&!1===function(t){return Jr(t)||Qr(t)}(n)&&(ny(t,is(e.get(),n)),e.set(null))}}(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=W(r,t);j(o,(function(r){var o=cc.fromRangeStart(e.selection.getRng());$b(t,e.getBody(),o).bind((function(t){return oy(e,n,t)}))}))}}(n,t,e,r.parents))})),e},cy=d(uy,!0),sy=d(uy,!1),ly=function(t,e){return function(n){return Bb(e,n).exists((function(e){return ny(t,e),!0}))}},fy=function(t,e,n,r){var o=t.getBody(),i=d(jv,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),$b(i,o,cc.fromRangeStart(t.selection.getRng())).map(Yb).map(ly(t,e))})),t.nodeChanged()},dy=function(t,e,n){if(t.selection.isCollapsed()&&Yc(t)){var r=cc.fromRangeStart(t.selection.getRng());return function(t,e,n,r){var o=function(t,e){return _s(e,t)||t}(t.getBody(),r.container()),i=d(jv,t),u=$b(i,o,r);return u.bind((function(t){return n?t.fold(l(x.some(Yb(t))),x.none,l(x.some(Kb(t))),x.none):t.fold(x.none,l(x.some(Kb(t))),x.none,l(x.some(Yb(t))))})).map(ly(t,e)).getOrThunk((function(){var a=nl(n,o,r),c=a.bind((function(t){return $b(i,o,t)}));return Ra(u,c,(function(){return Uv(i,o,r).exists((function(e){return!!function(t){return Ra(al(t),cl(t),(function(e,n){var r=Wv(!0,e),o=Wv(!1,n);return il(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(mg(t,n,Te(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?fy(t,e,r,o):fy(t,e,o,r),!0}))}))})).getOr(!1)}))}(t,e,n,r)}return!1},my=function(t){return 1===Ge(t).length},gy=function(t,e){var n=Te(t.getBody()),r=Te(t.selection.getStart()),o=W(function(t,e){var n=Am(e,t);return X(n,Mr).fold(l(n),(function(t){return n.slice(0,t)}))}(n,r),my);return et(o).exists((function(n){var r,i=cc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ra(al(n),cl(n),(function(r,o){var i=Wv(!0,r),u=Wv(!1,o),a=Wv(!1,e);return t?il(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):ul(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,ll(r.dom)&&Jg(r.dom))||(function(t,e,n,r){var o=d(ih,e),i=V(W(r,o),(function(t){return t.dom}));if(0===i.length)mg(e,t,n);else{var u=function(t,e){var n=Zg(!1),r=rh(e,n.dom);return rn(Te(t),n),ln(Te(t)),cc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}}(e,t,n,o),0))}))},hy=function(t,e){return!!t.selection.isCollapsed()&&gy(t,e)},py=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0},vy=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?wm:xm,r=e?ac.Forwards:ac.Backwards,o=Is(r,t.getBody(),t.selection.getRng());return n(o)?py(t,e,o.getNode(!e)):x.from(Wv(e,o)).filter((function(t){return n(t)&&Fs(o,t)})).exists((function(n){return py(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Vn(n)&&py(t,e,n)}(t,e)},by=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},yy=function(t,e){return(t||"table"===Me(e)?"margin":"padding")+("rtl"===Kn(e,"direction")?"-right":"-left")},wy=function(t){var e=Cy(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return Y(e,(function(e){var n=yy(qc(t),e),r=Jn(e,n).map(by).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},xy=function(t){return Pr(t)||Ir(t)},Cy=function(t){return W(V(t.selection.getSelectedBlocks(),Te),(function(t){return!xy(t)&&!function(t){return je(t).map(xy).getOr(!1)}(t)&&br(t,(function(t){return Ln(t.dom)||Hn(t.dom)})).exists((function(t){return Ln(t.dom)}))}))},Sy=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=qc(t),s=zc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),j(Cy(t),(function(t){!function(t,e,n,r,o,i){var u=yy(n,Te(i));if("outdent"===e){var a=Math.max(0,by(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else a=by(i.style[u])+r+o,t.setStyle(i,u,a)}(n,e,c,a,u,t.dom)}))},ky=function(t,e){if(t.selection.isCollapsed()&&wy(t)){var n=t.dom,r=t.selection.getRng(),o=cc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dm(Te(i),o))return Sy(t,"outdent"),!0}return!1},Oy=function(t,e){t.getDoc().execCommand(e,!1,null)},Ty=function(t){return void 0===t.touches||1!==t.touches.length?x.none():x.some(t.touches[0])},_y=function(t,e){return t.hasOwnProperty(e.nodeName)},Ey=function(t,e){return!!Mn(e)||!!kn(e)&&!_y(t,e)&&!wl(e)},Ay=function(t,e){if(Mn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||_y(t,e.nextSibling)))return!0}return!1},Ny=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=zc(t);if(c&&kn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return F(Em(Te(n),Te(e)),(function(e){return _y(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=Nd(t);for(c=s.firstChild;c;)if(Ey(a,c)){if(Ay(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,Dc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},Ry=function(t,e){e.hasAttribute("data-mce-caret")&&(eo(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},My=function(t,e){var n=function(t){return wr(Te(t.getBody()),"*[data-mce-caret]").fold(l(null),(function(t){return t.dom}))}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Ry(t,n)):void(Yr(n)&&(Ry(t,n),t.undoManager.add()))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(Av||(Av={}));var zy,Dy=function(t,e){return t===ac.Backwards?J(e):e},By=function(t,e,n){return t===ac.Forwards?e.next(n):e.prev(n)},Py=function(t,e,n,r){return Pn(r.getNode(e===ac.Forwards))?Av.Br:!1===Es(n,r)?Av.Block:Av.Wrap},Iy=function(t,e,n,r){for(var o,i=Js(n),u=r,a=[];u&&(o=By(e,i,u));){if(Pn(o.getNode(!1)))return e===ac.Forwards?{positions:Dy(e,a).concat([o]),breakType:Av.Br,breakAt:x.some(o)}:{positions:Dy(e,a),breakType:Av.Br,breakAt:x.some(o)};if(o.isVisible()){if(t(u,o)){var c=Py(0,e,u,o);return{positions:Dy(e,a),breakType:c,breakAt:x.some(o)}}a.push(o),u=o}else u=o}return{positions:Dy(e,a),breakType:Av.Eol,breakAt:x.none()}},Ly=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===ac.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Hy=function(t,e){return $(t,(function(t,n){return t.fold((function(){return x.some(n)}),(function(r){return Ra(tt(r.getClientRects()),tt(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),x.none())},Fy=function(t,e){return tt(e.getClientRects()).bind((function(e){return Hy(t,e.left)}))},Vy=d(Iy,uc.isAbove,-1),jy=d(Iy,uc.isBelow,1),Uy=d(Ly,-1,Vy),Wy=d(Ly,1,jy),qy=function(t){var e=function(e){return V(e,(function(e){return(e=za(e)).node=t,e}))};if(kn(t))return e(t.getClientRects());if(Mn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},$y=function(t){return K(t,qy)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(zy||(zy={}));var Gy,Xy,Ky=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i,c,l;for(l=$y([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(c=l[i],!n(c,s)){if(a.length>0&&e(c,Ct(a))&&u++,c.line=u,o(c))return!0;a.push(c)}},s=Ct(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Ts(r,t,mo,e);)if(n(r))return}(t,r,c,l),a},Yy=d(Ky,zy.Up,Pa,Ia),Jy=d(Ky,zy.Down,Ia,Pa),Qy=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Zy=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},tw=Hn,ew=Ts,nw=function(t,e){return Math.abs(t.left-e)},rw=function(t,e){return Math.abs(t.right-e)},ow=function(t,e){return t>=e.left&&t<=e.right},iw=function(t,e){return t>=e.top&&t<=e.bottom},uw=function(t,e){return wt(t,(function(t,n){var r=Math.min(nw(t,e),rw(t,e)),o=Math.min(nw(n,e),rw(n,e));return ow(e,n)?n:ow(e,t)?t:o===r&&tw(n.node)||o<r?n:t}))},aw=function(t,e,n,r,o){var i=ew(r,t,mo,e,!o);do{if(!i||n(i))return}while(i=ew(i,t,mo,e))},cw=function(t,e){t.selection.setRng(e),ud(t,t.selection.getRng())},sw=function(t,e,n){return x.some(gb(t,e,n))},lw=function(t,e,n,r,o,i){var u=e===ac.Forwards,a=Js(t.getBody()),c=d(Hs,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Ha(n);if(i(l))return fb(e,t,l,e===ac.Backwards,!1)}var f=Is(e,t.getBody(),n);if(s(f))return db(t,f.getNode(!u));var m=Wv(u,c(f)),g=function(t){return Gr(t.startContainer)}(n);if(!m)return g?x.some(n):x.none();if(s(m))return fb(e,t,m.getNode(!u),u,!1);var h=c(m);return h&&s(h)&&Fs(m,h)?fb(e,t,h.getNode(!u),u,!1):g?sw(t,m.toRange(),!1):x.none()},fw=function(t,e,n,r,o,i){var u=Is(e,t.getBody(),n),a=Ct(u.getClientRects()),c=e===zy.Down;if(!a)return x.none();var s,l=(c?Jy:Yy)(t.getBody(),Qy(1),u),f=W(l,Zy(1)),d=a.left,m=uw(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return fb(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Ha(n)){var p=function(t,e,n,r){var o,i,u,a,c,s=Js(e),l=[],f=0,d=function(t){return Ct(t.getClientRects())};1===t?(o=s.next,i=Ia,u=Pa,a=cc.after(r)):(o=s.prev,i=Pa,u=Ia,a=cc.before(r));var m=d(a);do{if(a.isVisible()&&!u(c=d(a),m)){if(l.length>0&&i(c,Ct(l))&&f++,(c=za(c)).position=a,c.line=f,n(c))return l;l.push(c)}}while(a=o(a));return l}(e,t.getBody(),Qy(1),s),v=uw(W(p,Zy(1)),d);if(v)return sw(t,v.position.toRange(),!1);if(v=Ct(W(p,Zy(0))))return sw(t,v.position.toRange(),!1)}return 0===f.length?dw(t,c).filter(c?o:r).map((function(e){return gb(t,e.toRange(),!1)})):x.none()},dw=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=cc.fromRangeEnd(n),i=jy(r,o);return et(i.positions)}return o=cc.fromRangeStart(n),i=Vy(r,o),tt(i.positions)},mw=function(t,e,n){return dw(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},gw=Hn,hw=function(t,e,n){var r=Js(t.getBody()),o=d(Hs,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==zc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(cc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(zc(t));return(!pe.ie||pe.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},pw=function(t,e){return function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return function(t,e,n){return lw(e,t,n,km,Om,gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},vw=function(t,e){return function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return fw(e,t,n,(function(t){return km(t)||Cm(t)}),(function(t){return Om(t)||Sm(t)}),gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},bw=function(t,e){return mw(t,e,e?Om:km)},yw=function(t){return H(["figcaption"],Me(t))},ww=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},xw=function(t,e,n){n?an(t,e):un(t,e)},Cw=function(t,e){var n=Te(t.getBody()),r=cc.fromRangeStart(t.selection.getRng()),o=zc(t),i=Dc(t);return function(t,e){var n=d(Ne,e);return br(Te(t.container()),Mr,n).filter(yw)}(r,n).exists((function(){if(function(t,e,n){return e?function(t,e){return jy(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Vy(t,e).breakAt.isNone()}(t.dom,n)}(n,e,r)){var u=function(t,e,n,r){return""===e?function(t,e){var n=ke("br");return xw(t,n,e),ww(n)}(t,r):function(t,e,n,r){var o=ke(n),i=ke("br");return qn(o,r),an(o,i),xw(t,o,e),ww(i)}(t,r,e,n)}(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},Sw=function(t,e){return!!t.selection.isCollapsed()&&Cw(t,e)},kw=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},Ow=function(t,e){return G(function(t,e){return K(function(t){return V(t,(function(t){return St({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:c},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))}(t,e),(function(t){return t.action()}))},Tw=function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return lw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},_w=function(t,e){var n=e?1:-1,r=t.selection.getRng();return fw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},Ew=function(t,e){return mw(t,e,e?xm:wm)},Aw=function(t,e,n,r,o){var i=va(Te(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return $(t,(function(t,r){return t.fold((function(){return x.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return x.some(i<o?r:t)}))}),x.none())}(W(function(t,e){return K(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+-2,bottom:t.bottom+-2,width:t.width+e,height:t.height+e}}(za(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},Nw=d(Aw,(function(t){return t.bottom}),(function(t,e){return t.y<e})),Rw=d(Aw,(function(t){return t.top}),(function(t,e){return t.y>e})),Mw=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===Av.Wrap&&0===t.positions.length}(r)||!Pn(n.getNode())&&function(t){return t.breakType===Av.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},zw=d(Mw,Vy),Dw=d(Mw,jy),Bw=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!ms()||!function(t,e,n){var r=cc.fromRangeStart(e);return ol(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n)||(fb(i,t,n,!e,!1).each((function(e){cw(t,e)})),0))},Pw=function(t,e,n){var r=function(t,e){var n=e.getNode(t);return kn(n)&&"TABLE"===n.nodeName?x.some(n):x.none()}(!!e,n),o=!1===e;r.fold((function(){return cw(t,n.toRange())}),(function(r){return ol(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return cw(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=zc(e);o?e.undoManager.transact((function(){var r=ke(o);qn(r,Dc(e)),an(r,ke("br")),t?on(Te(n),r):rn(Te(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),cw(e,i)})):cw(e,r.toRange())}(e,t,r,n)}))}))},Iw=function(t,e,n,r){var o=t.selection.getRng(),i=cc.fromRangeStart(o),u=t.getBody();if(!e&&zw(r,i)){var a=function(t,e,n){return function(t,e){return tt(e.getClientRects()).bind((function(e){return Nw(t,e.left,e.top)})).bind((function(t){return Fy(cl(n=t).map((function(t){return Vy(n,t).positions.concat(t)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Uy(t,cc.before(e)),n.left)}))})).getOr(cc.before(e))}(u,n,i);return Pw(t,e,a),!0}return!(!e||!Dw(r,i))&&(a=function(t,e,n){return function(t,e){return et(e.getClientRects()).bind((function(e){return Rw(t,e.left,e.top)})).bind((function(t){return Fy(al(n=t).map((function(t){return[t].concat(jy(n,t).positions)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Wy(t,cc.after(e)),n.left)}))})).getOr(cc.after(e))}(u,n,i),Pw(t,e,a),!0)},Lw=function(t,e,n){return x.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return x.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},Hw=function(t,e){return Lw(t,e,Bw)},Fw=function(t,e){return Lw(t,e,Iw)},Vw=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(Vr),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Ar(e,e);n=c.current();){if(Mn(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Pn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),ud(t,a)}},jw=function(t){return x.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},Uw=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},Ww=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},qw=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},$w=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!kn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},Gw=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},Xw=function(t){t.innerHTML='<br data-mce-bogus="1">'},Kw=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},Yw=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},Jw=function(t,e,n){return!1===Mn(e)?n:t?1===n&&e.data.charAt(n-1)===jr?0:n:n===e.data.length-1&&e.data.charAt(n)===jr?e.data.length:n},Qw=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Zw=function(t,e){var n=zc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;x.from(n.style).map(r.parseStyle).each((function(t){var n=Qn(Te(e)),o=St(St({},n),t);r.setStyles(e,o)}));var o=x.from(n.class).map((function(t){return t.split(/\s+/)})),i=x.from(e.className).map((function(t){return W(t.split(/\s+/),(function(t){return""!==t}))}));Ra(o,i,(function(t,n){var o=W(n,(function(e){return!H(t,e)})),i=kt(t,o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=ft(n,(function(t,e){return!H(u,e)}));r.setAttribs(e,a)}(t,e,Dc(t))},tx=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(ll(a)||wl(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return Zw(t,n),Xw(u),n},v=function(t){var e,n,u=Jw(t,r,o);if(Mn(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&kn(r)&&r===i.firstChild)return!0;if(Kw(r,"TABLE")||Kw(r,"HR"))return f&&!t||!f&&t;var a=new Ar(r,i);for(Mn(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(kn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Mn(e)&&!ho(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&Yw(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),Vw(t,u)};Pf(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=zc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);kn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Mn(r)?r.nodeValue.length:0);var x=Qw(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=Qw(d,r);if(!(u=d.getParent(r,d.isBlock))||!Yw(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),Zw(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),Zw(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;Ww(a=n)&&Ww(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if($w(n,r,!0)&&$w(n,r,!1))Uw(n,"LI")?i.insertAfter(c,qw(n)):i.replace(c,n);else if($w(n,r,!0))Uw(n,"LI")?(i.insertAfter(c,qw(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n);else if($w(n,r,!1))i.insertAfter(c,qw(n));else{n=qw(n);var s=u.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var l=s.extractContents();"LI"===o&&function(t,e){return t.firstChild&&"LI"===t.firstChild.nodeName}(l)?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n))}i.remove(r),Vw(t,c)}}(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Gr(i)?(u=eo(i),d.isEmpty(i)&&Xw(i),Zw(t,u),Vw(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),Vw(t,Kw(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,Jw(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,Jw(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){j(pa(Te(t),Pe),(function(t){var e=t.dom;e.nodeValue=Wr(e.nodeValue)}))}(a=n.extractContents()),function(t){do{Mn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;kn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||Gw(t,o))&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&Xw(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(Zw(t,u),Vw(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},ex=function(t,e,n){var r=t.create("span",{}," ");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},nx=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},rx=function(t,e){var n=ke("br");rn(Te(e),n),t.undoManager.add()},ox=function(t,e){ix(t.getBody(),e)||on(Te(e),ke("br"));var n=ke("br");on(Te(e),n),ex(t.dom,t.selection,n.dom),nx(t.dom,t.selection,n.dom,!1),t.undoManager.add()},ix=function(t,e){return n=cc.after(e),!!Pn(n.getNode())||il(t,cc.after(e)).map((function(t){return Pn(t.getNode())})).getOr(!1);var n},ux=function(t){return t&&"A"===t.nodeName&&"href"in t},ax=function(t){return t.fold(p,ux,ux,p)},cx=function(t,e){e.fold(c,d(rx,t),d(ox,t),c)},sx=function(t,e){var n=function(t){var e=d(jv,t),n=cc.fromRangeStart(t.selection.getRng());return $b(e,t.getBody(),n).filter(ax)}(t);n.isSome()?n.each(d(cx,t)):function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();Pf(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Ar(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),lc(i,u,n),ex(i,o,n),nx(i,o,n,r),t.undoManager.add()}(t,e)},lx=function(t,e){return jw(t).filter((function(t){return e.length>0&&Ee(Te(t),e)})).isSome()},fx=mr([{br:[]},{block:[]},{none:[]}]),dx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},mx=function(t){return function(e,n){return""===zc(e)===t}},gx=function(t){return function(e,n){return function(t){return jw(t).filter((function(t){return Ir(Te(t))})).isSome()}(e)===t}},hx=function(t,e){return function(n,r){return function(t){return jw(t).fold(l(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},px=function(t){return hx("pre",t)},vx=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},bx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},yx=function(t,e){return e},wx=function(t){var e=zc(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},xx=function(t,e){return function(n,r){return $(t,(function(t,e){return t&&e(n,r)}),!0)?x.some(e):x.none()}},Cx=function(t,e){(function(t,e){return Pb([xx([dx],fx.none()),xx([hx("summary",!0)],fx.br()),xx([px(!0),vx(!1),yx],fx.br()),xx([px(!0),vx(!1)],fx.block()),xx([px(!0),vx(!0),yx],fx.block()),xx([px(!0),vx(!0)],fx.br()),xx([gx(!0),yx],fx.br()),xx([gx(!0)],fx.block()),xx([mx(!0),yx,wx],fx.block()),xx([mx(!0)],fx.br()),xx([bx],fx.br()),xx([mx(!1),yx],fx.br()),xx([wx],fx.block())],[t,!(!e||!e.shiftKey)]).getOr(fx.none())})(t,e).fold((function(){sx(t,e)}),(function(){tx(t,e)}),c)},Sx=ae().browser,kx=function(t,e){var n=e.container(),r=e.offset();return Mn(n)?(n.insertData(r,t),x.some(uc(n,r+t.length))):Ls(e).map((function(n){var r=Oe(t);return e.isAtEnd()?on(n,r):rn(n,r),uc(r.dom,t.length)}))},Ox=d(kx,Vr),Tx=d(kx," "),_x=function(t,e){return function(n){return function(t,e){return!Xm(e)&&(function(t,e){return function(t,e){return ul(t.dom,e).isNone()}(t,e)||function(t,e){return il(t.dom,e).isNone()}(t,e)||Dm(t,e)||Bm(t,e)||Vm(t,e)||Fm(t,e)}(t,e)||$m(t,e)||Gm(t,e))}(t,n)?Ox(e):Tx(e)}},Ex=function(t){var e=cc.fromRangeStart(t.selection.getRng()),n=Te(t.getBody());if(t.selection.isCollapsed()){var r=d(jv,t),o=cc.fromRangeStart(t.selection.getRng());return $b(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return ul(t.dom,cc.before(e))}),(function(t){return al(t)}),(function(t){return cl(t)}),(function(e){return il(t.dom,cc.after(e))}))}}(n)).bind(_x(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},Ax=function(t){var e=ay(t);return function(t){t.on("keyup compositionstart",d(My,t))}(t),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ae().os;Ow([{keyCode:Cf.RIGHT,action:kw(pw,t,!0)},{keyCode:Cf.LEFT,action:kw(pw,t,!1)},{keyCode:Cf.UP,action:kw(vw,t,!1)},{keyCode:Cf.DOWN,action:kw(vw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Hw,t,!0)},{keyCode:Cf.LEFT,action:kw(Hw,t,!1)},{keyCode:Cf.UP,action:kw(Fw,t,!1)},{keyCode:Cf.DOWN,action:kw(Fw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Tw,t,!0)},{keyCode:Cf.LEFT,action:kw(Tw,t,!1)},{keyCode:Cf.UP,action:kw(_w,t,!1)},{keyCode:Cf.DOWN,action:kw(_w,t,!0)},{keyCode:Cf.RIGHT,action:kw(iy,t,e,!0)},{keyCode:Cf.LEFT,action:kw(iy,t,e,!1)},{keyCode:Cf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(cy,t,e)},{keyCode:Cf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(sy,t,e)},{keyCode:Cf.UP,action:kw(Sw,t,!1)},{keyCode:Cf.DOWN,action:kw(Sw,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))}(t,e),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){Ow([{keyCode:Cf.BACKSPACE,action:kw(ky,t,!1)},{keyCode:Cf.BACKSPACE,action:kw(kb,t,!1)},{keyCode:Cf.DELETE,action:kw(kb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(bb,t,!1)},{keyCode:Cf.DELETE,action:kw(bb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(dy,t,e,!1)},{keyCode:Cf.DELETE,action:kw(dy,t,e,!0)},{keyCode:Cf.BACKSPACE,action:kw(Bg,t,!1)},{keyCode:Cf.DELETE,action:kw(Bg,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(Ob,t,!1)},{keyCode:Cf.DELETE,action:kw(Ob,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(vy,t,!1)},{keyCode:Cf.DELETE,action:kw(vy,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(cb,t,!1)},{keyCode:Cf.DELETE,action:kw(cb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(ib,t,!1)},{keyCode:Cf.DELETE,action:kw(ib,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(hy,t,!1)},{keyCode:Cf.DELETE,action:kw(hy,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.BACKSPACE,action:kw(Sb,t)},{keyCode:Cf.DELETE,action:kw(Sb,t)}],e)}(t,e)}))}(t,e),function(t){t.on("keydown",(function(e){e.keyCode===Cf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Cx(t,e)})))}(t,e)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.SPACEBAR,action:kw(Ex,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),function(t){!function(t){var e=la((function(){t.composing||eg(t)}),0);Sx.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&eg(t)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.END,action:kw(bw,t,!0)},{keyCode:Cf.HOME,action:kw(bw,t,!1)},{keyCode:Cf.END,action:kw(Ew,t,!0)},{keyCode:Cf.HOME,action:kw(Ew,t,!1)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),e},Nx=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&_f(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!pe.range&&t.selection.isCollapsed()||lf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&lf(t)&&("IMG"===t.selection.getNode().nodeName?Tr.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Rx=function(t){return kn(t)&&Br(Te(t))},Mx=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},zx=Hn,Dx=Ln,Bx=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},Px=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},Ix=function(t){t.on((function(t){Px(t.ghost)})),t.clear()},Lx=function(t){var e,n=(e=ra(x.none()),{clear:function(){return e.set(x.none())},set:function(t){return e.set(x.some(t))},isSet:function(){return e.get().isSome()},on:function(t){return e.get().each(t)}}),r=Qu.DOM,o=document,i=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=G(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(zx,Dx)).getOr(null);if(a=e.getBody(),zx(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Bx(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}}(n,t),u=function(t,e){var n=Tr.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,function(t,e){return n=function(t){return t.inline?Mx(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Mx(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o}(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(n,t),a=function(t,e){return function(n){t.on((function(t){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!zx(e)}(e,3===(i=e.selection.getSel().getRangeAt(0).startContainer).nodeType?i.parentNode:i,t.element)){var r=((o=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),o);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Px(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var o,i})),Ix(t)}}(n,t),c=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Ix(t)}}(n,t);t.on("mousedown",i),t.on("mousemove",u),t.on("mouseup",a),r.bind(o,"mousemove",u),r.bind(o,"mouseup",c),t.on("remove",(function(){r.unbind(o,"mousemove",u),r.unbind(o,"mouseup",c)}))},Hx=Ln,Fx=Hn,Vx=function(t,e){return wf(t.getBody(),e)},jx=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=ds(t,i,o,(function(){return Nd(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Fx(t)||Vn(t))&&r.isChildOf(t,i)},l=function(t){t&&n.setRng(t)},f=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},g=function(t){return Kr(t)||Zr(t)||to(t)},h=function(t){return g(t.startContainer)||g(t.endContainer)},p=function(o,u){if(!o)return null;if(o.collapsed){if(!h(o)){var l=u?1:-1,f=Is(l,i,o),d=f.getNode(!u);if(hs(d))return m(l,d,!!u&&!f.isAtEnd(),!1);var g=f.getNode(u);if(hs(g))return m(l,g,!u&&!f.isAtEnd(),!1)}return null}var p=o.startContainer,v=o.startOffset,y=o.endOffset;if(3===p.nodeType&&0===v&&Fx(p.parentNode)&&(p=p.parentNode,v=r.nodeIndex(p),p=p.parentNode),1!==p.nodeType)return null;if(y===v+1&&p===o.endContainer){var w=p.childNodes[v];if(s(w))return function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var s=function(e,o,i){var u=t.$,c=wr(Te(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&pe.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(Vr).append(o).append(Vr),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),l=Te(o);return j(va(Te(t.getBody()),"*[data-mce-selected]"),(function(t){Ne(l,t)||Xn(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,b(),s}(w)}return null},v=function(){e&&e.removeAttribute(c),wr(Te(t.getBody()),"#"+a).each(ln),e=null},b=function(){u.hide()};return pe.ceFalse&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&hv(t,e.clientX,e.clientY)&&mb(t,n,!1).each(l)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Fx(o)&&(e.preventDefault(),t.focus()),Hx(o)&&r.isChildOf(o,n.getNode())&&v())})),t.on("blur NewBlock",v),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var c=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!(!a||e===c||!r.isChildOf(a,c)||!1!==Fx(Vx(t,a)))||a&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=Js(t);if(!t.firstChild)return!1;var n,r=cc.before(t.firstChild),o=e.next(r);return o&&!(km(n=o)||Om(n)||wm(n)||xm(n))}(a)};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Fx(r)?(e.preventDefault(),db(t,r).each(p)):s(n)&&db(t,n).each(p)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hv(t,e.clientX,e.clientY)){var u=Vx(t,o);if(u)Fx(u)?(e.preventDefault(),db(t,u).each(p)):(v(),Hx(u)&&e.shiftKey||xf(e.clientX,e.clientY,n.getRng())||(b(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))db(t,o).each(p);else if(!1===hs(o)){v(),b();var a=function(t,e,n){var r=$y(function(t){return W(nt(t.getElementsByTagName("*")),hs)}(t)),o=W(r,d(iw,n)),i=uw(o,e);if(i){var u=!An(i.node)&&!Vn(i.node);if((i=uw(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=W($y([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),aw(zy.Up,t,d(o,Pa),e.node,n),aw(zy.Down,t,d(o,Ia),e.node,n),r}(t,i,u),e))&&hs(i.node))return function(t,e){return{node:t.node,before:nw(t,e)<rw(t,e)}}(i,e)}return null}(i,e.clientX,e.clientY);if(a&&!c(o,a.node)){e.preventDefault();var f=m(1,a.node,a.before,!1);t.getBody().focus(),l(f)}}}})),t.on("keypress",(function(t){Cf.modifierPressed(t)||Fx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(e){e.range=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return mt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),mt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o}(e.range);var n=p(e.range,e.forward);n&&(e.range=n)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;h(n)||"mcepastebin"===o.id||b(),e=o,r.hasClass(e,"mce-offscreen-selection")||v()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!pe.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),function(t){Lx(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(zx(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.defaultPrevented){var n=e.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&xv(t,"Dropped file type is not supported"))}},n=function(n){Od(t,n.target)&&e(n)},r=function(){var r=Qu.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];j(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){j(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){Tr.setEditorTimeout(t,r,0)}))}(t)}(t),function(t){var e=la((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=gb(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Vn(n)){var r=wf(t.getBody(),n),o=Hn(r)?r:n;t.selection.getNode()!==o&&db(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(eo(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:b,destroy:function(){u.destroy(),e=null}}},Ux=Qu.DOM,Wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},qx=function(t){return ft(t,(function(t){return!1===N(t)}))},$x=function(t){var e=t.settings,n=t.editorUpload.blobCache;return qx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Wx(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},Gx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),function(t){var e=t.dom.getRoot();t.inline||lf(t)&&t.selection.getStart(!0)!==e||al(e).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;pe.browser.isIE()?function(t,e){var n=Te(t.getBody()),r=(vd(t)?x.from(e):x.none()).map(bd).filter(pd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))}(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Tr.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Xx=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,Ux.setAttrib(o,"spellcheck","false")),t.quirks=function(t){var e,n,r,o=xe.each,i=Cf.BACKSPACE,u=Cf.DELETE,a=t.dom,c=t.selection,s=t.parser,l=pe.gecko,f=pe.ie,d=pe.webkit,m="data:text/mce-internal,",g=f?"Text":"URL",h=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},p=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",(function(t){if(!p(t)&&t.keyCode===i&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(pe.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))};return t.on("keydown",(function(e){var n,r;if(!p(e)&&e.keyCode===Cf.BACKSPACE){var o=(n=c.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),c.setRng(n))}}})),e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",(function(n){var r,o,c=n.keyCode;if(!p(n)&&(c===u||c===i)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!a.isEmpty(o))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),o.firstChild&&a.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}})),pe.windowsPhone||t.on("keyup focusin mouseup",(function(t){Cf.modifierPressed(t)||c.normalize()}),!0),d&&(t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Kr(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)})),t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))})),zc(t)&&t.on("init",(function(){h("DefaultParagraphSeparator",zc(t))})),t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))})),b(),s.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),pe.iOS?(t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()})),y(),t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),pe.ie>=11&&(y(),b()),pe.ie&&(v(),h("AutoUrlDetect",!1),t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&c.select(e.target),(n=t.selection.getContent()).length>0&&(r=m+escape(t.id)+","+escape(n),e.dataTransfer.setData(g,r)))}(e)})),t.on("drop",(function(e){if(!p(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(g))&&e.indexOf(m)>=0?(e=e.substr(m.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Tf(e.x,e.y,t.getDoc());c.setRng(r),o=n.html,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:!0}):t.execCommand("mceInsertContent",!1,o)}}var o}))),l&&(t.on("keydown",(function(e){if(!p(e)&&e.keyCode===i){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!p(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Tr.setEditorTimeout(t,(function(){n.focus()}))}})),n=function(){var e=a.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),o(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!c.isCollapsed()&&a.getParent(c.getStart(),a.isBlock)!==a.getParent(c.getEnd(),a.isBlock)},t.on("keypress",(function(e){var o;if(!p(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(e){var o;!p(e)&&r()&&(o=n(),Tr.setEditorTimeout(t,(function(){o()})))})),function(t){return t.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",(function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),$c(t)||h("enableObjectResizing",!1)})),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||o(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))})),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),pe.mac&&t.on("keydown",(function(e){!Cf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})),b()),{refreshContentEditable:function(){},isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}}(t),function(t){t.fire("PostRender")}(t);var i=function(t){return t.getParam("directionality",aa.isRtl()?"rtl":void 0)}(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",(function(t){xe.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),t.contentStyles.length>0){var u="";xe.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}!function(t,e){var n=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader}(t),r=function(){t.on("remove",(function(){return n.unloadAll(e)})),Gx(t)};n.loadAll(e,r,r)}(t,t.contentCSS),n.content_style&&function(t,e){var n=Te(t.getBody()),r=en(tn(n)),o=ke("style");Wn(o,"type","text/css"),an(o,Oe(e)),an(r,o),t.on("remove",(function(){ln(o)}))}(t,n.content_style)},Kx=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Ux.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Ux.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=function(t){var e,n,r,o,i,u=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||Ev("blobid"),r=t.name||n,o=t.blob;return{id:l(n),name:l(r),filename:l(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:l(o),base64:l(t.base64),blobUri:l(t.blobUri||URL.createObjectURL(o)),uri:l(t.uri)}},n=function(e){return G(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(O(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(T(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=W(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){j(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),a=(r={},o=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:i=function(t){return t in r},getResultUri:function(t){var e=r[t];return e?e.resultUri:null},isPending:function(t){return!!i(t)&&1===r[t].status},isUploaded:function(t){return!!i(t)&&2===r[t].status},markPending:function(t){r[t]=o(1,null)},markUploaded:function(t,e){r[t]=o(2,e)},removeFailed:function(t){delete r[t]},destroy:function(){r={}}}),c=[],s=function(t){var e=ra(null);return t.on("change AddUndo",(function(t){e.set(St({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;et(n).filter((function(t){return!ap(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:Z(n,n.length-2).getOrNull()})}))}}}(t),f=function(e){return function(n){return t.selection?e(n):[]}},d=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},m=function(t,e,n){var r='src="'+n+'"'+(n===pe.transparentSrc?' data-mce-placeholder="1"':"");return t=d(t,'src="'+e+'"',r),d(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},g=function(e,n){j(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=V(t.fragments,(function(t){return m(t,e,n)})):t.content=m(t.content,e,n)}))},h=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},p=function(n){return e||(e=Tv(a,{url:Lc(t),basePath:Hc(t),credentials:Fc(t),handler:Vc(t)})),w().then(f((function(r){var o=V(r,(function(t){return t.blobInfo}));return e.upload(o,h).then(f((function(e){var o=[],i=V(e,(function(e,n){var i=r[n].blobInfo,a=r[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(u.removeByUri(a.src),function(e,n){var r,o=t.convertURL(n,"src");g(e.src,n),t.$(e).attr({src:Pc(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(a,e.url)):e.error&&(e.error.options.remove&&(g(a.getAttribute("src"),pe.transparentSrc),o.push(a)),function(t,e){xv(t,aa.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:i}}));return i.length>0&&s.fireIfChanged(),o.length>0&&(gp(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){j(o,(function(e){t.dom.remove(e),u.removeByUri(e.src)}))}))),n&&n(i),i})))})))},b=function(e){if(Bc(t))return p(e)},y=function(e){return!1!==Y(c,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",v,"function")}(t)(e))},w=function(){return n||(n=Ap(a,u)),n.findAll(t.getBody(),y).then(f((function(e){return e=W(e,(function(e){return"string"!=typeof e||(xv(t,e),!1)})),j(e,(function(t){g(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=a.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=$(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){Bc(t)?b():w()})),t.on("RawSaveContent",(function(t){t.content=x(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=x(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){j(t,(function(t){var e=t.attr("src");if(!u.getByUri(e)){var n=a.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:u,addFilter:function(t){c.push(t)},uploadImages:p,uploadImagesAuto:b,scanForImages:w,destroy:function(){u.destroy(),a.destroy(),n=e=null}}}(t),t.schema=Go(n),t.dom=Qu(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:jc(t),referrerPolicy:Uc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Hp($x(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Jd("br",1)).shortEnded=!0)}})),e}(t),t.serializer=jp(function(t){var e=t.settings;return St(St({},$x(t)),qx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=Cp(t.dom,t.getWin(),t.serializer,t),t.annotator=vf(t),t.formatter=Bv(t),t.undoManager=Pv(t),t._nodeChangeDispatcher=new Nx(t),t._selectionOverrides=jx(t),function(t){var e=ra(x.none()),n=ra(!1),r=fa((function(e){t.fire("longpress",St(St({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){Ty(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(x.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),Ty(o).each((function(r){e.get().each((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.set(x.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",St(St({},o),{type:"tap"}))}))}),!0)}(t),function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){j(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){j(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",O(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)}(t),gp(t)||function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=uc.fromRangeStart(e),r=uc.fromRangeEnd(e);if(uc.isElementPosition(n)){var o=n.container();Rx(o)&&al(o).each((function(t){return e.setStart(t.container(),t.offset())}))}uc.isElementPosition(r)&&(o=n.container(),Rx(o)&&cl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))),t.selection.setRng(Pg(e))}(t)}))}(t);var u=function(t){return gp(t)?ra(null):Ax(t)}(t);(function(t,e){t.addCommand("delete",(function(){!function(t,e){ky(t)||kb(t,!1)||bb(t,!1)||dy(t,e,!1)||ib(t,!1)||Bg(t)||Ob(t,!1)||vy(t,!1)||cb(t)||hy(t,!1)||(Oy(t,"Delete"),Xv(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){kb(t,!0)||bb(t,!0)||dy(t,e,!0)||ib(t,!0)||Bg(t)||Ob(t,!0)||vy(t,!0)||cb(t)||hy(t,!0)||Oy(t,"ForwardDelete")}(t,e)}))})(t,u),function(t){zc(t)&&t.on("NodeChange",d(Ny,t))}(t),function(t){var e=t.dom,n=zc(t),r=function(t){return t.getParam("placeholder",Nc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(Hv(t)){var e=t.keyCode;return!Fv(t)&&(Cf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||H(Iv,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return Hv(t)&&!(Fv(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(wo(Te(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,Lv)!==c||u)&&(e.setAttrib(a,Lv,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Tr.setEditorTimeout(t,(function(){return o(e)}))}))}))}(t),function(t){t.fire("PreInit")}(t),function(t){var e=t;return dt(t.plugins,"rtc").fold((function(){return e.rtcInstance=mp(t),x.none()}),(function(n){return x.some(n.setup().then((function(n){return e.rtcInstance=function(t,e){var n=function(t){return T(t)?t:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:c,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{match:function(t,r,o){return e.matchFormat(t,n(r))},matchAll:r,matchNode:r,canApply:function(t){return e.canApplyFormat(t)},closest:function(t){return e.closestFormat(t)},apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))},formatChanged:function(t,n,r,o){return e.formatChanged(n,r,o)}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=tm({inner:!0});return dp(t,o),"tree"===r?o:i.serialize(o)}return mp(t).editor.getContent(n,r)},setContent:function(n,r){var o=fp(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o,i=(o=t,x.from(o.selection.getStart(!0)).map((function(t){return t.nodeName.toLowerCase()}))).fold((function(){return{}}),(function(t){return{context:t}})),u=fp(n)?n:t.parser.parse(n,St(St({},i),{insert:!0}));e.insertContent(u)},addVisual:function(t){}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=tm({});return dp(t,o),"tree"===n?o:i.serialize(o)}return mp(t).selection.getContent(n,r)}},raw:{getModel:function(){return x.some(e.getRawModel())}}}}(t,n),n.isRemote})))}))}(t).fold((function(){Xx(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),Xx(t,e)}))}))},Yx=Qu.DOM,Jx=function(t,e){var n=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),r=function(t,e,n,r){var o=ke("iframe");return qn(o,r),qn(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),ga(o,"tox-edit-area__iframe"),o}(t.id,n,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom;r.onload=function(){r.onload=null,t.fire("load")};var o=function(t,e){if(document.domain!==window.location.hostname&&pe.browser.isIE()){var n=Ev("mce");t[n]=function(){Kx(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Yx.setAttrib(e,"src",r),!0}return!1}(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return Rc(t,"body_id","tinymce")}(t),r=function(t){return Rc(t,"body_class","")}(t);return Mc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Mc(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'}(t),Yx.add(e.iframeContainer,r),o},Qx=Qu.DOM,Zx=function(t,e,n){var r=vv.get(n),o=vv.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=xe.trim(n),r&&-1===xe.inArray(e,n)){if(xe.each(vv.dependencies(n),(function(n){Zx(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=aa.translate(["Failed to initialize plugin: {0}",e]);Ov(r,n),xv(t,r)}(t,n,e)}}},tC=function(t){return t.replace(/^\-/,"")},eC=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},nC=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,O(Xc(t))?function(t){return t.theme.renderUI()}(t):z(Xc(t))?function(t){var e=t.getElement(),n=Xc(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):function(t){var e=t.getElement();return t.inline?eC(null):function(t){var e=Qx.create("div");return Qx.insertAfter(e,t),eC(e)}(e)}(t)},rC=function(t){t.fire("ScriptsLoaded"),function(t){var e=xe.trim(Ic(t)),n=t.ui.registry.getAll().icons,r=St(St({},cv.get("default").icons),cv.get(e).icons);it(r,(function(e,r){mt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=Xc(t);if(O(e)){t.settings.theme=tC(e);var n=bv.get(e);t.theme=new n(t,bv.urls[e]),t.theme.init&&t.theme.init(t,bv.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];xe.each(Qc(t).split(/[ ,]/),(function(n){Zx(t,e,tC(n))}))}(t);var e=nC(t);!function(t,e){var n={show:x.from(e.show).getOr(c),hide:x.from(e.hide).getOr(c),disable:x.from(e.disable).getOr(c),isDisabled:x.from(e.isDisabled).getOr(p),enable:function(){t.mode.isReadOnly()||x.from(e.enable).map(h)}};t.ui=St(St({},t.ui),n)}(t,x.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,function(t){t.contentCSS=t.contentCSS.concat(function(t){var e=function(t){var e=t.getParam("content_css");return O(e)?V(e.split(","),zt):_(e)?e:!1===e||t.inline?[]:["default"]}(t),n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return V(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))}(t))}(t),t.inline?Kx(t):function(t,e){var n=Jx(t,e);e.editorContainer&&(Yx.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Yx.isHidden(e.editorContainer)),t.getElement().style.display="none",Yx.setAttrib(t.id,"aria-hidden","true"),n||Kx(t)}(t,n)},oC=Qu.DOM,iC=function(t){return"-"===t.charAt(0)},uC=function(t,e,n){return x.from(e).filter((function(t){return t.length>0&&!cv.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:x.some(e)}}))},aC=function(t,e){var n=na.ScriptLoader;!function(t,e,n,r){var o=Xc(e);if(O(o)){if(!iC(o)&&!bv.urls.hasOwnProperty(o)){var i=function(t){return t.getParam("theme_url")}(e);i?bv.load(o,e.documentBaseURI.toAbsolute(i)):bv.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){bv.waitFor(o,r)}))}else r()}(n,t,e,(function(){(function(t,e){var n=Wc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===aa.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,c,void 0,(function(){!function(t,e,n){Cv(t,"LanguageLoadError",Sv("language",e,n))}(e,o,n)}))}})(n,t),function(t,e,n){var r=uC(e,"default",n),o=function(t){return x.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:x.none()}}))}(e).orThunk((function(){return uC(e,Ic(e),"")}));j(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,c,void 0,(function(){!function(t,e,n){Cv(t,"IconsLoadError",Sv("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))}(n,t,e),function(t,e){xe.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){vv.load(n,e,c,void 0,(function(){kv(t,e,n)})),t.settings.plugins+=" "+n})),xe.each(Qc(t).split(/[ ,]/),(function(n){if((n=xe.trim(n))&&!vv.urls[n])if(iC(n)){n=n.substr(1,n.length);var r=vv.dependencies(n);xe.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=vv.createUrl(r,n);vv.load(o.resource,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};vv.load(n,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||rC(t)}),t,(function(){t.removed||rC(t)}))}))},cC={"font-size":"size","font-family":"face"},sC=function(t){return function(e,n){return x.from(n).map(Te).filter(Be).bind((function(n){return function(t,e,n){return Ld(Te(n),(function(e){return function(e){return Jn(e,t).orThunk((function(){return"font"===Me(e)?dt(cC,t).bind((function(t){return Gn(e,t)})):x.none()}))}(e)}),(function(t){return Ne(Te(e),t)}))}(t,e,n.dom).or(function(t,e){return x.from(Qu.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},lC=sC("font-size"),fC=s((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),sC("font-family")),dC=function(t){return al(t.getBody()).map((function(t){var e=t.container();return Mn(e)?e.parentNode:e}))},mC=function(t,e){return function(t){return x.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?x.none():x.from(t.selection.getStart(!0))}))}(t).orThunk(d(dC,t)).map(Te).filter(Be).map(e)},gC=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return xe.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return xe.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},hC=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return-1===t.indexOf(" ")||Rt(t,'"')||Rt(t,"'")?t:"'"+t+"'"})).join(",")},pC=xe.each,vC=xe.map,bC=xe.inArray,yC=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,xd(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus(),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(pC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;pC(t,(function(t,r){pC(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");pe.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),pC("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n=gC(t,e);t.formatter.toggle("fontname",{value:hC(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:gC(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.undoManager.transact((function(){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}))}(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){!function(t,e){var n=function(t){var e;return"string"!=typeof t?(e=xe.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}}(e);!function(t,e,n){hp(t).editor.insertContent(e,n)}(t,n.content,n.details)}(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Cx(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Sy(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Ln);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return sx(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=vC(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==bC(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return wy(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return mC(t,(function(e){return fC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return mC(t,(function(e){return lC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return mC(t,(function(e){var n=Te(t.getBody());return Ld(e,(function(t){return Jn(t,"line-height")}),d(Ne,n)).getOrThunk((function(){var t=parseFloat(Kn(e,"line-height")),n=parseFloat(Kn(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),wC="data-mce-contenteditable",xC=function(t,e,n){var r,o;ha(t,e)&&!1===n?(o=e,ma(r=t)?r.dom.classList.remove(o):function(t,e){(function(t,e,n){var r=W(da(t,e),(function(t){return t!==n}));r.length>0?Wn(t,e,r.join(" ")):Xn(t,e)})(t,"class",e)}(r,o),function(t){0===(ma(t)?t.dom.classList:function(t){return da(t,"class")}(t)).length&&Xn(t,"class")}(r)):n&&ga(t,e)},CC=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},SC=function(t,e){t.dom.contentEditable=e?"true":"false"},kC=function(t,e){var n=Te(t.getBody());xC(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){x.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,SC(n,!1),j(va(n,'*[contenteditable="true"]'),(function(t){Wn(t,wC,"true"),SC(t,!1)}))):(t.readonly=!1,SC(n,!0),j(va(n,'*[data-mce-contenteditable="true"]'),(function(t){Xn(t,wC),SC(t,!0)})),CC(t,"StyleWithCSS",!1),CC(t,"enableInlineTableEditing",!1),CC(t,"enableObjectResizing",!1),function(t){return Nd(t)||function(t){return cd().filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&Od(t,e.dom);var n})).isSome()}(t)}(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},OC=function(t){return t.readonly},TC=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){OC(t)&&j(e,(function(t){t.attr(wC,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(wC,(function(e){OC(t)&&j(e,(function(t){t.attr("contenteditable",t.attr(wC))}))})),t.serializer.addTempAttr(wC)},_C=xe.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"," "),EC=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||p}return t.isNative=function(t){return!!_C[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=e||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=v},r.stopPropagation=function(){r.isPropagationStopped=v},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=v},r.isDefaultPrevented=p,r.isPropagationStopped=p,r.isImmediatePropagationStopped=p),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=p),e){var o={func:e};r&&xe.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=this.bindings[a]=[],this.toggleEvent(a,!0)),n?c.unshift(o):c.push(o)}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return it(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e)for(var a=u.length;a--;)u[a].func===e&&(u=u.slice(0,a).concat(u.slice(a+1)),this.bindings[i]=u);else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else it(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),AC=function(t){return t._eventDispatcher||(t._eventDispatcher=new EC({scope:t,toggleEvent:function(e,n){EC.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},NC={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=AC(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return AC(this).on(t,e,n)},off:function(t,e){return AC(this).off(t,e)},once:function(t,e){return AC(this).once(t,e)},hasEventListeners:function(t){return AC(this).has(t)}},RC=Qu.DOM,MC=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=Gc(t);return n?(t.eventRoot||(t.eventRoot=RC.select(n)[0]),t.eventRoot):t.getBody()},zC=function(t,e,n){!function(t){return!t.hidden&&!OC(t)}(t)?OC(t)&&function(t,e){if(function(t){return"click"===t.type}(e)&&!Cf.metaKeyPressed(e)){var n=Te(e.target);(function(t,e){return xr(e,"a",(function(e){return Ne(e,Te(t.getBody()))})).bind((function(t){return Gn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Rt(o=n,"#")?function(t,e){return t.substring(e)}(o,"#".length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o}))}}(t,n):t.fire(e,n)},DC=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=MC(t,e);if(Gc(t)){if(Gy||(Gy={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Gy&&(it(Gy,(function(e,n){t.dom.unbind(MC(t,n))})),Gy=null)}))),Gy[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||RC.isChildOf(r,u))&&zC(o[i],e,n)}},Gy[e]=n,RC.bind(r,e,n)}else n=function(n){zC(t,e,n)},RC.bind(r,e,n),t.delegates[e]=n}},BC=St(St({},NC),{bindPendingEventDelegates:function(){var t=this;xe.each(t._pendingNativeEvents,(function(e){DC(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(e?n.initialized?DC(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(MC(n,t),t,n.delegates[t]),delete n.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(it(t.delegates,(function(e,n){t.dom.unbind(MC(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),PC=["design","readonly"],IC=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&kC(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},LC=xe.each,HC=xe.explode,FC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},VC=xe.makeMap("alt,ctrl,shift,meta,access"),jC=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(LC(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return LC(HC(xe.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:xe.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.parseShortcut=function(t){var e,n={};LC(HC(t.toLowerCase(),"+"),(function(t){t in VC?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=FC[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in VC)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,pe.mac?n.ctrl=!0:n.shift=!0),n.meta&&(pe.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=xe.map(HC(t,">"),this.parseShortcut);return o[o.length-1]=xe.extend(o[o.length-1],{func:n,scope:r||this.editor}),xe.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),UC=xe.each,WC=xe.trim,qC="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),$C={ftp:21,http:80,https:443,mailto:25},GC=function(){function t(e,n){e=WC(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);UC(qC,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=$C[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(UC(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?J(i).join("/"):a.slice(0,n).join("/")+"/"+J(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),XC=Qu.DOM,KC=xe.extend,YC=xe.each,JC=xe.resolve,QC=pe.ie,ZC=function(){function t(t,e,n){var r,o,i,u,a,s,l,f,d,m=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,KC(this,BC),this.settings=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:nv(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"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",indent_after:"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",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return St(St({},i),r?Zp:{})}(o,e,n,Kp,t);return uv(Yp||Jp,Yp,i,r,o)}(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(na.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Qu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),sa.languageLoad=this.settings.language_load,sa.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new GC(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new jC(this),this.editorCommands=new yC(this),this.settings.cache_suffix&&(pe.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:(o={},i={},u={},a={},s={},l={},d={addButton:(f=function(t,e){return function(n,r){return t[n.toLowerCase()]=St(St({},r),{type:e})}})(r={},"button"),addGroupToolbarButton:f(r,"grouptoolbarbutton"),addToggleButton:f(r,"togglebutton"),addMenuButton:f(r,"menubutton"),addSplitButton:f(r,"splitbutton"),addMenuItem:f(o,"menuitem"),addNestedMenuItem:f(o,"nestedmenuitem"),addToggleMenuItem:f(o,"togglemenuitem"),addAutocompleter:f(i,"autocompleter"),addContextMenu:f(a,"contextmenu"),addContextToolbar:f(s,"contexttoolbar"),addContextForm:f(s,"contextform"),addSidebar:f(l,"sidebar"),addIcon:function(t,e){return u[t.toLowerCase()]=e},getAll:function(){return{buttons:r,menuItems:o,icons:u,popups:i,contextMenus:a,contextToolbars:s,sidebars:l}}},{addAutocompleter:d.addAutocompleter,addButton:d.addButton,addContextForm:d.addContextForm,addContextMenu:d.addContextMenu,addContextToolbar:d.addContextToolbar,addIcon:d.addIcon,addMenuButton:d.addMenuButton,addMenuItem:d.addMenuItem,addNestedMenuItem:d.addNestedMenuItem,addSidebar:d.addSidebar,addSplitButton:d.addSplitButton,addToggleButton:d.addToggleButton,addGroupToolbarButton:d.addGroupToolbarButton,addToggleMenuItem:d.addToggleMenuItem,getAll:d.getAll}),styleSheetLoader:void 0,show:c,hide:c,enable:c,disable:c,isDisabled:p};var g,h,v,b=(g=this,h=ra("design"),v=ra({design:{activate:c,deactivate:c,editorReadOnly:!1},readonly:{activate:c,deactivate:c,editorReadOnly:!0}}),function(t){t.serializer?TC(t):t.on("PreInit",(function(){TC(t)}))}(g),function(t){t.on("ShowCaret",(function(e){OC(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){OC(t)&&e.preventDefault()}))}(g),{isReadOnly:function(){return OC(g)},set:function(t){return function(t,e,n,r){if(r!==n.get()){if(!mt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?IC(t,n,e,r):t.on("init",(function(){return IC(t,n,e,r)}))}}(g,v.get(),h,t)},get:function(){return h.get()},register:function(t,e){v.set(function(t,e,n){var r;if(H(PC,e))throw new Error("Cannot override default mode "+e);return St(St({},t),((r={})[e]=St(St({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(v.get(),t,e))}});this.mode=b,this.setMode=b.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Wu.overrideDefaults((function(){return{context:m.inline?m.getBody():m.getDoc(),element:m.getBody()}}))}return t.prototype.render=function(){!function(t){var e=t.id;aa.setCode(Wc(t));var n=function(){oC.unbind(window,"ready",n),t.render()};if(xi.Event.domLoaded){if(t.getElement()&&pe.contentEditable){var r=Te(t.getElement()),o=function(t){return $(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){U(r.dom.attributes,(function(t){return Xn(r,t.name)})),qn(r,o)})),t.ui.styleSheetLoader=function(t,e){return Er.forElement(t,{contentCssCors:Jc(e),referrerPolicy:Uc(e)})}(r,t),function(t){return t.getParam("inline")}(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||oC.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Rn(t.getElement())&&(oC.insertAfter(oC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},oC.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=yv(t),t.notificationManager=pv(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=oC.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),aC(t,t.suffix)}}else oC.bind(window,"ready",n)}(this)},t.prototype.focus=function(t){!function(t,e){t.removed||(e?Rd(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===Nd(t)&&xd(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return Ad(o),Ed(t,r),void Rd(t);t.inline||(pe.opera||Ad(n),t.getWin().focus()),(pe.gecko||t.inline)&&(Ad(n),Ed(t,r)),Rd(t)}(t))}(this,t)},t.prototype.hasFocus=function(){return Nd(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?JC(r):0,i=JC(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return aa.translate(t)},t.prototype.getParam=function(t,e,n){return function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?j(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[xe.trim(n[0])]=xe.trim(n[1]):e[xe.trim(n[0])]=xe.trim(n[0])})):e=t,e}(i):"string"===r?av(O,t,e).getOr(n):"number"===r?av(D,t,e).getOr(n):"boolean"===r?av(A,t,e).getOr(n):"object"===r?av(T,t,e).getOr(n):"array"===r?av(_,t,e).getOr(n):"string[]"===r?av((o=O,function(t){return _(t)&&Y(t,o)}),t,e).getOr(n):"function"===r?av(z,t,e).getOr(n):i}(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!(!H(Qc(this).split(/[ ,]/),t)||e&&void 0===vv.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(XC.show(t.getContainer()),XC.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(QC&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(XC.hide(t.getContainer()),XC.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=Rn(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Rn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=XC.getParent(r.id,"form"))&&YC(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return Up(this,t,e)},t.prototype.getContent=function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return hp(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")}(this,t)},t.prototype.insertContent=function(t,e){e&&(t=KC({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?Up(this,this.startContent,{format:"raw"}):Up(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=XC.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=XC.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){!function(t,e){(function(t,e){pp(t).editor.addVisual(e)})(t,e)}(this,t)},t.prototype.remove=function(){!function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Wp.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Wp.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Wp.remove(t.getContainer()),qp(e),qp(n),t.destroy()}}(this)},t.prototype.destroy=function(t){!function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),qp(n),qp(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Wp.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())}(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),tS=Qu.DOM,eS=xe.explode,nS=xe.each,rS=xe.extend,oS=0,iS=!1,uS=[],aS=[],cS=function(t){var e=t.type;nS(dS.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},sS=function(t){t!==iS&&(t?Wu(window).on("resize scroll",cS):Wu(window).off("resize scroll",cS),iS=t)},lS=function(t){var e=aS;delete uS[t.id];for(var n=0;n<uS.length;n++)if(uS[n]===t){uS.splice(n,1);break}return aS=W(aS,(function(e){return t!==e})),dS.activeEditor===t&&(dS.activeEditor=aS.length>0?aS[0]:null),dS.focusedEditor===t&&(dS.focusedEditor=null),e.length!==aS.length},fS="CSS1Compat"!==document.compatMode,dS=St(St({},NC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Wu,majorVersion:"5",minorVersion:"6.2",releaseDate:"2020-12-08",editors:uS,i18n:aa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=GC.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c;if(""!==(c=u[a].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}!t&&document.currentScript&&(-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/")))}n.baseURL=new GC(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new GC(n.baseURL),n.suffix=r,(o=n).on("AddEditor",d(Td,o)),o.on("RemoveEditor",d(_d,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&it(r,(function(t,e){sa.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=xe.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"," "),o=function(t){var e=t.id;return e||(e=dt(t,"name").filter((function(t){return!tS.get(t)})).getOrThunk(tS.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):tS.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new ZC(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};tS.unbind(window,"ready",a),function(e){var r=t[e];r&&r.apply(n,Array.prototype.slice.call(arguments,2))}("onpageload"),e=Wu.unique(function(t){var e=[];if(pe.browser.isIE()&&pe.browser.version.major<11)return Ov("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(fS)return Ov("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return nS(t.types,(function(t){e=e.concat(tS.select(t.selector))})),e;if(t.selector)return tS.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&nS(eS(n),(function(t){var n=tS.get(t);n?e.push(n):nS(document.forms,(function(n){nS(n.elements,(function(n){n.name===t&&(t="mce_editor_"+oS++,tS.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":nS(tS.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?nS(t.types,(function(n){xe.each(e,(function(e){return!tS.is(e,n.selector)||(l(o(e),rS({},t,n),e),!1)}))})):(xe.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(lS(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=xe.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):nS(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):Ov("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,tS.bind(window,"ready",a),new Cr((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?aS.slice(0):O(t)?G(aS,(function(e){return e.id===t})).getOr(null):D(t)&&aS[t]?aS[t]:null},add:function(t){var e=this;return uS[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(uS[t.id]=t),uS.push(t),aS.push(t)),sS(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Xy||(Xy=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Xy))),t},createEditor:function(t,e){return this.add(new ZC(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!O(t))return n=t,E(r.get(n.id))?null:(lS(n)&&r.fire("RemoveEditor",{editor:n}),0===aS.length&&window.removeEventListener("beforeunload",Xy),n.remove(),sS(aS.length>0),n);nS(tS.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=aS.length-1;e>=0;e--)r.remove(aS[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new ZC(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",0,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){nS(aS,(function(t){t.save()}))},addI18n:function(t,e){aa.add(t,e)},translate:function(t){return aa.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new GC(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new GC(this.baseURL)}});dS.setup();var mS,gS,hS,pS,vS=Math.min,bS=Math.max,yS=Math.round,wS=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=yS(c/2)),"c"===s[1]&&(r+=yS(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=yS(u/2)),"c"===s[4]&&(r-=yS(i/2)),xS(r,o,i,u)},xS=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},CS={inflate:function(t,e,n){return xS(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:wS,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=wS(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=bS(t.x,e.x),r=bS(t.y,e.y),o=vS(t.x+t.w,e.x+e.w),i=vS(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:xS(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=bS(0,e.x-r),l=bS(0,e.y-o),f=bS(0,i-a),d=bS(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),xS(r,o,(i-=f)-r,(u-=d)-o)},create:xS,fromClientRect:function(t){return xS(t.left,t.top,t.width,t.height)}},SS=(mS={},gS={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==mS[t])return mS[t];var o=new Cr((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);gS[t]=u.resolve,na.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return mS[t]=o,o},add:function(t,e){void 0!==gS[t]&&(gS[t](e),delete gS[t]),mS[t]=Cr.resolve(e)}}),kS=xe.each,OS=xe.extend,TS=function(){};TS.extend=hS=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!pS&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};pS=!0;var o=new this;return pS=!1,t.Mixins&&(kS(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&kS(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&kS(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&kS(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=OS({},e.Defaults,t.Defaults)),it(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=hS,n};var _S,ES=Math.min,AS=Math.max,NS=Math.round,RS={serialize:function(t){var e=JSON.stringify(t);return O(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},MS={callbacks:{},count:0,send:function(t){var e=this,n=Qu.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},zS=St(St({},NC),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Tr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",zS.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&xe.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=zS.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Tr.setTimeout(r,10)}}),DS=xe.extend,BS=function(){function t(t){this.settings=DS({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=DS(this.settings,t);r.success=function(t,o){void 0===(t=RS.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=RS.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",zS.send(r)},t}();try{var PS="__storage_test__";(_S=window.localStorage).setItem(PS,PS),_S.removeItem(PS)}catch(t){_S=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var IS={geom:{Rect:CS},util:{Promise:Cr,Delay:Tr,Tools:xe,VK:Cf,URI:GC,Class:TS,EventDispatcher:EC,Observable:NC,I18n:aa,XHR:zS,JSON:RS,JSONRequest:BS,JSONP:MS,LocalStorage:_S,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=AS(0,ES(e,1)),i=AS(0,ES(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=NS(255*(n+s)),r=NS(255*(r+s)),o=NS(255*(o+s))}else n=r=o=NS(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=ES(t/=255,ES(e/=255,n/=255)),u=AS(t,AS(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:NS(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:NS(100*r),v:NS(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:xi,Sizzle:ou,DomQuery:Wu,TreeWalker:Ar,TextSeeker:Na,DOMUtils:Qu,ScriptLoader:na,RangeUtils:Vf,Serializer:jp,StyleSheetLoader:_r,ControlSelection:kf,BookmarkManager:yf,Selection:Cp,Event:xi.Event},html:{Styles:di,Entities:Io,Node:Jd,Schema:Go,SaxParser:um,DomParser:Hp,Writer:Zd,Serializer:tm},Env:pe,AddOnManager:sa,Annotator:vf,Formatter:Bv,UndoManager:Pv,EditorCommands:yC,WindowManager:yv,NotificationManager:pv,EditorObservable:BC,Shortcuts:jC,Editor:ZC,FocusManager:Cd,EditorManager:dS,DOM:Qu.DOM,ScriptLoader:na.ScriptLoader,PluginManager:vv,ThemeManager:bv,IconManager:cv,Resource:SS,trim:xe.trim,isArray:xe.isArray,is:xe.is,toArray:xe.toArray,makeMap:xe.makeMap,each:xe.each,map:xe.map,grep:xe.grep,inArray:xe.inArray,extend:xe.extend,create:xe.create,walk:xe.walk,createNS:xe.createNS,resolve:xe.resolve,explode:xe.explode,_addCacheSuffix:xe._addCacheSuffix,isOpera:pe.opera,isWebKit:pe.webkit,isIE:pe.ie,isGecko:pe.gecko,isMac:pe.mac},LS=xe.extend(dS,IS);!function(t){window.tinymce=t,window.tinyMCE=t}(LS),function(e){try{t.exports=e}catch(t){}}(LS)}()}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{"use strict";n(7575),n(6890),n(8860),n(5209),n(3356),n(2875),n(8619),n(2540),n(8190),n(1295),n(2170),n(2682),n(1236),n(6884),n(4400),n(8208),n(6586),n(5053),n(7259),n(4926),n(5031),n(397),n(1933),n(5187),n.g.current_selection_range=null,n.g.editor=null})()})();\ No newline at end of filediff --git a/apps/mobile/html/Web.bundle/site/dist/main.js b/apps/mobile/html/Web.bundle/site/dist/main.jsindex 66e51bb22..154b68379 100644--- a/apps/mobile/html/Web.bundle/site/dist/main.js+++ b/apps/mobile/html/Web.bundle/site/dist/main.js@@ -1 +1 @@-(()=>{var t={2968:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.css"},6202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.min.css"},7286:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.css"},7362:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.min.css"},287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.css"},2271:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.min.css"},5417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.css"},874:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.min.css"},3341:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.css"},8786:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.css"},4243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.min.css"},9702:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.min.css"},1389:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.css"},3513:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.min.css"},1064:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/fonts/tinymce-mobile.woff"},8057:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.css"},6332:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.min.css"},4429:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.css"},18:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.min.css"},7899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.css"},7548:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.min.css"},9506:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.css"},8273:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.css"},7251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.min.css"},6122:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.min.css"},993:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.css"},8215:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.min.css"},9916:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/fonts/tinymce-mobile.woff"},8382:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.css"},4522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.min.css"},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.css"},8537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.min.css"},818:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.css"},6913:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.min.css"},8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-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 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-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 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.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 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 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 01-.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 00-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 010 2H5a1 1 0 010-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 110-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 01-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></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 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 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 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 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.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.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 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.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 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 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 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-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>',"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 01-.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 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-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.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.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 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.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 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-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 010-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 010-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 010-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-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 010-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 010-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 010-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 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.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 010-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.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-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 010-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 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-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.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.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 01-.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 01-.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 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.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 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.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 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 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 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-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 01-1-1v-2H7V9H5a1 1 0 110-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 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 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 017 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 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.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 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 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.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-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 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.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 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-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 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-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-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-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 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.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 0119 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 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.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 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-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 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 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 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-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 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-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 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-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 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 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.7l2.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-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 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.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 00-.8.8.8.8 0 01-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 012.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 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 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 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-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 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.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 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 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.7l-.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>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-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 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.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 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 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.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.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.6L34.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 00-.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 00-.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 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.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 17l-.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 01-.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 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-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 110-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 01-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="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.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 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.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 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 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 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.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 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-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 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-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 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-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 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 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 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.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 012.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 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-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 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.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 11-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 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-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.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-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 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 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 01-.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 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 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 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.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 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-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 01-.2-.6V8H5a1 1 0 110-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 01-.2-.6V13H5a1 1 0 010-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 01-.2-.6V18H5a1 1 0 010-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 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.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 010-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 00-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 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 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 017 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 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.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 00-.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 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.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-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-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 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.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 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.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 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-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 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-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 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-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 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.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.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.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 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-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 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.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 010-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 01-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 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 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 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.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 01-.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 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-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 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.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>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.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 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.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 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},6890:(t,e,n)=>{n(8785)},4400:(t,e,n)=>{n(2242)},2242:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},m=function(t,e,n){var r=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(e.parents,d),o=-1!==r?e.parents.slice(0,r):e.parents,u=i.grep(o,function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&function(t,e){return t.$.contains(t.getBody(),e)}(t,e)}}(t));return u.length>0&&u[0].nodeName===n},g=function(t,e,n,r,u,a){t.ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===u?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(i.map(a,(function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===u?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t)}})))},onAction:function(){return t.execCommand(r)},onItemAction:function(e,n){o(t,u,n)},select:function(e){return function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return function(t){return null==t?l:f(t)}(t.dom.getStyle(e,"listStyleType"))}(t).map((function(t){return e===t})).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(m(t,n,u))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}})},h=function(t,e,n,r,o,i){i.length>1?g(t,e,n,r,o,i):function(t,e,n,r,o,i){t.ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(m(t,n,o))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},onAction:function(){return t.execCommand(r)}})}(t,e,n,r,o)};r.add("advlist",(function(t){t.hasPlugin("lists")&&(function(t){h(t,"numlist","Numbered list","InsertOrderedList","OL",function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]}(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",function(t){var e=t.getParam("advlist_bullet_styles","default,circle,square");return e?e.split(/[ ,]/):[]}(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(e,n){o(t,"UL",n["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(e,n){o(t,"OL",n["list-style-type"])}))}(t))}))}()},6884:(t,e,n)=>{n(7652)},7652:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},r=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,n(e,r)):t.setStartBefore(e)},o=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,n(e,r)):t.setEndAfter(e)},i=function(t,e,n){var i,u,a,c,s,l,f,d=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i)}(t),m=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var g=t.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(l=s.length,r(g,s,l),o(g,s,l),g.endOffset<5)return;i=g.endOffset,u=s}else{if(3!==(u=g.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(r(g,u,0),o(g,u,u.nodeValue.length))}i=1===g.endOffset?2:g.endOffset-1-e}var h=i;do{r(g,u,i>=2?i-2:0),o(g,u,i>=1?i-1:0),i-=1,f=g.toString()}while(" "!==f&&""!==f&&160!==f.charCodeAt(0)&&i-2>=0&&f!==n);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(g.toString(),n)?0===g.startOffset?(r(g,u,0),o(g,u,h)):(r(g,u,i),o(g,u,h)):(r(g,u,i),o(g,u,h),i+=1),"."===(c=g.toString()).charAt(c.length-1)&&o(g,u,h-1);var p=(c=g.toString().trim()).match(d),v=function(t){return t.getParam("link_default_protocol","http","string")}(t);p&&("www."===p[1]?p[1]=v+"://www.":/@$/.test(p[1])&&!/^mailto:/.test(p[1])&&(p[1]="mailto:"+p[1]),a=t.selection.getBookmark(),t.selection.setRng(g),t.execCommand("createlink",!1,p[1]+p[2]),!1!==m&&t.dom.setAttrib(t.selection.getNode(),"target",m),t.selection.moveToBookmark(a),t.nodeChanged())}};t.add("autolink",(function(t){!function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){i(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){i(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){i(t,0,"")}(t)})))}(t)}))}()},5209:(t,e,n)=>{n(8578)},8578:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=tinymce.util.Tools.resolve("tinymce.util.Delay"),r=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},o=function(t,e,r,i,u){n.setEditorTimeout(t,(function(){a(t,e),r--?o(t,e,r,i,u):u&&u()}),i)},i=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},u=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},a=function(t,n){var o=t.dom,c=t.getDoc();if(c)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))i(t,!0);else{var s=c.documentElement,l=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),f=r(t),d=u(o,s,"margin-top",!0),m=u(o,s,"margin-bottom",!0),g=s.offsetHeight+d+m+l;g<0&&(g=0);var h=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;g+h>r(t)&&(f=g+h);var p=function(t){return t.getParam("max_height",0,"number")}(t);if(p&&f>p?(f=p,i(t,!0)):i(t,!1),f!==n.get()){var v=f-n.get();if(o.setStyle(t.getContainer(),"height",f+"px"),n.set(f),function(t){t.fire("ResizeEditor")}(t),e.browser.isSafari()&&e.mac){var b=t.getWin();b.scrollTo(b.pageXOffset,b.pageYOffset)}t.hasFocus()&&t.selection.scrollIntoView(t.selection.getNode()),e.webkit&&v<0&&a(t,n)}}};t.add("autoresize",(function(t){if(t.settings.hasOwnProperty("resize")||(t.settings.resize=!1),!t.inline){var e=(n=0,{get:function(){return n},set:function(t){n=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){a(t,e)}))}(t,e),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(){a(t,e)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){o(t,e,20,100,(function(){o(t,e,5,1e3)}))}))}(t,e)}var n}))}()},8190:(t,e,n)=>{n(7440)},7440:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.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:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})};t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){e(t)}))}(t),function(t){t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return e(t)}}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return e(t)}})}(t),{}}))}()},7259:(t,e,n)=>{n(8492)},8492:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var n,r=t.dom,i=t.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),o.each(i,(function(t){r.getParent(t.parentNode,'*[dir="'+e+'"]',r.getRoot())||r.setAttrib(t,"dir",n!==e?e:null)})),t.nodeChanged())},u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return"function"==typeof t},g=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},h=g,p=("undefined"!=typeof window?window:Function("return this;")(),function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}}),v=p(3),b=p(9),y=p(11),w=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode)?function(t){return h(t.dom.getRootNode())}:function(t){return b(t)?t:h(t.dom.ownerDocument)},x=function(t){return h(t.dom.host)},C=function(t){var e=v(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o,i,u=e.ownerDocument;return(o=h(e),i=w(o),y(i)?d.some(i):d.none()).fold((function(){return u.body.contains(e)}),(n=C,r=x,function(t){return n(r(t))}))},S=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||C(t)?r:function(t,e){return function(t){return void 0!==t.style&&m(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""}(n,e)}(t,"direction")?"rtl":"ltr"},k=function(t,e){return function(n){var r=function(t){var r=h(t.element);n.setActive(S(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};r.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){i(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){i(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:k(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:k(t,"rtl")})}(t)}))}()},4926:(t,e,n)=>{n(755)},755:()=>{!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})}(t)}))}()},2170:(t,e,n)=>{n(3302)},3302:()=>{!function(){"use strict";var t,e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},c=u("string"),s=u("object"),l=u("array"),f=(null,function(t){return null===t}),d=a("boolean"),m=a("number"),g=function(){},h=function(t){return function(){return t}},p=h(!1),v=h(!0),b=function(){return y},y=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:r,orThunk:n,map:b,each:g,bind:b,exists:p,forall:v,filter:b,equals:e,equals_:e,toArray:function(){return[]},toString:h("none()")}),w=function(t){var e=h(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.push,S=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!l(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);C.apply(e,t[n])}return e},k=("undefined"!=typeof window?window:Function("return this;")(),function(t,e,n){!function(t,e,n){if(!(c(n)||d(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)}),O=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},T=O,_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),A=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(t){return t.getParam("image_dimensions",!0,"boolean")},R=function(t){return t.getParam("images_upload_url","","string")},M=function(t){return t.getParam("images_upload_handler",void 0,"function")},z=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},D=function(t){return t&&(t=t.replace(/px$/,"")),t},B=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},P=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},I=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},L=_.DOM,H=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?D(t.style.marginLeft):""},F=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?D(t.style.marginTop):""},V=function(t){return t.style.borderWidth?D(t.style.borderWidth):""},j=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},U=function(t,e){return t.style[e]?t.style[e]:""},W=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},q=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},$=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},G=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=B(r),$(t,e)):q(t,n,r)}},X=function(t,e){return t.style[e]?D(t.style[e]):j(t,e)},K=function(t,e){var n=B(e);t.style.marginLeft=n,t.style.marginRight=n},Y=function(t,e){var n=B(e);t.style.marginTop=n,t.style.marginBottom=n},J=function(t,e){var n=B(e);t.style.borderWidth=n},Q=function(t,e){t.style.borderStyle=e},Z=function(t){return"FIGURE"===t.nodeName},tt=function(t){return 0===L.getAttrib(t,"alt").length&&"presentation"===L.getAttrib(t,"role")},et=function(t){return tt(t)?"":j(t,"alt")},nt=function(t,e){return{src:j(e,"src"),alt:et(e),title:j(e,"title"),width:X(e,"width"),height:X(e,"height"),class:j(e,"class"),style:t(j(e,"style")),caption:W(e),hspace:H(e),vspace:F(e),border:V(e),borderStyle:U(e,"borderStyle"),isDecorative:tt(e)}},rt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},ot=function(t,e,n){if(n){L.setAttrib(t,"role","presentation");var r=T(t);k(r,"alt","")}else f(e)?("alt",(r=T(t)).dom.removeAttribute("alt")):(r=T(t),k(r,"alt",e)),"presentation"===L.getAttrib(t,"role")&&L.setAttrib(t,"role","")},it=function(t,e){return function(n,r,o){t(n,o),$(n,e)}},ut=function(t,e,n){var r=nt(t,n);rt(n,r,e,"caption",(function(t,e,n){return function(t){W(t)?function(t){var e=t.parentNode;L.insertAfter(t,e),L.remove(e)}(t):function(t){var e=L.create("figure",{class:"image"});L.insertAfter(e,t),e.appendChild(t),e.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)}(t)})),rt(n,r,e,"src",q),rt(n,r,e,"title",q),rt(n,r,e,"width",G(0,t)),rt(n,r,e,"height",G(0,t)),rt(n,r,e,"class",q),rt(n,r,e,"style",it((function(t,e){return q(t,"style",e)}),t)),rt(n,r,e,"hspace",it(K,t)),rt(n,r,e,"vspace",it(Y,t)),rt(n,r,e,"border",it(J,t)),rt(n,r,e,"borderStyle",it(Q,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||ot(t,n.alt,n.isDecorative)}(n,r,e)},at=function(t,e){var n=t.dom.styles.parse(e),r=P(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},ct=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||I(e))?null:e},st=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,(function(e){return!!t.schema.getTextBlockElements()[e.nodeName]}),t.getBody());return r?n.split(r,e):e},lt=Object.prototype.hasOwnProperty,ft=(t=function(t,e){return s(t)&&s(e)?ft(t,e):e},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)lt.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}),dt=tinymce.util.Tools.resolve("tinymce.util.Tools"),mt=function(t){return c(t.value)?t.value:""},gt=function(t,e){var n=[];return dt.each(t,(function(t){var r=function(t){return c(t.text)?t.text:c(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=gt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},ht=function(t){return void 0===t&&(t=mt),function(e){return e?x.from(e).map((function(e){return gt(e,t)})):x.none()}},pt=function(t,e){return function(t,n){for(var r=0;r<t.length;r++){var o=function(t){return Object.prototype.hasOwnProperty.call(t,"items")}(i=t[r])?pt(i.items,e):i.value===e?x.some(i):x.none();if(o.isSome())return o}var i;return x.none()}(t)},vt=ht,bt=function(t,e){return t.bind((function(t){return pt(t,e)}))};var yt=function(t){var e,n=vt((function(e){return t.convertURL(e.value||e.url,"src")})),r=new E((function(e){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);"string"==typeof n?A.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}(t,(function(t){e(n(t).map((function(t){return S([[{text:"None",value:""}],t])})))}))})),o=(e=function(t){return t.getParam("image_class_list")}(t),ht(mt)(e)),i=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),u=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return!!R(t)}(t),s=function(t){return!!M(t)}(t),l=function(t){var e=ct(t);return e?nt((function(e){return at(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),f=function(t){return t.getParam("image_description",!0,"boolean")}(t),d=function(t){return t.getParam("image_title",!1,"boolean")}(t),m=N(t),g=function(t){return t.getParam("image_caption",!1,"boolean")}(t),h=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),p=R(t),v=function(t){return t.getParam("images_upload_base_path",void 0,"string")}(t),b=function(t){return t.getParam("images_upload_credentials",!1,"boolean")}(t),y=M(t),w=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),C=x.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return c(t)&&t.length>0}));return r.then((function(t){return{image:l,imageList:t,classList:o,hasAdvTab:i,hasUploadTab:u,hasUploadUrl:a,hasUploadHandler:s,hasDescription:f,hasImageTitle:d,hasDimensions:m,hasImageCaption:g,url:p,basePath:v,credentials:b,handler:y,prependURL:C,hasAccessibilityOptions:h,automaticUploads:w}}))},wt=function(t){var e=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),n={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},r=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[n]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:S([r.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},xt=function(t){return{title:"General",name:"general",items:wt(t)}},Ct=wt,St=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},kt=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Ot=function(t,e,n,r){(function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?x.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?x.some(t+e):x.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))})(e,r),function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=ft({},n);!function(t,e,n){t.hasDescription&&c(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&c(n.title)&&(e.title=n.title),t.hasDimensions&&(c(n.width)&&(e.dimensions.width=n.width),c(n.height)&&(e.dimensions.height=n.height)),c(n.class)&&bt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&d(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(c(n.style)&&(e.style=n.style),c(n.vspace)&&(e.vspace=n.vspace),c(n.border)&&(e.border=n.border),c(n.hspace)&&(e.hspace=n.hspace),c(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}}(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=bt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Tt=function(t,e,n,r){var o,i=r.getData();r.block("Uploading image"),(o=i.fileinput,function(t,e){return 0<t.length?x.some(t[0]):x.none()}(o)).fold((function(){r.unblock()}),(function(o){var i,u,a,c=URL.createObjectURL(o),s=(u={url:e.url,basePath:e.basePath,credentials:e.credentials,handler:e.handler},a=function(t,e,n,r){var o=new XMLHttpRequest;o.open("POST",u.url),o.withCredentials=u.credentials,o.upload.onprogress=function(t){r(t.loaded/t.total*100)},o.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){if(o.status<200||o.status>=300)n("HTTP Error: "+o.status);else{var t,r,i=JSON.parse(o.responseText);i&&"string"==typeof i.location?e((t=u.basePath,r=i.location,t?t.replace(/\/$/,"")+"/"+r.replace(/^\//,""):r)):n("Invalid JSON: "+o.responseText)}};var i=new FormData;i.append("file",t.blob(),t.filename()),o.send(i)},u=dt.extend({credentials:!1,handler:a},u),{upload:function(t){return u.url||u.handler!==a?function(t,e){return new E((function(n,r){try{e(t,n,r,g)}catch(t){r(t.message)}}))}(t,u.handler):E.reject("Upload url missing from the settings.")}}),l=function(){r.unblock(),URL.revokeObjectURL(c)},f=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ot(t,e,n,r)};(i=o,new E((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,c,n);e.automaticUploads?s.upload(i).then((function(t){f(t),l()})).catch((function(e){l(),t.alertErr(e)})):(t.addToBlobCache(i),f(i.blobUri()),r.unblock())}))}))},_t=function(t,e,n){return function(r,o){"src"===o.name?Ot(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=bt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ot(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=function(t,e,n){var r=P(t(n.style)),o=ft({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?D(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?D(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?D(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o}(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=ft(St(e.image),n.getData()),o=function(t,e){var n=document.createElement("img");return q(n,"style",e.style),(H(n)||""!==e.hspace)&&K(n,e.hspace),(F(n)||""!==e.vspace)&&Y(n,e.vspace),(V(n)||""!==e.border)&&J(n,e.border),(function(t){return U(t,"borderStyle")}(n)||""!==e.borderStyle)&&Q(n,e.borderStyle),t(n.getAttribute("style"))}(t.normalizeCss,kt(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?Tt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Et=function(t){return function(){t.open=!1}},At=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:S([[xt(t)],t.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{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"}]}]}]}]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Ct(t)}},Nt=function(t){return function(e){return function(n){var r=ft(St(e.image),n.getData());t.execCommand("mceUpdateImage",!1,kt(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Rt=function(t){return function(e){return function(t){return new E((function(e){var n=document.createElement("img"),r=function(t){n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:z(n.width,n.clientWidth),height:z(n.height,n.clientHeight)};r(E.resolve(t))},n.onerror=function(){r(E.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},Mt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Dt=function(t){return function(e){t.windowManager.alert(e)}},Bt=function(t){return function(e){return at(t,e)}},Pt=function(t){return function(e){return t.dom.parseStyle(e)}},It=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},Lt=function(t){var e={onSubmit:Nt(t),imageSize:Rt(t),addToBlobCache:zt(t),createBlobCache:Mt(t),alertErr:Dt(t),normalizeCss:Bt(t),parseStyle:Pt(t),serializeStyle:It(t)};return{open:function(){yt(t).then(function(t){return function(e){var n=function(t){return{prevImage:bt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:At(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:St(e.image),onSubmit:t.onSubmit(e),onChange:_t(t,e,n),onClose:Et(n)}}}(e)).then(t.windowManager.open)}}},Ht=function(t){t.addCommand("mceImage",Lt(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return function(t,e){var n=ct(t);if(n){var r=nt((function(e){return at(t,e)}),n),o=i(i({},r),e);o.src?function(t,e){var n=ct(t);if(ut((function(e){return at(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),Z(n.parentNode)){var r=n.parentNode;st(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!N(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)}(t,o):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&function(t,e){var n=function(t,e){var n=document.createElement("img");if(ut(t,i(i({},e),{caption:!1}),n),ot(n,e.alt,e.isDecorative),e.caption){var r=L.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return at(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Z(r)){var o=st(t,r);t.selection.select(o)}else t.selection.select(r)}(t,i(i({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))}(t,n)}))}))},Ft=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},Vt=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];Ft(o)&&(o.attr("contenteditable",t?"false":null),dt.each(o.getAll("figcaption"),r))}}};o.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",Vt(!0)),t.serializer.addNodeFilter("figure",Vt(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Lt(t).open,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Lt(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return Z(t)||"IMG"===t.nodeName&&!I(t)?["image"]:[]}})}(t),Ht(t)}))}()},5053:(t,e,n)=>{n(3253)},3253:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return!function(t){return null==t}(t)},g=("function",function(t){return"function"==typeof t});function h(t,e){return b(document.createElement("canvas"),t,e)}function p(t){var e=h(t.width,t.height);return v(e).drawImage(t,0,0),e}function v(t){return t.getContext("2d")}function b(t,e,n){return t.width=e,t.height=n,t}var y=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function w(t){return new y((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}function x(t){return new y((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return d.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,m=Math.min(f+i,a),g=new Array(m-f),h=f,p=0;h<m;++p,++h)g[p]=u[h].charCodeAt(0);s[l]=new Uint8Array(g)}return d.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))}function C(t,e,n){return e=e||"image/png",g(HTMLCanvasElement.prototype.toBlob)?new y((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):x(t.toDataURL(e,n))}var S=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()}(t,e,a)};function k(t,e,n){var r=e.type;function o(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:u(r),toBlob:function(){return y.resolve(e)},toDataURL:u(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return C(t,e,n)}))},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(p)}}}function O(t){return function(t){return new y((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return k(function(t){return w(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=h(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return v(e).drawImage(t,0,0),e}))}(t),t,e)}))}function T(t,e){return C(t,e).then((function(e){return k(y.resolve(t),e,t.toDataURL())}))}var _=Object.keys,E=function(t,e,n){return void 0===n&&(n=!1),new y((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=_(t),r=0,i=n.length;r<i;r++){var u=n[r];a=t[u],c=u,o.setRequestHeader(c,a)}var a,c}(e),o.responseType="blob",o.send()}))},A=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],N=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],R=function(t){var e=function(t){return"ImageProxy HTTP error: "+S(A,(function(e){return t===e.code})).fold(u("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return y.reject(e)},M=function(t){return S(N,(function(e){return e.type===t})).fold(u("Unknown service error"),(function(t){return t.message}))},z=function(t){return function(t){return new y((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=function(t){return"ImageProxy Service error: "+function(t){try{return d.some(JSON.parse(t))}catch(t){return d.none()}}(t).bind((function(t){return(e=t,n=["error","type"],r=function(t,e){return m(t)?t[e]:void 0},o=e,function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(n,(function(t){o=r(o,t)})),i=o,d.from(i)).map(M);var e,n,r,o,i})).getOr("Invalid JSON in service error message")}(t);return y.reject(e)}))},D=function(t){return t<200||t>=300},B=function(t,e,n){return void 0===n&&(n=!1),e?function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return E(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return D(t.status)?function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e=t.status,n=t.blob)?z(n):R(e):y.resolve(t.blob);var e,n}))}(t,e):function(t,e){return E(t,{},e).then((function(t){return D(t.status)?R(t.status):y.resolve(t.blob)}))}(t,n)},P=function(t){return O(t)},I=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},L=I,H=("undefined"!=typeof window?window:Function("return this;")(),function(t,e){return function(t,n){return S(t.dom.childNodes,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(L(t),e)})).map(L)}(t)}),F=tinymce.util.Tools.resolve("tinymce.util.Delay"),V=tinymce.util.Tools.resolve("tinymce.util.Promise"),j=tinymce.util.Tools.resolve("tinymce.util.URI"),U=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},W=function(t){return t.getParam("imagetools_proxy")};function q(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)}function $(t){return{w:t.naturalWidth,h:t.naturalHeight}}var G=0,X=function(t){return H(L(t),"img")},K=function(t,e){return t.dom.is(e,"figure")},Y=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},J=function(t,e){var n=function(e){return Y(t,e)&&(et(t,e)||nt(t,e)||m(W(t)))};return K(t,e)?X(e).bind((function(t){return n(t.dom)?d.some(t.dom):d.none()})):n(e)?d.some(e):d.none()},Q=function(t,e){t.notificationManager.open({text:e,type:"error"})},Z=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&K(t,n)?X(n):Y(t,e)?d.some(L(e)):d.none()},tt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return m(r)?t.dom.encode(r[n]):null},et=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new j(n).host===t.documentBaseURI.host},nt=function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new j(e.src).host)},rt=function(t,e){if(nt(t,e))return B(e.src,null,function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new j(e.src).host)}(t,e));if(!et(t,e)){var n=W(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return B(r,o,!1)}return function(t){var e,n=t.src;return 0===n.indexOf("data:")?x(n):(e=n,new y((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(){200===this.status&&t(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()})))}(e)},ot=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?V.resolve(n.blob()):function(t,e){return function(t){return d.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return rt(t,e)}),(function(t){return t(e)}))}(t,e)},it=function(t){F.clearTimeout(t.get())},ut=function(t,e,n,r,o,i,u){return n.toBlob().then((function(a){var c,s,l,f,d=t.editorUpload.blobCache;c=i.src;var g=e.type===a.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(f=d.getByUri(c),m(f)?(c=f.uri(),s=f.name(),l=f.filename()):(s=tt(t,c,2),l=tt(t,c,1))),f=d.create({id:"imagetools"+G++,blob:a,base64:n.toBase64(),uri:c,name:s,filename:g?l:void 0}),d.add(f),t.undoManager.transact((function(){t.$(i).on("load",(function e(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(it(o),function(t,e){var n=F.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))})),u&&t.$(i).attr({width:u.w,height:u.h}),t.$(i).attr({src:f.blobUri()}).removeAttr("data-mce-src")})),f}))},at=function(t,e,n,r){return function(){return Z(t).fold((function(){Q(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return ot(t,o.dom)})).then((function(i){return P(i).then(n).then((function(n){return ut(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){Q(t,e)}))}))}},ct=function(t,e,n){return function(){var r=Z(t).fold((function(){return null}),(function(t){var e=q(t.dom);return e?{w:e.h,h:e.w}:null}));return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||b(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}),r)()}},st=function(t,e,n){return function(){return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}))()}},lt=function(t,e){return function(){var n=Z(t),r=n.map((function(t){return $(t.dom)}));n.each((function(o){J(t,o.dom).each((function(i){ot(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){!function(t,e,n,r,o){(function(t){return w(t)})(o).then((function(t){var e=$(t);return r.w===e.w&&r.h===e.h||q(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(P).then((function(r){return ut(t,o,r,!0,e,n)})).catch((function(){}))}(t,e,n.dom,r,i)}))})),o.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};o.add("imagetools",(function(t){var e=r(0),n=r(null);!function(t,e){i.each({mceImageRotateLeft:ct(t,e,-90),mceImageRotateRight:ct(t,e,90),mceImageFlipVertical:st(t,e,"v"),mceImageFlipHorizontal:st(t,e,"h"),mceEditImage:lt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:e("mceImageRotateLeft")}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:e("mceImageRotateRight")}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:e("mceImageFlipVertical")}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:e("mceImageFlipHorizontal")}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:e("mceEditImage"),onSetup:function(e){var n=function(){var n=Z(t).forall((function(e){return J(t,e.dom).isNone()}));e.setDisabled(n)};return t.on("NodeChange",n),function(){t.off("NodeChange",n)}}}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:e("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(n){return J(t,n).fold((function(){return[]}),(function(t){return[{text:"Edit image",icon:"edit-image",onAction:e("mceEditImage")}]}))}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:U(t),predicate:function(e){return J(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=J(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(it(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},2682:(t,e,n)=>{n(7384)},7384:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(null,function(t){return null===t}),l=u("boolean"),f=u("function"),d=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},m=function(t){return t.getParam("default_link_target")},g=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},p=function(t){return t.getParam("link_title",!0,"boolean")},v=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},b=function(t){return t.getParam("link_default_protocol","http","string")},y=function(){},w=function(t){return function(){return t}},x=w(!1),C=w(!0),S=function(){return k},k=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:x,isSome:x,isNone:C,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:w(null),getOrUndefined:w(void 0),or:n,orThunk:e,map:S,each:y,bind:S,exists:x,forall:C,filter:S,equals:t,equals_:t,toArray:function(){return[]},toString:w("none()")}),O=function(t){var e=w(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:C,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return O(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:k},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(x,(function(e){return n(t,e)}))}};return o},T={some:O,none:S,from:function(t){return null==t?k:O(t)}},_=Array.prototype.indexOf,E=Array.prototype.push,A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},N=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return T.none()},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},M=function(t,e){return t?T.some(e):T.none()},z=tinymce.util.Tools.resolve("tinymce.util.Tools"),D=function(t){return a(t.value)?t.value:""},B=function(t,e){var n=[];return z.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=B(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},P=function(t){return void 0===t&&(t=D),function(e){return T.from(e).map((function(e){return B(e,t)}))}},I=function(t){return P(D)(t)},L=P,H=function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},F=D,V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=Object.keys,U=Object.hasOwnProperty,W=function(t,e){return U.call(t,e)},q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t){return t&&"a"===t.nodeName.toLowerCase()},G=function(t){return $(t)&&!!Y(t)},X=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new q(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},K=function(t){return/^\w+:/i.test(t)},Y=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},J=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===z.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return z.trim(t.sort().join(" "))}(i):""},Q=function(t,e){return e=e||t.selection.getNode(),nt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},Z=function(t,e){return(e?e.innerText||e.textContent:t.getContent({format:"text"})).replace(/\uFEFF/g,"")},tt=function(t){return z.grep(t,G).length>0},et=function(t){var e=t.schema.getTextInlineElements();return 0===X(t.selection.getRng(),(function(t){return 1===t.nodeType&&!$(t)&&!W(e,t.nodeName.toLowerCase())})).length},nt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},rt=function(t,e,n){var r=t.selection.getNode(),o=Q(t,r),i=function(t,e){var n=V({},e);if(!(h(t).length>0)&&!1===v(t)){var r=J(n.rel,"_blank"===n.target);n.rel=r||null}return T.from(n.target).isNone()&&!1===g(t)&&(n.target=m(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||K(t)?t:e+"://"+t}(n.href,d(t)),n}(t,function(t){return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(e,(function(t){r=n(r,t)})),r;var e,n,r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){nt(e)?ct(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},ot=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return function(t,e,n,r){(function(t,e){for(var n=j(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}})(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,(function(t,e){return!1===s(t)}),(n=r,function(t,e){n[e]=t}),y),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()})},it=function(t,e,n){t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ot(n)):rt(t,e,n)},ut=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();nt(e)?at(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},at=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},ct=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},st=function(t,e){return N(e,(function(e){return function(t){return W(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n}(e)?st(t,e.items):M(e.value===t,e)}))},lt=function(t,e){var n={text:t.text,title:t.title},r=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:T.none()).getOr([]);return function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?st(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:y}},text:i?t:e.text}})):T.none()}(n.text,r.name,u,t)};return{onChange:function(t,e){var o,i,u,a,c=e.name;return"url"===c?(o=t(),i=o.url,u=M(n.text.length<=0,T.from(i.meta.text).getOr(i.value)),a=function(t){return M(n.title.length<=0,T.from(t.meta.title).getOr(""))}(o.url),u.isSome()||a.isSome()?T.some(V(V({},u.map((function(t){return{text:t}})).getOr({})),a.map((function(t){return{title:t}})).getOr({}))):T.none()):function(t,e){return _.call(t,e)}(["anchor","link"],c)>-1?r(t(),e):"text"===c||"title"===c?(n[c]=t()[c],T.none()):T.none()}}},ft=tinymce.util.Tools.resolve("tinymce.util.Delay"),dt=tinymce.util.Tools.resolve("tinymce.util.Promise"),mt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?T.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return V(V({},t),{href:"mailto:"+e})}}):T.none()},gt=function(t,e){return function(n){var r=n.href;return 1===t&&!K(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?T.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return V(V({},t),{href:e+"://"+r})}}):T.none()}},ht=function(t){var e=t.dom.select("a:not([href])"),n=A(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]})));return n.length>0?T.some([{text:"None",value:""}].concat(n)):T.none()},pt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?I(e):T.none()},vt=tinymce.util.Tools.resolve("tinymce.util.XHR"),bt=function(t,e){var n=h(t);if(n.length>0){var r=e.is("_blank");return(!1===v(t)?L((function(t){return J(F(t),r)})):I)(n)}return T.none()},yt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],wt=function(t){var e=g(t);return c(e)?I(e).orThunk((function(){return T.some(yt)})):!1===e?T.none():T.some(yt)},xt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?T.some(r):T.none()},Ct=function(t,e){return function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new dt((function(t){a(n)?vt.send({url:n,success:function(e){return t(function(t){try{return T.some(JSON.parse(t))}catch(t){return T.none()}}(e))},error:function(e){return t(T.none())}}):f(n)?n((function(e){return t(T.some(e))})):t(T.from(n))})).then((function(t){return t.bind(L(e)).map((function(t){return t.length>0?[{text:"None",value:""}].concat(t):t}))}))}(t).then((function(n){var r=function(t,e){var n=t.dom,r=et(t)?T.some(Z(t.selection,e)):T.none(),o=e?T.some(n.getAttrib(e,"href")):T.none(),i=e?T.from(n.getAttrib(e,"target")):T.none(),u=xt(n,e,"rel"),a=xt(n,e,"class");return{url:o,text:r,title:xt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:wt(t),rels:bt(t,r.target),classes:pt(t),anchor:ht(t),link:n},optNode:T.from(e),flags:{titleEnabled:p(t)}}}))},St=function(t){(function(t){var e=Q(t);return Ct(t,e)})(t).then((function(e){var n=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ut(t),void n.close();var o=function(t){return T.from(r[t]).filter((function(n){return!e.anchor[t].is(n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};(function(t,e){return N([mt,gt(d(t),b(t))],(function(t){return t(e)})).fold((function(){return dt.resolve(e)}),(function(n){return new dt((function(r){!function(t,e,n){var r=t.selection.getRng();ft.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))})(t,i).then((function(e){it(t,u,e)})),n.close()}}(t,e);return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,T.from(m(n))),u=t.catalogs,a=lt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:A([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([u.anchor.map(H("anchor","Anchors")),u.rels.map(H("rel","Rel")),u.targets.map(H("target","Open link in...")),u.link.map(H("link","Link list")),u.classes.map(H("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,n,t)})).then((function(e){t.windowManager.open(e)}))},kt=function(t,e){return t.dom.getParent(e,"a[href]")},Ot=function(t){return kt(t,t.selection.getStart())},Tt=function(t,e){if(e){var n=Y(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else!function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)}(e.href)}},_t=function(t){return function(){St(t)}},Et=function(t){return function(){Tt(t,Ot(t))}},At=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Nt=function(t){return function(e){return At(t,(function(){e.setActive(!t.mode.isReadOnly()&&null!==Q(t,t.selection.getNode()))}))}},Rt=function(t){return function(e){var n=function(){return e.setDisabled(null===Q(t,t.selection.getNode()))};return n(),At(t,n)}},Mt=function(t){return function(e){var n=function(e){return tt(e)||(n=t.selection.getRng(),X(n,G).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),At(t,(function(t){return e.setDisabled(!n(t.parents))}))}};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:_t(t),onSetup:Nt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:_t(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return tt(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!Q(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Nt(t)},label:"Link",predicate:function(e){return!!Q(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=Q(t);return e?Y(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!Q(t,n)),Nt(t)(e)},onAction:function(e){var n=Q(t),r=e.getValue();if(n)t.undoManager.transact((function(){t.dom.setAttrib(n,"href",r),function(t){t.selection.collapse(!1)}(t),e.hide()}));else{var o={href:r,attach:function(){}},i=et(t)?T.some(Z(t.selection,n)).filter((function(t){return t.length>0})).or(T.from(r)):T.none();it(t,o,{href:r,text:i,title:T.none(),rel:T.none(),target:T.none(),class:T.none()}),e.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ut(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Et(t)(),e.hide()}}]})}(t),function(t){t.on("click",(function(e){var n=kt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Tt(t,n))})),t.on("keydown",(function(e){var n=Ot(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Tt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?_t(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},1236:(t,e,n)=>{n(7585)},7585:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){},i=function(t){return function(){return t}},u=function(t){return function(e){return!t(e)}},a=i(!1),c=i(!0),s=function(){return l},l=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:s,each:o,bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}}(),f=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},g=function(t){return function(e){return typeof e===t}},h=m("string"),p=m("array"),v=g("boolean"),b=g("function"),y=g("number"),w=Array.prototype.slice,x=Array.prototype.push,C=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},k=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},O=function(t,e,n){return S(t,(function(t){n=e(n,t)})),n},T=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()},_=function(t,e){return T(t,e,a)},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!p(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e}(C(t,e))},A=function(t){var e=w.call(t,0);return e.reverse(),e},N=function(t,e){return e>=0&&e<t.length?d.some(t[e]):d.none()},R=function(t){return N(t,0)},M=function(t){return N(t,t.length-1)},z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(){return B(0,0)},B=function(t,e){return{major:t,minor:e}},P=function(t,e){var n=String(e).toLowerCase();return 0===t.length?D():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return B(r(1),r(2))}(t,n)},I=D,L=function(t,e){var n=String(e).toLowerCase();return _(t,(function(t){return t.search(n)}))},H=function(t,e){return-1!==t.indexOf(e)},F=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,V=function(t){return function(e){return H(e,t)}},j=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return H(t,"edge/")&&H(t,"chrome")&&H(t,"safari")&&H(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,F],search:function(t){return H(t,"chrome")&&!H(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return H(t,"msie")||H(t,"trident")}},{name:"Opera",versionRegexes:[F,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:V("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:V("firefox")},{name:"Safari",versionRegexes:[F,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(H(t,"safari")||H(t,"mobile/"))&&H(t,"applewebkit")}}],U=[{name:"Windows",search:V("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return H(t,"iphone")||H(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:V("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:V("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:V("linux"),versionRegexes:[]},{name:"Solaris",search:V("sunos"),versionRegexes:[]},{name:"FreeBSD",search:V("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:V("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],W={browsers:i(j),oses:i(U)},q="Edge",$="Chrome",G="Opera",X="Firefox",K="Safari",Y=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(q),isChrome:r($),isIE:r("IE"),isOpera:r(G),isFirefox:r(X),isSafari:r(K)}},J=function(){return Y({current:void 0,version:I()})},Q=Y,Z=(i(q),i($),i("IE"),i(G),i(X),i(K),"Windows"),tt="Android",et="Linux",nt="Solaris",rt="FreeBSD",ot="ChromeOS",it=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Z),isiOS:r("iOS"),isAndroid:r(tt),isOSX:r("OSX"),isLinux:r(et),isSolaris:r(nt),isFreeBSD:r(rt),isChromeOS:r(ot)}},ut=function(){return it({current:void 0,version:I()})},at=it,ct=(i(Z),i("iOS"),i(tt),i(et),i("OSX"),i(nt),i(rt),i(ot),function(t,e){var n=W.browsers(),r=W.oses(),o=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(J,Q),u=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ut,at),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}}(u,o,t,e);return{browser:o,os:u,deviceType:a}}),st=function(t){return window.matchMedia(t).matches},lt=(t=function(){return ct(navigator.userAgent,st)},n=!1,function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}),ft=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},dt=function(t,e){var n=(e||document).createElement(t);return ft(n)},mt=ft,gt=function(t,e){return t.dom===e.dom},ht=function(t,e){return lt().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},pt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},vt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),yt=tinymce.util.Tools.resolve("tinymce.util.VK"),wt=Object.keys,xt=function(t,e){for(var n=wt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ct=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),St=(1,function(t){return 1===function(t){return t.dom.nodeType}(t)}),kt=function(t,e){var n=t.dom;xt(e,(function(t,e){!function(t,e,n){if(!(h(n)||v(n)||y(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Ot=function(t){return O(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Tt=function(t){return d.from(t.dom.parentNode).map(mt)},_t=function(t){return C(t.dom.childNodes,mt)},Et=function(t,e){var n=t.dom.childNodes;return d.from(n[e]).map(mt)},At=function(t){return Et(t,0)},Nt=function(t){return Et(t,t.dom.childNodes.length-1)},Rt=function(t,e){Tt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Mt=function(t,e){t.dom.appendChild(e.dom)},zt=function(t,e){S(e,(function(e){Mt(t,e)}))},Dt=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Bt=function(t){return function(t,e){return mt(t.dom.cloneNode(!0))}(t)},Pt=function(t,e){var n=function(t,e){var n=dt(e),r=Ot(t);return kt(n,r),n}(t,e);Rt(t,n);var r=_t(t);return zt(n,r),Dt(t),n},It=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ht=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ft=function(t){return function(e){return e&&t.test(e.nodeName)}},Vt=function(t){return t&&3===t.nodeType},jt=Ft(/^(OL|UL|DL)$/),Ut=Ft(/^(OL|UL)$/),Wt=Ht("ol"),qt=Ft(/^(LI|DT|DD)$/),$t=Ft(/^(DT|DD)$/),Gt=Ft(/^(TH|TD)$/),Xt=Ht("br"),Kt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Yt=function(t,e){return t&&t.nodeName in e},Jt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Qt=function(t,e){return t.isChildOf(e,t.getRoot())},Zt=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Yt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Yt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},te=It.DOM,ee=function(t){pt(t,"dt")&&Pt(t,"dd")},ne=function(t,e){if(Vt(t))return{container:t,offset:e};var n=vt.getNode(t,e);return Vt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Vt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Vt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},re=function(t){var e=t.cloneRange(),n=ne(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=ne(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},oe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ie=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ae(t,n))},ue=function(t){var e=t.selection.getSelectedBlocks();return Lt.grep(function(t,e){var n=Lt.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",ae(t,e))||e}));return oe.unique(n)}(t,e),(function(t){return qt(t)}))},ae=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ce=function(t,e){var n=t.dom.getParents(e,"ol,ul",ae(t,e));return M(n)},se=function(t,e){var n=C(e,(function(e){return ce(t,e).getOr(e)}));return oe.unique(n)},le=function(t,e,n){return t.isSome()&&e.isSome()?d.some(n(t.getOrDie(),e.getOrDie())):d.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!h(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&b(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){Mt(t.item,e.list)},ge=function(t,e){var n={list:dt(e,t),item:dt("li",t)};return Mt(n.list,n.item),n},he=function(t){return pt(t,"OL,UL")},pe=function(t){return At(t).map(he).getOr(!1)},ve=function(t){return t.depth>0},be=function(t){return t.isSelected},ye=function(t){var e=_t(t),n=Nt(t).map(he).getOr(!1)?e.slice(0,-1):e;return C(n,Bt)},we=function(t){return S(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return T(A(t.slice(0,e)),r,o).orThunk((function(){return T(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=function(t,e){var n={};return function(t,e,n,r){xt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),o),n}(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=z({},r.listAttributes));var n,r}))})),t},xe=function(t,e,n,r){return At(r).filter(he).fold((function(){e.each((function(t){gt(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return Tt(t).filter(St).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:ye(t),itemAttributes:Ot(t),listAttributes:Ot(r),listType:Ct(r)}}))}(r,t,n.get());e.each((function(t){gt(t.end,r)&&n.set(!1)}));var i=Nt(r).filter(he).map((function(r){return Ce(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Ce(t,e,n,r)}))},Ce=function(t,e,n,r){return E(_t(r),(function(r){return(he(r)?Ce:xe)(t+1,e,n,r)}))},Se=function(t,e){var n=we(e);return function(t,e){var n=O(e,(function(e,n){return n.depth>e.length?function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item.dom,de(r,"list-style-type","none");var r;M(t).each((function(t){kt(t.list,e.listAttributes),kt(t.item,e.itemAttributes),zt(t.item,e.content)}))}(o,n),r=o,le(M(e),R(r),me),e.concat(o)}(t,e,n):function(t,e,n){var r=e.slice(0,n.depth);return M(r).each((function(e){!function(t,e){Mt(t.list,e),t.item=e}(e,function(t,e,n){var r=dt("li",t);return kt(r,e),zt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){Ct(t.list)!==e.listType&&(t.list=Pt(t.list,e.listType)),kt(t.list,e.listAttributes)}(e,n)})),r}(t,e,n)}),[]);return R(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},ke=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return C(t,(function(t){return{sourceList:t,entries:Ce(0,e,r,t)}}))}(e,function(t){var e=C(ue(t),mt);return le(_(e,u(pe)),_(A(e),u(pe)),(function(t,e){return{start:t,end:e}}))}(t));S(r,(function(e){!function(t,e){S(k(t,be),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return E(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ve),(function(e){return R(e).map(ve).getOr(!1)?Se(t,e):function(t,e){var n=we(e);return C(n,(function(e){var n,r,o=(n=e.content,r=document.createDocumentFragment(),S(n,(function(t){r.appendChild(t.dom)})),mt(r));return mt(Zt(t,o.dom))}))}(t,e)}))}(t,e.entries);S(o,(function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,S(o,(function(t){Rt(r,t)})),Dt(e.sourceList)}))},Oe=function(t,e){var n=C(function(t){var e=function(t){var e=ce(t,t.selection.getStart()),n=k(t.selection.getSelectedBlocks(),Ut);return e.toArray().concat(n)}(t);return se(t,e)}(t),mt),r=C(function(t){return k(ue(t),$t)}(t),mt),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();ke(t,n,e),function(t,e,n){S(n,"Indent"===e?ee:function(e){return function(t,e){pt(e,"dd")?Pt(e,"dt"):pt(e,"dt")&&Tt(e).each((function(n){return function(t,e,n){var r=te.select('span[data-mce-type="bookmark"]',e),o=Zt(t,n),i=te.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){te.remove(c);break}t.dom.isEmpty(a)||te.insertAfter(a,e),te.insertAfter(o,e),Jt(t.dom,n.parentNode)&&(u=n.parentNode,Lt.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),te.remove(u)),te.remove(n),Jt(t.dom,e)&&te.remove(e)}(t,n.dom,e.dom)}))}(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(re(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Te=function(t){return Oe(t,"Indent")},_e=function(t){return Oe(t,"Outdent")},Ee=function(t){return Oe(t,"Flatten")},Ae=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Ne=It.DOM,Re=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=Ne.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):Ne.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},Me=function(t){function e(e){var n,r,o;n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(n),n=n.parentNode,Ne.remove(o),!n.hasChildNodes()&&Ne.isBlock(n)&&n.appendChild(Ne.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Ne.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),re(n)},ze=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},De=function(t){return/\btox\-/.test(t.className)},Be=function(t,e,n){var r=function(t){var r=T(t.parents,jt,Gt).filter((function(t){return t.nodeName===e&&!De(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Pe=function(t,e){Lt.each(e,(function(e,n){t.setAttribute(n,e)}))},Ie=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Pe(e,n["list-attributes"]),Lt.each(t.select("li",e),(function(t){Pe(t,n["list-item-attributes"])}))}(t,e,n)},Le=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Xt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Kt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},He=function(t,e,n){return function(t,e){return t&&e&&jt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Fe=function(t,e){var n,r;if(n=e.nextSibling,He(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,He(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},Ve=function(t){return"list-style-type"in t},je=function(t,e,n){var r=ie(t),o=function(t){var e=ie(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return Lt.grep(t.querySelectorAll("ol,ul,dl"),(function(t){return jt(t)}))}(e):Lt.grep(n,(function(t){return jt(t)&&e!==t}))}(t);n=n||{},r&&o.length>0?function(t,e,n,r,o){if(e.nodeName!==r||Ve(o)){var i=Re(t.selection.getRng(!0));Lt.each([e].concat(n),(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Ie(t.dom,o,r),fe(t,ze(n),o)}else Ie(t.dom,e,r),fe(t,ze(n),e)}(t,e,r,o)})),t.selection.setRng(Me(i))}else Ee(t)}(t,r,o,e,n):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Ve(r)||De(e)){var o=Re(t.selection.getRng(!0));Ie(t.dom,e,r);var i=t.dom.rename(e,n);Fe(t.dom,i),t.selection.setRng(Me(o)),fe(t,ze(n),i)}else Ee(t);else(function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=ae(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=Re(r);Lt.each(function(t,e,n){for(var r,o=[],i=t.dom,u=Le(t,e,!0,n),a=Le(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Lt.each(c,(function(e){if(Kt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Xt(e))return Xt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Ae.isBookmarkNode(e)&&(Kt(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i),(function(r){var i,a=r.previousSibling;a&&jt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Lt.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r),Ie(u,i,n),Fe(t.dom,i)})),t.selection.setRng(Me(a))}})(t,n,r),fe(t,ze(n),e)}(t,r,e,n)},Ue=It.DOM,We=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Vt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=vt.getNode(o,i));var a=new bt(o,r);for(n&&function(t,e){return!!Xt(e)&&t.isBlock(e.nextSibling)&&!Xt(e.previousSibling)}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Vt(o)&&o.data.length>0)return o}},qe=function(t,e){var n=e.childNodes;return 1===n.length&&!jt(n[0])&&t.isBlock(n[0])},$e=function(t,e,n){var r,o=e.parentNode;if(Qt(t,e)&&Qt(t,n)){jt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Xt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Xt(i)&&e.hasChildNodes()&&t.remove(i),Jt(t,n,!0)&&t.$(n).empty(),function(t,e,n){var r,o=qe(t,n)?n.firstChild:n;if(function(t,e){qe(t,e)&&t.remove(e.firstChild,!0)}(t,e),!Jt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)}(t,e,n),r&&n.appendChild(r);var u=ht(mt(n),mt(e))?t.getParents(e,jt,n):[];t.remove(e),S(u,(function(e){Jt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Ge=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ae(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&Jt(n,a))return!0;var c=re(r.getRng()),s=n.getParent(We(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),$e(t.dom,e,n),t.selection.setCursorLocation(n)}(t,n,r);else{var i=Re(e);$e(o,n,r),t.selection.setRng(Me(i))}}(t,c,s,u):(n=u).parentNode.firstChild===n?_e(t):function(t,e,n,r){var o=Re(e);$e(t.dom,n,r);var i=Me(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Ee(t)})),!0}return!1},Xe=function(t,e){return t.selection.isCollapsed()?function(t,e){return Ge(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ae(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=re(t.selection.getRng()),a=n.getParent(We(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Fe(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)}(t,e):function(t){var e=t.selection.getStart(),n=ae(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||ue(t).length>0)&&(t.undoManager.transact((function(){var e,n;t.execCommand("Delete"),e=t.dom,n=t.getBody(),Lt.each(Lt.grep(e.select("ol,ul",n)),(function(t){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),Jt(t,r)&&Ue.remove(r)):Ue.setStyle(r,"listStyleType","none")),jt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(e,t)}))})),!0)}(t)},Ke=function(t){var e=t.dom,n=ie(t);Wt(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact((function(){e.setAttrib(ie(t),"start","1"===r.start?"":r.start)})),n.close()}})},Ye=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}};r.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)&&(function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==yt.TAB||yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?_e(t):Te(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===yt.BACKSPACE?Xe(t,!1)&&e.preventDefault():e.keyCode===yt.DELETE&&Xe(t,!0)&&e.preventDefault()}))}(t)}(t),function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Te(t):"outdent"===n&&_e(t)})),t.addCommand("InsertUnorderedList",(function(e,n){je(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){je(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){je(t,"DL",n)})),t.addCommand("RemoveList",(function(){Ee(t)})),t.addCommand("mceListProps",(function(){Ke(t)})),t.addQueryStateHandler("InsertUnorderedList",Ye(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Ye(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Ye(t,"DL"))}(t)),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Be(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Be(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return Ke(t)},onSetup:function(e){return Be(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ie(t,e);return Wt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){Xe(t,e)}}}(t)}))}()},2540:(t,e,n)=>{n(3167)},3167:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},m=d("string"),g=d("object"),h=d("array"),p=Array.prototype.push,v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!h(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);p.apply(e,t[n])}return e},y=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},w=Object.keys,x=Object.hasOwnProperty,C=function(t,e){return S(t,e)?f.from(t[e]):f.none()},S=function(t,e){return x.call(t,e)},k=function(t){return t.getParam("media_scripts")},O=function(t){return t.getParam("media_live_embeds",!0)},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},N=_.DOM,R=function(t){return t.replace(/px$/,"")},M=function(t,e){var n=y(!1),r={};return E({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(S(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?N.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:C(n,"max-width").map(R).getOr(""),height:C(n,"max-height").map(R).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=T.extend(o.map,r)),"script"===e){var i=A(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=function(t){return{mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()]||""},D=tinymce.util.Tools.resolve("tinymce.html.Schema"),B=tinymce.util.Tools.resolve("tinymce.html.Writer"),P=_.DOM,I=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},L=function(t,e){!function(t,e){for(var n=w(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},H=["source","altsource"],F=function(t,e,n){var r,o=B(),i=y(!1),u=0;return E({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(S(a.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?P.parseStyle(n):{};r["max-width"]=I(t.width),r["max-height"]=I(t.height),L(e,{style:P.serializeStyle(r)})}(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&L(a,{width:e.width,height:e.height})}if(n)switch(t){case"video":L(a,{poster:e.poster,src:""}),e.altsource&&L(a,{src:""});break;case"iframe":L(a,{src:e.source});break;case"source":if(u<2&&(L(a,{src:e[H[u]],type:e[H[u]+"mime"]}),!e[H[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[H[a]]){var c=[];c.map={},u<=a&&(L(c,{src:e[H[a]],type:e[H[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},L(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},D({})).parse(t),o.getContent()},V=[{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&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}],j=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},U=function(t,e){var n=T.extend({},e);if(!n.source&&(T.extend(n,M(k(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=z(n.source),n.altsourcemime=z(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=V.filter((function(t){return t.regex.test(r)}))).length>0?T.extend({},o[0],{url:j(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowFullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return F(n.embed,n,!0);var u=A(k(t),n.source);u&&(n.type="script",n.width=String(u.width),n.height=String(u.height));var a=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",T.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,a):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},W=tinymce.util.Tools.resolve("tinymce.util.Promise"),q={},$=function(t){return function(e){return U(t,e)}},G=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new W((function(r,o){var i=function(n){return n.html&&(q[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};q[t.source]?i(q[t.source]):n({url:t.source},i,o)}))}(e,$(t),n):function(t,e){return new W((function(n){n({html:e(t),url:t.source})}))}(e,$(t))},X=function(t,e){return C(e,t).bind((function(t){return C(t,"meta")}))},K=function(t,e,n){return function(r){var o,i=function(){return C(t,r)},u=function(){return C(e,r)},a=function(t){return C(t,"value").bind((function(t){return t.length>0?f.some(t):f.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return g(t)?a(t).orThunk(u):u().orThunk((function(){return f.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return g(t)?a(t):f.from(t)}))}))).getOr(""),o}},Y=function(t,e){var n={};return C(t,"dimensions").each((function(t){v(["width","height"],(function(r){C(e,r).orThunk((function(){return C(t,r)})).each((function(t){return n[r]=t}))}))})),n},J=function(t,e){var n=e?X(e,t).getOr({}):{},r=K(t,n,e);return o(o(o(o(o({},r("source")),r("altsource")),r("poster")),r("embed")),Y(t,n))},Q=function(t){var e=o(o({},t),{source:{value:C(t,"source").getOr("")},altsource:{value:C(t,"altsource").getOr("")},poster:{value:C(t,"poster").getOr("")}});return v(["width","height"],(function(n){C(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Z=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},tt=function(t,e){return M(k(t),e)},et=function(t,e){return function(n){if(m(n.url)&&n.url.trim().length>0){var r=n.html,i=tt(e,r),u=o(o({},i),{source:n.url,embed:r});t.setData(Q(u))}}},nt=function(t,e){var n=t.dom.select("img[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("img[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},rt=function(t){var e=function(t){var e=t.selection.getNode(),n=function(t){return t.getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")}(e)?t.serializer.serialize(e,{selection:!0}):"";return o({embed:n},M(k(t),n))}(t),n=y(e),r=Q(e),i=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],u={title:"General",name:"general",items:b([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},a=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&a.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&a.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var c={title:"Advanced",name:"advanced",items:a},s=[u,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];a.length>0&&s.push(c);var l={type:"tabpanel",tabs:s},f=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=J(e.getData());(function(t,e,n){var r;e.embed=F(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,q.hasOwnProperty(r)))?nt(n,e.embed):G(n,e).then((function(t){nt(n,t.html)})).catch(Z(n))})(n.get(),r,t),e.close()},onChange:function(e,r){switch(r.name){case"source":!function(e,n){var r=J(n.getData(),"source");e.source!==r.source&&(et(f,t)({url:r.source,html:""}),G(t,r).then(et(f,t)).catch(Z(t)))}(n.get(),e);break;case"embed":!function(e){var n=J(e.getData()),r=tt(t,n.embed);e.setData(Q(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var r=J(e.getData(),n),i=U(t,r);e.setData(Q(o(o({},r),{embed:i})))}(e,r.name)}n.set(J(e.getData()))},initialData:r})},ot=tinymce.util.Tools.resolve("tinymce.html.Node"),it=tinymce.util.Tools.resolve("tinymce.Env"),ut=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=B();return E({validate:!1,allow_conditional_comments:!1,comment:function(t){r.comment(t)},cdata:function(t){r.cdata(t)},text:function(t,e){r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},D({})).parse(e),r.getContent()},at=function(t,e){var n=e.name,r=new ot("img",1);return r.shortEnded=!0,st(t,e,r),r.attr({width:e.attr("width")||"300",height:e.attr("height")||("audio"===n?"30":"150"),style:e.attr("style"),src:it.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},ct=function(t,e){var n=e.name,r=new ot("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),st(t,e,r);var o=new ot(n,1);o.attr({src:e.attr("src"),allowfullscreen:e.attr("allowfullscreen"),style:e.attr("style"),class:e.attr("class"),width:e.attr("width"),height:e.attr("height"),frameborder:"0"});var i=new ot("span",1);return i.attr("class","mce-shim"),r.append(o),r.append(i),r},st=function(t,e,n){var r,o,i,u=e.attributes;for(i=u.length;i--;)r=u[i].name,o=u[i].value,"width"!==r&&"height"!==r&&"style"!==r&&("data"!==r&&"src"!==r||(o=t.convertURL(o,r)),n.attr("data-mce-p-"+r,o));var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(ut(t,a))),n.firstChild=null)},lt=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},ft=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||lt(t))return!0;return!1},dt=function(t,e){return function(n){return t.selection.selectorChangedWithUnbind(e.join(","),n.setActive).unbind}};r.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){rt(t)}))}(t),function(t){t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){t.execCommand("mceMedia")},onSetup:dt(t,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){t.execCommand("mceMedia")}})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();T.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();T.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=A(k(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),"iframe"===n.name&&O(t)&&it.ceFalse?ft(n)||n.replace(ct(t,n)):ft(n)||n.replace(at(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,u,a,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new ot(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(u=r.attributes).length;i--;){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new ot("#text",3)).raw=!0,c.value=ut(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))}(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){var e=t.target.getAttribute("data-mce-object");"audio"!==e&&"script"!==e||t.preventDefault()})),t.on("ObjectResized",(function(t){var e,n=t.target;n.getAttribute("data-mce-object")&&(e=n.getAttribute("data-mce-html"))&&(e=unescape(e),n.setAttribute("data-mce-html",escape(F(e,{width:String(t.width),height:String(t.height)}))))}))}(t),function(t){return{showDialog:function(){rt(t)}}}(t)}))}()},8208:(t,e,n)=>{n(8931)},8931:(t,e,n)=>{const{EventDispatcher:r}=n(7575);!function(){"use strict";tinymce.PluginManager.add("mychecklist",(function(t,e){function n(){t.insertContent('<ul class="tox-checklist">\n <li></li>\n </ul>')}t.addCommand("InsertCheckList",(function(t,e){n()})),t.ui.registry.addButton("mychecklist",{icon:"checklist",tooltip:"Insert check list",onAction:n});let r=null;t.on("mousedown",(function(e){var n=e.target.parentElement;e.offsetX>0||"tox-checklist"===n.className&&(r=t.selection.getRng())})),t.on("mouseup",(function(e){var n=e.target.parentElement;e.offsetX>0||"tox-checklist"===n.className&&t.selection.setRng(r)})),t.on("NodeChange",(function(t){var e,n=t.target;n&&(e=n.parentElement),e&&"tox-checklist"===e.className&&"LI"===n.nodeName&&"tox-checklist--checked"===n.className&&(n.className="")})),t.on("NewBlock",(function(t){"LI"===t.newBlock.nodeName&&"tox-checklist--checked"===t.newBlock.className&&(t.newBlock.className="")})),t.on("click",(function(e){var n=e.target,o=n.parentElement;e.offsetX>0||("tox-checklist"===o.className&&("LI"===n.nodeName&&"tox-checklist--checked"===n.className?n.className="":"LI"===n.nodeName&&""===n.className&&(n.className="tox-checklist--checked")),t.fire("input"),t.selection.setRng(r))}))}))}()},1933:(t,e,n)=>{n(4129)},4129:(t,e,n)=>{"use strict";n.r(e);var r,o,i,u,a=n(7575);r=n.n(a)().util.Tools.resolve("tinymce.PluginManager"),o=function(t,e){t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,e("<br>"))}))},i=function(t,e,n){if(e&&e.isActive&&e.isActive())t.selection.getNode().textContent.length<=0?o(t,(t=>`<p>${t.replace(/\n/gm,"<br>")}</p>`)):t.execCommand("mceInsertNewLine",!1,{shiftKey:!0});else{var r=t.selection.getContent({format:"text"});if(r=r.replace(/^\n/gm,""),"shortcut"===n&&(r="<br>"),r.length>0){const e=t.selection.getRng();t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,`<pre class='codeblock'>${r}</pre>`)})),t.selection.setRng(e),t.nodeChanged()}else o(t,(t=>`<pre class='codeblock'>${t.replace(/\n/gm,"<br>")}</pre>`))}},u=function(t){return function(e){var n=function(t){e.setActive("PRE"===t.element.tagName)},r=function(e){"<pre></pre>"===e.content&&(e.preventDefault(),t.creatingCodeBlock=!0,i(t,void 0,"shortcut"))},o=function(e){t.creatingCodeBlock&&"mceInsertNewLine"===e.command&&(e.preventDefault(),t.creatingCodeBlock=!1)};return t.on("BeforeExecCommand",o),t.on("BeforeSetContent",r),t.on("NodeChange",n),function(){return t.off("BeforeExecCommand",o),t.off("BeforeSetContent",r),t.off("NodeChange",n)}}},r.add("mycode",(function(t){return function(t){t.addCommand("CodeBlock",(function(e){i(t,e)}))}(t),function(t){t.ui.registry.addToggleButton("code",{icon:"sourcecode",tooltip:"Code",onAction:function(e){return i(t,e)},onSetup:u(t)})}(t),{}}))},6586:(t,e,n)=>{n(9586)},9586:()=>{!function(){"use strict";tinymce.PluginManager.add("myimage",(function(t,e){function n(){var e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.onchange=function(){var e=this.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=function(){r(n.result,600,"image/jpeg",(e=>{var r=`<img src="${e}">`;t.insertContent(r),n.onerror=null}),.7),n.onerror=function(t){n.onerror=null}}},e.dispatchEvent(new MouseEvent("click"))}t.ui.registry.addButton("myimage",{icon:"image",tooltip:"Insert image",onAction:n});var r=function(t,e,n="image/jpeg",r,o=.7){var i,u,a,c,s,l;new Promise((function(e){(i=new Image).src=t,e("Done : ")})).then((t=>{u=i.width,a=i.height,c=Math.floor(a/u*e),(s=document.createElement("canvas")).width=e,s.height=c,s.getContext("2d").drawImage(i,0,0,e,c),l=s.toDataURL(n,o),r(l)}))};t.addCommand("InsertImage",(function(t,e){n()}))}))}()},5031:(t,e,n)=>{n(7814)},7814:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return function(e){return-1!==(" "+e.attr("class")+" ").indexOf(t)}},o=function(t,e,n){return function(r){var o=arguments,i=o[o.length-2],u=i>0?e.charAt(i-1):"";if('"'===u)return r;if(">"===u){var a=e.lastIndexOf("<",i);if(-1!==a){var c=e.substring(a,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+t.dom.encode(o[0])+'">'+t.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}};t.add("noneditable",(function(t){!function(t){var i="contenteditable",u=" "+e.trim(function(t){return t.getParam("noneditable_editable_class","mceEditable")}(t))+" ",a=" "+e.trim(n(t))+" ",c=r(u),s=r(a),l=function(t){var e=t.getParam("noneditable_regexp",[]);return e&&e.constructor===RegExp?[e]:e}(t);t.on("PreInit",(function(){l.length>0&&t.on("BeforeSetContent",(function(e){!function(t,e,r){var i=e.length,u=r.content;if("raw"!==r.format){for(;i--;)u=u.replace(e[i],o(t,u,n(t)));r.content=u}}(t,l,e)})),t.parser.addAttributeFilter("class",(function(t){for(var e,n=t.length;n--;)e=t[n],c(e)?e.attr(i,"true"):s(e)&&e.attr(i,"false")})),t.serializer.addAttributeFilter(i,(function(t){for(var e,n=t.length;n--;)e=t[n],(c(e)||s(e))&&(l.length>0&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(i,null))}))}))}(t)}))}()},2875:(t,e,n)=>{n(5103)},5103:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return!function(t){return null==t}(t)},m=("function",function(t){return"function"==typeof t}),g=Array.prototype.slice,h=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},p=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=m(Array.from)?Array.from:function(t){return g.call(t)},y=function(){var t=r(f.none());return{clear:function(){return t.set(f.none())},set:function(e){return t.set(f.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},w=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},x=tinymce.util.Tools.resolve("tinymce.Env"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=tinymce.util.Tools.resolve("tinymce.util.Promise"),k=tinymce.util.Tools.resolve("tinymce.util.VK"),O=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=function(t){return t.getParam("paste_data_images",!1)},E=function(t){return t.getParam("paste_merge_formats",!0)},A=function(t){return t.getParam("paste_retain_style_properties")},N=function(t){return t.getParam("validate")},R=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},M=function(t){return t.getParam("paste_data_images",!1,"boolean")},z=function(t){return T.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},D="\x3c!-- x-tinymce/html --\x3e",B=function(t){return-1!==t.indexOf(D)},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),I=tinymce.util.Tools.resolve("tinymce.html.DomParser"),L=tinymce.util.Tools.resolve("tinymce.html.Serializer"),H=" ",F=tinymce.util.Tools.resolve("tinymce.html.Node"),V=tinymce.util.Tools.resolve("tinymce.html.Schema");function j(t,e){return T.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t}function U(t){return j(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?H:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function W(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}function q(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),T.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e}function $(t){var e,n,r=1;function o(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e}function i(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0}function u(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{u(t)}while(t=t.next)}function a(t,o,a){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new F(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,u(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)}for(var c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){a(t,"ul");continue}if(q(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),a(t,"ol",m);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}function G(t,e,n,r){var o,i={},u=t.dom.parseStyle(r);return T.each(u,(function(u,a){switch(a){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(u)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":a="text-align";break;case"vert-align":a="vertical-align";break;case"font-color":case"mso-foreground":a="color";break;case"mso-background":case"mso-highlight":a="background";break;case"font-weight":case"font-style":return void("normal"!==u&&(i[a]=u));case"mso-element":if(/^(comment|comment-list)$/i.test(u))return void n.remove()}0!==a.indexOf("mso-comment")?0!==a.indexOf("mso-")&&("all"===A(t)||e&&e[a])&&(i[a]=u):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new F("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new F("i",1))),(i=t.dom.serializeStyle(i,n.name))||null}var X,K=function(t,e){return{content:t,cancelled:e}},Y=function(t,e){return t.insertContent(e,{merge:E(t),paste:!0}),!0},J=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},Q=function(t,e){return J(e)&&h(z(t),(function(t){return w(n=e,r="."+t,n.length-r.length);var n,r}))},Z=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!J(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},tt=function(t,e,n){return!!Q(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},et=function(t){return"\n"===t||"\r"===t},nt=function(t,e,n,r){var o=function(t,e,n){var r=W(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?function(t,e){var n,r=A(t);r&&(n=T.makeMap(r.split(/[, ]/))),e=j(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,H],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(H):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=V({valid_elements:o,valid_children:"-li[p]"});T.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var u=I({},i);u.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",G(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),u.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),u.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),u.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var a=u.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&$(a),L({validate:N(t)},i).serialize(a)}(t,e):e}(t,e):e;return function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=I({},t.schema);n.addNodeFilter("meta",(function(t){T.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return L({validate:N(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return K(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):K(i,o.isDefaultPrevented())}(t,o,n,r)}(t,e,n);!1===o.cancelled&&function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?Y(t,e):function(t,e){T.each([Z,tt,Y],(function(n){return!0!==n(t,e,Y)}))}(t,e)}(t,o.content,r)},rt=function(t,e,n){var r=n||B(e);nt(t,function(t){return t.replace(D,"")}(e),r,!1)},ot=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=T.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===u.length?u[0]:T.map(u,(function(t){return o+t+i})).join("")}(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(function(t,e){var n,r,o,i=(n=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(n+1).join(" "),u=e.replace(/\t/g,i);return(r=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===H?t.pcIsSpace||""===t.str||t.str.length===u.length-1||function(t,e){return e<t.length&&e>=0&&et(t[e])}(u,t.str.length+1)?{pcIsSpace:!1,str:t.str+H}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:et(e),str:t.str+e}},o={pcIsSpace:!1,str:""},v(u,(function(t){o=r(o,t)})),o).str}(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));nt(t,r,!1,!0)},it=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},ut=function(t,e){return e in t&&t[e].length>0},at=function(t){return ut(t,"text/html")||ut(t,"text/plain")},ct=("mceclip",X=0,function(){return"mceclip"+X++}),st=function(t,e,n){var r,o="paste"===e.type?e.clipboardData:e.dataTransfer;if(M(t)&&o){var i=function(t,e){var n=e.items?p(b(e.items),(function(t){return t.getAsFile()})):[],r=e.files?b(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,function(t){var e=z(t);return function(t){return n=t.type,w(n,"image/",0)&&h(e,(function(e){return n=e,r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(T.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}));var n}}(t))}(t,o);if(i.length>0)return e.preventDefault(),(r=i,S.all(p(r,(function(t){return new S((function(e){var n=function(t){return d(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))).then((function(e){n&&t.selection.setRng(n),v(e,(function(e){!function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,u=o.type,a=ct(),c=e.blob,s=new Image;if(s.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,s)){var l=t.editorUpload.blobCache,f=void 0,m=l.getByData(i,u);if(m)f=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&d(c.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return d(n)?t.dom.encode(n[1]):null}(t,c.name):a,p=g?c.name:void 0;f=l.create(a,c,i,h,p),l.add(f)}rt(t,'<img src="'+f.blobUri()+'">',!1)}else rt(t,'<img src="'+e.uri+'">',!1)}(t,e)}))})),!0}return!1},lt=function(t){return k.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},ft=function(t){return x.ie&&t.inline?document.body:t.getBody()},dt=function(t){return t.dom.get("mcepastebin")},mt=function(t,e){return e===t},gt=function(t,e){var n,r=dt(t);return(n=r)&&"mcepastebin"===n.id&&mt(e,r.innerHTML)},ht=function(t){var e=r(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(ft(t),"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"},n);(x.ie||x.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),function(t,e,n){(function(t){return ft(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){gt(t,n)||t.fire("paste")}))}(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(dt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return dt(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=T.grep(ft(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();T.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var u=t.dom.create("div");r.insertBefore(u,o[i]),e(u,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return gt(t,n)},isDefaultContent:function(t){return mt(n,t)}}},pt=function(t,e){var n=ht(t);return t.on("PreInit",(function(){return function(t,e,n){var r;(function(t,e,n){var r,o=y(),i=y();function u(t,n,r,o,i){var u;ut(n,"text/html")?u=n["text/html"]:(u=e.getHtml(),i=i||B(u),e.isDefaultContent(u)&&(o=!0)),u=U(u),e.remove();var a,c,s,l,f,d,m,g=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(u),h=Q(t,u);(!u.length||g&&!h)&&(o=!0),(o||h)&&(u=ut(n,"text/plain")&&g?n["text/plain"]:(a=u,c=V(),s=I({},c),l="",f=c.getShortEndedElements(),d=T.makeMap("script noscript style textarea video audio iframe object"," "),m=c.getBlockElements(),a=j(a,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(f[n]&&(l+=" "),d[n])l+=" ";else{if(3===e.type&&(l+=e.value),!e.shortEnded&&(e=e.firstChild))do{t(e)}while(e=e.next);m[n]&&r.next&&(l+="\n","p"===n&&(l+="\n"))}}else l+="\n"}(s.parse(a)),l)),e.isDefaultContent(u)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?ot(t,u):rt(t,u,i)}t.on("keyup",i.clear),t.on("keydown",(function(n){var u=function(t){lt(t)&&!t.isDefaultPrevented()&&e.remove()};if(lt(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&x.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),x.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:!0})}(t);e.remove(),e.create(),t.once("keyup",u),t.once("paste",(function(){t.off("keyup",u)}))}})),t.on("paste",(function(a){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return it(e.clipboardData||t.getDoc().dataTransfer)}(t,a),l="text"===n.get()||r,f=ut(s,"x-tinymce/html");r=!1,a.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(a)?e.remove():at(s)||!st(t,a,e.getLastRng()||t.selection.getRng())?(c||a.preventDefault(),!x.ie||c&&!a.ieFake||ut(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),ut(s,"text/html")?(a.preventDefault(),f||(f=B(s["text/html"])),u(t,s,c,l,f)):C.setEditorTimeout(t,(function(){u(t,s,c,l,f)}),0)):e.remove()}))})(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i,u=function(t){return 0===t.indexOf("webkit-fake-url")},a=function(t){return 0===t.indexOf("data:")};if(!M(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var c=e.length;c--;)(r=e[c].attr("src"))&&(u(r)||!R(t)&&a(r))&&((i=e[c]).attr("data-mce-object")||r===x.transparentSrc||i.remove())}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return rt(t,e,n)},pasteText:function(e){return ot(t,e)},pasteImageData:function(e,n){return st(t,e,n)},getDataTransferItems:it,hasHtmlOrText:at,hasContentType:ut}},vt=function(t,e,n,r){!function(t,e,n){if(!function(t){return!1===x.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData("x-tinymce/html",e),!0}catch(t){return!1}}(t.clipboardData,e.html,e.text)?n(e.html,r):(t.preventDefault(),r())},bt=function(t){return function(e,n){var r=function(t){return D+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var u=t.selection.getRng();i.focus();var a=t.dom.createRng();a.selectNodeContents(i),t.selection.setRng(a),C.setTimeout((function(){t.selection.setRng(u),o.parentNode.removeChild(o),n()}),0)}},yt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},wt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},xt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ct=function(t,e){return xt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},St=function(t,e){t.focus(),t.selection.setRng(e)};function kt(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))}function Ot(t,e){if(!W(e))return e;var n=[];return T.each(t.schema.getBlockElements(),(function(t,e){n.push(e)})),e=j(e,[[new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g"),"$1"]]),j(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Tt(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var u=t.dom,a=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=u.parseStyle(u.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=u.getStyle(a,o[s],!0);/color/.test(o[s])&&(l=u.toHex(l),f=u.toHex(f)),f!==l&&(c[o[s]]=l)}return(c=u.serializeStyle(c,"span"))?e+' style="'+c+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))}function _t(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))}var Et=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};o.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=r(!1),n=r(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),o=pt(t,n),i=function(t){x.webkit&&kt(t,Tt),x.ie&&(kt(t,Ot),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,_t))}(t);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)})}(t,o),function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),O(t,!1)):(e.pasteFormat.set("text"),O(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))}(t,o),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),function(t){t.on("cut",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){if(x.browser.isChrome()||x.browser.isFirefox()){var e=t.selection.getRng();C.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){}))}}(t))}(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),_(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ct(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,u=e.getDataTransferItems(r.dataTransfer),a=e.hasContentType(u,"x-tinymce/html");if((e.hasHtmlOrText(u)&&(!(i=u["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=u["mce-internal"]||u["text/html"]||u["text/plain"];c&&(r.preventDefault(),C.setEditorTimeout(t,(function(){t.undoManager.transact((function(){u["mce-internal"]&&t.execCommand("Delete"),St(t,o),c=U(c),u["text/html"]?e.pasteHtml(c,a):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){_(t)&&!1===n.get()&&(e.preventDefault(),St(t,Ct(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,o,e),function(t,e){return{clipboard:t,quirks:e}}(o,i)}}))}()},1295:(t,e,n)=>{n(6834)},6834:()=>{!function(){"use strict";var t,e,n,r,o,i=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},c=function(t){return function(){return t}},s=c(!1),l=c(!0),f=c("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),d=function(){return m},m=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:s,isSome:s,isNone:l,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:n,orThunk:e,map:d,each:function(){},bind:d,exists:s,forall:l,filter:d,equals:t,equals_:t,toArray:function(){return[]},toString:c("none()")}),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,(function(e){return n(t,e)}))}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=f,v=tinymce.util.Tools.resolve("tinymce.util.Tools"),b=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},y=function(t){return function(e){return typeof e===t}},w=b("string"),x=b("array"),C=y("boolean"),S=y("number"),k=Array.prototype.slice,O=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},_=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},E=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!x(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e}(T(t,e))},N=Object.hasOwnProperty,R=function(t,e){return N.call(t,e)},M=("undefined"!=typeof window?window:Function("return this;")(),3,function(t){return 3===function(t){return t.dom.nodeType}(t)}),z=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},D=z,B=function(t,e){return{element:t,offset:e}},P=function(t,e){(function(t,e){(function(t){return h.from(t.dom.parentNode).map(D)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))})(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},I=(r=M,"text",{get:function(t){if(!r(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o=function(t){return r(t)?h.from(t.dom.nodeValue):h.none()},set:function(t,e){if(!r(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}}),L=function(t){return I.get(t)},H=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),F=function(t,e){return t.isBlock(e)||R(t.schema.getShortEndedElements(),e.nodeName)},V=function(t,e){return"false"===t.getContentEditable(e)},j=function(t,e){return!t.isBlock(e)&&R(t.schema.getWhiteSpaceElements(),e.nodeName)},U=function(t,e){return function(t,e){var n=function(t){return T(t.dom.childNodes,D)}(t);return n.length>0&&e<n.length?B(n[e],0):B(t,e)}(D(t),e)},W=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var u=i?e(!1):n;u;){var a=V(t,u);if(a||j(t,u)){if(a?r.cef(u):r.boundary(u))break;u=e(!0)}else{if(F(t,u)){if(r.boundary(u))break}else 3===u.nodeType&&r.text(u);if(u===o)break;u=e(!1)}}},q=function(t,e,n,r,o){if(!function(t,e){return F(t,e)||V(t,e)||j(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),u=new H(n,i),a=o?u.next:u.prev;W(t,a,n,{boundary:l,cef:l,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(D(t))}})}},$=function(t,e,n,r,o,i){void 0===i&&(i=!0);var u=new H(n,e),a=[],c={sOffset:0,fOffset:0,elements:[]};q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(a.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return W(t,u.next,n,{boundary:s,cef:function(t){return s(),o&&a.push.apply(a,o.cef(t)),!1},text:function(t){c.elements.push(D(t)),o&&o.text(t,c)}},r,i),r&&q(t,c,r,e,!0),s(),a},G=function(t,e){var n=U(e.startContainer,e.startOffset),r=n.element.dom,o=U(e.endContainer,e.endOffset),i=o.element.dom;return $(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i;return n=A((i=D(e),function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),D)}("*[contenteditable=true]",i)),(function(e){var n=e.dom;return $(t,n,n)})),r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=k.call(n,0)).sort(r),o}},!1)},X=function(t,e){return e.collapsed?[]:G(t,e)},K=function(t,e){var n=t.createRng();return n.selectNode(e),X(t,n)},Y=function(t,e){return A(e,(function(e){var n=e.elements,r=T(n,L).join("");return function(t,e){var n,r,o;return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}((n=t,r=function(t,n){var r=L(n),o=t.last,i=o+r.length,u=A(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(u),last:i}},o={results:[],last:0},_(n,(function(t){o=r(o,t)})),o).results,(function(t){return t.matchId}))}(n,function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,u=[];i=o.exec(t);){var a=i[e.matchIndex],c=i.index+i[0].indexOf(a),s=c+a.length;if(s>r)break;u.push({start:c,finish:s}),o.lastIndex=s}return u}(r,t,e.sOffset,r.length-e.fOffset))}))},J=function(t,e){E(t,(function(t,n){E(t,(function(t){var r,o,i=D(e.cloneNode(!1));r="data-mce-index",o=n,function(t,e,n){if(!(w(n)||C(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(i.dom,r,o);var u=t.element.dom;if(u.length===t.finish&&0===t.start)P(t.element,i);else{u.length!==t.finish&&u.splitText(t.finish);var a=u.splitText(t.start);P(D(a),i)}}))}))},Q=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},Z=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return st(t,e,!1),r?function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),u=i.length>0?function(t,e){return A(e,(function(e){return K(t,e)}))}(t,i):X(t,n.getRng()),a=Y(e,u);return J(a,r),n.moveToBookmark(o),a.length}(t.dom,n,t.selection,o):function(t,e,n,r){var o=K(t,n),i=Y(e,o);return J(i,r),i.length}(t.dom,n,i,o)},tt=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},et=function(t,e){var n=[],r=v.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=Q(r[o]);null!==i&&i.length&&i===e.toString()&&n.push(r[o])}return n},nt=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(et(t,r.index),"mce-match-marker-selected");var u=et(t,o);return u.length?(i.addClass(et(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(u[0]),o):-1},rt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},ot=function(t,e,n,r,o,i){var u=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+p()+")"+n+"(?=$|\\s|"+p()+")":n}(n,o),a={regex:new RegExp(u,r?"g":"gi"),matchIndex:1},c=Z(t,e,a,i);if(c){var s=nt(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},it=function(t,e){var n=nt(t,e,!0);e.set(a(a({},e.get()),{index:n}))},ut=function(t,e){var n=nt(t,e,!1);e.set(a(a({},e.get()),{index:n}))},at=function(t){var e=Q(t);return null!==e&&e.length>0},ct=function(t,e,n,r,o){var i,u=e.get(),c=u.index,s=c;r=!1!==r;for(var l=t.getBody(),f=v.grep(v.toArray(l.getElementsByTagName("span")),at),d=0;d<f.length;d++){var m=Q(f[d]),g=i=parseInt(m,10);if(o||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,tt(f[d])):rt(t.dom,f[d]);f[++d];){if((g=parseInt(Q(f[d]),10))!==i){d--;break}rt(t.dom,f[d])}r&&s--}else i>c&&f[d].setAttribute("data-mce-index",String(i-1))}return e.set(a(a({},u),{count:o?0:u.count-1,index:s})),r?it(t,e):ut(t,e),!o&&e.get().count>0},st=function(t,e,n){var r,o,i,u=e.get(),c=v.toArray(t.getBody().getElementsByTagName("span"));for(r=0;r<c.length;r++){var s=Q(c[r]);null!==s&&s.length&&(s===u.index.toString()&&(o||(o=c[r].firstChild),i=c[r].firstChild),tt(c[r]))}if(e.set(a(a({},u),{index:-1,count:0,text:""})),o&&i){var l=t.dom.createRng();return l.setStart(o,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},lt=tinymce.util.Tools.resolve("tinymce.Env"),ft=function(t,e){var n,r=(n=i(h.none()),{clear:function(){return n.set(h.none())},set:function(t){return n.set(h.some(t))},isSet:function(){return n.get().isSome()},on:function(t){return n.get().each(t)}});t.undoManager.add();var o=v.trim(t.selection.getContent({format:"text"}));function u(t){(!function(t,e){return e.get().count>1}(0,e)?t.disable:t.enable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")}var c=function(t,e){var n=e?t.disable:t.enable;_(["replace","replaceall","prev","next"],n)},s=function(t,e){lt.browser.isSafari()&<.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},l=function(n){st(t,e,!1),c(n,!0),u(n)},f=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)it(t,e);else{var i=ot(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);i<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),c(n,0===i)}u(n)}else l(n)},d=e.get(),m={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:o,replacetext:"",wholewords:d.wholeWord,matchcase:d.matchCase,inselection:d.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&l(t)},onAction:function(n,r){var o=n.getData();switch(r.name){case"find":f(n);break;case"replace":ct(t,e,o.replacetext)?u(n):l(n);break;case"replaceall":ct(t,e,o.replacetext,!0,!0),l(n);break;case"prev":ut(t,e),u(n);break;case"next":it(t,e),u(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(a(a({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),l(n)}s(n,r.name)},onSubmit:function(t){f(t),s(t,"find")},onClose:function(){t.focus(),st(t,e),t.undoManager.add()}};r.set(t.windowManager.open(m,{inline:"toolbar"}))},dt=function(t,e){return function(){ft(t,e)}};u.add("searchreplace",(function(t){var e=i({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){ft(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:dt(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:dt(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",dt(t,e))}(t,e),function(t,e){return{done:function(n){return st(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),ot(t,e,n,r,o,i)},next:function(){return it(t,e)},prev:function(){return ut(t,e)},replace:function(n,r,o){return ct(t,e,n,r,o)}}}(t,e)}))}()},8619:(t,e,n)=>{n(2590)},2590:()=>{!function(){"use strict";var t=function(){},e=function(t){return function(){return t}},n=function(t){return t};function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var o,i,u,a=function(t){return function(e){return!t(e)}},c=e(!1),s=e(!0),l=function(){return f},f=(o=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:u=function(t){return t},getOrThunk:i=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:e(null),getOrUndefined:e(void 0),or:u,orThunk:i,map:l,each:t,bind:l,exists:c,forall:s,filter:l,equals:o,equals_:o,toArray:function(){return[]},toString:e("none()")}),d=function(t){var n=e(t),r=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(e){return d(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=function(t){return function(e){return typeof e===t}},p=g("string"),v=g("object"),b=g("array"),y=h("boolean"),w=(void 0,function(t){return undefined===t}),x=function(t){return!function(t){return null==t}(t)},C=h("function"),S=h("number"),k=Array.prototype.slice,O=Array.prototype.indexOf,T=Array.prototype.push,_=function(t,e){return function(t,e){return O.call(t,e)}(t,e)>-1},E=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},N=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},R=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},M=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},z=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},D=function(t,e,n){return R(t,(function(t){n=e(n,t)})),n},B=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,e,c)},P=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return m.some(n);return m.none()},I=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!b(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);T.apply(e,t[n])}return e},L=function(t,e){return I(N(t,e))},H=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},F=function(t){return[t]},V=function(t,e){return e>=0&&e<t.length?m.some(t[e]):m.none()},j=function(t){return V(t,t.length-1)},U=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return m.none()},W=function(){return(W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function q(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var $=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},G=function(){return X(0,0)},X=function(t,e){return{major:t,minor:e}},K=function(t,e){var n=String(e).toLowerCase();return 0===t.length?G():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return X(r(1),r(2))}(t,n)},Y=G,J=function(t,e){var n=String(e).toLowerCase();return B(t,(function(t){return t.search(n)}))},Q=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Z=function(t,e){return-1!==t.indexOf(e)},tt=function(t,e){return Q(t,e,0)},et=function(t,e){return Q(t,e,t.length-e.length)},nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),rt=function(t){return t.length>0},ot=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,it=function(t){return function(e){return Z(e,t)}},ut=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Z(t,"edge/")&&Z(t,"chrome")&&Z(t,"safari")&&Z(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ot],search:function(t){return Z(t,"chrome")&&!Z(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Z(t,"msie")||Z(t,"trident")}},{name:"Opera",versionRegexes:[ot,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:it("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:it("firefox")},{name:"Safari",versionRegexes:[ot,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Z(t,"safari")||Z(t,"mobile/"))&&Z(t,"applewebkit")}}],at=[{name:"Windows",search:it("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Z(t,"iphone")||Z(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:it("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:it("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:it("linux"),versionRegexes:[]},{name:"Solaris",search:it("sunos"),versionRegexes:[]},{name:"FreeBSD",search:it("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:it("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ct={browsers:e(ut),oses:e(at)},st="Edge",lt="Chrome",ft="Opera",dt="Firefox",mt="Safari",gt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(st),isChrome:r(lt),isIE:r("IE"),isOpera:r(ft),isFirefox:r(dt),isSafari:r(mt)}},ht=function(){return gt({current:void 0,version:Y()})},pt=gt,vt=(e(st),e(lt),e("IE"),e(ft),e(dt),e(mt),"Windows"),bt="Android",yt="Linux",wt="Solaris",xt="FreeBSD",Ct="ChromeOS",St=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r("iOS"),isAndroid:r(bt),isOSX:r("OSX"),isLinux:r(yt),isSolaris:r(wt),isFreeBSD:r(xt),isChromeOS:r(Ct)}},kt=function(){return St({current:void 0,version:Y()})},Ot=St,Tt=(e(vt),e("iOS"),e(bt),e(yt),e("OSX"),e(wt),e(xt),e(Ct),function(t,n){var r=ct.browsers(),o=ct.oses(),i=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ht,pt),u=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kt,Ot),a=function(t,n,r,o){var i=t.isiOS()&&!0===/ipad/i.test(r),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),d=!l&&!s&&!f;return{isiPad:e(i),isiPhone:e(u),isTablet:e(s),isPhone:e(l),isTouch:e(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:e(f),isDesktop:e(d)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}}),_t=function(t){return window.matchMedia(t).matches},Et=$((function(){return Tt(navigator.userAgent,_t)})),At=function(){return Et()},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Nt(n)},fromDom:Nt,fromPoint:function(t,e,n){return m.from(t.dom.elementFromPoint(e,n)).map(Nt)}},Mt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Dt=function(t,e){return t.dom===e.dom},Bt=function(t,e){return At().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Pt=Mt,It=Object.keys,Lt=Object.hasOwnProperty,Ht=function(t,e){for(var n=It(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ft=function(t,e){return Vt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Vt=function(t,e){var n={};return Ht(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},jt=function(e,n){var r={};return function(t,e,n,r){Ht(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r},Ut=function(t,e){return Wt(t,e)?m.from(t[e]):m.none()},Wt=function(t,e){return Lt.call(t,e)},qt=["tfoot","thead","tbody","colgroup"],$t=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Gt=function(t,e,n){return{element:t,cells:e,section:n}},Xt=function(t,e){return{element:t,isNew:e}},Kt=function(t,e){return{cells:t,section:e}},Yt=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),Jt=function(t){return t.dom.nodeType},Qt=function(t){return function(e){return Jt(e)===t}},Zt=function(t){return 8===Jt(t)||"#comment"===Yt(t)},te=Qt(1),ee=Qt(3),ne=Qt(9),re=Qt(11),oe=function(t){return Rt.fromDom(t.dom.ownerDocument)},ie=function(t){return ne(t)?t:oe(t)},ue=function(t){return m.from(t.dom.parentNode).map(Rt.fromDom)},ae=function(t,e){for(var n=C(e)?e:c,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Rt.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ce=function(t){return m.from(t.dom.previousSibling).map(Rt.fromDom)},se=function(t){return m.from(t.dom.nextSibling).map(Rt.fromDom)},le=function(t){return N(t.dom.childNodes,Rt.fromDom)},fe=function(t,e){var n=t.dom.childNodes;return m.from(n[e]).map(Rt.fromDom)},de=C(Element.prototype.attachShadow)&&C(Node.prototype.getRootNode),me=e(de),ge=de?function(t){return Rt.fromDom(t.dom.getRootNode())}:ie,he=function(t){return Rt.fromDom(t.dom.host)},pe=function(t){return x(t.dom.shadowRoot)},ve=function(t){var e=ee(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=ge(t);return re(e)?m.some(e):m.none()}(Rt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=ve,r=he,function(t){return n(r(t))}))},be=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Rt.fromDom(e)},ye=function(t,e){var n=[];return R(le(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(ye(t,e))})),n},we=function(t,e,n){return function(t,n,r){return M(ae(t,r),(function(t){return Mt(t,e)}))}(t,0,n)},xe=function(t,e){return function(t,n){return M(le(t),(function(t){return Mt(t,e)}))}(t)},Ce=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:N(n.querySelectorAll(t),Rt.fromDom)}(e,t)};function Se(t,e,n,r,o){return t(n,r)?m.some(n):C(o)&&o(n)?m.none():e(n,r,o)}var ke=function(t,e,n){for(var r=t.dom,o=C(n)?n:c;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(e(i))return m.some(i);if(o(i))break}return m.none()},Oe=function(t,e,n){return ke(t,(function(t){return Mt(t,e)}),n)},Te=function(t,e){return function(t,n){return B(t.dom.childNodes,(function(t){return n=Rt.fromDom(t),Mt(n,e);var n})).map(Rt.fromDom)}(t)},_e=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?m.none():m.from(n.querySelector(t)).map(Rt.fromDom)}(e,t)},Ee=function(t,e,n){return Se((function(t,e){return Mt(t,e)}),Oe,t,e,n)},Ae=function(t,e,n){if(!(p(n)||y(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ne=function(t,e,n){Ae(t.dom,e,n)},Re=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ae(n,e,t)}))},Me=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},ze=function(t,e){return m.from(Me(t,e))},De=function(t,e){t.dom.removeAttribute(e)},Be=function(t){return D(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Pe=function(t){return void 0!==t.style&&C(t.style.getPropertyValue)},Ie=function(t,e,n){if(!p(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Pe(t)&&t.style.setProperty(e,n)},Le=function(t,e,n){var r=t.dom;Ie(r,e,n)},He=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ie(n,e,t)}))},Fe=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||ve(t)?r:Ve(n,e)},Ve=function(t,e){return Pe(t)?t.style.getPropertyValue(e):""},je=function(t,e){var n=t.dom,r=Ve(n,e);return m.from(r).filter((function(t){return t.length>0}))},Ue=function(t,e){!function(t,e){Pe(t)&&t.style.removeProperty(e)}(t.dom,e),ze(t,"style").map(nt).is("")&&De(t,"style")},We=function(t,e,n){return void 0===n&&(n=0),ze(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},qe=function(t,e){return We(t,e,1)},$e=function(t){return qe(t,"colspan")>1},Ge=function(t){return qe(t,"rowspan")>1},Xe=function(t,e){return parseInt(Fe(t,e),10)},Ke=e(10),Ye=e(10),Je=function(t,e){return Qe(t,e,s)},Qe=function(t,e,n){return L(le(t),(function(t){return Mt(t,e)?n(t)?[t]:[]:Qe(t,e,n)}))},Ze=function(t,e){return function(t,e,n){return void 0===n&&(n=c),n(e)?m.none():_(t,Yt(e))?m.some(e):Oe(e,t.join(","),(function(t){return Mt(t,"table")||n(t)}))}(["td","th"],t,e)},tn=function(t){return Je(t,"th,td")},en=function(t){return Mt(t,"colgroup")?xe(t,"col"):L(on(t),(function(t){return xe(t,"col")}))},nn=function(t,e){return Ee(t,"table",e)},rn=function(t){return Je(t,"tr")},on=function(t){return nn(t).fold(e([]),(function(t){return xe(t,"colgroup")}))},un=function(t,e){return N(t,(function(t){if("colgroup"===Yt(t)){var n=N(en(t),(function(t){var e=We(t,"span",1);return $t(t,1,e)}));return Gt(t,n,"colgroup")}return n=N(tn(t),(function(t){var e=We(t,"rowspan",1),n=We(t,"colspan",1);return $t(t,e,n)})),Gt(t,n,e(t))}))},an=function(t){return ue(t).map((function(t){var e=Yt(t);return function(t){return _(qt,t)}(e)?e:"tbody"})).getOr("tbody")},cn=function(t){var e=rn(t),n=q(on(t),e);return un(n,an)},sn=function(t,e){return t+","+e},ln=function(t,e){var n=L(t.all,(function(t){return t.cells}));return M(n,e)},fn=function(t){var e={},n=[],r={},o=0,i=0,u=0;return R(t,(function(t){if("colgroup"===t.section)r=function(t){var e={},n=0;return R(t.cells,(function(t){var r=t.colspan;A(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);else{var a=[];R(t.cells,(function(t){for(var n=0;void 0!==e[sn(u,n)];)n++;for(var r=(f=t.element,d=t.rowspan,m=t.colspan,{element:f,rowspan:d,colspan:m,row:u,column:n}),o=0;o<t.colspan;o++)for(var c=0;c<t.rowspan;c++){var s=n+o,l=sn(u+c,s);e[l]=r,i=Math.max(i,s+1)}var f,d,m;a.push(r)})),o++,n.push(Gt(t.element,a,t.section)),u++}})),{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:r}},dn=function(t){var e=cn(t);return fn(e)},mn=fn,gn=function(t,e,n){var r=t.access[sn(e,n)];return void 0!==r?m.some(r):m.none()},hn=function(t,e,n){var r=ln(t,(function(t){return n(e,t.element)}));return r.length>0?m.some(r[0]):m.none()},pn=ln,vn=function(t){return L(t.all,(function(t){return t.cells}))},bn=function(t){return function(t,e){var n=[];return Ht(t,(function(t,e){n.push(t)})),n}(t.columns)},yn=function(t){return It(t.columns).length>0},wn=function(t,e){return m.from(t.columns[e])},xn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Cn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Sn=function(t,e,n){var r=hn(t,e,Dt),o=hn(t,n,Dt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,{startRow:Math.min(n.row,r.row),startCol:Math.min(n.column,r.column),finishRow:Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),finishCol:Math.max(n.column+n.colspan-1,r.column+r.colspan-1)};var n,r}))}))},kn=function(t,e,n){return Sn(t,e,n).map((function(e){var n=pn(t,r(xn,e));return N(n,(function(t){return t.element}))}))},On=function(t,e){return hn(t,e,(function(t,e){return Bt(e,t)})).map((function(t){return t.element}))},Tn=function(t,e,n){var r=En(t);return kn(r,e,n)},_n=function(t,e,n,r,o){var i=En(t),u=Dt(t,n)?m.some(e):On(i,e),a=Dt(t,o)?m.some(r):On(i,r);return u.bind((function(t){return a.bind((function(e){return kn(i,t,e)}))}))},En=dn,An=function(t,e){ue(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Nn=function(t,e){se(t).fold((function(){ue(t).each((function(t){Mn(t,e)}))}),(function(t){An(t,e)}))},Rn=function(t,e){(function(t){return fe(t,0)})(t).fold((function(){Mn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Mn=function(t,e){t.dom.appendChild(e.dom)},zn=function(t,e){An(t,e),Mn(e,t)},Dn=function(t,e){R(e,(function(n,r){var o=0===r?t:e[r-1];Nn(o,n)}))},Bn=function(t,e){R(e,(function(e){Mn(t,e)}))},Pn=function(t){t.dom.textContent="",R(le(t),(function(t){In(t)}))},In=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ln=function(t){var e,n=le(t);n.length>0&&(e=t,R(n,(function(t){An(e,t)}))),In(t)},Hn=function(t,e){var n=function(e){return t(e)?m.from(e.dom.nodeValue):m.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(ee),Fn=function(t){return Hn.get(t)},Vn=function(t){return Hn.getOption(t)},jn=function(t,e){return Hn.set(t,e)},Un=["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"];function Wn(){return{up:e({selector:Oe,closest:Ee,predicate:ke,all:ae}),down:e({selector:Ce,predicate:ye}),styles:e({get:Fe,getRaw:je,set:Le,remove:Ue}),attrs:e({get:Me,set:Ne,remove:De,copyTo:function(t,e){var n=Be(t);Re(e,n)}}),insert:e({before:An,after:Nn,afterAll:Dn,append:Mn,appendAll:Bn,prepend:Rn,wrap:zn}),remove:e({unwrap:Ln,remove:In}),create:e({nu:Rt.fromTag,clone:function(t){return Rt.fromDom(t.dom.cloneNode(!1))},text:Rt.fromText}),query:e({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ce,nextSibling:se}),property:e({children:le,name:Yt,parent:ue,document:function(t){return ie(t).dom},isText:ee,isComment:Zt,isElement:te,getText:Fn,setText:jn,isBoundary:function(t){return!!te(t)&&("body"===Yt(t)||_(Un,Yt(t)))},isEmptyTag:function(t){return!!te(t)&&_(["br","img","hr","input"],Yt(t))},isNonEditable:function(t){return te(t)&&"false"===Me(t,"contenteditable")}}),eq:Dt,is:Pt}}var qn=function(t,e,n,r){var o=e(t,n);return z(r,(function(n,r){var o=e(t,r);return $n(t,n,o)}),o)},$n=function(t,e,n){return e.bind((function(e){return n.filter(r(t.eq,e))}))},Gn=Wn(),Xn=function(t,e){return function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,qn):m.none()}(Gn,(function(e,n){return t(n)}),e)},Kn=function(t){return Oe(t,"table")},Yn=function(t,e,n){var o=function(t){return function(e){return void 0!==n&&n(e)||Dt(e,t)}};return Dt(t,e)?m.some({boxes:m.some([t]),start:t,finish:e}):Kn(t).bind((function(i){return Kn(e).bind((function(u){if(Dt(i,u))return m.some({boxes:Tn(i,t,e),start:t,finish:e});if(Bt(i,u)){var a=(s=we(e,"td,th",o(i))).length>0?s[s.length-1]:e;return m.some({boxes:_n(i,t,i,e,u),start:t,finish:a})}if(Bt(u,i)){var s,l=(s=we(t,"td,th",o(u))).length>0?s[s.length-1]:t;return m.some({boxes:_n(u,t,i,e,u),start:t,finish:l})}return function(t,e,n){return function(t,e,n,o){void 0===o&&(o=c);var i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return P(t,o).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},s=a(i),l=a(u),f=B(s,(function(e){return E(l,function(t,e){return r(t.eq,e)}(t,e))}));return{firstpath:s,secondpath:l,shared:f}}(Gn,t,e,void 0)}(t,e).shared.bind((function(r){return Ee(r,"table",n).bind((function(n){var r=we(e,"td,th",o(n)),a=r.length>0?r[r.length-1]:e,c=we(t,"td,th",o(n)),s=c.length>0?c[c.length-1]:t;return m.some({boxes:_n(n,t,i,e,u),start:s,finish:a})}))}))}))}))},Jn=function(t,e){var n=Ce(t,e);return n.length>0?m.some(n):m.none()},Qn=function(t,e,n){return _e(t,e).bind((function(e){return _e(t,n).bind((function(t){return Xn(Kn,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Zn=function(t,e,n,r,o){return function(t,e){return B(t,(function(t){return Mt(t,e)}))}(t,o).bind((function(t){return function(t,e,n){return nn(t).bind((function(r){return function(t,e,n,r){return hn(t,e,Dt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return gn(t,o+n,i+r).map((function(t){return t.element}))}))}(En(r),t,e,n)}))}(t,e,n).bind((function(t){return function(t,e){return Oe(t,"table").bind((function(n){return _e(n,e).bind((function(e){return Yn(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},tr=function(t,e){return Jn(t,e)},er=function(t,e,n){return Qn(t,e,n).bind((function(e){var n=function(e){return Dt(t,e)},o="thead,tfoot,tbody,table",i=Oe(e.first,o,n),u=Oe(e.last,o,n);return i.bind((function(t){return u.bind((function(n){return Dt(t,n)?function(t,e,n){return function(t,e,n){return Sn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,o=r(Cn,e),i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)n=n&&gn(t,i,u).exists(o);return n?m.some(e):m.none()}(t,e)}))}(En(t),e,n)}(e.table,e.first,e.last):m.none()}))}))}))},nr=function(t){if(!b(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return R(t,(function(r,o){var i=It(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!b(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=It(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!H(e,(function(t){return _(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},rr=nr([{none:[]},{multiple:["elements"]},{single:["element"]}]),or=function(t,e,n,r){return t.fold(e,n,r)},ir=rr.none,ur=rr.multiple,ar=rr.single,cr=tinymce.util.Tools.resolve("tinymce.PluginManager"),sr=function(t,e,n){var r=t[n].element,o=Rt.fromTag("td");Mn(o,Rt.fromTag("br")),(e?Mn:Rn)(r,o)},lr=function(t,e){var n=function(t){return Mt(t.element,e)},r=cn(t),o=mn(r),i=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0;return Ht(t.access,(function(t){if(e(t)){var n=t.row,a=n+t.rowspan-1,c=t.column,s=c+t.colspan-1;n<r?r=n:a>i&&(i=a),c<o?o=c:s>u&&(u=s)}})),function(t,e,n,r){return{minRow:t,minCol:e,maxRow:n,maxCol:r}}(r,o,i,u)}(o,n),u="th:not("+e+"),td:not("+e+")",a=Qe(t,"th,td",(function(t){return Mt(t,u)}));return R(a,In),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol||(gn(e,u,c).filter(r).isNone()?sr(t,a,u):a=!0)}(r,o,i,n),function(t,e){var n=M(Je(t,"tr"),(function(t){return 0===t.dom.childElementCount}));R(n,In),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||R(Je(t,"th,td"),(function(t){De(t,"rowspan"),De(t,"colspan")})),De(t,"width"),De(t,"height"),Ue(t,"width"),Ue(t,"height")}(t,i),t},fr=function(t){return"img"===Yt(t)?1:Vn(t).fold((function(){return le(t).length}),(function(t){return t.length}))},dr=["img","br"],mr=function(t){return Vn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||_(dr,Yt(t))},gr=function(t){return e=mr,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Rt.fromDom(t.childNodes[r]);if(e(o))return m.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return m.none()})(t.dom);var e,n},hr=function(t){return pr(t,mr)},pr=function(t,e){var n=function(t){for(var r=le(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return m.some(i);var u=n(i);if(u.isSome())return u}return m.none()};return n(t)},vr=function(t,e){return Rt.fromDom(t.dom.cloneNode(e))},br=function(t){return vr(t,!1)},yr=function(t){return vr(t,!0)},wr={scope:["row","col"]},xr=function(){var t=Rt.fromTag("td");return Mn(t,Rt.fromTag("br")),t},Cr=function(){return Rt.fromTag("col")},Sr=function(){return Rt.fromTag("colgroup")},kr=function(t,e,n){var r=function(t,e){var n=function(t,e){var n=Rt.fromTag(e),r=Be(t);return Re(n,r),n}(t,e),r=le(yr(t));return Bn(n,r),n}(t,e);return Ht(n,(function(t,e){null===t?De(r,e):Ne(r,e,t)})),r},Or=function(t){return t},Tr=function(t){return function(){return Rt.fromTag("tr",t.dom)}},_r=function(t,e,n){var r=function(t,e){var n,r,o;n=e,r=t.element.dom,o=n.dom,Pe(r)&&Pe(o)&&(o.style.cssText=r.style.cssText),Ue(e,"height"),1!==t.colspan&&Ue(t.element,"width")};return{col:function(e){var n=oe(e.element),o=Rt.fromTag(Yt(e.element),n.dom);return r(e,o),t(e.element,o),o},colgroup:Sr,row:Tr(e),cell:function(e){var o=oe(e.element),i=Rt.fromTag(Yt(e.element),o.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?function(t,e,n){return gr(t).map((function(r){var o=n.join(","),i=we(r,o,(function(e){return Dt(e,t)}));return z(i,(function(t,e){var n=br(e);return De(n,"contenteditable"),Mn(t,n),n}),e)})).getOr(e)}(e.element,i,u):i;return Mn(a,Rt.fromTag("br")),r(e,i),function(t,e){Ht(wr,(function(n,r){return ze(t,r).filter((function(t){return _(n,t)})).each((function(t){return Ne(e,r,t)}))}))}(e.element,i),t(e.element,i),i},replace:kr,gap:xr}},Er=function(t){return{col:Cr,colgroup:Sr,row:Tr(t),cell:xr,replace:Or,gap:xr}},Ar=function(t){return N(t,Rt.fromDom)},Nr=function(t){return or(t.get(),e([]),n,F)},Rr=function(t){var e=function(t,e){return ze(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Nr(t);return n.length>0&&H(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?m.some(n):m.none()},Mr=function(t,e,n){return or(e.get(),m.none,(function(e){return e.length<=1?m.none():er(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),m.none)},zr={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Dr=function(t){return{element:t,mergable:m.none(),unmergable:m.none(),selection:[t]}},Br=function(t,e,n){return{element:n,mergable:Mr(e,t,zr),unmergable:Rr(t),selection:Nr(t)}},Pr=nr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ir=W({},Pr),Lr=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e};function Hr(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Fe(n,t);return parseFloat(o)||0}return r},r=function(t,e){return D(e,(function(e,n){var r=Fe(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!S(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Pe(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var Fr,Vr,jr,Ur=Hr("width",(function(t){return t.dom.offsetWidth})),Wr=function(t){return Ur.get(t)},qr=function(t){return Ur.getOuter(t)},$r=function(t){var e=t.grid,r=A(e.columns,n),o=A(e.rows,n);return N(r,(function(e){return Gr((function(){return L(o,(function(n){return gn(t,n,e).filter((function(t){return t.column===e})).toArray()}))}),(function(t){return 1===t.colspan}),(function(){return gn(t,0,e)}))}))},Gr=function(t,e,n){var r=t();return B(r,e).orThunk((function(){return m.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Xr=function(t){var r=t.grid,o=A(r.rows,n),i=A(r.columns,n);return N(o,(function(n){return Gr((function(){return L(i,(function(r){return gn(t,n,r).filter((function(t){return t.row===n})).fold(e([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return gn(t,n,0)}))}))},Kr=function(t,e){return function(n){return"rtl"===Yr(n)?e:t}},Yr=function(t){return"rtl"===Fe(t,"direction")?"rtl":"ltr"},Jr=Hr("height",(function(t){var e=t.dom;return ve(t)?e.getBoundingClientRect().height:e.offsetHeight})),Qr=function(t){return Jr.get(t)},Zr=function(t){return Jr.getOuter(t)},to=function(t,e){return{left:t,top:e,translate:function(n,r){return to(t+n,e+r)}}},eo=to,no=function(t,e){return void 0!==t?t:void 0!==e?e:0},ro=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return eo(n.offsetLeft,n.offsetTop);var i=no(null==r?void 0:r.pageYOffset,o.scrollTop),u=no(null==r?void 0:r.pageXOffset,o.scrollLeft),a=no(o.clientTop,n.clientTop),c=no(o.clientLeft,n.clientLeft);return oo(t).translate(u-c,i-a)},oo=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?eo(n.offsetLeft,n.offsetTop):ve(t)?function(t){var e=t.getBoundingClientRect();return eo(e.left,e.top)}(e):eo(0,0)},io=function(t,e){return{row:t,y:e}},uo=function(t,e){return{col:t,x:e}},ao=function(t){return ro(t).left+qr(t)},co=function(t){return ro(t).left},so=function(t,e){return uo(t,co(e))},lo=function(t,e){return uo(t,ao(e))},fo=function(t){return ro(t).top},mo=function(t,e){return io(t,fo(e))},go=function(t,e){return io(t,fo(e)+Zr(e))},ho=function(t,e,n){if(0===n.length)return[];var r=N(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},po={delta:n,positions:function(t){return ho(mo,go,t)},edge:fo},vo=Kr({delta:n,edge:co,positions:function(t){return ho(so,lo,t)}},{delta:function(t){return-t},edge:ao,positions:function(t){return ho(lo,so,t)}}),bo={delta:function(t,e){return vo(e).delta(t,e)},positions:function(t,e){return vo(e).positions(t,e)},edge:function(t){return vo(t).edge(t)}},yo={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:[""]},wo=(Fr="[eE][+-]?[0-9]+",jr=["Infinity","[0-9]+\\."+(Vr=function(t){return"(?:"+t+")?"})("[0-9]+")+Vr(Fr),"\\.[0-9]+"+Vr(Fr),"[0-9]+"+Vr(Fr)].join("|"),new RegExp("^([+-]?(?:"+jr+"))(.*)$")),xo=function(){var t=At().browser;return t.isIE()||t.isEdge()},Co=function(t,e,n){return function(t,e){var n=parseFloat(t);return isNaN(n)?e:n}(Fe(t,e),n)},So=function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().width;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-left",0)-Co(t,"padding-right",0)-(Co(t,"border-left-width",0)+Co(t,"border-right-width",0))}(t):Co(t,"width",Wr(t))},ko=/(\d+(\.\d+)?)%/,Oo=/(\d+(\.\d+)?)px|em/,To=function(t,e){Le(t,"width",e+"px")},_o=function(t,e){Le(t,"width",e+"%")},Eo=function(t,e){Le(t,"height",e+"px")},Ao=function(t){var e=function(t){return je(t,"height").getOrThunk((function(){return function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().height;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-top",0)-Co(t,"padding-bottom",0)-(Co(t,"border-top-width",0)+Co(t,"border-bottom-width",0))}(t):Co(t,"height",Qr(t))}(t)+"px"}))}(t);return e?function(t,e,n,r){var o=parseInt(t,10);return et(t,"%")&&"table"!==Yt(e)?function(t,e,n,r){var o=nn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o}(e,t,Qr,Eo):Qr(t)},No=function(t){return je(t,"width").fold((function(){return m.from(Me(t,"width"))}),(function(t){return m.some(t)}))},Ro=function(t,e){return t/e.pixelWidth()*100},Mo=function(t,e){return No(t).fold((function(){var n=Wr(t);return Ro(n,e)}),(function(n){return function(t,e,n){var r=ko.exec(e);if(null!==r)return parseFloat(r[1]);var o=So(t);return Ro(o,n)}(t,n,e)}))},zo=function(t,e){return No(t).fold((function(){return So(t)}),(function(n){return function(t,e,n){var r=Oo.exec(e);if(null!==r)return parseInt(r[1],10);var o=ko.exec(e);return null!==o?function(t,e){return t/100*e.pixelWidth()}(parseFloat(o[1]),n):So(t)}(t,n,e)}))},Do=function(t){return function(t,e,n){return n(t)/qe(t,"rowspan")}(t,0,Ao)},Bo=function(t,e,n){Le(t,"width",e+n)},Po=function(t){return n=Wr,o=(r=e=t,m.from(r.dom.offsetParent).map(Rt.fromDom)).getOr(be(oe(e))),n(e)/n(o)*100+"%";var e,n,r,o},Io=e(ko),Lo=e(Oo),Ho=("col",function(t){return te(t)&&"col"===Yt(t)}),Fo=function(t,e,n){return je(t,e).fold((function(){return n(t)+"px"}),(function(t){return t}))},Vo=function(t,e){return Fo(t,"width",(function(t){return Ho(t)?Wr(t):zo(t,e)}))},jo=function(t){return Fo(t,"height",Do)},Uo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(function(t,e){if(e<0||e>=t.length-1)return m.none();var n=t[e].fold((function(){var n=function(t){var e=k.call(t,0);return e.reverse(),e}(t.slice(0,e));return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))}(n,e))}),(function(t){return o(t)}))},Wo=function(t,e,r,o,i){var u=$r(t),c=yn(t)?function(t){return N(bn(t),(function(t){return m.from(t.element)}))}(t):u,s=[m.some(bo.edge(e))].concat(N(bo.positions(u,e),(function(t){return t.map((function(t){return t.x}))}))),l=a($e);return N(c,(function(t,e){return Uo(t,e,s,l,(function(t){if(function(t){return!Ho(t)||je(t,"width").isSome()}(t))return r(t,i);var a,c=null!=(a=u[e])?n(a):m.none();return Uo(c,e,s,l,(function(t){return o(m.some(Wr(t)))}),o)}),o)}))},qo=function(t){return t.map((function(t){return t+"px"})).getOr("")},$o=function(t,e,n){return Wo(t,e,zo,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Go=function(t,e,n,r,o){var i=Xr(t),u=[m.some(n.edge(e))].concat(N(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return N(i,(function(t,e){return Uo(t,e,u,a(Ge),r,o)}))},Xo=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ko=function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Yo=function(t,e,n){var r=function(t,e){return yn(t)?function(t,e){var n=bn(t);return N(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)}(t,e);R(r,(function(t){n.setElementWidth(t.element,t.width)}))},Jo=function(t,n,r,o,i){var u=dn(t),a=i.getCellDelta(n),c=i.getWidths(u,i),s=r===u.grid.columns-1,l=o.clampTableDelta(c,r,a,i.minCellWidth(),s),f=function(t,n,r,o,i){var u=t.slice(0),a=function(t,e){return 0===t.length?Ir.none():1===t.length?Ir.only(0):0===e?Ir.left(0,1):e===t.length-1?Ir.right(e-1,e):e>0&&e<t.length-1?Ir.middle(e-1,e,e+1):Ir.none()}(t,n),c=e(N(u,e(0)));return a.fold(c,(function(t){return o.singleColumnWidth(u[t],r)}),(function(t,e){return i.calcLeftEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}),(function(t,e,n){return i.calcMiddleDeltas(u,t,e,n,r,o.minCellWidth(),o.isRelative)}),(function(t,e){return i.calcRightEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}))}(c,r,l,i,o),d=N(f,(function(t,e){return t+c[e]}));Yo(u,d,i),o.resizeTable(i.adjustTableWidth,l,s)},Qo=function(t){return N(t,e(0))},Zo=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},ti=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},ei=ti((function(t){return t<0})),ni=ti(s),ri=function(t,n){var r=m.from(t.dom.documentElement).map(Rt.fromDom).getOr(t);return{parent:e(r),view:e(t),origin:e(eo(0,0)),isResizable:n}},oi=nr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),ii=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):oi.invalid(n)},ui=W(W({},oi),{from:function(t){return et(t,"%")?ii("%",oi.percent,t):et(t,"px")?ii("px",oi.pixels,t):oi.invalid(t)}}),ai=function(t,n,r){var o=ui.from(r),i=H(t,(function(t){return"0px"===t}))?function(t,n){var r=t.fold((function(){return e("")}),(function(t){return e(t/n+"px")}),(function(){return e(100/n+"%")}));return A(n,r)}(o,t.length):function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))}(o,t,n);return li(i)},ci=function(t,r){return 0===t.length?r:z(t,(function(t,r){return ui.from(r).fold(e(0),n,n)+t}),0)},si=function(t,n){return ui.from(t).fold(e(t),(function(t){return t+n+"px"}),(function(t){return t+n+"%"}))},li=function(t){if(0===t.length)return t;var e=z(t,(function(t,e){var n=ui.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+"px",remainder:t-n}}(t)}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([si(n[n.length-1],Math.round(e.remainder))])},fi=ui.from,di=function(t){return fi(t).fold(e("px"),e("px"),e("%"))},mi=function(t,e,n,r){var o=dn(t),i=o.all,u=vn(o),a=bn(o);e.each((function(e){var n=di(e),i=Wr(t),c=function(t,e,n){return Wo(t,e,Vo,qo,n)}(o,t,r),s=ai(c,i,e);yn(o)?function(t,e,n){R(e,(function(e,r){var o=ci([t[r]],Ke());Le(e.element,"width",o+n)}))}(s,a,n):function(t,e,n){R(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=ci(r,Ke());Le(e.element,"width",o+n)}))}(s,u,n),Le(t,"width",e)})),n.each((function(e){var n=di(e),r=Qr(t),a=function(t,e,n){return Go(t,e,n,jo,qo)}(o,t,po);!function(t,e,n,r){R(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=ci(n,Ye());Le(e.element,"height",o+r)})),R(e,(function(e,n){Le(e.element,"height",t[n])}))}(ai(a,r,e),i,u,n),Le(t,"height",e)}))},gi=function(t){return No(t).exists((function(t){return ko.test(t)}))},hi=function(t){return No(t).exists((function(t){return Oo.test(t)}))},pi=function(t){return No(t).isNone()},vi=Po,bi=function(t){return dn(t).grid},yi=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=M(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};R(t,(function(t,e){o[t]=n[e]})),R(e,(function(t){t(o)}))}}},wi=function(t){return{registry:Ft(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Ft(t,(function(t){return t.trigger}))}},xi=function(t){return t.slice(0).sort()},Ci=function(t,e){var n=M(e,(function(e){return!_(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+xi(t).join(", "))}(n)},Si=function(t){return function(t,e){return function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var r;return function(t,e){if(!b(e))throw new Error("The required fields must be an array. Was: "+e+".");R(e,(function(e){if(!p(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),r=xi(e),B(r,(function(t,e){return e<r.length-1&&t===r[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+r.join(", ")+"].")})),function(r){var o=It(r);H(e,(function(t){return _(o,t)}))||function(t,e){throw new Error("All required keys ("+xi(t).join(", ")+") were not specified. Specified keys were: "+xi(e).join(", ")+".")}(e,o),t(e,o);var i=M(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+xi(t).join(", ")+") were not.")}(i,n.label),r}}(t,e,{validate:C,label:"function"})}(Ci,t)},ki=Si(["compare","extract","mutate","sink"]),Oi=Si(["element","start","stop","destroy"]),Ti=Si(["forceDrop","drop","move","delayDrop"]);function _i(){var e,n,r={onEvent:t,reset:t},o=(e=m.none(),{onEvent:function(t,r){r.extract(t).each((function(t){(function(t,n){var r=e.map((function(e){return t.compare(e,n)}));return e=m.some(n),r})(r,t).each((function(t){n.trigger.move(t)}))}))},reset:function(){e=m.none()},events:(n=wi({move:yi(["info"])})).registry}),i=r;return{on:function(){i.reset(),i=o},off:function(){i.reset(),i=r},isOn:function(){return i===o},onEvent:function(t,e){i.onEvent(t,e)},events:o.events}}var Ei=function(t){var e,n,r=Rt.fromDom(function(t){if(me()&&x(t.target)){var e=Rt.fromDom(t.target);if(te(e)&&pe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return V(n,0)}}return m.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Ai=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ni=s,Ri=function(t,e,n){return function(t,e,n,o){return function(t,e,n,o,i){var u=function(t,e){return function(n){t(n)&&e(Ei(n))}}(n,o);return t.dom.addEventListener(e,u,i),{unbind:r(Ai,t,e,u,i)}}(t,e,n,o,!1)}(t,e,Ni,n)},Mi=Ei,zi=function(t){return void 0!==t.dom.classList},Di=function(t,e){return function(t,e,n){var r=function(t,e){var n=Me(t,e);return void 0===n||""===n?[]:n.split(" ")}(t,e).concat([n]);return Ne(t,e,r.join(" ")),!0}(t,"class",e)},Bi=function(t,e){zi(t)?t.dom.classList.add(e):Di(t,e)},Pi=function(t,e){return zi(t)&&t.dom.classList.contains(e)},Ii=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Li=Ii("ephox-dragster"),Hi=Li.resolve,Fi=ki({compare:function(t,e){return eo(e.left-t.left,e.top-t.top)},extract:function(t){return m.some(eo(t.x,t.y))},sink:function(t,e){var n=function(t){var e=W({layerClass:Hi("blocker")},t),n=Rt.fromTag("div");return Ne(n,"role","presentation"),He(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Bi(n,Hi("blocker")),Bi(n,e.layerClass),{element:function(){return n},destroy:function(){In(n)}}}(e),r=Ri(n.element(),"mousedown",t.forceDrop),o=Ri(n.element(),"mouseup",t.drop),i=Ri(n.element(),"mousemove",t.move),u=Ri(n.element(),"mouseout",t.delayDrop);return Oi({element:n.element,start:function(t){Mn(t,n.element())},stop:function(){In(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Vi=function(t){return"true"===Me(t,"contenteditable")},ji=Ii("ephox-snooker"),Ui=ji.resolve,Wi=Ui("resizer-bar"),qi=Ui("resizer-rows"),$i=Ui("resizer-cols"),Gi=function(t){var e=Ce(t.parent(),"."+Wi);R(e,In)},Xi=function(t,e,n){var r=t.origin();R(e,(function(e){e.each((function(e){var o=n(r,e);Bi(o,Wi),Mn(t.parent(),o)}))}))},Ki=function(t,e,n,r,o){var i=ro(n),u=e.isResizable,a=r.length>0?po.positions(r,n):[],c=a.length>0?function(t,e){return L(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Rt.fromTag("div");return He(i,{position:"absolute",left:e+"px",top:n-3.5+"px",height:"7px",width:r+"px"}),Re(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r);return Bi(o,qi),o}))}(e,M(a,(function(t,e){return E(c,(function(t){return e===t}))})),i,qr(n));var s=o.length>0?bo.positions(o,n):[],l=s.length>0?function(t,e){var n=[];return A(t.grid.columns,(function(r){wn(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),M(n,(function(n){var r=pn(t,(function(t){return t.column===n}));return H(r,(function(t){return e(t.element)}))}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o,i,u,a,c,s=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=r,c=Rt.fromTag("div"),He(c,{position:"absolute",left:i-3.5+"px",top:u+"px",height:a+"px",width:"7px"}),Re(c,{"data-column":o,role:"presentation"}),c);return Bi(s,$i),s}))}(e,M(s,(function(t,e){return E(l,(function(t){return e===t}))})),i,Zr(n))},Yi=function(t,e){if(Gi(t),t.isResizable(e)){var n=dn(e),r=Xr(n),o=$r(n);Ki(n,t,e,r,o)}},Ji=function(t,e){var n=Ce(t.parent(),"."+Wi);R(n,e)},Qi=function(t){Ji(t,(function(t){Le(t,"display","none")}))},Zi=function(t){Ji(t,(function(t){Le(t,"display","block")}))},tu=Ui("resizer-bar-dragging"),eu=function(t){var e=function(){var t=wi({drag:yi(["xDelta","yDelta","target"])}),e=m.none(),n=function(){var t=wi({drag:yi(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();return n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))})),{assign:function(t){e=m.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}}(),n=function(t,e){return void 0===e&&(e={}),function(t,e,n){var r,o,i=!1,u=wi({start:yi([]),stop:yi([])}),a=_i(),c=function(){f.stop(),a.isOn()&&(a.off(),u.trigger.stop())},s=(r=c,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout((function(){r.apply(null,t),o=null}),200)}});a.events.move.bind((function(n){e.mutate(t,n.info)}));var l=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i&&t.apply(null,e)}},f=e.sink(Ti({forceDrop:c,drop:l(c),move:l((function(t){s.cancel(),a.onEvent(t,e)})),delayDrop:l(s.throttle)}),n);return{element:f.element,go:function(t){f.start(t),a.on(),u.trigger.start()},on:function(){i=!0},off:function(){i=!1},destroy:function(){f.destroy()},events:u.registry}}(t,void 0!==e.mode?e.mode:Fi,e)}(e,{}),o=m.none(),i=function(t,e){return m.from(Me(t,e))};e.events.drag.bind((function(t){i(t.target,"data-row").each((function(e){var n=Xe(t.target,"top");Le(t.target,"top",n+t.yDelta+"px")})),i(t.target,"data-column").each((function(e){var n=Xe(t.target,"left");Le(t.target,"left",n+t.xDelta+"px")}))}));var u=function(t,e){return Xe(t,e)-We(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){o.each((function(n){i(e,"data-row").each((function(t){var r=u(e,"top");De(e,"data-initial-top"),f.trigger.adjustHeight(n,r,parseInt(t,10))})),i(e,"data-column").each((function(t){var r=u(e,"left");De(e,"data-initial-left"),f.trigger.adjustWidth(n,r,parseInt(t,10))})),Yi(t,n)}))}))}));var a=function(r,o){f.trigger.startAdjust(),e.assign(r),Ne(r,"data-initial-"+o,Xe(r,o)),Bi(r,tu),Le(r,"opacity","0.2"),n.go(t.parent())},c=Ri(t.parent(),"mousedown",(function(t){var e;e=t.target,Pi(e,qi)&&a(t.target,"top"),function(t){return Pi(t,$i)}(t.target)&&a(t.target,"left")})),s=function(e){return Dt(e,t.view())},l=Ri(t.view(),"mouseover",(function(e){var n;(n=e.target,Ee(n,"table",s).filter((function(t){return function(t,e){return Ee(t,"[contenteditable]",e)}(t,s).exists(Vi)}))).fold((function(){ve(e.target)&&Gi(t)}),(function(e){o=m.some(e),Yi(t,e)}))})),f=wi({adjustHeight:yi(["table","delta","row"]),adjustWidth:yi(["table","delta","column"]),startAdjust:yi([])});return{destroy:function(){c.unbind(),l.unbind(),n.destroy(),Gi(t)},refresh:function(e){Yi(t,e)},on:n.on,off:n.off,hideBars:r(Qi,t),showBars:r(Zi,t),events:f.registry}},nu=function(t,e,n){var r=po,o=bo,i=eu(t),u=wi({beforeResize:yi(["table","type"]),afterResize:yi(["table","type"]),startDrag:yi([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row"),function(t,e,n,r){var o=dn(t),i=function(t,e,n){return Go(t,e,n,Do,(function(t){return t.getOrThunk(Ye)}))}(o,t,r),u=N(i,(function(t,r){return n===r?Math.max(e+t,Ye()):t})),a=Ko(o,u),c=function(t,e){return N(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);R(c,(function(t){Eo(t.element,t.height)})),R(a,(function(t){Eo(t.element,t.height)}));var s=z(u,(function(t,e){return t+e}),0);Eo(t,s)}(e,r.delta(t.delta,e),t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Jo(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},ru=function(t,e){return t.fire("newrow",{node:e})},ou=function(t,e){return t.fire("newcell",{node:e})},iu=function(t,e,n){t.fire("TableModified",W(W({},n),{table:e}))},uu={"border-collapse":"collapse",width:"100%"},au={border:"1"},cu="preservetable",su=function(t){return t.getParam("table_sizing_mode","auto")},lu=function(t){return t.getParam("table_responsive_width")},fu=function(t){return t.getParam("table_default_attributes",au,"object")},du=function(t){return t.getParam("table_default_styles",function(t){if(bu(t)){var e=t.getBody().offsetWidth;return W(W({},uu),{width:e+"px"})}return yu(t)?jt(uu,(function(t,e){return"width"!==e})):uu}(t),"object")},mu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},gu=function(t){return t.getParam("table_row_advtab",!0,"boolean")},hu=function(t){return t.getParam("table_advtab",!0,"boolean")},pu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},vu=function(t){return"relative"===su(t)||!0===lu(t)},bu=function(t){return"fixed"===su(t)||!1===lu(t)},yu=function(t){return"responsive"===su(t)},wu=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},xu=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return _(["section","cells","sectionCells","auto"],n)?n:e},Cu=function(t){var e=t.getParam("table_column_resizing",cu,"string");return B(["preservetable","resizetable"],(function(t){return t===e})).getOr(cu)},Su=function(t){return"preservetable"===Cu(t)},ku=function(t){var e=t.getParam("table_clone_elements");return p(e)?m.some(e.split(/[ ,]/)):Array.isArray(e)?m.some(e):m.none()},Ou=function(t){return t.nodeName.toLowerCase()},Tu=function(t){return Rt.fromDom(t.getBody())},_u=function(t){return t.getBoundingClientRect().width},Eu=function(t){return t.getBoundingClientRect().height},Au=function(t){return function(e){return Dt(e,Tu(t))}},Nu=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Ru=function(t){De(t,"data-mce-style");var e=function(t){return De(t,"data-mce-style")};R(tn(t),e),R(en(t),e)},Mu=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return m.from(n).filter(rt)},zu=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},Du=function(t){return Rt.fromDom(t.selection.getStart())},Bu=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Pu=function(t,e){var n=Bu(parseFloat(t)),r=Bu(Wr(e));return{width:n.get,pixelWidth:r.get,getWidths:function(t,n){return function(t,e,n){return Wo(t,e,Mo,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)}(t,e,n)},getCellDelta:function(t){return t/r.get()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Ke()/r.get()*100},setElementWidth:_o,adjustTableWidth:function(t){var o=n.get(),i=o+t/100*o;_o(e,i),n.set(i),r.set(Wr(e))},isRelative:!0,label:"percent"}},Iu=function(t,e){var r=Bu(t),o=r.get;return{width:o,pixelWidth:o,getWidths:function(t,n){return $o(t,e,n)},getCellDelta:n,singleColumnWidth:function(t,e){return[Math.max(Ke(),t+e)-t]},minCellWidth:Ke,setElementWidth:To,adjustTableWidth:function(t){var n=o()+t;To(e,n),r.set(n)},isRelative:!1,label:"pixel"}},Lu=function(n){return No(n).fold((function(){return function(n){var r=function(){return Wr(n)},o=e(0);return{width:r,pixelWidth:r,getWidths:function(t,e){return $o(t,n,e)},getCellDelta:o,singleColumnWidth:e([0]),minCellWidth:o,setElementWidth:t,adjustTableWidth:t,isRelative:!0,label:"none"}}(n)}),(function(t){return function(t,e){var n=Io().exec(e);if(null!==n)return Pu(n[1],t);var r=Lo().exec(e);if(null!==r){var o=parseInt(r[1],10);return Iu(o,t)}var i=Wr(t);return Iu(i,t)}(n,t)}))},Hu=Iu,Fu=Pu,Vu=function(t,e){if(vu(t)){var n=Mu(t,e.dom).filter(zu).getOrThunk((function(){return vi(e)}));return Fu(n,e)}return bu(t)?Hu(Wr(e),e):Lu(e)},ju=function(t){De(t,"width")},Uu=function(t,e){!function(t,e){var n=Po(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},Wu=function(t,e){!function(t,e){var n=function(t){return Wr(t)+"px"}(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},qu=function(t){Ue(t,"width");var e=en(t),n=e.length>0?e:tn(t);R(n,(function(t){Ue(t,"width"),ju(t)})),ju(t)},$u="bar-",Gu=function(t){return"false"!==Me(t,"data-mce-resize")},Xu=function(t){var n,r,o=m.none(),i=m.none(),u=m.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Vu(t,e)},l=function(){return Su(t)?{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=D(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ei(t,e,n,r)},calcLeftEdgeDeltas:n=function(t,e,n,r,o){var i=ni(t,r>=0?n:e,r,o);return Zo(t,e,n+1,[i,-i],Qo)},calcMiddleDeltas:function(t,e,r,o,i,u){return n(t,r,o,i,u)},calcRightEdgeDeltas:function(t,n,r,o,i,u){if(u)return Qo(t);var a=o/t.length;return N(t,e(a))}}:function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return N(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=ei(t,e,r,o);return Zo(t,e,n+1,[i,0],Qo)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ei,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=ei(e,r,o,i);return Qo(e.slice(0,r)).concat([a])}}}();var n};return t.on("init",(function(){var n=function(t,n){return t.inline?function(t,n,r){return{parent:e(n),view:e(t),origin:e(eo(0,0)),isResizable:r}}(Tu(t),(r=Rt.fromTag("div"),He(r,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Mn(be(Rt.fromDom(document)),r),r),n):ri(Rt.fromDom(t.getDoc()),n);var r}(t,Gu);if(u=m.some(n),function(t){var e=t.getParam("object_resizing",!0);return p(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var r=l(),a=nu(n,r,s);a.on(),a.events.startDrag.bind((function(e){o=m.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,_u(n),Eu(n),$u+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Ru(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,_u(r),Eu(r),$u+e.type),t.undoManager.add()})),i=m.some(a)}})),t.on("ObjectResizeStart",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o);R(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Cu(t)+"-columns")})),!hi(i)&&bu(t)?Wu(t,i):!gi(i)&&vu(t)&&Uu(t,i),pi(i)&&tt(e.origin,$u)&&Uu(t,i),n=e.width,r=yu(t)?"":Mu(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o),u=e.origin;tt(u,"corner-")&&function(e,o,i){var u=et(o,"e");if(""===r&&Uu(t,e),i!==n&&""!==r){Le(e,"width",r);var a=l(),c=s(e),f=Su(t)||u?function(t){return bi(t).columns}(e)-1:0;Jo(e,i-n,f,a,c)}else if(zu(r)){var d=parseFloat(r.replace("%",""));Le(e,"width",i*d/n+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(r)&&function(t){var e=dn(t);yn(e)||R(tn(t),(function(t){var e=Fe(t,"width");Le(t,"width",e),De(t,"width")}))}(e)}(i,u,e.width),Ru(i),iu(t,i.dom)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr(ri(Rt.fromDom(t.getBody()),Gu))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&In(e.parent())}(t,e)}))}}},Ku=function(t,e){return{element:t,offset:e}},Yu=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return Yu(t,e,n).orThunk((function(){return m.some(e)}))})):m.none()},Ju=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},Qu=function(t,e){var n=Yu(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return Ku(n,Ju(t,n));var r=t.property().children(n);return r.length>0?Qu(t,r[r.length-1]):Ku(n,Ju(t,n))},Zu=Qu,ta=Wn(),ea=function(t,e){(function(t){return No(t).bind((function(t){return e=t,n=["fixed","relative","empty"],m.from(wo.exec(e)).bind((function(t){var e=Number(t[1]),r=t[2];return function(t,e){return E(e,(function(e){return E(yo[e],(function(e){return t===e}))}))}(r,n)?m.some({value:e,unit:r}):m.none()}));var e,n}))})(t).each((function(n){var r=n.value/2;Bo(t,r,n.unit),Bo(e,r,n.unit)}))},na=function(t,e,n){t.cells[e]=n},ra=function(t,e){return Kt(e,t.section)},oa=function(t,e){var n=t.cells,r=N(n,e);return Kt(r,t.section)},ia=function(t,e){return t.cells[e]},ua=function(t,e){return ia(t,e).element},aa=function(t){return t.cells.length},ca=function(t){var e=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(a=u,"colgroup"===a.section?n:r).push(u)}var a;return{pass:n,fail:r}}(t);return{rows:e.fail,cols:e.pass}},sa=function(t,e,n,r){n===r?De(t,e):Ne(t,e,n)},la=function(t,e,n){j(xe(t,e)).fold((function(){return Rn(t,n)}),(function(t){return Nn(t,n)}))},fa=function(t,e){var n=[],r=[],o=function(t){return N(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return Pn(e),R(t.cells,(function(t){t.isNew&&r.push(t.element),sa(t.element,"colspan",t.colspan,1),sa(t.element,"rowspan",t.rowspan,1),Mn(e,t.element)})),e}))},i=function(t){return L(t,(function(t){return N(t.cells,(function(t){return sa(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Te(t,e).getOrThunk((function(){var n=Rt.fromTag(e,oe(t).dom);return"thead"===e?la(t,"caption,colgroup",n):"colgroup"===e?la(t,"caption",n):Mn(t,n),n}));return Pn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Bn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Te(t,e).each(In)}(n)},c=[],s=[],l=[],f=[];return R(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},da=function(t,e){if(0===t.length)return 0;var n=t[0];return P(t,(function(t){return!e(n.element,t.element)})).fold((function(){return t.length}),(function(t){return t}))},ma=function(t,e){var n=N(t,(function(t){return N(t.cells,c)}));return N(t,(function(r,o){return i=L(r.cells,(function(r,i){if(!1===n[o][i]){var u=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e).cells.slice(n),i=da(o,r),u=function(t,e){return N(t,(function(t){return ia(t,e)}))}(t,n).slice(e);return{colspan:i,rowspan:da(u,r)}}(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l})),u=r.section,{details:i,section:u};var i,u}))},ga=function(t,e,n){var r=[];if(yn(t)){var o=N(bn(t),(function(t){return Xt(t.element,n)}));r.push(Kt(o,"colgroup"))}for(var i=0;i<t.grid.rows;i++){for(var u=[],a=0;a<t.grid.columns;a++){var c=gn(t,i,a).map((function(t){return Xt(t.element,n)})).getOrThunk((function(){return Xt(e.gap(),!0)}));u.push(c)}var s=Kt(u,t.all[i].section);r.push(s)}return r},ha=function(t,e){return function(t,e){return N(t,(function(t){var n=function(t){return U(t,(function(t){return ue(t.element).map((function(t){var e=ue(t).isNone();return Xt(t,e)}))})).getOrThunk((function(){return Xt(e.row(),!0)}))}(t.details);return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(n.element,t.details,t.section,n.isNew)}))}(ma(t,Dt),e)},pa=function(t,e){return U(t.all,(function(t){return B(t.cells,(function(t){return Dt(e,t.element)}))}))},va=function(t,e,n,r,o){return function(i,u,a,c,s){var l=dn(u);return e(l,a).map((function(e){var n=function(t,e){return ga(t,e,!1)}(l,c),r=t(n,e,Dt,o(c));return{grid:ha(r.grid,c),cursor:r.cursor}})).fold((function(){return m.none()}),(function(t){var e=fa(u,t.grid),o=m.from(s).getOrThunk((function(){return Lu(u)}));return n(u,t.grid,o),r(u),Yi(i,u),m.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},ba=function(t,e){return Ze(e.element).bind((function(e){return pa(t,e)}))},ya=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some({cells:r,generators:e.generators,clipboard:e.clipboard}):m.none()},wa=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some(r):m.none()},xa=function(t,e,n,r){for(var o=ca(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<aa(o[0]);a++){var c=n(ua(o[u],a),e);!0===c&&!1===i?na(o[u],a,Xt(r(),!0)):!0===c&&(i=!1)}return t},Ca=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:e(t),getOrThunk:e(t),getOrDie:e(t),or:function(e){return Ca(t)},orThunk:function(e){return Ca(t)},fold:function(e,n){return n(t)},map:function(e){return Ca(e(t))},mapError:function(e){return Ca(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},Sa=function(e){return{is:c,isValue:c,isError:s,getOr:n,getOrThunk:function(t){return t()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return Sa(e)},mapError:function(t){return Sa(t(e))},each:t,bind:function(t){return Sa(e)},exists:c,forall:s,toOptional:m.none}},ka={value:Ca,error:Sa,fromOption:function(t,e){return t.fold((function(){return Sa(e)}),Ca)}},Oa=function(t,e){return{rowDelta:0,colDelta:aa(t[0])-aa(e[0])}},Ta=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},_a=function(t,e,n){var r="colgroup"===e.section?n.col:n.cell;return N(t,(function(){return Xt(r(),!0)}))},Ea=function(t,e,n){return t.concat(A(e,(function(){var e=t[t.length-1];return ra(e,_a(e.cells,e,n))})))},Aa=function(t,e,r){return N(t,(function(t){var o=_a(A(e,n),t,r);return ra(t,t.cells.concat(o))}))},Na=function(t,e,r){var o=e.colDelta<0?Aa:n;return(e.rowDelta<0?Ea:n)(o(t,Math.abs(e.colDelta),r),Math.abs(e.rowDelta),r)},Ra=function(t,e,n,o){var i=r(o,ia(t[e],n).element),u=t[e];return t.length>1&&aa(u)>1&&(n>0&&i(ua(u,n-1))||n<u.cells.length-1&&i(ua(u,n+1))||e>0&&i(ua(t[e-1],n))||e<t.length-1&&i(ua(t[e+1],n)))},Ma=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&R(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&na(t,e,Xt(r(),!0))}))}(e,t,o,r.cell);var i=Ta(n,e),u=Na(n,i,r),a=Ta(e,u),c=Na(e,a,r);return N(c,(function(e,n){var r=e.cells.slice(0,t).concat(u[n].cells).concat(e.cells.slice(t,e.cells.length));return ra(e,r)}))},za=function(t,e,n,r,o){!function(t,e,n,r){var o=ca(t).rows;if(e>0&&e<o.length){var i=function(t,e){return D(t,(function(t,n){return E(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);R(i,(function(t){for(var i=m.none(),u=function(e){for(var u=function(u){var a=o[e].cells[u];n(a.element,t.element)&&(i.isNone()&&(i=m.some(r())),i.each((function(t){na(o[e],u,Xt(t,!0))})))},a=0;a<aa(o[0]);a++)u(a)},a=e;a<o.length;a++)u(a)}))}}(e,t,o,r.cell);var i=Oa(n,e),u=Na(n,i,r),a=Oa(e,u),c=Na(e,a,r),s=ca(c),l=s.cols,f=s.rows;return l.concat(f.slice(0,t)).concat(u).concat(f.slice(t,f.length))},Da=function(t,e,n,r,o){var i=ca(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=oa(u[n],(function(t,n){return e>0&&e<u.length&&r(ua(u[e-1],n),ua(u[e],n))?ia(u[e],n):Xt(o(t.element,r),!0)}));return a.concat(c).concat([l]).concat(s)},Ba=function(t,e,n,r,o){return N(t,(function(t){var i=e>0&&e<aa(t)&&r(ua(t,e-1),ua(t,e)),u=function(t,e,n,r,o,i,u){return"colgroup"!==n&&r?ia(t,e):Xt(u(ua(t,o),i),!0)}(t,e,t.section,i,n,r,o);return function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat([n]).concat(i);return ra(t,u)}(t,e,u)}))},Pa=function(t,e,n,r){return N(t,(function(t){return oa(t,(function(t){return function(t){return E(e,(function(e){return n(t.element,e.element)}))}(t)?Xt(r(t.element,n),!0):t}))}))},Ia=function(t,e,n,r){return void 0!==ua(t[e],n)&&e>0&&r(ua(t[e-1],n),ua(t[e],n))},La=function(t,e,n){return e>0&&n(ua(t,e-1),ua(t,e))},Ha=function(t,e,n,r){var o=L(t,(function(r,o){return Ia(t,o,e,n)||La(r,e,n)?[]:[ia(r,e)]}));return Pa(t,o,n,r)},Fa=function(t,e,n,r){var o=ca(t).rows,i=o[e],u=L(i.cells,(function(t,r){return Ia(o,e,r,n)||La(i,r,n)?[]:[t]}));return Pa(t,u,n,r)},Va=Si(["cell","row","replace","gap","col","colgroup"]),ja=function(t){return{element:t,colspan:We(t,"colspan",1),rowspan:We(t,"rowspan",1)}},Ua=function(t,e){void 0===e&&(e=ja),Va(t);var n=Bu(m.none()),r=function(r){var i=function(n){return function(e){switch(Yt(e.element)){case"col":return t.col(e);default:return t.cell(e)}}(e(n))}(r);return n.get().isNone()&&n.set(m.some(i)),o=m.some({item:r,replacement:i}),i},o=m.none();return{getOrInit:function(t,e){return o.fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.replacement:r(t)}))},cursor:n.get}},Wa=function(t,e){return function(n){var r=Bu(m.none());Va(n);var o=[],i=function(i){var u={scope:t},a=n.replace(i,e,u);return o.push({item:i,sub:a}),r.get().isNone()&&r.set(m.some(a)),a};return{replaceOrInit:function(t,e){return function(t,e){return B(o,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return i(t)}),(function(n){return e(t,n.item)?n.sub:i(t)}))},cursor:r.get}}},qa=function(t){Va(t);var e=Bu(m.none());return{combine:function(n){return e.get().isNone()&&e.set(m.some(n)),function(){var e=t.cell({element:n,colspan:1,rowspan:1});return Ue(e,"width"),Ue(n,"width"),e}},cursor:e.get}},$a=["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"],Ga=Wn(),Xa=function(t){return function(t,e){var n=t.property().name(e);return _($a,n)}(Ga,t)},Ka=function(t){return function(t,e){var n=t.property().name(e);return _(["ol","ul"],n)}(Ga,t)},Ya=function(t){var e,n=function(t){return"br"===Yt(t)},r=function(t){return hr(t).bind((function(e){var r=se(e).map((function(t){return!!Xa(t)||!!function(t,e){return _(["br","img","hr","input"],t.property().name(e))}(Ga,t)&&"img"!==Yt(t)})).getOr(!1);return ue(e).map((function(o){return!0===r||("li"===Yt(i=o)||ke(i,Ka).isSome())||n(e)||Xa(o)&&!Dt(t,o)?[]:[Rt.fromTag("br")];var i}))})).getOr([])},o=0===(e=L(t,(function(t){var e=le(t);return function(t){return H(t,(function(t){return n(t)||ee(t)&&0===Fn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Rt.fromTag("br")]:e;Pn(t[0]),Bn(t[0],o)},Ja=function(t){0===tn(t).length&&In(t)},Qa=function(t,e){return{grid:t,cursor:e}},Za=function(t,e,n){var r=ca(t).rows;return tc(r,e,n).orThunk((function(){return tc(r,0,0)}))},tc=function(t,e,n){return m.from(t[e]).bind((function(t){return m.from(t.cells[n]).bind((function(t){return m.from(t.element)}))}))},ec=function(t,e,n){var r=ca(t).rows;return Qa(t,tc(r,e,n))},nc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},rc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},oc=function(t,e,n){var r,o,i=(r=t,o=n.section,un(r,(function(){return o}))),u=mn(i);return ga(u,e,!0)},ic=function(t,e){var n=M(t,e);return 0===n.length?m.some("td"):n.length===t.length?m.some("th"):m.none()},uc=function(t,e,n){var r=mn(e),o=n.getWidths(r,n);Yo(r,o,n)},ac=va((function(t,e,n,r){var o=e[0].row,i=e[0].row,u=nc(e),a=D(u,(function(t,e){return Da(t,i,o,n,r.getOrInit)}),t);return ec(a,i,e[0].column)}),wa,t,t,Ua),cc=va((function(t,e,n,r){var o=nc(e),i=o[o.length-1].row,u=o[o.length-1].row+o[o.length-1].rowspan,a=D(o,(function(t,e){return Da(t,u,i,n,r.getOrInit)}),t);return ec(a,u,e[0].column)}),wa,t,t,Ua),sc=va((function(t,e,n,r){var o=rc(e),i=o[0].column,u=o[0].column,a=D(o,(function(t,e){return Ba(t,u,i,n,r.getOrInit)}),t);return ec(a,e[0].row,u)}),wa,uc,t,Ua),lc=va((function(t,e,n,r){var o=e[e.length-1].column,i=e[e.length-1].column+e[e.length-1].colspan,u=rc(e),a=D(u,(function(t,e){return Ba(t,i,o,n,r.getOrInit)}),t);return ec(a,e[0].row,i)}),wa,uc,t,Ua),fc=va((function(t,e,n,r){var o=rc(e),i=function(t,e,n){var r=N(t,(function(t){var r=t.cells.slice(0,e).concat(t.cells.slice(n+1));return Kt(r,t.section)}));return M(r,(function(t){return t.cells.length>0}))}(t,o[0].column,o[o.length-1].column),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,uc,Ja,Ua),dc=va((function(t,e,n,r){var o=nc(e),i=function(t,e,n){var r=ca(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,t,Ja,Ua),mc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("row","th")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("row","th"))),gc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td"))),hc=(va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("col","th")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("col","th")),va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td")),va((function(t,n,r,o){var i=n.cells;Ya(i);var u=function(t,e,n,r){var o=ca(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)na(o[i],u,Xt(r(),!1));return t}(t,n.bounds,0,e(i[0]));return Qa(u,m.from(i[0]))}),(function(t,e){return e.mergable}),t,t,qa)),pc=va((function(t,e,n,r){var o=z(e,(function(t,e){return xa(t,e,n,r.combine(e))}),t);return Qa(o,m.from(e[0]))}),(function(t,e){return e.unmergable}),uc,t,qa),vc=va((function(t,e,n,r){var o,i,u=function(t,e){var n=dn(t);return ga(n,e,!0)}(e.clipboard,e.generators);return function(t,e,n,r,o){return function(t,e,n){if(t.row>=e.length||t.column>aa(e[0]))return ka.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=aa(n[0]),u=n.length;return ka.value({rowDelta:r.length-u,colDelta:o.length-i})}(t,e,n).map((function(i){var u=Na(e,i,r);return function(t,e,n,r,o){for(var i=t.row,u=t.column,a=i+n.length,c=u+aa(n[0]),s=i;s<a;s++)for(var l=u;l<c;l++){Ra(e,s,l,o)&&xa(e,ua(e[s],l),o,r.cell);var f=ua(n[s-i],l-u),d=r.replace(f);na(e[s],l,Xt(d,!0))}return e}(t,u,n,r,o)}))}((o=e.row,i=e.column,{row:o,column:i}),t,u,e.generators,n).fold((function(){return Qa(t,m.some(e.element))}),(function(t){var n=Za(t,e.row,e.column);return Qa(t,n)}))}),(function(t,e){return Ze(e.element).bind((function(n){return pa(t,n).map((function(t){return W(W({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),uc,t,Ua),bc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),yc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),wc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].row,u=o[i],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),xc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),Cc=function(t,e){var n=dn(t);return wa(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=I(N(n.all,(function(t){return M(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return ic(i,(function(t){return"th"===Yt(t.element)}))})).getOr("")},Sc=function(t){return Ou(t.parentNode)},kc=function(t,e){var n="thead"===Sc(e),r=!E(e.cells,(function(t){return"th"!==Ou(t)}));return n||r?m.some({thead:n,ths:r}):m.none()},Oc=function(t,e){return"thead"===(n=kc(0,e).fold((function(){return Sc(e)}),(function(t){return"thead"})))?"header":"tfoot"===n?"footer":"body";var n},Tc=function(t,e,n){var r=t.getParent(e,"table"),o=e.parentNode,i=Ou(o);if(n!==i){var u=t.select(n,r)[0];if(!u){u=t.create(n);var a=r.firstChild;"thead"===n?j(xe(Rt.fromDom(r),"caption,colgroup")).fold((function(){return r.insertBefore(u,a)}),(function(e){return t.insertAfter(u,e.dom)})):r.appendChild(u)}"tbody"===n&&"thead"===i&&u.firstChild?u.insertBefore(e,u.firstChild):u.appendChild(e),o.hasChildNodes()||t.remove(o)}},_c=function(t,e,n,r){var o=t.dom,i=function(t,e,n){if(x(n)&&Ou(e)!==n){var r=t.dom.rename(e,n);return ou(t,r),r}return e}(t,e,n);return w(r)||o.setAttrib(i,"scope",r),i},Ec=function(t,e,n,r){return R(e,(function(e){return _c(t,e,n,r)}))},Ac=function(t,e,n){var r,o=t.dom;if("header"===n){var i=xu(t),u="auto"===i?(r=nn(Rt.fromDom(e.cells[0])).map((function(t){return rn(t)})).getOr([]),U(r,(function(t){return kc(0,t.dom)})).map((function(t){return t.thead&&t.ths?"sectionCells":t.thead?"section":"cells"})).getOr("section")):i;Ec(t,e.cells,"section"===u?"td":"th","col"),Tc(o,e,"cells"===u?"tbody":"thead")}else Ec(t,e.cells,"td",null),Tc(o,e,"footer"===n?"tfoot":"tbody")},Nc=function(t){return function(e){var n=Yt(e),r="col"===n||"colgroup"===n?function(t){return nn(t).bind((function(t){return tr(t,zr.firstSelectedSelector)})).fold((function(){return t}),(function(t){return t[0]}))}(e):e;return Ee(r,t)}},Rc=Nc("th,td"),Mc=Nc("th,td,caption"),zc=function(t,e){return Rc(t).map((function(t){return Nr(e)})).getOr([])},Dc=function(t,e){var n,r,o,i=Rc(t),u=i.bind((function(t){return nn(t)})).map((function(t){return rn(t)}));return(n=i,r=u,o=function(t,n){return M(n,(function(n){return E(Ar(n.dom.cells),(function(n){return"1"===Me(n,e)||Dt(n,t)}))}))},n.isSome()&&r.isSome()?m.some(o(n.getOrDie(),r.getOrDie())):m.none()).getOr([])},Bc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Pc=function(t,e,n,r){return A(t,(function(t){return function(t,e,n,r){for(var o=Rt.fromTag("tr"),i=0;i<t;i++){var u=Rt.fromTag(r<e||i<n?"th":"td");i<n&&Ne(u,"scope","row"),r<e&&Ne(u,"scope","col"),Mn(u,Rt.fromTag("br")),Mn(o,u)}return o}(e,n,r,t)}))},Ic=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Lc=function(t,e,n,o,i){var u=du(t),a={styles:u,attributes:fu(t),colGroups:wu(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=Bc);var u=Rt.fromTag("table"),a="cells"!==o;He(u,i.styles),Re(u,i.attributes),i.colGroups&&Mn(u,function(t){var e=Rt.fromTag("colgroup");return A(t,(function(){return Mn(e,Rt.fromTag("col"))})),e}(e));var c=Math.min(t,n);if(a&&n>0){var s=Rt.fromTag("thead");Mn(u,s);var l=Pc(n,e,"sectionCells"===o?c:0,r);Bn(s,l)}var f=Rt.fromTag("tbody");Mn(u,f);var d=Pc(a?t-c:t,e,a?0:n,r);return Bn(f,d),u}(n,e,i,o,xu(t),a);Ne(r,"data-mce-id","__mce");var u=function(t){var e=Rt.fromTag("div"),n=Rt.fromDom(t.dom.cloneNode(!0));return Mn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),_e(Tu(t),'table[data-mce-id="__mce"]').map((function(e){return bu(t)?Wu(t,e):yu(t)?qu(e):(vu(t)||function(t){return p(t)&&-1!==t.indexOf("%")}(u.width))&&Uu(t,e),Ru(e),De(e,"data-mce-id"),function(t,e){R(Ce(e,"tr"),(function(e){ru(t,e.dom),R(Ce(e,"th,td"),(function(e){ou(t,e.dom)}))}))}(t,e),function(t,e){_e(e,"td,th").each(r(Ic,t))}(t,e),e.dom})).getOr(null)},Hc=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return S(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return Lc(t,n,e,a,u)}return console.error(o),null},Fc=function(t){return function(){return t().fold((function(){return[]}),(function(t){return N(t,(function(t){return t.dom}))}))}},Vc=function(t){return function(e){var n=e.length>0?m.some(Ar(e)):m.none();t(n)}},jc=function(t){return function(e,n,r){void 0===r&&(r={});var o=Hc(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Uc=function(t,e,n){var r=We(t,e,1);1===n||r<=1?De(t,e):Ne(t,e,Math.min(n,r))},Wc=tinymce.util.Tools.resolve("tinymce.util.Tools"),qc=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},$c=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Gc=function(t,e){Wc.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Xc=function(t,e){return function(t,e){return e.concat(N(t,(function(t){var e=t.text||t.title;return function(t){return e=t,Wt(e,"menu")&&void 0!==e.menu&&null!==e.menu;var e}(t)?{text:e,items:Xc(t.menu)}:{text:e,value:t.value}})))}(t,e||[])},Kc=function(t){return function(e){return tt(e,"rgb")?t.toHex(e):e}},Yc=function(t,e){var n=Rt.fromDom(e);return{borderwidth:je(n,"border-width").getOr(""),borderstyle:je(n,"border-style").getOr(""),bordercolor:je(n,"border-color").map(Kc(t)).getOr(""),backgroundcolor:je(n,"background-color").map(Kc(t)).getOr("")}},Jc=function(t){var e=t[0],n=t.slice(1);return R(n,(function(t){R(It(e),(function(n){Ht(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},Qc=function(t){var e=[{name:"borderstyle",type:"listbox",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"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(e):e}},Zc=function(t,e,n,r){return B(t,(function(t){return n.formatter.matchNode(r,e+t)})).getOr("")},ts=r(Zc,["left","center","right"],"align"),es=r(Zc,["top","middle","bottom"],"valign"),ns=[{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:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],rs=function(t){return ns.concat(function(t){var e=Xc(function(t){return t.getParam("table_cell_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},os=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},is={normal:os(!1),ifTruthy:os(!0)},us=function(t){return nn(t[0]).map((function(e){var n=dn(e),r=vn(n),o=M(r,(function(e){return E(t,(function(t){return Dt(e.element,t)}))}));return N(o,(function(t){return{element:t.element.dom,column:wn(n,t.column).map((function(t){return t.element.dom}))}}))}))},as=function(t,e,n){var r=n.getData();n.close(),t.undoManager.transact((function(){(function(t,e,n){var r=1===e.length;if(e.length>=1){var o=nn(e[0]);us(e).each((function(e){R(e,(function(e){var o=_c(t,e.element,n.celltype),i=r?is.normal(t,o):is.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Nu(n.height)),e.setStyle("width",Nu(n.width))}(i,e.column.map((function(e){return r?is.normal(t,e):is.ifTruthy(t,e)})).getOr(i),n),mu(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Nu(e.borderwidth))}(i,n),r&&(Gc(t,o),function(t,e){Wc.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&$c(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))})),o.each((function(e){return iu(t,e.dom)}))}})(t,e,r),t.focus()}))},cs=function(t,e){var n=zc(Du(t),e);if(0!==n.length){var o=function(t,e){var n=us(e).map((function(e){return N(e,(function(e){return function(t,e,n,r){var o=t.dom,i=r.getOr(e),u=function(t,e){return o.getStyle(t,e)||o.getAttrib(t,e)};return W({width:u(i,"width"),height:u(e,"height"),scope:o.getAttrib(e,"scope"),celltype:Ou(e),class:o.getAttrib(e,"class",""),halign:ts(t,e),valign:es(t,e)},n?Yc(o,e):{})}(t,e.element,mu(t),e.column)}))}));return Jc(n.getOrDie())}(t,n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:rs(t)},Qc("cell")]},u={type:"panel",items:[{type:"grid",columns:2,items:rs(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:mu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(as,t,n)})}},ss=[{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"}],ls=function(t){return ss.concat(function(t){var e=Xc(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},fs=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){(function(t,e,n,r){var o=1===e.length;R(e,(function(e){r.type!==Ou(e.parentNode)&&Ac(t,e,r.type);var i=o?is.normal(t,e):is.ifTruthy(t,e);!function(t,e){t.setAttrib("scope",e.scope),t.setAttrib("class",e.class),t.setStyle("height",Nu(e.height))}(i,r),gu(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,r),r.align!==n.align&&(Gc(t,e),$c(t,e,r.align))})),nn(Rt.fromDom(e[0])).each((function(e){return iu(t,e.dom)}))})(t,e,n,o),t.focus()}))},ds=function(t){var e=Dc(Du(t),zr.selected);if(0!==e.length){var n=N(e,(function(e){return function(t,e,n){var r=t.dom;return W({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),class:r.getAttrib(e,"class",""),type:Oc(0,e),align:ts(t,e)},n?Yc(r,e):{})}(t,e.dom,gu(t))})),o=Jc(n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:ls(t)},Qc("row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ls(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:gu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(fs,t,N(e,(function(t){return t.dom})),o)})}},ms=tinymce.util.Tools.resolve("tinymce.Env"),gs=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{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"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},hs=function(t,e,n,r){if("TD"===e.tagName||"TH"===e.tagName)p(n)?t.setStyle(e,n,r):t.setStyle(e,n);else if(e.children)for(var o=0;o<e.children.length;o++)hs(t,e.children[o],n,r)},ps=function(t,e,n){var r,o=t.dom,i=n.getData();n.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,u=parseInt(i.rows,10)||1;e=Lc(t,n,u,0,0)}!function(t,e,n){var r,o=t.dom,i={},u={};if(i.class=n.class,u.height=Nu(n.height),o.getAttrib(e,"width")&&!pu(t)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Nu(n.width),pu(t)?(u["border-width"]=Nu(n.border),u["border-spacing"]=Nu(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),pu(t)&&e.children)for(var a=0;a<e.children.length;a++)hs(o,e.children[a],{"border-width":Nu(n.border),padding:Nu(n.cellpadding)}),hu(t)&&hs(o,e.children[a],{"border-color":n.bordercolor});hu(t)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(W(W({},du(t)),u)),o.setAttribs(e,W(W({},fu(t)),i)),iu(t,e)}(t,e,i),(r=o.select("caption",e)[0])&&!i.caption&&o.remove(r),!r&&i.caption&&((r=o.create("caption")).innerHTML=ms.ie?" ":'<br data-mce-bogus="1"/>',e.insertBefore(r,e.firstChild)),""===i.align?Gc(t,e):$c(t,e,i.align),t.focus(),t.addVisual()}))},vs=function(t,e){var n,o=t.dom,i=function(t,e){var n,r,o,i,u=du(t),a=fu(t),c=e?(n=t.dom,{borderstyle:Ut(u,"border-style").getOr(""),bordercolor:Kc(n)(Ut(u,"border-color").getOr("")),backgroundcolor:Kc(n)(Ut(u,"background-color").getOr(""))}):{};return W(W(W(W(W(W({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],pu(t)&&i?{border:i}:Ut(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Ut(u,"border-spacing").or(Ut(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Ut(u,"border-padding").or(Ut(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),W(W({},r),o)))}(t,hu(t));!1===e?(n=o.getParent(t.selection.getStart(),"table"))?i=function(t,e,n){var r=t.dom;return W({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"),cellpadding:r.getAttrib(e,"cellpadding")||qc(t.dom,e,"padding"),border:function(e,n){var r=je(Rt.fromDom(n),"border-width");return pu(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||qc(t.dom,n,"border-width")||qc(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:ts(t,e)},n?Yc(r,e):{})}(t,n,hu(t)):hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""):(i.cols="1",i.rows="1",hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""));var u=Xc(function(t){return t.getParam("table_class_list",[],"array")}(t));u.length>0&&i.class&&(i.class=i.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:gs(t,u,e)},c=hu(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},Qc("table")]}:{type:"panel",items:[a]};t.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:r(ps,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i})},bs=function(t){return Mc(Du(t))},ys=function(t){return Rc(Du(t))},ws=function(e,n,o,i,u){var c=Au(e),s=function(t){return nn(t,c)},l=function(t){return function(n){e.selection.setRng(n),e.focus(),o.clear(t),Ru(t),iu(e,t.dom)}},f=function(t){return ys(e).each((function(e){s(e).each((function(n){var r=Br(i,n,e);t(n,r).each(l(n))}))}))},d=function(){return ys(e).map((function(n){return s(n).bind((function(r){return function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1),o=ca(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan);return function(t){return N(t,(function(t){var e=br(t.element);return R(t.cells,(function(t){var n=yr(t.element);sa(n,"colspan",t.colspan,1),sa(n,"rowspan",t.rowspan,1),Mn(e,n)})),e}))}(ha(o,n))}))}(r,Br(i,r,n),_r(t,Rt.fromDom(e.getDoc()),m.none()))}))}))},g=function(){return ys(e).map((function(t){return s(t).bind((function(e){return function(t,e){var n=dn(t);return wa(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan;return q(function(t,e,n){if(yn(t)){var r=M(bn(t),(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"span",n-e),r})),i=Rt.fromTag("colgroup");return Bn(i,o),[i]}return[]}(n,r,o),function(t,e,n){return N(t.all,(function(t){var r=M(t.cells,(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"colspan",n-e),r})),i=Rt.fromTag("tr");return Bn(i,o),i}))}(n,r,o))}))}(e,Br(i,e,t))}))}))},h=function(t,n){return n().each((function(n){var r=N(n,(function(t){return yr(t)}));ys(e).each((function(n){return s(n).each((function(n){var o=Er(Rt.fromDom(e.getDoc())),u=function(t,e,n,r){return{selection:Nr(t),clipboard:n,generators:r}}(i,0,r,o);t(n,u).each(l(n))}))}))}))};Ht({mceTableSplitCells:function(){return f(n.unmergeCells)},mceTableMergeCells:function(){return f(n.mergeCells)},mceTableInsertRowBefore:function(){return f(n.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(n.insertRowsAfter)},mceTableInsertColBefore:function(){return f(n.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(n.insertColumnsAfter)},mceTableDeleteCol:function(){return f(n.deleteColumn)},mceTableDeleteRow:function(){return f(n.deleteRow)},mceTableCutCol:function(t){return g().each((function(t){u.setColumns(t),f(n.deleteColumn)}))},mceTableCutRow:function(t){return d().each((function(t){u.setRows(t),f(n.deleteRow)}))},mceTableCopyCol:function(t){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(t){return d().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(t){return h(n.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(t){return h(n.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(t){return h(n.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(t){return h(n.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return bs(e).each((function(t){nn(t,c).filter(a(c)).each((function(t){var n=Rt.fromText("");if(Nn(t,n),In(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{var r=e.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),e.selection.setRng(r),e.nodeChanged()}}))}))},mceTableSizingMode:function(t,n){return function(t){return bs(e).each((function(n){yu(e)||bu(e)||vu(e)||nn(n,c).each((function(n){"relative"!==t||gi(n)?"fixed"!==t||hi(n)?"responsive"!==t||pi(n)||qu(n):Wu(e,n):Uu(e,n),Ru(n),iu(e,n.dom)}))}))}(n)}},(function(t,n){return e.addCommand(n,t)}));var b=function(t,e){e.each((function(e){iu(t,e.dom)}))};Ht({mceTableCellType:function(t,r){var o=nn(Du(e),c);n.setTableCellType(e,r),b(e,o)},mceTableRowType:function(t,r){var o=nn(Du(e),c);n.setTableRowType(e,r),b(e,o)}},(function(t,n){return e.addCommand(n,t)})),e.addCommand("mceTableColType",(function(t,e){return Ut(e,"type").each((function(t){return f("th"===t?n.makeColumnsHeader:n.unmakeColumnsHeader)}))})),Ht({mceTableProps:r(vs,e,!1),mceTableRowProps:r(ds,e),mceTableCellProps:r(cs,e,i)},(function(t,n){return e.addCommand(n,(function(){return t()}))})),e.addCommand("mceInsertTable",(function(t,n){v(n)&&It(n).length>0?Hc(e,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):vs(e,!0)})),e.addCommand("mceTableApplyCellStyle",(function(t,n){var r=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(v(n)){var o=zc(Du(e),i);if(0!==o.length){var u=jt(n,(function(t,n){return e.formatter.has(r(n))&&p(t)}));(function(t){for(var e in t)if(Lt.call(t,e))return!1;return!0})(u)||(Ht(u,(function(t,n){R(o,(function(o){is.normal(e,o.dom).setFormat(r(n),t)}))})),s(o[0]).each((function(t){return iu(e,t.dom,{structure:!1,style:!0})})))}}}))},xs={tablecellbackgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},tablecellbordercolor:{selector:"td,th",styles:{borderColor:"%value"},remove_similar:!0},tablecellborderstyle:{selector:"td,th",styles:{borderStyle:"%value"},remove_similar:!0},tablecellborderwidth:{selector:"td,th",styles:{borderWidth:"%value"},remove_similar:!0}},Cs=nr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Ss=W(W({},Cs),{none:function(t){return void 0===t&&(t=void 0),Cs.none(t)}}),ks=function(t,e){return nn(t,e).bind((function(e){var n=tn(e);return P(n,(function(e){return Dt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Os=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ts=nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_s={before:Ts.before,on:Ts.on,after:Ts.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(n,n,n)}},Es=nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),As={domRange:Es.domRange,relative:Es.relative,exact:Es.exact,exactFromRange:function(t){return Es.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Rt.fromDom(t.startContainer)},relative:function(t,e){return _s.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return Rt.fromDom(ie(e).dom.defaultView)},range:Os},Ns=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rs=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ms=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zs=nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ds=function(t,e,n){return e(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},Bs=function(t,n){return r=function(t,n){return n.match({domRange:function(t){return{ltr:e(t),rtl:m.none}},relative:function(e,n){return{ltr:$((function(){return Ns(t,e,n)})),rtl:$((function(){return m.some(Ns(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:$((function(){return Rs(t,e,n,r,o)})),rtl:$((function(){return m.some(Rs(t,r,o,e,n))}))}}})}(t,n),(o=r.ltr()).collapsed?r.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zs.rtl(Rt.fromDom(t.endContainer),t.endOffset,Rt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ds(0,zs.ltr,o)})):Ds(0,zs.ltr,o);var r,o},Ps=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})},Is=(zs.ltr,zs.rtl,function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom}),Ls=function(t,e,n,r){return ee(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return U(i,(function(t){return Is(t,n,r)?m.some(t):m.none()})).map((function(o){return function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Fn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,a=1;a<o;a++){var c=i(a).getBoundingClientRect(),s=Math.abs(e-c.left);if(n<=c.bottom){if(n<c.top||s>u)return a-1;u=s}}return 0}(0,n,r,o.right,u);return i(a)}(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=le(e);return U(i,(function(e){return o.selectNode(e.dom),Is(o.getBoundingClientRect(),n,r)?Ls(t,e,n,r):m.none()}))}(t,e,n,r)},Hs=function(t,e){return e-t.left<t.right-e},Fs=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Vs=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Hs(o,n);return(!0===i?gr:hr)(e).map((function(e){return Fs(t,e,i)}))},js=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Hs(r,n);return m.some(Fs(t,e,o))},Us=document.caretPositionFromPoint?function(t,e,n){return m.from(t.dom.caretPositionFromPoint(e,n)).bind((function(e){if(null===e.offsetNode)return m.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),m.some(n)}))}:document.caretRangeFromPoint?function(t,e,n){return m.from(t.dom.caretRangeFromPoint(e,n))}:function(t,e,n){return Rt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===le(e).length?js:Vs)(t,e,n)}(t,r,e)};return 0===le(r).length?o():function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Ls(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))}(t,r,e,n).orThunk(o)}))},Ws=function(t,e){var n=Yt(t);return"input"===n?_s.after(t):_(["br","img"],n)?0===e?_s.before(t):_s.after(t):_s.on(t,e)},qs=function(t,e){var n=t.fold(_s.before,Ws,_s.after),r=e.fold(_s.before,Ws,_s.after);return As.relative(n,r)},$s=function(t,e,n,r){var o=Ws(t,e),i=Ws(n,r);return As.relative(o,i)},Gs=function(t){return m.from(t.getSelection())},Xs=function(t,e){Gs(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},Ks=function(t,e,n,r,o){var i=Rs(t,e,n,r,o);Xs(t,i)},Ys=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){Ks(t,e,n,r,o)},rtl:function(e,n,r,o){Gs(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Ks(t,r,o,e,n)}else Ks(t,r,o,e,n)}))}})},Js=function(t,e,n,r,o){var i=$s(e,n,r,o);Ys(t,i)},Qs=function(t,e,n){var r=qs(e,n);Ys(t,r)},Zs=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return m.some(Os(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(n.endContainer),n.endOffset))}return m.none()},tl=function(t){if(null===t.anchorNode||null===t.focusNode)return Zs(t);var e=Rt.fromDom(t.anchorNode),n=Rt.fromDom(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=oe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Dt(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?m.some(Os(e,t.anchorOffset,n,t.focusOffset)):Zs(t)},el=function(t){return function(t){return Gs(t).filter((function(t){return t.rangeCount>0})).bind(tl)}(t).map((function(t){return As.exact(t.start,t.soffset,t.finish,t.foffset)}))},nl=tinymce.util.Tools.resolve("tinymce.util.VK"),rl=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none(o)}),(function(t){return t.index+1<t.all.length?Ss.middle(o,t.all[t.index+1]):Ss.last(o)})),r);var o},ol=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none()}),(function(t){return t.index-1>=0?Ss.middle(o,t.all[t.index-1]):Ss.first(o)})),r);var o},il=function(t,e){return function(t){var e=As.getWin(t).dom,n=function(t,n,r,o){return Rs(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Rt.fromDom(t.startContainer),n=Rt.fromDom(t.endContainer);return $s(e,t.startOffset,n,t.endOffset)},relative:qs,exact:$s})}(t);return Bs(e,r).match({ltr:n,rtl:n})}(As.exact(e,0,e,0))},ul=function(t,e,n,r){return n.fold(m.none,m.none,(function(t,e){return gr(e).map((function(t){return il(0,t)}))}),(function(n){return nn(n,e).bind((function(e){var o=Dr(n);return t.undoManager.transact((function(){r.insertRowsAfter(e,o)})),function(t,e){var n=Ce(e,"tr");return j(n).bind((function(t){return _e(t,"td,th").map((function(t){return il(0,t)}))}))}(0,e)}))}))},al=["table","li","dl"],cl=function(t,e){return{selection:t,kill:e}},sl=function(t,e,n,r){return{start:_s.on(t,e),finish:_s.on(n,r)}},ll=function(t,e){var n=Ps(t,e);return Os(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},fl=sl,dl=function(t,e,n,r,o){return Dt(n,r)?m.none():Yn(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>0?(o(t,r,e.start,e.finish),m.some(cl(m.some(fl(n,0,n,fr(n))),!0))):m.none()}))},ml=function(t,e){return{item:t,mode:e}},gl=function(t,e,n,r){return void 0===r&&(r=hl),t.property().parent(e).map((function(t){return ml(t,r)}))},hl=function(t,e,n,r){return void 0===r&&(r=pl),n.sibling(t,e).map((function(t){return ml(t,r)}))},pl=function(t,e,n,r){void 0===r&&(r=pl);var o=t.property().children(e);return n.first(o).map((function(t){return ml(t,r)}))},vl=[{current:gl,next:hl,fallback:m.none()},{current:hl,next:pl,fallback:m.some(gl)},{current:pl,next:pl,fallback:m.some(hl)}],bl=function(t,e,n,r,o){return void 0===o&&(o=vl),B(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return bl(t,e,n,r)}))}))}))},yl=function(t,e,n,r,o,i){return bl(t,e,r,o).bind((function(e){return i(e.item)?m.none():n(e.item)?m.some(e.item):yl(t,e.item,n,e.mode,o,i)}))},wl=function(t){return function(e){return 0===t.property().children(e).length}},xl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?m.some(t[t.length-1]):m.none()}},r)},Cl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?m.some(t[0]):m.none()}},r)},Sl=Wn(),kl=function(t,e){return function(t,e,n){return xl(t,e,wl(t),n)}(Sl,t,e)},Ol=function(t,e){return function(t,e,n){return Cl(t,e,wl(t),n)}(Sl,t,e)},Tl=nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),_l=function(t){return Ee(t,"tr")},El=W(W({},Tl),{verify:function(t,e,n,r,o,i,u){return Ee(r,"td,th",u).bind((function(n){return Ee(e,"td,th",u).map((function(e){return Dt(n,e)?Dt(r,n)&&fr(n)===o?i(e):Tl.none("in same cell"):Xn(_l,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?Tl.success():i(e)}),(function(t){return i(e)}))}))})).getOr(Tl.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Al=function(t){return"br"===Yt(t)},Nl=function(t,e,n){return e(t,n).bind((function(t){return ee(t)&&0===Fn(t).trim().length?Nl(t,e,n):m.some(t)}))},Rl=function(t,e,n,o){return function(t,e){return fe(t,e).filter(Al).orThunk((function(){return fe(t,e-1).filter(Al)}))}(e,n).bind((function(e){return o.traverse(e).fold((function(){return Nl(e,o.gather,t).map(o.relative)}),(function(t){return function(t){return ue(t).bind((function(e){var n=le(e);return function(t,e){return P(t,r(Dt,e))}(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return _s.on(t.parent,t.index)}))}))}))},Ml=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},zl=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},Dl=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Bl=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Pl=function(t,e){return m.some(t.getRect(e))},Il=function(t,e,n){return te(e)?Pl(t,e).map(Bl):ee(e)?function(t,e,n){return n>=0&&n<fr(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):m.none()}(t,e,n).map(Bl):m.none()},Ll=function(t,e){return te(e)?Pl(t,e).map(Bl):ee(e)?t.getRangedRect(e,0,e,fr(e)).map(Bl):m.none()},Hl=nr([{none:[]},{retry:["caret"]}]),Fl=function(t,e,n){return(r=e,o=Xa,Se((function(t,e){return e(t)}),ke,r,o,undefined)).fold(c,(function(e){return Ll(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o},Vl={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=Ml(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?Hl.retry(i):n.top===o.bottom?Hl.retry(Ml(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:Ml,gather:Ol},jl=function(t,e,n,r,o){return 0===o?m.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===Yt(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return jl(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(m.none,(function(i){return Ll(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(m.none,(function(r){return jl(t,e,n,r,o-1)}))})).orThunk((function(){return m.some(r)}))}),m.none)}))},Ul=function(t,e,n){var r=t.move(n,5),o=jl(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?m.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?m.some(-t.point(e)):m.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Wl={tryUp:r(Ul,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=zl(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?Hl.retry(i):n.bottom===o.top?Hl.retry(zl(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:zl,gather:kl}),tryDown:r(Ul,Vl),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:e(5)},ql=function(t,e,n){return t.getSelection().bind((function(r){return function(t,e,n,r){return(Al(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Nl(e,n.gather,t)})).map(n.relative)}(t,e,r):Rl(t,e,n,r)).map((function(t){return{start:t,finish:t}}))}(e,r.finish,r.foffset,n).fold((function(){return m.some(Ku(r.finish,r.foffset))}),(function(o){var i,u=t.fromSitus(o);return i=El.verify(t,r.finish,r.foffset,u.finish,u.foffset,n.failure,e),El.cata(i,(function(t){return m.none()}),(function(){return m.none()}),(function(t){return m.some(Ku(t,0))}),(function(t){return m.some(Ku(t,fr(t)))}))}))}))},$l=function(t,e,n,r,o,i){return 0===i?m.none():Kl(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=El.verify(t,n,r,a.finish,a.foffset,o.failure,e);return El.cata(c,(function(){return m.none()}),(function(){return m.some(u)}),(function(u){return Dt(n,u)&&0===r?Gl(t,n,r,zl,o):$l(t,e,u,0,o,i-1)}),(function(u){return Dt(n,u)&&r===fr(u)?Gl(t,n,r,Ml,o):$l(t,e,u,fr(u),o,i-1)}))}))},Gl=function(t,e,n,r,o){return Il(t,e,n).bind((function(e){return Xl(t,o,r(e,Wl.getJumpSize()))}))},Xl=function(t,e,n){var r=At().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):m.none()},Kl=function(t,e,n,r,o){return Il(t,n,r).bind((function(e){return Xl(t,o,e)}))},Yl=function(t,e,n,r,o){return Ee(r,"td,th",e).bind((function(r){return Ee(r,"table",e).bind((function(i){return function(t,e){return ke(t,(function(t){return ue(t).exists((function(t){return Dt(t,e)}))}),void 0).isSome()}(o,i)?function(t,e,n){return ql(t,e,n).bind((function(r){return $l(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Ee(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):m.none()}))}))},Jl=function(t,e,n,r,o,i){return At().browser.isIE()?m.none():i(r,e).orThunk((function(){return Yl(t,e,n,r,o).map((function(t){var e=t.range;return cl(m.some(fl(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Ql=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[0])?function(t,e,n){return xl(Sl,t,(function(t){return hr(t).isSome()}),n)}(n,0,e).map((function(t){var e=fr(t);return cl(m.some(fl(t,e,t,e)),!0)})):m.none()}))}))},Zl=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[r.length-1])?function(t,e,n){return Cl(Sl,t,(function(t){return gr(t).isSome()}),n)}(n,0,e).map((function(t){return cl(m.some(fl(t,0,t,0)),!0)})):m.none()}))}))},tf=function(t,e,n,r,o,i,u){return Yl(t,n,r,o,i).bind((function(t){return dl(e,n,t.start,t.finish,u)}))},ef=function(t,e){return Ee(t,"td,th",e)};var nf={traverse:se,gather:Ol,relative:_s.before,otherRetry:Wl.tryDown,ieRetry:Wl.ieTryDown,failure:El.failedDown},rf={traverse:ce,gather:kl,relative:_s.before,otherRetry:Wl.tryUp,ieRetry:Wl.ieTryUp,failure:El.failedUp},of=function(t){return function(e){return e===t}},uf=of(38),af=of(40),cf=function(t){return t>=37&&t<=40},sf={isBackward:of(37),isForward:of(39)},lf={isBackward:of(39),isForward:of(37)},ff=function(t){return{elementFromPoint:function(e,n){return Rt.fromPoint(Rt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=As.exact(e,n,r,o);return function(t,e){return n=Ps(t,e),r=n.getClientRects(),(o=r.length>0?r[0]:n.getBoundingClientRect()).width>0||o.height>0?m.some(o).map(Ms):m.none();var n,r,o}(t,i)},getSelection:function(){return el(t).map((function(e){return ll(t,e)}))},fromSitus:function(e){var n=As.relative(e.start,e.finish);return ll(t,n)},situsFromPoint:function(e,n){return function(t,e,n){return function(t,e,n){var r=Rt.fromDom(t.document);return Us(r,e,n).map((function(t){return Os(Rt.fromDom(t.startContainer),t.startOffset,Rt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)}(t,e,n).map((function(t){return sl(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){Gs(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),el(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Qs(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;Js(t,u,a,u,a)}))}))},setSelection:function(e){Js(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Qs(t,e,n)},selectContents:function(e){!function(t,e){var n=function(t,e){var n=t.document.createRange();return function(t,e){t.selectNodeContents(e.dom)}(n,e),n}(t,e);Xs(t,n)}(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Rt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,eo(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Rt.fromDom(t.document))}}},df=function(t,e){return{rows:t,cols:e}},mf=function(t){return!1===Pi(Rt.fromDom(t.target),"ephox-snooker-resizer-bar")};function gf(e,n,o){var i=function(t,e,n){var r=function(e){De(e,t.selected),De(e,t.firstSelected),De(e,t.lastSelected)},o=function(e){Ne(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=Ce(e,t.selectedSelector);R(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),R(r,o),Ne(u,t.firstSelected,"1"),Ne(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}}(zr,(function(n,r,i){o.targets().each((function(o){nn(r).each((function(u){var a=ku(e),c=_r(t,Rt.fromDom(e.getDoc()),a),s=function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1);return{upOrLeftCells:function(t,e,n){var r=t.slice(0,e[e.length-1].row+1),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return N(n,(function(t){return t.element}))}))}(e,t,n),downOrRightCells:function(t,e,n){var r=t.slice(e[0].row+e[0].rowspan-1,t.length),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return N(n,(function(t){return t.element}))}))}(e,t,n)}}))}(u,o,c);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(e,n,r,i,s)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(e)}));return e.on("init",(function(o){var u=e.getWin(),a=Tu(e),c=Au(e),s=function(t,e,n,r){var o=function(t,e,n,r){var o,i=(o=Bu(m.none()),{clear:function(){return o.set(m.none())},set:function(t){return o.set(m.some(t))},isSet:function(){return o.get().isSome()},on:function(t){return o.get().each(t)}}),u=i.clear;return{clearstate:u,mousedown:function(t){r.clear(e),ef(t.target,n).each(i.set)},mouseover:function(o){i.on((function(i){r.clearBeforeUpdate(e),ef(o.target,n).each((function(o){Yn(i,o,n).each((function(n){var u=n.boxes.getOr([]);(u.length>1||1===u.length&&!Dt(i,o))&&(r.selectRange(e,u,n.start,n.finish),t.selectContents(o))}))}))}))},mouseup:function(t){u()}}}(ff(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}}(u,a,c,i),l=function(t,e,n,o){var i=ff(t),u=function(){return o.clear(e),m.none()};return{keydown:function(t,a,c,s,l,f){var d=t.raw,g=d.which,h=!0===d.shiftKey;return Jn(e,o.selectedSelector).fold((function(){return af(g)&&h?r(tf,i,e,n,nf,s,a,o.selectRange):uf(g)&&h?r(tf,i,e,n,rf,s,a,o.selectRange):af(g)?r(Jl,i,n,nf,s,a,Zl):uf(g)?r(Jl,i,n,rf,s,a,Ql):m.none}),(function(t){var n=function(n){return function(){return U(n,(function(n){return function(t,e,n,r,o){return Zn(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,o)})).fold((function(){return Qn(e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){var n=af(g)||f.isForward(g)?_s.after:_s.before;return i.setRelativeSelection(_s.on(t.first,0),n(t.table)),o.clear(e),cl(m.none(),!0)}))}),(function(t){return m.some(cl(m.none(),!0))}))}};return af(g)&&h?n([df(1,0)]):uf(g)&&h?n([df(-1,0)]):f.isBackward(g)&&h?n([df(0,-1),df(-1,0)]):f.isForward(g)&&h?n([df(0,1),df(1,0)]):cf(g)&&!1===h?u:m.none}))()},keyup:function(t,r,i,u,a){return Jn(e,o.selectedSelector).fold((function(){var c=t.raw,s=c.which;return 0==(!0===c.shiftKey)?m.none():cf(s)?function(t,e,n,r,o,i,u){return Dt(n,o)&&r===i?m.none():Ee(n,"td,th",e).bind((function(n){return Ee(o,"td,th",e).bind((function(r){return dl(t,e,n,r,u)}))}))}(e,n,r,i,u,a,o.selectRange):m.none()}),m.none)}}}(u,a,c,i),f=function(t,e,n,r){var o=ff(t);return function(t,i){r.clearBeforeUpdate(e),Yn(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(u,a,c,i);e.on("TableSelectorChange",(function(t){return f(t.start,t.finish)}));var d,g,h=function(t,n){(function(t){return!0===t.raw.shiftKey})(t)&&(n.kill&&t.kill(),n.selection.each((function(t){var n=As.relative(t.start,t.finish),r=Ps(u,n);e.selection.setRng(r)})))},p=function(t){return 0===t.button},v=(d=Bu(Rt.fromDom(a)),g=Bu(0),{touchEnd:function(t){var e=Rt.fromDom(t.target);if("td"===Yt(e)||"th"===Yt(e)){var n=d.get(),r=g.get();Dt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),f(e,e))}d.set(e),g.set(t.timeStamp)}});e.on("dragstart",(function(t){s.clearstate()})),e.on("mousedown",(function(t){p(t)&&mf(t)&&s.mousedown(Mi(t))})),e.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||ms.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&mf(t)&&s.mouseover(Mi(t))})),e.on("mouseup",(function(t){p(t)&&mf(t)&&s.mouseup(Mi(t))})),e.on("touchend",v.touchEnd),e.on("keyup",(function(t){var n=Mi(t);if(n.raw.shiftKey&&cf(n.raw.which)){var r=e.selection.getRng(),o=Rt.fromDom(r.startContainer),i=Rt.fromDom(r.endContainer);l.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){h(n,t)}))}})),e.on("keydown",(function(t){var r=Mi(t);n().each((function(t){return t.hideBars()}));var o=e.selection.getRng(),i=Rt.fromDom(o.startContainer),u=Rt.fromDom(o.endContainer),a=Kr(sf,lf)(Rt.fromDom(e.selection.getStart()));l.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){h(r,t)})),n().each((function(t){return t.showBars()}))})),e.on("NodeChange",(function(){var n=e.selection,r=Rt.fromDom(n.getStart()),o=Rt.fromDom(n.getEnd());Xn(nn,[r,o]).fold((function(){return i.clear(a)}),t)}))})),{clear:i.clear}}cr.add("table",(function(e){var n,r=(n=zr.selectedSelector,{get:function(){return tr(Tu(e),n).fold((function(){return Mc(Du(e)).map(ar).getOrThunk(ir)}),(function(t){return ur(t)}))}}),o=function(t,e){var n=Bu(m.none()),r=Bu([]),o=function(){return Mc(Du(t)).bind((function(t){return nn(t).map((function(n){return"caption"===Yt(t)?Dr(t):Br(e,n,t)}))}))},i=function(){n.set($(o)()),R(r.get(),(function(t){return t()}))},u=function(t,e){var o=function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))};return o(),r.set(r.get().concat([o])),function(){r.set(M(r.get(),(function(t){return t!==o})))}};return t.on("NodeChange ExecCommand TableSelectorChange",i),{onSetupTable:function(t){return u(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return u(t,(function(t){return"caption"===Yt(t.element)}))},onSetupPasteable:function(t){return function(e){return u(e,(function(e){return"caption"===Yt(e.element)||t().isNone()}))}},onSetupMergeable:function(t){return u(t,(function(t){return t.mergable.isNone()}))},onSetupUnmergeable:function(t){return u(t,(function(t){return t.unmergable.isNone()}))},resetTargets:i,targets:function(){return n.get()}}}(e,r),i=Xu(e),u=gf(e,i.lazyResize,o),a=function(e,n,r){var o=function(t){return"table"===Yt(Tu(t))},i=ku(e),u=function(t,n,r,o){return function(u,a){Ru(u);var c=o(),s=Rt.fromDom(e.getDoc()),l=_r(r,s,i),f=Vu(e,u);return n(u)?t(c,u,a,l,f).bind((function(t){return R(t.newRows,(function(t){ru(e,t.dom)})),R(t.newCells,(function(t){ou(e,t.dom)})),t.cursor.map((function(t){var n=Zu(ta,t),r=e.dom.createRng();return r.setStart(n.element.dom,n.offset),r.setEnd(n.element.dom,n.offset),r}))})):m.none()}},a=u(dc,(function(t){return!1===o(e)||bi(t).rows>1}),t,n),c=u(fc,(function(t){return!1===o(e)||bi(t).columns>1}),t,n),l=u(ac,s,t,n),f=u(cc,s,t,n),d=u(sc,s,ea,n),g=u(lc,s,ea,n),h=u(hc,s,t,n),p=u(pc,s,t,n),v=u(bc,s,t,n),b=u(yc,s,t,n),y=u(wc,s,t,n),w=u(xc,s,t,n),x=u(vc,s,t,n),C=function(t,e){return Ut(t,"type").filter((function(t){return _(e,t)}))};return{deleteRow:a,deleteColumn:c,insertRowsBefore:l,insertRowsAfter:f,insertColumnsBefore:d,insertColumnsAfter:g,mergeCells:h,unmergeCells:p,pasteColsBefore:v,pasteColsAfter:b,pasteRowsBefore:y,pasteRowsAfter:w,pasteCells:x,setTableCellType:function(t,e){return C(e,["td","th"]).each((function(e){var n=N(zc(Du(t),r),(function(t){return t.dom}));Ec(t,n,e,null)}))},setTableRowType:function(t,e){return C(e,["header","body","footer"]).each((function(e){N(Dc(Du(t),zr.selected),(function(n){return Ac(t,n.dom,e)}))}))},makeColumnsHeader:u(mc,s,t,n),unmakeColumnsHeader:u(gc,s,t,n),getTableRowType:function(t){var e=Dc(Du(t),zr.selected);if(e.length>0){var n=N(e,(function(t){return Oc(0,t.dom)})),r=_(n,"header"),o=_(n,"footer");if(r||o){var i=_(n,"body");return!r||i||o?r||i||!o?"":"footer":"header"}return"body"}},getTableCellType:function(t){return ic(zc(Du(t),r),(function(t){return"th"===Yt(t)})).getOr("")},getTableColType:Cc}}(e,i.lazyWire,r),c=function(){var t=Bu(m.none()),e=Bu(m.none()),n=function(t){t.set(m.none())};return{getRows:t.get,setRows:function(r){t.set(r),n(e)},clearRows:function(){return n(t)},getColumns:e.get,setColumns:function(r){e.set(r),n(t)},clearColumns:function(){return n(e)}}}();return ws(e,a,u,r,c),function(t,e,n){var r=Au(t);Ht({mceTableRowType:function(){return e.getTableRowType(t)},mceTableCellType:function(){return e.getTableCellType(t)},mceTableColType:function(){return Rc(Du(t)).bind((function(t){return function(t){return nn(t,r)}(t).map((function(r){var o=Br(n,r,t);return e.getTableColType(r,o)}))})).getOr("")}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(e,a,r),function(e,n,r,o){e.on("BeforeGetContent",(function(r){!0===r.selection&&or(n.get(),t,(function(t){r.preventDefault(),function(t){return nn(t[0]).map(yr).map((function(t){return[lr(t,"[data-mce-selected]")]}))}(t).each((function(t){r.content="text"===r.format?function(t){return N(t,(function(t){return t.dom.innerText})).join("")}(t):function(t,e){return N(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(e,t)}))}),t)})),e.on("BeforeSetContent",(function(t){!0===t.selection&&!0===t.paste&&m.from(e.dom.getParent(e.selection.getStart(),"th,td")).each((function(n){var i=Rt.fromDom(n);nn(i).each((function(n){var u,a,c,s=M((u=t.content,(a=document.createElement("div")).innerHTML=u,le(Rt.fromDom(a))),(function(t){return"meta"!==Yt(t)}));if(1===s.length&&(c=s[0],"table"===Yt(c))){t.preventDefault();var l=Rt.fromDom(e.getDoc()),f=Er(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(i,s[0],f);r.pasteCells(n,d).each((function(t){e.selection.setRng(t),e.focus(),o.clear(n)}))}}))}))}))}(e,r,a,u),function(t,e,n){var r=function(e){return function(){return t.execCommand(e)}},o=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},i={text:"Table properties",onSetup:e.onSetupTable,onAction:r("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:r("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:e.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}),!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",i),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}}),t.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter"}}),t.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}}),t.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold((function(){return""}),(function(t){return"caption"===Yt(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}})}(e,o,c),function(t,e,n){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})}(e,o,c),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(e),e.on("PreInit",(function(){e.serializer.addTempAttr(zr.firstSelected),e.serializer.addTempAttr(zr.lastSelected),function(t){t.formatter.register(xs)}(e)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(e)&&e.on("keydown",(function(t){!function(t,e,n){if(t.keyCode===nl.TAB){var r=Tu(e),o=function(t){var e=Yt(t);return Dt(t,r)||_(al,e)},i=e.selection.getRng();if(i.collapsed){var u=Rt.fromDom(i.startContainer);Ze(u,o).each((function(r){t.preventDefault(),(t.shiftKey?ol:rl)(e,o,r,n).each((function(t){e.selection.setRng(t)}))}))}}}(t,e,a)})),e.on("remove",(function(){i.destroy()})),function(t,e,n,r){return{insertTable:jc(t),setClipboardRows:Vc(e.setRows),getClipboardRows:Fc(e.getRows),setClipboardCols:Vc(e.setColumns),getClipboardCols:Fc(e.getColumns),resizeHandler:n,selectionTargets:r}}(e,c,i,o)}))}()},397:(t,e,n)=>{n(2738)},2738:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(){},u=function(t){return function(){return t}},a=function(t){return t},c=u(!1),s=u(!0),l=function(){return f},f=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:l,each:i,bind:l,exists:c,forall:s,filter:l,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),d=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=g("string"),p=g("object"),v=g("array"),b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(t,e){return n=t,r=e,y.call(n,r)>-1;var n,r},x=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},C=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},S=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},k=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},O=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},T=Object.keys,_=Object.hasOwnProperty,E=(function(t){if(!v(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};C(t,(function(r,o){var i=T(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!v(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=T(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!O(e,(function(t){return w(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}}))}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var e=[],n=[];return C(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}),A=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:u(t),getOrThunk:u(t),getOrDie:u(t),or:function(e){return A(t)},orThunk:function(e){return A(t)},fold:function(e,n){return n(t)},map:function(e){return A(e(t))},mapError:function(e){return A(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},N=function(t){return{is:c,isValue:c,isError:s,getOr:a,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return N(t)},mapError:function(e){return N(e(t))},each:i,bind:function(e){return N(t)},exists:c,forall:s,toOptional:m.none}},R={value:A,error:N,fromOption:function(t,e){return t.fold((function(){return N(e)}),A)}},M=function(t){return"inline-command"===t.type||"inline-format"===t.type},z=function(t){return"block-command"===t.type||"block-format"===t.type},D=function(t){return e=t,n=function(t,e){return t.start.length===e.start.length?0:t.start.length>e.start.length?-1:1},(r=b.call(e,0)).sort(n),r;var e,n,r},B=function(t){var e=function(e){return R.error({message:e,pattern:t})},n=function(n,r,o){if(void 0!==t.format){var i=void 0;if(v(t.format)){if(!O(t.format,h))return e(n+" pattern has non-string items in the `format` array");i=t.format}else{if(!h(t.format))return e(n+" pattern has non-string `format` parameter");i=[t.format]}return R.value(r(i))}return void 0!==t.cmd?h(t.cmd)?R.value(o(t.cmd,t.value)):e(n+" pattern has non-string `cmd` parameter"):e(n+" pattern is missing both `format` and `cmd` parameters")};if(!p(t))return e("Raw pattern is not an object");if(!h(t.start))return e("Raw pattern is missing `start` parameter");if(void 0!==t.end){if(!h(t.end))return e("Inline pattern has non-string `end` parameter");if(0===t.start.length&&0===t.end.length)return e("Inline pattern has empty `start` and `end` parameters");var r=t.start,o=t.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(t){return{type:"inline-format",start:r,end:o,format:t}}),(function(t,e){return{type:"inline-command",start:r,end:o,cmd:t,value:e}}))}return void 0!==t.replacement?h(t.replacement)?0===t.start.length?e("Replacement pattern has empty `start` parameter"):R.value({type:"inline-command",start:"",end:t.start,cmd:"mceInsertContent",value:t.replacement}):e("Replacement pattern has non-string `replacement` parameter"):0===t.start.length?e("Block pattern has empty `start` parameter"):n("Block",(function(e){return{type:"block-format",start:t.start,format:e[0]}}),(function(e,n){return{type:"block-command",start:t.start,cmd:e,value:n}}))},P=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},I=function(t){return{inlinePatterns:S(t,M),blockPatterns:D(S(t,z))}},L="undefined"!=typeof window?window:Function("return this;")(),H=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=L.console;n&&(n.error?n.error.apply(n,t):n.log.apply(n,t))},F=[{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"}],V=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},j=tinymce.util.Tools.resolve("tinymce.util.Delay"),U=tinymce.util.Tools.resolve("tinymce.util.VK"),W=tinymce.util.Tools.resolve("tinymce.util.Tools"),q=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),G=function(t,e){return{container:t,offset:e}},X=function(t){return t.nodeType===Node.TEXT_NODE},K=function(t,e,n){if(e&&t.isEmpty(e)&&!n(e)){var r=e.parentNode;t.remove(e),K(t,r,n)}},Y=function(t,e,n,r){void 0===r&&(r=!0);var o=e.startContainer.parentNode,i=e.endContainer.parentNode;e.deleteContents(),r&&!n(e.startContainer)&&(X(e.startContainer)&&0===e.startContainer.data.length&&t.remove(e.startContainer),X(e.endContainer)&&0===e.endContainer.data.length&&t.remove(e.endContainer),K(t,o,n),o!==i&&K(t,i,n))},J=function(t,e){var n,r=e.get(t);return v(r)&&(n=r,function(t,e){return 0<t.length?m.some(t[0]):m.none()}(n)).exists((function(t){return e=t,"block",_.call(e,"block");var e}))},Q=function(t){return 0===t.start.length},Z=function(t,e){var n=m.from(t.dom.getParent(e.startContainer,t.dom.isBlock));return""===V(t)?n.orThunk((function(){return m.some(t.getBody())})):n},tt=q.DOM,et=function(t){return function(e){return t===e?-1:0}},nt=function(t,e,n){if(X(t)&&e>=0)return m.some(G(t,e));var r=$(tt);return m.from(r.backwards(t,e,et(t),n)).map((function(t){return G(t.container,t.container.data.length)}))},rt=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e>=0&&e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.backwards(t,e,et(t),n)).bind((function(t){var r=t.container.data;return rt(t.container,e+r.length,n)}))},ot=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.forwards(t,e,et(t),n)).bind((function(t){return ot(t.container,e-r.length,n)}))},it=function(t,e,n){if(X(e)&&(n<0||n>e.data.length))return[];for(var r=[n],o=e;o!==t&&o.parentNode;){for(var i=o.parentNode,u=0;u<i.childNodes.length;u++)if(i.childNodes[u]===o){r.push(u);break}o=i}return o===t?r.reverse():[]},ut=function(t,e,n,r,o){return{start:it(t,e,n),end:it(t,r,o)}},at=function(t,e){var n,r,o,i=e.slice(),u=i.pop();return(n=i,r=function(t,e){return t.bind((function(t){return m.from(t.childNodes[e])}))},o=m.some(t),C(n,(function(t){o=r(o,t)})),o).bind((function(t){return X(t)&&(u<0||u>t.data.length)?m.none():m.some({node:t,offset:u})}))},ct=function(t,e){return at(t,e.start).bind((function(n){var r=n.node,o=n.offset;return at(t,e.end).map((function(t){var e=t.node,n=t.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(e,n),i}))}))},st=function(t,e,n){(function(t,e,n){if(X(t)&&0>=t.length)return m.some(G(t,0));var r=$(tt);return m.from(r.forwards(t,0,et(t),n)).map((function(t){return G(t.container,0)}))})(e,0,e).each((function(r){var o=r.container;ot(o,n.start.length,e).each((function(n){var r=t.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Y(t,r,(function(t){return t===e}))}))}))},lt=function(t,e){var n=t.dom,r=t.selection.getRng();return Z(t,r).filter((function(e){var r=V(t),o=""===r&&n.is(e,"body")||n.is(e,r);return null!==e&&o})).bind((function(t){var r=t.textContent;return function(t,e){var n=e.replace(" "," ");return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,(function(t){return 0===e.indexOf(t.start)||0===n.indexOf(t.start)}),c)}(e,r).map((function(e){return W.trim(r).length===e.start.length?[]:[{pattern:e,range:ut(n.getRoot(),t,0,t,0)}]}))})).getOr([])},ft=0,dt=function(t,e){return t.create("span",{"data-mce-type":"bookmark",id:e})},mt=function(t,e){var n=t.createRng();return n.setStartAfter(e.start),n.setEndBefore(e.end),n},gt=function(t,e,n){var r=ct(t.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,u=0===r.endOffset?i:i.splitText(r.endOffset),a=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:e,end:u.parentNode.insertBefore(dt(t,e+"-end"),u),start:a.parentNode.insertBefore(dt(t,e+"-start"),a)}},ht=function(t,e,n){K(t,t.get(e.prefix+"-end"),n),K(t,t.get(e.prefix+"-start"),n)},pt=function(t,e,n,r){var o,i=e.start;return function(t,e,n,r,o){var i=$(t,function(t){return function(e){return t.isBlock(e)||w(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}}(t));return m.from(i.backwards(e,n,r,o))}(t,r.container,r.offset,(o=i,function(t,e){var n=t.data.substring(0,e),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=t.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),m.some(o)}var u=r.offset-i.length;return rt(r.container,u,n).map((function(e){var n=t.createRng();return n.setStart(e.container,e.offset),n.setEnd(r.container,r.offset),n})).filter((function(t){return t.toString()===i})).orThunk((function(){return pt(t,e,n,G(r.container,0))}))}))},vt=function(t,e,n){var r=t.dom,o=r.getRoot(),i=n.pattern,u=n.position.container,a=n.position.offset;return rt(u,a-n.pattern.end.length,e).bind((function(c){var s=ut(o,c.container,c.offset,u,a);if(Q(i))return m.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=bt(t,n.remainingPatterns,c.container,c.offset,e),f=l.getOr({matches:[],position:c}),d=f.position;return function(t,e,n,r,o,i){if(void 0===i&&(i=!1),0===e.start.length&&!i){var u=t.createRng();return u.setStart(n,r),u.setEnd(n,r),m.some(u)}return nt(n,r,o).bind((function(n){return pt(t,e,o,n).bind((function(t){if(i){if(t.endContainer===n.container&&t.endOffset===n.offset)return m.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return m.none()}return m.some(t)}))}))}(r,i,d.container,d.offset,e,l.isNone()).map((function(t){var e=function(t,e){return ut(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}(o,t);return{matches:f.matches.concat([{pattern:i,startRng:e,endRng:s}]),position:G(t.startContainer,t.startOffset)}}))}))},bt=function(t,e,n,r,o){var i=t.dom;return nt(n,r,i.getRoot()).bind((function(u){var a=i.createRng();a.setStart(o,0),a.setEnd(n,r);for(var c,s,l=a.toString(),f=0;f<e.length;f++){var d=e[f];if(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(c=l,s=d.end,c.length-s.length)){var g=e.slice();g.splice(f,1);var h=vt(t,o,{pattern:d,remainingPatterns:g,position:u});if(h.isSome())return h}}return m.none()}))},yt=function(t,e,n){t.selection.setRng(n),"inline-format"===e.type?C(e.format,(function(e){t.formatter.apply(e)})):t.execCommand(e.cmd,!1,e.value)},wt=function(t,e,n){var r=t.selection.getRng();return!1===r.collapsed?[]:Z(t,r).bind((function(o){var i=r.startOffset-(n?1:0);return bt(t,e,r.startContainer,i,o)})).fold((function(){return[]}),(function(t){return t.matches}))},xt=function(t,e){if(0!==e.length){var n=t.dom,r=t.selection.getBookmark(),i=function(t,e){var n,r=(n=(new Date).getTime(),"mce_textpattern_"+Math.floor(1e9*Math.random())+ ++ft+String(n)),i=k(e,(function(e,n){var i=gt(t,r+"_end"+e.length,n.endRng);return e.concat([o(o({},n),{endMarker:i})])}),[]);return k(i,(function(e,n){var u=i.length-e.length-1,a=Q(n.pattern)?n.endMarker:gt(t,r+"_start"+u,n.startRng);return e.concat([o(o({},n),{startMarker:a})])}),[])}(n,e);C(i,(function(e){var r=n.getParent(e.startMarker.start,n.isBlock),o=function(t){return t===r};Q(e.pattern)?function(t,e,n,r){var o=mt(t.dom,n);Y(t.dom,o,r),yt(t,e,o)}(t,e.pattern,e.endMarker,o):function(t,e,n,r,o){var i=t.dom,u=mt(i,r),a=mt(i,n);Y(i,a,o),Y(i,u,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=mt(i,c);yt(t,e,s)}(t,e.pattern,e.startMarker,e.endMarker,o),ht(n,e.endMarker,o),ht(n,e.startMarker,o)})),t.selection.moveToBookmark(r)}},Ct=function(t,e){var n=wt(t,e.inlinePatterns,!0);n.length>0&&t.undoManager.transact((function(){xt(t,n)}))},St=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0},kt=function(t,e){var n=[",",".",";",":","!","?"],r=[32];t.on("keydown",(function(n){13!==n.keyCode||U.modifierPressed(n)||function(t,e){if(!t.selection.isCollapsed())return!1;var n=wt(t,e.inlinePatterns,!1),r=lt(t,e.blockPatterns);return(r.length>0||n.length>0)&&(t.undoManager.add(),t.undoManager.extra((function(){t.execCommand("mceInsertNewLine")}),(function(){t.insertContent("\ufeff"),xt(t,n),function(t,e){if(0!==e.length){var n=t.selection.getBookmark();C(e,(function(e){return function(t,e){var n=t.dom,r=e.pattern,o=ct(n.getRoot(),e.range).getOrDie("Unable to resolve path range");return Z(t,o).each((function(e){"block-format"===r.type?J(r.format,t.formatter)&&t.undoManager.transact((function(){st(t.dom,e,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((function(){st(t.dom,e,r),t.execCommand(r.cmd,!1,r.value)}))})),!0}(t,e)})),t.selection.moveToBookmark(n)}}(t,r);var e=t.selection.getRng(),o=nt(e.startContainer,e.startOffset,t.dom.getRoot());t.execCommand("mceInsertNewLine"),o.each((function(e){var n=e.container;"\ufeff"===n.data.charAt(e.offset-1)&&(n.deleteData(e.offset-1,1),K(t.dom,n.parentNode,(function(e){return e===t.dom.getRoot()})))}))})),!0)}(t,e.get())&&n.preventDefault()}),!0),t.on("keyup",(function(n){St(r,n,(function(t,e){return t===e.keyCode&&!1===U.modifierPressed(e)}))&&Ct(t,e.get())})),t.on("keypress",(function(r){St(n,r,(function(t,e){return t.charCodeAt(0)===e.charCode}))&&j.setEditorTimeout(t,(function(){Ct(t,e.get())}))}))};r.add("textpattern",(function(t){var e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(function(t){var e=t.getParam("textpattern_patterns",F,"array");if(!v(e))return H("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=E(x(e,B));return C(n.errors,(function(t){return H(t.message,t.pattern)})),I(n.values)}(t));return kt(t,e),function(t){return{setPatterns:function(e){var n=E(x(e,B));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}t.set(I(n.values))},getPatterns:function(){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}(x(t.get().inlinePatterns,P),x(t.get().blockPatterns,P))}}}(e)}))}()},3356:(t,e,n)=>{n(3562)},3562:()=>{!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp("[-'\\.‘’․﹒'.]"),new RegExp("[:··״‧︓﹕:]"),new RegExp("[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]"),new RegExp("[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]"),new RegExp("\\r"),new RegExp("\\n"),new RegExp("[\v\f \u2028\u2029]"),new RegExp("[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]"),new RegExp("[-឴឵---\ufeff-]"),new RegExp("[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]"),new RegExp("[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]"),new RegExp("@")],i=new RegExp("^[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]$"),u=o,a=function(t){for(var e=13,n=u.length,r=0;r<n;++r){var o=u[r];if(o&&o.test(t)){e=r;break}}return e},c=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(0===n&&0===r)return!1;var o=t[e+2];if(0===n&&(2===r||1===r||12===r)&&0===o)return!1;var i=t[e-1];return(2!==n&&1!==n&&12!==r||0!==r||0!==i)&&(4!==n&&0!==n||4!==r&&0!==r)&&(3!==n&&1!==n||4!==r||4!==i)&&(4!==n||3!==r&&1!==r||4!==o)&&8!==n&&9!==n&&8!==i&&9!==i&&8!==r&&9!==r&&(5!==n||6!==r)&&(7===n||5===n||6===n||7===r||5===r||6===r||(10!==n||10!==r)&&(11!==r||0!==n&&4!==n&&10!==n&&11!==n)&&(11!==n||0!==r&&4!==r&&10!==r)&&12!==n)},s=/^\s+$/,l=i,f=function(t){return"http"===t||"https"===t},d=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],u=0;u<t.length;u++){var d=e(t[u]);"\ufeff"!==d&&(o.push(t[u]),i.push(d))}return function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),c(n,u)){var a=e[u];if((r.includeWhitespace||!s.test(a))&&(r.includePunctuation||!l.test(a))){var d=u-i.length+1,m=u+1,g=e.slice(d,m).join("");if(f(g)){var h=(y=void 0,y=function(t,e){var n;for(n=e;n<t.length&&!s.test(t[n]);n++);return n}(v=e,(b=u)+1),"://"===v.slice(b+1,y).join("").substr(0,3)?y:b),p=t.slice(m,h);Array.prototype.push.apply(i,p),u=h}o.push(i)}i=[]}var v,b,y;return o}(o,i,function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(i,(m=a,g={},function(t){if(g[t])return g[t];var e=m(t);return g[t]=e,e})),n);var m,g},m=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),g=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],u="",a=new m(t,t);t=a.next();)3===t.nodeType?u+=t.data.replace(/\uFEFF/g,""):o(t)&&u.length&&(i.push(u),u="");return u.length&&i.push(u),i},h=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},p=function(t,e){var r=g(t,e).join("\n");return d(r.split(""),n).length},v=function(t,e){var n=g(t,e).join("");return h(n)},b=function(t,e){var n=g(t,e).join("").replace(/\s/g,"");return h(n)},y=function(t,e){return function(){return e(t.getBody(),t.schema)}},w=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},x=function(t){return y(t,p)},C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)},k=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};void 0===t&&(t=300),e.add("wordcount",(function(e){var n=function(t){return{body:{getWordCount:x(t),getCharacterCount:y(t,v),getCharacterCountWithoutSpaces:y(t,b)},selection:{getWordCount:w(t,p),getCharacterCount:w(t,v),getCharacterCountWithoutSpaces:w(t,b)},getCount:x(t)}}(e);return function(t,e){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return k(t,e)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return k(t,e)}})}(e,n),function(t,e,n){var r=C.debounce((function(){return S(t,e)}),n);t.on("init",(function(){S(t,e),C.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)}),0)}))}(e,n,t),n}))}()},5187:(t,e,n)=>{var r={"./content/dark/content.css":2968,"./content/dark/content.min.css":6202,"./content/default/content.css":7286,"./content/default/content.min.css":7362,"./content/document/content.css":287,"./content/document/content.min.css":2271,"./content/writer/content.css":5417,"./content/writer/content.min.css":874,"./ui/oxide-dark/content.css":3341,"./ui/oxide-dark/content.inline.css":8786,"./ui/oxide-dark/content.inline.min.css":4243,"./ui/oxide-dark/content.min.css":9702,"./ui/oxide-dark/content.mobile.css":1389,"./ui/oxide-dark/content.mobile.min.css":3513,"./ui/oxide-dark/fonts/tinymce-mobile.woff":1064,"./ui/oxide-dark/skin.css":8057,"./ui/oxide-dark/skin.min.css":6332,"./ui/oxide-dark/skin.mobile.css":4429,"./ui/oxide-dark/skin.mobile.min.css":18,"./ui/oxide-dark/skin.shadowdom.css":7899,"./ui/oxide-dark/skin.shadowdom.min.css":7548,"./ui/oxide/content.css":9506,"./ui/oxide/content.inline.css":8273,"./ui/oxide/content.inline.min.css":7251,"./ui/oxide/content.min.css":6122,"./ui/oxide/content.mobile.css":993,"./ui/oxide/content.mobile.min.css":8215,"./ui/oxide/fonts/tinymce-mobile.woff":9916,"./ui/oxide/skin.css":8382,"./ui/oxide/skin.min.css":4522,"./ui/oxide/skin.mobile.css":108,"./ui/oxide/skin.mobile.min.css":8537,"./ui/oxide/skin.shadowdom.css":818,"./ui/oxide/skin.shadowdom.min.css":6913};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=5187},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(){},e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},r=function(t){return function(){return t}},o=function(t){return t};function i(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var u=function(t){return function(e){return!t(e)}},a=function(t){return function(){throw new Error(t)}},c=r(!1),s=r(!0),l=tinymce.util.Tools.resolve("tinymce.ThemeManager"),f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var g,h,p,v,b=function(){return y},y=(h=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:v=function(t){return t},getOrThunk:p=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:v,orThunk:p,map:b,each:t,bind:b,exists:c,forall:s,filter:b,equals:h,equals_:h,toArray:function(){return[]},toString:r("none()")}),w=function(t){var e=r(t),n=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=C("string"),O=C("object"),T=C("array"),_=S("boolean"),E=function(t){return void 0===t},A=function(t){return!function(t){return null==t}(t)},N=S("function"),R=S("number"),M=function(t,e){if(T(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},z=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,P=function(t,e){return D.call(t,e)},I=function(t,e){return P(t,e)>-1},L=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},H=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},F=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=z.call(t,r,r+e);n.push(o)}return n},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,c)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!T(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},Y=function(t,e){return K(V(t,e))},J=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},Q=function(t){var e=z.call(t,0);return e.reverse(),e},Z=function(t,e){return W(t,(function(t){return!I(e,t)}))},tt=function(t,e){var n=z.call(t,0);return n.sort(e),n},et=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},nt=function(t){return et(t,0)},rt=function(t){return et(t,t.length-1)},ot=N(Array.from)?Array.from:function(t){return z.call(t)},it=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},ut=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:r(t),getOrThunk:r(t),getOrDie:r(t),or:function(e){return ut(t)},orThunk:function(e){return ut(t)},fold:function(e,n){return n(t)},map:function(e){return ut(e(t))},mapError:function(e){return ut(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},at=function(e){return{is:c,isValue:c,isError:s,getOr:o,getOrThunk:function(t){return t()},getOrDie:function(){return a(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return at(e)},mapError:function(t){return at(t(e))},each:t,bind:function(t){return at(e)},exists:c,forall:s,toOptional:x.none}},ct={value:ut,error:at,fromOption:function(t,e){return t.fold((function(){return at(e)}),ut)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(g||(g={}));var st=function(t,e,n){return t.stype===g.Error?e(t.serror):n(t.svalue)},lt=function(t){return{stype:g.Value,svalue:t}},ft=function(t){return{stype:g.Error,serror:t}},dt=lt,mt=function(t){var e=[],n=[];return j(t,(function(t){st(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},gt=ft,ht=function(t,e){return t.stype===g.Value?e(t.svalue):t},pt=function(t,e){return t.stype===g.Value?{stype:g.Value,svalue:e(t.svalue)}:t},vt=Object.keys,bt=Object.hasOwnProperty,yt=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},wt=function(t,e){return xt(t,(function(t,n){return{k:n,v:e(t,n)}}))},xt=function(t,e){var n={};return yt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ct=function(t,e){var n=[];return yt(t,(function(t,r){n.push(e(t,r))})),n},St=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return x.some(u)}return x.none()},kt=function(t){return Ct(t,(function(t){return t}))},Ot=function(t,e){return Tt(t,e)?x.from(t[e]):x.none()},Tt=function(t,e){return bt.call(t,e)},_t=function(t,e){return Tt(t,e)&&void 0!==t[e]&&null!==t[e]},Et=function(t){if(!T(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=vt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!T(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=vt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!J(e,(function(t){return I(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},At=Object.prototype.hasOwnProperty,Nt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)At.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Rt=Nt((function(t,e){return O(t)&&O(e)?Rt(t,e):e})),Mt=Nt((function(t,e){return e})),zt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Dt=Et([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Bt=function(t){return Dt.defaultedThunk(r(t))},Pt=Dt.strict,It=Dt.asOption,Lt=Dt.defaultedThunk,Ht=(Dt.asDefaultedOptionThunk,Dt.mergeWithThunk),Ft=(Et([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){var n;return(n={})[t]=e,n}),Vt=function(t,e){return Ft(t,e)},jt=function(t){return function(t){var e={};return j(t,(function(t){e[t.key]=t.value})),e}(t)},Ut=function(t){return e(gt,K)(t)},Wt=function(t){var e=mt(t);return e.errors.length>0?Ut(e.errors):dt(e.values)},qt=function(t){return O(t)&&vt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},$t=function(t,e){return gt([{path:t,getErrorInfo:e}])},Gt=Et([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Xt=function(t,e,n){var r=Ot(t,e).fold((function(){return n(t)}),o);return dt(r)},Kt=function(t,e,n,o){return n.fold((function(n,i,u,a){var c=function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(t))}))},s=function(e){return e.fold((function(){var t=Ft(i,o(x.none()));return dt(t)}),(function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(x.some(t)))}))}))};return u.fold((function(){return ht(function(t,e,n){return Ot(e,n).fold((function(){return function(t,e,n){return $t(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+qt(n)}))}(t,n,e)}),dt)}(t,e,n),c)}),(function(t){return ht(Xt(e,n,t),c)}),(function(){return ht(function(t,e){return dt(Ot(t,e))}(e,n),s)}),(function(t){return ht(function(t,e,n){var r=Ot(t,e).map((function(e){return!0===e?n(t):e}));return dt(r)}(e,n,t),s)}),(function(t){var o=t(e),i=pt(Xt(e,n,r({})),(function(t){return Rt(o,t)}));return ht(i,c)}))}),(function(t,n){var r=n(e);return dt(Ft(t,o(r)))}))},Yt=function(t){return{extract:function(e,n,r){return o=t(r,n),i=function(t){return function(t,e){return $t(t,(function(){return e}))}(e,t)},o.stype===g.Error?i(o.serror):o;var o,i},toString:function(){return"val"}}},Jt=function(e){return vt(function(e,n){var r={};return function(t,e,n,r){yt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r}(e,(function(t){return null!=t})))},Qt=function(t){var e=Zt(t),n=q(t,(function(t,e){return e.fold((function(e){return Rt(t,Vt(e,!0))}),r(t))}),{});return{extract:function(t,r,o){var i=_(o)?[]:Jt(o),u=W(i,(function(t){return!_t(n,t)}));return 0===u.length?e.extract(t,r,o):function(t,e){return $t(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,u)},toString:e.toString}},Zt=function(t){return{extract:function(e,n,r){return function(t,e,n,r){return function(t,e){var n=mt(t);return n.errors.length>0?Ut(n.errors):function(t,e){return t.length>0?dt(Rt(e,Mt.apply(void 0,t))):dt(e)}(n.values,e)}(V(n,(function(n){return Kt(t,e,n,r)})),{})}(e,r,t,n)},toString:function(){return"obj{\n"+V(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},te=function(t){return{extract:function(e,n,r){var o=V(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return Wt(o)},toString:function(){return"array("+t.toString()+")"}}},ee=function(t){return{extract:function(e,n,r){for(var o=[],i=0,u=t;i<u.length;i++){var a=u[i].extract(e,n,r);if(a.stype===g.Value)return a;o.push(a)}return Wt(o)},toString:function(){return"oneOf("+V(t,(function(t){return t.toString()})).join(", ")+")"}}},ne=r(Yt(dt)),re=e(te,Zt),oe=Gt.state,ie=Gt.field,ue=function(t,e){return{extract:function(n,r,o){return Ot(o,t).fold((function(){return function(t,e){return $t(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return function(t,e,n,r,o){return Ot(r,o).fold((function(){return function(t,e,n){return $t(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+qt(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))}(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+vt(e)}}},ae=Yt(dt),ce=function(t){return re(t)},se=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}},le=function(t){return Yt((function(e){return t(e).fold(gt,dt)}))},fe=function(t,e){return function(t,e){return{extract:function(n,r,i){var u=vt(i),a=function(e,n){return te(Yt(t)).extract(e,o,n)}(n,u);return ht(a,(function(t){var o=V(t,(function(t){return Gt.field(t,t,Pt(),e)}));return Zt(o).extract(n,r,i)}))},toString:function(){return"setOf("+e.toString()+")"}}}((function(e){return t(e).fold(ft,lt)}),e)},de=function(t,e,n){return r=function(t,e,n,r){return function(t,e){return t.stype===g.Error?{stype:g.Error,serror:e(t.serror)}:t}(e.extract([t],n,r),(function(t){return{input:r,errors:t}}))}(t,e,o,n),st(r,ct.error,ct.value);var r},me=function(t){return t.fold((function(t){throw new Error(he(t))}),o)},ge=function(t,e,n){return me(de(t,e,n))},he=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,V(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+qt(t.input);var e,n},pe=function(t,e){return ue(t,e)},ve=function(t,e){return ue(t,wt(e,Zt))},be=r(ae),ye=function(t,e){return Yt((function(n){var r=typeof n;return t(n)?dt(n):gt("Expected type: "+e+" but got: "+r)}))},we=ye(R,"number"),xe=ye(k,"string"),Ce=ye(_,"boolean"),Se=ye(N,"function"),ke=function(t){var e=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every((function(e){return ke(t[e])}));case"Map":return e(t.keys(),ke)&&e(t.values(),ke);case"Set":return e(t.keys(),ke);default:return!1}},Oe=Yt((function(t){return ke(t)?dt(t):gt("Expected value to be acceptable for sending via postMessage")})),Te=function(t){return le((function(e){return I(t,e)?ct.value(e):ct.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},_e=function(t){return ie(t,t,Pt(),ne())},Ee=function(t,e){return ie(t,t,Pt(),e)},Ae=function(t){return Ee(t,we)},Ne=function(t){return Ee(t,xe)},Re=function(t,e){return ie(t,t,Pt(),Te(e))},Me=function(t){return Ee(t,Se)},ze=function(t,e){return ie(t,t,Pt(),Zt(e))},De=function(t,e){return ie(t,t,Pt(),re(e))},Be=function(t,e){return ie(t,t,Pt(),te(e))},Pe=function(t){return ie(t,t,It(),ne())},Ie=function(t,e){return ie(t,t,It(),e)},Le=function(t){return Ie(t,we)},He=function(t){return Ie(t,xe)},Fe=function(t){return Ie(t,Se)},Ve=function(t,e){return Ie(t,Zt(e))},je=function(t,e){return ie(t,t,Bt(e),ne())},Ue=function(t,e,n){return ie(t,t,Bt(e),n)},We=function(t,e){return Ue(t,e,we)},qe=function(t,e){return Ue(t,e,xe)},$e=function(t,e,n){return Ue(t,e,Te(n))},Ge=function(t,e){return Ue(t,e,Ce)},Xe=function(t,e){return Ue(t,e,Se)},Ke=function(t,e,n){return Ue(t,e,te(n))},Ye=function(t,e,n){return Ue(t,e,Zt(n))},Je=function(t,e){return oe(t,e)},Qe=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Ze=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},tn=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ze(n.childNodes[0])},en=function(t,e){var n=(e||document).createElement(t);return Ze(n)},nn=function(t,e){var n=(e||document).createTextNode(t);return Ze(n)},rn=Ze,on=function(){return un(0,0)},un=function(t,e){return{major:t,minor:e}},an=function(t,e){var n=String(e).toLowerCase();return 0===t.length?on():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return un(r(1),r(2))}(t,n)},cn=on,sn=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},ln=function(t,e){return-1!==t.indexOf(e)},fn=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,t.length-e.length)},dn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),mn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,gn=function(t){return function(e){return ln(e,t)}},hn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ln(t,"edge/")&&ln(t,"chrome")&&ln(t,"safari")&&ln(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,mn],search:function(t){return ln(t,"chrome")&&!ln(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ln(t,"msie")||ln(t,"trident")}},{name:"Opera",versionRegexes:[mn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:gn("firefox")},{name:"Safari",versionRegexes:[mn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ln(t,"safari")||ln(t,"mobile/"))&&ln(t,"applewebkit")}}],pn=[{name:"Windows",search:gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ln(t,"iphone")||ln(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:gn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:gn("linux"),versionRegexes:[]},{name:"Solaris",search:gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:gn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:gn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],vn={browsers:r(hn),oses:r(pn)},bn="Edge",yn="Chrome",wn="Opera",xn="Firefox",Cn="Safari",Sn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(bn),isChrome:r(yn),isIE:r("IE"),isOpera:r(wn),isFirefox:r(xn),isSafari:r(Cn)}},kn=function(){return Sn({current:void 0,version:cn()})},On=Sn,Tn=(r(bn),r(yn),r("IE"),r(wn),r(xn),r(Cn),"Windows"),_n="Android",En="Linux",An="Solaris",Nn="FreeBSD",Rn="ChromeOS",Mn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Tn),isiOS:r("iOS"),isAndroid:r(_n),isOSX:r("OSX"),isLinux:r(En),isSolaris:r(An),isFreeBSD:r(Nn),isChromeOS:r(Rn)}},zn=function(){return Mn({current:void 0,version:cn()})},Dn=Mn,Bn=(r(Tn),r("iOS"),r(_n),r(En),r("OSX"),r(An),r(Nn),r(Rn),function(t,e){var n=vn.browsers(),o=vn.oses(),i=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(kn,On),u=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(zn,Dn),a=function(t,e,n,o){var i=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:r(i),isiPhone:r(u),isTablet:r(s),isPhone:r(l),isTouch:r(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:r(f),isDesktop:r(d)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}}),Pn=function(t){return window.matchMedia(t).matches},In=zt((function(){return Bn(navigator.userAgent,Pn)})),Ln=function(){return In()},Hn=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Fn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Vn=function(t,e){return t.dom===e.dom},jn=function(t,e){return Ln().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Un=function(t){return N(t)?t:c},Wn=function(t,e,n){for(var r=t.dom,o=Un(n);r.parentNode;){r=r.parentNode;var i=rn(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()},qn=function(t,e,n){var r=e(t),o=Un(n);return r.orThunk((function(){return o(t)?x.none():Wn(t,e,o)}))},$n=function(t,e){return Vn(t.element,e.event.target)},Gn=function(e){if(!_t(e,"can")&&!_t(e,"abort")&&!_t(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return ge("Extracting event.handler",Qt([je("can",s),je("abort",c),je("run",t)]),e)},Xn=r,Kn=Xn("touchstart"),Yn=Xn("touchmove"),Jn=Xn("touchend"),Qn=Xn("touchcancel"),Zn=Xn("mousedown"),tr=Xn("mousemove"),er=Xn("mouseout"),nr=Xn("mouseup"),rr=Xn("mouseover"),or=Xn("focusin"),ir=Xn("focusout"),ur=Xn("keydown"),ar=Xn("keyup"),cr=Xn("input"),sr=Xn("change"),lr=Xn("click"),fr=Xn("transitionend"),dr=Xn("selectstart"),mr=function(t){return r("alloy."+t)},gr={tap:mr("tap")},hr=mr("focus"),pr=mr("blur.post"),vr=mr("paste.post"),br=mr("receive"),yr=mr("execute"),wr=mr("focus.item"),xr=gr.tap,Cr=mr("longpress"),Sr=mr("sandbox.close"),kr=mr("typeahead.cancel"),Or=mr("system.init"),Tr=mr("system.touchmove"),_r=mr("system.touchend"),Er=mr("system.scroll"),Ar=mr("system.resize"),Nr=mr("system.attached"),Rr=mr("system.detached"),Mr=mr("system.dismissRequested"),zr=mr("system.repositionRequested"),Dr=mr("focusmanager.shifted"),Br=mr("slotcontainer.visibility"),Pr=mr("change.tab"),Ir=mr("dismiss.tab"),Lr=mr("highlight"),Hr=mr("dehighlight"),Fr=function(t,e){Wr(t,t.element,e,{})},Vr=function(t,e,n){Wr(t,t.element,e,n)},jr=function(t){Fr(t,yr())},Ur=function(t,e,n){Wr(t,e,n,{})},Wr=function(t,e,n,r){var o=f({target:e},r);t.getSystem().triggerEvent(n,e,o)},qr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},$r=function(t){return jt(t)},Gr=function(t,e){return{key:t,value:Gn({abort:e})}},Xr=function(t){return{key:t,value:Gn({run:function(t,e){e.event.prevent()}})}},Kr=function(t,e){return{key:t,value:Gn({run:e})}},Yr=function(t,e,n){return{key:t,value:Gn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Jr=function(t){return function(e){return{key:t,value:Gn({run:function(t,n){$n(t,n)&&e(t,n)}})}}},Qr=function(t,e,n){return function(t,e){return Kr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){qr(e,e.element,t,r)}))}))}(t,e.partUids[n])},Zr=function(t,e){return Kr(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).fold((function(){return qn(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),c).getOr(t)}),(function(t){return t}));e(t,o,n)}))},to=function(t){return Kr(t,(function(t,e){e.cut()}))},eo=function(t){return Kr(t,(function(t,e){e.stop()}))},no=function(t,e){return Jr(t)(e)},ro=Jr(Nr()),oo=Jr(Rr()),io=Jr(Or()),uo=function(t){return function(e){return Kr(t,e)}}(yr()),ao=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),co=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},so=co(1),lo=co(3),fo=co(9),mo=co(11),go=function(t){return rn(t.dom.ownerDocument)},ho=function(t){return fo(t)?t:go(t)},po=function(t){return rn(ho(t).dom.documentElement)},vo=function(t){return rn(ho(t).dom.defaultView)},bo=function(t){return x.from(t.dom.parentNode).map(rn)},yo=function(t){return x.from(t.dom.offsetParent).map(rn)},wo=function(t){return V(t.dom.childNodes,rn)},xo=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rn)},Co=function(t,e){bo(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},So=function(t,e){(function(t){return x.from(t.dom.nextSibling).map(rn)})(t).fold((function(){bo(t).each((function(t){Oo(t,e)}))}),(function(t){Co(t,e)}))},ko=function(t,e){(function(t){return xo(t,0)})(t).fold((function(){Oo(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Oo=function(t,e){t.dom.appendChild(e.dom)},To=function(t,e){j(e,(function(e){Oo(t,e)}))},_o=function(t){t.dom.textContent="",j(wo(t),(function(t){Eo(t)}))},Eo=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ao=function(t){var e,n=wo(t);n.length>0&&(e=t,j(n,(function(t){Co(e,t)}))),Eo(t)},No=function(t){return t.dom.innerHTML},Ro=function(t,e){var n,r,o=go(t).dom,i=rn(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,wo(rn(r)));To(i,u),_o(t),Oo(t,i)},Mo=function(t,e,n){if(!(k(n)||_(n)||R(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},zo=function(t,e,n){Mo(t.dom,e,n)},Do=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Bo=function(t,e){return x.from(Do(t,e))},Po=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Io=function(t,e){t.dom.removeAttribute(e)},Lo=function(t){return function(t){var e=en("div"),n=rn(t.dom.cloneNode(!0));return Oo(e,n),No(e)}(function(t){return function(t,e){return rn(t.dom.cloneNode(!1))}(t)}(t))},Ho=function(t){return Lo(t)},Fo=$r([function(t,e){return{key:t,value:Gn({can:function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return Vn(e,t.element)&&!Vn(e,n)}(t,r,o)||(console.warn(hr()+" did not get interpreted by the desired target. \nOriginator: "+Ho(r)+"\nTarget: "+Ho(o)+"\nCheck the "+hr()+" event handlers"),!1)}})}}(hr())]),Vo=Object.freeze({__proto__:null,events:Fo}),jo=0,Uo=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++jo+String(e)},Wo=r("alloy-id-"),qo=r("data-alloy-id"),$o=Wo(),Go=qo(),Xo=function(t,e){Object.defineProperty(t.dom,Go,{value:e,writable:!0})},Ko=function(t){var e=so(t)?t.dom[Go]:null;return x.from(e)},Yo=function(t){return Uo(t)},Jo=o,Qo=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Ho(t().element)+" is not in context.":""))}};return{debugInfo:r("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:c}},Zo=Qo(),ti=function(t){return V(t,(function(t){return fn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},ei=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(i)}},t},ni=Uo("alloy-premade"),ri=function(t){return Vt(ni,t)},oi=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ti(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,m([e.getApis(),e],n))}),t)},ii={init:function(){return ui({readState:function(){return"No State required"}})}},ui=function(t){return t},ai=function(t,e){var n={};return yt(t,(function(t,r){yt(t,(function(t,o){var i=Ot(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},ci=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},si=function(t){return t.cHandler},li=function(t,e){return{name:t,handler:e}},fi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=tt(n,(function(e,n){var o=e.name,i=n.name,u=r.indexOf(o),a=r.indexOf(i);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));return u<a?-1:a<u?1:0}));return ct.value(o)}catch(t){return ct.error([t])}}("Event: "+n,0,t,r).map((function(t){return function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return Gn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,(function(t){t.run.apply(void 0,e)}))}})}(V(t,(function(t){return t.handler})))})):function(t,e){return ct.error(["The event ("+t+') 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(V(e,(function(t){return t.name})),null,2)])}(n,t)},di=function(t,e){var n,o,i,u=Ct(t,(function(t,n){return(1===t.length?ct.value(t[0].handler):fi(t,e,n)).map((function(o){var i=function(t){var e=function(t){return N(t)?{can:r(!0),abort:r(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}}(o),u=t.length>1?W(e[n],(function(e){return L(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Vt(n,function(t,e){return{handler:t,purpose:e}}(i,u))}))}));return n={},(i=function(t){var e=[],n=[];return j(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(u)).errors.length>0?(o=i.errors,ct.error(K(o))):function(t,e){return 0===t.length?ct.value(e):ct.value(Rt(e,Mt.apply(void 0,t)))}(i.values,n)},mi="alloy.base.behaviour",gi=function(t){return t.events},hi=function(t,e){var n=Do(t,e);return void 0===n||""===n?[]:n.split(" ")},pi=function(t){return void 0!==t.dom.classList},vi=function(t,e){pi(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=hi(t,e).concat([n]);zo(t,e,r.join(" "))})(t,"class",e)}(t,e)},bi=function(t,e){pi(t)?t.dom.classList.remove(e):function(t,e){(function(t,e,n){var r=W(hi(t,e),(function(t){return t!==n}));r.length>0?zo(t,e,r.join(" ")):Io(t,e)})(t,"class",e)}(t,e),function(t){0===(pi(t)?t.dom.classList:function(t){return hi(t,"class")}(t)).length&&Io(t,"class")}(t)},yi=function(t,e){return pi(t)&&t.dom.classList.contains(e)},wi=function(t,e){j(e,(function(e){vi(t,e)}))},xi=function(t,e){j(e,(function(e){bi(t,e)}))},Ci=function(t){return void 0!==t.style&&N(t.style.getPropertyValue)},Si=function(t){return mo(t)},ki=N(Element.prototype.attachShadow)&&N(Node.prototype.getRootNode),Oi=r(ki),Ti=ki?function(t){return rn(t.dom.getRootNode())}:ho,_i=function(t){return Si(t)?t:rn(ho(t).dom.body)},Ei=function(t){var e=Ti(t);return Si(e)?x.some(e):x.none()},Ai=function(t){return rn(t.dom.host)},Ni=function(t){var e=lo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Ei(rn(e)).fold((function(){return o.body.contains(e)}),(n=Ni,r=Ai,function(t){return n(r(t))}))},Ri=function(){return Mi(rn(document))},Mi=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return rn(e)},zi=function(t,e,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ci(t)&&t.style.setProperty(e,n)},Di=function(t,e){Ci(t)&&t.style.removeProperty(e)},Bi=function(t,e,n){var r=t.dom;zi(r,e,n)},Pi=function(t,e){var n=t.dom;yt(e,(function(t,e){zi(n,e,t)}))},Ii=function(t,e){var n=t.dom;yt(e,(function(t,e){t.fold((function(){Di(n,e)}),(function(t){zi(n,e,t)}))}))},Li=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ni(t)?r:Hi(n,e)},Hi=function(t,e){return Ci(t)?t.style.getPropertyValue(e):""},Fi=function(t,e){var n=t.dom,r=Hi(n,e);return x.from(r).filter((function(t){return t.length>0}))},Vi=function(t){var e={},n=t.dom;if(Ci(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},ji=function(t,e,n){var r=en(t);return Bi(r,e,n),Fi(r,e).isSome()},Ui=function(t,e){var n=t.dom;Di(n,e),Bo(t,"style").map(dn).is("")&&Io(t,"style")},Wi=function(t){return t.dom.offsetWidth},qi=function(t){return t.dom.value},$i=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Gi=function(t){return function(t,e){return function(t,e){var n=V(e,(function(t){return Ve(t.name(),[_e("config"),je("state",ii)])})),r=de("component.behaviours",Zt(n),t.behaviours).fold((function(e){throw new Error(he(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:wt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)}(t,function(t){var e=Ot(t,"behaviours").getOr({}),n=W(vt(e),(function(t){return void 0!==e[t]}));return V(n,(function(t){return e[t].me}))}(t))},Xi=function(t,e,n){var r={"alloy.base.behaviour":gi(t)};return function(t,e,n,r){var o=function(t,e,n){var r=f(f({},n),function(t,e){var n={};return j(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return ai(r,li)}(t,n,r);return di(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ki=function(t){var e=function(){return d},n=Qe(Zo),o=me(function(t){var e,n;return de("custom.definition",Zt([ie("dom","dom",Pt(),Zt([_e("tag"),je("styles",{}),je("classes",[]),je("attributes",{}),Pe("value"),Pe("innerHtml")])),_e("components"),_e("uid"),je("events",{}),je("apis",{}),ie("eventOrder","eventOrder",(e={},e[yr()]=["disabling",mi,"toggling","typeaheadevents"],e[hr()]=[mi,"focusing","keying"],e[Or()]=[mi,"disabling","toggling","representing"],e[cr()]=[mi,"representing","streaming","invalidating"],e[Rr()]=[mi,"representing","item-events","tooltipping"],e[Zn()]=["focusing",mi,"item-type-events"],e[Kn()]=["focusing",mi,"item-type-events"],e[rr()]=["item-type-events","tooltipping"],e[br()]=["receiving","reflecting","tooltipping"],n=e,Dt.mergeWithThunk(r(n))),be()),Pe("domModification")]),t)}(t)),i=Gi(t),u=function(t){return t.list}(i),a=function(t){return t.data}(i),c=function(t){var e=en(t.tag);!function(t,e){var n=t.dom;yt(e,(function(t,e){Mo(n,e,t)}))}(e,t.attributes),wi(e,t.classes),Pi(e,t.styles),t.innerHtml.each((function(t){return Ro(e,t)}));var n=t.domChildren;return To(e,n),t.value.each((function(t){$i(e,t)})),t.uid,Xo(e,t.uid),e}(function(t,e,n){var r,o,i,u=f(f({},(r=t).dom),{uid:r.uid,domChildren:V(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return ci({})}),ci)}(t),c={"alloy.base.modification":a};return i=e.length>0?function(t,e,n,r){var o=f({},e);j(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=ai(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return q(t,(function(t,e){return f(f({},e.modification),t)}),{})},a=q(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return ci({classes:a,attributes:c,styles:s})}(n,c,e,u):a,f(f({},o=u),{attributes:f(f({},o.attributes),i.attributes),styles:f(f({},o.styles),i.styles),classes:o.classes.concat(i.classes)})}(o,u,a)),s=Xi(o,u,a),l=Qe(o.components),d={getSystem:n.get,config:function(e){var n=a;return(N(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return N(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Qo(e))},element:c,syncComponents:function(){var t=wo(c),e=Y(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));l.set(e)},components:l.get,events:s};return d},Yi=function(t){var e=nn(t);return Ji({element:e})},Ji=function(e){var n=ge("external.component",Qt([_e("element"),Pe("uid")]),e),o=Qe(Qo());n.uid.each((function(t){Xo(n.element,t)}));var i={getSystem:o.get,config:x.none,hasConfigured:c,connect:function(t){o.set(t)},disconnect:function(){o.set(Qo((function(){return i})))},getApis:function(){return{}},element:n.element,spec:e,readState:r("No state"),syncComponents:t,components:r([]),events:{}};return ri(i)},Qi=Yo,Zi=function(t){return function(t){return Ot(t,ni)}(t).fold((function(){return function(t){var e=Jo(t),n=e.events,r=d(e,["events"]),o=function(t){var e=Ot(t,"components").getOr([]);return V(e,Zi)}(r),i=f(f({},r),{events:f(f({},Vo),n),components:o});return ct.value(Ki(i))}(t.hasOwnProperty("uid")?t:f({uid:Qi("")},t)).getOrDie()}),(function(t){return t}))},tu=ri;function eu(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Li(n,t);return parseFloat(o)||0}return r},r=function(t,e){return $(e,(function(e,n){var r=Li(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!R(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ci(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var nu=eu("height",(function(t){var e=t.dom;return Ni(t)?e.getBoundingClientRect().height:e.offsetHeight})),ru=function(t){return nu.get(t)},ou=function(t){return nu.getOuter(t)},iu=function(t,e){return{left:t,top:e,translate:function(n,r){return iu(t+n,e+r)}}},uu=iu,au=function(t,e){return void 0!==t?t:void 0!==e?e:0},cu=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return uu(n.offsetLeft,n.offsetTop);var i=au(null==r?void 0:r.pageYOffset,o.scrollTop),u=au(null==r?void 0:r.pageXOffset,o.scrollLeft),a=au(o.clientTop,n.clientTop),c=au(o.clientLeft,n.clientLeft);return su(t).translate(u-c,i-a)},su=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?uu(n.offsetLeft,n.offsetTop):Ni(t)?function(t){var e=t.getBoundingClientRect();return uu(e.left,e.top)}(e):uu(0,0)},lu=eu("width",(function(t){return t.dom.offsetWidth})),fu=function(t){return lu.get(t)},du=function(t){return lu.getOuter(t)},mu=function(t){var n=rn(function(t){if(Oi()&&A(t.target)){var e=rn(t.target);if(so(e)&&function(t){return A(t.dom.shadowRoot)}(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return nt(n)}}return x.from(t.target)}(t).getOr(t.target)),r=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=e(o,r);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(n,t.clientX,t.clientY,r,o,i,t)},gu=function(t,e,n,r,o){var u=function(t,e){return function(n){t(n)&&e(mu(n))}}(n,r);return t.dom.addEventListener(e,u,o),{unbind:i(hu,t,e,u,o)}},hu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},pu=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return uu(n,r)},vu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},bu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},yu=function(t){var e=void 0===t?window:t,n=e.document,r=pu(rn(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return bu(r.left,r.top,n,o)}),(function(t){return bu(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},wu=function(t,e){return t.view(e).fold(r([]),(function(e){var n=t.owner(e),r=wu(t,n);return[e].concat(r)}))},xu=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(rn)},owner:function(t){return go(t)}}),Cu=function(t){var e=rn(document),n=pu(e);return function(t,e){var n=e.owner(t),r=wu(e,n);return x.some(r)}(t,xu).fold(i(cu,t),(function(e){var r=su(t),o=q(e,(function(t,e){var n=su(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return uu(o.left+r.left+n.left,o.top+r.top+n.top)}))},Su=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ku=function(t){var e=cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Ou=function(t){var e=Cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Tu=function(){return yu(window)};function _u(t,e,n,r,o){return t(n,r)?x.some(n):N(o)&&o(n)?x.none():e(n,r,o)}var Eu,Au=function(t,e,n){for(var r=t.dom,o=N(n)?n:c;r.parentNode;){r=r.parentNode;var i=rn(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},Nu=function(t,e,n){return _u((function(t,e){return e(t)}),Au,t,e,n)},Ru=function(t,e,n){return Nu(t,e,n).isSome()},Mu=function(t,e,n){return Au(t,(function(t){return Hn(t,e)}),n)},zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?x.none():x.from(n.querySelector(t)).map(rn)}(e,t)},Du=function(t,e,n){return _u((function(t,e){return Hn(t,e)}),Mu,t,e,n)},Bu=function(){var t=Uo("aria-owns");return{id:t,link:function(e){zo(e,"aria-owns",t)},unlink:function(t){Io(t,"aria-owns")}}},Pu=function(t,e){return Ru(e,(function(e){return Vn(e,t.element)}),c)||function(t,e){return function(t){return Nu(t,(function(t){if(!so(t))return!1;var e=Do(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Do(t,"id"),n=Ti(t);return zu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return Pu(t,e)}))}(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Eu||(Eu={}));var Iu,Lu=Qe({}),Hu=["alloy/data/Fields","alloy/debugging/Debugging"],Fu=function(t,e,n){return function(t,e,n){switch(Ot(Lu.get(),t).orThunk((function(){var e=vt(Lu.get());return it(e,(function(e){return t.indexOf(e)>-1?x.some(Lu.get()[e]):x.none()}))})).getOr(Eu.NORMAL)){case Eu.NORMAL:return n(Vu());case Eu.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();I(["mousemove","mouseover","mouseout",Or()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:V(n,(function(t){return I(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ho(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case Eu.STOP:return!0}}(t,e,n)},Vu=r({logEventCut:t,logEventStopped:t,logNoParent:t,logEventNoHandlers:t,logEventResponse:t,write:t}),ju=r([_e("menu"),_e("selectedMenu")]),Uu=r([_e("item"),_e("selectedItem")]),Wu=(r(Zt(Uu().concat(ju()))),r(Zt(Uu()))),qu=ze("initSize",[_e("numColumns"),_e("numRows")]),$u=function(){return ze("markers",[_e("backgroundMenu")].concat(ju()).concat(Uu()))},Gu=function(t){return ze("markers",V(t,_e))},Xu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");G(e,(function(t){return t.indexOf("alloy")>0&&!L(Hu,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),ie(e,e,n,le((function(t){return ct.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},Ku=function(e){return Xu(0,e,Bt(t))},Yu=function(t){return Xu(0,t,Bt(x.none))},Ju=function(t){return Xu(0,t,Pt())},Qu=function(t){return Xu(0,t,Pt())},Zu=function(t,e){return Je(t,r(e))},ta=function(t){return Je(t,o)},ea=r(qu),na=function(t,e,n,r,o,i){return{x:t,y:e,bubble:n,direction:r,boundsRestriction:o,label:i}},ra=Et([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),oa=ra.southeast,ia=ra.southwest,ua=ra.northeast,aa=ra.northwest,ca=ra.south,sa=ra.north,la=ra.east,fa=ra.west,da=function(t,e){return function(n,r){for(var o={},i=0,u=n.length;i<u;i++){var a=n[i];o[String(a)]=Ot(e,a).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}return o}(["left","right","top","bottom"])},ma=function(t){return t.x},ga=function(t,e){return t.x+t.width/2-e.width/2},ha=function(t,e){return t.x+t.width-e.width},pa=function(t,e){return t.y-e.height},va=function(t){return t.y+t.height},ba=function(t,e){return t.y+t.height/2-e.height/2},ya=function(t,e,n){return na(ma(t),va(t),n.southeast(),oa(),da(t,{left:1,top:3}),"layout-se")},wa=function(t,e,n){return na(ha(t,e),va(t),n.southwest(),ia(),da(t,{right:0,top:3}),"layout-sw")},xa=function(t,e,n){return na(ma(t),pa(t,e),n.northeast(),ua(),da(t,{left:1,bottom:2}),"layout-ne")},Ca=function(t,e,n){return na(ha(t,e),pa(t,e),n.northwest(),aa(),da(t,{right:0,bottom:2}),"layout-nw")},Sa=function(t,e,n){return na(ga(t,e),pa(t,e),n.north(),sa(),da(t,{bottom:2}),"layout-n")},ka=function(t,e,n){return na(ga(t,e),va(t),n.south(),ca(),da(t,{top:3}),"layout-s")},Oa=function(t,e,n){return na(function(t){return t.x+t.width}(t),ba(t,e),n.east(),la(),da(t,{left:0}),"layout-e")},Ta=function(t,e,n){return na(function(t,e){return t.x-e.width}(t,e),ba(t,e),n.west(),fa(),da(t,{right:1}),"layout-w")},_a=function(){return[ya,wa,xa,Ca,ka,Sa,Oa,Ta]},Ea=function(){return[wa,ya,Ca,xa,ka,Sa,Oa,Ta]},Aa=function(){return[xa,Ca,ya,wa,Sa,ka]},Na=function(){return[Ca,xa,wa,ya,Sa,ka]},Ra=function(){return[ya,wa,xa,Ca,ka,Sa]},Ma=function(){return[wa,ya,Ca,xa,ka,Sa]},za=Object.freeze({__proto__:null,events:function(t){return $r([Kr(br(),(function(e,n){var r=t.channels,o=vt(r),i=n,u=function(t,e){return e.universal?t:W(t,(function(t){return I(e.channels,t)}))}(o,i);j(u,(function(t){var n=r[t],o=n.schema,u=ge("channel["+t+"] data\nReceiver: "+Ho(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),Da=[Ee("channels",fe(ct.value,Qt([Ju("onReceive"),je("schema",be())])))],Ba=function(t,e,n){return io((function(r,o){n(r,t,e)}))},Pa=function(t){return{key:t,value:void 0}},Ia=function(t,e,n,o,u,a,c){var s=function(t){return _t(t,n)?t[n]():x.none()},l=wt(u,(function(t,e){return function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(u.slice(0,1).concat(u.slice(3)))}},t}((function(o){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:r(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[o,t.config,t.state].concat(n))}))}),n,e)}(n,t,e)})),d=wt(a,(function(t,e){return ei(t,e)})),m=f(f(f({},d),l),{revoke:i(Pa,n),config:function(e){var r=ge(n+"-config",t,e);return{key:n,value:{config:r,me:m,configAsRaw:zt((function(){return ge(n+"-config",t,e)})),initialConfig:e,state:c}}},schema:function(){return e},exhibit:function(t,e){return s(t).bind((function(t){return Ot(o,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(ci({}))},name:function(){return n},handlers:function(t){return s(t).map((function(t){return Ot(o,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return m},La=function(t){return jt(t)},Ha=Qt([_e("fields"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),Fa=function(t){var e=ge("Creating behaviour: "+t.name,Ha,t);return function(t,e,n,r,o,i){var u,a=Qt(t),c=Ve(e,[("config",u=t,Ie("config",Qt(u)))]);return Ia(a,c,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Va=Qt([_e("branchKey"),_e("branches"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),ja=function(t){var e=ge("Creating behaviour: "+t.name,Va,t);return function(t,e,n,r,o,i){var u=t,a=Ve(e,[Ie("config",t)]);return Ia(u,a,e,n,r,o,i)}(ve(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Ua=r(void 0),Wa=Fa({fields:Da,name:"receiving",active:za}),qa=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),$a=function(t){return t.dom.focus()},Ga=function(t){return void 0===t&&(t=rn(document)),x.from(t.dom.activeElement).map(rn)},Xa=function(t){return Ga(Ti(t)).filter((function(e){return t.dom.contains(e.dom)}))},Ka=function(e,n){var r=Ti(n),o=Ga(r).bind((function(t){var e,r,o=function(e){return Vn(t,e)};return o(n)?x.some(n):(e=o,(r=function(t){for(var n=0;n<t.childNodes.length;n++){var o=rn(t.childNodes[n]);if(e(o))return x.some(o);var i=r(t.childNodes[n]);if(i.isSome())return i}return x.none()})(n.dom))})),i=e(n);return o.each((function(e){Ga(r).filter((function(t){return Vn(t,e)})).fold((function(){$a(e)}),t)})),i},Ya=function(t,e,n,r,o){return{position:t,left:e,top:n,right:r,bottom:o}},Ja=function(t,e){var n=function(t){return t+"px"};Ii(t,{position:x.some(e.position),left:e.left.map(n),top:e.top.map(n),right:e.right.map(n),bottom:e.bottom.map(n)})},Qa=Et([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Za=function(t,e,n,r,o,i){var u=e.x-n,a=e.y-r,c=o-(u+e.width),s=i-(a+e.height),l=x.some(u),f=x.some(a),d=x.some(c),m=x.some(s),g=x.none();return e.direction.fold((function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,g,g,d,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}))},tc=function(t,e){var n=i(Cu,e),r=t.fold(n,n,(function(){var t=pu();return Cu(e).translate(-t.left,-t.top)})),o=du(e),u=ou(e);return Su(r.left,r.top,o,u)},ec=function(t,e){return e.fold((function(){return t.fold(Tu,Tu,Su)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=nc(t,n.x,n.y);return Su(r.left,r.top,n.width,n.height)}))}))},nc=function(t,e,n){var o=uu(e,n);return t.fold(r(o),r(o),(function(){var t=pu();return o.translate(-t.left,-t.top)}))},rc=(Qa.none,Qa.relative),oc=Qa.fixed,ic=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},uc=function(t,e,n){return Math.min(Math.max(t,e),n)},ac=Et([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),cc=function(t,e,n,u){Ui(e,"max-height"),Ui(e,"max-width");var a,c={width:du(a=e),height:ou(a)};return function(t,e,n,u,a){var c=n.width,s=n.height,l=function(t,i,l,f){return function(t,e,n,i){var u=t.x,a=t.y,c=t.bubble.offset,s=c.left,l=c.top,f=function(t,e,n){var r=function(t,r){var i="top"===t||"bottom"===t?n.top:n.left;return Ot(e,t).bind(o).bind((function(e){return"left"===t||"top"===t?e>=r?x.some(e):x.none():e<=r?x.some(e):x.none()})).map((function(t){return t+i})).getOr(r)},i=r("left",t.x),u=r("top",t.y),a=r("right",t.right),c=r("bottom",t.bottom);return Su(i,u,a-i,c-u)}(i,t.boundsRestriction,c),d=f.y,m=f.bottom,g=f.x,h=f.right,p=a+l,v=function(t,e,n,r,o){var i=o.x,u=o.y,a=o.width,c=o.height,s=t>=i,l=e>=u,f=s&&l,d=t+n<=i+a&&e+r<=u+c,m=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),g=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),h=Math.max(o.x,o.right-n),p=Math.max(o.y,o.bottom-r);return{originInBounds:f,sizeInBounds:d,limitX:uc(t,o.x,h),limitY:uc(e,o.y,p),deltaW:m,deltaH:g}}(u+s,p,e,n,f),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,C=v.limitY,S=v.deltaW,k=v.deltaH,O=r(C+k-d),T=r(m-C),_=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction,T,T,O),E=r(w+S-g),A=r(h-w),N={x:w,y:C,width:S,height:k,maxHeight:_,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction,A,A,E),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:p};return b&&y?ac.fit(N):ac.nofit(N,S,k)}(t(e,n,u),c,s,a).fold(ac.fit,(function(t,e,n){return n>f||e>l?ac.nofit(t,e,n):ac.nofit(i,l,f)}))};return $(t,(function(t,e){var n=i(l,e);return t.fold(ac.fit,n)}),ac.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:oa(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(o,o)}(u.preference,t,c,n,u.bounds)},sc=function(t,e){!function(t,e){var n=nu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Bi(t,"max-height",n+"px")}(t,Math.floor(e))},lc=r((function(t,e){sc(t,e),Pi(t,{"overflow-x":"hidden","overflow-y":"auto"})})),fc=r((function(t,e){sc(t,e)})),dc=function(t,e,n){return void 0===t[e]?n:t[e]},mc=function(t,e,n,r){var o=cc(t,e,n,r);(function(t,e,n){Ja(t,function(t,e){return t.fold((function(){return Ya("absolute",x.some(e.x),x.some(e.y),x.none(),x.none())}),(function(t,n,r,o){return Za("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Za("fixed",e,t,n,r,o)}))}(n.origin,e))})(e,o,r),function(t,e){var n=e.classes;xi(t,n.off),wi(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r)},gc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],hc=function(t,e,n){var r=function(t){return Ot(n,t).getOr([])},o=function(t,e,n){var o=Z(gc,n);return{offset:uu(t,e),classesOn:Y(n,r),classesOff:Y(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},pc=function(){return hc(0,0,{})},vc=function(t,e){return function(n){return"rtl"===bc(n)?e:t}},bc=function(t){return"rtl"===Li(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Iu||(Iu={}));var yc="data-alloy-vertical-dir",wc=function(t){return Ru(t,(function(t){return so(t)&&Do(t,"data-alloy-vertical-dir")===Iu.BottomToTop}))},xc=function(){return Ve("layouts",[_e("onLtr"),_e("onRtl"),Pe("onBottomLtr"),Pe("onBottomRtl")])},Cc=function(t,e,n,r,o,i,u){var a=u.map(wc).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return vc(l,f)(t)},Sc=[_e("hotspot"),Pe("bubble"),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=e.hotspot,o=tc(n,r.element),i=Cc(t.element,e,Ra(),Ma(),Aa(),Na(),x.some(e.hotspot.element));return x.some({anchorBox:o,bubble:e.bubble.getOr(pc()),overrides:e.overrides,layouts:i,placer:x.none()})}))],kc=[_e("x"),_e("y"),je("height",0),je("width",0),je("bubble",pc()),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=nc(n,e.x,e.y),o=Su(r.left,r.top,e.width,e.height),i=Cc(t.element,e,_a(),Ea(),_a(),Ea(),x.none());return x.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:x.none()})}))],Oc=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Tc=Et([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_c=(Tc.before,Tc.on,Tc.after,function(t){return t.fold(o,o,o)}),Ec=Et([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ac={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(t){return Ec.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return rn(t.startContainer)},relative:function(t,e){return _c(t)},exact:function(t,e,n,r){return t}})}(t);return vo(e)},range:Oc},Nc=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rc=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Mc=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zc=Et([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Dc=function(t,e,n){return e(rn(n.startContainer),n.startOffset,rn(n.endContainer),n.endOffset)};zc.ltr,zc.rtl;var Bc,Pc=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(lo),Ic=function(t){return Pc.getOption(t)},Lc=["img","br"],Hc=function(t){return Ic(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||I(Lc,ao(t))},Fc=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?[]:V(n.querySelectorAll(t),rn)}(e,t)},Vc=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return x.some(Oc(rn(e.startContainer),e.startOffset,rn(n.endContainer),n.endOffset))}return x.none()},jc=function(t){if(null===t.anchorNode||null===t.focusNode)return Vc(t);var e=rn(t.anchorNode),n=rn(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=go(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Vn(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?x.some(Oc(e,t.anchorOffset,n,t.focusOffset)):Vc(t)},Uc=function(t,e){return n=function(t,e){return function(t,e){return n=function(t,e){return e.match({domRange:function(t){return{ltr:r(t),rtl:x.none}},relative:function(e,n){return{ltr:zt((function(){return Nc(t,e,n)})),rtl:zt((function(){return x.some(Nc(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:zt((function(){return Rc(t,e,n,r,o)})),rtl:zt((function(){return x.some(Rc(t,r,o,e,n))}))}}})}(t,e),(o=n.ltr()).collapsed?n.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zc.rtl(rn(t.endContainer),t.endOffset,rn(t.startContainer),t.startOffset)})).getOrThunk((function(){return Dc(0,zc.ltr,o)})):Dc(0,zc.ltr,o);var n,o}(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e),o=n.getClientRects(),(i=o.length>0?o[0]:n.getBoundingClientRect()).width>0||i.height>0?x.some(i).map(Mc):x.none();var n,o,i},Wc=function(t,e){return{element:t,offset:e}},qc=Et([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$c=function(t){return t.fold(o,(function(t,e,n){return t.translate(-e,-n)}))},Gc=function(t){return t.fold(o,o)},Xc=function(t){return $(t,(function(t,e){return t.translate(e.left,e.top)}),uu(0,0))},Kc=function(t){var e=V(t,Gc);return Xc(e)},Yc=qc.screen,Jc=qc.absolute,Qc=function(t,e,n){var r=go(t.element),o=pu(r),i=function(t,e,n){var r=vo(n.root).dom;return x.from(r.frameElement).map(rn).filter((function(e){var n=go(e),r=go(t.element);return Vn(n,r)})).map(cu)}(t,0,n).getOr(o);return Jc(i,o.left,o.top)},Zc=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=Yc(uu(o,i));return x.some(function(t,e,n){return{point:t,width:e,height:n}}(c,u,a))},ts=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c,s,l,f,d=[e,t.point],m=(i=function(){return Kc(d)},u=function(){return Kc(d)},a=function(){return function(t){var e=V(t,$c);return Xc(e)}(d)},r.fold(i,u,a)),g=(c=m.left,s=m.top,l=t.width,f=t.height,{x:c,y:s,width:l,height:f}),h=n.showAbove?Aa():Ra(),p=n.showAbove?Na():Ma(),v=Cc(o,n,h,p,h,p,x.none());return{anchorBox:g,bubble:n.bubble.getOr(pc()),overrides:n.overrides,layouts:v,placer:x.none()}}))},es=function(t,e){return lo(t)?Wc(t,e):function(t,e){var n=wo(t);if(0===n.length)return Wc(t,e);if(e<n.length)return Wc(n[e],0);var r=n[n.length-1],o=lo(r)?function(t){return Pc.get(t)}(r).length:wo(r).length;return Wc(r,o)}(t,e)},ns=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return function(t){return function(t){return x.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(jc)}(t)}}))().map((function(t){var e=es(t.start,t.soffset),n=es(t.finish,t.foffset);return Ac.range(e.element,e.offset,n.element,n.offset)}))},rs=[Pe("getSelection"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=vo(e.root).dom,o=Qc(t,0,e),i=ns(r,e).bind((function(t){return Uc(r,Ac.exactFromRange(t)).orThunk((function(){var e=nn("\ufeff");return Co(t.start,e),Uc(r,Ac.exact(e,0,e,1)).map((function(t){return Eo(e),t}))})).bind((function(t){return Zc(t.left,t.top,t.width,t.height)}))})),u=ns(r,e).bind((function(t){return so(t.start)?x.some(t.start):function(t){return bo(t)}(t.start)})).getOr(t.element);return ts(i,o,e,n,u)}))],os=[_e("node"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=Qc(t,0,e);return e.node.bind((function(o){var i=o.dom.getBoundingClientRect(),u=Zc(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return ts(u,r,e,n,a)}))}))],is=function(t){return t.x+t.width},us=function(t,e){return t.x-e.width},as=function(t,e){return t.y-e.height+t.height},cs=function(t){return t.y},ss=function(t,e,n){return na(is(t),cs(t),n.southeast(),oa(),da(t,{left:0,top:2}),"link-layout-se")},ls=function(t,e,n){return na(us(t,e),cs(t),n.southwest(),ia(),da(t,{right:1,top:2}),"link-layout-sw")},fs=function(t,e,n){return na(is(t),as(t,e),n.northeast(),ua(),da(t,{left:0,bottom:3}),"link-layout-ne")},ds=function(t,e,n){return na(us(t,e),as(t,e),n.northwest(),aa(),da(t,{right:1,bottom:3}),"link-layout-nw")},ms=function(){return[ss,ls,fs,ds]},gs=function(){return[ls,ss,ds,fs]},hs=[_e("item"),xc(),je("overrides",{}),Zu("placement",(function(t,e,n){var r=tc(n,e.item.element),o=Cc(t.element,e,ms(),gs(),ms(),gs(),x.none());return x.some({anchorBox:r,bubble:pc(),overrides:e.overrides,layouts:o,placer:x.none()})}))],ps=ve("anchor",{selection:rs,node:os,hotspot:Sc,submenu:hs,makeshift:kc}),vs=function(e,n,r,o,i){!function(e,n,r,o,i,u){var a=dc(u,"maxHeightFunction",lc()),c=dc(u,"maxWidthFunction",t),s=e.anchorBox,l=e.origin,f={bounds:ec(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};mc(s,n,r,f)}(function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)}(r.anchorBox,n),i.element,r.bubble,r.layouts,o,r.overrides)},bs=function(t,e,n,r,o,i){var u=i.map(ku);return ys(t,e,n,r,o,u)},ys=function(t,e,n,o,i,u){var a=ge("positioning anchor.info",ps,o);Ka((function(){Bi(i.element,"position","fixed");var n=Fi(i.element,"visibility");Bi(i.element,"visibility","hidden");var o,c=e.useFixed()?(o=document.documentElement,oc(0,0,o.clientWidth,o.clientHeight)):function(t){var e=cu(t.element),n=t.element.dom.getBoundingClientRect();return rc(e.left,e.top,n.width,n.height)}(t),s=a.placement,l=u.map(r).or(e.getBounds);s(t,a,c).each((function(e){e.placer.getOr(vs)(t,c,e,l,i)})),n.fold((function(){Ui(i.element,"visibility")}),(function(t){Bi(i.element,"visibility",t)})),Fi(i.element,"left").isNone()&&Fi(i.element,"top").isNone()&&Fi(i.element,"right").isNone()&&Fi(i.element,"bottom").isNone()&&Fi(i.element,"position").is("fixed")&&Ui(i.element,"position")}),i.element)},ws=Object.freeze({__proto__:null,position:function(t,e,n,r,o){bs(t,e,n,r,o,x.none())},positionWithin:bs,positionWithinBounds:ys,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),xs=[je("useFixed",c),Pe("getBounds")],Cs=Fa({fields:xs,name:"positioning",active:qa,apis:ws}),Ss=function(t){Fr(t,Rr());var e=t.components();j(e,Ss)},ks=function(t){var e=t.components();j(e,ks),Fr(t,Nr())},Os=function(t,e){Oo(t.element,e.element)},Ts=function(t,e){var n=t.components();!function(t){j(t.components(),(function(t){return Eo(t.element)})),_o(t.element),t.syncComponents()}(t);var r=Z(n,e);j(r,(function(e){Ss(e),t.getSystem().removeFromWorld(e)})),j(e,(function(e){e.getSystem().isConnected()?Os(t,e):(t.getSystem().addToWorld(e),Os(t,e),Ni(t.element)&&ks(e)),t.syncComponents()}))},_s=function(t,e){Es(t,e,Oo)},Es=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ni(t.element)&&ks(e),t.syncComponents()},As=function(t){Ss(t),Eo(t.element),t.getSystem().removeFromWorld(t)},Ns=function(t){var e=bo(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));As(t),e.each((function(t){t.syncComponents()}))},Rs=function(t){var e=t.components();j(e,As),_o(t.element),t.syncComponents()},Ms=function(t,e){zs(t,e,Oo)},zs=function(t,e,n){n(t,e.element);var r=wo(e.element);j(r,(function(t){e.getByDom(t).each(ks)}))},Ds=function(t){var e=wo(t.element);j(e,(function(e){t.getByDom(e).each(Ss)})),Eo(t.element)},Bs=function(t,e,n,r){n.get().each((function(e){Rs(t)}));var o=e.getAttachPoint(t);_s(o,t);var i=t.getSystem().build(r);return _s(t,i),n.set(i),i},Ps=function(t,e,n,r){var o=Bs(t,e,n,r);return e.onOpen(t,o),o},Is=function(t,e,n){n.get().each((function(r){Rs(t),Ns(t),e.onClose(t,r),n.clear()}))},Ls=function(t,e,n){return n.isOpen()},Hs=function(t,e,n){var r=e.getAttachPoint(t);Bi(t.element,"position",Cs.getMode(r)),function(t,e,n,r){Fi(t.element,e).fold((function(){Io(t.element,n)}),(function(e){zo(t.element,n,e)})),Bi(t.element,e,"hidden")}(t,"visibility",e.cloakVisibilityAttr)},Fs=function(t,e,n){(function(t){return L(["top","left","right","bottom"],(function(e){return Fi(t,e).isSome()}))})(t.element)||Ui(t.element,"position"),function(t,e,n){Bo(t.element,n).fold((function(){return Ui(t.element,e)}),(function(n){return Bi(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Vs=Object.freeze({__proto__:null,cloak:Hs,decloak:Fs,open:Ps,openWhileCloaked:function(t,e,n,r,o){Hs(t,e),Ps(t,e,n,r),o(),Fs(t,e)},close:Is,isOpen:Ls,isPartOf:function(t,e,n,r){return Ls(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Bs(t,e,n,r)}))}}),js=Object.freeze({__proto__:null,events:function(t,e){return $r([Kr(Sr(),(function(n,r){Is(n,t,e)}))])}}),Us=[Ku("onOpen"),Ku("onClose"),_e("isPartOf"),_e("getAttachPoint"),je("cloakVisibilityAttr","data-precloak-visibility")],Ws=Fa({fields:Us,name:"sandboxing",active:js,apis:Vs,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=r("not-implemented");return ui({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(x.none())},set:function(e){t.set(x.some(e))},get:function(){return t.get()}})}})}),qs=r("dismiss.popups"),$s=r("reposition.popups"),Gs=r("mouse.released"),Xs=Qt([je("isExtraPart",c),Ve("fireEventInstead",[je("event",Mr())])]),Ks=function(t){var e,n=ge("Dismissal",Xs,t);return(e={})[qs()]={schema:Qt([_e("target")]),onReceive:function(t,e){Ws.isOpen(t)&&(Ws.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Ws.close(t)}),(function(e){return Fr(t,e.event)})))}},e},Ys=Qt([Ve("fireEventInstead",[je("event",zr())]),Me("doReposition")]),Js=function(t){var e,n=ge("Reposition",Ys,t);return(e={})[$s()]={onReceive:function(t){Ws.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Fr(t,e.event)}))}},e},Qs=function(t,e,n){e.store.manager.onLoad(t,e,n)},Zs=function(t,e,n){e.store.manager.onUnload(t,e,n)},tl=Object.freeze({__proto__:null,onLoad:Qs,onUnload:Zs,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),el=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[ro((function(n,r){Qs(n,t,e)})),oo((function(n,r){Zs(n,t,e)}))]:[Ba(t,e,Qs)];return $r(n)}}),nl=function(){var t=Qe(null);return ui({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},rl=function(){var t=Qe({}),e=Qe({});return ui({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Ot(t.get(),n).orThunk((function(){return Ot(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};j(n,(function(t){i[t.value]=t,Ot(t,"meta").each((function(e){Ot(e,"text").each((function(e){u[e]=t}))}))})),t.set(f(f({},r),i)),e.set(f(f({},o),u))},clear:function(){t.set({}),e.set({})}})},ol=Object.freeze({__proto__:null,memory:nl,dataset:rl,manual:function(){return ui({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),il=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},ul=[Pe("initialValue"),_e("getFallbackEntry"),_e("getDataKey"),_e("setValue"),Zu("manager",{setValue:il,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){il(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:rl})],al=[_e("getValue"),je("setValue",t),Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:t,state:ii.init})],cl=[Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:nl})],sl=[Ue("store",{mode:"memory"},ve("mode",{memory:cl,manual:al,dataset:ul})),Ku("onSetValue"),je("resetOnDom",!1)],ll=Fa({fields:sl,name:"representing",active:el,apis:tl,extra:{setValueFrom:function(t,e){var n=ll.getValue(e);ll.setValue(t,n)}},state:ol}),fl=function(t,e){return Ye(t,{},V(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,ie(n,n,It(),Yt((function(t){return gt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Je("dump",o)]))},dl=function(t){return t.dump},ml=function(t,e){return f(f({},t.dump),La(e))},gl=fl,hl=ml,pl="placeholder",vl=Et([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),bl=function(t){return Tt(t,"uiType")},yl=function(t,e,n,i){return function(t,e,n,o){return bl(n)&&n.uiType===pl?function(t,e,n,o){return t.exists((function(t){return t!==n.owner}))?vl.single(!0,r(n)):Ot(o,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+vt(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,o):vl.single(!1,r(n))}(t,0,n,i).fold((function(r,o){var u=bl(n)?o(e,n.config,n.validated):o(e),a=Ot(u,"components").getOr([]),c=Y(a,(function(n){return yl(t,e,n,i)}));return[f(f({},u),{components:c})]}),(function(t,r){if(bl(n)){var i=r(e,n.config,n.validated);return n.validated.preprocess.getOr(o)(i)}return r(e)}))},wl=vl.single,xl=vl.multiple,Cl=r(pl),Sl=Et([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),kl=je("factory",{sketch:o}),Ol=je("schema",[]),Tl=_e("name"),_l=ie("pname","pname",Lt((function(t){return"<alloy."+Uo(t.name)+">"})),be()),El=Je("schema",(function(){return[Pe("preprocess")]})),Al=je("defaults",r({})),Nl=je("overrides",r({})),Rl=Zt([kl,Ol,Tl,_l,Al,Nl]),Ml=Zt([kl,Ol,Tl,Al,Nl]),zl=Zt([kl,Ol,Tl,_l,Al,Nl]),Dl=Zt([kl,El,Tl,_e("unit"),_l,Al,Nl]),Bl=function(t){return t.fold(x.some,x.none,x.some,x.some)},Pl=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Il=function(t,e){return function(n){var r=ge("Converting part type",e,n);return t(r)}},Ll=Il(Sl.required,Rl),Hl=Il(Sl.external,Ml),Fl=Il(Sl.optional,zl),Vl=Il(Sl.group,Dl),jl=r("entirety"),Ul=Object.freeze({__proto__:null,required:Ll,external:Hl,optional:Fl,group:Vl,asNamedPart:Bl,name:Pl,asCommon:function(t){return t.fold(o,o,o,o)},original:jl}),Wl=function(t,e,n,r){return Rt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},ql=function(t,e){var n={};return j(e,(function(e){Bl(e).each((function(e){var r=$l(t,e.pname);n[e.name]=function(n){var o=ge("Part: "+e.name+" in "+t,Zt(e.schema),n);return f(f({},r),{config:n,validated:o})}}))})),n},$l=function(t,e){return{uiType:Cl(),owner:t,name:e}},Gl=function(t,e,n){return{uiType:Cl(),owner:t,name:e,config:n,validated:{}}},Xl=function(t){return Y(t,(function(t){return t.fold(x.none,x.some,x.none,x.none).map((function(t){return ze(t.name,t.schema.concat([ta(jl())]))})).toArray()}))},Kl=function(t){return V(t,Pl)},Yl=function(t,e,n){return function(t,e,n){var o={},i={};return j(n,(function(t){t.fold((function(t){o[t.pname]=wl(!0,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];i[t.name]=r(t.factory.sketch(Wl(e,t,n[jl()]),n))}),(function(t){o[t.pname]=wl(!1,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){o[t.pname]=xl(!0,(function(e,n,r){var o=e[t.name];return V(o,(function(n){return t.factory.sketch(Rt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:r(o),externals:r(i)}}(0,e,n)},Jl=function(t,e,n){return function(t,e,n,o){var i=wt(o,(function(t,e){return o=t,i=!1,{name:r(n=e),required:function(){return o.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+n);return i=!0,o}};var n,o,i})),u=function(t,e,n,r){return Y(n,(function(n){return yl(t,e,n,r)}))}(t,e,n,i);return yt(i,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),u}(x.some(t),e,e.components,n)},Ql=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Zl=function(t,e,n){return Ql(t,e,n).getOrDie("Could not find part: "+n)},tf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]))})),o},ef=function(t,e){var n=t.getSystem();return wt(e.partUids,(function(t,e){return r(n.getByUid(t))}))},nf=function(t){return vt(t.partUids)},rf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]).getOrDie())})),o},of=function(t,e){var n=Kl(e);return jt(V(n,(function(e){return{key:e,value:t+"-"+e}})))},uf=function(t){return ie("partUids","partUids",Ht((function(e){return of(e.uid,t)})),be())},af=Object.freeze({__proto__:null,generate:ql,generateOne:Gl,schemas:Xl,names:Kl,substitutes:Yl,components:Jl,defaultUids:of,defaultUidsSchema:uf,getAllParts:ef,getAllPartNames:nf,getPart:Ql,getPartOrDie:Zl,getParts:tf,getPartsOrDie:rf}),cf=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[ze("parts",t)]:[]).concat([_e("uid"),je("dom",{}),je("components",[]),ta("originalSpec"),je("debug.sketcher",{})]).concat(e)}(r,o);return ge(t+" [SpecSchema]",Qt(i.concat(e)),n)},sf=function(t,e,n,r,o){var i=lf(o),u=Xl(n),a=uf(n),c=cf(t,e,i,u,[a]),s=Yl(0,c,n);return r(c,Jl(t,c,s.internals()),i,s.externals())},lf=function(t){return function(t){return Tt(t,"uid")}(t)?t:f(f({},t),{uid:Yo("uid")})},ff=Qt([_e("name"),_e("factory"),_e("configFields"),je("apis",{}),je("extraApis",{})]),df=Qt([_e("name"),_e("factory"),_e("configFields"),_e("partFields"),je("apis",{}),je("extraApis",{})]),mf=function(t){var e=ge("Sketcher for "+t.name,ff,t),n=wt(e.apis,oi),r=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=lf(r);return n(cf(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},gf=function(t){var e=ge("Sketcher for "+t.name,df,t),n=ql(e.name,e.partFields),r=wt(e.apis,oi),o=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return sf(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},hf=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},pf=function(t,e){return t?x.some(e):x.none()},vf=function(t){return"input"===ao(t)&&"radio"!==Do(t,"type")||"textarea"===ao(t)},bf=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),yf=[_e("find")],wf=Fa({fields:yf,name:"composing",apis:bf}),xf=function(t,e,n,r){var o=Fc(t.element,"."+e.highlightClass);j(o,(function(n){L(r,(function(t){return t.element===n}))||(bi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Fr(n,Hr())})))}))},Cf=function(t,e,n,r){xf(t,e,0,[r]),Sf(t,e,n,r)||(vi(r.element,e.highlightClass),e.onHighlight(t,r),Fr(r,Lr()))},Sf=function(t,e,n,r){return yi(r.element,e.highlightClass)},kf=function(t,e,n){return zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Of=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return(r.length>0?x.some(r[r.length-1]):x.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Tf=function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return X(o,(function(t){return yi(t,e.highlightClass)})).bind((function(e){var n=ic(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},_f=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return hf(V(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ef=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return xf(t,e,0,[])},dehighlight:function(t,e,n,r){Sf(t,e,n,r)&&(bi(r.element,e.highlightClass),e.onDehighlight(t,r),Fr(r,Hr()))},highlight:Cf,highlightFirst:function(t,e,n){kf(t,e).each((function(r){Cf(t,e,n,r)}))},highlightLast:function(t,e,n){Of(t,e).each((function(r){Cf(t,e,n,r)}))},highlightAt:function(t,e,n,r){(function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return x.from(o[r]).fold((function(){return ct.error("No element found with index "+r)}),t.getSystem().getByDom)})(t,e,0,r).fold((function(t){throw new Error(t)}),(function(r){Cf(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=_f(t,e);G(o,r).each((function(r){Cf(t,e,n,r)}))},isHighlighted:Sf,getHighlighted:function(t,e,n){return zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:kf,getLast:Of,getPrevious:function(t,e,n){return Tf(t,e,0,-1)},getNext:function(t,e,n){return Tf(t,e,0,1)},getCandidates:_f}),Af=[_e("highlightClass"),_e("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],Nf=Fa({fields:Af,name:"highlighting",apis:Ef}),Rf=[8],Mf=[9],zf=[13],Df=[27],Bf=[32],Pf=[37],If=[38],Lf=[39],Hf=[40],Ff=function(t,e,n){var r=Q(t.slice(0,e)),o=Q(t.slice(e+1));return G(r.concat(o),n)},Vf=function(t,e,n){var r=Q(t.slice(0,e));return G(r,n)},jf=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return G(o.concat(r),n)},Uf=function(t,e,n){var r=t.slice(e+1);return G(r,n)},Wf=function(t){return function(e){var n=e.raw;return I(t,n.which)}},qf=function(t){return function(e){return J(t,(function(t){return t(e)}))}},$f=function(t){return!0===t.raw.shiftKey},Gf=function(t){return!0===t.raw.ctrlKey},Xf=u($f),Kf=function(t,e){return{matches:t,classification:e}},Yf=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Vn(e,t)}))}))||Vr(t,Dr(),{prevFocus:e,newFocus:n})},Jf=function(){var t=function(t){return Xa(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Yf(e,r,o)}}},Qf=function(){var e=function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))};return{get:e,set:function(n,r){var o=e(n);n.getSystem().getByDom(r).fold(t,(function(t){Nf.highlight(n,t)}));var i=e(n);Yf(n,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Bc||(Bc={}));var Zf=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u;return(i=n(t,e,r,o),u=e.event,G(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([je("focusManager",Jf()),Ue("focusInside","onFocus",le((function(t){return I(["onFocus","onEnterOrSpace","onApi"],t)?ct.value(t):ct.error("Invalid value for focusInside")}))),Zu("handler",u),Zu("state",e),Zu("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Bc.OnFocusMode?x.none():o(t).map((function(n){return Kr(hr(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Kr(ur(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=Wf(Bf.concat(zf))(r.event);t.focusInside===Bc.OnEnterOrSpaceMode&&i&&$n(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Kr(ar(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return $r(u.toArray().concat(a))}};return u},td=function(t){var e=[Pe("onEscape"),Pe("onEnter"),je("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),je("firstTabstop",0),je("useTabstopAt",s),Pe("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Du(e,t)})).getOr(e);return ru(n)>0},o=function(t,e,r){(function(t,e){var r=Fc(t.element,e.selector),o=W(r,(function(t){return n(e,t)}));return x.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},u=function(t,e,r,o){var u=Fc(t.element,r.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,r).bind((function(e){return X(u,i(Vn,e)).bind((function(e){return function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?x.some(!0):x.none()}),(function(e){return o.focusManager.set(t,e),x.some(!0)}))}(t,u,e,r,o)}))}))},a=r([Kf(qf([$f,Wf(Mf)]),(function(t,e,n){var r=n.cyclic?Ff:Vf;return u(t,0,n,r)})),Kf(Wf(Mf),(function(t,e,n){var r=n.cyclic?jf:Uf;return u(t,0,n,r)})),Kf(Wf(Df),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Kf(qf([Xf,Wf(zf)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),c=r([]);return Zf(e,ii.init,a,c,(function(){return x.some(o)}))},ed=td(Je("cyclic",c)),nd=td(Je("cyclic",s)),rd=function(t,e,n){return vf(n)&&Wf(Bf)(e.event)?x.none():function(t,e,n){return Ur(t,n,yr()),x.some(!0)}(t,0,n)},od=function(t,e){return x.some(!0)},id=[je("execute",rd),je("useSpace",!1),je("useEnter",!0),je("useControlEnter",!1),je("useDown",!1)],ud=function(t,e,n){return n.execute(t,e,t.element)},ad=Zf(id,ii.init,(function(t,e,n,r){var o=n.useSpace&&!vf(t.element)?Bf:[],i=n.useEnter?zf:[],u=n.useDown?Hf:[],a=o.concat(i).concat(u);return[Kf(Wf(a),ud)].concat(n.useControlEnter?[Kf(qf([Gf,Wf(zf)]),ud)]:[])}),(function(t,e,n,r){return n.useSpace&&!vf(t.element)?[Kf(Wf(Bf),od)]:[]}),(function(){return x.none()})),cd=function(){var t=Qe(x.none());return ui({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(x.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},sd=Object.freeze({__proto__:null,flatgrid:cd,init:function(t){return t.state(t)}}),ld=function(t){return function(e,n,r,o){var i=t(e.element);return gd(i,e,n,r,o)}},fd=function(t,e){var n=vc(t,e);return ld(n)},dd=function(t,e){var n=vc(e,t);return ld(n)},md=function(t){return function(e,n,r,o){return gd(t,e,n,r,o)}},gd=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},hd=md,pd=md,vd=md,bd=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},yd=function(t,e,n){var r=Fc(t,n);return function(t,n){return X(t,(function(t){return Vn(t,e)})).map((function(e){return{index:e,candidates:t}}))}(W(r,bd))},wd=function(t,e){return X(t,(function(t){return Vn(e,t)}))},xd=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?x.some(t[r]):x.none()}))},Cd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=ic(i,o,0,u-1);return x.some({row:e,column:a})}))},Sd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=ic(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=uc(i,0,a-1);return x.some({row:u,column:c})}))},kd=[_e("selector"),je("execute",rd),Yu("onEscape"),je("captureTab",!1),ea()],Od=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Td=function(t){return function(e,n,r,o){return yd(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},_d=function(t,e,n){return n.captureTab?x.some(!0):x.none()},Ed=Td((function(t,e,n,r){return Cd(t,e,n,r,-1)})),Ad=Td((function(t,e,n,r){return Cd(t,e,n,r,1)})),Nd=Td((function(t,e,n,r){return Sd(t,e,n,r,-1)})),Rd=Td((function(t,e,n,r){return Sd(t,e,n,r,1)})),Md=r([Kf(Wf(Pf),fd(Ed,Ad)),Kf(Wf(Lf),dd(Ed,Ad)),Kf(Wf(If),hd(Nd)),Kf(Wf(Hf),pd(Rd)),Kf(qf([$f,Wf(Mf)]),_d),Kf(qf([Xf,Wf(Mf)]),_d),Kf(Wf(Df),(function(t,e,n){return n.onEscape(t,e)})),Kf(Wf(Bf.concat(zf)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),zd=r([Kf(Wf(Bf),od)]),Dd=Zf(kd,cd,Md,zd,(function(){return x.some(Od)})),Bd=function(t,e,n,r){var o=function(t,e,n){var i,u=ic(e,r,0,n.length-1);return u===t?x.none():(i=n[u],"button"===ao(i)&&"disabled"===Do(i,"disabled")?o(t,u,n):x.from(n[u]))};return yd(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Pd=[_e("selector"),je("getInitial",x.none),je("execute",rd),Yu("onEscape"),je("executeOnMove",!1),je("allowVertical",!0)],Id=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Ld=function(t,e,n){e.getInitial(t).orThunk((function(){return zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Hd=function(t,e,n){return Bd(t,n.selector,e,-1)},Fd=function(t,e,n){return Bd(t,n.selector,e,1)},Vd=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Id(e,n,r):x.some(!0)}))}},jd=function(t,e,n){return n.onEscape(t,e)},Ud=r([Kf(Wf(Bf),od)]),Wd=Zf(Pd,ii.init,(function(t,e,n,r){var o=Pf.concat(n.allowVertical?If:[]),i=Lf.concat(n.allowVertical?Hf:[]);return[Kf(Wf(o),Vd(fd(Hd,Fd))),Kf(Wf(i),Vd(dd(Hd,Fd))),Kf(Wf(zf),Id),Kf(Wf(Bf),Id),Kf(Wf(Df),jd)]}),Ud,(function(){return x.some(Ld)})),qd=function(t,e,n){return x.from(t[e]).bind((function(t){return x.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},$d=function(t,e,n,r){var o=t[e].length,i=ic(n,r,0,o-1);return qd(t,e,i)},Gd=function(t,e,n,r){var o=ic(n,r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Xd=function(t,e,n,r){var o=t[e].length,i=uc(n+r,0,o-1);return qd(t,e,i)},Kd=function(t,e,n,r){var o=uc(n+r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Yd=[ze("selectors",[_e("row"),_e("cell")]),je("cycles",!0),je("previousSelector",x.none),je("execute",rd)],Jd=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return zu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Qd=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Du(r,o.selectors.row).bind((function(t){var e=Fc(t,o.selectors.cell);return wd(e,r).bind((function(e){var r=Fc(n,o.selectors.row);return wd(r,t).bind((function(t){var n=function(t,e){return V(t,(function(t){return Fc(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Zd=Qd((function(t,e,n){return $d(t,e,n,-1)}),(function(t,e,n){return Xd(t,e,n,-1)})),tm=Qd((function(t,e,n){return $d(t,e,n,1)}),(function(t,e,n){return Xd(t,e,n,1)})),em=Qd((function(t,e,n){return Gd(t,n,e,-1)}),(function(t,e,n){return Kd(t,n,e,-1)})),nm=Qd((function(t,e,n){return Gd(t,n,e,1)}),(function(t,e,n){return Kd(t,n,e,1)})),rm=r([Kf(Wf(Pf),fd(Zd,tm)),Kf(Wf(Lf),dd(Zd,tm)),Kf(Wf(If),hd(em)),Kf(Wf(Hf),pd(nm)),Kf(Wf(Bf.concat(zf)),(function(t,e,n){return Xa(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),om=r([Kf(Wf(Bf),od)]),im=Zf(Yd,ii.init,rm,om,(function(){return x.some(Jd)})),um=[_e("selector"),je("execute",rd),je("moveOnTab",!1)],am=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},cm=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},sm=function(t,e,n){return Bd(t,n.selector,e,-1)},lm=function(t,e,n){return Bd(t,n.selector,e,1)},fm=r([Kf(Wf(If),vd(sm)),Kf(Wf(Hf),vd(lm)),Kf(qf([$f,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(sm)(t,e,n,r):x.none()})),Kf(qf([Xf,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(lm)(t,e,n,r):x.none()})),Kf(Wf(zf),am),Kf(Wf(Bf),am)]),dm=r([Kf(Wf(Bf),od)]),mm=Zf(um,ii.init,fm,dm,(function(){return x.some(cm)})),gm=[Yu("onSpace"),Yu("onEnter"),Yu("onShiftEnter"),Yu("onLeft"),Yu("onRight"),Yu("onTab"),Yu("onShiftTab"),Yu("onUp"),Yu("onDown"),Yu("onEscape"),je("stopSpaceKeyup",!1),Pe("focusIn")],hm=Zf(gm,ii.init,(function(t,e,n){return[Kf(Wf(Bf),n.onSpace),Kf(qf([Xf,Wf(zf)]),n.onEnter),Kf(qf([$f,Wf(zf)]),n.onShiftEnter),Kf(qf([$f,Wf(Mf)]),n.onShiftTab),Kf(qf([Xf,Wf(Mf)]),n.onTab),Kf(Wf(If),n.onUp),Kf(Wf(Hf),n.onDown),Kf(Wf(Pf),n.onLeft),Kf(Wf(Lf),n.onRight),Kf(Wf(Bf),n.onSpace),Kf(Wf(Df),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Kf(Wf(Bf),od)]:[]}),(function(t){return t.focusIn})),pm=ed.schema(),vm=nd.schema(),bm=Wd.schema(),ym=Dd.schema(),wm=im.schema(),xm=ad.schema(),Cm=mm.schema(),Sm=hm.schema(),km=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:pm,cyclic:vm,flow:bm,flatgrid:ym,matrix:wm,execution:xm,menu:Cm,special:Sm}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return _t(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:sd}),Om=function(t,e,n,r){var o=t.getSystem().build(r);Es(t,o,n)},Tm=function(t,e,n,r){var o=_m(t);G(o,(function(t){return Vn(r.element,t.element)})).each(Ns)},_m=function(t,e){return t.components()},Em=function(t,e,n,r,o){var i=_m(t);return x.from(i[r]).map((function(e){return Tm(t,0,0,e),o.each((function(e){Om(t,0,(function(t,e){!function(t,e,n){xo(t,n).fold((function(){Oo(t,e)}),(function(t){Co(t,e)}))}(t,e,r)}),e)})),e}))},Am=Fa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Om(t,0,Oo,r)},prepend:function(t,e,n,r){Om(t,0,ko,r)},remove:Tm,replaceAt:Em,replaceBy:function(t,e,n,r,o){var i=_m(t);return X(i,r).bind((function(e){return Em(t,0,0,e,o)}))},set:function(t,e,n,r){Ka((function(){var e=V(r,t.getSystem().build);Ts(t,e)}),t.element)},contents:_m})}),Nm=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=$r(e);return Fa({fields:[_e("enabled")],name:t,active:{events:r(n)}})}(t,e),configAsRaw:r({}),initialConfig:{},state:ii}}},Rm=function(t,e){e.ignore||($a(t.element),e.onFocus(t))},Mm=Object.freeze({__proto__:null,focus:Rm,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return function(t){var e=Ti(t).dom;return t.dom===e.activeElement}(t.element)}}),zm=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return ci(n)},events:function(t){return $r([Kr(hr(),(function(e,n){Rm(e,t),n.stop()}))].concat(t.stopMousedown?[Kr(Zn(),(function(t,e){e.event.prevent()}))]:[]))}}),Dm=[Ku("onFocus"),je("stopMousedown",!1),je("ignore",!1)],Bm=Fa({fields:Dm,name:"focusing",active:zm,apis:Mm}),Pm=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Im=function(t,e,n){e.toggleClass.each((function(e){n.get()?vi(t.element,e):bi(t.element,e)}))},Lm=function(t,e,n){Vm(t,e,n,!n.get())},Hm=function(t,e,n){n.set(!0),Im(t,e,n),Pm(t,e,n)},Fm=function(t,e,n){n.set(!1),Im(t,e,n),Pm(t,e,n)},Vm=function(t,e,n,r){(r?Hm:Fm)(t,e,n)},jm=function(t,e,n){Vm(t,e,n,e.selected)},Um=Object.freeze({__proto__:null,onLoad:jm,toggle:Lm,isOn:function(t,e,n){return n.get()},on:Hm,off:Fm,set:Vm}),Wm=Object.freeze({__proto__:null,exhibit:function(){return ci({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Lm,uo((function(t){o(t,n,r)}))),u=Ba(t,e,jm);return $r(K([t.toggleOnExecute?[i]:[],[u]]))}}),qm=function(t,e,n){zo(t.element,"aria-expanded",n)},$m=[je("selected",!1),Pe("toggleClass"),je("toggleOnExecute",!0),Ue("aria",{mode:"none"},ve("mode",{pressed:[je("syncWithExpanded",!1),Zu("update",(function(t,e,n){zo(t.element,"aria-pressed",n),e.syncWithExpanded&&qm(t,0,n)}))],checked:[Zu("update",(function(t,e,n){zo(t.element,"aria-checked",n)}))],expanded:[Zu("update",qm)],selected:[Zu("update",(function(t,e,n){zo(t.element,"aria-selected",n)}))],none:[Zu("update",t)]}))],Gm=Fa({fields:$m,name:"toggling",active:Wm,apis:Um,state:(!1,{init:function(){var t=Qe(false);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(false)},readState:function(){return t.get()}}}})}),Xm=function(){var t=function(t,e){e.stop(),jr(t)};return[Kr(lr(),t),Kr(xr(),t),to(Kn()),to(Zn())]},Km=function(t){return $r(K([t.map((function(t){return uo((function(e,n){t(e),n.stop()}))})).toArray(),Xm()]))},Ym="alloy.item-hover",Jm="alloy.item-focus",Qm=function(t){(Xa(t.element).isNone()||Bm.isFocused(t))&&(Bm.isFocused(t)||Bm.focus(t),Vr(t,Ym,{item:t}))},Zm=function(t){Vr(t,Jm,{item:t})},tg=r(Ym),eg=r(Jm),ng=[_e("data"),_e("components"),_e("dom"),je("hasSubmenu",!1),Pe("toggling"),gl("itemBehaviours",[Gm,Bm,km,ll]),je("ignoreFocus",!1),je("domModification",{}),Zu("builder",(function(t){return{dom:t.dom,domModification:f(f({},t.domModification),{attributes:f(f(f({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:hl(t.itemBehaviours,[t.toggling.fold(Gm.revoke,(function(t){return Gm.config(f({aria:{mode:"checked"}},t))})),Bm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"execution"}),ll.config({store:{mode:"memory",initialValue:t.data}}),Nm("item-type-events",m(Xm(),[Kr(rr(),Qm),Kr(wr(),Bm.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),je("eventOrder",{})],rg=[_e("dom"),_e("components"),Zu("builder",(function(t){return{dom:t.dom,components:t.components,events:$r([eo(wr())])}}))],og=r([Ll({name:"widget",overrides:function(t){return{behaviours:La([ll.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),ig=[_e("uid"),_e("data"),_e("components"),_e("dom"),je("autofocus",!1),je("ignoreFocus",!1),gl("widgetBehaviours",[ll,Bm,km]),je("domModification",{}),uf(og()),Zu("builder",(function(t){var e=Yl(0,t,og()),n=Jl("item-widget",t,e.internals()),r=function(e){return Ql(e,t,"widget").map((function(t){return km.focusIn(t),t}))},o=function(e,n){return vf(n.event.target)?x.none():t.autofocus?(n.setSource(e.element),x.none()):x.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:$r([uo((function(t,e){r(t).each((function(t){e.stop()}))})),Kr(rr(),Qm),Kr(wr(),(function(e,n){t.autofocus?r(e):Bm.focus(e)}))]),behaviours:hl(t.widgetBehaviours,[ll.config({store:{mode:"memory",initialValue:t.data}}),Bm.config({ignore:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Ua(),onLeft:o,onRight:o,onEscape:function(e,n){return Bm.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),x.none()):x.none():(Bm.focus(e),x.some(!0))}})])}}))],ug=ve("type",{widget:ig,item:ng,separator:rg}),ag=r([Vl({factory:{sketch:function(t){var e=ge("menu.spec item",ug,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:f(f({},e),{uid:Yo("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),cg=r([_e("value"),_e("items"),_e("dom"),_e("components"),je("eventOrder",{}),fl("menuBehaviours",[Nf,ll,wf,km]),Ue("movement",{mode:"menu",moveOnTab:!0},ve("mode",{grid:[ea(),Zu("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Zu("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),_e("rowSelector")],menu:[je("moveOnTab",!0),Zu("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Ee("markers",Wu()),je("fakeFocus",!1),je("focusManager",Jf()),Ku("onHighlight")]),sg=r("alloy.menu-focus"),lg=gf({name:"Menu",configFields:cg(),partFields:ag(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.menuBehaviours,[Nf.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),ll.config({store:{mode:"memory",initialValue:t.value}}),wf.config({find:x.some}),km.config(t.movement.config(t,t.movement))]),events:$r([Kr(eg(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Nf.highlight(t,n),e.stop(),Vr(t,sg(),{menu:t,item:n})}))})),Kr(tg(),(function(t,e){var n=e.event.item;Nf.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),fg=function(t,e,n,r){return Ot(n,r).bind((function(r){return Ot(t,r).bind((function(r){var o=fg(t,e,n,r);return x.some([r].concat(o))}))})).getOr([])},dg=function(t){return"prepared"===t.type?x.some(t.menu):x.none()},mg=function(){var t=Qe({}),e=Qe({}),n=Qe({}),r=Qe(x.none()),o=Qe({}),i=function(t){return u(t).bind(dg)},u=function(t){return Ot(e.get(),t)},a=function(e){return Ot(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(f(f({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(x.some(i)),t.set(a),e.set(u),o.set(c);var s=function(t,e){var n={};yt(t,(function(t,e){j(t,(function(t){n[t]=e}))}));var r=e,o=xt(e,(function(t,e){return{k:t,v:e}})),i=wt(o,(function(t,e){return[e].concat(fg(n,r,o,e))}));return wt(n,(function(t){return Ot(i,t).getOr([t])}))}(c,a);n.set(s)},expand:function(e){return Ot(t.get(),e).map((function(t){var r=Ot(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Ot(n.get(),t)},collapse:function(t){return Ot(n.get(),t).bind((function(t){return t.length>1?x.some(t.slice(1)):x.none()}))},lookupMenu:u,lookupItem:a,otherMenus:function(t){var e=o.get();return Z(vt(e),t)},getPrimary:function(){return r.get().bind(i)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(x.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(e,o){var u=W(a(e).toArray(),(function(t){return i(t).isSome()}));return Ot(n.get(),e).bind((function(e){var n=Q(u.concat(e));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return x.none();e.push(r.getOrDie())}return x.some(e)}(Y(n,(function(e,u){return function(e,n,r){return i(e).bind((function(o){return function(e){return St(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))}(e,o,n.slice(0,u+1)).fold((function(){return r.get().is(e)?[]:[x.none()]}),(function(t){return[x.some(t)]}))})))}))}}},gg=dg,hg=r("collapse-item"),pg=mf({name:"TieredMenu",configFields:[Qu("onExecute"),Qu("onEscape"),Ju("onOpenMenu"),Ju("onOpenSubmenu"),Ku("onRepositionMenu"),Ku("onCollapseMenu"),je("highlightImmediately",!0),ze("data",[_e("primary"),_e("menus"),_e("expansions")]),je("fakeFocus",!1),Ku("onHighlight"),Ku("onHover"),$u(),_e("dom"),je("navigateOnHover",!0),je("stayInDom",!1),fl("tmenuBehaviours",[km,Nf,wf,Am]),je("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Qe(x.none()),o=mg(),i=function(t){return ll.getValue(t).value},u=function(e){return wt(t.data.menus,(function(t,e){return Y(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},a=function(t,e){Nf.highlight(t,e),Nf.getHighlighted(e).orThunk((function(){return Nf.getFirst(e)})).each((function(e){Ur(t,e.element,wr())}))},c=function(t,e){return hf(V(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?x.some(t.menu):x.none()}))})))},s=function(e,n,r){var o=c(n,n.otherMenus(r));j(o,(function(n){xi(n.element,[t.markers.backgroundMenu]),t.stayInDom||Am.remove(e,n)}))},l=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=Fc(e.element,"."+t.markers.item),u=W(o,(function(t){return"true"===Do(t,"aria-haspopup")}));return j(u,(function(t){e.getSystem().getByDom(t).each((function(t){var e=i(t);n[e]=t}))})),r.set(x.some(n)),n}))}(e);yt(o,(function(t,e){var r=I(n,e);zo(t.element,"aria-expanded",r)}))},d=function(e,n,r){return x.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return x.none();var i=o.menu,u=c(n,r.slice(1));return j(u,(function(e){vi(e.element,t.markers.backgroundMenu)})),Ni(i.element)||Am.append(e,tu(i)),xi(i.element,[t.markers.backgroundMenu]),a(e,i),s(e,n,r),x.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,u){void 0===u&&(u=n.HighlightSubmenu);var a=i(r);return o.expand(a).bind((function(i){return l(e,i),x.from(i[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ni(s.element)||Am.append(e,tu(s)),t.onOpenSubmenu(e,r,s,Q(i)),u===n.HighlightSubmenu?(Nf.highlightFirst(s),d(e,o,i)):(Nf.dehighlightAll(s),x.some(r))}))}))}))},g=function(e,n){var r=i(n);return o.collapse(r).bind((function(r){return l(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},h=function(e){return function(n,r){return Du(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},p=$r([Kr(sg(),(function(t,e){var n=e.event.item;o.lookupItem(i(n)).each((function(){var n=e.event.menu;Nf.highlight(t,n);var r=i(e.event.item);o.refresh(r).each((function(e){return s(t,o,e)}))}))})),uo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===i(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),ro((function(e,n){(function(e){var n=function(e,n,r){return wt(r,(function(r,o){var i=function(){return lg.sketch(f(f({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Qf():Jf()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()})(e).each((function(n){Am.append(e,tu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&a(e,n)}))}))].concat(t.navigateOnHover?[Kr(tg(),(function(e,r){var u=r.event.item;!function(t,e){var n=i(e);o.refresh(n).bind((function(e){return l(t,e),d(t,o,e)}))}(e,u),m(e,u,n.HighlightParent),t.onHover(e,u)}))]:[])),v=function(t){return Nf.getHighlighted(t).bind(Nf.getHighlighted)},b={collapseMenu:function(t){v(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){a(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return v(e).bind((function(t){var e=i(t),n=kt(o.getMenus()),r=hf(V(n,gg));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return it(e,(function(t){if(!t.getSystem().isConnected())return x.none();var e=Nf.getCandidates(t);return G(e,(function(t){return i(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return x.from(t.components()[0]).filter((function(t){return"menu"===Do(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.tmenuBehaviours,[km.config({mode:"special",onRight:h((function(t,e){return vf(e.element)?x.none():m(t,e,n.HighlightSubmenu)})),onLeft:h((function(t,e){return vf(e.element)?x.none():g(t,e)})),onEscape:h((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ur(t,e.element,wr())}))}}),Nf.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),wf.config({find:function(t){return Nf.getHighlighted(t)}}),Am.config({})]),eventOrder:t.eventOrder,apis:b,events:p}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Vt(t,e),expansions:{}}},collapseItem:function(t){return{value:Uo(hg()),meta:{text:t}}}}}),vg=mf({name:"InlineView",configFields:[_e("lazySink"),Ku("onShow"),Ku("onHide"),Fe("onEscape"),fl("inlineBehaviours",[Ws,ll,Wa]),Ve("fireDismissalEventInstead",[je("event",Mr())]),Ve("fireRepositionEventInstead",[je("event",zr())]),je("getRelated",x.none),je("isExtraPart",c),je("eventOrder",x.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return ku(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Ws.openWhileCloaked(e,r,(function(){return Cs.positionWithinBounds(i,n,e,o())})),ll.setValue(e,x.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Ra()},onRtl:function(){return Ma()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return pg.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Ws.close(e),t.onEscape.map((function(t){return t(e)})),x.some(!0)},onExecute:function(){return x.some(!0)},onOpenMenu:function(t,e){Cs.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Cs.position(o,f({anchor:"submenu",item:e},a(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Cs.positionWithinBounds(u,n,e,o()),j(r,(function(t){var e=a(t.triggeringPath);Cs.position(u,f({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})}(t,e,n,r,o);Ws.open(e,i),ll.setValue(e,x.some({mode:"menu",menu:i}))},i=function(e){Ws.isOpen(e)&&ll.getValue(e).each((function(n){switch(n.mode){case"menu":Ws.getState(e).each((function(t){pg.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Cs.positionWithinBounds(r,n.anchor,e,n.getBounds())}}))},u={setContent:function(t,e){Ws.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,x.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,(function(){return x.none()}))},showMenuWithinBounds:o,hide:function(t){Ws.isOpen(t)&&(ll.setValue(t,x.none()),Ws.close(t))},getContent:function(t){return Ws.getState(t)},reposition:i,isOpen:Ws.isOpen};return{uid:t.uid,dom:t.dom,behaviours:ml(t.inlineBehaviours,[Ws.config({isPartOf:function(e,n,r){return Pu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return Pu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),ll.config({store:{mode:"memory",initialValue:x.none()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js(f(f({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),bg=function(t){return t.x},yg=function(t,e){return t.x+t.width/2-e.width/2},wg=function(t,e){return t.x+t.width-e.width},xg=function(t){return t.y},Cg=function(t,e){return t.y+t.height-e.height},Sg=function(t,e,n){return na(wg(t,e),Cg(t,e),n.innerSoutheast(),aa(),da(t,{right:0,bottom:3}),"layout-inner-se")},kg=function(t,e,n){return na(bg(t),Cg(t,e),n.innerSouthwest(),ua(),da(t,{left:1,bottom:3}),"layout-inner-sw")},Og=function(t,e,n){return na(wg(t,e),xg(t),n.innerNortheast(),ia(),da(t,{right:0,top:2}),"layout-inner-ne")},Tg=function(t,e,n){return na(bg(t),xg(t),n.innerNorthwest(),oa(),da(t,{left:1,top:2}),"layout-inner-nw")},_g=function(t,e,n){return na(yg(t,e),xg(t),n.innerNorth(),ca(),da(t,{top:2}),"layout-inner-n")},Eg=function(t,e,n){return na(yg(t,e),Cg(t,e),n.innerSouth(),sa(),da(t,{bottom:3}),"layout-inner-s")},Ag=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ng=mf({name:"Button",factory:function(t){var e=Km(t.action),n=t.dom.tag,r=function(e){return Ot(t.dom,"attributes").bind((function(t){return Ot(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:hl(t.buttonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return f({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[je("uid",void 0),_e("dom"),je("components",[]),gl("buttonBehaviours",[Bm,km]),Pe("action"),Pe("role"),je("eventOrder",{})]}),Rg=function(t){var e=function(t){return void 0!==t.uid}(t)&&_t(t,"uid")?t.uid:Yo("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return f(f({},t),{uid:e})}}},Mg=function(t){return x.from(t()["temporary-placeholder"]).getOr("!not found!")},zg=function(t,e){return x.from(e()[t.toLowerCase()]).getOrThunk((function(){return Mg(e)}))},Dg=function(t,e){return it(t,(function(t){return x.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Mg(e)}))},Bg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Pg=mf({name:"Notification",factory:function(t){var e=Rg({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:La([Am.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Rg({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:La([Am.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Am.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Am.set(r,[Yi(n)])}}},u=K([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return x.from(Bg[t])})).toArray()]),a=Rg(Ng.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),c=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Dg(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:La([Am.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:La([Bm.config({}),Nm("notification-events",[Kr(or(),(function(t){a.getOpt(t).each(Bm.focus)}))])]),components:c.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[a.asSpec()]:[]),apis:i}},configFields:[Pe("level"),_e("progress"),_e("icon"),_e("onAction"),_e("text"),_e("iconProvider"),_e("translationProvider"),Ge("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});var Ig,Lg=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Hg=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Fg=function(t,e,n,r,o){var i=Hg(t,(function(e){return function(t,e){return t.isBlock(e)||I(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return x.from(i.backwards(e,n,r,o))},Vg=function(t,e){return jg(rn(t.selection.getNode())).getOrThunk((function(){var n=tn('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Oo(n,rn(e.extractContents())),e.insertNode(n.dom),bo(n).each((function(t){return t.dom.normalize()})),function(t){return e=Hc,(n=function(t){for(var r=wo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return x.some(i);var u=n(i);if(u.isSome())return u}return x.none()})(t);var e,n}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===ao(t)?1:Ic(t).fold((function(){return wo(t).length}),(function(t){return t.length}))}(e))})),n}))},jg=function(t){return Du(t,"[data-mce-autocompleter]")},Ug=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Wg=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},qg=function(t,e){return t.substring(e.length)},$g=function(t,e,n,r){return void 0===r&&(r=0),jg(rn(e.startContainer)).fold((function(){return function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return x.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Fg(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Wg(o))return x.none();if(o===n)break}return x.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return x.none();var i=Ug(o);return 0!==i.lastIndexOf(n)||qg(i,n).length<r?x.none():x.some({text:qg(i,n),range:o,triggerChar:n})}))}(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Ug(r);return x.some({range:r,text:qg(o,n),triggerChar:n})}))},Gg=tinymce.util.Tools.resolve("tinymce.util.Promise"),Xg=function(t,e){return{container:t,offset:e}},Kg=function(t){if(function(t){return 3===t.nodeType}(t))return Xg(t,t.data.length);var e=t.childNodes;return e.length>0?Kg(e[e.length-1]):Xg(t,e.length)},Yg=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Yg(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Kg(n[n.length-1]):Xg(t,e)},Jg=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=W(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return function(t){return function(e){var n=Yg(e.startContainer,e.startOffset);return!function(t,e){return Fg(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Wg(e)})).isSome()}(t,n)}}(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return x.none();var a=Gg.all(V(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return x.some({lookupData:a,context:n})},Qg=Zt([Ne("type"),He("text")]),Zg=Zt([je("type","autocompleteitem"),je("active",!1),je("disabled",!1),je("meta",{}),Ne("value"),He("text"),He("icon")]),th=Zt([Ne("type"),Ne("ch"),We("minChars",1),je("columns",1),We("maxResults",10),Fe("matches"),Me("fetch"),Me("onAction"),Ke("highlightOn",[],xe)]),eh=[Ge("disabled",!1),He("tooltip"),He("icon"),He("text"),Xe("onSetup",(function(){return t}))],nh=Zt([Ne("type"),Me("onAction")].concat(eh)),rh=function(t){return de("toolbarbutton",nh,t)},oh=[Ge("active",!1)].concat(eh),ih=Zt(oh.concat([Ne("type"),Me("onAction")])),uh=function(t){return de("ToggleButton",ih,t)},ah=[Xe("predicate",(function(){return!1})),$e("scope","node",["node","editor"]),$e("position","selection",["node","selection","line"])],ch=eh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),sh=oh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),lh=eh.concat([je("type","contextformbutton")]),fh=oh.concat([je("type","contextformtogglebutton")]),dh=ve("type",{contextformbutton:ch,contextformtogglebutton:sh}),mh=Zt([je("type","contextform"),Xe("initValue",(function(){return""})),He("label"),Be("commands",dh),Ie("launch",ve("type",{contextformbutton:lh,contextformtogglebutton:fh}))].concat(ah)),gh=Zt([je("type","contexttoolbar"),Ne("items")].concat(ah));!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ig||(Ig={}));var hh,ph=Ig,vh="tox-menu-nav__js",bh="tox-collection__item",yh={normal:vh,color:"tox-swatch"},wh="tox-collection__item--enabled",xh="tox-collection__item-label",Ch="tox-collection__item-caret",Sh="tox-collection__item--active",kh="tox-collection__item-container",Oh="tox-collection__item-container--row",Th=function(t){return Ot(yh,t).getOr(vh)},_h=function(t){return"color"===t?"tox-swatches":"tox-menu"},Eh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:_h(t),tieredMenu:"tox-tiered-menu"}},Ah=function(t){var e=Eh(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Th(t)}},Nh=function(t,e,n){var r=Eh(n);return{tag:"div",classes:K([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Rh=[lg.parts.items({})],Mh=function(t,e,n){var r=Eh(n);return{dom:{tag:"div",classes:K([[r.tieredMenu]])},markers:Ah(n)}},zh=function(t,e){return function(n){var r=F(n,e);return V(r,(function(e){return{dom:t,components:e}}))}},Dh=function(t,e){var n=[],r=[];return j(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Tt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),V(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Bh=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[lg.parts.items({preprocess:function(n){return"auto"!==t&&t>1?zh({tag:"div",classes:["tox-collection__group"]},t)(n):Dh(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ph=function(t){return L(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Ih=function(t){return console.error(he(t)),console.log(t),x.none()},Lh=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[lg.parts.items({preprocess:function(t){return Dh(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},Hh=function(t,e,n,r,i){var u;return"color"===i?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[lg.parts.items({preprocess:"auto"!==t?zh({tag:"div",classes:["tox-swatches__row"]},t):o})]}]}}(r)).dom,components:u.components,items:n}:"normal"===i&&"auto"===r?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"normal"===i&&1===r?{value:t,dom:(u=Bh(1,n)).dom,components:u.components,items:n}:"normal"===i?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"listpreview"===i&&"auto"!==r?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[lg.parts.items({preprocess:zh({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:u.components,items:n}:{value:t,dom:Nh(e,r,i),components:Rh,items:n}},Fh=[Ne("type"),Ne("src"),He("alt"),Ke("classes",[],xe)],Vh=Zt(Fh),jh=[Ne("type"),Ne("text"),He("name"),Ke("classes",["tox-collection__item-label"],xe)],Uh=Zt(jh),Wh=se((function(){return pe("type",{cardimage:Vh,cardtext:Uh,cardcontainer:qh})})),qh=Zt([Ne("type"),qe("direction","horizontal"),qe("align","left"),qe("valign","middle"),Be("items",Wh)]),$h=[Ge("disabled",!1),He("text"),He("shortcut"),ie("value","value",Lt((function(){return Uo("menuitem-value")})),be()),je("meta",{})],Gh=Zt([Ne("type"),He("label"),Be("items",Wh),Xe("onSetup",(function(){return t})),Xe("onAction",t)].concat($h)),Xh=Zt([Ne("type"),Ge("active",!1),He("icon")].concat($h)),Kh=Zt([Ne("type"),Re("fancytype",["inserttable","colorswatch"]),Xe("onAction",t)]),Yh=Zt([Ne("type"),Xe("onSetup",(function(){return t})),Xe("onAction",t),He("icon")].concat($h)),Jh=Zt([Ne("type"),Me("getSubmenuItems"),Xe("onSetup",(function(){return t})),He("icon")].concat($h)),Qh=Zt([Ne("type"),He("icon"),Ge("active",!1),Xe("onSetup",(function(){return t})),Me("onAction")].concat($h)),Zh=function(t,e,n){var r=Fc(t.element,"."+n);if(r.length>0){var o=X(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return x.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return x.none()},tp=function(t){return function(t,e){return La([Nm(t,e)])}(Uo("unnamed-events"),t)},ep=[_e("lazySink"),_e("tooltipDom"),je("exclusive",!0),je("tooltipComponents",[]),je("delay",300),$e("mode","normal",["normal","follow-highlight"]),je("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:r([ka,Sa,ya,xa,wa,Ca]),onRtl:r([ka,Sa,ya,xa,wa,Ca])}}})),Ku("onHide"),Ku("onShow")],np=Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=Qe(x.none()),n=function(){t.get().each((function(t){clearTimeout(t)}))},o=r("not-implemented");return ui({getTooltip:function(){return e.get()},isShowing:function(){return e.get().isSome()},setTooltip:function(t){e.set(x.some(t))},clearTooltip:function(){e.set(x.none())},clearTimer:n,resetTimer:function(e,r){n(),t.set(x.some(setTimeout((function(){e()}),r)))},readState:o})}}),rp=Uo("tooltip.exclusive"),op=Uo("tooltip.show"),ip=Uo("tooltip.hide"),up=function(t,e,n){t.getSystem().broadcastOn([rp],{})},ap=Object.freeze({__proto__:null,hideAllExclusive:up,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Am.set(t,r)}))}}),cp=Fa({fields:ep,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Ns(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return $r(K([[Kr(op,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){up(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:$r("normal"===t.mode?[Kr(rr(),(function(t){Fr(n,op)})),Kr(er(),(function(t){Fr(n,ip)}))]:[]),behaviours:La([Am.config({})])});e.setTooltip(o),_s(r,o),t.onShow(n,o),Cs.position(r,t.anchor(n),o)}}(n)}),t.delay)})),Kr(ip,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Kr(br(),(function(t,e){var r=e;r.universal||I(r.channels,rp)&&n(t)})),oo((function(t){n(t)}))],"normal"===t.mode?[Kr(or(),(function(t){Fr(t,op)})),Kr(pr(),(function(t){Fr(t,ip)})),Kr(rr(),(function(t){Fr(t,op)})),Kr(er(),(function(t){Fr(t,ip)}))]:[Kr(Lr(),(function(t,e){Fr(t,op)})),Kr(Hr(),(function(t){Fr(t,ip)}))]]))}}),state:np,apis:ap}),sp=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),lp=tinymce.util.Tools.resolve("tinymce.util.I18n"),fp=["input","button","textarea","select"],dp=function(t,e,n){(e.disabled()?bp:yp)(t,e)},mp=function(t,e){return!0===e.useNative&&I(fp,ao(t.element))},gp=function(t){zo(t.element,"disabled","disabled")},hp=function(t){Io(t.element,"disabled")},pp=function(t){zo(t.element,"aria-disabled","true")},vp=function(t){zo(t.element,"aria-disabled","false")},bp=function(t,e,n){e.disableClass.each((function(e){vi(t.element,e)})),(mp(t,e)?gp:pp)(t),e.onDisabled(t)},yp=function(t,e,n){e.disableClass.each((function(e){bi(t.element,e)})),(mp(t,e)?hp:vp)(t),e.onEnabled(t)},wp=function(t,e){return mp(t,e)?function(t){return Po(t.element,"disabled")}(t):function(t){return"true"===Do(t.element,"aria-disabled")}(t)},xp=Object.freeze({__proto__:null,enable:yp,disable:bp,isDisabled:wp,onLoad:dp,set:function(t,e,n,r){(r?bp:yp)(t,e)}}),Cp=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return $r([Gr(yr(),(function(e,n){return wp(e,t)})),Ba(t,e,dp)])}}),Sp=[Xe("disabled",c),je("useNative",!0),Pe("disableClass"),Ku("onDisabled"),Ku("onEnabled")],kp=Fa({fields:Sp,name:"disabling",active:Cp,apis:xp}),Op=tinymce.util.Tools.resolve("tinymce.EditorManager"),Tp=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},_p=function(t){return t.getParam("width",sp.DOM.getStyle(t.getElement(),"width"))},Ep=function(t){return x.from(t.getParam("min_width")).filter(R)},Ap=function(t){return x.from(t.getParam("min_height")).filter(R)},Np=function(t){return x.from(t.getParam("max_width")).filter(R)},Rp=function(t){return x.from(t.getParam("max_height")).filter(R)},Mp=function(t){return!1!==t.getParam("menubar",!0,"boolean")},zp=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=k(e),o=T(e)&&e.length>0;return!Bp(t)&&(o||r||n)},Dp=function(t){var e=H(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=W(e,(function(t){return"string"==typeof t}));return n.length>0?x.some(n):x.none()},Bp=function(t){return Dp(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),(function(){return!0}))};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(hh||(hh={}));var Pp,Ip=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Pp||(Pp={}));var Lp,Hp,Fp=function(t){return t.getParam("toolbar_location",Pp.auto,"string")},Vp=function(t){return Fp(t)===Pp.bottom},jp=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?zu(Ri(),e):x.none()},Up=function(t){return t.inline&&jp(t).isSome()},Wp=function(t){return jp(t).getOrThunk((function(){return _i(Ti(rn(t.getElement())))}))},qp=function(t){return t.inline&&!Mp(t)&&!zp(t)&&!Bp(t)},$p=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Up(t)&&!qp(t)},Gp=function(t){var e=t.getParam("menu");return e?wt(e,(function(t){return f(f({},t),{items:t.items})})):{}},Xp=function(t){return t.getParam("menubar")},Kp=function(t){return t.getParam("anchor_top","#top")},Yp=function(t){return t.getParam("anchor_bottom","#bottom")},Jp="silver.readonly",Qp=Zt([("readonly",Ee("readonly",Ce))]),Zp=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([qs()],{target:n}),t.uiMothership.broadcastOn([qs()],{target:n})),t.mothership.broadcastOn([Jp],{readonly:e}),t.uiMothership.broadcastOn([Jp],{readonly:e})},tv=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Zp(e,!0)})),t.on("SwitchMode",(function(){return Zp(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},ev=function(){var t;return Wa.config({channels:(t={},t[Jp]={schema:Qp,onReceive:function(t,e){kp.set(t,e.readonly)}},t)})},nv=function(t){return kp.config({disabled:t})},rv=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},ov=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},iv=function(t,e){var n=t.getApi(e);return function(t){t(n)}},uv=function(t,e){return ro((function(n){iv(t,n)((function(n){var r=t.onSetup(n);null!=r&&e.set(r)}))}))},av=function(t,e){return oo((function(n){return iv(t,n)(e.get())}))},cv=function(t,e){return uo((function(n,r){iv(t,n)(t.onAction),t.triggersSubmenu||e!==ph.CLOSE_ON_EXECUTE||(Fr(n,Sr()),r.stop())}))},sv=((Lp={})[yr()]=["disabling","alloy.base.behaviour","toggling","item-events"],Lp),lv=function(t){return Y(t,(function(t){return t.toArray()}))},fv=function(e,n,r,o){var i,u=Qe(t);return{type:"item",dom:n.dom,components:lv(n.optComponents),data:e.data,eventOrder:sv,hasSubmenu:e.triggersSubmenu,itemBehaviours:La([Nm("item-events",[cv(e,r),uv(e,u),av(e,u)]),(i=function(){return e.disabled||o.isDisabled()},kp.config({disabled:i,disableClass:"tox-collection__item--state-disabled"})),ev(),Am.config({})].concat(e.itemBehaviours))}},dv=function(t){return{value:t.value,meta:f({text:t.text.getOr("")},t.meta)}},mv=tinymce.util.Tools.resolve("tinymce.Env"),gv=function(t){var e=mv.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=V(n,(function(t){var n=t.toLowerCase().trim();return Tt(e,n)?e[n]:t}));return mv.mac?r.join(""):r.join("+")},hv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},pv=function(t){return{dom:{tag:"div",classes:[xh]},components:[Yi(lp.translate(t))]}},vv=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},bv=function(t,e){return{dom:{tag:"div",classes:[xh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(lp.translate(e))]}]}},yv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:gv(t)}}},wv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:zg("checkmark",t)}}},xv=function(t,e){var n=e.map((function(t){return{attributes:{title:lp.translate(t)}}})).getOr({});return f({tag:"div",classes:[vh,bh].concat(t?["tox-collection__item-icon-rtl"]:[])},n)},Cv=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Sv=["list-bull-circle","list-bull-default","list-bull-square"],kv=function(t,e,n,r){void 0===r&&(r=x.none());var o,u=lp.isRtl()&&t.iconContent.exists((function(t){return I(Sv,t)})),a=(o=t.iconContent,o.map((function(t){return lp.isRtl()&&I(Cv,t)?t+"-rtl":t}))).map((function(t){return function(t,e,n){return x.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Mg(e)}))}(t,e.icons,r)})),c=x.from(t.meta).fold((function(){return pv}),(function(t){return Tt(t,"style")?i(bv,t.style):pv}));return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=n.getOr(""),i={tag:"div",attributes:t.map((function(t){return{title:r.translate(t)}})).getOr({}),classes:["tox-swatch"]},f(f({},i),"custom"===e?{tag:"button",classes:m(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:m(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:f(f({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,a,e):function(t,e,n,r,o){var i=n?e.or(x.some("")).map(hv):x.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return x.some(vv(t,[xh]))}));return{dom:xv(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(yv),u,t.caret]}}(t,a,n,c,u)},Ov=function(t,e){return Ot(t,"tooltipWorker").map((function(t){return[cp.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:fc}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){cp.setComponents(e,[Ji({element:rn(t)})])}))}})]})).getOr([])},Tv=function(t,e){var n=function(t){return sp.DOM.encode(t)}(lp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},_v=ql("item-widget",og()),Ev=function(t){return{value:t}},Av=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Nv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Rv=function(t){return Av.test(t)||Nv.test(t)},Mv=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},zv=function(t){var e=Mv(t.red)+Mv(t.green)+Mv(t.blue);return Ev(e)},Dv=Math.min,Bv=Math.max,Pv=Math.round,Iv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Lv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Hv=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Fv=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Vv=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Bv(0,Dv(i,1)),u=Bv(0,Dv(u,1)),0===i)return e=n=r=Pv(255*u),Hv(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Pv(255*(e+l)),n=Pv(255*(n+l)),r=Pv(255*(r+l)),Hv(e,n,r,1)},jv=function(t){var e,n,r=(e=function(t){return{value:t.value.replace(Av,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),null===(n=Nv.exec(e.value))?["FFFFFF","FF","FF","FF"]:n),o=parseInt(r[1],16),i=parseInt(r[2],16),u=parseInt(r[3],16);return Hv(o,i,u,1)},Uv=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Hv(o,i,u,a)},Wv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},qv=Hv(255,0,0,1),$v=function(t,e){return t.fire("ResizeContent",e)},Gv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Xv="tinymce-custom-colors",Kv="choiceitem",Yv=[{type:Kv,text:"Light Green",value:"#BFEDD2"},{type:Kv,text:"Light Yellow",value:"#FBEEB8"},{type:Kv,text:"Light Red",value:"#F8CAC6"},{type:Kv,text:"Light Purple",value:"#ECCAFA"},{type:Kv,text:"Light Blue",value:"#C2E0F4"},{type:Kv,text:"Green",value:"#2DC26B"},{type:Kv,text:"Yellow",value:"#F1C40F"},{type:Kv,text:"Red",value:"#E03E2D"},{type:Kv,text:"Purple",value:"#B96AD9"},{type:Kv,text:"Blue",value:"#3598DB"},{type:Kv,text:"Dark Turquoise",value:"#169179"},{type:Kv,text:"Orange",value:"#E67E23"},{type:Kv,text:"Dark Red",value:"#BA372A"},{type:Kv,text:"Dark Purple",value:"#843FA1"},{type:Kv,text:"Dark Blue",value:"#236FA1"},{type:Kv,text:"Light Gray",value:"#ECF0F1"},{type:Kv,text:"Medium Gray",value:"#CED4D9"},{type:Kv,text:"Gray",value:"#95A5A6"},{type:Kv,text:"Dark Gray",value:"#7E8C8D"},{type:Kv,text:"Navy Blue",value:"#34495E"},{type:Kv,text:"Black",value:"#000000"},{type:Kv,text:"White",value:"#ffffff"}],Jv=function(t){void 0===t&&(t=10);var e,n=Gv.getItem(Xv),r=k(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=P(t,e);return-1===n?x.none():x.some(n)})(o,e).each(i),o.unshift(e),o.length>t&&o.pop(),Gv.setItem(Xv,JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),Qv=function(t){return!1!==t.getParam("custom_colors")},Zv=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u<t.length;u+=2)e.push({text:t[u+1],value:i(t[u]),type:"choiceitem"});return e}(e):Yv},tb=function(t){Jv.add(t)},eb=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,(e=Zv(t).length,Math.max(5,Math.ceil(Math.sqrt(e)))));var e},nb=function(t,e,n,r){"custom"===n?cb(t)((function(n){n.each((function(n){tb(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},rb=function(t,e){return t.concat(V(Jv.state(),(function(t){return{type:Kv,text:t,value:t}})).concat(function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]}(e)))},ob=function(t,e){return function(n){n(rb(t,e))}},ib=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},ub=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return x.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return function(t){if("transparent"===t)return x.some(Hv(0,0,0,0));var e=Iv.exec(t);if(null!==e)return x.some(Uv(e[1],e[2],e[3],"1"));var n=Lv.exec(t);return null!==n?x.some(Uv(n[1],n[2],n[3],n[4])):x.none()}(t).map((function(t){var n=zv(t).value;return ln(e.toLowerCase(),n)}))})).getOr(!1)},columns:eb(t),fetch:ob(Zv(t),Qv(t)),onAction:function(e){null!==o.get()&&nb(t,n,o.get(),(function(){}))},onItemAction:function(r,i){nb(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&ib(n,e,o.get());var r=function(t){t.name===e&&ib(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},ab=function(e,n,r,o){e.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){nb(e,r,n.value,t)}}]}})},cb=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(x.from(n.colorpicker)),e.close()}}(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(x.none())}})}},sb=function(t,e,n,r,o,i,u,a){var c=Ph(e),s=lb(e,n,r,"color"!==o?"normal":"color",i,u,a);return Hh(t,c,s,r,o)},lb=function(t,e,n,r,o,i,u){return hf(V(t,(function(a){return"choiceitem"===a.type?(c=a,de("choicemenuitem",Xh,c)).fold(Ih,(function(c){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:n,textContent:e?t.text:x.none(),htmlContent:x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:x.none(),checkMark:e?x.some(wv(u.icons)):x.none(),caret:x.none(),value:t.value},u,a);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,Ph(t)))})):x.none();var c})))},fb=function(t,e){var n=Ah(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},db=Uo("cell-over"),mb=Uo("cell-execute"),gb=function(t,e,n){var r,o=function(n){return Vr(n,mb,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Zi({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:La([Nm("insert-table-picker-cell",[Kr(rr(),Bm.focus),Kr(yr(),o),Kr(lr(),i),Kr(xr(),i)]),Gm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Bm.config({onFocus:function(n){return Vr(n,db,{row:t,col:e})}})])})},hb=function(t){return Y(t,(function(t){return V(t,tu)}))},pb=function(t,e){return Yi(e+1+"x"+(t+1))},vb={inserttable:function(t){var e=Uo("size-label"),n=function(t,e,n){for(var r=[],o=0;o<10;o++){for(var i=[],u=0;u<10;u++)i.push(gb(o,u,t));r.push(i)}return r}(e),r=Rg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Yi("0x0")],behaviours:La([Am.config({})])});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:hb(n).concat(r.asSpec()),behaviours:La([Nm("insert-table-picker",[Zr(db,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<10;i++)for(var u=0;u<10;u++)Gm.set(t[i][u],i<=e&&u<=n)}(n,i,u),Am.set(r.get(t),[pb(i,u)])})),Zr(mb,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Fr(e,Sr())}))]),km.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=rb(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o="color",i=sb(Uo("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),u=f(f({},i),{markers:Ah(o),movement:fb(r,o)});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget(lg.sketch(u))]}}},bb=function(t,e){return V(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Oh,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[kh,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,bb(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return I(e.cardText.highlightOn,t)}))?x.from(e.cardText.matchText).getOr(""):"";return vv(Tv(t.text,n),t.classes)}}))},yb=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:f({tag:"div",classes:[bh,"tox-collection__group-heading"]},e),components:[]}};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Hp||(Hp={}));var wb=function(e,n,r,o,i){var u,a=r.shared.providers,c=function(t){return i?f(f({},t),{shortcut:x.none(),icon:t.text.isSome()?x.none():t.icon}):t};switch(e.type){case"menuitem":return(u=e,de("menuitem",Yh,u)).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,caret:x.none(),checkMark:x.none(),shortcutContent:t.shortcut},n,r);return fv({data:dv(t),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)}(c(t),n,a,o))}));case"nestedmenuitem":return function(t){return de("nestedmenuitem",Jh,t)}(e).fold(Ih,(function(e){return x.some(function(e,n,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var u,a=i?(u=r.icons,{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-down",u)}}):function(t){return{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-right",t)}}}(r.icons),c=kv({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:x.none(),ariaLabel:e.text,caret:x.some(a),checkMark:x.none(),shortcutContent:e.shortcut},r,o);return fv({data:dv(e),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:e.disabled,onAction:t,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,r)}(c(e),n,a,o,i))}));case"togglemenuitem":return function(t){return de("togglemenuitem",Qh,t)}(e).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,checkMark:x.some(wv(n.icons)),caret:x.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c(t),n,a,o))}));case"separator":return function(t){return de("separatormenuitem",Qg,t)}(e).fold(Ih,(function(t){return x.some(yb(t))}));case"fancymenuitem":return function(t){return de("fancymenuitem",Kh,t)}(e).fold(Ih,(function(t){return function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?x.some(t[e]):x.none()}(vb,t.fancytype).map((function(n){return n(t,e)}))}(c(t),r)}));default:return console.error("Unknown item in general menu",e),x.none()}},xb=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Ph(t);return hf(V(t,(function(t){switch(t.type){case"separator":return(r=t,de("Autocompleter.Separator",Qg,r)).fold(Ih,(function(t){return x.some(yb(t))}));case"cardmenuitem":return function(t){return de("cardmenuitem",Gh,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r){var o={dom:xv(!1,t.label),optComponents:[x.some({dom:{tag:"div",classes:[kh,Oh]},components:bb(t.items,r)})]};return fv({data:dv(f({text:x.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){kp.set(t,e),j(Fc(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(kp)&&kp.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:x.from(r.itemBehaviours).getOr([])},o,e,n.providers)}(f(f({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Ov(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return de("Autocompleter.Item",Zg,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:r,textContent:x.none(),htmlContent:n?t.text.map((function(t){return Tv(t,e)})):x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:x.none(),checkMark:x.none(),caret:x.none(),value:t.value},u.providers,a,t.icon);return fv({data:dv(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:Ov(t.meta,u)},c,i,u.providers)}(t,e,a,"normal",n,o,i,c))}))}var r})))},Cb=function(t,e,n,r,o){var i=Ph(e),u=hf(V(e,(function(t){var e=function(t){return wb(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(f(f({},t),{disabled:!0})):e(t)})));return(o?Lh:Hh)(t,i,u,1,"normal")},Sb=function(t){return pg.singleData(t.value,t)},kb=function(t,e){var n=Qe(x.none()),r=Qe(!1),o=Zi(vg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissAutocompleter",[Kr(Mr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&vg.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));jg(e.getOr(rn(t.selection.getNode()))).each(Ao),u(),n.set(x.none()),r.set(!1)}},c=zt((function(){return function(t){var e,n,r=t.ui.registry.getAll().popups,o=wt(r,(function(t){return(e=t,de("Autocompleter",th,e)).fold((function(t){throw new Error(he(t))}),(function(t){return t}));var e})),i=(e=Ct(o,(function(t){return t.ch})),n={},j(e,(function(t){n[t]={}})),vt(n)),u=kt(o);return{dataset:o,triggerChars:i,lookupByChar:function(t){return W(u,(function(e){return e.ch===t}))}}}(t)})),s=function(l){(function(e){return n.get().map((function(n){return $g(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Jg(t,c,n,e)}))})).getOrThunk((function(){return function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return it(n.triggerChars,(function(n){return $g(t,e,n)}))}(t.dom,r,n).bind((function(n){return Jg(t,e,n)}))}(t,c)}))})(l).fold(a,(function(c){!function(e){if(!i()){var o=Vg(t,e.range);n.set(x.some({triggerChar:e.triggerChar,element:o,matchLength:e.text.length})),r.set(!1)}}(c.context),c.lookupData.then((function(i){n.get().map((function(n){var l,f,d,m=c.context;if(n.triggerChar===m.triggerChar){var g=(l=m.triggerChar,d=it(f=i,(function(t){return x.from(t.columns)})).getOr(1),Y(f,(function(n){var o=n.items;return xb(o,n.matchText,(function(e,o){var i=t.selection.getRng();$g(t.dom,i,l).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),s(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,ph.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?function(e,n,r,i){e.matchLength=n.text.length;var u=it(r,(function(t){return x.from(t.columns)})).getOr(1);vg.showAt(o,{anchor:"node",root:rn(t.getBody()),node:x.from(e.element)},lg.sketch(function(t,e,n,r){var o=n===Hp.ContentFocus?Qf():Jf(),i=fb(e,r),u=Ah(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===Hp.ContentFocus,focusManager:o,menuBehaviours:tp("auto"!==e?[]:[ro((function(t,e){Zh(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;km.setGridSize(t,r,n)}))}))])}}(Hh("autocompleter-value",!0,i,u,"normal"),u,Hp.ContentFocus,"normal"))),vg.getContent(o).each(Nf.highlightFirst)}(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},l={onKeypress:Lg((function(t){27!==t.which&&s()}),50),cancelIfNecessary:a,isMenuOpen:function(){return vg.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return vg.getContent(o)}};!1===t.hasPlugin("rtc")&&function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Vr(t,ur(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Nf.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(jr),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Nf.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&jg(rn(e.element)).isNone()&&t.cancelIfNecessary()}))}(l,t)},Ob=s,Tb=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!1)}(t,e,Ob,n)},_b=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!0)}(t,e,Ob,n)},Eb=mu,Ab=function(t,e,n){return Du(t,e,n).isSome()};function Nb(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}}var Rb=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?x.none():x.some(e.touches[0])},Mb=function(){return Ln().browser.isFirefox()},zb=Qt([Me("triggerEvent"),je("stopBackspace",!0)]),Db=function(t,e){var n=ge("Getting GUI events settings",zb,e),r=function(t){var e=Qe(x.none()),n=Qe(!1),r=Nb((function(e){t.triggerEvent(Cr(),e),n.set(!0)}),400),o=jt([{key:Kn(),value:function(t){return Rb(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(x.some(i))})),x.none()}},{key:Yn(),value:function(t){return r.cancel(),Rb(t).each((function(t){e.get().each((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(x.none())}))})),x.none()}},{key:Jn(),value:function(o){return r.cancel(),e.get().filter((function(t){return Vn(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(xr(),o)}))}}]);return{fireIfReady:function(t,e){return Ot(o,e).bind((function(e){return e(t)}))}}}(n),o=V(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return Tb(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Qe(x.none()),u=Tb(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(x.some(setTimeout((function(){n.triggerEvent(vr(),t)}),0)))})),a=Tb(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===Rf[0]&&!I(["input","textarea"],ao(t.target))&&!Ab(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Mb()?_b(t,"focus",e):Tb(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Qe(x.none()),l=function(t,e){return Mb()?_b(t,"blur",e):Tb(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(x.some(setTimeout((function(){n.triggerEvent(pr(),t)}),0)))}));return{unbind:function(){j(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.get().each(clearTimeout),s.get().each(clearTimeout)}}},Bb=function(t,e){var n=Ot(t,"target").getOr(e);return Qe(n)},Pb=Et([{stopped:[]},{resume:["element"]},{complete:[]}]),Ib=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=Qe(!1),r=Qe(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),Pb.complete()}),(function(t){var n=t.descHandler;return si(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Pb.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Pb.complete()):bo(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Pb.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Pb.resume(r)}))}))},Lb=function(t,e,n,r,o,i){return Ib(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return Lb(t,e,n,r,o,i)}),(function(){return!1}))},Hb=function(t,e,n,r,o){var i=Bb(n,r);return Lb(t,e,n,r,i,o)};function Fb(){var t,e=(t={},{registerId:function(e,n,r){yt(r,(function(r,o){var u=void 0!==t[o]?t[o]:{};u[n]=function(t,e){return{cHandler:i.apply(void 0,[t.handler].concat(e)),purpose:t.purpose}}(r,e),t[o]=u}))},unregisterId:function(e){yt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return Ot(t,e).map((function(t){return Ct(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Ot(t,n);return qn(r,(function(t){return function(t,e){return Ko(e).fold((function(){return x.none()}),(function(n){return t.bind((function(t){return Ot(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}),n={},r=function(t){Ko(t.element).each((function(t){delete n[t],e.unregisterId(t)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(t){var o=function(t){var e=t.element;return Ko(e).fold((function(){return function(t,e){var n=Uo($o+"uid-");return Xo(e,n),n}(0,t.element)}),(function(t){return t}))}(t);_t(n,o)&&function(t,e){var o=n[e];if(o!==t)throw new Error('The tagId "'+e+'" is already used by: '+Ho(o.element)+"\nCannot use it for: "+Ho(t.element)+"\nThe conflicting element is"+(Ni(o.element)?" ":" not ")+"already in the DOM");r(t)}(t,o);var i=[t];e.registerId(i,o,t.events),n[o]=t},unregister:r,getById:function(t){return Ot(n,t)}}}var Vb=mf({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=d(e,["attributes"]);return{uid:t.uid,dom:f({tag:"div",attributes:f({role:"presentation"},n)},r),components:t.components,behaviours:dl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[je("components",[]),fl("containerBehaviours",[]),je("events",{}),je("domModification",{}),je("eventOrder",{})]}),jb=function(e){var n=function(t){return bo(e.element).fold((function(){return!0}),(function(e){return Vn(t,e)}))},o=Fb(),i=function(t,e){return o.find(n,t,e)},u=Db(e.element,{triggerEvent:function(t,e){return Fu(t,e.target,(function(n){return function(t,e,n,r){return Hb(t,e,n,n.target,r)}(i,t,e,n)}))}}),l={debugInfo:r("real"),triggerEvent:function(t,e,n){Fu(t,e,(function(r){return Hb(i,t,n,e,r)}))},triggerFocus:function(e,n){Ko(e).fold((function(){$a(e)}),(function(r){Fu(hr(),e,(function(r){return function(t,e,n,r,o){var i=Bb(n,r);Ib(t,e,n,r,i,o)}(i,hr(),{originator:n,kill:t,prevent:t,target:e},e,r),!1}))}))},triggerEscape:function(t,e){l.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return y(t)},getByDom:function(t){return w(t)},build:Zi,addToGui:function(t){m(t)},removeFromGui:function(t){g(t)},addToWorld:function(t){f(t)},removeFromWorld:function(t){d(t)},broadcast:function(t){p(t)},broadcastOn:function(t,e){v(t,e)},broadcastEvent:function(t,e){b(t,e)},isConnected:s},f=function(t){t.connect(l),lo(t.element)||(o.register(t),j(t.components(),f),l.triggerEvent(Or(),t.element,{target:t.element}))},d=function(t){lo(t.element)||(j(t.components(),d),o.unregister(t)),t.disconnect()},m=function(t){_s(e,t)},g=function(t){Ns(t)},h=function(t){var e=o.filter(br());j(e,(function(e){var n=e.descHandler;si(n)(t)}))},p=function(t){h({universal:!0,data:t})},v=function(t,e){h({universal:!1,channels:t,data:e})},b=function(e,n){return function(e,n,r){var o=function(e){var n=Qe(!1);return{stop:function(){n.set(!0)},cut:t,isStopped:n.get,isCut:c,event:e,setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")}}(n);return j(e,(function(t){var e=t.descHandler;si(e)(o)})),o.isStopped()}(o.filter(e),n)},y=function(t){return o.getById(t).fold((function(){return ct.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ct.value)},w=function(t){var e=Ko(t).getOr("not found");return y(e)};return f(e),{root:e,element:e.element,destroy:function(){u.unbind(),Eo(e.element)},add:m,remove:g,getByUid:y,getByDom:w,addToWorld:f,removeFromWorld:d,broadcast:p,broadcastOn:v,broadcastEvent:b}},Ub=r([je("prefix","form-field"),fl("fieldBehaviours",[wf,ll])]),Wb=r([Fl({schema:[_e("dom")],name:"label"}),Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Ll({factory:{sketch:function(t){var e=function(t,e){var n={};return yt(t,(function(t,r){I(e,r)||(n[r]=t)})),n}(t,["factory"]);return t.factory.sketch(e)}},schema:[_e("factory")],name:"field"})]),qb=gf({name:"FormField",configFields:Ub(),partFields:Wb(),factory:function(t,e,n,r){var o=ml(t.fieldBehaviours,[wf.config({find:function(e){return Ql(e,t,"field")}}),ll.config({store:{mode:"manual",getValue:function(t){return wf.getCurrent(t).bind(ll.getValue)},setValue:function(t,e){wf.getCurrent(t).each((function(t){ll.setValue(t,e)}))}}})]),i=$r([ro((function(e,n){var r=tf(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Uo(t.prefix);r.label().each((function(t){zo(t.element,"for",n),zo(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Uo(t.prefix);zo(n.element,"id",r),zo(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Ql(e,t,"field")},getLabel:function(e){return Ql(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),$b=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({attributes:jt([{key:e.tabAttr,value:"true"}])})}}),Gb=[je("tabAttr","data-alloy-tabstop")],Xb=Fa({fields:Gb,name:"tabstopping",active:$b}),Kb=tinymce.util.Tools.resolve("tinymce.html.Entities"),Yb=function(t,e,n,r){var o=Jb(t,e,n,r);return qb.sketch(o)},Jb=function(t,e,n,r){return{dom:Qb(n),components:t.toArray().concat([e]),fieldBehaviours:La(r)}},Qb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Zb=function(t,e){return qb.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ty=Uo("form-component-change"),ey=Uo("form-close"),ny=Uo("form-cancel"),ry=Uo("form-action"),oy=Uo("form-submit"),iy=Uo("form-block"),uy=Uo("form-unblock"),ay=Uo("form-tabchange"),cy=Uo("form-resize"),sy=r([Pe("data"),je("inputAttributes",{}),je("inputStyles",{}),je("tag","input"),je("inputClasses",[]),Ku("onSetValue"),je("styles",{}),je("eventOrder",{}),fl("inputBehaviours",[ll,Bm]),je("selectOnFocus",!0)]),ly=function(e){return La([Bm.config({onFocus:e.selectOnFocus?function(t){var e=t.element,n=qi(e);e.dom.setSelectionRange(0,n.length)}:t})])},fy=function(t){return f(f({},ly(t)),ml(t.inputBehaviours,[ll.config({store:f(f({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return qi(t.element)},setValue:function(t,e){qi(t.element)!==e&&$i(t.element,e)}}),onSetValue:t.onSetValue})]))},dy=function(t){return{tag:t.tag,attributes:f({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},my=mf({name:"Input",configFields:sy(),factory:function(t,e){return{uid:t.uid,dom:dy(t),components:[],behaviours:fy(t),eventOrder:t.eventOrder}}}),gy={},hy={exports:gy};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,gy,hy);var py,vy=hy.exports.boltExport,by=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return by((function(e){r((function(n){e(t(n))}))}))},isReady:o}},yy={nu:by,pure:function(t){return by((function(e){e(t)}))}},wy=function(t){setTimeout((function(){throw t}),0)},xy=function(t){var e=function(e){t().then(e,wy)};return{map:function(e){return xy((function(){return t().then(e)}))},bind:function(e){return xy((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return xy((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return yy.nu(e)},toCached:function(){var e=null;return xy((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Cy=function(t){return xy((function(){return new vy(t)}))},Sy=function(t){return xy((function(){return vy.resolve(t)}))},ky=["input","textarea"],Oy=function(t){var e=ao(t);return I(ky,e)},Ty=function(t,e){var n=e.getRoot(t).getOr(t.element);bi(n,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ro(t,e.validHtml)})),e.onValid(t)}))},_y=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);vi(o,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ro(t,r)})),e.onInvalid(t,r)}))},Ey=function(t,e,n){return e.validator.fold((function(){return Sy(ct.value(!0))}),(function(e){return e.validate(t)}))},Ay=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Ey(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return _y(t,e,0,n),ct.error(n)}),(function(n){return Ty(t,e),ct.value(n)})):ct.error("No longer in system")}))},Ny=Object.freeze({__proto__:null,markValid:Ty,markInvalid:_y,query:Ey,run:Ay,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return yi(n,e.invalidClass)}}),Ry=Object.freeze({__proto__:null,events:function(e,n){return e.validator.map((function(n){return $r([Kr(n.onEvent,(function(t){Ay(t,e).get(o)}))].concat(n.validateOnLoad?[ro((function(n){Ay(n,e).get(t)}))]:[]))})).getOr({})}}),My=[_e("invalidClass"),je("getRoot",x.none),Ve("notify",[je("aria","alert"),je("getContainer",x.none),je("validHtml",""),Ku("onValid"),Ku("onInvalid"),Ku("onValidate")]),Ve("validator",[_e("validate"),je("onEvent","input"),je("validateOnLoad",!0)])],zy=Fa({fields:My,name:"invalidating",active:Ry,apis:Ny,extra:{validation:function(t){return function(e){var n=ll.getValue(e);return Sy(t(n))}}}}),Dy=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),By=[Ee("others",fe(ct.value,be()))],Py=Fa({fields:By,name:"coupling",apis:Dy,state:Object.freeze({__proto__:null,init:function(){var t={},e=r({});return ui({readState:e,getOrCreate:function(e,n,r){var o=vt(n.others);if(o)return Ot(t,r).getOrThunk((function(){var o=Ot(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),Iy=r("sink"),Ly=r(Fl({name:Iy(),overrides:r({dom:{tag:"div"},behaviours:La([Cs.config({useFixed:s})]),events:$r([to(ur()),to(Zn()),to(lr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(py||(py={}));var Hy=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},Fy=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Uy(r,t);return a.map((function(t){return t.bind((function(t){return x.from(pg.sketch(f(f({},i.menu()),{uid:Yo(""),data:t,highlightImmediately:u===py.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Cs.position(r,n,e),Ws.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Cs.position(r,{anchor:"submenu",item:e},n),Ws.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Cs.position(o,n,e),j(r,(function(t){Cs.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Bm.focus(r),Ws.close(o),x.some(!0)}})))}))}))}(t,e,Hy(t,n),n,r,o,u).map((function(t){return t.fold((function(){Ws.isOpen(r)&&Ws.close(r)}),(function(t){Ws.cloak(r),Ws.open(r,t),i(r)})),r}))},Vy=function(t,e,n,r,o,i,u){return Ws.close(r),Sy(r)},jy=function(t,e,n,r,o,i){var u=Py.getCoupled(n,"sandbox");return(Ws.isOpen(u)?Vy:Fy)(t,e,n,u,r,o,i)},Uy=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Iy()).map((function(t){return function(){return ct.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return ct.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Wy=function(t){Ws.getState(t).each((function(t){pg.repositionMenus(t)}))},qy=function(t,e,n){var r=Bu(),o=Uy(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:hl(t.sandboxBehaviours,[ll.config({store:{mode:"memory",initialValue:e}}),Ws.config({onOpen:function(o,i){var u=Hy(t,e);r.link(e.element),t.matchWidth&&function(t,e,n){var r=wf.getCurrent(e).getOr(e),o=fu(t.element);n?Bi(r.element,"min-width",o+"px"):function(t,e){lu.set(t,e)}(r.element,o)}(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return Pu(n,r)||Pu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),wf.config({find:function(t){return Ws.getState(t).bind((function(t){return wf.getCurrent(t)}))}}),Wa.config({channels:f(f({},Ks({isExtraPart:c})),Js({doReposition:Wy}))})])}},$y=function(t){var e=Py.getCoupled(t,"sandbox");Wy(e)},Gy=function(){return[je("sandboxClasses",[]),gl("sandboxBehaviours",[wf,Wa,Ws,ll])]},Xy=r([_e("dom"),_e("fetch"),Ku("onOpen"),Yu("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),fl("dropdownBehaviours",[Gm,Py,km,Bm]),_e("toggleClass"),je("eventOrder",{}),Pe("lazySink"),je("matchWidth",!1),je("useMinWidth",!1),Pe("role")].concat(Gy())),Ky=r([Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Ly()]),Yy=gf({name:"Dropdown",configFields:Xy(),partFields:Ky(),factory:function(e,n,r,o){var i,u=function(t){Ws.getState(t).each((function(t){pg.highlightPrimary(t)}))},a={expand:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightNone).get(t)},open:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},isOpen:Gm.isOn,close:function(n){Gm.isOn(n)&&jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},repositionMenus:function(t){Gm.isOn(t)&&$y(t)}},c=function(t,e){return jr(t),x.some(!0)};return{uid:e.uid,dom:e.dom,components:n,behaviours:ml(e.dropdownBehaviours,[Gm.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){Gm.on(t)},onClose:function(){Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Yy.isOpen(t)){var n=Py.getCoupled(t,"sandbox");u(n)}else Yy.open(t);return x.some(!0)},onEscape:function(t,e){return Yy.isOpen(t)?(Yy.close(t),x.some(!0)):x.none()}}),Bm.config({})]),events:Km(x.some((function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)}))),eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:a,domModification:{attributes:f(f({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===e.dom.tag?{type:("type",Ot(e.dom,"attributes").bind((function(t){return Ot(t,"type")}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Jy=Fa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return $r([Gr(dr(),s)])},exhibit:function(){return ci({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Qy=Uo("color-input-change"),Zy=Uo("color-swatch-change"),tw=Uo("color-picker-cancel"),ew=function(t,e,n){return{hue:t,saturation:e,value:n}},nw=Uo("rgb-hex-update"),rw=Uo("slider-update"),ow=Uo("palette-update"),iw=Fl({schema:[_e("dom")],name:"label"}),uw=function(t){return Fl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:$r([Yr(Kn(),(function(e,n,r){return t(e,r)}),[e]),Yr(Zn(),(function(e,n,r){return t(e,r)}),[e]),Yr(tr(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},aw=uw("top-left"),cw=uw("top"),sw=uw("top-right"),lw=uw("right"),fw=uw("bottom-right"),dw=uw("bottom"),mw=uw("bottom-left"),gw=[iw,uw("left"),lw,cw,dw,aw,sw,mw,fw,Ll({name:"thumb",defaults:r({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:$r([Qr(Kn(),t,"spectrum"),Qr(Yn(),t,"spectrum"),Qr(Jn(),t,"spectrum"),Qr(Zn(),t,"spectrum"),Qr(tr(),t,"spectrum"),Qr(nr(),t,"spectrum")])}}}),Ll({schema:[Je("mouseIsDown",(function(){return Qe(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:La([km.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Bm.config({})]),events:$r([Kr(Kn(),n),Kr(Yn(),n),Kr(Zn(),n),Kr(tr(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],hw=r("slider.change.value"),pw=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?x.some(n.touches[0]).map((function(t){return uu(t.clientX,t.clientY)})):x.none()}var r=e;return void 0!==r.clientX?x.some(r).map((function(t){return uu(t.clientX,t.clientY)})):x.none()},vw=function(t){return t.model.minX},bw=function(t){return t.model.minY},yw=function(t){return t.model.minX-1},ww=function(t){return t.model.minY-1},xw=function(t){return t.model.maxX},Cw=function(t){return t.model.maxY},Sw=function(t){return t.model.maxX+1},kw=function(t){return t.model.maxY+1},Ow=function(t,e,n){return e(t)-n(t)},Tw=function(t){return Ow(t,xw,vw)},_w=function(t){return Ow(t,Cw,bw)},Ew=function(t){return Tw(t)/2},Aw=function(t){return _w(t)/2},Nw=function(t){return t.stepSize},Rw=function(t){return t.snapToGrid},Mw=function(t){return t.snapStart},zw=function(t){return t.rounded},Dw=function(t,e){return void 0!==t[e+"-edge"]},Bw=function(t){return Dw(t,"left")},Pw=function(t){return Dw(t,"right")},Iw=function(t){return Dw(t,"top")},Lw=function(t){return Dw(t,"bottom")},Hw=function(t){return t.model.value.get()},Fw=function(t){return{x:t}},Vw=function(t){return{y:t}},jw=function(t,e){return{x:t,y:e}},Uw=function(t,e){Vr(t,hw(),{value:e})},Ww=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},qw=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},$w=function(t,e,n){return Math.max(e,Math.min(n,t))},Gw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=$w(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return $w(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},Xw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},Kw="top",Yw="right",Jw="bottom",Qw="left",Zw=function(t){return t.element.dom.getBoundingClientRect()},tx=function(t,e){return t[e]},ex=function(t){var e=Zw(t);return tx(e,Qw)},nx=function(t){var e=Zw(t);return tx(e,Yw)},rx=function(t){var e=Zw(t);return tx(e,Kw)},ox=function(t){var e=Zw(t);return tx(e,Jw)},ix=function(t){var e=Zw(t);return tx(e,"width")},ux=function(t){var e=Zw(t);return tx(e,"height")},ax=function(t,e,n){return(t+e)/2-n},cx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Qw),i=tx(n,Yw),u=tx(r,Qw);return ax(o,i,u)},sx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Kw),i=tx(n,Jw),u=tx(r,Kw);return ax(o,i,u)},lx=function(t,e){Vr(t,hw(),{value:e})},fx=function(t){return{x:t}},dx=function(t,e,n){var r={min:vw(e),max:xw(e),range:Tw(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),maxBound:nx(t),screenRange:ix(t)};return Gw(r)},mx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).x,vw(n),xw(n),Nw(n));return lx(e,fx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},gx=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ix(t),u=r.bind((function(e){return x.some(cx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(cx(e,t))})).getOr(i),c={min:vw(e),max:xw(e),range:Tw(e),value:n,hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),minOffset:0,maxBound:nx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return ex(e)-ex(t)+u},hx=mx(-1),px=mx(1),vx=x.none,bx=x.none,yx={"top-left":x.none(),top:x.none(),"top-right":x.none(),right:x.some((function(t,e){Uw(t,Fw(Sw(e)))})),"bottom-right":x.none(),bottom:x.none(),"bottom-left":x.none(),left:x.some((function(t,e){Uw(t,Fw(yw(e)))}))},wx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n),o=fx(r);return lx(t,o),r},setToMin:function(t,e){var n=vw(e);lx(t,fx(n))},setToMax:function(t,e){var n=xw(e);lx(t,fx(n))},findValueOfOffset:dx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.left}))},findPositionOfValue:gx,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=fu(e.element)/2;Bi(e.element,"left",i-u+"px")},onLeft:hx,onRight:px,onUp:vx,onDown:bx,edgeActions:yx}),xx=function(t,e){Vr(t,hw(),{value:e})},Cx=function(t){return{y:t}},Sx=function(t,e,n){var r={min:bw(e),max:Cw(e),range:_w(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),maxBound:ox(t),screenRange:ux(t)};return Gw(r)},kx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).y,bw(n),Cw(n),Nw(n));return xx(e,Cx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},Ox=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ux(t),u=r.bind((function(e){return x.some(sx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(sx(e,t))})).getOr(i),c={min:bw(e),max:Cw(e),range:_w(e),value:n,hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),minOffset:0,maxBound:ox(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return rx(e)-rx(t)+u},Tx=x.none,_x=x.none,Ex=kx(-1),Ax=kx(1),Nx={"top-left":x.none(),top:x.some((function(t,e){Uw(t,Vw(ww(e)))})),"top-right":x.none(),right:x.none(),"bottom-right":x.none(),bottom:x.some((function(t,e){Uw(t,Vw(kw(e)))})),"bottom-left":x.none(),left:x.none()},Rx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Sx(t,e,n),o=Cx(r);return xx(t,o),r},setToMin:function(t,e){var n=bw(e);xx(t,Cx(n))},setToMax:function(t,e){var n=Cw(e);xx(t,Cx(n))},findValueOfOffset:Sx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.top}))},findPositionOfValue:Ox,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ru(e.element)/2;Bi(e.element,"top",i-u+"px")},onLeft:Tx,onRight:_x,onUp:Ex,onDown:Ax,edgeActions:Nx}),Mx=function(t,e){Vr(t,hw(),{value:e})},zx=function(t,e){return{x:t,y:e}},Dx=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?qw:Ww,i=e?Hw(r).x:o(Hw(r).x,vw(r),xw(r),Nw(r)),u=e?o(Hw(r).y,bw(r),Cw(r),Nw(r)):Hw(r).y;return Mx(n,zx(i,u)),x.some(i)}(t,e,n,r).map((function(){return!0}))}},Bx=Dx(-1,!1),Px=Dx(1,!1),Ix=Dx(-1,!0),Lx=Dx(1,!0),Hx={"top-left":x.some((function(t,e){Uw(t,jw(yw(e),ww(e)))})),top:x.some((function(t,e){Uw(t,jw(Ew(e),ww(e)))})),"top-right":x.some((function(t,e){Uw(t,jw(Sw(e),ww(e)))})),right:x.some((function(t,e){Uw(t,jw(Sw(e),Aw(e)))})),"bottom-right":x.some((function(t,e){Uw(t,jw(Sw(e),kw(e)))})),bottom:x.some((function(t,e){Uw(t,jw(Ew(e),kw(e)))})),"bottom-left":x.some((function(t,e){Uw(t,jw(yw(e),kw(e)))})),left:x.some((function(t,e){Uw(t,jw(yw(e),Aw(e)))}))},Fx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n.left),o=Sx(t,e,n.top),i=zx(r,o);return Mx(t,i),i},setToMin:function(t,e){var n=vw(e),r=bw(e);Mx(t,zx(n,r))},setToMax:function(t,e){var n=xw(e),r=Cw(e);Mx(t,zx(n,r))},getValueFromEvent:function(t){return pw(t)},setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=fu(e.element)/2,c=ru(e.element)/2;Bi(e.element,"left",i-a+"px"),Bi(e.element,"top",u-c+"px")},onLeft:Bx,onRight:Px,onUp:Ix,onDown:Lx,edgeActions:Hx}),Vx=gf({name:"Slider",configFields:[je("stepSize",1),je("onChange",t),je("onChoose",t),je("onInit",t),je("onDragStart",t),je("onDragEnd",t),je("snapToGrid",!1),je("rounded",!0),Pe("snapStart"),Ee("model",ve("mode",{x:[je("minX",0),je("maxX",100),Je("value",(function(t){return Qe(t.mode.minX)})),_e("getInitialValue"),Zu("manager",wx)],y:[je("minY",0),je("maxY",100),Je("value",(function(t){return Qe(t.mode.minY)})),_e("getInitialValue"),Zu("manager",Rx)],xy:[je("minX",0),je("maxX",100),je("minY",0),je("maxY",100),Je("value",(function(t){return Qe({x:t.mode.minX,y:t.mode.minY})})),_e("getInitialValue"),Zu("manager",Fx)]})),fl("sliderBehaviours",[km,ll]),Je("mouseIsDown",(function(){return Qe(!1)}))],partFields:gw,factory:function(t,e,n,r){var o,i=function(e){return Zl(e,t,"thumb")},u=function(e){return Zl(e,t,"spectrum")},a=function(e){return Ql(e,t,"left-edge")},c=function(e){return Ql(e,t,"right-edge")},l=function(e){return Ql(e,t,"top-edge")},f=function(e){return Ql(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:l,getBottomEdge:f,getSpectrum:u})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),x.some(!0)},p=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Ql(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},b=function(e,n){n.stop(),t.onDragEnd(e,i(e)),p(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.sliderBehaviours,[km.config({mode:"special",focusIn:function(e){return Ql(e,t,"spectrum").map(km.focusIn).map(s)}}),ll.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),Wa.config({channels:(o={},o[Gs()]={onReceive:p},o)})]),events:$r([Kr(hw(),(function(t,e){h(t,e.event.value)})),ro((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),Kr(Kn(),v),Kr(Jn(),b),Kr(Zn(),v),Kr(nr(),b)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),jx=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Vx.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return Vx.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:r({y:0})},components:[n,o],sliderBehaviours:La([Bm.config({})]),onChange:function(t,e,n){Vr(t,rw,{value:n})}})},Ux="form",Wx=[fl("formBehaviours",[ll])],qx=function(t){return"<alloy.field."+t+">"},$x=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.formBehaviours,[ll.config({store:{mode:"manual",getValue:function(e){var n=ef(e,t);return wt(n,(function(t,e){return t().bind((function(t){var n,r;return n=wf.getCurrent(t),r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ho(t.element)),n.fold((function(){return ct.error(r)}),ct.value)})).map(ll.getValue)}))},setValue:function(e,n){yt(n,(function(n,r){Ql(e,t,r).each((function(t){wf.getCurrent(t).each((function(t){ll.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Ql(e,t,n).bind(wf.getCurrent)}}}},Gx={getField:oi((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),Gl(Ux,qx(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:qx(t)})}));return sf(Ux,Wx,o,$x,n)}},Xx=Uo("valid-input"),Kx=Uo("invalid-input"),Yx=Uo("validating-input"),Jx="colorcustom.rgb.",Qx=function(e,n,r,o){var i=function(t,r){return zy.config({invalidClass:n("invalid"),notify:{onValidate:function(e){Vr(e,Yx,{type:t})},onValid:function(e){Vr(e,Xx,{type:t,value:ll.getValue(e)})},onInvalid:function(e){Vr(e,Kx,{type:t,value:ll.getValue(e)})}},validator:{validate:function(t){var n=ll.getValue(t),o=r(n)?ct.value(!0):ct.error(e("aria.input.invalid"));return Sy(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=e("colorcustom.rgb.range"),l=[qb.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),qb.parts.field({data:c,factory:my,inputAttributes:f({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:La([i(o,r),Xb.config({})]),onSetValue:function(e){zy.isInvalid(e)&&zy.run(e).get(t)}})],d="hex"!==o?[qb.parts["aria-descriptor"]({text:s})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(d)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;ll.setValue(t,{red:n,green:r,blue:o})},c=Rg({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Bi(t.element,"background-color","#"+e.value)}))};return mf({factory:function(){var t={red:Qe(x.some(255)),green:Qe(x.some(255)),blue:Qe(x.some(255)),hex:Qe(x.some("ffffff"))},i=function(e){return t[e].get()},l=function(e,n){t[e].set(n)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",x.some(e)),l("green",x.some(n)),l("blue",x.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,x.none()):o(t)},m=function(t,e){var n=e.event;!function(t){return"hex"===t.type}(n)?function(t,e,n){var r=parseInt(n,10);l(e,x.some(r)),i("red").bind((function(t){return i("green").bind((function(e){return i("blue").map((function(n){return Hv(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=zv(e);return Gx.getField(t,"hex").each((function(e){Bm.isFocused(e)||ll.setValue(t,{hex:n.value})})),n}(t,e);s(t,n)}))}(t,n.type,n.value):function(t,e){r(t);var n=Ev(e);l("hex",x.some(e));var o=jv(n);a(t,o),f(o),Vr(t,nw,{hex:n}),s(t,n)}(t,n.value)},g=function(t){return{label:e(Jx+t+".label"),description:e(Jx+t+".description")}},h=g("red"),p=g("green"),v=g("blue"),b=g("hex");return Rt(Gx.sketch((function(t){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[t.field("red",qb.sketch(u(Fv,"red",h.label,h.description,255))),t.field("green",qb.sketch(u(Fv,"green",p.label,p.description,255))),t.field("blue",qb.sketch(u(Fv,"blue",v.label,v.description,255))),t.field("hex",qb.sketch(u(Rv,"hex",b.label,b.description,"ffffff"))),c.asSpec()],formBehaviours:La([zy.config({invalidClass:n("form-invalid")}),Nm("rgb-form-events",[Kr(Xx,m),Kr(Kx,d),Kr(Yx,d)])])}})),{apis:{updateHex:function(t,e){ll.setValue(t,{hex:e.value}),function(t,e){var n=jv(e);a(t,n),f(n)}(t,e),s(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Zx=function(e,n){return mf({name:"ColourPicker",configFields:[_e("dom"),je("onValidHex",t),je("onInvalidHex",t)],factory:function(t){var o,i=Qx(e,n,t.onValidHex,t.onInvalidHex),u=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),o=Vx.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return mf({factory:function(t){var u=r({x:0,y:0}),a=La([wf.config({find:x.some}),Bm.config({})]);return Vx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[n,o],onChange:function(t,e,n){Vr(t,ow,{value:n})},onInit:function(t,e,n,r){i(n.element.dom,Wv(qv))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom;i(n,Wv(e))}(e,n)}},extraApis:{}})}(0,n),a={paletteRgba:Qe(qv)},c=Rg(u.sketch({})),s=Rg(i.sketch({})),l=function(t,e){c.getOpt(t).each((function(t){var n=jv(e);a.paletteRgba.set(n),u.setRgba(t,n)}))},f=function(t,e){s.getOpt(t).each((function(t){i.updateHex(t,e)}))},d=function(t,e,n){j(n,(function(n){n(t,e)}))};return{uid:t.uid,dom:t.dom,components:[c.asSpec(),jx(0,n),s.asSpec()],behaviours:La([Nm("colour-picker-events",[Kr(ow,(o=[f],function(t,e){var n=e.event.value,r=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?ew(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,ew(Math.round(n),Math.round(100*e),Math.round(100*r)))}(a.paletteRgba.get()),i=ew(r.hue,n.x,100-n.y),u=Vv(i),c=zv(u);d(t,c,o)})),Kr(rw,function(){var t=[l,f];return function(e,n){var r=function(t){var e=ew((100-t)/100*360,100,100),n=Vv(e);return zv(n)}(n.event.value.y);d(e,r,t)}}())]),wf.config({find:function(t){return s.getOpt(t)}}),km.config({mode:"acyclic"})])}}})},tC=function(){return wf.config({find:x.some})},eC=function(t){return wf.config({find:function(e){return xo(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},nC={"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","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},rC=function(t){return function(t){return nC[t]}(t)},oC=tinymce.util.Tools.resolve("tinymce.Resource"),iC=tinymce.util.Tools.resolve("tinymce.util.Tools"),uC=Zt([je("preprocess",o),je("postprocess",o)]),aC=function(t,e,n){return ll.config(Rt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},cC=function(t,e){var n=ge("RepresentingConfigs.memento processors",uC,e);return ll.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=ll.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);ll.setValue(i,o)}}})},sC=aC,lC=function(t){return e=No,n=Ro,aC(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}));var e,n},fC=function(t){return ll.config({store:{mode:"memory",initialValue:t}})},dC=Uo("alloy-fake-before-tabstop"),mC=Uo("alloy-fake-after-tabstop"),gC=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:La([Bm.config({ignore:!0}),Xb.config({})])}},hC=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[gC([dC]),t,gC([mC])],behaviours:La([eC(1)])}},pC=function(t,e){Vr(t,ur(),{raw:{which:9,shiftKey:e}})},vC=function(t,e){var n=e.element;yi(n,dC)?pC(t,!0):yi(n,mC)&&pC(t,!1)},bC=function(t){return Ab(t,["."+dC,"."+mC].join(","),c)},yC=!(Ln().browser.isIE()||Ln().browser.isEdge());function wC(t,e){return SC(document.createElement("canvas"),t,e)}function xC(t){var e=wC(t.width,t.height);return CC(e).drawImage(t,0,0),e}function CC(t){return t.getContext("2d")}function SC(t,e,n){return t.width=e,t.height=n,t}function kC(t){return t.naturalWidth||t.width}function OC(t){return t.naturalHeight||t.height}var TC=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function _C(t,e,n){return e=e||"image/png",N(HTMLCanvasElement.prototype.toBlob)?new TC((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):(r=t.toDataURL(e,n),new TC((function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return x.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,a),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=u[g].charCodeAt(0);s[l]=new Uint8Array(m)}return x.some(new Blob(s,{type:r}))})(r).fold((function(){e("uri is not base64: "+r)}),t)})));var r}function EC(t,e,n){var o=e.type;function i(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:r(o),toBlob:function(){return TC.resolve(e)},toDataURL:r(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return _C(t,e,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(xC)}}}function AC(t){return function(t){return new TC((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return EC(function(t){return function(t){return new TC((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=wC(kC(t),OC(t));return CC(e).drawImage(t,0,0),e}))}(t),t,e)}))}function NC(t,e){return _C(t,e).then((function(e){return EC(TC.resolve(t),e,t.toDataURL())}))}function RC(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var MC=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function zC(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o}function DC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t);var o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*O+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),NC(t,e)}(n,t.getType(),e)}))}function BC(t){return function(e,n){return DC(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var PC,IC,LC=function(t){return function(e){return DC(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),HC=BC((function(t,e){return zC(t,[1,0,0,0,e=RC(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),FC=BC((function(t,e){var n;return e=RC(e,-1,1),zC(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?MC[e]:MC[Math.floor(e)]*(1-n)+MC[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),VC=(PC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),NC(t,e)}(n,t.getType(),e)}))}(t,PC)}),jC=(IC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=CC(t),o=new Array(256),i=0;i<o.length;i++)o[i]=IC(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),NC(t,e)}(n,t.getType(),e)}))});function UC(t,e,n){var r=kC(t),o=OC(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=function(t,e,n){return new TC((function(r){var o=kC(t),i=OC(t),u=Math.floor(o*e),a=Math.floor(i*n),c=wC(u,a);CC(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}(t,i,u);return a?c.then((function(t){return UC(t,e,n)})):c}var WC,qC=function(t){return LC(t)},$C=function(t){return VC(t)},GC=function(t,e){return jC(t,e)},XC=function(t,e){return HC(t,e)},KC=function(t,e){return FC(t,e)},YC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),NC(r,e)}(n,t.getType(),e)}))}(t,e)},JC=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return UC(r,e,n).then((function(e){return NC(e,t.getType())}))}))}(t,e,n)},QC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||SC(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),NC(r,e)}(n,t.getType(),e)}))}(t,e)},ZC=function(t,e){return f({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},tS=function(t,e){return ZC(zg(t,e),{})},eS=function(t,e){return ZC(zg(t,e),{behaviours:La([Am.config({})])})},nS=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:La([Am.config({})])}},rS=Uo("toolbar.button.execute"),oS=((WC={})[yr()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],WC),iS=Uo("update-menu-text"),uS=Uo("update-menu-icon"),aS=function(e,n,r){var o=Qe(t),u=e.text.map((function(t){return Rg(nS(t,n,r.providers))})),a=e.icon.map((function(t){return Rg(eS(t,r.providers.icons))})),c=function(t,e){var n=ll.getValue(t);return Bm.focus(n),Vr(n,"keydown",{raw:e.event.raw}),Yy.close(n),x.some(!0)},s=e.role.fold((function(){return{}}),(function(t){return{role:t}})),l=e.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}}));return Rg(Yy.sketch(f(f(f({},e.uid?{uid:e.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(V(e.classes,(function(t){return n+"--"+t}))),attributes:f({},l)},components:lv([a.map((function(t){return t.asSpec()})),u.map((function(t){return t.asSpec()})),x.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:zg("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:La(m(e.dropdownBehaviours,[nv((function(){return e.disabled||r.providers.isDisabled()})),ev(),Jy.config({}),Am.config({}),Nm("dropdown-events",[uv(e,o),av(e,o)]),Nm("menubutton-update-display-text",[Kr(iS,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[Yi(r.providers.translate(e.event.text))])}))})),Kr(uS,(function(t,e){a.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[eS(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Rt(oS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:La([km.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:Mh(0,e.columns,e.presets)},fetch:function(t){return Cy(i(e.fetch,t))}}))).asSpec()},cS=function(t){return"separator"===t.type},sS={type:"separator"},lS=function(t,e){var n=function(t,e){var n=$(t,(function(t,n){return function(t){return k(t)}(n)?""===n?t:"|"===n?t.length>0&&!cS(t[t.length-1])?t.concat([sS]):t:Tt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&cS(n[n.length-1])&&n.pop(),n}(k(t)?t.split(" "):t,e);return q(n,(function(t,n){var r=function(t,e){return function(t){return Tt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=lS(n,e);return{item:t,menus:Rt(r.menus,Vt(t.value,r.items)),expansions:Rt(r.expansions,Vt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}}(function(t){if(cS(t))return t;var e=Ot(t,"value").getOrThunk((function(){return Uo("generated-menu-item")}));return Rt({value:e},t)}(n),e);return{menus:Rt(t.menus,r.menus),items:[r.item].concat(t.items),expansions:Rt(t.expansions,r.expansions)}}),{menus:{},expansions:{},items:[]})},fS=function(t,e,n,r){var o=Uo("primary-menu"),i=lS(t,n.shared.providers.menuItems());if(0===i.items.length)return x.none();var u=Cb(o,i.items,e,n,r),a=wt(i.menus,(function(t,r){return Cb(r,t,e,n,!1)})),c=Rt(a,Vt(o,u));return x.from(pg.tieredData(o,c,i.expansions))},dS=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setActive:function(e){var n=t.element;e?(vi(n,"tox-tbtn--enabled"),zo(n,"aria-pressed",!0)):(bi(n,"tox-tbtn--enabled"),Io(n,"aria-pressed"))},isActive:function(){return yi(t.element,"tox-tbtn--enabled")}}},mS=function(t,e,n,r){return aS({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(fS(t,ph.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:dS,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({})]},e,n.shared)},gS=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){$a(e.element),Vr(e,ry,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(V(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return f(f({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},hS=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=f({buttonBehaviours:La([nv((function(){return t.disabled||i.isDisabled()})),ev(),Xb.config({}),Nm("button press",[Xr("click"),Xr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Rt(a,{dom:r});return Rt(c,{components:o})},pS=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return tS(t,n.icons)})),u=lv([i]);return hS(t,e,r,o,u,n)},vS=function(t,e,n,r){void 0===r&&(r=[]);var o=pS(t,x.some(e),n,r);return Ng.sketch(o)},bS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return tS(t,n.icons)})):x.none(),a=u.isSome()?lv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=m(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=f(f({tag:"button",classes:s},c),{attributes:{title:i}});return hS(t,e,r,l,a,n)},yS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=bS(t,x.some(e),n,r,o);return Ng.sketch(i)},wS=function(t,e){return function(n){"custom"===e?Vr(n,ry,{name:t,value:{}}):"submit"===e?Fr(n,oy):"cancel"===e?Fr(n,ny):console.error("Unknown button type: ",e)}},xS=function(e,n,r){if(function(t,e){return"menu"===e}(0,n)){var o=e,i=f(f({},e),{onSetup:function(n){return n.setDisabled(e.disabled),t},fetch:gS(o.items,(function(){return u}),r)}),u=Rg(mS(i,"tox-tbtn",r,x.none()));return u.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,n)){var a=wS(e.name,n),c=f(f({},e),{borderless:!1});return yS(c,a,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},CS=r([je("field1Name","field1"),je("field2Name","field2"),Ju("onLockedChange"),Gu(["lockClass"]),je("locked",!1),gl("coupledFieldBehaviours",[wf,ll])]),SS=function(t,e){return Ll({factory:qb,name:t,overrides:function(t){return{fieldBehaviours:La([Nm("coupled-input-behaviour",[Kr(cr(),(function(n){(function(t,e,n){return Ql(t,e,n).bind(wf.getCurrent)})(n,t,e).each((function(e){Ql(n,t,"lock").each((function(r){Gm.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},kS=r([SS("field1","field2"),SS("field2","field1"),Ll({factory:Ng,schema:[_e("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:La([Gm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),OS=gf({name:"FormCoupledInputs",configFields:CS(),partFields:kS(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hl(t.coupledFieldBehaviours,[wf.config({find:x.some}),ll.config({store:{mode:"manual",getValue:function(e){var n,r=rf(e,t,["field1","field2"]);return(n={})[t.field1Name]=ll.getValue(r.field1()),n[t.field2Name]=ll.getValue(r.field2()),n},setValue:function(e,n){var r=rf(e,t,["field1","field2"]);_t(n,t.field1Name)&&ll.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&ll.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Ql(e,t,"field1")},getField2:function(e){return Ql(e,t,"field2")},getLock:function(e){return Ql(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),TS=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return ct.value({value:n,unit:r})}return ct.error(t)},_S=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?x.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?x.some(t.value):x.some(t.value/n[t.unit]*n[e]):x.none()},ES=function(t){return x.none()},AS=function(t,e){var n=ES,r=Uo("ratio-event"),o=OS.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:zg("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:zg("unlock",e.icons)}}],buttonBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return qb.parts.field({factory:my,inputClasses:["tox-textfield"],inputBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({}),Nm("size-input-events",[Kr(or(),(function(t,e){Vr(t,r,{isField1:n})})),Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=OS.parts.field1(i([qb.parts.label(a("Width")),u(!0)])),s=OS.parts.field2(i([qb.parts.label(a("Height")),u(!1)]));return OS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){TS(ll.getValue(t)).each((function(t){n(t).each((function(t){ll.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.disable),OS.getField2(t).bind(qb.getField).each(kp.disable),OS.getLock(t).each(kp.disable)},onEnabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.enable),OS.getField2(t).bind(qb.getField).each(kp.enable),OS.getLock(t).each(kp.enable)}}),ev(),Nm("size-input-events2",[Kr(r,(function(t,e){var r,o,i,u,a=e.event.isField1,c=a?OS.getField1(t):OS.getField2(t),s=a?OS.getField2(t):OS.getField1(t),l=c.map(ll.getValue).getOr(""),f=s.map(ll.getValue).getOr("");r=f,n=(o=TS(l).toOptional(),i=TS(r).toOptional(),u=function(t,e){return _S(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return _S(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(ES)},o.isSome()&&i.isSome()?x.some(u(o.getOrDie(),i.getOrDie())):x.none()).getOr(ES)}))])])})},NS={undo:r(Uo("undo")),redo:r(Uo("redo")),zoom:r(Uo("zoom")),back:r(Uo("back")),apply:r(Uo("apply")),swap:r(Uo("swap")),transform:r(Uo("transform")),tempTransform:r(Uo("temp-transform")),transformApply:r(Uo("transform-apply"))},RS=r("save-state"),MS=r("disable"),zS=r("enable"),DS={formActionEvent:ry,saveState:RS,disable:MS,enable:zS},BS=function(e,n){var o=function(t,e,r,o){return Rg(yS({name:t,text:t,disabled:r,primary:o,icon:x.none(),borderless:!1},e,n))},i=function(t,e,r,o){return Rg(vS({name:t,icon:x.some(t),tooltip:x.some(e),disabled:o,primary:!1,borderless:!1},r,n))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=t,l=function(t,e,n){Vr(t,e,n)},f=function(t){return Fr(t,DS.disable())},d=function(t){return Fr(t,DS.enable())},m=function(t,e){f(t),l(t,NS.transform(),{transform:e}),d(t)},g=function(t){return function(){et.getOpt(t).each((function(t){Am.set(t,[Z])}))}},h=function(t,e){f(t),l(t,NS.transformApply(),{transform:e,swap:g(t)}),d(t)},p=function(){return o("Back",(function(t){return l(t,NS.back(),{swap:g(t)})}),!1,!1)},v=function(){return Rg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:La([kp.config({})])})},b=function(){return o("Apply",(function(t){return l(t,NS.apply(),{swap:g(t)})}),!0,!0)},y=function(){return function(t){var n=e.getRect();return function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return function(t,e,n,r,o,i){var u=wC(o,i);return CC(u).drawImage(t,-n,-r),NC(u,e)}(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)}(t,n.x,n.y,n.w,n.h)}},w=[p(),v(),o("Apply",(function(t){var n=y();h(t,n),e.hideCrop()}),!1,!0)],C=Vb.sketch({dom:c,components:w.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-crop-buttons-events",[Kr(DS.disable(),(function(t,e){u(w,t)})),Kr(DS.enable(),(function(t,e){a(w,t)}))])])}),S=Rg(AS({name:"size",label:x.none(),constrain:!0,disabled:!1},n)),k=[p(),v(),S,v(),o("Apply",(function(t){S.getOpt(t).each((function(e){var n,r,o=ll.getValue(e),i=(n=parseInt(o.width,10),r=parseInt(o.height,10),function(t){return JC(t,n,r)});h(t,i)}))}),!1,!0)],O=Vb.sketch({dom:c,components:k.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-resize-buttons-events",[Kr(DS.disable(),(function(t,e){u(k,t)})),Kr(DS.enable(),(function(t,e){a(k,t)}))])])}),T=function(t,e){return function(n){return t(n,e)}},_=T(YC,"h"),E=T(YC,"v"),A=T(QC,-90),N=T(QC,90),R=function(t,e){!function(t,e){f(t),l(t,NS.tempTransform(),{transform:e}),d(t)}(t,e)},M=[p(),v(),i("flip-horizontally","Flip horizontally",(function(t){R(t,_)}),!1),i("flip-vertically","Flip vertically",(function(t){R(t,E)}),!1),i("rotate-left","Rotate counterclockwise",(function(t){R(t,A)}),!1),i("rotate-right","Rotate clockwise",(function(t){R(t,N)}),!1),v(),b()],z=Vb.sketch({dom:c,components:M.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-fliprotate-buttons-events",[Kr(DS.disable(),(function(t,e){u(M,t)})),Kr(DS.enable(),(function(t,e){a(M,t)}))])])}),D=function(t,e,o,i,u){var a=Vx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}),c=Vx.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=Vx.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Rg(Vx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:u,getInitialValue:r({x:i})},components:[a,c,s],sliderBehaviours:La([Bm.config({})]),onChoose:e}))},B=function(t,e,n,r,o){return D(t,(function(t,n,r){var o=T(e,r.x/100);m(t,o)}),n,r,o)},P=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[p(),B(t,e,n,r,o),b()]}(t,e,n,r,o);return Vb.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-filter-panel-buttons-events",[Kr(DS.disable(),(function(t,e){u(i,t)})),Kr(DS.enable(),(function(t,e){a(i,t)}))])])})},I=[p(),v(),b()],L=Vb.sketch({dom:c,components:I.map((function(t){return t.asSpec()}))}),H=P("Brightness",XC,-100,0,100),F=P("Contrast",KC,-100,0,100),V=P("Gamma",GC,-100,0,100),j=function(t,e,n){return function(r){return function(t,e,n,r){return function(t,e,n,r){return DC(t,function(t,e,n,r){return zC([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[e=RC(e,0,2),0,0,0,0,0,n=RC(n,0,2),0,0,0,0,0,r=RC(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}(0,e,n,r))}(t,e,n,r)}(r,t,e,n)}},U=function(t){return D(t,(function(t,e,n){var r=W.getOpt(t),o=$.getOpt(t),i=q.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=ll.getValue(e).x/100,i=ll.getValue(r).x/100,u=ll.getValue(n).x/100,a=j(o,i,u);m(t,a)}))}))}))}),0,100,200)},W=U("R"),q=U("G"),$=U("B"),G=[p(),W,q,$,b()],X=Vb.sketch({dom:c,components:G.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){l(r,NS.swap(),{transform:e,swap:function(){et.getOpt(r).each((function(e){Am.set(e,[t]),n(e)}))}})}},Y=x.some($C),J=x.some(qC),Q=[i("crop","Crop",K(C,x.none(),(function(t){e.showCrop()})),!1),i("resize","Resize",K(O,x.none(),(function(t){S.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;ll.setValue(t,{width:r,height:o})}))})),!1),i("orientation","Orientation",K(z,x.none(),s),!1),i("brightness","Brightness",K(H,x.none(),s),!1),i("sharpen","Sharpen",K(L,Y,s),!1),i("contrast","Contrast",K(F,x.none(),s),!1),i("color-levels","Color levels",K(X,x.none(),s),!1),i("gamma","Gamma",K(V,x.none(),s),!1),i("invert","Invert",K(L,J,s),!1)],Z=Vb.sketch({dom:c,components:Q.map((function(t){return t.asSpec()}))}),tt=Vb.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:La([Am.config({})])}),et=Rg(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},PS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),IS=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),LS=tinymce.util.Tools.resolve("tinymce.util.Observable"),HS=tinymce.util.Tools.resolve("tinymce.util.VK");function FS(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function VS(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(FS(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){FS(t),IS(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};this.destroy=function(){IS(a).off()},IS(a).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);FS(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=IS("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(u.body),IS(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)}))}var jS,US=0,WS=function(t){var e=Rg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=Qe(1),r=Qe(x.none()),o=Qe({x:0,y:0,w:1,h:1}),i=Qe({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=fu(t.element),c=ru(t.element),s=i.dom.naturalWidth*u,l=i.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Pi(i,m),e.getOpt(t).each((function(t){Pi(t.element,m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=en("img");return zo(a,"src",e),(r=a.dom,new Gg((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){return s.getOpt(t).map((function(t){var e=Ji({element:a});Am.replaceAt(t,1,x.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=PS.inflate(c,-20,-20);return o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=fu(t.element),o=ru(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a),a}))}))},c=Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:La([Nm("image-panel-crop-events",[ro((function(t){s.getOpt(t).each((function(t){var e=function(t,e,n,r,o){var i,u="tox-crid-"+US++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function l(e,r,o,i){var u,a,c,l,f;u=r.x,a=r.y,c=r.w,l=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=PS.clamp({x:u,y:a,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)}function f(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),IS("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}iC.each(a,(function(e){IS("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){f(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}IS('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),iC.each(c,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),iC.each(a,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=iC.map(a,(function(e){var n;return new VS(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),IS(r).on("focusin focusout",(function(t){IS(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),IS(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)}switch(iC.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1})),e.keyCode){case HS.LEFT:r(e,0,t,-10,0);break;case HS.RIGHT:r(e,0,t,10,0);break;case HS.UP:r(e,0,t,0,-10);break;case HS.DOWN:r(e,0,t,0,10);break;case HS.ENTER:case HS.SPACEBAR:e.preventDefault(),o()}}));var g=iC.extend({toggleVisibility:function(t){var e=iC.map(a,(function(t){return"#"+u+"-"+t.name})).concat(iC.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?IS(e,r).show():IS(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){iC.each(i,(function(t){t.destroy()})),i=[]}},LS);return g}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element.dom,(function(){}));e.toggleVisibility(!1),e.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(x.some(e))}))}))])])}],containerBehaviours:La([Am.config({}),Nm("image-panel-events",[ro((function(e){a(e,t)}))])])}),s=Rg(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.get().each((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.get().each((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},qS=function(t,e,n,r,o){return vS({name:t,icon:x.some(e),disabled:n,tooltip:x.some(t),primary:!1,borderless:!1},r,o)},$S=function(t,e){e?kp.enable(t):kp.disable(t)},GS=function(e,n){var r=function(t){var e=Qe(t),n=Qe(x.none()),r=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();r.add(t);var o=function(t){e.set(t)},i=function(t){return{blob:t,url:URL.createObjectURL(t)}},u=function(t){URL.revokeObjectURL(t.url)},a=function(){n.get().each(u),n.set(x.none())},c=function(t){var e,n=i(t);return o(n),e=r.add(n).removed,iC.each(e,u),n.url};return{getBlobState:function(){return e.get()},setBlobState:o,addBlobState:c,getTempState:function(){return n.get().fold((function(){return e.get()}),(function(t){return t}))},updateTempState:function(t){var e=i(t);return a(),n.set(x.some(e)),e.url},addTempState:function(t){var e=i(t);return n.set(x.some(e)),e.url},applyTempState:function(t){return n.get().fold((function(){}),(function(e){c(e.blob),t()}))},destroyTempState:a,undo:function(){var t=r.undo();return o(t),t.url},redo:function(){var t=r.redo();return o(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}}(e.currentState),o=function(t){var e=r.getHistoryStates();m.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Vr(t,DS.formActionEvent,{name:DS.saveState(),value:e.undoEnabled})},i=function(t){return t.toBlob()},u=function(t){Vr(t,DS.formActionEvent,{name:DS.disable(),value:{}})},a=function(t){g.getApplyButton(t).each((function(t){kp.enable(t)})),Vr(t,DS.formActionEvent,{name:DS.enable(),value:{}})},c=function(t,e){return u(t),d.updateSrc(t,e)},s=function(t,e,n,r,s){return u(t),function(t){return AC(t)}(e).then(n).then(i).then(r).then((function(e){return c(t,e).then((function(e){return o(t),s(),a(t),e}))})).catch((function(e){return console.log(e),a(t),e}))},l=function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(t){return r.updateTempState(t)}),n)},f=function(t){var e=r.getBlobState().url;return r.destroyTempState(),o(t),e},d=WS(e.currentState.url),m=function(t){var e=Rg(qS("Undo","undo",!0,(function(t){Vr(t,NS.undo(),{direction:1})}),t)),n=Rg(qS("Redo","redo",!0,(function(t){Vr(t,NS.redo(),{direction:1})}),t));return{container:Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),qS("Zoom in","zoom-in",!1,(function(t){Vr(t,NS.zoom(),{direction:1})}),t),qS("Zoom out","zoom-out",!1,(function(t){Vr(t,NS.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){$S(t,r)})),n.getOpt(t).each((function(t){$S(t,o)}))}}}(n),g=BS(d,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[g.memContainer.asSpec(),d.memContainer.asSpec(),m.container],behaviours:La([ll.config({store:{mode:"manual",getValue:function(){return r.getBlobState()}}}),Nm("image-tools-events",[Kr(NS.undo(),(function(t,e){var n=r.undo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.redo(),(function(t,e){var n=r.redo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.zoom(),(function(t,e){var n=e.event.direction;d.zoom(t,n)})),Kr(NS.back(),(function(t,e){!function(t){var e=f(t);c(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),d.hideCrop()})),Kr(NS.apply(),(function(t,e){r.applyTempState((function(){f(t),(0,e.event.swap)()}))})),Kr(NS.transform(),(function(e,n){return l(e,n.event.transform,t)})),Kr(NS.tempTransform(),(function(e,n){return function(e,n){var o=r.getTempState().blob;s(e,o,n,(function(t){return r.addTempState(t)}),t)}(e,n.event.transform)})),Kr(NS.transformApply(),(function(t,e){return function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(e){var n=r.addBlobState(e);return f(t),n}),n)}(t,e.event.transform,e.event.swap)})),Kr(NS.swap(),(function(t,e){!function(t){m.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){l(t,e,r)}))}))]),tC()])}},XS=function(t){return!Tt(t,"items")},KS="data-value",YS=function(t,e,n,r){return V(n,(function(n){return XS(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){ll.setValue(t,n.value),Vr(t,ty,{name:e}),Bm.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return YS(t,e,n.items,r)}}}))},JS=function(t,e){return it(t,(function(t){return XS(t)?pf(t.value===e,t):JS(t.items,e)}))},QS=mf({name:"HtmlSelect",configFields:[_e("options"),fl("selectBehaviours",[Bm,ll]),je("selectClasses",[]),je("selectAttributes",{}),Pe("data")],factory:function(t,e){var n=V(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Vt("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:ml(t.selectBehaviours,[Bm.config({}),ll.config({store:f({mode:"manual",getValue:function(t){return qi(t.element)},setValue:function(e,n){G(t.options,(function(t){return t.value===n})).isSome()&&$i(e.element,n)}},r)})])}}}),ZS=function(t,e){var n=t.label.map((function(t){return Zb(t,e)})),o=[kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),km.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Fr(t,oy),x.some(!0)}}),Nm("textfield-change",[Kr(cr(),(function(e,n){Vr(e,ty,{name:t.name})})),Kr(vr(),(function(e,n){Vr(e,ty,{name:t.name})}))]),Xb.config({})],i=t.validation.map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=ll.getValue(e),r=t.validator(n);return Sy(!0===r?ct.value(n):ct.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),u=t.placeholder.fold(r({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(r({}),(function(t){return{inputmode:t}})),c=f(f({},u),a),s=qb.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:c,inputClasses:[t.classname],inputBehaviours:La(K([o,i])),selectOnFocus:!1,factory:my}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),d=[kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()];return Yb(n,s,l,d)},tk=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return $r([Kr(t.event,n),oo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Kr(t,(function(){return e.cancel()}))]})).getOr([])))}}),ek=function(t){var e=Qe(null);return ui({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},nk=Object.freeze({__proto__:null,throttle:ek,init:function(t){return t.stream.streams.state(t)}}),rk=[Ee("stream",ve("mode",{throttle:[_e("delay"),je("stopEvent",!0),Zu("streams",{setup:function(t,e){var n=t.stream,r=Lg(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:ek})]})),je("event","input"),Pe("cancelEvent"),Ju("onStream")],ok=Fa({fields:rk,name:"streaming",active:tk,state:nk}),ik=function(t,e,n){var r=ll.getValue(n);ll.setValue(e,r),ak(e)},uk=function(t,e){var n=t.element,r=qi(n),o=n.dom;"number"!==Do(n,"type")&&e(o,r)},ak=function(t){uk(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},ck=r("alloy.typeahead.itemexecute"),sk=r([Pe("lazySink"),_e("fetch"),je("minChars",5),je("responseTime",1e3),Ku("onOpen"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),je("layouts",x.none()),je("eventOrder",{}),Ye("model",{},[je("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),je("selectsOver",!0),je("populateFromBrowse",!0)]),Ku("onSetValue"),Yu("onExecute"),Ku("onItemExecute"),je("inputClasses",[]),je("inputAttributes",{}),je("inputStyles",{}),je("matchWidth",!0),je("useMinWidth",!1),je("dismissOnBlur",!0),Gu(["openClass"]),Pe("initialData"),fl("typeaheadBehaviours",[Bm,ll,ok,km,Gm,Py]),Je("previewing",(function(){return Qe(!0)}))].concat(sy()).concat(Gy())),lk=r([Hl({schema:[$u()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){(function(t,e,n){if(t.selectsOver){var r=ll.getValue(e),o=t.getDisplayText(r),i=ll.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?x.some((function(){ik(0,e,n),function(t,e){uk(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):x.none()}return x.none()})(t.model,r,n).fold((function(){return Nf.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Vr(t,ck(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)}))}}}})]),fk=gf({name:"Typeahead",configFields:sk(),partFields:lk(),factory:function(e,n,r,o){var i=function(n,r,i){e.previewing.set(!1);var u=Py.getCoupled(n,"sandbox");Ws.isOpen(u)?wf.getCurrent(u).each((function(t){Nf.getHighlighted(t).fold((function(){i(t)}),(function(){qr(u,t.element,"keydown",r)}))})):Fy(e,a(n),n,u,o,(function(t){wf.getCurrent(t).each(i)}),py.HighlightFirst).get(t)},u=ly(e),a=function(t){return function(e){return e.map((function(e){var n=kt(e.menus),r=Y(n,(function(t){return W(t.items,(function(t){return"item"===t.type}))}));return ll.getState(t).update(V(r,(function(t){return t.data}))),e}))}},c=[Bm.config({}),ll.config({onSetValue:e.onSetValue,store:f({mode:"dataset",getDataKey:function(t){return qi(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){$i(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(t){return Vt("initialValue",t)})).getOr({}))}),ok.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(n,r){var i=Py.getCoupled(n,"sandbox");if(Bm.isFocused(n)&&qi(n.element).length>=e.minChars){var u=wf.getCurrent(i).bind((function(t){return Nf.getHighlighted(t).map(ll.getValue)}));e.previewing.set(!0),Fy(e,a(n),n,i,o,(function(t){wf.getCurrent(i).each((function(t){u.fold((function(){e.model.selectsOver&&Nf.highlightFirst(t)}),(function(e){Nf.highlightBy(t,(function(t){return ll.getValue(t).value===e.value})),Nf.getHighlighted(t).orThunk((function(){return Nf.highlightFirst(t),x.none()}))}))}))}),py.HighlightFirst).get(t)}},cancelEvent:kr()}),km.config({mode:"special",onDown:function(t,e){return i(t,e,Nf.highlightFirst),x.some(!0)},onEscape:function(t){var e=Py.getCoupled(t,"sandbox");return Ws.isOpen(e)?(Ws.close(e),x.some(!0)):x.none()},onUp:function(t,e){return i(t,e,Nf.highlightLast),x.some(!0)},onEnter:function(t){var n=Py.getCoupled(t,"sandbox"),r=Ws.isOpen(n);if(r&&!e.previewing.get())return wf.getCurrent(n).bind((function(t){return Nf.getHighlighted(t)})).map((function(e){return Vr(t,ck(),{item:e}),!0}));var o=ll.getValue(t);return Fr(t,kr()),e.onExecute(n,t,o),r&&Ws.close(n),x.some(!0)}}),Gm.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){return Gm.on(t)},onClose:function(){return Gm.off(t)}})}}}),Nm("typeaheadevents",[uo((function(n){var r=t;jy(e,a(n),n,o,r,py.HighlightFirst).get(t)})),Kr(ck(),(function(t,n){var r=Py.getCoupled(t,"sandbox");ik(e.model,t,n.event.item),Fr(t,kr()),e.onItemExecute(t,r,n.event.item,ll.getValue(t)),Ws.close(r),ak(t)}))].concat(e.dismissOnBlur?[Kr(pr(),(function(t){var e=Py.getCoupled(t,"sandbox");Xa(e.element).isNone()&&Ws.close(e)}))]:[]))];return{uid:e.uid,dom:dy(Rt(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:f(f({},u),ml(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}}}),dk=function(t){return f(f({},t),{toCached:function(){return dk(t.toCached())},bindFuture:function(e){return dk(t.bind((function(t){return t.fold((function(t){return Sy(ct.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return dk(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return dk(t.map((function(t){return t.map(e)})))},mapError:function(e){return dk(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return dk(Cy((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ct.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},mk=function(t){return dk(Cy(t))},gk={type:"separator"},hk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},pk=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},vk=function(t,e){return function(t){return V(t,hk)}(function(t,e){return W(e,(function(e){return e.type===t}))}(t,e))},bk=function(t){return vk("header",t.targets)},yk=function(t){return vk("anchor",t.targets)},wk=function(t){return x.from(t.anchorTop).map((function(t){return pk("<top>",t)})).toArray()},xk=function(t){return x.from(t.anchorBottom).map((function(t){return pk("<bottom>",t)})).toArray()},Ck=function(t,e){var n=t.toLowerCase();return W(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return ln(e.toLowerCase(),n)||ln(t.value.toLowerCase(),n)}))},Sk=Uo("aria-invalid"),kk=function(t){return function(e,n,r){return Ot(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},Ok={bar:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),collection:kk((function(t,e){return function(t,e){var n,r,i=t.label.map((function(t){return Zb(t,e)})),u=function(t){return function(e,n){Du(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Do(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||Vr(n,ry,{name:t.name,value:i})})),c=[Kr(rr(),u((function(t,e,n){$a(n)}))),Kr(lr(),a),Kr(xr(),a),Kr(or(),u((function(t,e,n){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)})),vi(n,Sh)}))),Kr(ir(),u((function(t){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)}))}))),uo(u((function(e,n,r,o){Vr(e,ry,{name:t.name,value:o})})))],s=function(t,e){return V(Fc(t.element,".tox-collection__item"),e)},l=qb.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:o},behaviours:La([kp.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){vi(t,"tox-collection__item--state-disabled"),zo(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){bi(t,"tox-collection__item--state-disabled"),Io(t,"aria-disabled")}))}}),ev(),Am.config({}),ll.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=V(r,(function(n){var r=lp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Kb.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?F(o,t.columns):[o],u=V(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ro(n.element,u.join(""))}(n,r),"auto"===t.columns&&Zh(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;km.setGridSize(n,e,r)})),Fr(n,cy)}}),Xb.config({}),km.config((r=t.columns,1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+bh}})),Nm("collection-events",c)]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Yb(i,l,["tox-form__group--collection"],[])}(t,e.shared.providers)})),alertbanner:kk((function(t,e){return function(t,e){return Vb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:zg(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Vr(e,ry,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!0,label:t.label,inputMode:x.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:kk((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=V(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:La([tC(),Am.config({}),lC(x.none()),km.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Rt(n,{source:"dynamic"});return kk(t)(e,o,r)}}((function(t,e){return function(t,e){var n=yC&&t.sandboxed,r=f(f({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=Qe("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)zo(n.element,"srcdoc",r);else{zo(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Zb(t,e)})),u=qb.parts.field({factory:{sketch:function(t){return hC({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:La([Xb.config({}),Bm.config({}),sC(x.none(),o.getValue,o.setValue)])})}}});return Yb(i,u,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),button:kk((function(t,e){return function(t,e){var n,r,o=wS(t.name,"custom");return n=x.none(),r=qb.parts.field(f({factory:Ng},bS(t,x.some(o),e,[fC(""),tC()]))),Yb(n,r,[],[])}(t,e.shared.providers)})),checkbox:kk((function(t,e){return function(t,e){var n=ll.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),x.some(!0)},i=qb.parts.field({factory:{sketch:o},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:La([tC(),kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Bm.config({}),n,km.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Nm("checkbox-events",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),u=qb.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:La([Jy.config({})])}),a=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:zg("checked"===t?"selected":"unselected",e.icons)}}},c=Rg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return qb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,c.asSpec(),u],fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),colorinput:kk((function(t,e){return function(t,e,n){var r=qb.parts.field({factory:my,inputClasses:["tox-textfield"],onSetValue:function(t){return zy.run(t).get((function(){}))},inputBehaviours:La([kp.config({disabled:e.providers.isDisabled}),ev(),Xb.config({}),zy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return bo(t.element)},notify:{onValid:function(t){var e=ll.getValue(t);Vr(t,Qy,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=ll.getValue(t);if(0===e.length)return Sy(ct.value(!0));var n=en("span");Bi(n,"background-color",e);var r=Fi(n,"background-color").fold((function(){return ct.error("blah")}),(function(t){return ct.value(e)}));return Sy(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Zb(t,e.providers)})),i=function(t,e){Vr(t,Zy,{value:e})},u=Rg(function(t,e){return Yy.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:La([nv(e.providers.isDisabled),ev(),Jy.config({}),Xb.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Cy((function(e){return t.fetch(e)})).map((function(r){return x.from(Sb(Rt(sb(Uo("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:fb(t.columns,t.presets)})))}))},parts:{menu:Mh(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[wa,ya,ka]},onLtr:function(){return[ya,wa,ka]}},components:[],fetch:ob(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Fr(t,tw)}),(function(e){i(t,e),tb(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:La([Nm("form-field-events",[Kr(Qy,(function(e,n){u.getOpt(e).each((function(t){Bi(t.element,"background-color",n.event.color)})),Vr(e,ty,{name:t.name})})),Kr(Zy,(function(t,e){qb.getField(t).each((function(n){ll.setValue(n,e.event.value),wf.getCurrent(t).each(Bm.focus)}))})),Kr(tw,(function(t,e){qb.getField(t).each((function(e){wf.getCurrent(t).each(Bm.focus)}))}))])])})}(t,e.shared,e.colorinput)})),colorpicker:kk((function(t){var e=function(t){return"tox-"+t},n=Zx(rC,e),r=Rg(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:La([ll.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return wf.getCurrent(e).bind((function(t){return ll.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);wf.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){ll.setValue(t,{hex:x.from(n[1]).getOr("")}),Gx.getField(t,"hex").each((function(t){Fr(t,cr())}))}))}}}),tC()])}})),dropzone:kk((function(t,e){return function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,(function(t){t(e,n)}))}},o=function(t,e){if(!kp.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){ll.setValue(n,function(t,e){var n=iC.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return W(ot(t),(function(t){return L(n,(function(e){return fn(t.name,"."+e)}))}))}(r,e)),Vr(n,ty,{name:t.name})},a=Rg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:La([Nm("input-file-events",[to(lr()),to(xr())])])}),c=t.label.map((function(t){return Zb(t,e)})),s=qb.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:La([fC([]),tC(),kp.config({}),Gm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Nm("dropzone-events",[Kr("dragenter",r([n,Gm.toggle])),Kr("dragleave",r([n,Gm.toggle])),Kr("dragover",n),Kr("drop",r([n,o])),Kr(sr(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Ng.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:La([Xb.config({}),nv(e.isDisabled),ev()])})]}]}}}});return Yb(c,s,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),grid:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),listbox:kk((function(e,n){return function(e,n){var o=n.shared.providers,i=nt(e.items).filter(XS),u=e.label.map((function(t){return Zb(t,o)})),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[qb.parts.field({dom:{},factory:{sketch:function(o){return aS({uid:o.uid,text:i.map((function(t){return t.text})),icon:x.none(),tooltip:e.label,role:x.none(),fetch:function(t,r){var o=YS(t,e.name,e.items,ll.getValue(t));r(fS(o,ph.CLOSE_ON_EXECUTE,n,!1))},onSetup:r(t),getApi:r({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({}),ll.config({store:{mode:"manual",initialValue:i.map((function(t){return t.value})).getOr(""),getValue:function(t){return Do(t.element,KS)},setValue:function(t,n){JS(e.items,n).each((function(e){zo(t.element,KS,e.value),Vr(t,iS,{text:e.text})}))}}})]},"tox-listbox",n.shared)}}})]};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([u.toArray(),[a]]),fieldBehaviours:La([kp.config({disabled:r(e.disabled),onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}})])})}(e,n)})),selectbox:kk((function(t,e){return function(t,e){var n=V(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Zb(t,e)})),o=qb.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:QS,selectBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Nm("selectbox-change",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),i=t.size>1?x.none():x.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:zg("chevron-down",e.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:K([[o],i.toArray()])};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([r.toArray(),[u]]),fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),sizeinput:kk((function(t,e){return AS(t,e.shared.providers)})),urlinput:kk((function(e,n){return function(e,n,r){var o,i=n.shared.providers,u=function(t){var n=ll.getValue(t);r.addToHistory(n.value,e.filetype)},a=qb.parts.field({factory:fk,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":Sk,type:"url"},minChars:0,responseTime:0,fetch:function(t){var o=function(t,e,n){var r=ll.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=Ck(o,function(t){return V(t,(function(t){return pk(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,Ck(o,bk(e)),Ck(o,K([wk(e),yk(e),xk(e)]))],$(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(gk,e)}),[])):i}))}(e.filetype,t,r),i=fS(o,ph.BUBBLE_TO_SANDBOX,n,!1);return Sy(i)},getHotspot:function(t){return g.getOpt(t)},onSetValue:function(e,n){e.hasConfigured(zy)&&zy.run(e).get(t)},typeaheadBehaviours:La(K([r.getValidationHandler().map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){zo(t.element,"title",i.translate(e))}))}},validator:{validate:function(n){var r=ll.getValue(n);return mk((function(n){t({type:e.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ct.error(t.message);n(e)}else{var r=ct.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[kp.config({disabled:function(){return e.disabled||i.isDisabled()}}),Xb.config({}),Nm("urlinput-events",K(["file"===e.filetype?[Kr(cr(),(function(t){Vr(t,ty,{name:e.name})}))]:[],[Kr(sr(),(function(t){Vr(t,ty,{name:e.name}),u(t)})),Kr(vr(),(function(t){Vr(t,ty,{name:e.name}),u(t)}))]]))]])),eventOrder:(o={},o[cr()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:Mh(0,0,"normal")},onExecute:function(t,e,n){Vr(e,oy,{})},onItemExecute:function(t,n,r,o){u(t),Vr(t,ty,{name:e.name})}}),c=e.label.map((function(t){return Zb(t,i)})),s=Rg(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:zg(n,i.icons),attributes:f({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}}("invalid",x.some(Sk),"warning")),l=Rg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),d=r.getUrlPicker(e.filetype),m=Uo("browser.url.event"),g=Rg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()}})])}),h=Rg(yS({name:e.name,icon:x.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(t){return Fr(t,m)}),i,[],["tox-browse-url"]));return qb.sketch({dom:Qb([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:K([[g.asSpec()],d.map((function(){return h.asSpec()})).toArray()])}]),fieldBehaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable),h.getOpt(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable),h.getOpt(t).each(kp.enable)}}),ev(),Nm("url-input-events",[Kr(m,(function(t){wf.getCurrent(t).each((function(n){var r=ll.getValue(n),o=f({fieldname:e.name},r);d.each((function(r){r(o).get((function(r){ll.setValue(n,r),Vr(t,ty,{name:e.name})}))}))}))}))])])})}(e,n,n.urlinput)})),customeditor:kk((function(t){var e=Qe(x.none()),n=Rg({dom:{tag:t.tag}}),r=Qe(x.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:La([Nm("custom-editor-events",[ro((function(o){n.getOpt(o).each((function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?oC.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(x.none()),e.set(x.some(t))}))}))}))]),ll.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(x.some(n))}),(function(t){return t.setValue(n)}))}}}),tC()]),components:[n.asSpec()]}})),htmlpanel:kk((function(t){return"presentation"===t.presets?Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:La([Xb.config({}),Bm.config({})])})})),imagetools:kk((function(t,e){return GS(t,e.shared.providers)})),table:kk((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(r,(function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}}))}]}),(n=t.cells,{dom:{tag:"tbody"},components:V(n,(function(t){return{dom:{tag:"tr"},components:V(t,o)}}))})],behaviours:La([Xb.config({}),Bm.config({})])}}(t,e.shared.providers)})),panel:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:V(t.items,e.shared.interpreter)}}(t,e)}))},Tk={field:function(t,e){return e}},_k=function(t,e,n){var r=Rt(n,{shared:{interpreter:function(e){return Ek(t,e,r)}}});return Ek(t,e,r)},Ek=function(t,e,n){return Ot(Ok,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},Ak={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Nk=function(t,e,n){var r=hc(-12,12,Ak),o={maxHeightFunction:fc()};return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),bubble:r,layouts:{onRtl:function(){return[Tg]},onLtr:function(){return[Og]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[ya]},onLtr:function(){return[wa]}},overrides:o}}},Rk=function(t,e,n){return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),layouts:{onRtl:function(){return[_g]},onLtr:function(){return[_g]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ka]},onLtr:function(){return[ka]}}}}},Mk=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return x.some(Ac.range(rn(e.startContainer),e.startOffset,rn(e.endContainer),e.endOffset))}}}},zk=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},Dk=function(t,e,n){var r=Up(t),o=function(){return rn(t.getBody())},i=function(){return rn(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:Nk(i,e,u),banner:Rk(i,e,u),cursor:Mk(t,o),node:zk(o)}},Bk=function(t){return function(e,n){cb(t)(e,n)}},Pk=function(t){return function(){return Qv(t)}},Ik=function(t){return function(){return Zv(t)}},Lk=function(t){return function(){return eb(t)}},Hk=function(t){return{colorPicker:Bk(t),hasCustomColors:Pk(t),getColors:Ik(t),getColorCols:Lk(t)}},Fk=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},Vk=function(t){return{isDraggableModal:Fk(t)}},jk=[{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"}]}],Uk=function(t){return $(t,(function(t,e){if(Tt(e,"items")){var n=Uk(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(Tt(e,"inline")||function(t){return Tt(t,"block")}(e)||function(t){return Tt(t,"selector")}(e)){var r="custom-"+(k(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return f(f({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},Wk=function(t){return function(t){return x.from(t.getParam("style_formats")).filter(T)}(t).map((function(e){var n=function(t,e){var n=Uk(e),r=function(e){j(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?jk.concat(n):n})).getOr(jk)},qk=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Rt(t,r)},$k=function(t,e,n,r){var o=function(e){return V(e,(function(e){var i=vt(e);if(_t(e,"items")){var u=o(e.items);return Rt(function(t){return Rt(t,{type:"submenu"})}(e),{getStyleItems:function(){return u}})}return _t(e,"format")?function(t){return qk(t,n,r)}(e):1===i.length&&I(i,"title")?Rt(e,{type:"separator"}):function(e){var o=k(e.name)?e.name:Uo(e.title),i="custom-"+o,u={type:"formatter",format:i,isSelected:n(i),getStylePreview:r(i)},a=Rt(e,u);return t.formatter.register(o,a),a}(e)}))};return o(e)},Gk=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,r):[t.format]},o=Qe([]),i=Qe([]),u=Qe([]),a=Qe([]),c=Qe(!1);return t.on("PreInit",(function(u){var a=Wk(t),c=$k(t,a,e,n);o.set(c),i.set(Y(c,r))})),t.on("addStyleModifications",(function(o){var i=$k(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Y(i,r))})),{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},Xk=iC.trim,Kk=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Yk=Kk("true"),Jk=Kk("false"),Qk=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},Zk=function(t){return t.innerText||t.textContent},tO=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&nO(t)},eO=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},nO=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Yk(t)}return!1}(t)&&!Jk(t)},rO=function(t){return eO(t)&&nO(t)},oO=function(t){var e=function(t){return t.id?t.id:Uo("h")}(t);return Qk("header",Zk(t),"#"+e,function(t){return eO(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},iO=function(e){var n=e.id||e.name,r=Zk(e);return Qk("anchor",r||"#"+n,"#"+n,0,t)},uO=function(t){return Xk(t.title).length>0},aO=function(t){var e=function(t){return V(Fc(rn(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),(function(t){return t.dom}))}(t);return W(function(t){return V(W(t,rO),oO)}(e).concat(function(t){return V(W(t,tO),iO)}(e)),uO)},cO="tinymce-url-history",sO=function(t){return k(t)&&/^https?/.test(t)},lO=function(t){return O(t)&&St(t,(function(t){return!(T(e=t)&&e.length<=5&&J(e,sO));var e})).isNone()},fO=function(){var t,e=Gv.getItem(cO);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+cO+" was not valid JSON",t),{};throw t}return lO(t)?t:(console.log("Local storage "+cO+" was not valid format",t),{})},dO=function(t){var e=fO();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},mO=function(t,e){if(sO(t)){var n=fO(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=W(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!lO(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Gv.setItem(cO,JSON.stringify(t))}(n)}},gO=function(t){return!!t},hO=function(t){return wt(iC.makeMap(t,/[, ]/),gO)},pO=function(t){return x.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(N)},vO=function(t){return x.from(t).filter(k).getOrUndefined()},bO=function(t){return{getHistory:dO,addToHistory:mO,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?x.none():x.some({targets:aO(t.getBody()),anchorTop:vO(Kp(t)),anchorBottom:vO(Yp(t))})}(t)},getValidationHandler:function(){return function(t){return x.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return function(t,e){var n=function(t){var e=x.some(function(t){return t.getParam("file_picker_types")}(t)).filter(gO),n=x.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(gO),r=e.or(n).map(hO);return pO(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return vt(t).length>0&&t}))}))}(t);return _(n)?n?pO(t):x.none():n[e]?pO(t):x.none()}(t,e).map((function(n){return function(r){return Cy((function(o){var i=f({filetype:e,fieldname:r.fieldname},x.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!k(t))throw new Error("Expected value to be string");if(void 0!==e&&!O(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})}),r.value,i)}))}}))}(t,e)}}},yO=r((function(t,e){!function(t,e){var n=lu.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Bi(t,"max-width",n+"px")}(t,Math.floor(e))})),wO="contexttoolbar-hide",xO=r([_e("dom"),je("shell",!0),fl("toolbarBehaviours",[Am])]),CO=r([Fl({name:"groups",overrides:function(){return{behaviours:La([Am.config({})])}}})]),SO=gf({name:"Toolbar",configFields:xO(),partFields:CO(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.toolbarBehaviours,o.behaviours),apis:{setGroups:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"groups")).fold((function(){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")}),(function(t){Am.set(t,n)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),kO=function(t,e,n){return{within:t,extra:e,withinWidth:n}},OO=function(t,e,n){var o,i=(o=function(t,e){var r=n(t);return x.some({element:t,start:e,finish:e+r,width:r})},$(t,(function(t,e){return o(e,t.len).fold(r(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),u=W(i,(function(t){return t.finish<=e})),a=q(u,(function(t,e){return t+e.width}),0);return{within:u,extra:i.slice(u.length),withinWidth:a}},TO=function(t){return V(t,(function(t){return t.element}))},_O=function(t,e){var n=V(e,(function(t){return tu(t)}));SO.setGroups(t,n)},EO=function(t,e,n){var r=Zl(t,e,"primary"),o=Py.getCoupled(t,"overflowGroup");Bi(r.element,"visibility","hidden");var i=e.builtGroups.get().concat([o]),u=it(i,(function(t){return Xa(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),_O(r,i);var a=function(t,e,n,r){var o=function(t,e,n){var r=OO(e,t,n);return 0===r.extra.length?x.some(r):x.none()}(t,e,n).getOrThunk((function(){return OO(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=TO(t.concat(e));return kO(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=TO(t).concat([n]);return kO(o,TO(e),r)}(i,u,r,a):function(t,e,n){return kO(TO(t),[],n)}(i,0,a)}(fu(r.element),e.builtGroups.get(),(function(t){return fu(t.element)}),o);0===a.extra.length?(Am.remove(r,o),n([])):(_O(r,a.within),n(a.extra)),Ui(r.element,"visibility"),Wi(r.element),u.each(Bm.focus)},AO=r([fl("splitToolbarBehaviours",[Py]),Je("builtGroups",(function(){return Qe([])}))]),NO=r([Gu(["overflowToggledClass"]),Fe("getOverflowBounds"),_e("lazySink"),Je("overflowGroups",(function(){return Qe([])}))].concat(AO())),RO=r([Ll({factory:SO,schema:xO(),name:"primary"}),Hl({schema:xO(),name:"overflow"}),Hl({name:"overflow-button"}),Hl({name:"overflow-group"})]),MO=r([Gu(["toggledClass"]),_e("lazySink"),Me("fetch"),Fe("getBounds"),Ve("fireDismissalEventInstead",[je("event",Mr())]),xc()]),zO=r([Hl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:La([Gm.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Hl({factory:SO,schema:xO(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:La([km.config({mode:"cyclic",onEscape:function(e){return Ql(e,t,"button").each(Bm.focus),x.none()}})])}}})]),DO=function(t,e){var n=Py.getCoupled(t,"toolbarSandbox");Ws.isOpen(n)?Ws.close(n):Ws.open(n,e.toolbar())},BO=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Cs.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:yO()}},e,o)},PO=function(t,e,n,r,o){SO.setGroups(e,o),BO(t,e,n,r),Gm.on(t)},IO=gf({name:"FloatingToolbarButton",factory:function(t,e,n,r){return f(f({},Ng.sketch(f(f({},r.button()),{action:function(t){DO(t,r)},buttonBehaviours:hl({dump:r.button().buttonBehaviours},[Py.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Bu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:La([km.config({mode:"special",onEscape:function(t){return Ws.close(t),x.some(!0)}}),Ws.config({onOpen:function(o,i){n.fetch().get((function(o){PO(t,i,n,e.layouts,o),r.link(t.element),km.focusIn(i)}))},onClose:function(){Gm.off(t),Bm.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return Pu(n,r)||Pu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:c},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js({doReposition:function(){Ws.getState(Py.getCoupled(t,"toolbarSandbox")).each((function(r){BO(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(o){PO(e,o,t,n.layouts,r)}))},reposition:function(e){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(r){BO(e,r,t,n.layouts)}))},toggle:function(t){DO(t,r)},getToolbar:function(t){return Ws.getState(Py.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Ws.isOpen(Py.getCoupled(t,"toolbarSandbox"))}}})},configFields:MO(),partFields:zO(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),LO=r([_e("items"),Gu(["itemSelector"]),fl("tgroupBehaviours",[km])]),HO=r([Vl({name:"items",unit:"item"})]),FO=gf({name:"ToolbarGroup",configFields:LO(),partFields:HO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.tgroupBehaviours,[km.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),VO=function(t){return V(t,(function(t){return tu(t)}))},jO=function(t,e,n){EO(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){IO.setGroups(t,VO(r))}))}))},UO=gf({name:"SplitFloatingToolbar",configFields:NO(),partFields:RO(),factory:function(t,e,n,r){var o=Rg(IO.sketch({fetch:function(){return Cy((function(e){e(VO(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[wa,ya]},onRtl:function(){return[ya,wa]},onBottomLtr:function(){return[Ca,xa]},onBottomRtl:function(){return[xa,Ca]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(){return FO.sketch(f(f({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(V(n,e.getSystem().build)),jO(e,o,t)},refresh:function(e){return jO(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){IO.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(IO.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){IO.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(IO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),WO=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},qO=function(t){return t.dimension.property},$O=function(t,e){return t.dimension.getDimension(e)},GO=function(t,e){var n=WO(t,e);xi(n,[e.shrinkingClass,e.growingClass])},XO=function(t,e){bi(t.element,e.openClass),vi(t.element,e.closedClass),Bi(t.element,qO(e),"0px"),Wi(t.element)},KO=function(t,e){bi(t.element,e.closedClass),vi(t.element,e.openClass),Ui(t.element,qO(e))},YO=function(t,e,n,r){n.setCollapsed(),Bi(t.element,qO(e),$O(e,t.element)),Wi(t.element),GO(t,e),XO(t,e),e.onStartShrink(t),e.onShrunk(t)},JO=function(t,e,n,r){var o=r.getOrThunk((function(){return $O(e,t.element)}));n.setCollapsed(),Bi(t.element,qO(e),o),Wi(t.element);var i=WO(t,e);bi(i,e.growingClass),vi(i,e.shrinkingClass),XO(t,e),e.onStartShrink(t)},QO=function(t,e,n){var r=$O(e,t.element);("0px"===r?YO:JO)(t,e,n,x.some(r))},ZO=function(t,e,n){var r=WO(t,e),o=yi(r,e.shrinkingClass),i=$O(e,t.element);KO(t,e);var u=$O(e,t.element);(o?function(){Bi(t.element,qO(e),i),Wi(t.element)}:function(){XO(t,e)})(),bi(r,e.shrinkingClass),vi(r,e.growingClass),KO(t,e),Bi(t.element,qO(e),u),n.setExpanded(),e.onStartGrow(t)},tT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.growingClass)},eT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.shrinkingClass)},nT=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Ui(t.element,qO(e));var r=$O(e,t.element);Bi(t.element,qO(e),r)}},grow:function(t,e,n){n.isExpanded()||ZO(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&QO(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&YO(t,e,n,x.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:tT,isShrinking:eT,isTransitioning:function(t,e,n){return!0===tT(t,e)||!0===eT(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?QO:ZO)(t,e,n)},disableTransitions:GO}),rT=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return ci(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Vt(e.dimension.property,"0px")})},events:function(t,e){return $r([no(fr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(GO(n,t),e.isExpanded()&&Ui(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),oT=[_e("closedClass"),_e("openClass"),_e("shrinkingClass"),_e("growingClass"),Pe("getAnimationRoot"),Ku("onShrunk"),Ku("onStartShrink"),Ku("onGrown"),Ku("onStartGrow"),je("expanded",!1),Ee("dimension",ve("property",{width:[Zu("property","width"),Zu("getDimension",(function(t){return fu(t)+"px"}))],height:[Zu("property","height"),Zu("getDimension",(function(t){return ru(t)+"px"}))]}))],iT=Fa({fields:oT,name:"sliding",active:rT,apis:nT,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(t.expanded);return ui({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:i(e.set,!1),setExpanded:i(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),uT=r([Gu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ku("onOpened"),Ku("onClosed")].concat(AO())),aT=r([Ll({factory:SO,schema:xO(),name:"primary"}),Ll({factory:SO,schema:xO(),name:"overflow",overrides:function(t){return{toolbarBehaviours:La([iT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Ql(e,t,"overflow-button").each((function(t){Gm.off(t),Bm.focus(t)})),t.onClosed(e)},onGrown:function(e){km.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Ql(e,t,"overflow-button").each(Gm.on)}}),km.config({mode:"acyclic",onEscape:function(e){return Ql(e,t,"overflow-button").each(Bm.focus),x.some(!0)}})])}}}),Hl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:La([Gm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Hl({name:"overflow-group"})]),cT=function(t,e){Ql(t,e,"overflow-button").bind((function(){return Ql(t,e,"overflow")})).each((function(n){sT(t,e),iT.toggleGrow(n)}))},sT=function(t,e){Ql(t,e,"overflow").each((function(n){EO(t,e,(function(t){var e=V(t,(function(t){return tu(t)}));SO.setGroups(n,e)})),Ql(t,e,"overflow-button").each((function(t){iT.hasGrown(n)&&Gm.on(t)})),iT.refresh(n)}))},lT=gf({name:"SplitSlidingToolbar",configFields:uT(),partFields:aT(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(t){return FO.sketch(f(f({},r["overflow-group"]()),{items:[Ng.sketch(f(f({},r["overflow-button"]()),{action:function(e){Fr(t,o)}}))]}))}}}),Nm("toolbar-toggle-events",[Kr(o,(function(e){cT(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=V(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),sT(e,t)},refresh:function(e){return sT(e,t)},toggle:function(e){return cT(e,t)},isOpen:function(e){return function(t,e){return Ql(t,e,"overflow").map(iT.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),fT=r(Uo("toolbar-height-change")),dT=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:f({tag:"div",classes:["tox-toolbar__group"]},e),components:[FO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:La([Xb.config({}),Bm.config({})])}},mT=function(t){return FO.sketch(dT(t))},gT=function(t,e){var n=ro((function(e){var n=V(t.initGroups,mT);SO.setGroups(e,n)}));return La([ov(t.providers.isDisabled),ev(),km.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Nm("toolbar-events",[n])])},hT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":dT({title:x.none(),items:[]}),"overflow-button":pS({name:"more",icon:x.some("more-drawer"),disabled:!1,tooltip:x.some("More..."),primary:!1,borderless:!1},x.none(),t.providers)},splitToolbarBehaviours:gT(t,e)}},pT=function(t){var e=hT(t),n=UO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return UO.sketch(f(f({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Ou(e),r=po(e),o=Ou(r),i=Math.max(r.dom.scrollHeight,o.height);return Su(n.x+4,o.y,n.width-8,i)},parts:f(f({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},vT=function(t){var e=lT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=lT.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=hT(t);return lT.sketch(f(f({},r),{components:[e,n],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:function(t){t.getSystem().broadcastOn([fT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([fT()],{type:"closed"})}}))},bT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return SO.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===hh.scrolling?["tox-toolbar--scrolling"]:[])},components:[SO.parts.groups({})],toolbarBehaviours:gT(t,e)})},yT=Zt([Ne("type"),Ee("items",ee([ce([Ne("name"),Be("items",xe)]),xe]))].concat(eh)),wT=[He("text"),He("tooltip"),He("icon"),Me("fetch"),Xe("onSetup",(function(){return t}))],xT=Zt(m([Ne("type")],wT)),CT=function(t){return de("menubutton",xT,t)},ST=Zt([Ne("type"),He("tooltip"),He("icon"),He("text"),Fe("select"),Me("fetch"),Xe("onSetup",(function(){return t})),$e("presets","normal",["normal","color","listpreview"]),je("columns",1),Me("onAction"),Me("onItemAction")]),kT=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=V(o,n.getSystem().build);Ts(n,i)}))};return $r([Kr(br(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;I(o.channels,i)&&n(e,o.data)}})),ro((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),OT=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),TT=[_e("channel"),Pe("renderComponents"),Pe("updateState"),Pe("initialData")],_T=Fa({fields:TT,name:"reflecting",active:kT,apis:OT,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(t){return t}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(x.none())}}}})}),ET=r([_e("toggleClass"),_e("fetch"),Ju("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),Ju("onItemExecute"),Pe("lazySink"),_e("dom"),Ku("onOpen"),fl("splitDropdownBehaviours",[Py,km,Bm]),je("matchWidth",!1),je("useMinWidth",!1),je("eventOrder",{}),Pe("role")].concat(Gy())),AT=Ll({factory:Ng,schema:[_e("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(jr)},buttonBehaviours:La([Gm.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),NT=Ll({factory:Ng,schema:[_e("dom")],name:"button",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),RT=r([AT,NT,Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Ly()]),MT=gf({name:"SplitDropdown",configFields:ET(),partFields:RT(),factory:function(e,n,r,o){var i,u=function(t){wf.getCurrent(t).each((function(t){Nf.highlightFirst(t),km.focusIn(t)}))},a=function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)},c=function(t){var n=Zl(t,e,"button");return jr(n),x.some(!0)},s=f(f({},$r([ro((function(t,n){Ql(t,e,"aria-descriptor").each((function(e){var n=Uo("aria");zo(e.element,"id",n),zo(t.element,"aria-describedby",n)}))}))])),Km(x.some(a))),l={repositionMenus:function(t){Gm.isOn(t)&&$y(t)}};return{uid:e.uid,dom:e.dom,components:n,apis:l,eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),events:s,behaviours:ml(e.splitDropdownBehaviours,[Py.config({others:{sandbox:function(t){var n=Zl(t,e,"arrow");return qy(e,t,{onOpen:function(){Gm.on(n),Gm.on(t)},onClose:function(){Gm.off(n),Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t){return a(t),x.some(!0)}}),Bm.config({}),Gm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),zT=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},DT=function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},BT=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},PT=Uo("focus-button"),IT=["checklist","ordered-list"],LT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],HT=function(t,e,n,r,o,i){var u,a=function(t){return lp.isRtl()&&I(IT,t)?t+"-rtl":t},c=lp.isRtl()&&t.exists((function(t){return I(LT,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:BT(n,i)},components:lv([t.map((function(t){return tS(a(t),i.icons)})),e.map((function(t){return nS(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Zn()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:La([ov(i.isDisabled),ev(),Nm("common-button-display-events",[Kr(Zn(),(function(t,e){e.event.prevent(),Fr(t,PT)}))])].concat(r.map((function(n){return _T.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return lv([t.icon.map((function(t){return tS(a(t),i.icons)})),t.text.map((function(t){return nS(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},FT=function(e,n,r){var o,i=Qe(t),u=HT(e.icon,e.text,e.tooltip,x.none(),x.none(),r);return Ng.sketch({dom:u.dom,components:u.components,eventOrder:oS,buttonBehaviours:La([Nm("toolbar-button-events",[(o={onAction:e.onAction,getApi:n.getApi},uo((function(t,e){iv(o,t)((function(e){Vr(t,rS,{buttonApi:e}),o.onAction(e)}))}))),uv(n,i),av(n,i)]),ov((function(){return e.disabled||r.isDisabled()})),ev()].concat(n.toolbarButtonBehaviours))})},VT=function(t,e,n){return FT(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Nm("toolbarButtonWith",n)]:[]),getApi:zT,onSetup:t.onSetup},e)},jT=function(t,e,n){return Rt(FT(t,{toolbarButtonBehaviours:[Am.config({}),Gm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Nm("toolbarToggleButtonWith",n)]:[]),getApi:DT,onSetup:t.onSetup},e))},UT=function(t,e,n){return function(r){return Cy((function(t){return e.fetch(t)})).map((function(o){return x.from(Sb(Rt(sb(Uo("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,ph.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:fb(e.columns,e.presets),menuBehaviours:tp("auto"!==e.columns?[]:[ro((function(t,n){Zh(t,4,Th(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;km.setGridSize(t,n,r)}))}))])})))}))}},WT=function(t,e){return Kr(rS,(function(n,r){var o=function(t){return{hide:function(){return Fr(t,Sr())},getValue:function(){return ll.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},qT=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Rg(my.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:La([km.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return jr(t),!0}))},onLeft:function(t,e){return e.cut(),x.none()},onRight:function(t,e){return e.cut(),x.none()}})])})),o=function(t,e,n){var r=V(e,(function(e){return Rg(function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(uh(f(f({},o),{type:"togglebutton",onAction:function(){}})));return jT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(rh(f(f({},o),{type:"button",onAction:function(){}})));return VT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r)}(t,e,n))}));return{asSpecs:function(){return V(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return it(e,(function(e,n){return e.primary?x.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(u(kp.isDisabled)):x.none()}))}}}(r,t.commands,e);return[{title:x.none(),items:[r.asSpec()]},{title:x.none(),items:o.asSpecs()}]},$T=function(t,e){var n=yu(window),r=ku(rn(t.getContentAreaContainer())),o=Mp(t)||zp(t)||Bp(t),i=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(r,n),u=i.x,a=i.width;if(t.inline&&!o)return Su(u,n.y,a,n.height);var c=function(t,e,n,r){var o=rn(t.getContainer()),i=zu(o,".tox-editor-header").getOr(o),u=ku(i),a=u.y>=e.bottom,c=r&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,n.y),bottom:n.bottom};if(t.inline&&!c)return{y:n.y,bottom:Math.min(u.y,n.bottom)};var s=ku(o);return c?{y:Math.max(u.bottom,n.y),bottom:Math.min(s.bottom,n.bottom)}:{y:Math.max(s.y,n.y),bottom:Math.min(u.y,n.bottom)}}(t,r,n,e.header.isPositionedAtTop()),s=c.y,l=c.bottom;return Su(u,s,a,l-s)},GT=function(t,e){var n=W(e,(function(e){return e.predicate(t.dom)})),r=U(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},XT=function(t,e){var n={},r=[],o=[],i={},u={},a=vt(t);return j(a,(function(a){var c=t[a];"contextform"===c.type?function(t,a){var c=me(de("ContextForm",mh,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=f(f({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c}(a,c):"contexttoolbar"===c.type&&function(t,e){var n;(n=e,de("ContextToolbar",gh,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))}(a,c)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},KT=Uo("forward-slide"),YT=Uo("backward-slide"),JT=Uo("change-slide-event"),QT="tox-pop--resizing",ZT=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return x.some({type:"separator",text:a});if("submenu"===t.type){var c=Y(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?x.none():x.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Y(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return x.some(f({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Y(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(fS(u,ph.CLOSE_ON_EXECUTE,t,!1))}}}},t_=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return V(r.data,(function(t){return qk(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:ZT(0,e,n),getStyleItems:o}},e_=function(e,n,r){var o=t_(0,n,r),i=o.items,u=o.getStyleItems;return aS({text:r.icon.isSome()?x.none():x.some(""),icon:r.icon,tooltip:x.from(r.tooltip),role:x.none(),fetch:i.getFetch(n,u),onSetup:function(n){return r.setInitialValue.each((function(t){return t(n.getComponent())})),r.nodeChangeHandler.map((function(t){var r=t(n.getComponent());return e.on("NodeChange",r),function(){e.off("NodeChange",r)}})).getOr(t)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(jS||(jS={}));var n_,r_,o_,i_,u_=function(t,e,n,r){return{type:"basic",data:(o=function(t,e){return e===jS.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r),V(o,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}})))};var o},a_=[{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"}],c_=function(t){var e=function(e){var n=G(a_,(function(e){return t.formatter.match(e.format)})).fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));Vr(e,uS,{icon:"align-"+n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o={type:"basic",data:a_};return{tooltip:"Align",icon:x.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(t){return function(){return x.none()}},onAction:function(e){return function(){return G(a_,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},s_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],l_=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},f_=function(t){var e=function(){var e=function(t){return t?l_(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:G(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return function(t){var e;return 0===t.indexOf("-apple-system")&&(e=l_(t.toLowerCase()),J(s_,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(o)?x.from({title:"System Font",format:o}):x.none()})),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)})),i=u_(t,"font_formats","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",jS.SemiColon);return{tooltip:"Fonts",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return x.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},d_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},m_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},g_=function(t){var e=function(){var e=x.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":Ot(m_,t).getOr(t)}(r,t),i=function(t){return Ot(d_,t).getOr("")}(o);e=G(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=r(x.none),o=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},i=x.some((function(t){return function(){return o(t)}})),u=x.some((function(t){return o(t)})),a=u_(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",jS.Space);return{tooltip:"Font sizes",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},setInitialValue:u,nodeChangeHandler:i,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},h_=function(t,e){var n=e(),r=V(n,(function(t){return t.format}));return x.from(t.formatter.closest(r)).bind((function(t){return G(n,(function(e){return e.format===t}))})).orThunk((function(){return pf(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},p_=function(t){var e=Qe(x.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(x.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(x.some(t))}}},v_=function(){return p_((function(t){return t.destroy()}))},b_=function(){return p_((function(t){return t.unbind()}))},y_=function(t,e){return function(n){var r=b_(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.on("init",o),r.clear}},w_=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},x_=function(t){var e=function(e){var n=h_(t,(function(){return o.data})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o=u_(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",jS.SemiColon);return{tooltip:"Blocks",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:w_(t),setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},C_=function(t,e){var n=function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,n):[{title:t.title,format:t.format}]},r=Y(Wk(t),n),o=h_(t,(function(){return r})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:o})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)}));return{tooltip:"Formats",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},onAction:w_(t),setInitialValue:o,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},S_=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{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"]}],k_=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return he(t)})).getOrDie();return e(i,r,o)}},O_={button:k_(rh,(function(t,e){return n=t,r=e.backstage.shared.providers,VT(n,r,[]);var n,r})),togglebutton:k_(uh,(function(t,e){return n=t,r=e.backstage.shared.providers,jT(n,r,[]);var n,r})),menubutton:k_(CT,(function(t,e){return mS(t,"tox-tbtn",e.backstage,x.none())})),splitbutton:k_((function(t){return de("SplitButton",ST,t)}),(function(e,n){return function(e,n){var r,o=Uo("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setIconFill:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"fill",n)}))},setIconStroke:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"stroke",n)}))},setActive:function(e){zo(t.element,"aria-pressed",e),zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Gm.set(t,e)}))}))},isActive:function(){return zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(Gm.isOn)}))}}},u=Qe(t),a={getApi:i,onSetup:e.onSetup};return MT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:f({"aria-pressed":!1},BT(e.tooltip,n.providers))},onExecute:function(t){e.onAction(i(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:La([rv(n.providers.isDisabled),ev(),Nm("split-dropdown-events",[Kr(PT,Bm.focus),uv(a,u),av(a,u)]),Jy.config({})]),eventOrder:(r={},r[Nr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:UT(i,e,n.providers),parts:{menu:Mh(0,e.columns,e.presets)},components:[MT.parts.button(HT(e.icon,e.text,x.none(),x.some(o),x.some([Gm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),MT.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:zg("chevron-down",n.providers.icons)},buttonBehaviours:La([rv(n.providers.isDisabled),ev()])}),MT.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(e,n.backstage.shared)})),grouptoolbarbutton:k_((function(t){return de("GroupToolbarButton",yT,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[yc]=e.backstage.shared.header.isPositionedAtTop()?Iu.TopToBottom:Iu.BottomToTop,r);switch(Ip(n)){case hh.floating:return function(t,e,n,r){var o=e.shared;return IO.sketch({lazySink:o.getSink,fetch:function(){return Cy((function(e){e(V(n(t.items),mT))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:HT(t.icon,t.text,t.tooltip,x.none(),x.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return __(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,x.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=f({type:"advanced"},e.styleselect);return e_(t,e,C_(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return e_(t,e,g_(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return e_(t,e,f_(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return e_(t,e,x_(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return e_(t,e,c_(t))}(t,e.backstage)}},T_={styleselect:O_.styleSelectButton,fontsizeselect:O_.fontsizeSelectButton,fontselect:O_.fontSelectButton,formatselect:O_.formatButton,align:O_.alignMenuButton},__=function(t,e,n,r){var o=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=V(S_,(function(e){var n=W(e.items,(function(e){return Tt(t,e)||Tt(T_,e)}));return{name:e.name,items:n}}));return W(e,(function(t){return t.items.length>0}))}(r):k(n)?(e=n.split("|"),V(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return M(t,(function(t){return Tt(t,"name")&&Tt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}(e),i=V(o,(function(o){var i=Y(o.items,(function(o){return 0===o.trim().length?[]:function(t,e,n,r,o,i){return Ot(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return it(t,(function(t){return Ot(e,t+n.toLowerCase())}))}))})).fold((function(){return Ot(T_,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return x.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return Ot(O_,t.type).fold((function(){return console.error("skipping button defined by",t),x.none()}),(function(r){return x.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),x.none())}))}(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:x.from(t.translate(o.name)),items:i}}));return W(i,(function(t){return t.items.length>0}))},E_={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"]},A_={maxHeightFunction:fc(),maxWidthFunction:yO()},N_={onLtr:function(){return[Sa,ka,xa,ya,Ca,wa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[Sa,ka,Ca,wa,xa,ya,_g,Eg,Tg,kg,Og,Sg]}},R_={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},M_=function(t,e,n,r){var o,i,u=Ln().deviceType.isTouch,a=Zi((o={sink:n,onEscape:function(){return t.focus(),x.some(!0)}},i=Qe([]),vg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),vg.getContent(t).each((function(t){Ui(t.element,"visibility")})),bi(t.element,QT),Ui(t.element,"width")},inlineBehaviours:La([Nm("context-toolbar-events",[no(fr(),(function(t,e){bi(t.element,QT),Ui(t.element,"width")})),Kr(JT,(function(t,e){Ui(t.element,"width");var n=fu(t.element);vg.setContent(t,e.event.contents),vi(t.element,QT);var r=fu(t.element);Bi(t.element,"width",n+"px"),vg.getContent(t).each((function(n){e.event.focus.bind((function(e){return $a(e),Xa(t.element)})).orThunk((function(){return km.focusIn(n),Ga()}))})),Ag.setTimeout((function(){Bi(t.element,"width",r+"px")}),0)})),Kr(KT,(function(t,e){vg.getContent(t).each((function(t){i.set(i.get().concat([{bar:t,focus:Ga()}]))})),Vr(t,JT,{contents:e.event.forwardContents,focus:x.none()})})),Kr(YT,(function(t,e){rt(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Vr(t,JT,{contents:tu(e.bar),focus:e.focus})}))}))]),km.config({mode:"special",onEscape:function(t){return rt(i.get()).fold((function(){return o.onEscape()}),(function(e){return Fr(t,YT),x.some(!0)}))}})]),lazySink:function(){return ct.value(o.sink)}}))),c=function(){return $T(t,r.backstage.shared)},s=function(){if(u()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,a,s,l=(e=g.get().filter((function(t){return Ni(rn(t))})).map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?pu().top:Ou(rn(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),f=c();return o=l.y,i=l.bottom,a=f.y,s=f.bottom,!(Math.max(o,a)<=Math.min(i,s))},l=function(){vg.hide(a)},d=function(){m.get().each((function(t){var e=a.element;Ui(e,"display"),s()?Bi(e,"display","none"):Cs.positionWithinBounds(n,t,a,x.some(c()))}))},m=Qe(x.none()),g=Qe(x.none()),h=Qe(null),p=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:La([km.config({mode:"acyclic"}),Nm("pop-dialog-wrap-events",[ro((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return km.focusIn(e)}))})),oo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},v=zt((function(){return XT(e,(function(t){var e=b([t]);Vr(a,KT,{forwardContents:p(e)})}))})),b=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=f(f({},n),o.formNavigators),u=Ip(t)===hh.scrolling?hh.scrolling:hh.default,a=K(V(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return __(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,x.some(["form:"]))}(i,e):function(t,e){return qT(t,e)}(e,r.backstage.shared.providers)})));return bT({type:u,uid:Uo("context-toolbar"),initGroups:a,onEscape:x.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",(function(e){var n=v();Ot(n.lookupTable,e.toolbarKey).each((function(n){y([n],e.target===t?x.none():x.some(e)),vg.getContent(a).each(km.focusIn)}))}));var y=function(t,e){if(C(),!u()||!r.backstage.isContextMenuOpen()){var n=b(t),o=e.map(rn),i=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Rt(n,function(t,e){return"line"===t?{bubble:hc(12,0,E_),layouts:{onLtr:function(){return[Oa]},onRtl:function(){return[Ta]}},overrides:A_}:{bubble:hc(0,12,E_),layouts:e?R_:N_,overrides:A_}}(t,u()))}(t[0].position,o);m.set(x.some(i)),g.set(e);var l=a.element;Ui(l,"display"),vg.showWithinBounds(a,i,p(n),(function(){return x.some(c())})),s()&&Bi(l,"display","none")}},w=function(){t.hasFocus()&&function(t,e){var n=rn(e.getBody()),r=function(t){return Vn(t,n)},o=rn(e.selection.getNode());return function(t){return!r(t)&&!jn(n,t)}(o)?x.none():function(t,e,n){var r=GT(t,e);if(r.contextForms.length>0)return x.some({elem:t,toolbars:[r.contextForms[0]]});var o=GT(t,n);if(o.contextForms.length>0)return x.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return L(t,(function(t){return t.position===e}))},n=function(e){return W(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=V(n("selection"),(function(t){return f(f({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return x.some({elem:t,toolbars:i})}return x.none()}(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return function(t,e,n){return t(e)?x.none():Wn(e,(function(t){var e=GT(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return G(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return W(t,(function(t){return t.position===e}))}))}(r);return i.length>0?x.some({elem:t,toolbars:i}):x.none()}),t)}(r,o,t)}))}(v(),t).fold((function(){m.set(x.none()),vg.hide(a)}),(function(t){y(t.toolbars,x.some(t.elem.dom))}))},C=function(){var t=h.get();null!==t&&(Ag.clearTimeout(t),h.set(null))},S=function(t){C(),h.set(t)};t.on("init",(function(){t.on(wO,l),t.on("ScrollContent ScrollWindow longpress",d),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){S(Ag.setEditorTimeout(t,w,0))})),t.on("focusout",(function(e){Ag.setEditorTimeout(t,(function(){Xa(n.element).isNone()&&Xa(a.element).isNone()&&(m.set(x.none()),vg.hide(a))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(m.set(x.none()),vg.hide(a))})),t.on("NodeChange",(function(e){Xa(a.element).fold((function(){S(Ag.setEditorTimeout(t,w,0))}),(function(t){}))}))}))},z_=af,D_=Ul,B_=r([je("shell",!1),_e("makeItem"),je("setupItem",t),gl("listBehaviours",[Am])]),P_=Fl({name:"items",overrides:function(){return{behaviours:La([Am.config({})])}}}),I_=r([P_]),L_=gf({name:r("CustomList")(),configFields:B_(),partFields:I_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"items")).fold((function(){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")}),(function(r){var o=Am.contents(r),i=n.length,u=i-o.length,a=u>0?H(u,(function(){return t.makeItem()})):[],c=o.slice(i);j(c,(function(t){return Am.remove(r,t)})),j(a,(function(t){return Am.append(r,t)}));var s=Am.contents(r);j(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),H_=t,F_=c,V_=r([]),j_=Object.freeze({__proto__:null,setup:H_,isDocked:F_,getBehaviours:V_}),U_=function(t){return(Fi(t,"position").is("fixed")?x.none():yo(t)).orThunk((function(){var e=en("span");return bo(t).bind((function(t){Oo(t,e);var n=yo(e);return Eo(e),n}))}))},W_=function(t){return U_(t).map(cu).getOrThunk((function(){return uu(0,0)}))},q_=Et([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),$_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeOutClass),vi(n,e.fadeInClass),e.onShow(t)},G_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeInClass),vi(n,e.fadeOutClass),e.onHide(t)},X_=function(t,e,n){return J(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},K_=function(t,e){return e.getInitialPosition().map((function(e){return Su(e.bounds.x,e.bounds.y,fu(t),ru(t))}))},Y_=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(x.none()),r.position){case"static":return x.some(q_.static());case"absolute":var o=U_(t).map(ku).getOrThunk((function(){return ku(Ri())}));return x.some(q_.absolute(Ya("absolute",Ot(r.style,"left").map((function(t){return e.x-o.x})),Ot(r.style,"top").map((function(t){return e.y-o.y})),Ot(r.style,"right").map((function(t){return o.right-e.right})),Ot(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return x.none()}}))},J_=function(t,e,n){var r=t.element;return Fi(r,"position").is("fixed")?function(t,e,n){return K_(t,n).filter((function(t){return X_(n.getModes(),t,e)})).bind((function(e){return Y_(t,e,n)}))}(r,e,n):function(t,e,n){var r=ku(t);if(X_(n.getModes(),r,e))return x.none();!function(t,e,n){n.setInitialPosition(x.some({style:Vi(t),position:Li(t,"position")||"static",bounds:e}))}(t,r,n);var o=Tu(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return x.some(q_.fixed(Ya("fixed",x.some(i),c?x.some(u):x.none(),x.none(),c?x.none():x.some(a))))}(r,e,n)},Q_=function(t,e){j(["left","right","top","bottom","position"],(function(e){return Ui(t.element,e)})),e.onUndocked(t)},Z_=function(t,e,n){Ja(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},tE=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(wi(t.element,[e.fadeOutClass]),e.onHide(t)):(u?$_:G_)(t,e))}))}))},eE=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&tE(t,e,n,r),J_(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return Q_(t,e)}),(function(n){return Z_(t,e,n)}),(function(o){tE(t,e,n,r,!0),Z_(t,e,o)}))}))}(t,e,n)},nE=function(e,n,r){r.isDocked()&&function(e,n,r){var o=e.element;r.setDocked(!1),function(t,e){var n=t.element;return K_(n,e).bind((function(t){return Y_(n,t,e)}))}(e,r).each((function(r){r.fold((function(){return Q_(e,n)}),(function(t){return Z_(e,n,t)}),t)})),r.setVisible(!0),n.contextual.each((function(t){xi(o,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),eE(e,n,r)}(e,n,r)},rE=Object.freeze({__proto__:null,refresh:eE,reset:nE,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),oE=Object.freeze({__proto__:null,events:function(t,e){return $r([no(fr(),(function(n,r){t.contextual.each((function(t){yi(n.element,t.transitionClass)&&(xi(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n)),r.stop()}))})),Kr(Er(),(function(n,r){eE(n,t,e)})),Kr(Ar(),(function(n,r){nE(n,t,e)}))])}}),iE=[Ve("contextual",[Ne("fadeInClass"),Ne("fadeOutClass"),Ne("transitionClass"),Me("lazyContext"),Ku("onShow"),Ku("onShown"),Ku("onHide"),Ku("onHidden")]),Xe("lazyViewport",Tu),Ke("modes",["top","bottom"],xe),Ku("onDocked"),Ku("onUndocked")],uE=Fa({fields:iE,name:"docking",active:oE,apis:rE,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(!1),n=Qe(!0),r=Qe(x.none()),o=Qe(t.modes);return ui({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),aE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},cE="tox-tinymce--toolbar-sticky-on",sE="tox-tinymce--toolbar-sticky-off",lE=function(t){var e=t.element;bo(e).each((function(n){var r="padding-"+uE.getModes(t)[0];if(uE.isDocked(t)){var o=fu(n);Bi(e,"width",o+"px"),Bi(n,r,function(t){return ou(t)+(parseInt(Li(t,"margin-top"),10)||0)+(parseInt(Li(t,"margin-bottom"),10)||0)}(e)+"px")}else Ui(e,"width"),Ui(n,r)}))},fE=function(t,e){e?(bi(t,aE.fadeOutClass),wi(t,[aE.transitionClass,aE.fadeInClass])):(bi(t,aE.fadeInClass),wi(t,[aE.fadeOutClass,aE.transitionClass]))},dE=function(t,e){var n=rn(t.getContainer());e?(vi(n,cE),bi(n,sE)):(vi(n,sE),bi(n,cE))},mE=function(t,e){var n=Qe(x.none()),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||lE(e),dE(t,uE.isDocked(e)),e.getSystem().broadcastOn([$s()],{}),r().each((function(t){return t.getSystem().broadcastOn([$s()],{})}))},u=t.inline?[]:function(){var t;return[Wa.config({channels:(t={},t[fT()]={onReceive:lE},t)})]}();return m([Bm.config({}),uE.config({contextual:f({lazyContext:function(e){var n,r=ou(e.element),o=t.inline?t.getContentAreaContainer():t.getContainer(),i=ku(rn(o)),u=i.height-r,a=i.y+(n=e,"top",I(uE.getModes(n),"top")?0:r);return x.some(Su(i.x,a,i.width,u))},onShow:function(){o((function(t){return fE(t,!0)}))},onShown:function(t){o((function(t){return xi(t,[aE.transitionClass,aE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=go(o=e),Ga(i).filter((function(t){return!Vn(o,t)})).filter((function(t){return Vn(t,rn(i.dom.body))||jn(r,t)})).each((function(){return $a(o)})),n.set(x.none())}))},onHide:function(t){n.set(function(t,e){return Xa(t).orThunk((function(){return e().toOptional().bind((function(t){return Xa(t.element)}))}))}(t.element,r)),o((function(t){return fE(t,!1)}))},onHidden:function(){o((function(t){return xi(t,[aE.transitionClass])}))}},aE),modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},gE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(uE.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(lE)})),t.on("SkinLoaded",(function(){n().each((function(t){uE.isDocked(t)?uE.reset(t):uE.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(uE.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){uE.refresh(e);var n=e.element;bd(n)&&function(t,e){var n=go(e),r=n.dom.defaultView.innerHeight,o=pu(n),i=rn(t.elm),u=Ou(i),a=ru(i),c=u.y,s=c+a,l=cu(e),f=ru(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)vu(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;vu(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){dE(t,!1)}))},isDocked:function(t){return t().map(uE.isDocked).getOr(!1)},getBehaviours:mE}),hE=mf({factory:function(t,e){var n={focus:km.focusIn,setMenus:function(t,n){var r=V(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=CT(n).mapError((function(t){return he(t)})).getOrDie();return mS(r,"tox-mbtn",e.backstage,x.some("menuitem"))}));Am.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:La([Am.config({}),Nm("menubar-events",[ro((function(e){t.onSetup(e)})),Kr(rr(),(function(t,e){zu(t.element,".tox-mbtn--active").each((function(n){Du(e.event.target,".tox-mbtn").each((function(e){Vn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Yy.expand(t),Yy.close(n),Bm.focus(t)}))}))}))}))})),Kr(Dr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Yy.isOpen(n)&&(Yy.expand(t),Yy.close(n))}))}))}))]),km.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),x.some(!0)}}),Xb.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[_e("dom"),_e("uid"),_e("onEscape"),_e("backstage"),je("onSetup",t)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),pE="container",vE=[fl("slotBehaviours",[])],bE=function(t){return"<alloy.field."+t+">"},yE=function(t,e){var n,r=function(e){return nf(t)},o=function(e,n){return function(r,o){return Ql(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Do(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Bi(n,"display","none"),zo(n,"aria-hidden","true"),Vr(t,Br(),{name:e,visible:!1})}})),c=(n=a,function(t,e){j(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;Ui(n,"display"),Io(n,"aria-hidden"),Vr(t,Br(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return Ql(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.slotBehaviours),apis:l}},wE=wt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return oi(t)})),xE=f(f({},wE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Gl(pE,bE(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:bE(t)})}));return sf(pE,vE,o,yE,n)}}),CE=Zt([He("icon"),He("tooltip"),Xe("onShow",t),Xe("onHide",t),Xe("onSetup",(function(){return t}))]),SE=function(t){return{element:function(){return t.element.dom}}},kE=function(e,n){var r=V(vt(n),(function(t){var e=n[t],r=me(function(t){return de("sidebar",CE,t)}(e));return{name:t,getApi:SE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return V(r,(function(n){var o=Qe(t);return e.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:tp([uv(n,o),av(n,o),Kr(Br(),(function(t,e){var n=e.event;G(r,(function(t){return t.name===n.name})).each((function(e){(n.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},OE=function(t){return xE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:kE(e,t),slotBehaviours:tp([ro((function(t){return xE.hideAllSlots(t)}))])}}))},TE=function(t){return wf.getCurrent(t).bind((function(t){return iT.isGrowing(t)||iT.hasGrown(t)?wf.getCurrent(t).bind((function(t){return G(xE.getSlotNames(t),(function(e){return xE.isShowing(t,e)}))})):x.none()}))},_E=Uo("FixSizeEvent"),EE=Uo("AutoSizeEvent"),AE=function(t){var e=tn(t),n=wo(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return $(e,(function(t,e){var n;return"class"===e.name?t:f(f({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:No(e)};return f({tag:ao(e),classes:o,attributes:r},i)},NE=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})])}},RE=D_.optional({factory:hE,name:"menubar",schema:[_e("backstage")]}),ME=D_.optional({factory:{sketch:function(t){return L_.sketch({uid:t.uid,dom:t.dom,listBehaviours:La([km.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return bT({type:t.type,uid:Uo("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),x.some(!0)}})},setupItem:function(t,e,n,r){SO.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[_e("dom"),_e("onEscape")]}),zE=D_.optional({factory:{sketch:function(t){return function(t){return t.type===hh.sliding?vT:t.type===hh.floating?pT:bT}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),x.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[_e("dom"),_e("onEscape"),_e("getSink")]}),DE=D_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?mE:V_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:La(n(e,t.sharedBackstage))}}},name:"header",schema:[_e("dom")]}),BE=D_.optional({name:"socket",schema:[_e("dom")]}),PE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:La([Xb.config({}),Bm.config({}),iT.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:function(t){wf.getCurrent(t).each(xE.hideAllSlots),Fr(t,EE)},onGrown:function(t){Fr(t,EE)},onStartGrow:function(t){Vr(t,_E,{width:Fi(t.element,"width").getOr("")})},onStartShrink:function(t){Vr(t,_E,{width:fu(t.element)+"px"})}}),Am.config({}),wf.config({find:function(t){var e=Am.contents(t);return nt(e)}})])}],behaviours:La([eC(0),Nm("sidebar-sliding-events",[Kr(_E,(function(t,e){Bi(t.element,"width",e.event.width)})),Kr(EE,(function(t,e){Ui(t.element,"width")}))])])}}},name:"sidebar",schema:[_e("dom")]}),IE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:La([Am.config({})]),components:[]}}},name:"throbber",schema:[_e("dom")]}),LE=gf({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return z_.getPart(e,t,"socket")},setSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){return Am.set(t,[OE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){wf.getCurrent(t).each((function(n){iT.hasGrown(t)?xE.isShowing(n,e)?iT.shrink(t):(xE.hideAllSlots(n),xE.showSlot(n,e)):(xE.hideAllSlots(n),xE.showSlot(n,e),iT.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return z_.getPart(e,t,"sidebar").bind(TE).getOrNull()},getHeader:function(e){return z_.getPart(e,t,"header")},getToolbar:function(e){return z_.getPart(e,t,"toolbar")},setToolbar:function(e,n){z_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){z_.getPart(e,t,"multiple-toolbar").each((function(t){L_.setItems(t,n)}))},refreshToolbar:function(e){z_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){z_.getPart(e,t,"toolbar").each((function(t){var e,n;n=function(e){return e(t)},null!=(e=t.getApis().toggle)?x.some(n(e)):x.none()}))},isToolbarDrawerToggled:function(e){return z_.getPart(e,t,"toolbar").bind((function(t){return x.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return z_.getPart(e,t,"throbber")},focusToolbar:function(e){z_.getPart(e,t,"toolbar").orThunk((function(){return z_.getPart(e,t,"multiple-toolbar")})).each((function(t){km.focusIn(t)}))},setMenubar:function(e,n){z_.getPart(e,t,"menubar").each((function(t){hE.setMenus(t,n)}))},focusMenubar:function(e){z_.getPart(e,t,"menubar").each((function(t){hE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[_e("dom"),_e("behaviours")],partFields:[DE,RE,zE,ME,BE,PE,IE],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=V(n,(function(t){return mT(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=V(n,(function(t){return V(t,mT)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),HE={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 toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},FE=function(t){return"string"==typeof t?t.split(" "):t},VE=function(t,e){var n=f(f({},HE),e.menus),r=vt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?FE("file edit view insert format tools table help"):FE(!1===e.menubar?"":e.menubar),i=W(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||HE.hasOwnProperty(t)})),u=V(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Y(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||L(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:FE(o.items)},e,t)}));return W(u,(function(t){return t.getItems().length>0&&L(t.getItems(),(function(t){return"separator"!==t.type}))}))},jE=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},UE=function(t,e,n){return new Gg((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},WE=function(t,e){return UE(t,e+"/skin.min.css",t.ui.styleSheetLoader)},qE=function(t,e){var n;return n=rn(t.getElement()),Ei(n).isSome()?UE(t,e+"/skin.shadowdom.min.css",sp.DOM.styleSheetLoader):Gg.resolve()},$E=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Op.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&k(n)?Gg.all([WE(e,n),qE(e,n)]).then(jE(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:"Skin could not be loaded"})}}(e)):jE(e)()},GE=i($E,!1),XE=i($E,!0),KE=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,u=n.buttons;if(M(i,k)){var a=i.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return __(t,o,{backstage:r},x.none())}));LE.setToolbars(o,a)}else LE.setToolbar(o,__(t,n,{backstage:r},x.none()))},YE=Ln(),JE=YE.os.isiOS()&&YE.os.version.major<=12,QE=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=Qe(0),u=e.outerContainer;GE(t);var a=rn(o.targetNode),c=_i(Ti(a));!function(t,e){zs(t,e,So)}(a,e.mothership),Ms(c,e.uiMothership),t.on("PostRender",(function(){KE(t,e,n,r),i.set(t.getWin().innerWidth),LE.setMenubar(u,VE(t,n)),LE.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=Qe(uu(r.innerWidth,r.innerHeight)),u=Qe(uu(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(uu(r.innerWidth,r.innerHeight)),$v(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(uu(e.offsetWidth,e.offsetHeight)),$v(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=_b(rn(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Bi(f,"display","none")})),t.on("show",(function(){Ui(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var s,l,f=LE.getSocket(u).getOrDie("Could not find expected socket element");if(JE){Pi(f.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var d=(s=function(){t.fire("ScrollContent")},20,l=null,{cancel:function(){null!==l&&(clearTimeout(l),l=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===l&&(l=setTimeout((function(){s.apply(null,t),l=null}),20))}}),m=Tb(f.element,"scroll",d.throttle);t.on("remove",m.unbind)}tv(t,e),t.addCommand("ToggleSidebar",(function(e,n){LE.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return LE.whichSidebar(u)}));var g=Ip(t);g!==hh.sliding&&g!==hh.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(LE.refreshToolbar(e.outerContainer),i.set(n))}));var h={enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(u)}};return{iframeContainer:f.element.dom,editorContainer:u.element.dom,api:h}}}),ZE=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?x.some(parseInt(""+t,10)):x.none()},tA=function(t){return R(t)?t+"px":t},eA=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},nA=function(t){var e=_p(t),n=Ep(t),r=Np(t);return ZE(e).map((function(t){return eA(t,n,r)}))},rA=function(t,e){var n=ku(t);return{pos:e?n.y:n.bottom,bounds:n}},oA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=Qe(null),s=rn(o.targetNode),l=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=sp.DOM,c=Up(t),s=$p(t),l=Np(t).or(nA(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Ip(t),g=m===hh.sliding||m===hh.floating,h=Qe(!1),p=function(){return h.get()&&!t.removed},v=function(t){return g?t.fold((function(){return 0}),(function(t){return t.components().length>1?ru(t.components()[1].element):0})):0},b=function(){i.broadcastOn([$s()],{})},y=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=ZE(Li(Ri(),"margin-left")).getOr(0);return fu(Ri())-cu(e).left+t})),Bi(o.get().element,"max-width",n+"px")),g&&LE.refreshToolbar(u),c||function(){var t=LE.getToolbar(u),n=v(t),r=ku(e),i=d()?Math.max(r.y-ru(o.get().element)+n,0):r.bottom;Pi(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?uE.reset(r):uE.refresh(r)}b()}},w=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Fp(t)){case Pp.auto:var r=LE.getToolbar(u),o=v(r),i=ru(n.element)-o,a=ku(e);if(a.y>i)return"top";var c=po(e),s=Math.max(c.dom.scrollHeight,ru(c));return a.bottom<s-i||Tu().bottom<a.bottom-i?"bottom":"top";case Pp.bottom:return"bottom";case Pp.top:default:return"top"}}(o.get());i!==r&&(function(t){var e=o.get();uE.setModes(e,[t]),f.setDockingMode(t);var n=d()?Iu.TopToBottom:Iu.BottomToTop;zo(e.element,yc,n)}(i),n&&y(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Bi(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Ui(i.element,"display"),w(!1),y()},hide:function(){h.set(!1),n.outerContainer&&(Bi(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Bi(i.element,"display","none")},update:y,updateMode:w,repositionPopups:b}}(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);XE(t);var d=function(){if(c.get())l.show();else{c.set(LE.getHeader(a).getOrDie());var o=Wp(t);Ms(o,i),Ms(o,u),KE(t,e,n,r),LE.setMenubar(a,VE(t,n)),l.show(),function(t,e,n,r){var o=Qe(rA(e,n.isPositionedAtTop())),i=function(r){var i=rA(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&$v(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Ag.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=b_();u.set(_b(rn(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&d()})),tv(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),iA=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},uA=function(t){(function(t){!function(t){iC.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"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:y_(t,e.name),onAction:iA(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:y_(t,n),onAction:iA(t,n)})}}(t),function(t){iC.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"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))}(t),function(t){iC.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:y_(t,e.name)})}))}(t)})(t),function(t){iC.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",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{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"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:iA(t,"code")})}(t)},aA=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},cA={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:[""]},sA=(n_="[eE][+-]?[0-9]+",o_=["Infinity","[0-9]+\\."+(r_=function(t){return"(?:"+t+")?"})("[0-9]+")+r_(n_),"\\.[0-9]+"+r_(n_),"[0-9]+"+r_(n_)].join("|"),new RegExp("^([+-]?(?:"+o_+"))(.*)$")),lA=function(t){return function(t,e){return function(t,e){return x.from(sA.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return L(e,(function(e){return L(cA[e],(function(e){return t===e}))}))}(r,e)?x.some({value:n,unit:r}):x.none()}))}(t,["fixed","relative","empty"]).map((function(t){return t.value+t.unit}))}(t).getOr(t)},fA=function(t){var e=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")}(t),n=new Map,r=v_(),o=function(){var e=lA(t.queryCommandValue("LineHeight"));x.from(n.get(e)).fold((function(){return r.clear()}),(function(t){r.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)}))};return t.on("nodeChange",o),V(e,(function(i,u){return{type:"togglemenuitem",text:i,onSetup:function(a){return n.set(lA(i),a),u+1===e.length&&o(),function(){0===u&&(t.off("nodeChange",o),r.clear())}},onAction:function(){return t.execCommand("LineHeight",!1,i)}}}))},dA=function(t,e){!function(t){iC.each([{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"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:y_(t,e.name)})}));t.ui.registry.addButton("alignnone",{tooltip:"No alignment",onAction:function(){return t.execCommand("JustifyNone")},icon:"align-none"})}(t),uA(t),function(t,e){!function(t,e){var n=t_(0,e,c_(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,f_(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=f({type:"advanced"},e.styleselect),r=t_(0,e,C_(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,x_(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,g_(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)}(t,e),function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)}(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=Qe(null),n=Qe(null);ub(t,"forecolor","forecolor","Text color",e),ub(t,"backcolor","hilitecolor","Background color",n),ab(t,"forecolor","forecolor","Text color"),ab(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t),function(t){!function(t){t.ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return fA(t)}})}(t),function(t){t.ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(e){return e(fA(t))}})}(t)}(t)},mA=function(t,e){return{anchor:"makeshift",x:t,y:e}},gA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},hA=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(gA(t)){var e=t.touches[0];return mA(e.pageX,e.pageY)}return mA(t.pageX,t.pageY)}(e):function(t,e){var n=sp.DOM.getPos(t);return function(t,e,n){return mA(t.x+e,t.y+n)}(e,n.x,n.y)}(t.getContentAreaContainer(),function(t){if(gA(t)){var e=t.touches[0];return mA(e.clientX,e.clientY)}return mA(t.clientX,t.clientY)}(e)):pA(t)},pA=function(t){return{anchor:"selection",root:rn(t.selection.getNode())}},vA=function(t){return{anchor:"node",node:x.some(rn(t.selection.getNode())),root:rn(t.getBody())}},bA=function(t,e,n,r,o,i){var u=n(),a=i?vA(t):hA(t,e);fS(u,ph.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),vg.showMenuAt(o,a,{menu:{markers:Ah("normal")},data:t})}))},yA={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},wA={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"]},xA=function(t,e,n,r,o,i){var u=Ln(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),d=function(){var u=n();!function(t,e,n,r,o,i,u){var a=i?vA(t):function(t,e){return f({bubble:hc(0,12,wA),layouts:yA,overrides:{maxWidthFunction:yO(),maxHeightFunction:fc()}},hA(t,e))}(t,e);fS(n,ph.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),vg.showMenuWithinBounds(o,a,{menu:{markers:Ah("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return x.some($T(t,r.shared))})),t.fire(wO)}))}(t,e,u,r,o,i,!(s||a||c&&l))};if(!c&&!a||i)s&&!i&&t.selection.setCursorLocation(e.target,0),d();else{var m=function(){!function(t){var e=t.selection.getRng(),n=function(){Ag.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),d()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Uc(t.getWin(),Ac.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)}))):m()}},CA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},SA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},kA=function(t){return k(t)?"|"===t:"separator"===t.type},OA={type:"separator"},TA=function(t){if(k(t))return t;switch(t.type){case"separator":return OA;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return k(e)?e:V(e,TA)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(e=t.onAction,function(){return e()})}}var e},_A=function(t,e){if(0===e.length)return t;var n=rt(t).filter((function(t){return!kA(t)})).fold((function(){return[]}),(function(t){return[OA]}));return t.concat(n).concat(e).concat([OA])},EA=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},AA=function(t,e){return EA(t,e)?t.selection.getStart(!0):e.target},NA=function(t,e,n){var r=Ln().deviceType.isTouch,o=Zi(vg.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissContextMenu",[Kr(Mr(),(function(e,n){Ws.close(e),t.focus()}))])])})),i=function(t){return vg.hide(o)},u=function(e){if(SA(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!SA(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t);if(EA(t,e))return!0;if(n){var r=AA(t,e);return Ab(rn(r),n)}return!1}(t,e);(r()?xA:bA)(t,e,(function(){var n=AA(t,e),r=t.ui.registry.getAll(),o=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return x.from(t.getParam("contextmenu")).map(CA).getOrThunk((function(){return W(CA("link linkchecker image imagetools table spellchecker configurepermanentpen"),(function(t){return Tt(r,t)}))}))}(t)}(t);return function(t,e,n){var r=$(e,(function(e,r){if(Tt(t,r)){var o=t[r].update(n);if(k(o))return _A(e,o.split(" "));if(o.length>0){var i=V(o,TA);return _A(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&kA(r[r.length-1])&&r.pop(),r}(r.contextMenus,o,n)}),n,o,i)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",u)}))},RA=Et([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),MA=function(t){return function(e){return e.translate(-t.left,-t.top)}},zA=function(t){return function(e){return e.translate(t.left,t.top)}},DA=function(t){return function(e,n){return $(t,(function(t,e){return e(t)}),uu(e,n))}},BA=function(t,e,n){return t.fold(DA([zA(n),MA(e)]),DA([MA(e)]),DA([]))},PA=function(t,e,n){return t.fold(DA([zA(n)]),DA([]),DA([zA(e)]))},IA=function(t,e,n){return t.fold(DA([]),DA([MA(n)]),DA([zA(e),MA(n)]))},LA=function(t,e,n){var r=t.fold((function(t,e){return{position:x.some("absolute"),left:x.some(t+"px"),top:x.some(e+"px")}}),(function(t,e){return{position:x.some("absolute"),left:x.some(t-n.left+"px"),top:x.some(e-n.top+"px")}}),(function(t,e){return{position:x.some("fixed"),left:x.some(t+"px"),top:x.some(e+"px")}}));return f({right:x.none(),bottom:x.none()},r)},HA=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(IA,FA),o(PA,VA),o(BA,jA))},FA=RA.offset,VA=RA.absolute,jA=RA.fixed,UA=function(t,e){var n=Do(t,e);return E(n)?NaN:parseInt(n,10)},WA=function(t,e,n,r,o,i){var u=function(t,e,n,r){return function(t,e){var n=t.element,r=UA(n,e.leftAttr),o=UA(n,e.topAttr);return isNaN(r)||isNaN(o)?x.none():x.some(uu(r,o))}(t,e).fold((function(){return n}),(function(t){return jA(t.left+r.left,t.top+r.top)}))}(t,e,n,r),a=e.mustSnap?$A(t,e,u,o,i):GA(t,e,u,o,i),c=BA(u,o,i);return function(t,e,n){var r=t.element;zo(r,e.leftAttr,n.left+"px"),zo(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:jA(c.left,c.top),extra:x.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},qA=function(t,e,n,r){return it(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?x.some({output:HA(t.output,e,n,r),extra:t.extra}):x.none()}))},$A=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o).orThunk((function(){return $(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return uu(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:x.some(u),snap:x.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:x.some(u),snap:x.some(e)}:t}))}),{deltas:x.none(),snap:x.none()}).snap.map((function(t){return{output:HA(t.output,n,r,o),extra:t.extra}}))}))},GA=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o)},XA=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t,e,n){return{coord:HA(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=LA(c.coord,0,a);Ii(o,s)}}}),KA="data-initial-z-index",YA=function(t,e){t.getSystem().addToGui(e),function(t){bo(t.element).filter(so).each((function(e){Fi(e,"z-index").each((function(t){zo(e,KA,t)})),Bi(e,"z-index",Li(t.element,"z-index"))}))}(e)},JA=function(t){!function(t){bo(t.element).filter(so).each((function(t){Bo(t,KA).fold((function(){return Ui(t,"z-index")}),(function(e){return Bi(t,"z-index",e)})),Io(t,KA)}))}(t),t.getSystem().removeFromGui(t)},QA=function(t,e,n){return t.getSystem().build(Vb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},ZA=Ve("snaps",[_e("getSnapPoints"),Ku("onSensor"),_e("leftAttr"),_e("topAttr"),je("lazyViewport",Tu),je("mustSnap",!1)]),tN=[je("useFixed",c),_e("blockerClass"),je("getTarget",o),je("onDrag",t),je("repositionTarget",!0),je("onDrop",t),Xe("getBounds",Tu),ZA],eN=function(t,e){return{bounds:t.getBounds(),height:ou(e.element),width:du(e.element)}},nN=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return eN(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t){return(e=Fi(t,"left"),n=Fi(t,"top"),r=Fi(t,"position"),o=function(t,e,n){return("fixed"===n?jA:FA)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?x.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):x.none()).getOrThunk((function(){var e=cu(t);return VA(e.left,e.top)}));var e,n,r,o}(o),s=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=PA(e,n,r),a=uc(u.left,i.x,i.x+i.width-o.width),c=uc(u.top,i.y,i.y+i.height-o.height),s=VA(a,c);return e.fold((function(){var t=IA(s,n,r);return FA(t.left,t.top)}),(function(){return s}),(function(){var t=BA(s,n,r);return jA(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return FA(t+e,n+u)}),(function(t,n){return VA(t+e,n+u)}),(function(t,n){return jA(t+e,n+u)}))),c=BA(a,r,o);return jA(c.left,c.top)}),(function(e){var u=WA(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)}(t,e.snaps,c,u,a,r,n),l=LA(s,0,a);Ii(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},rN=function(t,e,n,r){e.each(JA),n.snaps.each((function(e){!function(t,e){!function(t,e){var n=t.element;Io(n,e.leftAttr),Io(n,e.topAttr)}(t,e)}(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},oN=function(t){return function(e,n){var r=function(t){n.setStartData(eN(e,t))};return $r(m([Kr(Er(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},iN=Object.freeze({__proto__:null,getData:function(t){return x.from(uu(t.x,t.y))},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),uN=function(t,e,n){return[Kr(Zn(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return rN(r,x.some(c),t,e)},u=Nb(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),nN(r,t,e,iN,n)}},c=QA(r,t.blockerClass,function(t){return $r([Kr(Zn(),t.forceDrop),Kr(nr(),t.drop),Kr(tr(),(function(e,n){t.move(n.event)})),Kr(er(),t.delayDrop)])}(a));n(r),YA(r,c)}}))]},aN=m(tN,[Zu("dragger",{handlers:oN(uN)})]),cN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return x.some(uu(e.clientX,e.clientY))}(e):x.none()},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),sN=function(t,e,n){var r=Qe(x.none());return[Kr(Kn(),(function(o,i){i.stop();var u=function(){rN(o,r.get(),t,e),r.set(x.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(n){nN(o,t,e,cN,n)}},c=QA(o,t.blockerClass,function(t){return $r([Kr(Kn(),t.forceDrop),Kr(Jn(),t.drop),Kr(Qn(),t.drop),Kr(Yn(),(function(e,n){t.move(n.event)}))])}(a));r.set(x.some(c)),n(o),YA(o,c)})),Kr(Yn(),(function(n,r){r.stop(),nN(n,t,e,cN,r.event)})),Kr(Jn(),(function(n,o){o.stop(),rN(n,r.get(),t,e),r.set(x.none())})),Kr(Qn(),(function(n){rN(n,r.get(),t,e),r.set(x.none())}))]},lN=aN,fN=m(tN,[Zu("dragger",{handlers:oN(sN)})]),dN=m(tN,[Zu("dragger",{handlers:oN((function(t,e,n){return m(uN(t,e,n),sN(t,e,n))}))})]),mN=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:lN,touch:fN,mouseOrTouch:dN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:x.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=x.none(),e=x.none(),n=r({});return ui({readState:n,reset:function(){t=x.none(),e=x.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=x.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=x.some(t)}})}}),apis:XA}),gN=function(t,e,n,r,o,i){return t.fold((function(){return mN.snap({sensor:VA(n-20,r-20),range:uu(o,i),output:VA(x.some(n),x.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return mN.snap({sensor:VA(o,i),range:uu(40,40),output:VA(x.some(n-u.width/2),x.some(r-u.height/2)),extra:{td:e}})}))},hN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Vn(t,e)}))})(e.get(),o)||(e.set(x.some(o)),n(o))},mustSnap:!0}},pN=function(t){return Rg(Ng.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:La([mN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Jy.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},vN=function(t,e){var n=Qe([]),r=Qe([]),o=Qe(!1),i=Qe(x.none()),u=Qe(x.none()),a=function(t){var n=Ou(t);return gN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Ou(t);return gN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=hN((function(){return V(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=hN((function(){return V(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=pN(s),d=pN(l),m=Zi(f.asSpec()),g=Zi(d.asSpec()),h=function(e,n,r,o){var i=r(n);mN.snapTo(e,i),function(e,n,r,i){var u=n.dom.getBoundingClientRect();Ui(e.element,"display");var a=vo(rn(t.getBody())).dom.innerHeight,c=u[o]<0,s=function(t,e){return t[o]>e}(u,a);(c||s)&&Bi(e.element,"display","none")}(e,n)},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};Ln().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(_s(e,m),_s(e,g),o.set(!0)),i.set(x.some(t.start)),u.set(x.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Ns(m),Ns(g),o.set(!1)),i.set(x.none()),u.set(x.none())})))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(i_||(i_={}));var bN,yN,wN,xN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},CN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(function(t,e,n){return e.delimiter||(e.delimiter="»"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:La([km.config({mode:"flow",selector:"div[role=button]"}),kp.config({disabled:n.isDisabled}),ev(),Xb.config({}),Am.config({}),Nm("elementPathEvents",[ro((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return km.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!xN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?Am.set(r,(i=V(a||[],(function(e,r){return Ng.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:La([nv(n.isDisabled),ev()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},$(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):Am.set(r,[])}))}))])]),components:[]}}(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Am.set(t,[Yi(e.translate(["{0} "+r,n[r]]))])};return Ng.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:La([nv(e.isDisabled),ev(),Xb.config({}),Am.config({}),ll.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Nm("wordcount-events",[uo((function(t){var e=ll.getValue(t),n="words"===e.mode?"characters":"words";ll.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),ro((function(e){t.on("wordCountUpdate",(function(t){var n=ll.getValue(e).mode;ll.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=lp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?i_.None:"both"===n?i_.Both:i_.Vertical}(t);return o!==i_.None&&r.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:zg("resize-handle",e.icons)},behaviours:La([mN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){!function(t,e,n){var r=rn(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=eA(r+e.top,Ap(t),Rp(t)),n===i_.Both&&(i.width=eA(o+e.left,Ep(t),Np(t))),i}(t,e,n,ru(r),fu(r));yt(o,(function(t,e){return Bi(r,e,tA(t))})),function(t){t.fire("ResizeEditor")}(t)}(t,o,n)},blockerClass:"tox-blocker"})])}}(o)),r}()}},SN=function(t){var e,n,r,o,i=t.inline,u=i?oA:QE,a=$p(t)?gE:j_,c=x.none(),s=Ln(),l=s.browser.isIE()?["tox-platform-ie"]:[],d=s.deviceType.isTouch()?["tox-platform-touch"]:[],m=Vp(t),g=Wp(t),h=lp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[yc]=m?Iu.BottomToTop:Iu.TopToBottom,e)},v=function(){return c.bind(LE.getHeader)},b=Zi((n=Vn(Ri(),g)&&"grid"===Li(g,"display"),r={dom:f({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(d)},h),behaviours:La([Cs.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:$r([Kr(Ar(),(function(){Bi(q.element,"width",document.body.clientWidth+"px")}))])},Rt(r,n?o:{}))),y=function(){return ct.value(b)},w=Rg({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return LE.getThrobber(t)})).getOrDie("Could not find throbber element")},S=function(t,e,n){var r=Qe(!1),o=function(t){var e=Qe(Vp(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:lp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return Ek(Tk,t,e)}(t,i)},anchors:Dk(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ct.value(t)}},urlinput:bO(e),styleselect:Gk(e),colorinput:Hk(e),dialog:Vk(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i}(b,t,(function(){return c.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=LE.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=Ip(t),T=LE.parts.toolbar(f({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind((function(t){return LE.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),_=LE.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),E=LE.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),A=LE.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),N=LE.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),M=t.getParam("statusbar",!0,"boolean")&&!i?x.some(CN(t,S.shared.providers)):x.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[E,A]},D=Bp(t),B=zp(t),P=Mp(t),I=LE.parts.header({dom:f({tag:"div",classes:["tox-editor-header"]},p),components:K([P?[k]:[],D?[_]:B?[T]:[],Up(t)?[]:[w.asSpec()]]),sticky:$p(t),editor:t,sharedBackstage:S.shared}),L=K([m?[]:[I],i?[]:[z],m?[I]:[]]),H=K([[{dom:{tag:"div",classes:["tox-editor-container"]},components:L}],i?[]:M.toArray(),[N]]),F=qp(t),V=f(f({role:"application"},lp.isRtl()?{dir:"rtl"}:{}),F?{"aria-hidden":"true"}:{}),U=Zi(LE.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d).concat(l),styles:f({visibility:"hidden"},F?{opacity:"0",border:"0"}:{}),attributes:V},components:H,behaviours:La([ev(),kp.config({disableClass:"tox-tinymce--disabled"}),km.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"})])}));c=x.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){LE.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){LE.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){LE.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return LE.isToolbarDrawerToggled(U)}));var W=jb(U),q=jb(b);!function(t,e,n){var r=function(t,r){j([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){j([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(qs(),{target:t.target})},u=Tb(rn(document),"touchstart",i),a=Tb(rn(document),"touchmove",(function(t){return r(Tr(),t)})),c=Tb(rn(document),"touchend",(function(t){return r(_r(),t)})),s=Tb(rn(document),"mousedown",i),l=Tb(rn(document),"mouseup",(function(t){0===t.raw.button&&o(Gs(),{target:t.target})})),f=function(t){return o(qs(),{target:rn(t.target)})},d=function(t){0===t.button&&o(Gs(),{target:rn(t.target)})},m=function(t){return r(Er(),Eb(t))},g=function(t){o($s(),{}),r(Ar(),Eb(t))},h=function(){return o($s(),{})};t.on("PostRender",(function(){t.on("click",f),t.on("tap",f),t.on("mouseup",d),t.on("ScrollWindow",m),t.on("ResizeWindow",g),t.on("ResizeEditor",h)})),t.on("remove",(function(){t.off("click",f),t.off("tap",f),t.off("mouseup",d),t.off("ScrollWindow",m),t.off("ResizeWindow",g),t.off("ResizeEditor",h),s.unbind(),u.unbind(),a.unbind(),c.unbind(),l.unbind()})),t.on("detach",(function(){Ds(e),Ds(n),e.destroy(),n.destroy()}))}(t,W,q);var $=function(){var e=tA(function(t){return function(t){var e=Tp(t),n=Ap(t),r=Rp(t);return ZE(e).map((function(t){return eA(t,n,r)}))}(t).getOr(Tp(t))}(t)),n=tA(function(t){return nA(t).getOr(_p(t))}(t));return t.inline||(ji("div","width",n)&&Bi(U.element,"width",n),ji("div","height",e)?Bi(U.element,"height",e):Bi(U.element,"height","200px")),e};return{mothership:W,uiMothership:q,backstage:S,renderUI:function(){a.setup(t,S.shared,v),dA(t,S),NA(t,y,S),function(t){var e=t.ui.registry.getAll().sidebars;j(vt(e),(function(n){var r=e[n],o=function(){return x.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),function(t,e,n){var r=Qe(!1),o=Qe(x.none()),i=function(t){t!==r.get()&&(function(t,e,n){var r=t.element;!0===e?(Am.set(t,[NE(n)]),Ui(r,"display"),Io(r,"aria-hidden")):(Am.set(t,[]),Bi(r,"display","none"),zo(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(Ag.clearTimeout),R(e.time)){var n=Ag.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(x.some(n))}else i(e.state),o.set(x.none())}))}(t,C,S.shared),wt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Dp(t),s={menuItems:r,menus:Gp(t),menubar:Xp(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===hh.floating,buttons:n,sidebar:i};M_(t,o,b,{backstage:S}),vN(t,b);var l=t.getElement(),f=$(),d={mothership:W,uiMothership:q,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:q.broadcast,broadcastOn:q.broadcastOn,register:function(){}}}}}},kN=r([_e("lazySink"),Pe("dragBlockClass"),Xe("getBounds",Tu),je("useTabstopAt",s),je("eventOrder",{}),fl("modalBehaviours",[km]),Yu("onExecute"),Qu("onEscape")]),ON={sketch:o},TN=r([Fl({name:"draghandle",overrides:function(t,e){return{behaviours:La([mN.config({mode:"mouse",getTarget:function(t){return Mu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Ll({schema:[_e("dom")],name:"title"}),Ll({factory:ON,schema:[_e("dom")],name:"close"}),Ll({factory:ON,schema:[_e("dom")],name:"body"}),Fl({factory:ON,schema:[_e("dom")],name:"footer"}),Hl({factory:{sketch:function(t,e){return f(f({},t),{dom:e.dom,components:e.components})}},schema:[je("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),je("components",[])],name:"blocker"})]),_N=Object.freeze({__proto__:null,block:function(t,e,n,r){zo(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})]),u=r(o,i),a=o.getSystem().build(u);Am.append(o,tu(a)),a.hasConfigured(km)&&km.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Am.remove(o,a)}))},unblock:function(t,e,n){Io(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),EN=[Xe("getRoot",x.none),Ku("onBlock"),Ku("onUnblock")],AN=Fa({fields:EN,name:"blocking",apis:_N,state:Object.freeze({__proto__:null,init:function(){var t=v_();return ui({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NN=gf({name:"ModalDialog",configFields:kN(),partFields:TN(),factory:function(t,e,n,r){var i,u=Qe(x.none()),a=Uo("modal-events"),c=f(f({},t.eventOrder),((i={})[Nr()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),i));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){u.set(x.some(e));var n=t.lazySink(e).getOrDie(),o=r.blocker(),i=n.getSystem().build(f(f({},o),{components:o.components.concat([tu(e)]),behaviours:La([Bm.config({}),Nm("dialog-blocker-events",[no(or(),(function(){km.focusIn(e)}))])])}));_s(n,i),km.focusIn(e)},hide:function(t){u.set(x.none()),bo(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Ns(t)}))}))},getBody:function(e){return Zl(e,t,"body")},getFooter:function(e){return Zl(e,t,"footer")},setIdle:function(t){AN.unblock(t)},setBusy:function(t,e){AN.block(t,e)}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:ml(t.modalBehaviours,[Am.config({}),km.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),AN.config({getRoot:u.get}),Nm(a,[ro((function(e){var n,r,i,u,a,c;n=e.element,r=Zl(e,t,"title").element,i=Bo(n,"id").fold((function(){var t=Uo("dialog-label");return zo(r,"id",t),t}),o),zo(n,"aria-labelledby",i),u=e.element,a=Zl(e,t,"body").element,c=x.from(Do(u,"id")).fold((function(){var t=Uo("dialog-describe");return zo(a,"id",t),t}),o),zo(u,"aria-describedby",c)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),RN=Zt([Ne("type"),Ne("name")].concat($h)),MN=Ce,zN=[ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),$e("align","end",["start","end"]),Ge("primary",!1),Ge("disabled",!1)],DN=m(zN,[Ne("text")]),BN=m([Re("type",["submit","cancel","custom"])],DN),PN=m([Re("type",["menu"]),He("text"),He("tooltip"),He("icon"),Be("items",RN)],zN),IN=ve("type",{submit:BN,cancel:BN,custom:BN,menu:PN}),LN=[Ne("type"),Ne("text"),Re("level",["info","warn","error","success"]),Ne("icon"),je("url","")],HN=Zt(LN),FN=[Ne("type"),Ne("text"),Ge("disabled",!1),Ge("primary",!1),ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),Ge("borderless",!1)],VN=Zt(FN),jN=[Ne("type"),Ne("name"),Ne("label"),Ge("disabled",!1)],UN=Zt(jN),WN=Ce,qN=[Ne("type"),Ne("name")],$N=qN.concat([He("label")]),GN=$N.concat([je("columns","auto")]),XN=Zt(GN),KN=ce([Ne("value"),Ne("text"),Ne("icon")]),YN=Zt($N),JN=xe,QN=Zt($N),ZN=xe,tR=qN.concat([qe("tag","textarea"),Ne("scriptId"),Ne("scriptUrl"),Ue("settings",void 0,Oe)]),eR=qN.concat([qe("tag","textarea"),Me("init")]),nR=le((function(t){return de("customeditor.old",Qt(eR),t).orThunk((function(){return de("customeditor.new",Qt(tR),t)}))})),rR=xe,oR=Zt($N),iR=te(ae),uR=function(t){return[Ne("type"),Ae("columns"),t]},aR=[Ne("type"),Ne("html"),$e("presets","presentation",["presentation","document"])],cR=Zt(aR),sR=$N.concat([Ge("sandboxed",!0)]),lR=Zt(sR),fR=xe,dR=$N.concat([Ee("currentState",Zt([_e("blob"),Ne("url")]))]),mR=Zt(dR),gR=$N.concat([He("inputMode"),He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),hR=Zt(gR),pR=xe,vR=function(t){return[Ne("type"),Ne("label"),t]},bR=[Ne("text"),Ne("value")],yR=[Ne("text"),Be("items",(yN=function(){return wR},wN=zt((function(){return yN()})),{extract:function(t,e,n){return wN().extract(t,e,n)},toString:function(){return wN().toString()}}))],wR=ee([Zt(bR),Zt(yR)]),xR=$N.concat([Be("items",wR),Ge("disabled",!1)]),CR=Zt(xR),SR=xe,kR=$N.concat([De("items",[Ne("text"),Ne("value")]),We("size",1),Ge("disabled",!1)]),OR=Zt(kR),TR=xe,_R=$N.concat([Ge("constrain",!0),Ge("disabled",!1)]),ER=Zt(_R),AR=Zt([Ne("width"),Ne("height")]),NR=[Ne("type"),Be("header",xe),Be("cells",te(xe))],RR=Zt(NR),MR=$N.concat([He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),zR=Zt(MR),DR=xe,BR=$N.concat([$e("filetype","file",["image","media","file"]),je("disabled",!1)]),PR=Zt(BR),IR=Zt([Ne("value"),je("meta",{})]),LR=function(t){return ie("items","items",Pt(),te(le((function(e){return de("Checking item of "+t,HR,e).fold((function(t){return ct.error(he(t))}),(function(t){return ct.value(t)}))}))))},HR=se((function(){return pe("type",{alertbanner:HN,bar:Zt((t=LR("bar"),[Ne("type"),t])),button:VN,checkbox:UN,colorinput:YN,colorpicker:QN,dropzone:oR,grid:Zt(uR(LR("grid"))),iframe:lR,input:hR,listbox:CR,selectbox:OR,sizeinput:ER,textarea:zR,urlinput:PR,customeditor:nR,htmlpanel:cR,imagetools:mR,collection:XN,label:Zt(vR(LR("label"))),table:RR,panel:VR});var t})),FR=[Ne("type"),je("classes",[]),Be("items",HR)],VR=Zt(FR),jR=[ie("name","name",Lt((function(){return Uo("tab-name")})),xe),Ne("title"),Be("items",HR)],UR=[Ne("type"),De("tabs",jR)],WR=Zt(UR),qR=DN,$R=IN,GR=Zt([Ne("title"),Ee("body",pe("type",{panel:VR,tabpanel:WR})),qe("size","normal"),Be("buttons",$R),je("initialData",{}),Xe("onAction",t),Xe("onChange",t),Xe("onSubmit",t),Xe("onClose",t),Xe("onCancel",t),je("onTabChange",t)]),XR=Zt(m([Re("type",["cancel","custom"])],qR)),KR=Zt([Ne("title"),Ne("url"),Le("height"),Le("width"),(bN=XR,Ie("buttons",te(bN))),Xe("onAction",t),Xe("onCancel",t),Xe("onClose",t),Xe("onMessage",t)]),YR=function(t){return O(t)?[t].concat(Y(kt(t),YR)):T(t)?Y(t,YR):[]},JR=function(t){return k(t.type)&&k(t.name)},QR={checkbox:WN,colorinput:JN,colorpicker:ZN,dropzone:iR,input:pR,iframe:fR,sizeinput:AR,selectbox:TR,listbox:SR,size:AR,textarea:DR,urlinput:IR,customeditor:rR,collection:KN,togglemenuitem:MN},ZR=function(t){var e=function(t){return W(YR(t),JR)}(t),n=Y(e,(function(t){return function(t){return x.from(QR[t.type])}(t).fold((function(){return[]}),(function(e){return[Ee(t.name,e)]}))}));return Zt(n)},tM=function(t){return{internalDialog:me(de("dialog",GR,t)),dataValidator:ZR(t),initialData:t.initialData}},eM={open:function(t,e){var n=tM(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(me(de("dialog",KR,e)))},redial:function(t){return tM(t)}},nM=function(t){var e=[],n={};return yt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ct.error(e):ct.value(n)},rM=function(t,e){var n,r=Rg(Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:V(t.items,(function(t){return _k(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),(n=r,wf.config({find:n.getOpt})),cC(r,{postprocess:function(t){return nM(t).fold((function(t){return console.error(t),{}}),(function(t){return t}))}})])}},oM=mf({name:"TabButton",configFields:[je("uid",void 0),_e("value"),ie("dom","dom",Ht((function(){return{attributes:{role:"tab",id:Uo("aria"),"aria-selected":"false"}}})),be()),Pe("action"),je("domModification",{}),fl("tabButtonBehaviours",[Bm,km,ll]),_e("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Km(t.action),behaviours:ml(t.tabButtonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0}),ll.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),iM=r([_e("tabs"),_e("dom"),je("clickToDismiss",!1),fl("tabbarBehaviours",[Nf,km]),Gu(["tabClass","selectedClass"])]),uM=Vl({factory:oM,name:"tabs",unit:"tab",overrides:function(e){var n=function(t,e){Nf.dehighlight(t,e),Vr(t,Ir(),{tabbar:t,button:e})},r=function(t,e){Nf.highlight(t,e),Vr(t,Pr(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(e.uid).getOrDie(),u=Nf.isHighlighted(i,o);(u&&e.clickToDismiss?n:u?t:r)(i,o)},domModification:{classes:[e.markers.tabClass]}}}}),aM=r([uM]),cM=gf({name:"Tabbar",configFields:iM(),partFields:aM(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:ml(t.tabbarBehaviours,[Nf.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){zo(e.element,"aria-selected","true")},onDehighlight:function(t,e){zo(e.element,"aria-selected","false")}}),km.config({mode:"flow",getInitial:function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),sM=mf({name:"Tabview",configFields:[fl("tabviewBehaviours",[Am])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:ml(t.tabviewBehaviours,[Am.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),lM=r([je("selectFirst",!0),Ku("onChangeTab"),Ku("onDismissTab"),je("tabs",[]),fl("tabSectionBehaviours",[])]),fM=Ll({factory:cM,schema:[_e("dom"),ze("markers",[_e("tabClass"),_e("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),dM=Ll({factory:sM,name:"tabview"}),mM=r([fM,dM]),gM=gf({name:"TabSection",configFields:lM(),partFields:mM(),factory:function(t,e,n,r){var o=function(e,n){Ql(e,t,"tabbar").each((function(t){n(t).each(jr)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.tabSectionBehaviours),events:$r(K([t.selectFirst?[ro((function(t,e){o(t,Nf.getFirst)}))]:[],[Kr(Pr(),(function(e,n){var r,o;r=n.event.button,o=ll.getValue(r),Ql(r,t,"tabview").each((function(e){G(t.tabs,(function(t){return t.value===o})).each((function(n){var o=n.view();Bo(r.element,"id").each((function(t){zo(e.element,"aria-labelledby",t)})),Am.set(e,o),t.onChangeTab(e,r,o)}))}))})),Kr(Ir(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Ql(e,t,"tabview").map((function(t){return Am.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Nf.getCandidates(t);return G(n,(function(t){return ll.getValue(t)===e})).filter((function(e){return!Nf.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),hM=function(t,e){Bi(t,"height",e+"px"),Ln().browser.isIE()?Ui(t,"flex-basis"):Bi(t,"flex-basis",e+"px")},pM=function(t,e,n){Mu(t,'[role="dialog"]').each((function(t){zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Bi(e,"height","0"),Bi(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=po(t).dom,i=Mu(t,".tox-dialog-wrap").getOr(t);r="fixed"===Li(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=ru(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+fu(n)?Math.max(ru(n),u):u,c=parseInt(Li(t,"margin-top"),10)||0,s=parseInt(Li(t,"margin-bottom"),10)||0;return r-(ru(t)+c+s-a)}(t,e,r))})).each((function(t){hM(e,t)}))}))}))},vM=function(t){return zu(t,'[role="tabpanel"]')},bM="send-data-to-section",yM="send-data-to-view",wM=function(t,e){var n=Qe({}),r=function(t){var e=ll.getValue(t),r=nM(e).getOr({}),o=n.get(),i=Rt(o,r);n.set(i)},o=function(t){var e=n.get();ll.setValue(t,e)},i=Qe(null),a=V(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,(function(t){return _k(n,t,e)})),formBehaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),Nm("TabView.form.events",[ro(o),oo(r)]),Wa.config({channels:jt([{key:bM,value:{onReceive:r}},{key:yM,value:{onReceive:o}}])})])}}))]}}})),c=function(t){var e;return{smartTabHeight:(e=Qe(x.none()),{extraEvents:[ro((function(n){var r=n.element;vM(r).each((function(o){Bi(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r,i=(r=function(t,e,n){return V(t,(function(r,o){Am.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Am.set(n,[]),i.height}))}(t,o,n),nt(tt(r,(function(t,e){return t>e?-1:t<e?1:0}))));e.set(i)})),pM(r,o,e),Ui(o,"visibility"),function(t,e){nt(t).each((function(t){return gM.showTab(e,t.value)}))}(t,n),Ag.requestAnimationFrame((function(){pM(r,o,e)}))}))})),Kr(Ar(),(function(t){var n=t.element;vM(n).each((function(t){pM(n,t,e)}))})),Kr(cy,(function(t,n){var r=t.element;vM(r).each((function(t){var n=Ga();Bi(t,"visibility","hidden");var o=Fi(t,"height").map((function(t){return parseInt(t,10)}));Ui(t,"height"),Ui(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(x.from(i)),pM(r,t,e)):o.each((function(e){hM(t,e)})),Ui(t,"visibility"),n.each($a)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}(a).smartTabHeight;return gM.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=ll.getValue(e);Vr(t,ay,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[gM.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[cM.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:La([Xb.config({})])}),gM.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:La([Nm("tabpanel",c.extraEvents),km.config({mode:"acyclic"}),wf.config({find:function(t){return nt(gM.getViewItems(t))}}),ll.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([bM],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([yM],{})}}})])})},xM=Uo("update-dialog"),CM=Uo("update-title"),SM=Uo("update-body"),kM=Uo("update-footer"),OM=Uo("body-send-message"),TM=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:f(f({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:La([eC(0),_T.config({channel:SM,updateState:function(t,e){return x.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[wM(t.body,n)];default:return[rM(t.body,n)]}},initialData:t})])}},_M=mv.deviceType.isTouch(),EM=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},AM=function(t,e){return NN.parts.close(Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:La([Xb.config({})])}))},NM=function(){return NN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},RM=function(t,e){return NN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:AE("<p>"+e.translate(t)+"</p>")}]}]})},MM=function(t){return NN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},zM=function(t,e){return[Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},DM=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return NN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),x.some(!0)},useTabstopAt:function(t){return!bC(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:f({position:"relative"},t.extraStyles)},components:m([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:AE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:_M?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:La(m([Bm.config({}),Nm("dialog-events",t.dialogEvents.concat([no(or(),(function(t,e){km.focusIn(t)}))])),Nm("scroll-lock",[ro((function(){vi(Ri(),i)})),oo((function(){bi(Ri(),i)}))])],t.extraBehaviours)),eventOrder:f((e={},e[yr()]=["dialog-events"],e[Nr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Rr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},BM=function(t){return Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.icons)}}],action:function(t){Fr(t,ny)}})},PM=function(t,e,n){var r=function(t){return[Yi(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:f({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:La([_T.config({channel:CM,renderComponents:r})])}},IM=function(){return{dom:AE('<div class="tox-dialog__draghandle"></div>')}},LM=function(t,e){return function(t,e){var n=NN.parts.title(PM(t,x.none(),e)),r=NN.parts.draghandle(IM()),o=NN.parts.close(BM(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},HM=function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},FM=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){NN.setBusy(t(),(function(t,n){return HM(e.message,n)}))},onUnblock:function(){NN.setIdle(t())}}},VM=function(t,e,n,r){var o;return Zi(DM(f(f({},t),{lazySink:r.shared.getSink,extraBehaviours:m([_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:e}),fC({})],t.extraBehaviours),onEscape:function(t){Fr(t,ny)},dialogEvents:n,eventOrder:(o={},o[br()]=[_T.name(),Wa.name()],o[Nr()]=["scroll-lock",_T.name(),"messages","dialog-events","alloy.base.behaviour"],o[Rr()]=["alloy.base.behaviour","dialog-events","messages",_T.name(),"scroll-lock"],o)})))},jM=function(t){return V(t,(function(t){return"menu"===t.type?function(t){var e=V(t.items,(function(t){var e=Qe(!1);return f(f({},t),{storage:e})}));return f(f({},t),{items:e})}(t):t}))},UM=function(t){return $(t,(function(t,e){return"menu"===e.type?$(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},WM=function(t,e){return[Zr(or(),vC),t(ey,(function(t,n){e.onClose(),n.onClose()})),t(ny,(function(t,e,n,r){e.onCancel(t),Fr(r,ey)})),Kr(uy,(function(t,n){return e.onUnblock()})),Kr(iy,(function(t,n){return e.onBlock(n.event)}))]},qM=function(t,e,n){var r=function(e,n){return Kr(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){_T.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return m(WM(r,e),[r(oy,(function(t,e){return e.onSubmit(t)})),r(ty,(function(t,e,n){e.onChange(t,{name:n.name})})),r(ry,(function(t,e,r,o){var i=function(){return km.focusIn(o)},u=function(t){return Po(t,"disabled")||Bo(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Ti(o.element),c=Ga(a);e.onAction(t,{name:r.name,value:r.value}),Ga(a).fold(i,(function(t){u(t)||c.exists((function(e){return jn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!jn(e.element,t)})).each(i)}))})),r(ay,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),oo((function(e){var n=t();ll.setValue(e,n.getData())}))])},$M=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=U(n,(function(t){return"start"===t.align})),o=function(t,e){return Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},GM=function(t,e){return{dom:AE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:La([_T.config({channel:kM,initialData:t,updateState:function(t,n){var r=V(n.buttons,(function(t){var n=Rg(function(t,e){return xS(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return x.some({lookupByName:function(t,e){return function(t,e,n){return G(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:$M})])}},XM=function(t,e){return NN.parts.footer(GM(t,e))},KM=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=wf.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return Gx.getField(n,e).fold((function(){var r=t.getFooter();return _T.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return x.some(t)}))}return x.none()},YM=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=ll.getValue(r),i=wt(n,(function(t){return t.get()}));return f(f({},o),i)},setData:function(e){r((function(r){var i=o.getData(),u=f(f({},i),e),a=function(t,e){var n=t.getRoot();return _T.getState(n).get().map((function(t){return me(de("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();ll.setValue(c,a),yt(n,(function(t,e){Tt(u,e)&&t.set(u[e])}))}))},disable:function(e){KM(t,e).each(kp.disable)},enable:function(e){KM(t,e).each(kp.enable)},focus:function(e){KM(t,e).each(Bm.focus)},block:function(t){if(!k(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Vr(e,iy,{message:t})}))},unblock:function(){r((function(t){Fr(t,uy)}))},showTab:function(e){r((function(n){var r=t.getBody();_T.getState(r).get().exists((function(t){return t.isTabPanel()}))&&wf.getCurrent(r).each((function(t){gM.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([xM],r),n.getSystem().broadcastOn([CM],r.internalDialog),n.getSystem().broadcastOn([SM],r.internalDialog),n.getSystem().broadcastOn([kM],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(t){Fr(t,ey)}))}};return o},JM=tinymce.util.Tools.resolve("tinymce.util.URI"),QM=["insertContent","setContent","execCommand","close","block","unblock"],ZM=function(t){return O(t)&&-1!==QM.indexOf(t.mceAction)},tz=function(t,e,n,r){var o,i,a,c,s,l,d,g,h=LM(t.title,r),p=(g={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[hC({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:La([Xb.config({}),Bm.config({})])})]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)})])},NN.parts.body(g)),v=t.buttons.bind((function(t){return 0===t.length?x.none():x.some(XM({buttons:t},r))})),b=(c=function(){return N},s=FM((function(){return A}),e),l=function(t,e){return Kr(t,(function(t,n){d(t,(function(r,o){e(c(),r,n.event,t)}))}))},d=function(t,e){_T.getState(t).get().each((function(n){e(n,t)}))},m(WM(l,s),[l(ry,(function(t,e,n){e.onAction(t,{name:n.name})}))])),y=f(f({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),w=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],C=new JM(t.url,{base_uri:new JM(window.location.href)}),S=C.protocol+"://"+C.host+(C.port?":"+C.port:""),T=Qe(x.none()),E=[Nm("messages",[ro((function(){var e=Tb(rn(window),"message",(function(e){if(C.isSameOrigin(new JM(e.raw.origin))){var r=e.raw.data;ZM(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!_(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,N,r):function(t){return!ZM(t)&&O(t)&&Tt(t,"mceAction")}(r)&&t.onMessage(N,r)}}));T.set(x.some(e))})),oo((function(){T.get().each((function(t){return t.unbind()}))}))]),Wa.config({channels:(o={},o[OM]={onReceive:function(t,e){zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,S)}))}},o)})],A=VM({header:h,body:p,footer:v,extraClasses:w,extraBehaviours:E,extraStyles:y},t,b,r),N=(i=A,a=function(t){i.getSystem().isConnected()&&t(i)},{block:function(t){if(!k(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a((function(e){Vr(e,iy,{message:t})}))},unblock:function(){a((function(t){Fr(t,uy)}))},close:function(){a((function(t){Fr(t,ey)}))},sendMessage:function(t){a((function(e){e.getSystem().broadcastOn([OM],t)}))}});return{dialog:A,instanceApi:N}},ez=function(t,e,n){return e&&n?[]:[uE.config({contextual:{lazyContext:function(){return x.some(ku(rn(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},nz=function(t){var e=t.backstage,n=t.editor,r=$p(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){NN.hide(c),r()},i=Rg(xS({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage)),u=NM(),a=AM(o,e.providers),c=Zi(DM({lazySink:function(){return e.getSink()},header:EM(u,a),body:RM(n,e.providers),footer:x.some(MM(zM([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,o)],eventOrder:{}}));NN.show(c);var s=i.get(c);Bm.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){NN.hide(s),r(t)},i=Rg(xS({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:x.none()},"submit",t.backstage)),u=xS({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage),a=NM(),c=AM((function(){return o(!1)}),e.providers),s=Zi(DM({lazySink:function(){return e.getSink()},header:EM(a,c),body:RM(n,e.providers),footer:x.some(MM(zM([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,(function(){return o(!1)})),Kr(oy,(function(){return o(!0)}))],eventOrder:{}}));NN.show(s);var l=i.get(s);Bm.focus(l)}}}(t),u=function(t,n){return eM.open((function(t,r,o){var i=r,u=function(t,e,n){var r=LM(t.internalDialog.title,n),o=function(t,e){var n=TM(t,x.none(),e,!1);return NN.parts.body(n)}({body:t.internalDialog.body},n),i=jM(t.internalDialog.buttons),u=UM(i),a=XM({buttons:i},n),c=qM((function(){return d}),FM((function(){return f}),e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:x.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=VM(l,t,c,n),d=YM({getRoot:function(){return f},getBody:function(){return NN.getBody(f)},getFooter:function(){return NN.getFooter(f)},getFormWrapper:function(){var t=NN.getBody(f);return wf.getCurrent(t).getOr(t)}},e.redial,u);return{dialog:f,instanceApi:d}}({dataValidator:o,initialData:i,internalDialog:t},{redial:eM.redial,closeWindow:function(){NN.hide(u.dialog),n(u.instanceApi)}},e);return NN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},a=function(t,o,i,u){return eM.open((function(t,a,c){var s,l=me(de("data",c,a)),d=(s=Qe(x.none()),{clear:function(){return s.set(x.none())},set:function(t){return s.set(x.some(t))},isSet:function(){return s.get().isSome()},on:function(t){return s.get().each(t)}}),g=e.shared.header.isPositionedAtTop(),h=function(){return d.on((function(t){vg.reposition(t),uE.refresh(t)}))},p=function(t,e,n,r){var o,i,u,a,c,s=Uo("dialog-label"),l=Uo("dialog-content"),f=Rg((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:[PM(u,x.some(a),c),IM(),BM(c)],containerBehaviours:La([mN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Du(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Rg(function(t,e,n,r){return TM(t,x.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=jM(t.internalDialog.buttons),g=UM(m),h=Rg(function(t,e){return GM(t,e)}({buttons:m},n)),p=qM((function(){return b}),{onBlock:function(t){AN.block(v,(function(e,n){return HM(t.message,n)}))},onUnblock:function(){AN.unblock(v)},onClose:function(){return e.closeWindow()}},n.shared.getSink),v=Zi({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=""+l,o)},eventOrder:(i={},i[br()]=[_T.name(),Wa.name()],i[yr()]=["execute-on-form"],i[Nr()]=["reflecting","execute-on-form"],i),behaviours:La([km.config({mode:"cyclic",onEscape:function(t){return Fr(t,ey),x.some(!0)},useTabstopAt:function(t){return!bC(t)&&("button"!==ao(t)||"disabled"!==Do(t,"disabled"))}}),_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:t}),Bm.config({}),Nm("execute-on-form",p.concat([no(or(),(function(t,e){km.focusIn(t)}))])),AN.config({getRoot:function(){return x.some(v)}}),Am.config({}),fC({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),b=YM({getRoot:function(){return v},getFooter:function(){return h.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var t=d.get(v);return wf.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:v,instanceApi:b}}({dataValidator:c,initialData:l,internalDialog:t},{redial:eM.redial,closeWindow:function(){d.on(vg.hide),n.off("ResizeEditor",h),d.clear(),i(p.instanceApi)}},e,u),v=Zi(vg.sketch(f(f({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},g?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:La(m([Nm("window-manager-inline-events",[Kr(Mr(),(function(t,e){Fr(p.dialog,ny)}))])],ez(n,r,g))),isExtraPart:function(t,e){return function(t){return Ab(t,".tox-alert-dialog")||Ab(t,".tox-confirm-dialog")}(e)}})));return d.set(v),vg.showWithin(v,o,tu(p.dialog),x.some(Ri())),r&&g||(uE.refresh(v),n.on("ResizeEditor",h)),p.instanceApi.setData(l),km.focusIn(p.dialog),p.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?a(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?a(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,r){return function(t,r){return eM.openUrl((function(t){var o=tz(t,{closeWindow:function(){NN.hide(o.dialog),r(o.instanceApi)}},n,e);return NN.show(o.dialog),o.instanceApi}),t)}(t,r)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};l.add("silver",(function(t){var e=SN(t),n=e.uiMothership,o=e.backstage,i=e.renderUI,u=e.getUi;kb(t,o.shared);var a=nz({editor:t,backstage:o});return{renderUI:i,getWindowManagerImpl:r(a),getNotificationManagerImpl:function(){return function(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),u=function(){o(),vg.hide(c)},a=Zi(Pg.sketch({text:t.text,level:I(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:x.from(t.icon),closeButton:!i,onAction:u,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),c=Zi(vg.sketch(f({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(c),t.timeout>0&&Ag.setTimeout((function(){u()}),t.timeout),{close:u,moveTo:function(t,e){vg.showAt(c,{anchor:"makeshift",x:t,y:e},tu(a))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(t){case"bc-bc":return Eg;case"tc-tc":return _g;case"tc-bc":return Sa;case"bc-tc":default:return ka}}(n),o={anchor:"node",root:Ri(),node:x.some(rn(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};vg.showAt(c,o,tu(a))}else vg.showAt(c,e.backstage.shared.anchors.banner(),tu(a))},text:function(t){Pg.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){Pg.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){j(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(nt(t).each((function(t){return t.moveRel(null,"banner")})),j(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}(0,{backstage:o},n)},ui:u()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t){return r((function(e,n){var u=Object.keys(e),a=Object.keys(n);if(!function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))}(o).eq(u,a))return!1;for(var c=u.length,s=0;s<c;s++){var l=u[s];if(!t.eq(e[l],n[l]))return!1}return!0}))},a=r((function(t,n){if(t===n)return!0;var r=e(t);return r===e(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===n:"array"===r?i(a).eq(t,n):"object"===r&&u(a).eq(t,n))})),c=function(){},s=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},l=function(t){return function(){return t}},f=function(t){return t};function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var m=function(t){return function(e){return!t(e)}},g=function(t){return function(){throw new Error(t)}},h=function(t){t()},p=l(!1),v=l(!0),b=function(){return y},y=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:e,map:b,each:c,bind:b,exists:p,forall:v,filter:b,equals:t,equals_:t,toArray:function(){return[]},toString:l("none()")}}(),w=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=function(t){return function(e){return t===e}},O=C("string"),T=C("object"),_=C("array"),E=k(null),A=S("boolean"),N=k(void 0),R=function(t){return null==t},M=function(t){return!R(t)},z=S("function"),D=S("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(t,e){return P.call(t,e)},H=function(t,e){return L(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return U(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,p)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!_(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);I.apply(e,t[n])}return e}(V(t,e))},Y=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},J=function(t){var e=B.call(t,0);return e.reverse(),e},Q=function(t,e){return W(t,(function(t){return!H(e,t)}))},Z=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},tt=function(t){return Z(t,0)},et=function(t){return Z(t,t.length-1)},nt=z(Array.from)?Array.from:function(t){return B.call(t)},rt=Object.keys,ot=Object.hasOwnProperty,it=function(t,e){for(var n=rt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ut=function(t,e){return at(t,(function(t,n){return{k:n,v:e(t,n)}}))},at=function(t,e){var n={};return it(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ct=function(t){return function(e,n){t[n]=e}},st=function(t,e,n,r){return it(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},lt=function(t,e){var n={},r={};return st(t,e,ct(n),ct(r)),{t:n,f:r}},ft=function(t,e){var n={};return st(t,e,ct(n),c),n},dt=function(t,e){return mt(t,e)?x.from(t[e]):x.none()},mt=function(t,e){return ot.call(t,e)},gt=function(t,e){return mt(t,e)&&void 0!==t[e]&&null!==t[e]},ht=Array.isArray,pt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return!1;return!0},vt=function(t,e){var n=[];return pt(t,(function(r,o){n.push(e(r,o,t))})),n},bt=function(t,e){var n=[];return pt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},yt=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},wt=function(t,e,n,r){for(var o=N(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},xt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Ct=function(t){return t[t.length-1]},St=function(){return(St=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function kt(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var Ot=function(){return Tt(0,0)},Tt=function(t,e){return{major:t,minor:e}},_t=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ot():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Tt(r(1),r(2))}(t,n)},Et=Ot,At=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},Nt=function(t,e){return-1!==t.indexOf(e)},Rt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(0,0+e.length)===e}(t,e)},Mt=function(t){return function(e){return e.replace(t,"")}},zt=Mt(/^\s+|\s+$/g),Dt=Mt(/^\s+/g),Bt=Mt(/\s+$/g),Pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,It=function(t){return function(e){return Nt(e,t)}},Lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Nt(t,"edge/")&&Nt(t,"chrome")&&Nt(t,"safari")&&Nt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pt],search:function(t){return Nt(t,"chrome")&&!Nt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Nt(t,"msie")||Nt(t,"trident")}},{name:"Opera",versionRegexes:[Pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:It("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:It("firefox")},{name:"Safari",versionRegexes:[Pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Nt(t,"safari")||Nt(t,"mobile/"))&&Nt(t,"applewebkit")}}],Ht=[{name:"Windows",search:It("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Nt(t,"iphone")||Nt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:It("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:It("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:It("linux"),versionRegexes:[]},{name:"Solaris",search:It("sunos"),versionRegexes:[]},{name:"FreeBSD",search:It("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:It("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ft={browsers:l(Lt),oses:l(Ht)},Vt="Edge",jt="Chrome",Ut="Opera",Wt="Firefox",qt="Safari",$t=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Vt),isChrome:r(jt),isIE:r("IE"),isOpera:r(Ut),isFirefox:r(Wt),isSafari:r(qt)}},Gt=function(){return $t({current:void 0,version:Et()})},Xt=$t,Kt=(l(Vt),l(jt),l("IE"),l(Ut),l(Wt),l(qt),"Windows"),Yt="Android",Jt="Linux",Qt="Solaris",Zt="FreeBSD",te="ChromeOS",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Kt),isiOS:r("iOS"),isAndroid:r(Yt),isOSX:r("OSX"),isLinux:r(Jt),isSolaris:r(Qt),isFreeBSD:r(Zt),isChromeOS:r(te)}},ne=function(){return ee({current:void 0,version:Et()})},re=ee,oe=(l(Kt),l("iOS"),l(Yt),l(Jt),l("OSX"),l(Qt),l(Zt),l(te),function(t,e){var n=Ft.browsers(),r=Ft.oses(),o=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(Gt,Xt),i=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ne,re),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,t,e);return{browser:o,os:i,deviceType:u}}),ie=function(t){return window.matchMedia(t).matches},ue=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return oe(navigator.userAgent,ie)})),ae=function(){return ue()},ce=navigator.userAgent,se=ae(),le=se.browser,fe=se.os,de=se.deviceType,me=/WebKit/.test(ce)&&!le.isEdge(),ge="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,he=-1!==ce.indexOf("Windows Phone"),pe={opera:le.isOpera(),webkit:me,ie:!(!le.isIE()&&!le.isEdge())&&le.version.major,gecko:le.isFirefox(),mac:fe.isOSX()||fe.isiOS(),iOS:de.isiPad()||de.isiPhone(),android:fe.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:le.isIE()?document.documentMode||7:10,fileApi:ge,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!le.isIE(),desktop:de.isDesktop(),windowsPhone:he,browser:{current:le.current,version:le.version,isChrome:le.isChrome,isEdge:le.isEdge,isFirefox:le.isFirefox,isIE:le.isIE,isOpera:le.isOpera,isSafari:le.isSafari},os:{current:fe.current,version:fe.version,isAndroid:fe.isAndroid,isChromeOS:fe.isChromeOS,isFreeBSD:fe.isFreeBSD,isiOS:fe.isiOS,isLinux:fe.isLinux,isOSX:fe.isOSX,isSolaris:fe.isSolaris,isWindows:fe.isWindows},deviceType:{isDesktop:de.isDesktop,isiPad:de.isiPad,isiPhone:de.isiPhone,isPhone:de.isPhone,isTablet:de.isTablet,isTouch:de.isTouch,isWebView:de.isWebView}},ve=/^\s*|\s*$/g,be=function(t){return null==t?"":(""+t).replace(ve,"")},ye=function(t,e){return e?!("array"!==e||!ht(t))||typeof t===e:void 0!==t},we=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),pt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;we(t,e,n,r)})))},xe={trim:be,isArray:ht,is:ye,toArray:function(t){if(ht(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:pt,map:vt,grep:bt,inArray:yt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=this,a=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},walk:we,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||ye(t,"array")?t:vt(t.split(e||","),be)},_addCacheSuffix:function(t){var e=pe.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Ce=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Se=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ce(n.childNodes[0])},ke=function(t,e){var n=(e||document).createElement(t);return Ce(n)},Oe=function(t,e){var n=(e||document).createTextNode(t);return Ce(n)},Te=Ce,_e=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Ee=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ae=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ne=function(t,e){return t.dom===e.dom},Re=function(t,e){return ae().browser.isIE()?function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t.dom,e.dom,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Me=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),ze=function(t){return t.dom.nodeType},De=function(t){return function(e){return ze(e)===t}},Be=De(1),Pe=De(3),Ie=De(9),Le=De(11),He=function(t){return Te(t.dom.ownerDocument)},Fe=function(t){return Ie(t)?t:He(t)},Ve=function(t){return Te(Fe(t).dom.defaultView)},je=function(t){return x.from(t.dom.parentNode).map(Te)},Ue=function(t){return x.from(t.dom.previousSibling).map(Te)},We=function(t){return x.from(t.dom.nextSibling).map(Te)},qe=function(t){return J(_e(t,Ue))},$e=function(t){return _e(t,We)},Ge=function(t){return V(t.dom.childNodes,Te)},Xe=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(Te)},Ke=function(t){return Xe(t,0)},Ye=function(t){return Xe(t,t.dom.childNodes.length-1)},Je=function(t){return Le(t)},Qe=z(Element.prototype.attachShadow)&&z(Node.prototype.getRootNode),Ze=l(Qe),tn=Qe?function(t){return Te(t.dom.getRootNode())}:Fe,en=function(t){return Je(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Te(e)}(Fe(t))},nn=function(t){return Te(t.dom.host)},rn=function(t,e){je(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},on=function(t,e){We(t).fold((function(){je(t).each((function(t){an(t,e)}))}),(function(t){rn(t,e)}))},un=function(t,e){Ke(t).fold((function(){an(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},an=function(t,e){t.dom.appendChild(e.dom)},cn=function(t,e){j(e,(function(e){an(t,e)}))},sn=function(t){t.dom.textContent="",j(Ge(t),(function(t){ln(t)}))},ln=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},fn=function(t){var e,n=Ge(t);n.length>0&&(e=t,j(n,(function(t){rn(e,t)}))),ln(t)},dn=function(t){var e=Pe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=tn(t);return Je(e)?x.some(e):x.none()}(Te(e)).fold((function(){return o.body.contains(e)}),(n=dn,r=nn,function(t){return n(r(t))}))},mn=function(t,e){return{left:t,top:e,translate:function(n,r){return mn(t+n,e+r)}}},gn=mn,hn=function(t,e){return void 0!==t?t:void 0!==e?e:0},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?gn(n.offsetLeft,n.offsetTop):dn(t)?function(t){var e=t.getBoundingClientRect();return gn(e.left,e.top)}(e):gn(0,0)},vn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return gn(n,r)},bn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},yn=function(t,e){ae().browser.isSafari()&&z(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},wn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},xn=function(t){var e=void 0===t?window:t,n=e.document,r=vn(Te(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return wn(r.left,r.top,n,o)}),(function(t){return wn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Cn=function(t){return function(e){return!!e&&e.nodeType===t}},Sn=function(t){return!!t&&!Object.getPrototypeOf(t)},kn=Cn(1),On=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return H(e,n)}return!1}},Tn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(kn(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},_n=function(t){return function(e){return kn(e)&&e.hasAttribute(t)}},En=function(t){return kn(t)&&t.hasAttribute("data-mce-bogus")},An=function(t){return kn(t)&&"TABLE"===t.tagName},Nn=function(t){return function(e){if(kn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Rn=On(["textarea","input"]),Mn=Cn(3),zn=Cn(8),Dn=Cn(9),Bn=Cn(11),Pn=On(["br"]),In=On(["img"]),Ln=Nn("true"),Hn=Nn("false"),Fn=On(["td","th"]),Vn=On(["video","audio","object","embed"]),jn=function(t){return void 0!==t.style&&z(t.style.getPropertyValue)},Un=function(t,e,n){if(!(O(n)||A(n)||D(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Wn=function(t,e,n){Un(t.dom,e,n)},qn=function(t,e){var n=t.dom;it(e,(function(t,e){Un(n,e,t)}))},$n=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Gn=function(t,e){return x.from($n(t,e))},Xn=function(t,e){t.dom.removeAttribute(e)},Kn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||dn(t)?r:Yn(n,e)},Yn=function(t,e){return jn(t)?t.style.getPropertyValue(e):""},Jn=function(t,e){var n=t.dom,r=Yn(n,e);return x.from(r).filter((function(t){return t.length>0}))},Qn=function(t){var e={},n=t.dom;if(jn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Zn=ae().browser,tr=function(t){return G(t,Be)},er=function(t,e){return t.children&&H(t.children,e)},nr={},rr={exports:nr};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,nr,rr);var or=rr.exports.boltExport,ir=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return ir((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ur={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ar=function(t){setTimeout((function(){throw t}),0)},cr=function(t){var e=function(e){t().then(e,ar)};return{map:function(e){return cr((function(){return t().then(e)}))},bind:function(e){return cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sr=function(t){return cr((function(){return new or(t)}))},lr=function(t){return{is:function(e){return t===e},isValue:v,isError:p,getOr:l(t),getOrThunk:l(t),getOrDie:l(t),or:function(e){return lr(t)},orThunk:function(e){return lr(t)},fold:function(e,n){return n(t)},map:function(e){return lr(e(t))},mapError:function(e){return lr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},fr=function(t){return{is:p,isValue:p,isError:v,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return g(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return fr(t)},mapError:function(e){return fr(e(t))},each:c,bind:function(e){return fr(t)},exists:p,forall:v,toOptional:x.none}},dr={value:lr,error:fr,fromOption:function(t,e){return t.fold((function(){return fr(e)}),lr)}},mr=function(t){if(!_(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=rt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!_(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=rt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!Y(e,(function(t){return H(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},gr=(mr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(f,f)});function hr(t,e,n,r,o){return t(n,r)?x.some(n):z(o)&&o(n)?x.none():e(n,r,o)}var pr,vr=function(t,e,n){for(var r=t.dom,o=z(n)?n:p;r.parentNode;){r=r.parentNode;var i=Te(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},br=function(t,e,n){return hr((function(t,e){return e(t)}),vr,t,e,n)},yr=function(t,e,n){return vr(t,(function(t){return Ee(t,e)}),n)},wr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?x.none():x.from(n.querySelector(t)).map(Te)}(e,t)},xr=function(t,e,n){return hr((function(t,e){return Ee(t,e)}),yr,t,e,n)},Cr=window.Promise?window.Promise:function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(e,t(i,this),t(u,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};function o(t){var e=this;null!==this._state?r((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function i(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void s(t(n,e),t(i,this),t(u,this))}this._state=!0,this._value=e,a.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n((function(n,i){o.call(r,new c(t,e,n,i))}))},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new n((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}t[i]=u,0==--r&&e(t)}catch(t){n(t)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.race=function(t){return new n((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},n}(),Sr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},kr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Or=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Sr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Tr={requestAnimationFrame:function(t,e){pr?pr.then(t):pr=new Cr((function(t){e||(e=document.body),function(t,e){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(t){window.setTimeout(t,0)}),r(t,e)}(t,e)})).then(t)},setTimeout:Sr,setInterval:kr,setEditorTimeout:function(t,e,n){return Sr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=kr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Or,throttle:Or,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}};function _r(t,e){void 0===e&&(e={});var n=0,r={},o=Te(t),i=Fe(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=xe._addCacheSuffix(a),d=function(t){return dt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?Tr.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=ke("link",i.dom);qn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Wn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Wn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,an(en(o),b),Wn(v,"href",f)}else h();else g()},c=function(t){return sr((function(e){a(t,s(e,l(dr.value(t))),s(e,l(dr.error(t))))}))},f=function(t){var e=xe._addCacheSuffix(t);dt(r,e).each((function(t){var n,i;0==--t.count&&(delete r[e],n=t.id,i=en(o),wr(i,"#"+n).each(ln))}))};return{load:a,loadAll:function(t,e,n){var r;(r=V(t,c),function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):j(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))}(r,sr)).get((function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(gr)):e(r.pass.map(gr))}))},unload:f,unloadAll:function(t){j(t,(function(t){f(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var Er=function(){var t=new WeakMap;return{forElement:function(e,n){var r=tn(e).dom;return x.from(t.get(r)).getOrThunk((function(){var e=_r(r,n);return t.set(r,e),e}))}}}(),Ar=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Nr=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,v)).hasOwnProperty(Me(n))}},Rr=Nr(["h1","h2","h3","h4","h5","h6"]),Mr=Nr(["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"]),zr=function(t){return Be(t)&&!Mr(t)},Dr=function(t){return Be(t)&&"br"===Me(t)},Br=Nr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Pr=Nr(["ul","ol","dl"]),Ir=Nr(["li","dd","dt"]),Lr=Nr(["thead","tbody","tfoot"]),Hr=Nr(["td","th"]),Fr=Nr(["pre","script","textarea","style"]),Vr=" ",jr="\ufeff",Ur=function(t){return"\ufeff"===t},Wr=function(t){return t.replace(/\uFEFF/g,"")},qr=kn,$r=Mn,Gr=function(t){return $r(t)&&(t=t.parentNode),qr(t)&&t.hasAttribute("data-mce-caret")},Xr=function(t){return $r(t)&&Ur(t.data)},Kr=function(t){return Gr(t)||Xr(t)},Yr=function(t){return t.firstChild!==t.lastChild||!Pn(t.firstChild)},Jr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset())===jr||t.isAtStart()&&Xr(e.previousSibling))},Qr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset()-1)===jr||t.isAtEnd()&&Xr(e.nextSibling))},Zr=function(t){return $r(t)&&t.data[0]===jr},to=function(t){return $r(t)&&t.data[t.data.length-1]===jr},eo=function(t){return t&&t.hasAttribute("data-mce-caret")?(n=(e=t.getElementsByTagName("br"))[e.length-1],En(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},no=Ln,ro=Hn,oo=Pn,io=Mn,uo=On(["script","style","textarea"]),ao=On(["img","input","textarea","hr","iframe","video","audio","object","embed"]),co=On(["table"]),so=Kr,lo=function(t){return!so(t)&&(io(t)?!uo(t.parentNode):ao(t)||oo(t)||co(t)||fo(t))},fo=function(t){return!1===function(t){return kn(t)&&"true"===t.getAttribute("unselectable")}(t)&&ro(t)},mo=function(t,e){return lo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(fo(t))return!1;if(no(t))return!0}return!0}(t,e)},go=/^[ \t\r\n]*$/,ho=function(t){return go.test(t)},po=function(t,e){return lo(t)&&!1===function(t,e){return Mn(t)&&ho(t.data)&&!1===function(t,e){var n,r,o=Te(e);return n=Te(t),r=d(Ne,o),yr(n,"pre,code",r).isSome()}(t,e)}(t,e)||function(t){return kn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||vo(t)},vo=_n("data-mce-bookmark"),bo=_n("data-mce-bogus"),yo=("data-mce-bogus","all",function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}),wo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(po(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new Ar(n,t);do{if(e){if(yo(n)){n=o.next(!0);continue}if(bo(n)){n=o.next();continue}}if(Pn(n))r++,n=o.next();else{if(po(n,t))return!1;n=o.next()}}while(n);return r<=1}(t.dom,e)},xo=function(t,e){return M(t)&&(po(t,e)||zr(Te(t)))},Co=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},So=function(t,e,n){var r=n||e;if(kn(e)&&Co(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)So(t,o[i],r);if(kn(e)){var u=e.childNodes;1===u.length&&Co(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Bn(t)||Dn(t)}(e)||po(e,r)||function(t){return!!kn(t)&&t.childNodes.length>0}(e)||function(t,e){return Mn(t)&&t.data.length>0&&function(t,e){var n=new Ar(t,e).prev(!1),r=new Ar(t,e).next(!1),o=N(n)||xo(n,e),i=N(r)||xo(r,e);return o&&i}(t,e)}(e,r)||t.remove(e),e},ko=xe.makeMap,Oo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,To=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_o=/[<>&\"\']/g,Eo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ao={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:"Ÿ"},No={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Ro={"<":"<",">":">","&":"&",""":'"',"'":"'"},Mo=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),No[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},zo=Mo("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),Do=function(t,e){return t.replace(e?Oo:To,(function(t){return No[t]||t}))},Bo=function(t,e){return t.replace(e?Oo:To,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":No[t]||"&#"+t.charCodeAt(0)+";"}))},Po=function(t,e,n){return n=n||zo,t.replace(e?Oo:To,(function(t){return No[t]||n[t]||t}))},Io={encodeRaw:Do,encodeAllRaw:function(t){return(""+t).replace(_o,(function(t){return No[t]||t}))},encodeNumeric:Bo,encodeNamed:Po,getEncodeFunc:function(t,e){var n=Mo(e)||zo,r=ko(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Oo:To,(function(t){return void 0!==No[t]?No[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Po(t,e,n)}:Po:r.numeric?Bo:Do},decode:function(t){return t.replace(Eo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Ao[e]||String.fromCharCode(e):Ro[t]||zo[t]||function(t){var e=ke("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},Lo={},Ho={},Fo=xe.makeMap,Vo=xe.each,jo=xe.extend,Uo=xe.explode,Wo=xe.inArray,qo=function(t,e){return(t=xe.trim(t))?t.split(e||" "):[]},$o=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Vo(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Fo(t,/[, ]/):Uo(t,/[, ]/)}))),n};function Go(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=Fo(o,/[, ]/,Fo(o.toUpperCase(),/[, ]/)):(o=Lo[e])||(o=Fo(n," ",Fo(n.toUpperCase()," ")),o=jo(o,r),Lo[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=qo(r));var s=qo(t);for(o=s.length;o--;)u={attributes:c(i=qo([e,n].join(" "))),attributesOrder:i,children:c(r,Ho)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=qo(t);n=u.length;for(var c=qo(e);n--;)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return Lo[t]?Lo[t]:(e="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"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),Vo(qo(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Vo(qo(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("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),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("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"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Vo(qo("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,Lo[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=$o(t.valid_styles),s=$o(t.invalid_styles,"map"),l=$o(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h="td th iframe video audio object script code",p=u("non_empty_elements",h+" pre",m),v=u("move_caret_before_on_enter_elements",h+" table",m),b=u("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"),y=u("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",b),w=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");Vo((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=qo(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(p=a[1],f=a[2],v=a[3],l=a[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(it(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=qo(l,"|")).length;i<u;i++)if(a=S.exec(l[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],w=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(Wo(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===p&&(s.validValues=Fo(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=x(f),r.push(c)):e[f]=c}}},S=function(t){e={},r=[],C(t),Vo(a,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(Lo.text_block_elements=Lo.block_elements=null,Vo(qo(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[a];delete(s=jo({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Vo(n,(function(t,e){t[a]&&(n[e]=t=jo({},n[e]),t[c]=t[a])}))})))},O=function(e){var r=/^([+\-]?)([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]+)\[([^\]]+)]$/;Lo[t.schema]=null,e&&Vo(qo(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Vo(qo(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},T=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};return t.valid_elements?S(t.valid_elements):(Vo(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Vo(qo("strong/b em/i"),(function(t){var n=qo(t,"/");e[n[1]].outputName=n[0]})),Vo(qo("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Vo(qo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Vo(qo("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Vo({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"},(function(t,n){e[n]&&(e[n].parentsRequired=qo(t))})),t.invalid_elements&&Vo(Uo(t.invalid_elements),(function(t){e[t]&&delete e[t]})),T("span")||C("span[!data-mce-type|*]"),{children:n,elements:e,getValidStyles:function(){return c},getValidClasses:function(){return l},getBlockElements:function(){return y},getInvalidStyles:function(){return s},getShortEndedElements:function(){return m},getTextBlockElements:function(){return b},getTextInlineElements:function(){return w},getBoolAttrs:function(){return g},getElementRule:T,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return p},getMoveCaretBeforeOnEnterElements:function(){return v},getWhiteSpaceElements:function(){return f},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=T(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}}var Xo,Ko,Yo,Jo,Qo,Zo,ti,ei,ni,ri,oi,ii,ui,ai,ci,si,li,fi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},di=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,a=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<l.length;n++)s[l[n]]="\ufeff"+n,s["\ufeff"+n]=l[n];return{toHex:function(t){return t.replace(i,fi)},parse:function(e){var r,o,l,f,d,m,g,h={},p=t.url_converter,v=t.url_converter_scope||this,b=function(t,e,r){var o=h[t+"-top"+e];if(o){var i=h[t+"-right"+e];if(i){var u=h[t+"-bottom"+e];if(u){var a=h[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(h[t+e]=-1===n?c[0]:c.join(" "),delete h[t+"-top"+e],delete h[t+"-right"+e],delete h[t+"-bottom"+e],delete h[t+"-left"+e])}}}}},y=function(t){var e,n=h[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return h[t]=n[0],!0}},w=function(t){return f=!0,s[t]},x=function(t,e){return f&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return s[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},C=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},S=function(t){return t.replace(/\\[0-9a-f]+/gi,C)},k=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=x(i)).replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return p&&(n=p.call(v,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));r=a.exec(e);)if(a.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),l=r[2].replace(c,""),o&&l){if(o=S(o),l=S(l),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===o&&"700"===l?l="bold":"color"!==o&&"background-color"!==o||(l=l.toLowerCase()),l=(l=l.replace(i,fi)).replace(u,k),h[o]=f?x(l,!0):l}b("border","",!0),b("border","-width"),b("border","-color"),b("border","-style"),b("padding",""),b("margin",""),"border",m="border-style",g="border-color",y(d="border-width")&&y(m)&&y(g)&&(h.border=h[d]+" "+h[m]+" "+h[g],delete h[d],delete h[m],delete h[g]),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):it(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},mi=/^(?:mouse|contextmenu)|click/,gi={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},hi=function(){return!1},pi=function(){return!0},vi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},bi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},yi=function(t,e){var n,r=e||{};for(n in t)gi[n]||(r[n]=t[n]);if(r.target||(r.target=r.srcElement||document),r.composedPath&&(r.composedPath=function(){return t.composedPath()}),t&&function(t){return mi.test(t.type)}(t)&&void 0===t.pageX&&void 0!==t.clientX){var o=r.target.ownerDocument||document,i=o.documentElement,u=o.body;r.pageX=t.clientX+(i&&i.scrollLeft||u&&u.scrollLeft||0)-(i&&i.clientLeft||u&&u.clientLeft||0),r.pageY=t.clientY+(i&&i.scrollTop||u&&u.scrollTop||0)-(i&&i.clientTop||u&&u.clientTop||0)}return r.preventDefault=function(){r.isDefaultPrevented=pi,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},r.stopPropagation=function(){r.isPropagationStopped=pi,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=pi,r.stopPropagation()},!1===function(t){return t.isDefaultPrevented===pi||t.isDefaultPrevented===hi}(r)&&(r.isDefaultPrevented=hi,r.isPropagationStopped=hi,r.isImmediatePropagationStopped=hi),void 0===r.metaKey&&(r.metaKey=!1),r},wi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){bi(t,"DOMContentLoaded",i),bi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():vi(t,"DOMContentLoaded",i),n.domLoaded||vi(t,"load",i)}},xi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(yi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,yi({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=yi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=yi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(yi({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?wi(t,s,f):vi(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],bi(t,r.fakeName||u,r.nativeHandler,r.capture))}}else it(a,(function(e,n){bi(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(mt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=yi(null,n);o.type=e,o.target=t;do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Ci="sizzle"+-new Date,Si=window.document,ki=0,Oi=0,Ti=iu(),_i=iu(),Ei=iu(),Ai=function(t,e){return t===e&&(ri=!0),0},Ni="undefined",Ri=1<<31,Mi={}.hasOwnProperty,zi=[],Di=zi.pop,Bi=zi.push,Pi=zi.push,Ii=zi.slice,Li=zi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Hi="[\\x20\\t\\r\\n\\f]",Fi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Vi="\\[[\\x20\\t\\r\\n\\f]*("+Fi+")(?:"+Hi+"*([*^$|!~]?=)"+Hi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Fi+"))|)"+Hi+"*\\]",ji=":("+Fi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Vi+")*)|.*)\\)|)",Ui=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),Wi=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),qi=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),$i=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),Gi=new RegExp(ji),Xi=new RegExp("^"+Fi+"$"),Ki={ID:new RegExp("^#("+Fi+")"),CLASS:new RegExp("^\\.("+Fi+")"),TAG:new RegExp("^("+Fi+"|[*])"),ATTR:new RegExp("^"+Vi),PSEUDO:new RegExp("^"+ji),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Yi=/^(?:input|select|textarea|button)$/i,Ji=/^h\d$/i,Qi=/^[^{]+\{\s*\[native \w/,Zi=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tu=/[+~]/,eu=/'|\\/g,nu=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ru=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Pi.apply(zi=Ii.call(Si.childNodes),Si.childNodes),zi[Si.childNodes.length].nodeType}catch(t){Pi={apply:zi.length?function(t,e){Bi.apply(t,Ii.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var ou=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Si)!==ii&&oi(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||ii).nodeType)&&9!==a)return[];if(ai&&!r){if(o=Zi.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&li(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Pi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&Xo.getElementsByClassName)return Pi.apply(n,e.getElementsByClassName(u)),n}if(Xo.qsa&&(!ci||!ci.test(t))){if(f=l=Ci,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Qo(t),(l=e.getAttribute("id"))?f=l.replace(eu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+fu(s[c]);d=tu.test(t)&&su(e.parentNode)||e,m=s.join(",")}if(m)try{return Pi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return ti(t.replace(Ui,"$1"),e,n,r)};function iu(){var t=[];return function e(n,r){return t.push(n+" ")>Ko.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function uu(t){return t[Ci]=!0,t}function au(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Ri)-(~t.sourceIndex||Ri);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function cu(t){return uu((function(e){return e=+e,uu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function su(t){return t&&typeof t.getElementsByTagName!==Ni&&t}function lu(){}function fu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function du(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Oi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[ki,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Ci]||(e[Ci]={}))[r])&&a[0]===ki&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function mu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function gu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function hu(t,e,n,r,o,i){return r&&!r[Ci]&&(r=hu(r)),o&&!o[Ci]&&(o=hu(o,i)),uu((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ou(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:gu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=gu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?Li.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=gu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Pi.apply(u,v)}))}function pu(t){for(var e,n,r,o=t.length,i=Ko.relative[t[0].type],u=i||Ko.relative[" "],a=i?1:0,c=du((function(t){return t===e}),u,!0),s=du((function(t){return Li.call(e,t)>-1}),u,!0),l=[function(t,n,r){return!i&&(r||n!==ei)||((e=n).nodeType?c(t,n,r):s(t,n,r))}];a<o;a++)if(n=Ko.relative[t[a].type])l=[du(mu(l),n)];else{if((n=Ko.filter[t[a].type].apply(null,t[a].matches))[Ci]){for(r=++a;r<o&&!Ko.relative[t[r].type];r++);return hu(a>1&&mu(l),a>1&&fu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Ui,"$1"),n,a<r&&pu(t.slice(a,r)),r<o&&pu(t=t.slice(r)),r<o&&fu(t))}l.push(n)}return mu(l)}Xo=ou.support={},Jo=ou.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},oi=ou.setDocument=function(t){var e,n=t?t.ownerDocument||t:Si,r=n.defaultView;return n!==ii&&9===n.nodeType&&n.documentElement?(ii=n,ui=n.documentElement,ai=!Jo(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){oi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){oi()}))),Xo.attributes=!0,Xo.getElementsByTagName=!0,Xo.getElementsByClassName=Qi.test(n.getElementsByClassName),Xo.getById=!0,Ko.find.ID=function(t,e){if(typeof e.getElementById!==Ni&&ai){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Ko.filter.ID=function(t){var e=t.replace(nu,ru);return function(t){return t.getAttribute("id")===e}},Ko.find.TAG=Xo.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Ni)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Ko.find.CLASS=Xo.getElementsByClassName&&function(t,e){if(ai)return e.getElementsByClassName(t)},si=[],ci=[],Xo.disconnectedMatch=!0,ci=ci.length&&new RegExp(ci.join("|")),si=si.length&&new RegExp(si.join("|")),e=Qi.test(ui.compareDocumentPosition),li=e||Qi.test(ui.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ai=e?function(t,e){if(t===e)return ri=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Xo.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Si&&li(Si,t)?-1:e===n||e.ownerDocument===Si&&li(Si,e)?1:ni?Li.call(ni,t)-Li.call(ni,e):0:4&r?-1:1)}:function(t,e){if(t===e)return ri=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:ni?Li.call(ni,t)-Li.call(ni,e):0;if(i===u)return au(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?au(a[o],c[o]):a[o]===Si?-1:c[o]===Si?1:0},n):ii},ou.matches=function(t,e){return ou(t,null,null,e)},ou.matchesSelector=function(t,e){if((t.ownerDocument||t)!==ii&&oi(t),e=e.replace($i,"='$1']"),Xo.matchesSelector&&ai&&(!si||!si.test(e))&&(!ci||!ci.test(e)))try{var n=(void 0).call(t,e);if(n||Xo.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return ou(e,ii,null,[t]).length>0},ou.contains=function(t,e){return(t.ownerDocument||t)!==ii&&oi(t),li(t,e)},ou.attr=function(t,e){(t.ownerDocument||t)!==ii&&oi(t);var n=Ko.attrHandle[e.toLowerCase()],r=n&&Mi.call(Ko.attrHandle,e.toLowerCase())?n(t,e,!ai):void 0;return void 0!==r?r:Xo.attributes||!ai?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},ou.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ou.uniqueSort=function(t){var e,n=[],r=0,o=0;if(ri=!Xo.detectDuplicates,ni=!Xo.sortStable&&t.slice(0),t.sort(Ai),ri){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return ni=null,t},Yo=ou.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Yo(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Yo(e);return n},(Ko=ou.selectors={cacheLength:50,createPseudo:uu,match:Ki,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(nu,ru),t[3]=(t[3]||t[4]||t[5]||"").replace(nu,ru),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ou.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ou.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Ki.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Gi.test(n)&&(e=Qo(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(nu,ru).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Ti[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+Hi+"|$)"))&&Ti(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Ni&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=ou.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[Ci]||(p[Ci]={}))[t]||[])[0]===ki&&s[1],d=s[0]===ki&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[ki,m,d];break}}else if(b&&(s=(e[Ci]||(e[Ci]={}))[t])&&s[0]===ki)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ci]||(f[Ci]={}))[t]=[ki,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Ko.pseudos[t]||Ko.setFilters[t.toLowerCase()]||ou.error("unsupported pseudo: "+t);return r[Ci]?r(e):r.length>1?(n=[t,t,"",e],Ko.setFilters.hasOwnProperty(t.toLowerCase())?uu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Li.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:uu((function(t){var e=[],n=[],r=Zo(t.replace(Ui,"$1"));return r[Ci]?uu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:uu((function(t){return function(e){return ou(t,e).length>0}})),contains:uu((function(t){return t=t.replace(nu,ru),function(e){return(e.textContent||e.innerText||Yo(e)).indexOf(t)>-1}})),lang:uu((function(t){return Xi.test(t||"")||ou.error("unsupported lang: "+t),t=t.replace(nu,ru).toLowerCase(),function(e){var n;do{if(n=ai?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===ui},focus:function(t){return t===ii.activeElement&&(!ii.hasFocus||ii.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Ko.pseudos.empty(t)},header:function(t){return Ji.test(t.nodeName)},input:function(t){return Yi.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:cu((function(){return[0]})),last:cu((function(t,e){return[e-1]})),eq:cu((function(t,e,n){return[n<0?n+e:n]})),even:cu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:cu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:cu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:cu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Ko.pseudos.eq,j(["radio","checkbox","file","password","image"],(function(t){Ko.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),j(["submit","reset"],(function(t){Ko.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),lu.prototype=Ko.filters=Ko.pseudos,Ko.setFilters=new lu,Qo=ou.tokenize=function(t,e){var n,r,o,i,u,a,c,s=_i[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=Ko.preFilter;u;){for(i in n&&!(r=Wi.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=qi.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Ui," ")}),u=u.slice(n.length)),Ko.filter)Ko.filter.hasOwnProperty(i)&&(!(r=Ki[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?ou.error(t):_i(t,a).slice(0)},Zo=ou.compile=function(t,e){var n,r=[],o=[],i=Ei[t+" "];if(!i){for(e||(e=Qo(t)),n=e.length;n--;)(i=pu(e[n]))[Ci]?r.push(i):o.push(i);(i=Ei(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=ei,v=o||r&&Ko.find.TAG("*",c),b=ki+=null==p?1:Math.random()||.1,y=v.length;for(c&&(ei=i!==ii&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(ki=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Di.call(a));h=gu(h)}Pi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&ou.uniqueSort(a)}return c&&(ki=b,ei=p),g};return n?uu(o):o}(o,r))).selector=t}return i},ti=ou.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Qo(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&Xo.getById&&9===e.nodeType&&ai&&Ko.relative[i[1].type]){if(!(e=(Ko.find.ID(u.matches[0].replace(nu,ru),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=Ki.needsContext.test(t)?0:i.length;o--&&(u=i[o],!Ko.relative[a=u.type]);)if((c=Ko.find[a])&&(r=c(u.matches[0].replace(nu,ru),tu.test(i[0].type)&&su(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&fu(i)))return Pi.apply(n,r),n;break}}return(s||Zo(t,l))(r,e,!ai,n,tu.test(t)&&su(e.parentNode)||e),n},Xo.sortStable=Ci.split("").sort(Ai).join("")===Ci,Xo.detectDuplicates=!!ri,oi(),Xo.sortDetached=!0;var vu=document,bu=Array.prototype.push,yu=Array.prototype.slice,wu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,xu=xi.Event,Cu=xe.makeMap("children,contents,next,prev"),Su=function(t){return void 0!==t},ku=function(t){return"string"==typeof t},Ou=function(t,e){var n,r=(e=e||vu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Tu=function(t,e,n,r){var o;if(ku(e))e=Ou(e,Fu(t[0]));else if(e.length&&!e.nodeType){if(e=Wu.makeArray(e),r)for(o=e.length-1;o>=0;o--)Tu(t,e[o],n,r);else for(o=0;o<e.length;o++)Tu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},_u=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Eu=function(t,e,n){var r,o;return e=Wu(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Au=xe.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Nu=xe.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ru={for:"htmlFor",class:"className",readonly:"readOnly"},Mu={float:"cssFloat"},zu={},Du={},Bu=function(t,e){return new Wu.fn.init(t,e)},Pu=/^\s*|\s*$/g,Iu=function(t){return null==t?"":(""+t).replace(Pu,"")},Lu=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Hu=function(t,e){var n=[];return Lu(t,(function(t,r){e(r,t)&&n.push(r)})),n},Fu=function(t){return t?9===t.nodeType?t:t.ownerDocument:vu};Bu.fn=Bu.prototype={constructor:Bu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return Wu(t).attr(e);o.context=e=document}if(ku(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:wu.exec(t)))return Wu(e).find(t);if(n[1])for(r=Ou(t,Fu(e)).firstChild;r;)bu.call(o,r),r=r.nextSibling;else{if(!(r=Fu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return xe.toArray(this)},add:function(t,e){var n,r,o=this;if(ku(t))return o.add(Wu(t));if(!1!==e)for(n=Wu.unique(o.toArray().concat(Wu.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else bu.apply(o,Wu.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)Lu(t,(function(t,e){r.attr(t,e)}));else{if(!Su(e)){if(r[0]&&1===r[0].nodeType){if((n=zu[t])&&n.get)return n.get(r[0],t);if(Nu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=zu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ru[t]||t))Lu(t,(function(t,e){n.prop(t,e)}));else{if(!Su(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)Lu(t,(function(t,e){o.css(t,e)}));else if(Su(e))t=i(t),"number"!=typeof e||Au[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Du[t])&&r.set)r.set(this,e);else{try{this.style[Mu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Du[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],xu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if(Su(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){Wu(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(Su(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Wu(t).append(this),this},prependTo:function(t){return Wu(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Eu(this,t)},wrapAll:function(t){return Eu(this,t,!0)},wrapInner:function(t){return this.each((function(){Wu(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Wu(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Wu(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?Lu(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=_u(r,t);if(o!==e){var i=r.className;o?r.className=Iu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return _u(this[0],t)},each:function(t){return Lu(this,t)},on:function(t,e){return this.each((function(){xu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){xu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?xu.fire(this,t.type,t):xu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Wu(yu.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Wu.find(t,this[e],r);return Wu(r)},filter:function(t){return Wu("function"==typeof t?Hu(this.toArray(),(function(e,n){return t(n,e)})):Wu.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Wu&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Wu(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Wu(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:bu,sort:Array.prototype.sort,splice:Array.prototype.splice},xe.extend(Bu,{extend:xe.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:xe.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:xe.isArray,each:Lu,trim:Iu,grep:Hu,find:ou,expr:ou.selectors,unique:ou.uniqueSort,text:ou.getText,contains:ou.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?Wu.find.matchesSelector(e[0],t)?[e[0]]:[]:Wu.find.matches(t,e)}});var Vu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Wu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Wu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},ju=function(t,e,n,r){var o=[];for(r instanceof Wu&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Wu(t).is(r))break}o.push(t)}return o},Uu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Lu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Vu(t,"parentNode")},next:function(t){return Uu(t,"nextSibling",1)},prev:function(t){return Uu(t,"previousSibling",1)},children:function(t){return ju(t.firstChild,"nextSibling",1)},contents:function(t){return xe.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Bu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Wu.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Cu[t]||(r=Wu.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Wu(r);return n?o.filter(n):o}})),Lu({parentsUntil:function(t,e){return Vu(t,"parentNode",e)},nextUntil:function(t,e){return ju(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return ju(t,"previousSibling",1,e).slice(1)}},(function(t,e){Bu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Wu.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Wu.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Wu(o);return r?i.filter(r):i}})),Bu.fn.is=function(t){return!!t&&this.filter(t).length>0},Bu.fn.init.prototype=Bu.fn,Bu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Wu.extend(n,this),n},Bu.attrHooks=zu,Bu.cssHooks=Du;var Wu=Bu,qu=xe.each,$u=xe.grep,Gu=pe.ie,Xu=/^([a-z0-9],?)+$/i,Ku=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Yu=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function Ju(t,e){var n=this;void 0===e&&(e={});var r={},o=window,i={},u=0,a=Er.forElement(Te(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],l=e.schema?e.schema:Go({}),f=di({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new xi:xi.Event,m=l.getBlockElements(),g=Wu.overrideDefaults((function(){return{context:t,element:W.getRoot()}})),h=function(e){return e&&t&&O(e)?t.getElementById(e):e},p=function(t){return g("string"==typeof t?h(t):t)},v=function(t,e,n){var r,o,i=p(t);return i.length&&(o=(r=q[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=h(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=p(t),i=o.attr(n);if(o.length){var u=q[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return function(t,e,n){var r,o,i=0,u=0,a=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Kn(Te(t),"position"))return{x:i=(o=e.getBoundingClientRect()).left+(a.documentElement.scrollLeft||t.scrollLeft)-a.documentElement.clientLeft,y:u=o.top+(a.documentElement.scrollTop||t.scrollTop)-a.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!er(r,n);)i+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!er(r,n);)i-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=function(t){return Zn.isFirefox()&&"table"===Me(t)?tr(Ge(t)).filter((function(t){return"caption"===Me(t)})).bind((function(t){return tr($e(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Te(e))}return{x:i,y:u}}(t.body,h(e),n)},C=function(t,e,n){var r=p(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=pe.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},S=function(t){var e,n;return t=h(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Xu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return ou(e,i[0].ownerDocument||i[0],null,i).length>0},T=function(t,e,n,r){var o,i=[],u=h(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),xe.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return k(t,o)});u&&!(u===n||R(u.nodeType)||Dn(u)||Bn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},E=function(t,e,r){var o,i="string"==typeof t?h(t):t;if(!i)return!1;if(xe.isArray(i)&&(i.length||0===i.length))return o=[],qu(i,(function(t,n){t&&o.push(e.call(r,"string"==typeof t?h(t):t,n))})),o;var u=r||n;return e.call(u,i)},A=function(t,e){p(t).each((function(t,n){qu(e,(function(t,e){y(n,e,t)}))}))},N=function(t,e){var n=p(t);Gu?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Wu("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},M=function(e,n,r,o,i){return E(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&N(u,o)),i?u:e.appendChild(u)}))},z=function(e,n,r){return M(t.createElement(e),e,n,r,!0)},D=Io.encodeAllRaw,B=function(t,e){var n=p(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){p(t).toggleClass(e,n).each((function(){""===this.className&&Wu(this).attr("class",null)}))},I=function(t,e,n){return E(e,(function(e){return xe.is(e,"array")&&(t=t.cloneNode(!0)),n&&qu($u(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(kn(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,r,i,u){if(xe.isArray(n)){for(var a=n.length,c=[];a--;)c[a]=F(n[a],r,i,u);return c}return!e.collect||n!==t&&n!==o||s.push([n,r,i,u]),d.bind(n,r,i,u||W)},V=function(e,n,r){if(xe.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,r);return u}if(s.length>0&&(e===t||e===o))for(i=s.length;i--;){var a=s[i];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||d.unbind(a[0],a[1],a[2])}return d.unbind(e,n,r)},U=function(t){if(t&&kn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},W={doc:t,settings:e,win:o,files:i,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:s,styles:f,schema:l,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:g,$$:p,root:null,clone:function(e,n){if(!Gu||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return qu(b(e),(function(t){y(r,t.nodeName,v(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=xn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=h(t);var e=x(t),n=S(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:S,getParent:function(t,e,n){var r=T(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:T,get:h,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return ou(n,h(r)||e.root_element||t,[])},is:k,add:M,create:z,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+D(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=O(n)?p(t).css(n,r):p(t).css(n);e.update_styles&&Ku(f,o)},getStyle:C,setStyles:function(t,n){var r=p(t).css(n);e.update_styles&&Ku(f,r)},removeAllAttribs:function(t){return E(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(t){return f.parse(t)},serializeStyle:function(t,e){return f.serialize(t,e)},addStyle:function(e){var n,o;if(W!==Ju.DOM&&t===document){if(r[e])return;r[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(n=t.getElementsByTagName("head")[0]).firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),j(t.split(","),(function(t){i[t]=!0,a.load(t,c)}))},addClass:function(t,e){p(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return p(t).hasClass(e)},toggleClass:P,show:function(t){p(t).show()},hide:function(t){p(t).hide()},isHidden:function(t){return"none"===p(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?h(t):t;return kn(e)?e.outerHTML:Wu("<div></div>").append(Wu(e).clone()).html()},setOuterHTML:function(t,e){p(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Wu(this).html(e),!0)}))},decode:Io.decode,encode:D,insertAfter:function(t,e){var n=h(e);return E(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=z(e),qu(b(t),(function(e){y(n,e.nodeName,v(t,e.nodeName))})),I(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return f.toHex(xe.trim(t))},run:E,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Ar(t,t.parentNode),u=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,kn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!ho(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&ho(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:Yu,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,Yu(t)),u.setEnd(e.parentNode,Yu(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,Yu(e)+1),u.setEnd(t.parentNode,Yu(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(So(W,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(So(W,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:U,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=U(t));t=t.parentNode);return n},destroy:function(){if(s.length>0)for(var t=s.length;t--;){var e=s[t];d.unbind(e[0],e[1],e[2])}it(i,(function(t,e){a.unload(e),delete i[e]})),ou.setDocument&&ou.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},q=function(t,e,n){var r=e.keep_values,o={set:function(t,n,r){e.url_converter&&(n=e.url_converter.call(e.url_converter_scope||W,n,r,t[0])),t.attr("data-mce-"+r,n).attr(r,n)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(f,e);return W}!function(t){t.DOM=t(document),t.nodeIndex=Yu}(Ju||(Ju={}));var Qu=Ju,Zu=Qu.DOM,ta=xe.each,ea=xe.grep,na=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=Zu,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=xe._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),z(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ta(o.scriptLoadedCallbacks[e],(function(e){z(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=ea(t);if(t.length=0,ta(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ta(n,(function(t){0===i.length?z(t.success)&&t.success.call(t.scope):z(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),ra=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},oa={},ia=ra("en"),ua=function(){return dt(oa,ia.get())},aa={getData:function(){return ut(oa,(function(t){return St({},t)}))},setCode:function(t){t&&ia.set(t)},getCode:function(){return ia.get()},add:function(t,e){var n=oa[t];n||(oa[t]=n={}),it(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=ua().getOr({}),r=function(t){return z(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return dt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(T(e=t)&&mt(e,"raw"))return r(t.raw);if(function(t){return _(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return mt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return ua().bind((function(t){return dt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return mt(oa,t)}};function ca(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=W(o,(function(n){return n.name===t&&n.state===e}));j(n,(function(t){return t.callback()}))},u=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},c=function(t,e,o,s,l){if(!n[t]){var f="string"==typeof e?e:e.prefix+e.resource+e.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ca.baseURL+"/"+f),n[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){i(t,"loaded"),function(t,e,n,r){var o=u(t);j(o,(function(t){var n=a(e,t);c(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(na))}(t,e,o,s)};r[t]?d():na.ScriptLoader.add(f,d,s,l)}},s=function(t,e,i){void 0===i&&(i="added"),mt(r,t)&&"added"===i||mt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){if(r[t])return r[t].instance},dependencies:u,requireLangPack:function(t,e){!1!==ca.languageLoad&&s(t,(function(){var r=aa.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||na.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},add:function(t,n,o){var u=n;return e.push(u),r[t]={instance:u,dependencies:o},i(t,"added"),u},remove:function(t){delete n[t],delete r[t]},createUrl:a,addComponents:function(e,n){var r=t.urls[e];j(n,(function(t){na.ScriptLoader.add(r+"/"+t)}))},load:c,waitFor:s}}!function(t){t.PluginManager=t(),t.ThemeManager=t()}(ca||(ca={}));var sa=ca,la=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null===n&&(n=setTimeout((function(){t.apply(null,r),n=null}),e))}}},fa=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},da=function(t,e){var n=$n(t,e);return void 0===n||""===n?[]:n.split(" ")},ma=function(t){return void 0!==t.dom.classList},ga=function(t,e){ma(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=da(t,e).concat([n]);Wn(t,e,r.join(" "))})(t,"class",e)}(t,e)},ha=function(t,e){return ma(t)&&t.dom.classList.contains(e)},pa=function(t,e){var n=[];return j(Ge(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(pa(t,e))})),n},va=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?[]:V(n.querySelectorAll(t),Te)}(e,t)},ba=l("mce-annotation"),ya=l("data-mce-annotation"),wa=l("data-mce-annotation-uid"),xa=function(t,e){var n=t.selection.getRng(),r=Te(n.startContainer),o=Te(t.getBody()),i=e.fold((function(){return"."+ba()}),(function(t){return"["+ya()+'="'+t+'"]'})),u=Xe(r,n.startOffset).getOr(r),a=xr(u,i,(function(t){return Ne(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?x.some($n(t,e)):x.none()};return a.bind((function(e){return c(e,""+wa()).bind((function(n){return c(e,""+ya()).map((function(e){var r=Ca(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ca=function(t,e){var n=Te(t.getBody());return va(n,"["+wa()+'="'+e+'"]')},Sa=0,ka=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Sa+String(e)},Oa=function(t,e){var n,r,o=He(t).dom,i=Te(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ge(Te(r)));cn(i,u),sn(t),an(t,i)},Ta=function(t,e){return Te(t.dom.cloneNode(e))},_a=function(t){return Ta(t,!1)},Ea=function(t){return Ta(t,!0)},Aa=function(t,e,n){void 0===n&&(n=p);var r=new Ar(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Mn(e)&&!n(e));return x.from(e).filter(Mn)};return{current:function(){return x.from(r.current()).filter(Mn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Na=function(t,e){var n=e||function(e){return t.isBlock(e)||Pn(e)||Hn(e)},r=function(t,e,n,o){if(Mn(t)){var i=o(t,e,t.data);if(-1!==i)return x.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Ra=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},Ma=Math.round,za=function(t){return t?{left:Ma(t.left),top:Ma(t.top),bottom:Ma(t.bottom),right:Ma(t.right),width:Ma(t.width),height:Ma(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Da=function(t,e){return t=za(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Ba=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Pa=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Ba(e.top-t.bottom,t,e)},Ia=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Ba(e.bottom-t.top,t,e)},La=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ha=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Fa=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},Va=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),ja=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Va.test(t)},Ua=kn,Wa=lo,qa=Tn("display","block table"),$a=Tn("float","left right"),Ga=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Ua,Wa,m($a)),Xa=m(Tn("white-space","pre pre-line pre-wrap")),Ka=Mn,Ya=Pn,Ja=Qu.nodeIndex,Qa=Fa,Za=function(t){return"createRange"in t?t.createRange():Qu.DOM.createRng()},tc=function(t){return t&&/[\r\n\t ]/.test(t)},ec=function(t){return!!t.setStart&&!!t.setEnd},nc=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(tc(t.toString())&&Xa(n.parentNode)&&Mn(n)&&(e=n.data,tc(e[r-1])||tc(e[r+1])))},rc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},oc=function(t){var e,n=t.getClientRects();return e=n.length>0?za(n[0]):za(t.getBoundingClientRect()),!ec(t)&&Ya(t)&&rc(e)?function(t){var e=t.ownerDocument,n=Za(e),r=e.createTextNode(Vr),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=za(n.getBoundingClientRect());return o.removeChild(r),i}(t):rc(e)&&ec(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Mn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),oc(i)}return null}(t):e},ic=function(t,e){var n=Da(t,e);return n.width=1,n.right=n.left+1,n};function uc(t,e,n){var r=function(){return n||(n=function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(r.length>0&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=Za(t.ownerDocument);if(e<t.data.length){if(ja(t.data[e]))return r;if(ja(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!nc(n)))return o(ic(oc(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),nc(n)||o(ic(oc(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),nc(n)||o(ic(oc(n),!0)))};if(Ka(t.container()))return i(t.container(),t.offset()),r;if(Ua(t.container()))if(t.isAtEnd())n=Qa(t.container(),t.offset()),Ka(n)&&i(n,n.data.length),Ga(n)&&!Ya(n)&&o(ic(oc(n),!1));else{if(n=Qa(t.container(),t.offset()),Ka(n)&&i(n,0),Ga(n)&&t.isAtEnd())return o(ic(oc(n),!1)),r;e=Qa(t.container(),t.offset()-1),Ga(e)&&!Ya(e)&&(qa(e)||qa(n)||!Ga(n))&&o(ic(oc(e),!1)),Ga(n)&&o(ic(oc(n),!0))}return r}(uc(t,e))),n};return{container:l(t),offset:l(e),toRange:function(){var n=Za(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Ka(t),0===e},isAtEnd:function(){return Ka(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return Qa(t,n?e-1:e)}}}!function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,Ja(e)+1)},t.before=function(e){return t(e.parentNode,Ja(e))},t.isAbove=function(t,e){return Ra(tt(e.getClientRects()),et(t.getClientRects()),Pa).getOr(!1)},t.isBelow=function(t,e){return Ra(et(e.getClientRects()),tt(t.getClientRects()),Ia).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&Mn(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}}(uc||(uc={}));var ac,cc=uc,sc=function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)},lc=function(t,e,n){Bn(n)?function(t,e,n){var r=x.from(n.firstChild),o=x.from(n.lastChild);e.insertNode(n),r.each((function(e){return sc(t,e.previousSibling)})),o.each((function(e){return sc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),sc(t,n.previousSibling),sc(t,n.nextSibling)}(t,e,n)},fc=Mn,dc=En,mc=Qu.nodeIndex,gc=function(t){var e=t.parentNode;return dc(e)?gc(e):e},hc=function(t){return t?wt(t.childNodes,(function(t,e){return dc(e)&&"BR"!==e.nodeName?t=t.concat(hc(e)):t.push(e),t}),[]):[]},pc=function(t){return function(e){return t===e}},vc=function(t){return(fc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=hc(gc(t)),n=xt(e,pc(t),t),e=e.slice(0,n+1);var r=wt(e,(function(t,n,r){return fc(n)&&fc(e[r-1])&&t++,t}),0);return e=bt(e,On([t.nodeName])),(n=xt(e,pc(t),t))-r}(t)+"]"},bc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),fc(n)?o=function(t,e){for(;(t=t.previousSibling)&&fc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(vc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode)r.push(e);return r}(t,n),u=bt(u,m(En)),(a=a.concat(vt(u,(function(t){return vc(t)})))).reverse().join("/")+","+o},yc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=wt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=hc(t);return r=bt(r,(function(t,e){return!fc(t)||!fc(r[e-1])})),(r=bt(r,On([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?fc(i)?function(t,e){for(var n,r=t,o=0;fc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!fc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return fc(t)&&e>t.data.length&&(e=t.data.length),cc(t,e)}(i,parseInt(n,10)):(n="after"===n?mc(i)+1:mc(i),cc(i.parentNode,n)):null},wc=Hn,xc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Mn(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Mn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Cc=function(t,e,n){var r=0;return xe.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Sc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],kn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},kc=function(t){return Sc(t,!0),Sc(t,!1),t},Oc=function(t,e){var n;if(kn(t)&&(t=Fa(t,e),wc(t)))return t;if(Kr(t)){if(Mn(t)&&Gr(t)&&(t=t.parentNode),n=t.previousSibling,wc(n))return n;if(n=t.nextSibling,wc(n))return n}},Tc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(wc(r)||"IMG"===o)return{name:o,index:Cc(n.dom,o,r)};var u=function(t){return Oc(t.startContainer,t.startOffset)||Oc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Cc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=xc(o,t,n,r,!0),e.isCollapsed()||(i.end=xc(o,t,n,r,!1)),i}(t,n,e,i)},_c=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},Ec=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Cc(n,a,u)};var c=kc(r.cloneRange());if(!i){c.collapse(!1);var s=_c(n,o+"_end",e);lc(n,c,s)}(r=kc(r)).collapse(!0);var l=_c(n,o+"_start",e);return lc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Ac=d(Tc,f,!0),Nc=Qu.DOM,Rc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},Mc=function(t){return t.getParam("content_security_policy","")},zc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Dc=function(t){return t.getParam("forced_root_block_attrs",{})},Bc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Pc=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Ic=function(t){return t.getParam("icons","","string")},Lc=function(t){return t.getParam("images_upload_url","","string")},Hc=function(t){return t.getParam("images_upload_base_path","","string")},Fc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Vc=function(t){return t.getParam("images_upload_handler",null,"function")},jc=function(t){return t.getParam("content_css_cors",!1,"boolean")},Uc=function(t){return t.getParam("referrer_policy","","string")},Wc=function(t){return t.getParam("language","en","string")},qc=function(t){return t.getParam("indent_use_margin",!1)},$c=function(t){var e=t.getParam("object_resizing");return!1!==e&&!pe.iOS&&(O(e)?e:"table,img,figure.image,div")},Gc=function(t){return t.getParam("event_root")},Xc=function(t){return t.getParam("theme")},Kc=function(t){return t.getParam("validate")},Yc=function(t){return!1!==t.getParam("inline_boundaries")},Jc=function(t){return t.getParam("content_css_cors")},Qc=function(t){return t.getParam("plugins","","string")},Zc=kn,ts=Mn,es=function(t){var e=t.parentNode;e&&e.removeChild(t)},ns=function(t){var e=Wr(t);return{count:t.length-e.length,text:e}},rs=function(t){for(var e;-1!==(e=t.data.lastIndexOf(jr));)t.deleteData(e,1)},os=function(t,e){return us(t),e},is=function(t,e){return cc.isTextPosition(e)?function(t,e){return ts(t)&&e.container()===t?function(t,e){var n=ns(t.data.substr(0,e.offset())),r=ns(t.data.substr(e.offset()));return(n.text+r.text).length>0?(rs(t),cc(t,e.offset()-n.count)):e}(t,e):os(t,e)}(t,e):function(t,e){return e.container()===t.parentNode?function(t,e){var n=e.container(),r=function(t,e){var n=L(t,e);return-1===n?x.none():x.some(n)}(nt(n.childNodes),t).map((function(t){return t<e.offset()?cc(n,e.offset()-1):e})).getOr(e);return us(t),r}(t,e):os(t,e)}(t,e)},us=function(t){Zc(t)&&Kr(t)&&(Yr(t)?t.removeAttribute("data-mce-caret"):es(t)),ts(t)&&(rs(t),0===t.data.length&&es(t))},as=ae().browser,cs=Hn,ss=Vn,ls=Fn,fs=function(t,e,n){var r,o,i,u,a,c=Da(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(a=t.getBoundingClientRect(),o=t.scrollLeft-a.left,i=t.scrollTop-a.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,(u=e.offsetWidth-e.clientWidth)>0&&(n&&(u*=-1),c.left+=u,c.right+=u),c},ds=function(t,e,n,r){var o,i,u=ra(x.none()),a=zc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=va(Te(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;to(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Zr(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(us(i),i=null),u.get().each((function(t){Wu(t.caret).remove(),u.set(x.none())})),o&&(Tr.clearInterval(o),o=null)};return{show:function(t,a){var l,f;if(s(),ls(a))return null;if(!n(a))return i=function(t,e){var n,r=t.ownerDocument.createTextNode(jr),o=t.parentNode;if(e){if(n=t.previousSibling,$r(n)){if(Kr(n))return n;if(to(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,$r(n)){if(Kr(n))return n;if(Zr(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(a,t),f=a.ownerDocument.createRange(),gs(i.nextSibling)?(f.setStart(i,0),f.setEnd(i,0)):(f.setStart(i,1),f.setEnd(i,1)),f;i=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o}(c,a,t),l=fs(e,a,t),Wu(i).css("top",l.top);var d=Wu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(e)[0];return u.set(x.some({caret:d,element:a,before:t})),u.get().each((function(e){t&&Wu(e.caret).addClass("mce-visual-caret-before")})),o=Tr.setInterval((function(){r()?Wu("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Wu("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500),(f=a.ownerDocument.createRange()).setStart(i,0),f.setEnd(i,0),f},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.get().each((function(t){var n=fs(e,t.element,t.before);Wu(t.caret).css(St({},n))}))},destroy:function(){return Tr.clearInterval(o)}}},ms=function(){return as.isIE()||as.isEdge()||as.isFirefox()},gs=function(t){return cs(t)||ss(t)},hs=function(t){return gs(t)||An(t)&&ms()},ps=Hn,vs=Vn,bs=Tn("display","block table table-cell table-caption list-item"),ys=Kr,ws=Gr,xs=kn,Cs=lo,Ss=function(t){return t>0},ks=function(t){return t<0},Os=function(t,e){for(var n;n=t(e);)if(!ws(n))return n;return null},Ts=function(t,e,n,r,o){var i=new Ar(t,r),u=ps(t)||ws(t);if(ks(e)){if(u&&n(t=Os(i.prev,!0)))return t;for(;t=Os(i.prev,o);)if(n(t))return t}if(Ss(e)){if(u&&n(t=Os(i.next,!0)))return t;for(;t=Os(i.next,o);)if(n(t))return t}return null},_s=function(t,e){for(;t&&t!==e;){if(bs(t))return t;t=t.parentNode}return null},Es=function(t,e,n){return _s(t.container(),n)===_s(e.container(),n)},As=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return xs(n)?n.childNodes[r+t]:null},Ns=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Rs=function(t,e,n){return _s(e,t)===_s(n,t)},Ms=function(t,e,n){var r,o;for(o=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[o],ys(r)&&(r=r[o]),ps(r)||vs(r)){if(Rs(e,r,n))return r;break}if(Cs(r))break;n=n.parentNode}return null},zs=d(Ns,!0),Ds=d(Ns,!1),Bs=function(t,e,n){var r,o,i,u=d(Ms,!0,e),a=d(Ms,!1,e);o=n.startContainer;var c=n.startOffset;if(Gr(o)){if(xs(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,hs(r)))return zs(r);if("after"===i&&(r=o.previousSibling,hs(r)))return Ds(r)}if(!n.collapsed)return n;if(Mn(o)){if(ys(o)){if(1===t){if(r=a(o))return zs(r);if(r=u(o))return Ds(r)}if(-1===t){if(r=u(o))return Ds(r);if(r=a(o))return zs(r)}return n}if(to(o)&&c>=o.data.length-1)return 1===t&&(r=a(o))?zs(r):n;if(Zr(o)&&c<=1)return-1===t&&(r=u(o))?Ds(r):n;if(c===o.data.length)return(r=a(o))?zs(r):n;if(0===c)return(r=u(o))?Ds(r):n}return n},Ps=function(t,e){return x.from(As(t?0:-1,e)).filter(ps)},Is=function(t,e,n){var r=Bs(t,e,n);return-1===t?uc.fromRangeStart(r):uc.fromRangeEnd(r)},Ls=function(t){return x.from(t.getNode()).map(Te)},Hs=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Fs=function(t,e){var n=Es(t,e);return!(n||!Pn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(ac||(ac={}));var Vs=Hn,js=Mn,Us=kn,Ws=Pn,qs=lo,$s=function(t){return ao(t)||function(t){return!!fo(t)&&!0!==$(nt(t.getElementsByTagName("*")),(function(t,e){return t||no(e)}),!1)}(t)},Gs=mo,Xs=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Ks=function(t,e){if(Ss(t)){if(qs(e.previousSibling)&&!js(e.previousSibling))return cc.before(e);if(js(e))return cc(e,0)}if(ks(t)){if(qs(e.nextSibling)&&!js(e.nextSibling))return cc.after(e);if(js(e))return cc(e,e.data.length)}return ks(t)?Ws(e)?cc.before(e):cc.after(e):cc.before(e)},Ys=function(t,e,n){var r,o,i,u;if(!Us(n)||!e)return null;if(e.isEqual(cc.after(n))&&n.lastChild){if(u=cc.after(n.lastChild),ks(t)&&qs(n.lastChild)&&Us(n.lastChild))return Ws(n.lastChild)?cc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(js(a)){if(ks(t)&&c>0)return cc(a,--c);if(Ss(t)&&c<a.length)return cc(a,++c);r=a}else{if(ks(t)&&c>0&&(o=Xs(a,c-1),qs(o)))return!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,i.data.length):cc.after(i):js(o)?cc(o,o.data.length):cc.before(o);if(Ss(t)&&c<a.childNodes.length&&(o=Xs(a,c),qs(o)))return Ws(o)?function(t,e){var n=e.nextSibling;return n&&qs(n)?js(n)?cc(n,0):cc.before(n):Ys(ac.Forwards,cc.after(e),t)}(n,o):!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,0):cc.before(i):js(o)?cc(o,0):cc.after(o);r=o||u.getNode()}if((Ss(t)&&u.isAtEnd()||ks(t)&&u.isAtStart())&&(r=Ts(r,t,v,n,!0),Gs(r,n)))return Ks(t,r);o=Ts(r,t,Gs,n);var s=Ct(W(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),Vs));return!s||o&&s.contains(o)?o?Ks(t,o):null:u=Ss(t)?cc.after(s):cc.before(s)},Js=function(t){return{next:function(e){return Ys(ac.Forwards,e,t)},prev:function(e){return Ys(ac.Backwards,e,t)}}},Qs=function(t){return cc.isTextPosition(t)?0===t.offset():lo(t.getNode())},Zs=function(t){if(cc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return lo(t.getNode(!0))},tl=function(t,e){return!cc.isTextPosition(t)&&!cc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},el=function(t,e,n){var r=Js(e);return x.from(t?r.next(n):r.prev(n))},nl=function(t,e,n){return el(t,e,n).bind((function(r){return Es(n,r,e)&&function(t,e,n){return t?!tl(e,n)&&(r=e,!(!cc.isTextPosition(r)&&Pn(r.getNode())))&&Zs(e)&&Qs(n):!tl(n,e)&&Qs(e)&&Zs(n);var r}(t,n,r)?el(t,e,r):x.some(r)}))},rl=function(t,e,n,r){return nl(t,e,n).bind((function(n){return r(n)?rl(t,e,n,r):x.some(n)}))},ol=function(t,e){var n,r=t?e.firstChild:e.lastChild;return Mn(r)?x.some(cc(r,t?0:r.data.length)):r?lo(r)?x.some(t?cc.before(r):Pn(n=r)?cc.before(n):cc.after(n)):function(t,e,n){var r=t?cc.before(n):cc.after(n);return el(t,e,r)}(t,e,r):x.none()},il=d(el,!0),ul=d(el,!1),al=d(ol,!0),cl=d(ol,!1),sl="_mce_caret",ll=function(t){return kn(t)&&t.id===sl},fl=function(t,e){for(;e&&e!==t;){if(e.id===sl)return e;e=e.parentNode}return null},dl=function(t,e){return kn(e)&&t.isBlock(e)&&!e.innerHTML&&!pe.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},ml=function(t,e){return cl(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},gl=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!fl(t,e)||(function(t,e){var n=t.ownerDocument.createTextNode(jr);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),0))},hl=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,gl(s,i,r))return!0;if(c[o]>a.length-1)return!!gl(s,i,r)||ml(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},pl=function(t){return Mn(t)&&t.data.length>0},vl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.nextSibling)?(r=s.nextSibling,o=0):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,xe.each(xe.grep(s.childNodes),(function(t){Mn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&Mn(u)&&!pe.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return x.some(cc(a,c))}return x.none()},bl=function(t,e,n){return function(t,e,n){return 2===e?Tc(Wr,n,t):3===e?function(t){var e=t.getRng();return{start:bc(t.dom.getRoot(),cc.fromRangeStart(e)),end:bc(t.dom.getRoot(),cc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Ec(t,!1)}(t,e,n)},yl=function(t,e){(function(t,e){var n=t.dom;if(e){if(function(t){return xe.isArray(t.start)}(e))return function(t,e){var n=t.createRng();return hl(t,!0,e,n)&&hl(t,!1,e,n)?x.some(n):x.none()}(n,e);if(function(t){return"string"==typeof t.start}(e))return x.some(function(t,e){var n,r=t.createRng();return n=yc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=yc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return t.hasOwnProperty("id")}(e))return function(t,e){var n=vl(t,"start",e),r=vl(t,"end",e);return Ra(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(dl(t,e.container()),e.offset()),r.setEnd(dl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return t.hasOwnProperty("name")}(e))return function(t,e){return x.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return t.hasOwnProperty("rng")}(e))return x.some(e.rng)}return x.none()})(t,e).each((function(e){t.setRng(e)}))},wl=function(t){return kn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},xl=(Vr,function(t){return" "===t}),Cl=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Sl=function(t){return!Cl(t)&&!xl(t)},kl=function(t){return!!t.nodeType},Ol=function(t,e,n){var r,o,i,u=n.startOffset,a=n.startContainer;if((n.startContainer!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===a.nodeType)for(u<(i=a.childNodes).length?(a=i[u],r=new Ar(a,t.getParent(a,t.isBlock))):(a=i[i.length-1],(r=new Ar(a,t.getParent(a,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Al(o))return n.setStart(o,0),void e.setRng(n)},Tl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Al(t))return t}},_l=function(t,e){return kl(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},El=function(t,e,n){return t.schema.isValidChild(e,n)},Al=function(t,e){if(void 0===e&&(e=!1),M(t)&&Mn(t)){var n=e?t.data.replace(/ /g," "):t.data;return ho(n)}return!1},Nl=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Rl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Ml=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},zl=function(t,e,n){return Ml(t,t.getStyle(e,n),n)},Dl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Bl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Pl=function(t){return gt(t,"block")},Il=function(t){return gt(t,"selector")},Ll=function(t){return gt(t,"inline")},Hl=wl,Fl=Bl,Vl=Al,jl=_l,Ul=function(t,e){for(var n=e;n;){if(kn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Wl=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},ql=function(t,e,n){return Wl(t,e,n,(function(t){return xl(t)||Cl(t)}))},$l=function(t,e,n){return Wl(t,e,n,Sl)},Gl=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Na(t),c=o?i.backwards:i.forwards;return x.from(c(e,n,(function(t,e){return Hl(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,ql).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),$l):x.some(t)})).orThunk((function(){return u?x.some({container:u,offset:o?0:u.length}):x.none()}))},Xl=function(t,e,n,r,o){Mn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Fl(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!("collapsed"in c)||c.collapsed===n.collapsed)&&t.is(i[u],c.selector))return i[u]}return r},Kl=function(t,e,n,r){var o,i=t.dom,u=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,u)),!o){var a=i.getParent(n,"LI,TD,TH");o=i.getParent(Mn(n)?n.parentNode:n,(function(e){return e!==u&&jl(t,e)}),a)}if(o&&e[0].wrapper&&(o=Fl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Rl(o,"br")););return o||n},Yl=function(t,e,n,r){var o=n.parentNode;return!M(n[r])&&(!(o!==e&&!R(o)&&!t.isBlock(o))||Yl(t,e,o,r))},Jl=function(t,e,n,r,o){var i,u,a=n,c=o?"previousSibling":"nextSibling",s=t.getRoot();if(Mn(n)&&!Vl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(i=a[c];i;i=i[c]){var l=Mn(i)&&!Yl(t,s,i,c);if(!Hl(i)&&(!Pn(u=i)||!u.getAttribute("data-mce-bogus")||u.nextSibling)&&!Vl(i,l))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n},Ql=function(t){return Hl(t.parentNode)||Hl(t)},Zl=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom;return kn(o)&&o.hasChildNodes()&&(o=Fa(o,i),Mn(o)&&(i=0)),kn(u)&&u.hasChildNodes()&&(u=Fa(u,e.collapsed?a:a-1),Mn(u)&&(a=u.nodeValue.length)),o=Ul(c,o),u=Ul(c,u),Ql(o)&&(o=Hl(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Mn(o)&&(i=e.collapsed?o.length:0)),Ql(u)&&(u=Hl(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,Mn(u)&&(a=e.collapsed?0:u.length)),e.collapsed&&(Gl(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Gl(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n}))),(n[0].inline||n[0].block_expand)&&(n[0].inline&&Mn(o)&&0!==i||(o=Jl(c,n,o,i,!0)),n[0].inline&&Mn(u)&&a!==u.nodeValue.length||(u=Jl(c,n,u,a,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=Xl(c,n,e,o,"previousSibling"),u=Xl(c,n,e,u,"nextSibling")),(n[0].block||n[0].selector)&&(o=Kl(t,n,o,"previousSibling"),u=Kl(t,n,u,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=Jl(c,n,o,i,!0)),c.isBlock(u)||(u=Jl(c,n,u,a,!1)))),kn(o)&&(i=c.nodeIndex(o),o=o.parentNode),kn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},tf=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},ef=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,u=e.endOffset,a=function(t){var e;return 3===(e=t[0]).nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===u&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=tf(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=tf(i,u-1)),r===i)return n(a([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=s(r,f)||r,g=s(i,f)||i;l(r,m,!0);var h=c(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);h.length&&n(a(h)),l(i,g)},nf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},rf=function(t,e){var n=va(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:function(t){return W(function(t){return K(t,(function(t){var e=Ha(t);return e?[Te(e)]:[]}))}(t),Hr)}(t)},of=function(t){return rf(nf(t.selection.getSel()),Te(t.getBody()))},uf=function(t){return Ke(t).fold(l([t]),(function(e){return[t].concat(uf(e))}))},af=function(t){return Ye(t).fold(l([t]),(function(e){return"br"===Me(e)?Ue(e).map((function(e){return[t].concat(af(e))})).getOr([]):[t].concat(af(e))}))},cf=function(t,e){return Ra(function(t){var e=t.startContainer,n=t.startOffset;return Mn(e)?0===n?x.some(Te(e)):x.none():x.from(e.childNodes[n]).map(Te)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Mn(e)?n===e.data.length?x.some(Te(e)):x.none():x.from(e.childNodes[n-1]).map(Te)}(e),(function(e,n){var r=G(uf(t),d(Ne,e)),o=G(af(t),d(Ne,n));return r.isSome()&&o.isSome()})).getOr(!1)},sf=function(t,e,n,r){var o=n,i=new Ar(n,o),u=ft(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!H(["td","th","table"],e.toLowerCase())}));do{if(Mn(n)&&0!==xe.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},lf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},ff=function(t,e){var n=of(t);n.length>0?j(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},df=function(t,e,n){var r=Ec(t,e);n(r),t.moveToBookmark(r)},mf=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(Pe),gf=function(t){return mf.get(t)},hf=function(t,e,n,r){var o=e.uid,i=void 0===o?ka("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=ke("span",t);ga(a,ba()),Wn(a,""+wa(),i),Wn(a,""+ya(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return qn(a,l),function(t,e){j(e,(function(e){ga(t,e)}))}(a,d),a},pf=function(t,e,n,r,o){var i=[],u=hf(t.getDoc(),o,n,r),a=ra(x.none()),c=function(){a.set(x.none())},s=function(t){j(t,l)},l=function(e){switch(function(t,e,n,r){return je(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Pe(t)&&gf(t)===jr}(e)?"valid":function(t){return Be(t)&&ha(t,ba())}(e)?"existing":ll(e.dom)?"caret":El(t,n,r)&&El(t,Me(o),n)?"valid":"invalid-child"}))}(t,e,"span",Me(e))){case"invalid-child":c();var n=Ge(e);s(n),c();break;case"valid":!function(t,e){rn(t,e),an(e,t)}(e,a.get().getOrThunk((function(){var t=_a(u);return i.push(t),a.set(x.some(t)),t})))}};return ef(t.dom,e,(function(t){c(),function(t){var e=V(t,Te);s(e)}(t)})),i},vf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?x.from(e[t]).map((function(t){return t.settings})):x.none()}});!function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){j(t,(function(t){(function(t){return x.from(t.attr(ya())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))}(t,n);var r=function(t,e){var n=ra({}),r=function(t,e){o(t,(function(t){return e(t),t}))},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:ra(x.none())});r[t]=o,n.set(r)},i=fa((function(){var e,i,u=n.get(),a=(e=rt(u),(i=B.call(e,0)).sort(void 0),i);j(a,(function(e){o(e,(function(n){var o=n.previous.get();return xa(t,x.some(e)).fold((function(){o.isSome()&&(function(t){r(t,(function(e){j(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.set(x.none()))}),(function(t){var e=t.uid,i=t.name,u=t.elements;o.is(e)||(function(t,e,n){r(t,(function(r){j(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:V(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(x.some(e)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()})),{addListener:function(t,e){o(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}}(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){!function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=of(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=Zl(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=hf(t.getDoc(),r,e,n.decorate);Oa(a,Vr),o.getRng().insertNode(a.dom),o.select(a.dom)}else df(o,!1,(function(){ff(t,(function(o){pf(t,o,e,n.decorate,r)}))}))}))}(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){xa(t,x.some(e)).each((function(t){var e=t.elements;j(e,fn)}))},getAll:function(e){var n=function(t,e){var n=Te(t.getBody()),r=va(n,"["+ya()+'="'+e+'"]'),o={};return j(r,(function(t){var e=$n(t,wa()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])})),o}(t,e);return ut(n,(function(t){return V(t,(function(t){return t.dom}))}))}}};function bf(t){return{getBookmark:d(bl,t),moveToBookmark:d(yl,t)}}!function(t){t.isBookmarkNode=wl}(bf||(bf={}));var yf=bf,wf=function(t,e){for(;e&&e!==t;){if(Ln(e)||Hn(e))return e;e=e.parentNode}return null},xf=function(t,e,n){if(n.collapsed)return!1;if(pe.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(kn(r))return F(r.getClientRects(),(function(n){return La(n,t,e)}))}return F(n.getClientRects(),(function(n){return La(n,t,e)}))},Cf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return pe.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Sf=Hn,kf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p=e.dom,v=xe.each,b=e.getDoc(),y=document,w=Math.abs,x=Math.round,C=e.getBody(),S={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},k=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},O=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return k(t.target)&&!xf(n.clientX,n.clientY,e)}return k(t.target)&&!xf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},T=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},_=function(t){var n=$c(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&Ee(Te(t),n)},E=function(t,e,n){p.setStyles(T(t),{width:e,height:n})},A=function(t){var v,b,y,S;v=t.screenX-u,b=t.screenY-a,d=v*i[2]+c,m=b*i[3]+s,d=d<5?5:d,m=m<5?5:m,(k(n)&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Cf.modifierPressed(t):Cf.modifierPressed(t))&&(w(v)>w(b)?(m=x(d*l),d=x(m/l)):(d=x(m/l),m=x(d*l))),E(r,d,m),y=(y=i.startPos.x+v)>0?y:0,S=(S=i.startPos.y+b)>0?S:0,p.setStyles(o,{left:y,top:S,display:"block"}),o.innerHTML=d+" × "+m,i[2]<0&&r.clientWidth<=d&&p.setStyle(r,"left",void 0+(c-d)),i[3]<0&&r.clientHeight<=m&&p.setStyle(r,"top",void 0+(s-m)),(v=C.scrollWidth-g)+(b=C.scrollHeight-h)!=0&&p.setStyles(o,{left:y-v,top:S-b}),f||(function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,c,s,"corner-"+i.name),f=!0)},N=function(){var t=f;f=!1;var u=function(t,r){r&&(n.style[t]||!e.schema.isValid(n.nodeName.toLowerCase(),t)?p.setStyle(T(n),t,r):p.setAttrib(T(n),t,""+r))};t&&(u("width",d),u("height",m)),p.unbind(b,"mousemove",A),p.unbind(b,"mouseup",N),y!==b&&(p.unbind(y,"mousemove",A),p.unbind(y,"mouseup",N)),p.remove(r),p.remove(o),R(n),t&&(function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,d,m,"corner-"+i.name),p.setAttrib(n,"style",p.getAttrib(n,"style"))),e.nodeChanged()},R=function(t){M(),B();var f=p.getPos(t,C),w=f.x,x=f.y,k=t.getBoundingClientRect(),O=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==t&&(n=t,d=m=0);var z=e.fire("ObjectSelected",{target:t});_(t)&&!z.isDefaultPrevented()?v(S,(function(t,e){var f;(f=p.get("mceResizeHandle"+e))&&p.remove(f),f=p.add(C,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===pe.ie&&(f.contentEditable=!1),p.bind(f,"mousedown",(function(f){f.stopImmediatePropagation(),f.preventDefault(),function(f){u=f.screenX,a=f.screenY,c=T(n).clientWidth,s=T(n).clientHeight,l=s/c,(i=t).name=e,i.startPos={x:O*t[0]+w,y:R*t[1]+x},g=C.scrollWidth,h=C.scrollHeight,r=n.cloneNode(!0),p.addClass(r,"mce-clonedresizable"),p.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,p.setStyles(r,{left:w,top:x,margin:0}),E(r,O,R),r.removeAttribute("data-mce-selected"),C.appendChild(r),p.bind(b,"mousemove",A),p.bind(b,"mouseup",N),y!==b&&(p.bind(y,"mousemove",A),p.bind(y,"mouseup",N)),o=p.add(C,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" × "+s)}(f)})),t.elm=f,p.setStyles(f,{left:O*t[0]+w-f.offsetWidth/2,top:R*t[1]+x-f.offsetHeight/2})})):M(),n.setAttribute("data-mce-selected","1")},M=function(){B(),n&&n.removeAttribute("data-mce-selected"),it(S,(function(t,e){var n=p.get("mceResizeHandle"+e);n&&(p.unbind(n),p.remove(n))}))},z=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};f||e.removed||(v(p.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=p.$(r).closest("table,img,figure.image,hr")[0],C)&&(P(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):M())},D=function(t){return Sf(wf(e.getBody(),t))},B=function(){it(S,(function(t){t.elm&&(p.unbind(t.elm),delete t.elm)}))},P=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};return e.on("init",(function(){if(P(),pe.browser.isIE()||pe.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;f||!/^(TABLE|IMG|HR)$/.test(r)||D(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Tr.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(D(t.target)||Vn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};p.bind(C,"mscontrolselect",t),e.on("remove",(function(){return p.unbind(C,"mscontrolselect",t)}))}var r=Tr.throttle((function(t){e.composing||z(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",M),e.on("contextmenu longpress",O,!0)})),e.on("remove",B),{isResizable:_,showResizeRect:R,hideResizeRect:M,updateResizeRect:z,destroy:function(){n=r=null}}},Of=function(t){return Ln(t)||Hn(t)},Tf=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=xe.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Hn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Of))?null:t}(r,n.body)}return r},_f=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Ef=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Af=function(t,e,n){return Ef(t,e,(function(t){return t.nodeName===n}))},Nf=function(t){return t&&"TABLE"===t.nodeName},Rf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Mf=function(t,e){return Kr(t)&&!1===Ef(t,e,ll)},zf=function(t,e,n){for(var r=new Ar(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Pn(e))return!0},Df=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Pn(o)&&e&&t.isEmpty(s))return x.some(uc(o.parentNode,t.nodeIndex(o)));for(var l=new Ar(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Mf(u,a))return x.none();if(Mn(u)&&u.nodeValue.length>0)return!1===Af(u,a,"A")?x.some(uc(u,r?u.nodeValue.length:0)):x.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return x.none();i=u}return n&&i?x.some(uc(i,0)):x.none()},Bf=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=kn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,Kr(o))return x.none();if(kn(o)&&i>o.childNodes.length-1&&(a=!1),Dn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(Kr(u))return x.none();if(f[u.nodeName]||Nf(u))return x.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Mn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Nf(o))return x.none();if(function(t,e){for(;e&&e!==t;){if(Hn(e))return!0;e=e.parentNode}return!1}(c,o)||Kr(o))return x.none();if(o.hasChildNodes()&&!1===Nf(o)){u=o;var d=new Ar(o,c);do{if(Hn(u)||Kr(u)){s=!1;break}if(Mn(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Rf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(Mn(o)&&0===i&&Df(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),kn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Pn(u)||function(t,e){return t.previousSibling&&"A"===t.previousSibling.nodeName}(u)||zf(t,u,!1)||zf(t,u,!0)||Df(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&Mn(o)&&i===o.nodeValue.length&&Df(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?x.some(uc(o,i)):x.none()},Pf=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=uc.fromRangeStart(e);return Bf(t,n,!0,r).each((function(t){n&&uc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Bf(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),_f(e,r)?x.none():x.some(r)},If=function(t,e){return t.splitText(e)},Lf=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Mn(e)?n>0&&n<e.nodeValue.length&&(e=(r=If(e,n)).previousSibling,o>n?(e=r=If(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Mn(e)&&n>0&&n<e.nodeValue.length&&(e=If(e,n),n=0),Mn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=If(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}};function Hf(t){return{walk:function(e,n){return ef(t,e,n)},split:Lf,normalize:function(e){return Pf(t,e).fold(p,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}!function(t){t.compareRanges=_f,t.getCaretRangeFromPoint=Tf,t.getSelectedNode=Ha,t.getNode=Fa}(Hf||(Hf={}));var Ff,Vf=Hf,jf=function(t,e){var n=function(e){var n=function(t){var e=t.dom;return dn(t)?e.getBoundingClientRect().height:e.offsetHeight}(e);if(n<=0||null===n){var r=Kn(e,t);return parseFloat(r)||0}return n},r=function(t,e){return $(e,(function(e,n){var r=Kn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!D(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;jn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height"),Uf=function(t,e){return t.view(e).fold(l([]),(function(e){var n=t.owner(e),r=Uf(t,n);return[e].concat(r)}))},Wf=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Te)},owner:function(t){return Fe(t)}}),qf=function(t){return"textarea"===Me(t)},$f=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return gn(n.offsetLeft,n.offsetTop);var i=hn(null==r?void 0:r.pageYOffset,o.scrollTop),u=hn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=hn(o.clientTop,n.clientTop),c=hn(o.clientLeft,n.clientLeft);return pn(t).translate(u-c,i-a)}(t),r=function(t){return jf.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Gf=function(t,e,n,r){Jf(t,(function(o,i){return Kf(t,e,n,r)}),n)},Xf=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,vn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Kf=function(t,e,n,r){var o=Te(t.getBody()),i=Te(t.getDoc());o.dom.offsetWidth;var u,a,c,s,l=(u=Te(n.startContainer),a=n.startOffset,c=function(t,e){var n=Ge(t);if(0===n.length||qf(t))return{element:t,offset:e};if(e<n.length&&!qf(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return qf(r)?{element:t,offset:e}:"img"===Me(r)?{element:r,offset:1}:Pe(r)?{element:r,offset:gf(r).length}:{element:r,offset:Ge(r).length}}(u,a),s=Se('<span data-mce-bogus="all">\ufeff</span>'),rn(c.element,s),$f(s,(function(){return ln(s)})));Xf(t,i,e,l,r),l.cleanup()},Yf=function(t,e,n,r){var o=Te(t.getDoc());Xf(t,o,n,function(t){return $f(Te(t),c)}(e),r)},Jf=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(Te(r),Te(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Qf=function(t,e,n,r){var o=t.pos;if(n)bn(o.left,o.top,r);else{var i=o.top-e+t.height;bn(o.left,i,r)}},Zf=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;u<e?Qf(r,n,!1!==o,t):u>i?Qf(r,n,c?!1!==o:!0===o,t):a>i&&!c&&Qf(r,n,!0===o,t)},td=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r)},ed=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r);var i=function(t){var e=Te(document),n=vn(e),r=function(t,e){var n=e.owner(t);return Uf(e,n)}(t,Wf),o=pn(t),i=q(r,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return gn(i.left+o.left+n.left,i.top+o.top+n.top)}(n.element),u=xn(window);i.top<u.y?yn(n.element,!1!==r):i.top>u.bottom&&yn(n.element,!0===r)},nd=function(t,e,n){return Gf(t,td,e,n)},rd=function(t,e,n){return Yf(t,e,td,n)},od=function(t,e,n){return Gf(t,ed,e,n)},id=function(t,e,n){return Yf(t,e,ed,n)},ud=function(t,e,n){(t.inline?nd:od)(t,e,n)},ad=function(t){var e=tn(t).dom;return t.dom===e.activeElement},cd=function(t){return void 0===t&&(t=Te(document)),x.from(t.dom.activeElement).map(Te)},sd=mr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ld=(sd.before,sd.on,sd.after,mr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),fd=(ld.domRange,ld.relative,ld.exact,function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}}),dd=ae().browser,md=function(t,e){var n=Pe(e)?gf(e).length:Ge(e).length+1;return t>n?n:t<0?0:t},gd=function(t){return fd(t.start,md(t.soffset,t.start),t.finish,md(t.foffset,t.finish))},hd=function(t,e){return!Sn(e.dom)&&(Re(t,e)||Ne(t,e))},pd=function(t){return function(e){return hd(t,e.start)&&hd(t,e.finish)}},vd=function(t){return!0===t.inline||dd.isIE()},bd=function(t){return fd(Te(t.startContainer),t.startOffset,Te(t.endContainer),t.endOffset)},yd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),x.some(e)}catch(t){return x.none()}},wd=function(t){var e,n,r,o=vd(t)?(e=Te(t.getBody()),(n=Ve(e).dom,r=n.getSelection(),(r&&0!==r.rangeCount?x.from(r.getRangeAt(0)):x.none()).map(bd)).filter(pd(e))):x.none();t.bookmark=o.isSome()?o:t.bookmark},xd=function(t){return(t.bookmark?t.bookmark:x.none()).bind((function(e){return n=Te(t.getBody()),r=e,x.from(r).filter(pd(n)).map(gd);var n,r})).bind(yd)},Cd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Sd=function(t){var e=la((function(){wd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};Qu.DOM.bind(document,"mouseup",n),t.on("remove",(function(){Qu.DOM.unbind(document,"mouseup",n)}))}(t,e),function(t,e){ae().browser.isIE()?function(t){t.on("focusout",(function(){wd(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||wd(t)}))}(t,e)})),t.on("remove",(function(){e.cancel()}))},kd=Qu.DOM,Od=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==kd.getParent(e,(function(e){return function(t){return Cd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},Td=function(t,e){var n=e.editor;Sd(n),n.on("focusin",(function(){var e=this,n=t.focusedEditor;n!==e&&(n&&n.fire("blur",{focusedEditor:e}),t.setActive(e),t.focusedEditor=e,e.fire("focus",{blurredEditor:n}),e.focus(!0))})),n.on("focusout",(function(){var e=this;Tr.setEditorTimeout(e,(function(){var n=t.focusedEditor;Od(e,function(t){try{var e=tn(Te(t.getElement()));return cd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(e))||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ff||(Ff=function(e){var n=t.activeEditor;n&&function(t){if(Ze()&&M(t.target)){var e=Te(t.target);if(Be(e)&&M(e.dom.shadowRoot)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return tt(n)}}return x.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Od(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},kd.bind(document,"focusin",Ff))},_d=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(kd.unbind(document,"focusin",Ff),Ff=null)},Ed=function(t,e){(function(t,e){return function(t){return t.collapsed?x.from(Fa(t.startContainer,t.startOffset)).map(Te):x.none()}(e).bind((function(e){return Lr(e)?x.some(e):!1===Re(t,e)?x.some(t):x.none()}))})(Te(t.getBody()),e).bind((function(t){return al(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},Ad=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},Nd=function(t){return t.inline?function(t){var e,n,r=t.getBody();return r&&(e=Te(r),ad(e)||(n=e,cd(tn(n)).filter((function(t){return n.dom.contains(t.dom)}))).isSome())}(t):function(t){return t.iframeElement&&ad(Te(t.iframeElement))}(t)},Rd=function(t){return t.editorManager.setActive(t)},Md=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return x.from(i).map(Te).map((function(t){return r&&e.collapsed?t:Xe(t,o(t,u)).getOr(t)})).bind((function(t){return Be(t)?x.some(t):je(t).filter(Be)})).map((function(t){return t.dom})).getOr(t)},zd=function(t,e,n){return Md(t,e,!0,n,(function(t,e){return Math.min(t.dom.childNodes.length,e)}))},Dd=function(t,e,n){return Md(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Bd=function(t,e){for(var n=t;t&&Mn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Pd=function(t,e){return V(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Id=function(t){return z(t)?t:p},Ld=function(t,e,n){var r=e(t),o=Id(n);return r.orThunk((function(){return o(t)?x.none():function(t,e,n){for(var r=t.dom,o=Id(n);r.parentNode;){r=r.parentNode;var i=Te(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()}(t,e,o)}))},Hd=Rl,Fd=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},Vd=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!Fd(t,e,n)||e.parentNode===o||!!Wd(t,e,n,r,!0)})),Wd(t,e,n,r))},jd=function(t,e,n){return!!Hd(e,n.inline)||!!Hd(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},Ud=function(t,e,n,r,o,i){var u,a,c,s=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(s)if(void 0===s.length){for(u in s)if(s.hasOwnProperty(u)){if(a="attributes"===r?t.getAttrib(e,u):zl(t,e,u),o&&!a&&!n.exact)return;if((!o||n.exact)&&!Hd(a,Ml(t,Nl(s[u],i),u)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?t.getAttrib(e,s[c]):zl(t,e,s[c]))return n;return n},Wd=function(t,e,n,r,o){var i,u,a,c,s=t.formatter.get(n),l=t.dom;if(s&&e)for(u=0;u<s.length;u++)if(i=s[u],jd(t.dom,e,i)&&Ud(l,e,i,"attributes",o,r)&&Ud(l,e,i,"styles",o,r)){if(c=i.classes)for(a=0;a<c.length;a++)if(!t.dom.hasClass(e,c[a]))return;return i}},qd=function(t,e,n,r){if(r)return Vd(t,r,e,n);if(r=t.selection.getNode(),Vd(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!Vd(t,o,e,n))},$d=function(t,e,n){return $(n,(function(n,r){var o=function(t,e){return F(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return F(["styles","attributes"],(function(n){return dt(t,n).exists((function(t){var n=_(t)?t:function(t,e){var n=[];return it(t,(function(t,e){n.push(t)})),n}(t);return F(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Gd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xd=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},Kd=function(t){if(!ho(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Yd=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Jd=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Gd[e]||1);return n&&it(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&it(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Xd(n,this))n.name===t&&e.push(n);return e},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Xd(n,t))e.push(n);for(var r=e.length;r--;)(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Yd(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Yd(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Kd(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&ho(o.value))return!1;if(n&&n(o))return!1}while(o=Xd(o,r));return!0},t.prototype.walk=function(t){return Xd(this,null,t)},t}(),Qd=xe.makeMap,Zd=function(t){var e=[],n=(t=t||{}).indent,r=Qd(t.indent_before||""),o=Qd(t.indent_after||""),i=Io.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tm=function(t,e){void 0===e&&(e=Go());var n=Zd(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r,a,c,s,l,f,d,m,g,h=i[t.type];if(h)h(t);else{if(r=t.name,a=t.shortEnded,c=t.attributes,o&&c&&c.length>1&&((f=[]).map={},g=e.getElementRule(t.name))){for(d=0,m=g.attributesOrder.length;d<m;d++)(s=g.attributesOrder[d])in c.map&&(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));for(d=0,m=c.length;d<m;d++)(s=c[d].name)in f.map||(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));c=f}if(n.start(t.name,c,a),!a){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},em=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return dt(e.uris,t).getOr(t)}))},nm=["img","video"],rm=function(t,e,n){var r,o,i=1,u=t.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(a.lastIndex=r=n;o=a.exec(e);){if(r=a.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in u)continue;i++}if(0===i)break}return r},om=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function im(t,e){void 0===e&&(e=Go());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,u=t.start?t.start:n,a=t.end?t.end:n,c=t.pi?t.pi:n,s=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");for(var f,d,m,g,h,p,v,b,y,w,x,C,S,k,O,T,_,E,A,N=n.html,M=0,z=[],D=0,B=Io.decode,P=xe.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L="html"===l?0:1,F=function(t){var e,n;for(e=z.length;e--&&z[e].name!==t;);if(e>=0){for(n=z.length-1;n>=e;n--)(t=z[n]).valid&&a(t.name);z.length=e}},V=function(t,e){return i(em(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(em(e,n)))},U=function(t,e){var n=t||"",r=!Rt(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length}(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},W=function(e,r,o,i,u){var a,c;if(o=function(t){return dt(n.uris,t).getOr(t)}((r=r.toLowerCase())in K?r:B(o||i||u||"")),Y&&!b&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(r)){if(!(a=k[r])&&O){for(c=O.length;c--&&!(a=O[c]).pattern.test(r););-1===c&&(a=null)}if(!a)return;if(a.validValues&&!(o in a.validValues))return}if(P[r]&&!t.allow_script_urls){var s=o.replace(/[\s\u0000-\u001F]+/g,"");try{s=decodeURIComponent(s)}catch(t){s=unescape(s)}if(I.test(s))return;if(function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return!(R(t)?H(nm,e):t)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))}(t,s,e))return}b&&(r in P||0===r.indexOf("on"))||(g.map[r]=o,g.push({name:r,value:o}))},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),X=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=N+">";f=q.exec(tt);){var et=f[0];if(M<f.index&&V(B(N.substr(M,f.index-M))),d=f[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=f[8]){if(f.index+et.length>N.length){V(B(N.substr(f.index))),M=f.index+et.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in G,Q&&X[d]&&z.length>0&&z[z.length-1].name===d&&F(d);var nt=om($,f[9]);if(null!==nt){if("all"===nt){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}if(!Y||(w=e.getElementRule(d))){if(x=!0,Y&&(k=w.attributes,O=w.attributePatterns),(S=f[9])?((b=-1!==S.indexOf("data-mce-type"))&&J&&(x=!1),(g=[]).map={},S.replace($,(function(t,e,n,r,o){return W(d,e,n,r,o),""}))):(g=[]).map={},Y&&!b){if(T=w.attributesRequired,_=w.attributesDefault,E=w.attributesForced,w.removeEmptyAttrs&&!g.length&&(x=!1),E)for(h=E.length;h--;)v=(C=E[h]).name,"{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A});if(_)for(h=_.length;h--;)(v=(C=_[h]).name)in g.map||("{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A}));if(T){for(h=T.length;h--&&!(T[h]in g.map););-1===h&&(x=!1)}if(C=g.map["data-mce-bogus"]){if("all"===C){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}}x&&u(d,g,y)}else x=!1;if(m=Z[d]){m.lastIndex=M=f.index+et.length,(f=m.exec(N))?(x&&(p=N.substr(M,f.index-M)),M=f.index+f[0].length):(p=N.substr(M),M=N.length),x&&(p.length>0&&V(p,!0),a(d)),q.lastIndex=M;continue}y||(S&&S.indexOf("/")===S.length-1?x&&a(d):z.push({name:d,valid:x}))}else if(d=f[1])j(d);else if(d=f[2]){if(!(1===L||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){M=U("",f.index+2),q.lastIndex=M;continue}o(d)}else if(d=f[3])s(d);else{if((d=f[4])||"<!"===et){M=U(d,f.index+et.length),q.lastIndex=M;continue}if(d=f[5]){if(1!==L){M=U("?",f.index+2),q.lastIndex=M;continue}c(d,f[6])}}M=f.index+et.length}for(M<N.length&&V(B(N.substr(M))),h=z.length-1;h>=0;h--)(d=z[h]).valid&&a(d.name)};return{parse:function(t,e){void 0===e&&(e="html"),l(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=ka("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}return 0===u?{prefix:i,uris:o,html:t}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join("")})}(t),e)}}}!function(t){t.findEndTag=rm}(im||(im={}));var um=im,am=function(t,e){var n,r,o,i,u=e,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=t.schema;u=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),u);for(var s=c.getShortEndedElements();i=a.exec(u);)r=a.lastIndex,o=i[0].length,n=s[i[1]]?r:um.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),a.lastIndex=r-o;return Wr(u)},cm=am,sm=xe.each,lm=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return sm(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||wl(e)||wl(n))}},fm=function(t,e,n){return x.from(n.container()).filter(Mn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},dm=d(fm,!0,Cl),mm=d(fm,!1,Cl),gm=function(t){var e=t.container();return Mn(e)&&(0===e.data.length||Ur(e.data)&&yf.isBookmarkNode(e.parentNode))},hm=function(t,e){return function(n){return x.from(As(t?0:-1,n)).filter(e).isSome()}},pm=function(t){return In(t)&&"block"===Kn(Te(t),"display")},vm=function(t){return Hn(t)&&!function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},bm=hm(!0,pm),ym=hm(!1,pm),wm=hm(!0,Vn),xm=hm(!1,Vn),Cm=hm(!0,An),Sm=hm(!1,An),km=hm(!0,vm),Om=hm(!1,vm),Tm=function(t){sn(t),an(t,Se('<br data-mce-bogus="1">'))},_m=function(t){Ye(t).each((function(e){Ue(e).each((function(n){Mr(t)&&Dr(e)&&Mr(n)&&ln(e)}))}))},Em=function(t,e){return function(t,e,n){return Re(e,t)?function(t,e){for(var n=z(e)?e:p,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Te(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Ne(t,e)})).slice(0,-1):[]}(t,e,p)},Am=function(t,e){return[t].concat(Em(t,e))},Nm=function(t,e,n){return rl(t,e,n,gm)},Rm=function(t,e){return G(Am(Te(e.container()),t),Mr)},Mm=function(t,e,n){return Nm(t,e.dom,n).forall((function(t){return Rm(e,n).fold((function(){return!1===Es(t,n,e.dom)}),(function(r){return!1===Es(t,n,e.dom)&&Re(r,Te(t.container()))}))}))},zm=function(t,e,n){return Rm(e,n).fold((function(){return Nm(t,e.dom,n).forall((function(t){return!1===Es(t,n,e.dom)}))}),(function(e){return Nm(t,e.dom,n).isNone()}))},Dm=d(zm,!1),Bm=d(zm,!0),Pm=d(Mm,!1),Im=d(Mm,!0),Lm=function(t){return Ls(t).exists(Dr)},Hm=function(t,e,n){var r=W(Am(Te(n.container()),e),Mr),o=tt(r).getOr(e);return el(t,o.dom,n).filter(Lm)},Fm=function(t,e){return Ls(e).exists(Dr)||Hm(!0,t,e).isSome()},Vm=function(t,e){return function(t){return x.from(t.getNode(!0)).map(Te)}(e).exists(Dr)||Hm(!1,t,e).isSome()},jm=d(Hm,!1),Um=d(Hm,!0),Wm=function(t){return uc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},qm=function(t,e){var n=W(Am(Te(e.container()),t),Mr);return tt(n).getOr(t)},$m=function(t,e){return Wm(e)?mm(e):mm(e)||ul(qm(t,e).dom,e).exists(mm)},Gm=function(t,e){return Wm(e)?dm(e):dm(e)||il(qm(t,e).dom,e).exists(dm)},Xm=function(t){return Ls(t).bind((function(t){return br(t,Be)})).exists((function(t){return function(t){return H(["pre","pre-wrap"],t)}(Kn(t,"white-space"))}))},Km=function(t,e){return!Xm(e)&&(Dm(t,e)||Pm(t,e)||Vm(t,e)||$m(t,e))},Ym=function(t,e){return!Xm(e)&&(Bm(t,e)||Im(t,e)||Fm(t,e)||Gm(t,e))},Jm=function(t,e){return Km(t,e)||Ym(t,function(t){var e=t.container(),n=t.offset();return Mn(e)&&n<e.data.length?uc(e,n+1):t}(e))},Qm=function(t,e){return xl(t.charAt(e))},Zm=function(t){var e=t.container();return Mn(e)&&Nt(e.data,Vr)},tg=function(t,e){return x.some(e).filter(Zm).bind((function(e){var n,r,o,i=e.container();return function(t,e){var n=e.data,r=uc(e,0);return!(!Qm(n,0)||Jm(t,r)||(e.data=" "+n.slice(1),0))}(t,i)||(r=(n=i).data,(o=function(t){var e=t.split("");return V(e,(function(t,n){return xl(t)&&n>0&&n<e.length-1&&Sl(e[n-1])&&Sl(e[n+1])?" ":t})).join("")}(r))!==r&&(n.data=o,1))||function(t,e){var n=e.data,r=uc(e,n.length-1);return!(!Qm(n,n.length-1)||Jm(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,i)?x.some(e):x.none()}))},eg=function(t){var e=Te(t.getBody());t.selection.isCollapsed()&&tg(e,uc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},ng=function(t,e,n){if(0!==n){var r=Te(t),o=vr(r,Mr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Ym(o,cc(t,t.data.length)),a=0===e&&Km(o,cc(t,0));t.replaceData(e,n,function(t,e,n){return $(t,(function(r,o){return Cl(o)||xl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+Vr}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},rg=function(t,e){var n=t.data.slice(e),r=n.length-Dt(n).length;return ng(t,e,r)},og=function(t,e){var n=t.data.slice(0,e),r=n.length-Bt(n).length;return ng(t,e-r,r)},ig=function(t,e,n,r){void 0===r&&(r=!0);var o=Bt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),ln(Te(u)),n&&rg(i,o),i},ug=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===cc.isTextPosition(t)&&n===e.parentNode&&r>cc.before(e).offset()}(e,t)?cc(e.container(),e.offset()-1):e},ag=function(t){return lo(t.previousSibling)?x.some((e=t.previousSibling,Mn(e)?cc(e,e.data.length):cc.after(e))):t.previousSibling?cl(t.previousSibling):x.none();var e},cg=function(t){return lo(t.nextSibling)?x.some((e=t.nextSibling,Mn(e)?cc(e,0):cc.before(e))):t.nextSibling?al(t.nextSibling):x.none();var e},sg=function(t,e,n){return function(t,e,n){return t?function(t,e){return cg(e).orThunk((function(){return ag(e)})).orThunk((function(){return function(t,e){return il(t,cc.after(e)).fold((function(){return ul(t,cc.before(e))}),x.some)}(t,e)}))}(e,n):function(t,e){return ag(e).orThunk((function(){return cg(e)})).orThunk((function(){return function(t,e){var n=cc.before(e.previousSibling?e.previousSibling:e.parentNode);return ul(t,n).fold((function(){return il(t,cc.after(e))}),x.some)}(t,e)}))}(e,n)}(t,e,n).map(d(ug,n))},lg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},fg=function(t,e){return e&&mt(t.schema.getBlockElements(),Me(e))},dg=function(t){if(wo(t)){var e=Se('<br data-mce-bogus="1">');return sn(t),an(t,e),x.some(cc.before(e.dom))}return x.none()},mg=function(t,e,n,r){void 0===r&&(r=!0);var o,i=sg(e,t.getBody(),n.dom),u=vr(n,d(fg,t),(o=t.getBody(),function(t){return t.dom===o})),a=function(t,e,n){var r,o,i,u,a=Ue(t).filter(Pe),c=We(t).filter(Pe);return ln(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return ig(o,i,n),r.container()===i?cc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?x.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):x.none()).orThunk((function(){return n&&(a.each((function(t){return og(t.dom,t.dom.length)})),c.each((function(t){return rg(t.dom,0)}))),e}))}(n,i,function(t,e){return mt(t.schema.getTextInlineElements(),Me(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(dg).fold((function(){r&&lg(t,e,a)}),(function(n){r&&lg(t,e,x.some(n))}))},gg=function(t,e){return{start:t,end:e}},hg=mr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),pg=function(t,e){return xr(Te(t),"td,th",e)},vg=function(t,e){return yr(t,"table",e)},bg=function(t){return!Ne(t.start,t.end)},yg=function(t,e){return vg(t.start,e).bind((function(n){return vg(t.end,e).bind((function(t){return e=Ne(n,t),r=n,e?x.some(r):x.none();var e,r}))}))},wg=function(t){return va(t,"td,th")},xg=function(t,e){return yg(e,t).isSome()},Cg=function(t,e,n){return t.filter((function(t){return bg(t)&&xg(n,t)})).orThunk((function(){return function(t,e){var n=pg(e.startContainer,t),r=pg(e.endContainer,t);return e.collapsed?x.none():Ra(n,r,gg).fold((function(){return n.fold((function(){return r.bind((function(e){return vg(e,t).bind((function(t){return tt(wg(t)).map((function(t){return gg(t,e)}))}))}))}),(function(e){return vg(e,t).bind((function(t){return et(wg(t)).map((function(t){return gg(e,t)}))}))}))}),(function(e){return xg(t,e)?x.none():function(t,e){return vg(t.start,e).bind((function(e){return et(wg(e)).map((function(e){return gg(t.start,e)}))}))}(e,t)}))}(n,e)})).bind((function(t){return function(t,e){return yg(t,e).map((function(e){return function(t,e,n){return{rng:t,table:e,cells:n}}(t,e,wg(e))}))}(t,n)}))},Sg=function(t,e){return X(t,(function(t){return Ne(t,e)}))},kg=function(t){return function(t){return Ra(Sg(t.cells,t.rng.start),Sg(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))}(t).map((function(e){var n=t.cells;return e.length===n.length?hg.removeTable(t.table):hg.emptyCells(e)}))},Og=function(t,e){var n=function(t){return function(e){return Ne(t,e)}}(t),r=function(t,e){var n=pg(t.startContainer,e),r=pg(t.endContainer,e);return Ra(n,r,gg)}(e,n);return function(t,e,n){return t.filter((function(t){return function(t,e){return!bg(t)&&yg(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&cf(t.start,e)})).map((function(t){return t.start}))}(r,e,n).map((function(t){return hg.deleteCellSelection(e,t)})).orThunk((function(){return Cg(r,e,n).bind(kg)}))},Tg=function(t){var e;return(8===ze(e=t)||"#comment"===Me(e)?Ue(t):Ye(t)).bind(Tg).orThunk((function(){return x.some(t)}))},_g=function(t,e){return j(e,Tm),t.selection.setCursorLocation(e[0].dom,0),!0},Eg=function(t,e,n){e.deleteContents();var r,o=Tg(n).getOr(n),i=Te(t.dom.getParent(o.dom,t.dom.isBlock));if(wo(i)&&(Tm(i),t.selection.setCursorLocation(i.dom,0)),!Ne(n,i)){var u=je(i).is(n)?[]:je(r=i).map(Ge).map((function(t){return W(t,(function(t){return!Ne(r,t)}))})).getOr([]);j(u.concat(Ge(n)),(function(t){Ne(t,i)||Re(t,i)||ln(t)}))}return!0},Ag=function(t,e){return mg(t,!1,e),!0},Ng=function(t,e){return G(Am(e,t),Hr)},Rg=function(t,e){return G(Am(e,t),(function(t){return"caption"===Me(t)}))},Mg=function(t,e){return Tm(e),t.selection.setCursorLocation(e.dom,0),x.some(!0)},zg=function(t,e){return t?Cm(e):Sm(e)},Dg=function(t,e,n){var r=Te(t.getBody());return Rg(r,n).fold((function(){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return Ng(n,r).bind((function(r){return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(t){return Ng(e,Te(t.getNode())).map((function(t){return!1===Ne(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)}(t,e,r,n)||function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return zg(e,n)||el(e,t.getBody(),n).exists((function(t){return zg(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return al(t.dom).bind((function(o){return cl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Mg(t,e)}(t,r):function(t,e,n){return Rg(t,Te(n.getNode())).map((function(t){return!1===Ne(t,e)}))}(e,r,i)})).or(x.some(!0))}(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Bg=function(t,e){var n=Te(t.selection.getStart(!0)),r=of(t);return t.selection.isCollapsed()&&0===r.length?Dg(t,e,n):function(t,e){var n=Te(t.getBody()),r=t.selection.getRng(),o=of(t);return 0!==o.length?_g(t,o):function(t,e,n,r){return Rg(e,r).fold((function(){return function(t,e,n){return Og(e,n).map((function(e){return e.fold(d(Ag,t),d(_g,t),d(Eg,t))}))}(t,e,n)}),(function(e){return function(t,e){return Mg(t,e)}(t,e)})).getOr(!1)}(t,n,r,e)}(t,n)},Pg=function(t){return t.collapsed?t:function(t){var e=cc.fromRangeStart(t),n=cc.fromRangeEnd(t),r=t.commonAncestorContainer;return el(!1,r,n).map((function(o){return!Es(e,n,r)&&Es(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)}(t)},Ig=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===Vr}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Lg=function(t){return t.length>0&&(!(n=t[t.length-1]).firstChild||(e=n)&&e.firstChild&&e.firstChild===e.lastChild&&function(t){return t.data===Vr||Pn(t)}(e.firstChild))?t.slice(0,-1):t;var e,n},Hg=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Fg=function(t,e){var n=cc.after(t),r=Js(e).prev(n);return r?r.toRange():null},Vg=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Hg(e,n.startContainer),a=Lg((o=i.firstChild,xe.grep(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=cc.fromRangeStart(n),o=Js(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Hg(e,i.getNode())!==u};return s(1)?function(t,e,n){var r=t.parentNode;return xe.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=cc.before(t),r=Js(e).next(n);return r?r.toRange():null}(t,n)}(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Fg(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),xe.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Fg(e[e.length-1],n)}(u,a,c,n)},jg=Fn,Ug=function(t,e,n){var r,o,i,u,a,c,s=t.selection,l=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Te(t.getRoot());return n=Km(r,cc.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Ym(r,cc.fromRangeEnd(e))?n.replace(/( | )(<br( \/)>)?$/," "):n.replace(/ (<br( \/)?>)?$/," ")}(l,s.getRng(),e));var f=t.parser,d=n.merge,m=tm({validate:Kc(t)},t.schema),g='<span id="mce_marker" data-mce-type="bookmark"></span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},(i=t.fire("BeforeSetContent",i)).isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=i.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,g);var h=(a=s.getRng()).startContainer||(a.parentElement?a.parentElement():null),p=t.getBody();h===p&&s.isCollapsed()&&l.isBlock(p.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,p.firstChild)&&l.isEmpty(p.firstChild)&&((a=l.createRng()).setStart(p.firstChild,0),a.setEnd(p.firstChild,0),s.setRng(a)),s.isCollapsed()||function(t){var e=t.dom,n=Pg(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,jg);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,jg)&&cf(Te(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Eg(t,n,Te(r))}(t);var v,b={context:(r=s.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},y=f.parse(e,b);if(!0===n.paste&&Ig(t.schema,y)&&function(t,e){return!!Hg(t,e)}(l,r))return a=Vg(m,l,s.getRng(),y),s.setRng(a),void t.fire("SetContent",i);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(y),"mce_marker"===(c=y.lastChild).attr("id"))for(u=c,c=c.prev;c;c=c.walk(!0))if(3===c.type||!l.isBlock(c.name)){t.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(u,c,"br"===c.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),b.invalid){for(t.selection.setContent(g),r=s.getNode(),o=t.getBody(),9===r.nodeType?r=c=o:c=r;c!==o;)r=c,c=c.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return m.serialize(y)})))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=m.serialize(y),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new lm(r);xe.each(r.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)}))}}(t,d),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){i.scrollIntoView(e);var u=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(u)return o.remove(e),void i.select(u);var a=o.createRng(),c=e.previousSibling;c&&3===c.nodeType?(a.setStart(c,c.nodeValue.length),pe.ie||(r=e.nextSibling)&&3===r.nodeType&&(c.appendData(r.data),r.parentNode.removeChild(r))):(a.setStartBefore(e),a.setEndBefore(e));var s=o.getParent(e,o.isBlock);o.remove(e),s&&o.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),jg(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=cc.fromRangeStart(e);if(n=Js(t.getBody()).next(n))return n.toRange()}(a))?o.add(s,o.create("br",{"data-mce-bogus":"1"})):(a=n,o.remove(s))),i.setRng(a)}}(t,l.get("mce_marker")),v=t.getBody(),xe.each(v.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){x.from(t.getParent(e,"td,th")).map(Te).each(_m)}(l,s.getStart()),t.fire("SetContent",i),t.addVisual()}},Wg=function(t,e){e(t),t.firstChild&&Wg(t.firstChild,e),t.next&&Wg(t.next,e)},qg=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Wg(n.firstChild,(function(n){j(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),j(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(u)&&i.push(r[u]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(t,e,n);j(r,(function(t){j(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},$g=function(t){return t instanceof Jd},Gg=function(t,e){t.dom.setHTML(t.getBody(),e),function(t){Nd(t)&&al(t.getBody()).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Xg=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?function(t,e){return G(t.dom.childNodes,(function(t){return e(Te(t))})).map(Te)}(Te(n.parentNode),(function(n){return!Ne(t,n)&&e(n)})):x.none()}(t,e).isSome()},Kg=jr,Yg="_mce_caret",Jg=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Kg||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Qg=function(t){if(t){var e=new Ar(t,t);for(t=e.current();t;t=e.next())if(Mn(t))return t}return null},Zg=function(t){var e=ke("span");return qn(e,{id:Yg,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&an(e,Oe(Kg)),e},th=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Jg(e))mg(t,!1,Te(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Qg(t);return e&&e.nodeValue.charAt(0)===Kg&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&Tm(Te(u)),o.setRng(i)}},eh=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)th(t,e,n);else if(!(e=fl(t.getBody(),o.getStart())))for(;e=r.get(Yg);)th(t,e,!1)},nh=function(t,e){return t.appendChild(e),e},rh=function(t,e){var n=q(t,(function(t,e){return nh(t,e.cloneNode(!1))}),e);return nh(n,n.ownerDocument.createTextNode(Kg))},oh=function(t,e,n,r){var o,i,c,s=t.dom,l=t.selection,f=[],m=l.getRng(),g=m.startContainer,h=m.startOffset;for(i=g,3===g.nodeType&&(h!==g.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Wd(t,i,e,n,r)){c=i;break}i.nextSibling&&(o=!0),f.push(i),i=i.parentNode}if(c)if(o){var p=l.getBookmark();m.collapse(!0);var v=Zl(t,m,t.formatter.get(e),!0);v=Lf(v),t.formatter.remove(e,n,v,r),l.moveToBookmark(p)}else{var b=fl(t.getBody(),c),y=Zg(!1).dom;!function(t,e,n){var r,o,i,u=t.dom,a=u.getParent(n,d(_l,t));a&&u.isEmpty(a)?n.parentNode.replaceChild(e,n):(r=Te(n),o=va(r,"br"),i=W(function(t){for(var e=[],n=t.dom;n;)e.push(Te(n)),n=n.lastChild;return e}(r).slice(-1),Dr),o.length===i.length&&j(i,ln),u.isEmpty(n)?n.parentNode.replaceChild(e,n):u.insertAfter(e,n))}(t,y,null!==b?b:c);var w=function(t,e,n,r,o,i){var c=t.formatter,s=t.dom,l=W(rt(c.get()),(function(t){return t!==r&&!Nt(t,"removeformat")})),f=$d(t,n,l);if(W(f,(function(e){return!function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return ft(t,(function(t,e){return F(r,(function(t){return t===e}))}))};return F(t.formatter.get(e),(function(e){var r=o(e);return F(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=a),u(n).eq(t,e)}(r,e)}))}))}(t,e,r)})).length>0){var d=n.cloneNode(!1);return s.add(e,d),c.remove(r,o,d,i),s.remove(d),x.some(d)}return x.none()}(t,y,c,e,n,r),C=rh(f.concat(w.toArray()),y);th(t,b,!1),l.setCursorLocation(C,1),s.isEmpty(c)&&s.remove(c)}},ih=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(Me(e))&&!ll(e.dom)&&!En(e.dom)},uh={},ah=bt,ch=pt;uh.pre||(uh.pre=[]),uh.pre.push((function(t){var e,n=t.selection.getRng(),r=On(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),ch(ah(ah(e,r),(function(t){return r(t.previousSibling)&&-1!==yt(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Wu(n=t).remove(),Wu(e).append("<br><br>").append(n.childNodes)})))}));var sh=xe.each,lh=function(t){return kn(t)&&!wl(t)&&!ll(t)&&!En(t)},fh=function(t,e){var n;for(n=t;n;n=n[e]){if(Mn(n)&&0!==n.nodeValue.length)return t;if(kn(n)&&!wl(n))return n}return t},dh=function(t,e,n){var r,o,i=new lm(t);if(e&&n&&(e=fh(e,"previousSibling"),n=fh(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),xe.each(xe.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},mh=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=dh(t,Tl(r),r);dh(t,o,Tl(o,!0))}},gh=function(t,e,n){sh(t.childNodes,(function(t){lh(t)&&(e(t)&&n(t),t.hasChildNodes()&&gh(t,e,n))}))},hh=function(t,e){return function(n){return!(!n||!zl(t,n,e))}},ph=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},vh=mr([{keep:[]},{rename:["name"]},{removed:[]}]),bh=/^(src|href|style)$/,yh=xe.each,wh=Rl,xh=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Ch=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],kn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Mn(r)&&n&&o>=r.nodeValue.length&&(r=new Ar(r,t.getBody()).next()||r),Mn(r)&&!n&&0===o&&(r=new Ar(r,t.getBody()).prev()||r),r},Sh=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},kh=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Oh=function(t,e,n,r,o){var i=Te(e),u=Te(t.create(r,o)),a=n?$e(i):qe(i);return cn(u,a),n?(rn(i,u),un(u,i)):(on(i,u),an(u,i)),u.dom},Th=function(t,e,n,r){return!(e=Tl(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},_h=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!!wh(e,n.inline)||!!wh(e,n.block)||(n.selector?kn(e)&&t.is(e,n.selector):void 0)}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return vh.keep();var a=r;if(e.inline&&"all"===e.remove&&_(e.preserve_attributes)){var c=W(u.getAttribs(a),(function(t){return H(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),j(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return vh.rename("span")}if("all"!==e.remove){yh(e.styles,(function(t,r){t=Ml(u,Nl(t,n),r+""),D(r)&&(r=t,o=null),(e.remove_similar||!o||wh(zl(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),yh(e.attributes,(function(t,r){var i;if(t=Nl(t,n),D(r)&&(r=t,o=null),e.remove_similar||!o||wh(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",j(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);"class"===r&&a.removeAttribute("className"),bh.test(r)&&a.removeAttribute("data-mce-"+r),a.removeAttribute(r)}})),yh(e.classes,(function(t){t=Nl(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return vh.keep()}}return"none"!==e.remove?(function(t,e,n){var r,o=e.parentNode,i=t.dom,u=zc(t);n.block&&(u?o===i.getRoot()&&(n.list_block&&wh(e,n.list_block)||j(nt(e.childNodes),(function(e){El(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=kh(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0}))):i.isBlock(e)&&!i.isBlock(o)&&(Th(i,e,!1)||Th(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Th(i,e,!0)||Th(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!wh(n.inline,e)||i.remove(e,!0)}(t,a,e),vh.removed()):vh.keep()},Eh=function(t,e,n,r,o){return _h(t,e,n,r,o).fold(p,(function(e){return t.dom.rename(r,e),!0}),v)},Ah=function(t,e,n,r){return _h(t,e,n,r,r).fold(l(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),l(null))},Nh=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return j(Bl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=Wd(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=Ah(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),u.inline&&mh(f,u,0,s))}return r}(t,i,a,r,r,0,u,n)},f=function(e){var r,o;kn(e)&&c.getContentEditable(e)&&(r=a,a="true"===c.getContentEditable(e),o=!0);var s=nt(e.childNodes);if(a&&!o)for(var l=0;l<i.length&&!Eh(t,i[l],n,e,e);l++);if(u.deep&&s.length){for(l=0;l<s.length;l++)f(s[l]);o&&(a=r)}},d=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return wl(t)&&kn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),Mn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},m=function(e){var n,r,o=Zl(t,e,i,e.collapsed);if(u.split){if(o=Lf(o),(n=Ch(t,o,!0))!==(r=Ch(t,o))){if(n=Sh(n,!0),r=Sh(r,!1),xh(c,n,r)){var a=x.from(n.firstChild).getOr(n);return l(Oh(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(xh(c,r,n))return a=x.from(r.lastChild).getOr(r),l(Oh(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);n=kh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=kh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),ef(c,s,(function(t){j(t,(function(t){wl(t)||wl(t.parentNode)||l(t)}))})),l(n),l(r),n=d(!0),r=d()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}ef(c,o,(function(e){j(e,(function(e){f(e),j(["underline","line-through","overline"],(function(n){kn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Dl(c,e.parentNode)===n&&Eh(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)if(kl(r)){var g=c.createRng();g.setStartBefore(r),g.setEndAfter(r),m(g)}else m(r);else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&u.inline&&!of(t).length?oh(t,e,n,o):(df(s,!0,(function(){ff(t,m)})),u.inline&&qd(t,e,n,s.getStart())&&Ol(c,s,s.getRng()),t.nodeChanged());else{r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!Eh(t,i[h],n,r,r));h++);}},Rh=xe.each,Mh=xe.each,zh=function(t,e){return gt(t,e)},Dh=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(e=e||i,t){if(e.onformat&&e.onformat(t,e,n,r),Mh(e.styles,(function(e,r){a.setStyle(t,r,Nl(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Mh(e.attributes,(function(e,r){a.setAttrib(t,r,Nl(e,n))})),Mh(e.classes,(function(e){e=Nl(e,n),a.hasClass(t,e)||a.addClass(t,e)}))}},l=function(t,e){var n=!1;return!!Il(i)&&(Mh(t,(function(t){if(!("collapsed"in t)||t.collapsed===u)return a.is(e,t.selector)&&!ll(e)?(s(e,t),n=!0,!1):void 0})),n)},f=function(r,u,a,c){var f=[],d=!0,m=i.inline||i.block,g=r.create(m);s(g),ef(r,u,(function(u){var a,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),y=u.parentNode.nodeName.toLowerCase();if(kn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Pn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Ll(e)){var o=St(St({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=Xg(Te(n),(function(t){return ll(t.dom)}));return gt(o,r)&&wo(Te(n.parentNode),!1)&&!i}return!1}(t,i,u,y))return a=null,void(Pl(i)&&r.remove(u));if(i.wrapper&&Wd(t,u,e,n))a=null;else{if(d&&!p&&Pl(i)&&!i.wrapper&&_l(t,b)&&El(t,y,m)){var w=r.rename(u,m);return s(w),f.push(w),void(a=null)}if(Il(i)){var x=l(o,u);if(!zh(i,"inline")||x)return void(a=null)}!d||p||!El(t,m,b)||!El(t,y,m)||!c&&3===u.nodeType&&1===u.nodeValue.length&&65279===u.nodeValue.charCodeAt(0)||ll(u)||zh(i,"inline")&&r.isBlock(u)?(a=null,Mh(xe.grep(u.childNodes),h),p&&(d=v),a=null):(a||(a=r.clone(g,!1),u.parentNode.insertBefore(a,u),f.push(a)),a.appendChild(u))}};Mh(u,h)})),!0===i.links&&Mh(f,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),Mh(xe.grep(t.childNodes),e)};e(t)})),Mh(f,(function(u){var a=function(t){var e=0;return Mh(t.childNodes,(function(t){(function(t){return M(t)&&Mn(t)&&0===t.length})(t)||wl(t)||e++})),e}(u);!(f.length>1)&&r.isBlock(u)||0!==a?(Ll(i)||i.wrapper)&&(i.exact||1!==a||(u=function(t){var e,n=function(t){var e=!1;return Mh(t.childNodes,(function(t){if(function(t){return t&&1===t.nodeType&&!wl(t)&&!ll(t)&&!En(t)}(t))return e=t,!1})),e}(t);return n&&!wl(n)&&jd(r,n,i)&&(e=r.clone(n,!1),s(e),r.replace(e,t,!0),r.remove(n,!0)),e||t}(u)),function(t,e,n,r){Rh(e,(function(e){Rh(t.dom.select(e.inline,r),(function(r){lh(r)&&Eh(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";sh(t.select(r,n),(function(n){lh(n)&&sh(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))}(t,o,n,u),function(t,e,n,r,o){Wd(t,o.parentNode,n,r)&&Eh(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(Wd(t,i,n,r))return Eh(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&gh(r,hh(t,"fontSize"),ph(t,"backgroundColor",Nl(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Dl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(xe.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(gh(r,hh(t,"fontSize"),ph(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),mh(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(kl(r)){if(!l(o,r)){var d=a.createRng();d.setStartBefore(r),d.setEndAfter(r),f(a,Zl(t,d,o),0,!0)}}else f(a,r,0,!0);else if(u&&Ll(i)&&!of(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=fl(t.getBody(),i.getStart()))&&(o=Qg(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=Zl(t,u,t.formatter.get(e));m=Lf(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Kg||(s=t.getDoc(),l=Zg(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)}(t,e,n);else{var m=c.getNode(),g=o[0];t.settings.forced_root_block||!g.defaultBlock||a.getParent(m,a.isBlock)||Dh(t,g.defaultBlock),c.setRng(Pg(c.getRng())),df(c,!0,(function(e){ff(t,(function(e,n){var r=n?e:Zl(t,e,o);f(a,r)}))})),Ol(a,c,c.getRng()),t.nodeChanged()}!function(t,e){ch(uh[t],(function(t){t(e)}))}(e,t)}}else{r=c.getNode();for(var h=0,p=o.length;h<p;h++){var v=o[h];if(v.ceFalseOverride&&Il(v)&&a.is(r,v.selector))return void s(r,v)}}},Bh=function(t,e,n,r){return lt(t,(function(t,o){return!!mt(e,o)||(j(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},Ph=function(t,e,n,r,o){return null===e.get()&&function(t,e){var n=ra({});t.set({}),e.on("NodeChange",(function(r){!function(t,e,n,r){var o=rt(n.get()),i={},u={},a=W(Bl(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));it(r,(function(e,n){xe.each(a,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(j(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:a})})),i[n]=e.callbacks),u[n]=e.callbacks,!1):!Fd(t,r,n)&&void 0}))}));var c=Bh(n.get(),u,e,a);n.set(St(St({},i),c))}(e,r.element,n,t.get())}))}(e,t),function(t,e,n,r){var o=t.get();j(e.split(","),(function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)})),t.set(o)}(e,n,r,o),{unbind:function(){return function(t,e,n){var r=t.get();j(e.split(","),(function(t){r[t].callbacks=W(r[t].callbacks,(function(t){return t!==n})),0===r[t].callbacks.length&&delete r[t]})),t.set(r)}(e,n,r)}}},Ih=function(t,e){var n=(e||document).createDocumentFragment();return j(t,(function(t){n.appendChild(t.dom)})),Te(n)},Lh=function(t,e,n){return{element:t,width:e,rows:n}},Hh=function(t,e){return{element:t,cells:e}},Fh=function(t,e){return{x:t,y:e}},Vh=function(t,e){var n=parseInt($n(t,e),10);return isNaN(n)?1:n},jh=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Uh=function(t){return $(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},Wh=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Ne(o[i],e))return x.some(Fh(i,r));return x.none()},qh=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Hh(u[a].element,s))}return i},$h=function(t){return function(t,e){var n=_a(t.element),r=ke("tbody");return cn(r,e),an(n,r),n}(t,function(t){return V(t.rows,(function(t){var e=V(t.cells,(function(t){var e=Ea(t);return Xn(e,"colspan"),Xn(e,"rowspan"),e})),n=_a(t.element);return cn(n,e),n}))}(t))},Gh=function(t,e){return G(t,(function(t){return"li"===Me(t)&&cf(t,e)})).fold(l([]),(function(e){return function(t){return G(t,(function(t){return"ul"===Me(t)||"ol"===Me(t)}))}(t).map((function(t){var e=ke(Me(t));return function(t,e){var n=t.dom;it(e,(function(t,e){!function(t,e,n){if(!O(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);jn(t)&&t.style.setProperty(e,n)}(n,e,t)}))}(e,ft(Qn(t),(function(t,e){return Rt(e,"list-style")}))),[ke("li"),e]})).getOr([])}))},Xh=function(){return Ih([])},Kh=function(t,e){return n=Te(e.cloneContents()),r=function(t,e){var n=Te(e.commonAncestorContainer),r=Am(n,t),o=W(r,(function(t){return zr(t)||Rr(t)})),i=Gh(r,e),u=o.concat(i.length?i:function(t){return Ir(t)?je(t).filter(Pr).fold(l([]),(function(e){return[t,e]})):Pr(t)?[t]:[]}(n));return V(u,_a)}(t,e),o=$(r,(function(t,e){return an(e,t),e}),n),r.length>0?Ih([o]):o;var n,r,o},Yh=function(t,e){return(n=t,r=e[0],yr(r,"table",d(Ne,n))).bind((function(t){var n,r,o,i=e[0],u=e[e.length-1],a=function(t){var e=Lh(_a(t),0,[]);return j(va(t,"tr"),(function(t,n){j(va(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=Vh(o,"rowspan"),u=Vh(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Hh(Ea(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:_a(o)}}(e,function(t,e,n){for(;jh(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),Lh(e.element,Uh(e.rows),e.rows)}(t);return(n=a,r=i,o=u,Wh(n,r).bind((function(t){return Wh(n,o).map((function(e){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?qh(t,r,o,i,u):qh(t,r,u,i,o);return Lh(t.element,Uh(a),a)}(n,t,e)}))}))).map((function(t){return Ih([$h(t)])}))})).getOrThunk(Xh);var n,r},Jh=function(t,e){return e>=0&&e<t.length&&Cl(t.charAt(e))},Qh=function(t,e){var n=Wr(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Zh=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return x.from(t.selection.getRng()).map((function(e){var n=x.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=pe.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=Qh(u,i),c=Wr(u.textContent);if(t.dom.remove(u),Jh(c,0)||Jh(c,c.length-1)){var s=n.getOr(r),l=Qh(s,i),f=l.indexOf(a);return-1===f?a:(Jh(l,f-1)?" ":"")+a+(Jh(l,f+a.length)?" ":"")}return a})).getOr("")}(t);n.getInner=!0;var r=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=Pd(t,nf(o)),u=e.contextual?function(t,e){var n=rf(e,t);return n.length>0?Yh(t,n):function(t,e){return e.length>0&&e[0].collapsed?Xh():Kh(t,e[0])}(t,e)}(Te(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)},tp=function(t){return kn(t)?t.outerHTML:Mn(t)?Io.encodeRaw(t.data,!1):zn(t)?"\x3c!--"+t.data+"--\x3e":""},ep=function(t,e){var n,r,o,i,u,a,c,s,l,f=V(nt(e.childNodes),tp);return function(t,e){var n=0;j(t,(function(t){0===t[0]?n++:1===t[0]?(function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)}(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},np=ra(x.none()),rp=function(t){var e,n=(e=t.getBody(),W(V(nt(e.childNodes),tp),(function(t){return t.length>0}))),r=K(n,(function(e){var n=am(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},op=function(t,e,n){"fragmented"===e.type?ep(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},ip=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},up=function(t){var e=ke("body",np.get().getOrThunk((function(){var t=document.implementation.createHTMLDocument("undo");return np.set(x.some(t)),t})));return Oa(e,ip(t)),j(va(e,"*[data-mce-bogus]"),fn),e.dom.innerHTML},ap=function(t,e){return!(!t||!e)&&(!!function(t,e){return ip(t)===ip(e)}(t,e)||function(t,e){return up(t)===up(e)}(t,e))},cp=function(t){return 0===t.get()},sp=function(t,e,n){cp(n)&&(t.typing=e)},lp=function(t,e){t.typing&&(sp(t,!1,e),t.add())},fp=function(t){return t instanceof Jd},dp=function(t,e){qg(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},mp=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){cp(e)&&n.set(x.some(Ac(t.selection)))}(t,e,n)},addUndoLevel:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=rp(t);if(i=i||{},i=xe.extend(i,a),!1===cp(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&ap(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Ac(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,sp(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],op(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],op(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!ap(rp(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return lp(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];op(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r){return qd(t,e,n,r)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&Wd(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return Wd(t,e,n,r,o)},canApply:function(e){return function(t,e){var n,r,o,i,u,a=t.formatter.get(e),c=t.dom;if(a)for(n=t.selection.getStart(),r=Bl(c,n),i=a.length-1;i>=0;i--){if(!(u=a[i].selector)||a[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],u))return!0}return!1}(t,e)},closest:function(e){return function(t,e){var n=function(e){return Ne(e,Te(t.getBody()))};return x.from(t.selection.getStart(!0)).bind((function(r){return Ld(Te(r),(function(n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n]);if(r.isSome())return r}return x.none()}(e,(function(e){return function(e,n){return Wd(t,e.dom,n)?x.some(n):x.none()}(n,e)}))}),n)})).getOrNull()}(t,e)},apply:function(e,n,r){return Dh(t,e,n,r)},remove:function(e,n,r,o){return Nh(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!qd(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Dh(t,e,n,r):Nh(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o){return Ph(t,e,n,r,o)}},editor:{getContent:function(e,n){return function(t,e,n){return x.from(t.getBody()).fold(l("tree"===e.format?new Jd("body",11):""),(function(r){return function(t,e,n,r){var o;return e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),o="raw"===e.format?xe.trim(cm(t.serializer,r.innerHTML)):"text"===e.format?t.dom.isEmpty(r)?"":Wr(r.innerText||r.textContent):"tree"===e.format?t.serializer.serialize(r,e):function(t,e){var n=zc(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,e)),H(["text","tree"],e.format)||Fr(Te(r))?e.content=o:e.content=xe.trim(o),e.no_events||t.fire("GetContent",e),e.content}(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=$g(e)?"":e,n.no_events||t.fire("BeforeSetContent",n),$g(e)||(e=n.content),x.from(t.getBody()).fold(l(e),(function(r){return $g(e)?function(t,e,n,r){qg(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tm({validate:t.validate},t.schema).serialize(n);return r.content=Fr(Te(e))?o:xe.trim(o),Gg(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),(o=zc(t))&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,Dc(t),n)):n||(n='<br data-mce-bogus="1">'),Gg(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=tm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=Fr(Te(e))?n:xe.trim(n),Gg(t,r.content),r.no_events||t.fire("SetContent",r)),r.content}(t,r,e,n)}))}(t,e,n)},insertContent:function(e,n){return Ug(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=M(e)?e:t.getBody();N(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),j(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Zh(t,e,n)}},raw:{getModel:function(){return x.none()}}}},gp=function(t){return mt(t.plugins,"rtc")},hp=function(t){return t.rtcInstance?t.rtcInstance:mp(t)},pp=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},vp=function(t){return 0===t.dom.length?(ln(t),x.none()):x.some(t)},bp=function(t,e,n,r){t.bind((function(t){return(r?og:rg)(t.dom,r?t.dom.length:0),e.filter(Pe).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(ig(o,i,!1,!r),n.setStart(i,u)):(ig(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return yf.isBookmarkNode(t.dom)})).bind(e?We:Ue)}(e,r).or(e).filter(Pe).map((function(t){return function(t,e){je(t).each((function(n){var r=t.dom;e&&Km(n,cc(r,0))?rg(r,0):!e&&Ym(n,cc(r,r.length))&&og(r,r.length)}))}(t,r)}))}))},yp=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=W(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}},wp=function(t){return!!t.select},xp=function(t){return!(!t||!t.ownerDocument)&&Re(Te(t.ownerDocument),Te(t))},Cp=function(t,e,n,r){var o,i,u=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};xe.each(n,(function(e,n){xe.each(i,(function(o){if(t.is(o,n))return r[n]||(xe.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),xe.each(r,(function(t,e){u[e]||(delete r[e],xe.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){yp(n,o,i),yp(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return function(t,e,n){void 0===n&&(n={});var r=function(t,e){return St(St({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e);if(r.no_events||!(r=t.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,St(St({isRootContent:!0,forced_root_block:!1},o),e));return tm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,r);var o=t.selection.getRng();!function(t,e){var n=x.from(e.firstChild).map(Te),r=x.from(e.lastChild).map(Te);t.deleteContents(),t.insertNode(e);var o=n.bind(Ue).filter(Pe).bind(vp),i=r.bind(We).filter(Pe).bind(vp);bp(o,n,t,!0),bp(i,r,t,!1),t.collapse(!1)}(o,o.createContextualFragment(n.content)),t.selection.setRng(o),ud(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)}(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var l=e.document;if(null==l)return null;if(void 0!==r.bookmark&&!1===Nd(r)){var f=xd(r);if(f.isSome())return f.map((function(t){return Pd(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Sn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=Pd(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!wp(t)||xp(t.startContainer)&&xp(t.endContainer))}(t)){var u=wp(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||pe.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Sn(n)||Sn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(sf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return pp(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)}(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return x.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(sf(t,o,e,!0),sf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Bd(r.nextSibling,!0):r.parentNode,o=0===u?Bd(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return zd(r.getBody(),l(),t)},getEnd:function(t){return Dd(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||zd(u,e,e.collapsed),t.isBlock),r=t.getParent(r||Dd(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Ar(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(nf(n).length>1)&&lf(r)){var o=Pf(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?rd:id)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(Tf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?cc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=yf(m),h=kf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Sp=function(t,e){var n=di();e.convert_fonts_to_spans&&function(t,e,n){t.addNodeFilter("font",(function(t){j(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){j(["color","face","size"],(function(e){t.attr(e,null)}))}(t)}))}))}(t,n,xe.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){j(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},kp=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Op=function(t,e){var n;try{n=atob(e)}catch(t){return x.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return x.some(new Blob([r],{type:t}))},Tp=function(t){return 0===t.indexOf("blob:")?function(t){return new Cr((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===this.status?e(this.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new Cr((function(t){var n=kp(e),r=n.type,o=n.data;Op(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},_p=0,Ep=function(t){return(t||"blobid")+_p++};function Ap(t,e){var n={};return{findAll:function(r,o){o||(o=v);var i=W(function(t){return t?nt(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!pe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===pe.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),u=V(i,(function(t){if(void 0!==n[t.src])return new Cr((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Cr((function(n,r){!function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=kp(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){(function(t){return new Cr((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=kp(u).data,i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))}(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Cr.all(u)}}}var Np,Rp,Mp=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Jd("br",1)).shortEnded=!0:r.empty().append(new Jd("#text",3)).value=Vr},zp=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Dp=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Bp=xe.makeMap,Pp=xe.each,Ip=xe.explode,Lp=xe.extend,Hp=function(t,e){void 0===e&&(e=Go());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e,u,a;(u=t.name)in n&&((a=o[u])?a.push(t):o[u]=[t]),e=r.length;for(;e--;)(u=r[e].name)in t.attributes.map&&((a=i[u])?a.push(t):i[u]=[t]);return t},a={schema:e,addAttributeFilter:function(t,e){Pp(Ip(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Pp(Ip(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v,b=[];c=c||{},o={},i={};var y=Lp(Bp("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=e.getNonEmptyElements(),x=e.children,C=t.validate,S=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),k=e.getWhiteSpaceElements(),O=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,_=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;p=k.hasOwnProperty(c.context)||k.hasOwnProperty(t.root_name);var A=function(t,e){var r,i=new Jd(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){var n,r,o,i,u=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!u[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},R=um({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(A("#cdata",4)).value=t},text:function(t,e){var n;p||(t=t.replace(_," "),function(t,e){return t&&(e[t.name]||"br"===t.name)}(v.lastChild,y)&&(t=t.replace(O,""))),0!==t.length&&((n=A("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(A("#comment",8)).value=t},pi:function(t,e){v.append(A(t,7)).value=e,N(v)},doctype:function(t){v.append(A("#doctype",10)).value=t,N(v)},start:function(t,n,o){var u,a,c,s,l=C?e.getElementRule(t):{};if(l){for((u=A(l.outputName||t,1)).attributes=n,u.shortEnded=o,v.append(u),(s=x[v.name])&&x[u.name]&&!s[u.name]&&b.push(u),a=r.length;a--;)(c=r[a].name)in n.map&&((g=i[c])?g.push(u):i[c]=[u]);y[t]&&N(u),o||(v=u),!p&&k[t]&&(p=!0)}},end:function(n){var r,o,i,u,a=C?e.getElementRule(n):{};if(a){if(y[n]&&!p){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(O,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(p&&k[n]&&(p=!1),a.removeEmpty&&Dp(e,w,k,v))return u=v.parent,y[v.name]?v.empty().remove():v.unwrap(),void(v=u);a.paddEmpty&&(function(t){return zp(t,"#text")&&t.firstChild.value===Vr}(v)||Dp(e,w,k,v))&&Mp(t,c,y,v),v=v.parent}}},e),M=v=new Jd(c.context||t.root_name,11);if(R.parse(a,c.format),C&&b.length&&(c.context?c.invalid=!0:function(t){var n,r,o,i,a,c,s,l,f,d,m,g=Bp("tr,td,th,tbody,thead,tfoot,table"),h=e.getNonEmptyElements(),p=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if((r=t[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!g[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),a=c=u(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(c.name,i[f].name)?(s=u(i[f].clone()),c.append(s)):s=c,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,s.append(l),l=m;c=s}Dp(e,h,p,a)?o.insert(r,i[0],!0):(o.insert(a,i[0],!0),o.insert(r,a)),o=i[0],(Dp(e,h,p,o)||zp(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ol"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ol"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(u(new Jd("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(u(new Jd("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}}(b)),S&&("body"===M.name||c.isRootContent)&&function(){var n,r,o=M.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(O,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(e.isValidChild(M.name,S.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=A(S,1)).attr(t.forced_root_block_attrs),M.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!c.invalid){for(h in o)if(o.hasOwnProperty(h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return M}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=xe.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Dp(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&Mp(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new Jd("#text",3)).value=Vr,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(void 0,r=(n=i.attr("rel"))?xe.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Jd("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e,r,o,i,u,a,c,s=t.length,l=n.getValidClasses();s--;){for(r=(e=t[s]).attr("class").split(" "),u="",o=0;o<r.length;o++)i=r[o],c=!1,(a=l["*"])&&a[i]&&(c=!0),a=l[e.name],!c&&a&&a[i]&&(c=!0),c&&(u&&(u+=" "),u+=i);u.length||(u=null),e.attr("class",u)}})),function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(function(t){return t.attr("src")===pe.transparentSrc||t.attr("data-mce-placeholder")})(t)||function(t){return t.attr("data-mce-bogus")}(t)||(r=i,o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r),o?x.some({type:o[1],data:decodeURIComponent(o[2])}):x.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),it(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return x.from(n.getByData(r,e)).orThunk((function(){return Op(e,r).map((function(t){var e=n.create(Ep(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return j(t,r)}))}(t,e)}(a,t),function(t,e){e.inline_styles&&Sp(t,e)}(a,t),a},Fp=function(t,e,n){-1===xe.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},Vp=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Qu.DOM,o=e&&e.schema?e.schema:Go(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=Hp(t,o);return function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o,i,u=t.length,a="data-mce-"+r,c=e.url_converter,s=e.url_converter_scope;u--;)void 0!==(i=(o=t[u]).attr(a))?(o.attr(r,i.length>0?i:null),o.attr(a,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))})),t.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r,o=t.length;o--;)"bookmark"!==(r=t[o]).attr("data-mce-type")||n.cleanup||(x.from(r.firstChild).exists((function(t){return!Ur(t.value)}))?r.unwrap():r.remove())})),t.addNodeFilter("noscript",(function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=Io.decode(e.value))})),t.addNodeFilter("script,style",(function(t,n){for(var r,o,i,u=t.length,a=function(t){return t.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,"")};u--;)o=(r=t[u]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+a(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+a(o)+"\n--\x3e")})),t.addNodeFilter("#comment",(function(t){for(var r,o=t.length;o--;)r=t[o],e.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),t.addAttributeFilter("data-mce-type",(function(e){j(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r),{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=St({format:"html"},u),c=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o,i=t.dom;e=e.cloneNode(!0);var u=document.implementation;return u.createHTMLDocument&&(r=u.createHTMLDocument(""),xe.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){r.body.appendChild(r.importNode(t,!0))})),e="BODY"!==e.nodeName?r.body.firstChild:r.body,o=i.doc,i.doc=r),function(t,e){t.fire("PreProcess",e)}(t,St(St({},n),{node:e})),o&&(i.doc=o),e}(t,e,n):e}(e,n,a),s=function(t,e,n){var r=Wr(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||Fr(Te(e))?r:xe.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?St({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,St(St({},e),{content:n})).content:n}(t,o,function(t,e,n){return tm(t,e).serialize(n)}(e,n,r))}(e,t,o,l,a)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:d(Fp,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},jp=function(t,e){var n=Vp(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Up=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return hp(t).editor.setContent(e,n)}(t,e,n)},Wp=Qu.DOM,qp=function(t){return x.from(t).each((function(t){return t.destroy()}))},$p=Object.prototype.hasOwnProperty,Gp=(Np=function(t,e){return T(t)&&T(e)?Gp(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)$p.call(o,i)&&(n[i]=Np(n[i],o[i]))}return n}),Xp=ae().deviceType,Kp=Xp.isTouch(),Yp=Xp.isPhone(),Jp=Xp.isTablet(),Qp=["lists","autolink","autosave"],Zp={table_grid:!1,object_resizing:!1,resize:!1},tv=function(t){var e=_(t)?t.join(" "):t,n=V(O(e)?e.split(" "):[],zt);return W(n,(function(t){return t.length>0}))},ev=function(t,e){return t.sections().hasOwnProperty(e)},nv=function(t,e){return dt(t,"toolbar_mode").orThunk((function(){return dt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},rv=function(t,e){var n={resize:!1,toolbar_mode:nv(t,"scrolling"),toolbar_sticky:!1};return St(St(St({},Zp),n),e?{menubar:!1}:{})},ov=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?xe.extend({},t.external_plugins,n):n},iv=function(t,e,n,r){var o=tv(n.forced_plugins),i=tv(r.plugins),u=function(t,e){return ev(t,e)?t.sections()[e]:{}}(e,"mobile"),a=function(t,e){return[].concat(tv(t)).concat(tv(e))}(o,function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return ev(t,e)&&"mobile"===r[e].theme}(e,"mobile")?W(r,d(H,Qp)):t&&ev(e,"mobile")?r:n}(t,e,i,u.plugins?tv(u.plugins):i));if(pe.browser.isIE()&&H(a,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return xe.extend(r,{plugins:a.join(" ")})},uv=function(t,e,n,r,o){var i=t?{mobile:rv(o.mobile||{},e)}:{},u=function(t,e){var n=lt(e,(function(e,n){return H(t,n)}));return function(t,e){return{sections:l(t),settings:l(e)}}(n.t,n.f)}(["mobile"],Gp(i,o)),a=xe.extend(n,r,u.settings(),function(t,e){return t&&ev(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return xe.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:ov(r,u.settings())});return iv(t,u,r,a)},av=function(t,e,n){return x.from(e.settings[n]).filter(t)},cv=(Rp={},{add:function(t,e){Rp[t]=e},get:function(t){return Rp[t]?Rp[t]:{icons:{}}},has:function(t){return mt(Rp,t)}}),sv=function(t,e){return e.dom[t]},lv=function(t,e){return parseInt(Kn(e,t),10)},fv=d(sv,"clientWidth"),dv=d(sv,"clientHeight"),mv=d(lv,"margin-top"),gv=d(lv,"margin-left"),hv=function(t,e,n){var r=Te(t.getBody()),o=t.inline?r:Te(Fe(r).dom.documentElement),i=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+gv(e):0),y:r-(t?o.top+e.dom.clientTop+mv(e):0)}}(t.inline,o,e,n);return function(t,e,n){var r=fv(t),o=dv(t);return e>=0&&n>=0&&e<=r&&n<=o}(o,i.x,i.y)};function pv(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return x.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){X(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&function(t){var e;return(e=t.inline?t.getBody():t.getContentAreaContainer(),x.from(e).map(Te)).map(dn).getOr(!1)}(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),G(e,(function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(u,(function(){i(a),o(),r().fold((function(){return t.focus()}),(function(t){return Te(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",St({},a)),a}))};return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1)})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Tr.requestAnimationFrame(o)})),t.on("remove",(function(){j(e.slice(),(function(t){n().close(t)}))}))}(t),{open:u,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:function(){return e}}}var vv=sa.PluginManager,bv=sa.ThemeManager,yv=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=W(e,(function(t){return t!==n}))).length&&t.focus()},i=function(n){t.editorManager.setActive(t),wd(t);var r=n();return function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)}(r),r};return t.on("remove",(function(){j(e,(function(t){n().close(t)}))})),{open:function(t,e){return i((function(){return n().open(t,e,o)}))},openUrl:function(t){return i((function(){return n().openUrl(t,o)}))},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){x.from(e[e.length-1]).each((function(t){n().close(t),o(t)}))}}},wv=function(t,e){t.notificationManager.open({type:"error",text:e})},xv=function(t,e){t._skinLoaded?wv(t,e):t.on("SkinLoaded",(function(){wv(t,e)}))},Cv=function(t,e,n){!function(t,e,n){t.fire(e,n)}(t,e,{message:n}),console.error(n)},Sv=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},kv=function(t,e,n){Cv(t,"PluginLoadError",Sv("plugin",e,n))},Ov=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,kt([t],e)):r.log.apply(r,kt([t],e)))};function Tv(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);u&&"string"==typeof u.location?n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o)):r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){xe.each(n[t],(function(t){t(e)})),delete n[t]};return!1===z(e.handler)&&(e.handler=r),{upload:function(a,c){return e.url||e.handler!==r?function(r,a){return r=xe.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Cr.all(xe.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Cr((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new Cr((function(a){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||(c||(c=r()),c.progressBar.value(t))}))}catch(t){a(i(e,t.message,{}))}}))}(r,e.handler,a)})))}(a,c):new Cr((function(t){t([])}))}}}var _v=0,Ev=function(t){return t+_v+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e};var Av,Nv=xe.each,Rv=Qu.DOM,Mv=function(t,e){var n,r,o,i=e&&e.schema||Go({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Rv.create(r.name);return function(t,e){e.classes.length&&Rv.addClass(t,e.classes.join(" ")),Rv.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==xe.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Rv.create("div")).appendChild(t),xe.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Rv.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},zv=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=xe.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==xe.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},Dv=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return O(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=dt(e,"preview");if(c.is(!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),xe.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=xe.map(t.split(/(?:~\+|~|\+)/),zv),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Mv(l,t)):r=Mv([n],t);var f=Rv.select(n,r)[0]||r.firstChild;return Nv(e.styles,(function(t,e){var n=a(t);n&&Rv.setStyle(f,e,n)})),Nv(e.attributes,(function(t,e){var n=a(t);n&&Rv.setAttrib(f,e,n)})),Nv(e.classes,(function(t){var e=a(t);Rv.hasClass(f,e)||Rv.addClass(f,e)})),t.fire("PreviewFormats"),Rv.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Rv.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Nv(u.split(" "),(function(e){var n=Rv.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Rv.getStyle(t.getBody(),e,!0),"#ffffff"===Rv.toHex(n).toLowerCase())||"color"===e&&"#000000"===Rv.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Rv.remove(r),i},Bv=function(t){var e=function(t){var e={},n=function(t,r){t&&("string"!=typeof t?xe.each(t,(function(t,e){n(e,t)})):(_(r)||(r=[r]),xe.each(r,(function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),e[t]=r))};return n(function(t){var e={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",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",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"}],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",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",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:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],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",defaultBlock:"p",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:function(t,e,n){return kn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){xe.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 xe.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return t?e[t]:e},has:function(t){return mt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}}(t),n=ra(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();eh(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Kg||eh(t,fl(r,n.getStart())),37!==e&&39!==e||eh(t,fl(r,n.getStart()))}(t,e.keyCode)}))}(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){pp(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){pp(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){pp(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r){return function(t,e,n,r){return pp(t).formatter.match(e,n,r)}(t,e,n,r)},closest:function(e){return function(t,e){return pp(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return pp(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return pp(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return pp(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o){return function(t,e,n,r,o){return void 0===o&&(o=!1),pp(t).formatter.formatChanged(e,n,r,o)}(t,n,e,r,o)},getCssText:d(Dv,t)}},Pv=function(t){var e=ra(x.none()),n=ra(0),r=ra(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){pp(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return pp(t).undoManager.addUndoLevel(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return pp(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return pp(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){pp(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){pp(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return pp(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return pp(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return pp(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){pp(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){pp(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return gp(t)||function(t,e,n){var r=ra(!1),o=function(t){sp(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(lp(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===ap(rp(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),sp(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Iv=[9,27,Cf.HOME,Cf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Cf.DOWN,Cf.UP,Cf.LEFT,Cf.RIGHT].concat(pe.browser.isFirefox()?[224]:[]),Lv="data-mce-placeholder",Hv=function(t){return"keydown"===t.type||"keyup"===t.type},Fv=function(t){var e=t.keyCode;return e===Cf.BACKSPACE||e===Cf.DELETE},Vv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,jv=function(t,e){return Ee(Te(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Uv=function(t,e,n){var r=function(t,e,n){return W(Qu.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return x.from(r[r.length-1])},Wv=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Xr(n)?Mn(n.nextSibling)?cc(n.nextSibling,0):cc.after(n):Jr(e)?cc(n,r+1):e:Xr(n)?Mn(n.previousSibling)?cc(n.previousSibling,n.previousSibling.data.length):cc.before(n):Qr(e)?cc(n,r-1):e},qv=d(Wv,!0),$v=d(Wv,!1),Gv=function(t,e){return Re(t,e)?br(e,(function(t){return Br(t)||Ir(t)}),function(t){return function(e){return Ne(t,Te(e.dom.parentNode))}}(t)):x.none()},Xv=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Kv=function(t,e){return{from:t,to:e}},Yv=function(t,e){var n=Te(t),r=Te(e.container());return Gv(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},Jv=function(t){var e=Ge(t);return X(e,Mr).fold((function(){return e}),(function(t){return e.slice(0,t)}))},Qv=function(t){var e=Jv(t);return j(e,ln),e},Zv=function(t,e){var n=Am(e,t);return G(n.reverse(),(function(t){return wo(t)})).each(ln)},tb=function(t,e,n,r){if(wo(n))return Tm(n),al(n.dom);0===W(qe(r),(function(t){return!wo(t)})).length&&wo(e)&&rn(r,ke("br"));var o=ul(n.dom,cc.before(r.dom));return j(Qv(e),(function(t){rn(r,t)})),Zv(t,e),o},eb=function(t,e,n){if(wo(n))return ln(n),wo(e)&&Tm(e),al(e.dom);var r=cl(n.dom);return j(Qv(e),(function(t){an(n,t)})),Zv(t,e),r},nb=function(t,e){ol(t,e.dom).map((function(t){return t.getNode()})).map(Te).filter(Dr).each(ln)},rb=function(t,e,n){return nb(!0,e),nb(!1,n),function(t,e){return Re(e,t)?function(t,e){var n=Am(e,t);return x.from(n[n.length-1])}(e,t):x.none()}(e,n).fold(d(eb,t,e,n),d(tb,t,e,n))},ob=function(t,e,n,r){return e?rb(t,r,n):rb(t,n,r)},ib=function(t,e){var n=Te(t.getBody()),r=function(t,e,n){return n.collapsed?function(t,e,n){var r=Yv(t,cc.fromRangeStart(n)),o=r.bind((function(n){return el(e,t,n.position).bind((function(n){return Yv(t,n).map((function(n){return function(t,e,n){return Pn(n.position.getNode())&&!1===wo(n.block)?ol(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?el(e,t,r).bind((function(e){return Yv(t,e)})):x.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Ra(r,o,Kv).filter((function(t){return function(t){return!1===Ne(t.from.block,t.to.block)}(t)&&function(t){return je(t.from.block).bind((function(e){return je(t.to.block).filter((function(t){return Ne(e,t)}))})).isSome()}(t)&&function(t){return!1===Hn(t.from.block.dom)&&!1===Hn(t.to.block.dom)}(t)}))}(t,e,n):x.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ob(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},ub=function(t,e){var n=Te(e),r=d(Ne,t);return vr(n,Hr,r).isSome()},ab=function(t){var e=Te(t.getBody());return function(t,e){var n=ul(t.dom,cc.fromRangeStart(e)).isNone(),r=il(t.dom,cc.fromRangeEnd(e)).isNone();return!function(t,e){return ub(t,e.startContainer)||ub(t,e.endContainer)}(t,e)&&n&&r}(e,t.selection.getRng())?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ra(Gv(t,Te(n.startContainer)),Gv(t,Te(n.endContainer)),(function(r,o){return!1===Ne(r,o)&&(n.deleteContents(),ob(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},cb=function(t,e){return!t.selection.isCollapsed()&&ab(t)},sb=Ln,lb=Hn,fb=function(t,e,n,r,o){return x.from(e._selectionOverrides.showCaret(t,n,r,o))},db=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?x.none():x.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},mb=function(t,e,n){var r=Bs(1,t.getBody(),e),o=cc.fromRangeStart(r),i=o.getNode();if(gs(i))return fb(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(gs(u))return fb(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return lb(t)||sb(t)}));return gs(a)?fb(1,t,a,!1,n):x.none()},gb=function(t,e,n){return e.collapsed?mb(t,e,n).getOr(e):e},hb=function(t){return km(t)||wm(t)},pb=function(t){return Om(t)||xm(t)},vb=function(t,e,n,r,o,i){return fb(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},bb=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Mn(n.commonAncestorContainer))return!1;var r=e?ac.Forwards:ac.Backwards,o=Js(t.getBody()),i=d(Hs,e?o.next:o.prev),u=e?hb:pb,a=Is(r,t.getBody(),n),c=Wv(e,i(a));if(!c||!Fs(a,c))return!1;if(u(c))return vb(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Fs(c,s))&&vb(t,n,a.getNode(),r,e,s)}(t,e)},yb=mr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),wb=function(t,e,n){return el(e,t,n).bind((function(r){return o=r.getNode(),Hr(Te(o))||Ir(Te(o))||function(t,e,n,r){var o=function(e){return zr(Te(e))&&!Es(n,r,t)};return Ps(!e,n).fold((function(){return Ps(e,r).fold(p,o)}),o)}(t,e,n,r)?x.none():e&&Hn(r.getNode())||!1===e&&Hn(r.getNode(!0))?function(t,e,n,r){var o=r.getNode(!1===e);return Gv(Te(t),Te(n.getNode())).map((function(t){return wo(t)?yb.remove(t.dom):yb.moveToElement(o)})).orThunk((function(){return x.some(yb.moveToElement(o))}))}(t,e,n,r):e&&Om(n)||!1===e&&km(n)?x.some(yb.moveToPosition(r)):x.none();var o}))},xb=function(t,e){return x.from(wf(t.getBody(),e))},Cb=function(t,e){var n=t.selection.getNode();return xb(t,n).filter(Hn).fold((function(){return function(t,e,n){var r=Bs(e?1:-1,t,n),o=cc.fromRangeStart(r),i=Te(t);return!1===e&&Om(o)?x.some(yb.remove(o.getNode(!0))):e&&km(o)?x.some(yb.remove(o.getNode())):!1===e&&km(o)&&Vm(i,o)?jm(i,o).map((function(t){return yb.remove(t.getNode())})):e&&Om(o)&&Fm(i,o)?Um(i,o).map((function(t){return yb.remove(t.getNode())})):function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return kn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Hn(e.nextSibling)?x.some(yb.moveToElement(e.nextSibling)):!1===t&&Hn(e.previousSibling)?x.some(yb.moveToElement(e.previousSibling)):x.none()}(e,n.getNode(!1===e)).fold((function(){return wb(t,e,n)}),x.some):wb(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return x.some(yb.remove(t))}),(function(t){return x.some(yb.moveToElement(t))}),(function(n){return Es(e,n,t)?x.none():x.some(yb.moveToPosition(n))}))}(t,n,e)}))}(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0}}(t,e),function(t,e){return function(n){var r=e?cc.before(n):cc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),v)},Sb=function(t){var e=t.dom,n=t.selection,r=wf(t.getBody(),n.getNode());if(Ln(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(cc.before(o).toRange())}return!0},kb=function(t,e){return t.selection.isCollapsed()?Cb(t,e):function(t,e){var n=t.selection.getNode();return!!Hn(n)&&xb(t,n.parentNode).filter(Hn).fold((function(){var n;return n=Te(t.getBody()),j(va(n,".mce-offscreen-selection"),ln),mg(t,e,Te(t.selection.getNode())),Xv(t),!0}),(function(){return!0}))}(t,e)},Ob=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return el(e,t.getBody(),n).filter((function(t){return e?bm(t):ym(t)})).bind((function(t){return x.from(As(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Tb=Mn,_b=function(t){return Tb(t)&&t.data[0]===jr},Eb=function(t){return Tb(t)&&t.data[t.data.length-1]===jr},Ab=function(t){return t.ownerDocument.createTextNode(jr)},Nb=function(t,e){return t?function(t){if(Tb(t.previousSibling))return Eb(t.previousSibling)||t.previousSibling.appendData(jr),t.previousSibling;if(Tb(t))return _b(t)||t.insertData(0,jr),t;var e=Ab(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Tb(t.nextSibling))return _b(t.nextSibling)||t.nextSibling.insertData(0,jr),t.nextSibling;if(Tb(t))return Eb(t)||t.appendData(jr),t;var e=Ab(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Rb=d(Nb,!0),Mb=d(Nb,!1),zb=function(t,e){return Mn(t.container())?Nb(e,t.container()):Nb(e,t.getNode())},Db=function(t,e){var n=e.get();return n&&t.container()===n&&Xr(n)},Bb=function(t,e){return e.fold((function(e){us(t.get());var n=Rb(e);return t.set(n),x.some(cc(n,n.length-1))}),(function(e){return al(e).map((function(e){if(Db(e,t))return cc(t.get(),1);us(t.get());var n=zb(e,!0);return t.set(n),cc(n,1)}))}),(function(e){return cl(e).map((function(e){if(Db(e,t))return cc(t.get(),t.get().length-1);us(t.get());var n=zb(e,!1);return t.set(n),cc(n,n.length-1)}))}),(function(e){us(t.get());var n=Mb(e);return t.set(n),x.some(cc(n,1))}))},Pb=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return x.none()},Ib=mr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Lb=function(t,e){return _s(e,t)||t},Hb=function(t,e,n){var r=qv(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return il(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.before(t)}))}),x.none)},Fb=function(t,e){return null===fl(t,e)},Vb=function(t,e,n){return Uv(t,e,n).filter(d(Fb,e))},jb=function(t,e,n){var r=$v(n);return Vb(t,e,r).bind((function(t){return ul(t,r).isNone()?x.some(Ib.start(t)):x.none()}))},Ub=function(t,e,n){var r=qv(n);return Vb(t,e,r).bind((function(t){return il(t,r).isNone()?x.some(Ib.end(t)):x.none()}))},Wb=function(t,e,n){var r=$v(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return ul(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.after(t)}))}),x.none)},qb=function(t){return!1===(e=Gb(t),"rtl"===Qu.DOM.getStyle(e,"direction",!0)||(n=e.textContent,Vv.test(n)));var e,n},$b=function(t,e,n){return Pb([Hb,jb,Ub,Wb],[t,e,n]).filter(qb)},Gb=function(t){return t.fold(f,f,f,f)},Xb=function(t){return t.fold(l("before"),l("start"),l("end"),l("after"))},Kb=function(t){return t.fold(Ib.before,Ib.before,Ib.after,Ib.after)},Yb=function(t){return t.fold(Ib.start,Ib.start,Ib.end,Ib.end)},Jb=function(t,e,n,r,o,i){return Ra(Uv(e,n,r),Uv(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=_s(e,t),o=_s(n,t);return r&&r===o}(n,e,r)?Ib.after(t?e:r):i})).getOr(i)},Qb=function(t,e){return t.fold(v,(function(t){return r=e,!(Xb(n=t)===Xb(r)&&Gb(n)===Gb(r));var n,r}))},Zb=function(t,e){return t?e.fold(s(x.some,Ib.start),x.none,s(x.some,Ib.after),x.none):e.fold(x.none,s(x.some,Ib.before),x.none,s(x.some,Ib.end))},ty=function(t,e,n,r){var o=Wv(t,r),i=$b(e,n,o);return $b(e,n,o).bind(d(Zb,t)).orThunk((function(){return function(t,e,n,r,o){var i=Wv(t,o);return el(t,n,i).map(d(Wv,t)).fold((function(){return r.map(Kb)}),(function(o){return $b(e,n,o).map(d(Jb,t,e,n,i,o)).filter(d(Qb,r))})).filter(qb)}(t,e,n,i,r)}))},ey=(d(ty,!1),d(ty,!0),function(t,e,n){var r=t?1:-1;return e.setRng(cc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0}),ny=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},ry=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},oy=function(t,e,n){return Bb(e,n).map((function(e){return ny(t,e),n}))},iy=function(t,e,n){return!!Yc(t)&&function(t,e,n){var r=t.getBody(),o=cc.fromRangeStart(t.selection.getRng()),i=d(jv,t);return ty(n,i,r,o).bind((function(n){return oy(t,e,n)}))}(t,e,n).isSome()},uy=function(t,e,n){return!!Yc(e)&&function(t,e){var n=e.selection.getRng(),r=t?cc.fromRangeEnd(n):cc.fromRangeStart(n);return!!function(t){return z(t.selection.getSel().modify)}(e)&&(t&&Jr(r)?ey(!0,e.selection,r):!(t||!Qr(r))&&ey(!1,e.selection,r))}(t,e)},ay=function(t){var e=ra(null),n=d(jv,t);return t.on("NodeChange",(function(r){!Yc(t)||pe.browser.isIE()&&r.initial||(function(t,e,n){var r=V(va(Te(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=W(r,t),i=W(n,t);j(Q(o,i),d(ry,!1)),j(Q(i,o),d(ry,!0))}(n,t.dom,r.parents),function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=cc.fromRangeStart(t.selection.getRng());cc.isTextPosition(n)&&!1===function(t){return Jr(t)||Qr(t)}(n)&&(ny(t,is(e.get(),n)),e.set(null))}}(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=W(r,t);j(o,(function(r){var o=cc.fromRangeStart(e.selection.getRng());$b(t,e.getBody(),o).bind((function(t){return oy(e,n,t)}))}))}}(n,t,e,r.parents))})),e},cy=d(uy,!0),sy=d(uy,!1),ly=function(t,e){return function(n){return Bb(e,n).exists((function(e){return ny(t,e),!0}))}},fy=function(t,e,n,r){var o=t.getBody(),i=d(jv,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),$b(i,o,cc.fromRangeStart(t.selection.getRng())).map(Yb).map(ly(t,e))})),t.nodeChanged()},dy=function(t,e,n){if(t.selection.isCollapsed()&&Yc(t)){var r=cc.fromRangeStart(t.selection.getRng());return function(t,e,n,r){var o=function(t,e){return _s(e,t)||t}(t.getBody(),r.container()),i=d(jv,t),u=$b(i,o,r);return u.bind((function(t){return n?t.fold(l(x.some(Yb(t))),x.none,l(x.some(Kb(t))),x.none):t.fold(x.none,l(x.some(Kb(t))),x.none,l(x.some(Yb(t))))})).map(ly(t,e)).getOrThunk((function(){var a=nl(n,o,r),c=a.bind((function(t){return $b(i,o,t)}));return Ra(u,c,(function(){return Uv(i,o,r).exists((function(e){return!!function(t){return Ra(al(t),cl(t),(function(e,n){var r=Wv(!0,e),o=Wv(!1,n);return il(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(mg(t,n,Te(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?fy(t,e,r,o):fy(t,e,o,r),!0}))}))})).getOr(!1)}))}(t,e,n,r)}return!1},my=function(t){return 1===Ge(t).length},gy=function(t,e){var n=Te(t.getBody()),r=Te(t.selection.getStart()),o=W(function(t,e){var n=Am(e,t);return X(n,Mr).fold(l(n),(function(t){return n.slice(0,t)}))}(n,r),my);return et(o).exists((function(n){var r,i=cc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ra(al(n),cl(n),(function(r,o){var i=Wv(!0,r),u=Wv(!1,o),a=Wv(!1,e);return t?il(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):ul(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,ll(r.dom)&&Jg(r.dom))||(function(t,e,n,r){var o=d(ih,e),i=V(W(r,o),(function(t){return t.dom}));if(0===i.length)mg(e,t,n);else{var u=function(t,e){var n=Zg(!1),r=rh(e,n.dom);return rn(Te(t),n),ln(Te(t)),cc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}}(e,t,n,o),0))}))},hy=function(t,e){return!!t.selection.isCollapsed()&&gy(t,e)},py=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0},vy=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?wm:xm,r=e?ac.Forwards:ac.Backwards,o=Is(r,t.getBody(),t.selection.getRng());return n(o)?py(t,e,o.getNode(!e)):x.from(Wv(e,o)).filter((function(t){return n(t)&&Fs(o,t)})).exists((function(n){return py(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Vn(n)&&py(t,e,n)}(t,e)},by=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},yy=function(t,e){return(t||"table"===Me(e)?"margin":"padding")+("rtl"===Kn(e,"direction")?"-right":"-left")},wy=function(t){var e=Cy(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return Y(e,(function(e){var n=yy(qc(t),e),r=Jn(e,n).map(by).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},xy=function(t){return Pr(t)||Ir(t)},Cy=function(t){return W(V(t.selection.getSelectedBlocks(),Te),(function(t){return!xy(t)&&!function(t){return je(t).map(xy).getOr(!1)}(t)&&br(t,(function(t){return Ln(t.dom)||Hn(t.dom)})).exists((function(t){return Ln(t.dom)}))}))},Sy=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=qc(t),s=zc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),j(Cy(t),(function(t){!function(t,e,n,r,o,i){var u=yy(n,Te(i));if("outdent"===e){var a=Math.max(0,by(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else a=by(i.style[u])+r+o,t.setStyle(i,u,a)}(n,e,c,a,u,t.dom)}))},ky=function(t,e){if(t.selection.isCollapsed()&&wy(t)){var n=t.dom,r=t.selection.getRng(),o=cc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dm(Te(i),o))return Sy(t,"outdent"),!0}return!1},Oy=function(t,e){t.getDoc().execCommand(e,!1,null)},Ty=function(t){return void 0===t.touches||1!==t.touches.length?x.none():x.some(t.touches[0])},_y=function(t,e){return t.hasOwnProperty(e.nodeName)},Ey=function(t,e){return!!Mn(e)||!!kn(e)&&!_y(t,e)&&!wl(e)},Ay=function(t,e){if(Mn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||_y(t,e.nextSibling)))return!0}return!1},Ny=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=zc(t);if(c&&kn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return F(Em(Te(n),Te(e)),(function(e){return _y(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=Nd(t);for(c=s.firstChild;c;)if(Ey(a,c)){if(Ay(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,Dc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},Ry=function(t,e){e.hasAttribute("data-mce-caret")&&(eo(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},My=function(t,e){var n=function(t){return wr(Te(t.getBody()),"*[data-mce-caret]").fold(l(null),(function(t){return t.dom}))}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Ry(t,n)):void(Yr(n)&&(Ry(t,n),t.undoManager.add()))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(Av||(Av={}));var zy,Dy=function(t,e){return t===ac.Backwards?J(e):e},By=function(t,e,n){return t===ac.Forwards?e.next(n):e.prev(n)},Py=function(t,e,n,r){return Pn(r.getNode(e===ac.Forwards))?Av.Br:!1===Es(n,r)?Av.Block:Av.Wrap},Iy=function(t,e,n,r){for(var o,i=Js(n),u=r,a=[];u&&(o=By(e,i,u));){if(Pn(o.getNode(!1)))return e===ac.Forwards?{positions:Dy(e,a).concat([o]),breakType:Av.Br,breakAt:x.some(o)}:{positions:Dy(e,a),breakType:Av.Br,breakAt:x.some(o)};if(o.isVisible()){if(t(u,o)){var c=Py(0,e,u,o);return{positions:Dy(e,a),breakType:c,breakAt:x.some(o)}}a.push(o),u=o}else u=o}return{positions:Dy(e,a),breakType:Av.Eol,breakAt:x.none()}},Ly=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===ac.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Hy=function(t,e){return $(t,(function(t,n){return t.fold((function(){return x.some(n)}),(function(r){return Ra(tt(r.getClientRects()),tt(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),x.none())},Fy=function(t,e){return tt(e.getClientRects()).bind((function(e){return Hy(t,e.left)}))},Vy=d(Iy,uc.isAbove,-1),jy=d(Iy,uc.isBelow,1),Uy=d(Ly,-1,Vy),Wy=d(Ly,1,jy),qy=function(t){var e=function(e){return V(e,(function(e){return(e=za(e)).node=t,e}))};if(kn(t))return e(t.getClientRects());if(Mn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},$y=function(t){return K(t,qy)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(zy||(zy={}));var Gy,Xy,Ky=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i,c,l;for(l=$y([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(c=l[i],!n(c,s)){if(a.length>0&&e(c,Ct(a))&&u++,c.line=u,o(c))return!0;a.push(c)}},s=Ct(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Ts(r,t,mo,e);)if(n(r))return}(t,r,c,l),a},Yy=d(Ky,zy.Up,Pa,Ia),Jy=d(Ky,zy.Down,Ia,Pa),Qy=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Zy=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},tw=Hn,ew=Ts,nw=function(t,e){return Math.abs(t.left-e)},rw=function(t,e){return Math.abs(t.right-e)},ow=function(t,e){return t>=e.left&&t<=e.right},iw=function(t,e){return t>=e.top&&t<=e.bottom},uw=function(t,e){return wt(t,(function(t,n){var r=Math.min(nw(t,e),rw(t,e)),o=Math.min(nw(n,e),rw(n,e));return ow(e,n)?n:ow(e,t)?t:o===r&&tw(n.node)||o<r?n:t}))},aw=function(t,e,n,r,o){var i=ew(r,t,mo,e,!o);do{if(!i||n(i))return}while(i=ew(i,t,mo,e))},cw=function(t,e){t.selection.setRng(e),ud(t,t.selection.getRng())},sw=function(t,e,n){return x.some(gb(t,e,n))},lw=function(t,e,n,r,o,i){var u=e===ac.Forwards,a=Js(t.getBody()),c=d(Hs,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Ha(n);if(i(l))return fb(e,t,l,e===ac.Backwards,!1)}var f=Is(e,t.getBody(),n);if(s(f))return db(t,f.getNode(!u));var m=Wv(u,c(f)),g=function(t){return Gr(t.startContainer)}(n);if(!m)return g?x.some(n):x.none();if(s(m))return fb(e,t,m.getNode(!u),u,!1);var h=c(m);return h&&s(h)&&Fs(m,h)?fb(e,t,h.getNode(!u),u,!1):g?sw(t,m.toRange(),!1):x.none()},fw=function(t,e,n,r,o,i){var u=Is(e,t.getBody(),n),a=Ct(u.getClientRects()),c=e===zy.Down;if(!a)return x.none();var s,l=(c?Jy:Yy)(t.getBody(),Qy(1),u),f=W(l,Zy(1)),d=a.left,m=uw(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return fb(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Ha(n)){var p=function(t,e,n,r){var o,i,u,a,c,s=Js(e),l=[],f=0,d=function(t){return Ct(t.getClientRects())};1===t?(o=s.next,i=Ia,u=Pa,a=cc.after(r)):(o=s.prev,i=Pa,u=Ia,a=cc.before(r));var m=d(a);do{if(a.isVisible()&&!u(c=d(a),m)){if(l.length>0&&i(c,Ct(l))&&f++,(c=za(c)).position=a,c.line=f,n(c))return l;l.push(c)}}while(a=o(a));return l}(e,t.getBody(),Qy(1),s),v=uw(W(p,Zy(1)),d);if(v)return sw(t,v.position.toRange(),!1);if(v=Ct(W(p,Zy(0))))return sw(t,v.position.toRange(),!1)}return 0===f.length?dw(t,c).filter(c?o:r).map((function(e){return gb(t,e.toRange(),!1)})):x.none()},dw=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=cc.fromRangeEnd(n),i=jy(r,o);return et(i.positions)}return o=cc.fromRangeStart(n),i=Vy(r,o),tt(i.positions)},mw=function(t,e,n){return dw(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},gw=Hn,hw=function(t,e,n){var r=Js(t.getBody()),o=d(Hs,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==zc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(cc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(zc(t));return(!pe.ie||pe.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},pw=function(t,e){return function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return function(t,e,n){return lw(e,t,n,km,Om,gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},vw=function(t,e){return function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return fw(e,t,n,(function(t){return km(t)||Cm(t)}),(function(t){return Om(t)||Sm(t)}),gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},bw=function(t,e){return mw(t,e,e?Om:km)},yw=function(t){return H(["figcaption"],Me(t))},ww=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},xw=function(t,e,n){n?an(t,e):un(t,e)},Cw=function(t,e){var n=Te(t.getBody()),r=cc.fromRangeStart(t.selection.getRng()),o=zc(t),i=Dc(t);return function(t,e){var n=d(Ne,e);return br(Te(t.container()),Mr,n).filter(yw)}(r,n).exists((function(){if(function(t,e,n){return e?function(t,e){return jy(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Vy(t,e).breakAt.isNone()}(t.dom,n)}(n,e,r)){var u=function(t,e,n,r){return""===e?function(t,e){var n=ke("br");return xw(t,n,e),ww(n)}(t,r):function(t,e,n,r){var o=ke(n),i=ke("br");return qn(o,r),an(o,i),xw(t,o,e),ww(i)}(t,r,e,n)}(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},Sw=function(t,e){return!!t.selection.isCollapsed()&&Cw(t,e)},kw=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},Ow=function(t,e){return G(function(t,e){return K(function(t){return V(t,(function(t){return St({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:c},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))}(t,e),(function(t){return t.action()}))},Tw=function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return lw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},_w=function(t,e){var n=e?1:-1,r=t.selection.getRng();return fw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},Ew=function(t,e){return mw(t,e,e?xm:wm)},Aw=function(t,e,n,r,o){var i=va(Te(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return $(t,(function(t,r){return t.fold((function(){return x.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return x.some(i<o?r:t)}))}),x.none())}(W(function(t,e){return K(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+-2,bottom:t.bottom+-2,width:t.width+e,height:t.height+e}}(za(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},Nw=d(Aw,(function(t){return t.bottom}),(function(t,e){return t.y<e})),Rw=d(Aw,(function(t){return t.top}),(function(t,e){return t.y>e})),Mw=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===Av.Wrap&&0===t.positions.length}(r)||!Pn(n.getNode())&&function(t){return t.breakType===Av.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},zw=d(Mw,Vy),Dw=d(Mw,jy),Bw=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!ms()||!function(t,e,n){var r=cc.fromRangeStart(e);return ol(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n)||(fb(i,t,n,!e,!1).each((function(e){cw(t,e)})),0))},Pw=function(t,e,n){var r=function(t,e){var n=e.getNode(t);return kn(n)&&"TABLE"===n.nodeName?x.some(n):x.none()}(!!e,n),o=!1===e;r.fold((function(){return cw(t,n.toRange())}),(function(r){return ol(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return cw(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=zc(e);o?e.undoManager.transact((function(){var r=ke(o);qn(r,Dc(e)),an(r,ke("br")),t?on(Te(n),r):rn(Te(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),cw(e,i)})):cw(e,r.toRange())}(e,t,r,n)}))}))},Iw=function(t,e,n,r){var o=t.selection.getRng(),i=cc.fromRangeStart(o),u=t.getBody();if(!e&&zw(r,i)){var a=function(t,e,n){return function(t,e){return tt(e.getClientRects()).bind((function(e){return Nw(t,e.left,e.top)})).bind((function(t){return Fy(cl(n=t).map((function(t){return Vy(n,t).positions.concat(t)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Uy(t,cc.before(e)),n.left)}))})).getOr(cc.before(e))}(u,n,i);return Pw(t,e,a),!0}return!(!e||!Dw(r,i))&&(a=function(t,e,n){return function(t,e){return et(e.getClientRects()).bind((function(e){return Rw(t,e.left,e.top)})).bind((function(t){return Fy(al(n=t).map((function(t){return[t].concat(jy(n,t).positions)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Wy(t,cc.after(e)),n.left)}))})).getOr(cc.after(e))}(u,n,i),Pw(t,e,a),!0)},Lw=function(t,e,n){return x.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return x.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},Hw=function(t,e){return Lw(t,e,Bw)},Fw=function(t,e){return Lw(t,e,Iw)},Vw=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(Vr),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Ar(e,e);n=c.current();){if(Mn(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Pn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),ud(t,a)}},jw=function(t){return x.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},Uw=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},Ww=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},qw=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},$w=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!kn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},Gw=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},Xw=function(t){t.innerHTML='<br data-mce-bogus="1">'},Kw=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},Yw=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},Jw=function(t,e,n){return!1===Mn(e)?n:t?1===n&&e.data.charAt(n-1)===jr?0:n:n===e.data.length-1&&e.data.charAt(n)===jr?e.data.length:n},Qw=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Zw=function(t,e){var n=zc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;x.from(n.style).map(r.parseStyle).each((function(t){var n=Qn(Te(e)),o=St(St({},n),t);r.setStyles(e,o)}));var o=x.from(n.class).map((function(t){return t.split(/\s+/)})),i=x.from(e.className).map((function(t){return W(t.split(/\s+/),(function(t){return""!==t}))}));Ra(o,i,(function(t,n){var o=W(n,(function(e){return!H(t,e)})),i=kt(t,o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=ft(n,(function(t,e){return!H(u,e)}));r.setAttribs(e,a)}(t,e,Dc(t))},tx=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(ll(a)||wl(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return Zw(t,n),Xw(u),n},v=function(t){var e,n,u=Jw(t,r,o);if(Mn(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&kn(r)&&r===i.firstChild)return!0;if(Kw(r,"TABLE")||Kw(r,"HR"))return f&&!t||!f&&t;var a=new Ar(r,i);for(Mn(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(kn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Mn(e)&&!ho(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&Yw(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),Vw(t,u)};Pf(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=zc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);kn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Mn(r)?r.nodeValue.length:0);var x=Qw(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=Qw(d,r);if(!(u=d.getParent(r,d.isBlock))||!Yw(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),Zw(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),Zw(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;Ww(a=n)&&Ww(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if($w(n,r,!0)&&$w(n,r,!1))Uw(n,"LI")?i.insertAfter(c,qw(n)):i.replace(c,n);else if($w(n,r,!0))Uw(n,"LI")?(i.insertAfter(c,qw(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n);else if($w(n,r,!1))i.insertAfter(c,qw(n));else{n=qw(n);var s=u.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var l=s.extractContents();"LI"===o&&function(t,e){return t.firstChild&&"LI"===t.firstChild.nodeName}(l)?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n))}i.remove(r),Vw(t,c)}}(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Gr(i)?(u=eo(i),d.isEmpty(i)&&Xw(i),Zw(t,u),Vw(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),Vw(t,Kw(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,Jw(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,Jw(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){j(pa(Te(t),Pe),(function(t){var e=t.dom;e.nodeValue=Wr(e.nodeValue)}))}(a=n.extractContents()),function(t){do{Mn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;kn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||Gw(t,o))&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&Xw(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(Zw(t,u),Vw(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},ex=function(t,e,n){var r=t.create("span",{}," ");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},nx=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},rx=function(t,e){var n=ke("br");rn(Te(e),n),t.undoManager.add()},ox=function(t,e){ix(t.getBody(),e)||on(Te(e),ke("br"));var n=ke("br");on(Te(e),n),ex(t.dom,t.selection,n.dom),nx(t.dom,t.selection,n.dom,!1),t.undoManager.add()},ix=function(t,e){return n=cc.after(e),!!Pn(n.getNode())||il(t,cc.after(e)).map((function(t){return Pn(t.getNode())})).getOr(!1);var n},ux=function(t){return t&&"A"===t.nodeName&&"href"in t},ax=function(t){return t.fold(p,ux,ux,p)},cx=function(t,e){e.fold(c,d(rx,t),d(ox,t),c)},sx=function(t,e){var n=function(t){var e=d(jv,t),n=cc.fromRangeStart(t.selection.getRng());return $b(e,t.getBody(),n).filter(ax)}(t);n.isSome()?n.each(d(cx,t)):function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();Pf(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Ar(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),lc(i,u,n),ex(i,o,n),nx(i,o,n,r),t.undoManager.add()}(t,e)},lx=function(t,e){return jw(t).filter((function(t){return e.length>0&&Ee(Te(t),e)})).isSome()},fx=mr([{br:[]},{block:[]},{none:[]}]),dx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},mx=function(t){return function(e,n){return""===zc(e)===t}},gx=function(t){return function(e,n){return function(t){return jw(t).filter((function(t){return Ir(Te(t))})).isSome()}(e)===t}},hx=function(t,e){return function(n,r){return function(t){return jw(t).fold(l(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},px=function(t){return hx("pre",t)},vx=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},bx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},yx=function(t,e){return e},wx=function(t){var e=zc(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},xx=function(t,e){return function(n,r){return $(t,(function(t,e){return t&&e(n,r)}),!0)?x.some(e):x.none()}},Cx=function(t,e){(function(t,e){return Pb([xx([dx],fx.none()),xx([hx("summary",!0)],fx.br()),xx([px(!0),vx(!1),yx],fx.br()),xx([px(!0),vx(!1)],fx.block()),xx([px(!0),vx(!0),yx],fx.block()),xx([px(!0),vx(!0)],fx.br()),xx([gx(!0),yx],fx.br()),xx([gx(!0)],fx.block()),xx([mx(!0),yx,wx],fx.block()),xx([mx(!0)],fx.br()),xx([bx],fx.br()),xx([mx(!1),yx],fx.br()),xx([wx],fx.block())],[t,!(!e||!e.shiftKey)]).getOr(fx.none())})(t,e).fold((function(){sx(t,e)}),(function(){tx(t,e)}),c)},Sx=ae().browser,kx=function(t,e){var n=e.container(),r=e.offset();return Mn(n)?(n.insertData(r,t),x.some(uc(n,r+t.length))):Ls(e).map((function(n){var r=Oe(t);return e.isAtEnd()?on(n,r):rn(n,r),uc(r.dom,t.length)}))},Ox=d(kx,Vr),Tx=d(kx," "),_x=function(t,e){return function(n){return function(t,e){return!Xm(e)&&(function(t,e){return function(t,e){return ul(t.dom,e).isNone()}(t,e)||function(t,e){return il(t.dom,e).isNone()}(t,e)||Dm(t,e)||Bm(t,e)||Vm(t,e)||Fm(t,e)}(t,e)||$m(t,e)||Gm(t,e))}(t,n)?Ox(e):Tx(e)}},Ex=function(t){var e=cc.fromRangeStart(t.selection.getRng()),n=Te(t.getBody());if(t.selection.isCollapsed()){var r=d(jv,t),o=cc.fromRangeStart(t.selection.getRng());return $b(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return ul(t.dom,cc.before(e))}),(function(t){return al(t)}),(function(t){return cl(t)}),(function(e){return il(t.dom,cc.after(e))}))}}(n)).bind(_x(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},Ax=function(t){var e=ay(t);return function(t){t.on("keyup compositionstart",d(My,t))}(t),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ae().os;Ow([{keyCode:Cf.RIGHT,action:kw(pw,t,!0)},{keyCode:Cf.LEFT,action:kw(pw,t,!1)},{keyCode:Cf.UP,action:kw(vw,t,!1)},{keyCode:Cf.DOWN,action:kw(vw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Hw,t,!0)},{keyCode:Cf.LEFT,action:kw(Hw,t,!1)},{keyCode:Cf.UP,action:kw(Fw,t,!1)},{keyCode:Cf.DOWN,action:kw(Fw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Tw,t,!0)},{keyCode:Cf.LEFT,action:kw(Tw,t,!1)},{keyCode:Cf.UP,action:kw(_w,t,!1)},{keyCode:Cf.DOWN,action:kw(_w,t,!0)},{keyCode:Cf.RIGHT,action:kw(iy,t,e,!0)},{keyCode:Cf.LEFT,action:kw(iy,t,e,!1)},{keyCode:Cf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(cy,t,e)},{keyCode:Cf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(sy,t,e)},{keyCode:Cf.UP,action:kw(Sw,t,!1)},{keyCode:Cf.DOWN,action:kw(Sw,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))}(t,e),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){Ow([{keyCode:Cf.BACKSPACE,action:kw(ky,t,!1)},{keyCode:Cf.BACKSPACE,action:kw(kb,t,!1)},{keyCode:Cf.DELETE,action:kw(kb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(bb,t,!1)},{keyCode:Cf.DELETE,action:kw(bb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(dy,t,e,!1)},{keyCode:Cf.DELETE,action:kw(dy,t,e,!0)},{keyCode:Cf.BACKSPACE,action:kw(Bg,t,!1)},{keyCode:Cf.DELETE,action:kw(Bg,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(Ob,t,!1)},{keyCode:Cf.DELETE,action:kw(Ob,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(vy,t,!1)},{keyCode:Cf.DELETE,action:kw(vy,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(cb,t,!1)},{keyCode:Cf.DELETE,action:kw(cb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(ib,t,!1)},{keyCode:Cf.DELETE,action:kw(ib,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(hy,t,!1)},{keyCode:Cf.DELETE,action:kw(hy,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.BACKSPACE,action:kw(Sb,t)},{keyCode:Cf.DELETE,action:kw(Sb,t)}],e)}(t,e)}))}(t,e),function(t){t.on("keydown",(function(e){e.keyCode===Cf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Cx(t,e)})))}(t,e)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.SPACEBAR,action:kw(Ex,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),function(t){!function(t){var e=la((function(){t.composing||eg(t)}),0);Sx.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&eg(t)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.END,action:kw(bw,t,!0)},{keyCode:Cf.HOME,action:kw(bw,t,!1)},{keyCode:Cf.END,action:kw(Ew,t,!0)},{keyCode:Cf.HOME,action:kw(Ew,t,!1)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),e},Nx=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&_f(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!pe.range&&t.selection.isCollapsed()||lf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&lf(t)&&("IMG"===t.selection.getNode().nodeName?Tr.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Rx=function(t){return kn(t)&&Br(Te(t))},Mx=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},zx=Hn,Dx=Ln,Bx=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},Px=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},Ix=function(t){t.on((function(t){Px(t.ghost)})),t.clear()},Lx=function(t){var e,n=(e=ra(x.none()),{clear:function(){return e.set(x.none())},set:function(t){return e.set(x.some(t))},isSet:function(){return e.get().isSome()},on:function(t){return e.get().each(t)}}),r=Qu.DOM,o=document,i=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=G(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(zx,Dx)).getOr(null);if(a=e.getBody(),zx(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Bx(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}}(n,t),u=function(t,e){var n=Tr.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,function(t,e){return n=function(t){return t.inline?Mx(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Mx(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o}(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(n,t),a=function(t,e){return function(n){t.on((function(t){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!zx(e)}(e,3===(i=e.selection.getSel().getRangeAt(0).startContainer).nodeType?i.parentNode:i,t.element)){var r=((o=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),o);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Px(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var o,i})),Ix(t)}}(n,t),c=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Ix(t)}}(n,t);t.on("mousedown",i),t.on("mousemove",u),t.on("mouseup",a),r.bind(o,"mousemove",u),r.bind(o,"mouseup",c),t.on("remove",(function(){r.unbind(o,"mousemove",u),r.unbind(o,"mouseup",c)}))},Hx=Ln,Fx=Hn,Vx=function(t,e){return wf(t.getBody(),e)},jx=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=ds(t,i,o,(function(){return Nd(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Fx(t)||Vn(t))&&r.isChildOf(t,i)},l=function(t){t&&n.setRng(t)},f=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},g=function(t){return Kr(t)||Zr(t)||to(t)},h=function(t){return g(t.startContainer)||g(t.endContainer)},p=function(o,u){if(!o)return null;if(o.collapsed){if(!h(o)){var l=u?1:-1,f=Is(l,i,o),d=f.getNode(!u);if(hs(d))return m(l,d,!!u&&!f.isAtEnd(),!1);var g=f.getNode(u);if(hs(g))return m(l,g,!u&&!f.isAtEnd(),!1)}return null}var p=o.startContainer,v=o.startOffset,y=o.endOffset;if(3===p.nodeType&&0===v&&Fx(p.parentNode)&&(p=p.parentNode,v=r.nodeIndex(p),p=p.parentNode),1!==p.nodeType)return null;if(y===v+1&&p===o.endContainer){var w=p.childNodes[v];if(s(w))return function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var s=function(e,o,i){var u=t.$,c=wr(Te(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&pe.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(Vr).append(o).append(Vr),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),l=Te(o);return j(va(Te(t.getBody()),"*[data-mce-selected]"),(function(t){Ne(l,t)||Xn(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,b(),s}(w)}return null},v=function(){e&&e.removeAttribute(c),wr(Te(t.getBody()),"#"+a).each(ln),e=null},b=function(){u.hide()};return pe.ceFalse&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&hv(t,e.clientX,e.clientY)&&mb(t,n,!1).each(l)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Fx(o)&&(e.preventDefault(),t.focus()),Hx(o)&&r.isChildOf(o,n.getNode())&&v())})),t.on("blur NewBlock",v),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var c=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!(!a||e===c||!r.isChildOf(a,c)||!1!==Fx(Vx(t,a)))||a&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=Js(t);if(!t.firstChild)return!1;var n,r=cc.before(t.firstChild),o=e.next(r);return o&&!(km(n=o)||Om(n)||wm(n)||xm(n))}(a)};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Fx(r)?(e.preventDefault(),db(t,r).each(p)):s(n)&&db(t,n).each(p)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hv(t,e.clientX,e.clientY)){var u=Vx(t,o);if(u)Fx(u)?(e.preventDefault(),db(t,u).each(p)):(v(),Hx(u)&&e.shiftKey||xf(e.clientX,e.clientY,n.getRng())||(b(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))db(t,o).each(p);else if(!1===hs(o)){v(),b();var a=function(t,e,n){var r=$y(function(t){return W(nt(t.getElementsByTagName("*")),hs)}(t)),o=W(r,d(iw,n)),i=uw(o,e);if(i){var u=!An(i.node)&&!Vn(i.node);if((i=uw(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=W($y([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),aw(zy.Up,t,d(o,Pa),e.node,n),aw(zy.Down,t,d(o,Ia),e.node,n),r}(t,i,u),e))&&hs(i.node))return function(t,e){return{node:t.node,before:nw(t,e)<rw(t,e)}}(i,e)}return null}(i,e.clientX,e.clientY);if(a&&!c(o,a.node)){e.preventDefault();var f=m(1,a.node,a.before,!1);t.getBody().focus(),l(f)}}}})),t.on("keypress",(function(t){Cf.modifierPressed(t)||Fx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(e){e.range=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return mt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),mt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o}(e.range);var n=p(e.range,e.forward);n&&(e.range=n)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;h(n)||"mcepastebin"===o.id||b(),e=o,r.hasClass(e,"mce-offscreen-selection")||v()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!pe.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),function(t){Lx(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(zx(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.defaultPrevented){var n=e.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&xv(t,"Dropped file type is not supported"))}},n=function(n){Od(t,n.target)&&e(n)},r=function(){var r=Qu.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];j(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){j(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){Tr.setEditorTimeout(t,r,0)}))}(t)}(t),function(t){var e=la((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=gb(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Vn(n)){var r=wf(t.getBody(),n),o=Hn(r)?r:n;t.selection.getNode()!==o&&db(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(eo(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:b,destroy:function(){u.destroy(),e=null}}},Ux=Qu.DOM,Wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},qx=function(t){return ft(t,(function(t){return!1===N(t)}))},$x=function(t){var e=t.settings,n=t.editorUpload.blobCache;return qx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Wx(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},Gx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),function(t){var e=t.dom.getRoot();t.inline||lf(t)&&t.selection.getStart(!0)!==e||al(e).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;pe.browser.isIE()?function(t,e){var n=Te(t.getBody()),r=(vd(t)?x.from(e):x.none()).map(bd).filter(pd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))}(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Tr.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Xx=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,Ux.setAttrib(o,"spellcheck","false")),t.quirks=function(t){var e,n,r,o=xe.each,i=Cf.BACKSPACE,u=Cf.DELETE,a=t.dom,c=t.selection,s=t.parser,l=pe.gecko,f=pe.ie,d=pe.webkit,m="data:text/mce-internal,",g=f?"Text":"URL",h=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},p=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",(function(t){if(!p(t)&&t.keyCode===i&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(pe.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))};return t.on("keydown",(function(e){var n,r;if(!p(e)&&e.keyCode===Cf.BACKSPACE){var o=(n=c.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),c.setRng(n))}}})),e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",(function(n){var r,o,c=n.keyCode;if(!p(n)&&(c===u||c===i)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!a.isEmpty(o))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),o.firstChild&&a.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}})),pe.windowsPhone||t.on("keyup focusin mouseup",(function(t){Cf.modifierPressed(t)||c.normalize()}),!0),d&&(t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Kr(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)})),t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))})),zc(t)&&t.on("init",(function(){h("DefaultParagraphSeparator",zc(t))})),t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))})),b(),s.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),pe.iOS?(t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()})),y(),t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),pe.ie>=11&&(y(),b()),pe.ie&&(v(),h("AutoUrlDetect",!1),t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&c.select(e.target),(n=t.selection.getContent()).length>0&&(r=m+escape(t.id)+","+escape(n),e.dataTransfer.setData(g,r)))}(e)})),t.on("drop",(function(e){if(!p(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(g))&&e.indexOf(m)>=0?(e=e.substr(m.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Tf(e.x,e.y,t.getDoc());c.setRng(r),o=n.html,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:!0}):t.execCommand("mceInsertContent",!1,o)}}var o}))),l&&(t.on("keydown",(function(e){if(!p(e)&&e.keyCode===i){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!p(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Tr.setEditorTimeout(t,(function(){n.focus()}))}})),n=function(){var e=a.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),o(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!c.isCollapsed()&&a.getParent(c.getStart(),a.isBlock)!==a.getParent(c.getEnd(),a.isBlock)},t.on("keypress",(function(e){var o;if(!p(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(e){var o;!p(e)&&r()&&(o=n(),Tr.setEditorTimeout(t,(function(){o()})))})),function(t){return t.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",(function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),$c(t)||h("enableObjectResizing",!1)})),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||o(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))})),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),pe.mac&&t.on("keydown",(function(e){!Cf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})),b()),{refreshContentEditable:function(){},isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}}(t),function(t){t.fire("PostRender")}(t);var i=function(t){return t.getParam("directionality",aa.isRtl()?"rtl":void 0)}(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",(function(t){xe.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),t.contentStyles.length>0){var u="";xe.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}!function(t,e){var n=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader}(t),r=function(){t.on("remove",(function(){return n.unloadAll(e)})),Gx(t)};n.loadAll(e,r,r)}(t,t.contentCSS),n.content_style&&function(t,e){var n=Te(t.getBody()),r=en(tn(n)),o=ke("style");Wn(o,"type","text/css"),an(o,Oe(e)),an(r,o),t.on("remove",(function(){ln(o)}))}(t,n.content_style)},Kx=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Ux.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Ux.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=function(t){var e,n,r,o,i,u=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||Ev("blobid"),r=t.name||n,o=t.blob;return{id:l(n),name:l(r),filename:l(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:l(o),base64:l(t.base64),blobUri:l(t.blobUri||URL.createObjectURL(o)),uri:l(t.uri)}},n=function(e){return G(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(O(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(T(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=W(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){j(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),a=(r={},o=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:i=function(t){return t in r},getResultUri:function(t){var e=r[t];return e?e.resultUri:null},isPending:function(t){return!!i(t)&&1===r[t].status},isUploaded:function(t){return!!i(t)&&2===r[t].status},markPending:function(t){r[t]=o(1,null)},markUploaded:function(t,e){r[t]=o(2,e)},removeFailed:function(t){delete r[t]},destroy:function(){r={}}}),c=[],s=function(t){var e=ra(null);return t.on("change AddUndo",(function(t){e.set(St({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;et(n).filter((function(t){return!ap(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:Z(n,n.length-2).getOrNull()})}))}}}(t),f=function(e){return function(n){return t.selection?e(n):[]}},d=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},m=function(t,e,n){var r='src="'+n+'"'+(n===pe.transparentSrc?' data-mce-placeholder="1"':"");return t=d(t,'src="'+e+'"',r),d(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},g=function(e,n){j(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=V(t.fragments,(function(t){return m(t,e,n)})):t.content=m(t.content,e,n)}))},h=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},p=function(n){return e||(e=Tv(a,{url:Lc(t),basePath:Hc(t),credentials:Fc(t),handler:Vc(t)})),w().then(f((function(r){var o=V(r,(function(t){return t.blobInfo}));return e.upload(o,h).then(f((function(e){var o=[],i=V(e,(function(e,n){var i=r[n].blobInfo,a=r[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(u.removeByUri(a.src),function(e,n){var r,o=t.convertURL(n,"src");g(e.src,n),t.$(e).attr({src:Pc(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(a,e.url)):e.error&&(e.error.options.remove&&(g(a.getAttribute("src"),pe.transparentSrc),o.push(a)),function(t,e){xv(t,aa.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:i}}));return i.length>0&&s.fireIfChanged(),o.length>0&&(gp(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){j(o,(function(e){t.dom.remove(e),u.removeByUri(e.src)}))}))),n&&n(i),i})))})))},b=function(e){if(Bc(t))return p(e)},y=function(e){return!1!==Y(c,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",v,"function")}(t)(e))},w=function(){return n||(n=Ap(a,u)),n.findAll(t.getBody(),y).then(f((function(e){return e=W(e,(function(e){return"string"!=typeof e||(xv(t,e),!1)})),j(e,(function(t){g(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=a.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=$(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){Bc(t)?b():w()})),t.on("RawSaveContent",(function(t){t.content=x(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=x(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){j(t,(function(t){var e=t.attr("src");if(!u.getByUri(e)){var n=a.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:u,addFilter:function(t){c.push(t)},uploadImages:p,uploadImagesAuto:b,scanForImages:w,destroy:function(){u.destroy(),a.destroy(),n=e=null}}}(t),t.schema=Go(n),t.dom=Qu(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:jc(t),referrerPolicy:Uc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Hp($x(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Jd("br",1)).shortEnded=!0)}})),e}(t),t.serializer=jp(function(t){var e=t.settings;return St(St({},$x(t)),qx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=Cp(t.dom,t.getWin(),t.serializer,t),t.annotator=vf(t),t.formatter=Bv(t),t.undoManager=Pv(t),t._nodeChangeDispatcher=new Nx(t),t._selectionOverrides=jx(t),function(t){var e=ra(x.none()),n=ra(!1),r=fa((function(e){t.fire("longpress",St(St({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){Ty(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(x.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),Ty(o).each((function(r){e.get().each((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.set(x.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",St(St({},o),{type:"tap"}))}))}),!0)}(t),function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){j(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){j(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",O(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)}(t),gp(t)||function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=uc.fromRangeStart(e),r=uc.fromRangeEnd(e);if(uc.isElementPosition(n)){var o=n.container();Rx(o)&&al(o).each((function(t){return e.setStart(t.container(),t.offset())}))}uc.isElementPosition(r)&&(o=n.container(),Rx(o)&&cl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))),t.selection.setRng(Pg(e))}(t)}))}(t);var u=function(t){return gp(t)?ra(null):Ax(t)}(t);(function(t,e){t.addCommand("delete",(function(){!function(t,e){ky(t)||kb(t,!1)||bb(t,!1)||dy(t,e,!1)||ib(t,!1)||Bg(t)||Ob(t,!1)||vy(t,!1)||cb(t)||hy(t,!1)||(Oy(t,"Delete"),Xv(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){kb(t,!0)||bb(t,!0)||dy(t,e,!0)||ib(t,!0)||Bg(t)||Ob(t,!0)||vy(t,!0)||cb(t)||hy(t,!0)||Oy(t,"ForwardDelete")}(t,e)}))})(t,u),function(t){zc(t)&&t.on("NodeChange",d(Ny,t))}(t),function(t){var e=t.dom,n=zc(t),r=function(t){return t.getParam("placeholder",Nc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(Hv(t)){var e=t.keyCode;return!Fv(t)&&(Cf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||H(Iv,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return Hv(t)&&!(Fv(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(wo(Te(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,Lv)!==c||u)&&(e.setAttrib(a,Lv,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Tr.setEditorTimeout(t,(function(){return o(e)}))}))}))}(t),function(t){t.fire("PreInit")}(t),function(t){var e=t;return dt(t.plugins,"rtc").fold((function(){return e.rtcInstance=mp(t),x.none()}),(function(n){return x.some(n.setup().then((function(n){return e.rtcInstance=function(t,e){var n=function(t){return T(t)?t:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:c,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{match:function(t,r,o){return e.matchFormat(t,n(r))},matchAll:r,matchNode:r,canApply:function(t){return e.canApplyFormat(t)},closest:function(t){return e.closestFormat(t)},apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))},formatChanged:function(t,n,r,o){return e.formatChanged(n,r,o)}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=tm({inner:!0});return dp(t,o),"tree"===r?o:i.serialize(o)}return mp(t).editor.getContent(n,r)},setContent:function(n,r){var o=fp(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o,i=(o=t,x.from(o.selection.getStart(!0)).map((function(t){return t.nodeName.toLowerCase()}))).fold((function(){return{}}),(function(t){return{context:t}})),u=fp(n)?n:t.parser.parse(n,St(St({},i),{insert:!0}));e.insertContent(u)},addVisual:function(t){}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=tm({});return dp(t,o),"tree"===n?o:i.serialize(o)}return mp(t).selection.getContent(n,r)}},raw:{getModel:function(){return x.some(e.getRawModel())}}}}(t,n),n.isRemote})))}))}(t).fold((function(){Xx(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),Xx(t,e)}))}))},Yx=Qu.DOM,Jx=function(t,e){var n=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),r=function(t,e,n,r){var o=ke("iframe");return qn(o,r),qn(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),ga(o,"tox-edit-area__iframe"),o}(t.id,n,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom;r.onload=function(){r.onload=null,t.fire("load")};var o=function(t,e){if(document.domain!==window.location.hostname&&pe.browser.isIE()){var n=Ev("mce");t[n]=function(){Kx(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Yx.setAttrib(e,"src",r),!0}return!1}(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return Rc(t,"body_id","tinymce")}(t),r=function(t){return Rc(t,"body_class","")}(t);return Mc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Mc(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'}(t),Yx.add(e.iframeContainer,r),o},Qx=Qu.DOM,Zx=function(t,e,n){var r=vv.get(n),o=vv.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=xe.trim(n),r&&-1===xe.inArray(e,n)){if(xe.each(vv.dependencies(n),(function(n){Zx(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=aa.translate(["Failed to initialize plugin: {0}",e]);Ov(r,n),xv(t,r)}(t,n,e)}}},tC=function(t){return t.replace(/^\-/,"")},eC=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},nC=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,O(Xc(t))?function(t){return t.theme.renderUI()}(t):z(Xc(t))?function(t){var e=t.getElement(),n=Xc(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):function(t){var e=t.getElement();return t.inline?eC(null):function(t){var e=Qx.create("div");return Qx.insertAfter(e,t),eC(e)}(e)}(t)},rC=function(t){t.fire("ScriptsLoaded"),function(t){var e=xe.trim(Ic(t)),n=t.ui.registry.getAll().icons,r=St(St({},cv.get("default").icons),cv.get(e).icons);it(r,(function(e,r){mt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=Xc(t);if(O(e)){t.settings.theme=tC(e);var n=bv.get(e);t.theme=new n(t,bv.urls[e]),t.theme.init&&t.theme.init(t,bv.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];xe.each(Qc(t).split(/[ ,]/),(function(n){Zx(t,e,tC(n))}))}(t);var e=nC(t);!function(t,e){var n={show:x.from(e.show).getOr(c),hide:x.from(e.hide).getOr(c),disable:x.from(e.disable).getOr(c),isDisabled:x.from(e.isDisabled).getOr(p),enable:function(){t.mode.isReadOnly()||x.from(e.enable).map(h)}};t.ui=St(St({},t.ui),n)}(t,x.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,function(t){t.contentCSS=t.contentCSS.concat(function(t){var e=function(t){var e=t.getParam("content_css");return O(e)?V(e.split(","),zt):_(e)?e:!1===e||t.inline?[]:["default"]}(t),n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return V(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))}(t))}(t),t.inline?Kx(t):function(t,e){var n=Jx(t,e);e.editorContainer&&(Yx.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Yx.isHidden(e.editorContainer)),t.getElement().style.display="none",Yx.setAttrib(t.id,"aria-hidden","true"),n||Kx(t)}(t,n)},oC=Qu.DOM,iC=function(t){return"-"===t.charAt(0)},uC=function(t,e,n){return x.from(e).filter((function(t){return t.length>0&&!cv.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:x.some(e)}}))},aC=function(t,e){var n=na.ScriptLoader;!function(t,e,n,r){var o=Xc(e);if(O(o)){if(!iC(o)&&!bv.urls.hasOwnProperty(o)){var i=function(t){return t.getParam("theme_url")}(e);i?bv.load(o,e.documentBaseURI.toAbsolute(i)):bv.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){bv.waitFor(o,r)}))}else r()}(n,t,e,(function(){(function(t,e){var n=Wc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===aa.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,c,void 0,(function(){!function(t,e,n){Cv(t,"LanguageLoadError",Sv("language",e,n))}(e,o,n)}))}})(n,t),function(t,e,n){var r=uC(e,"default",n),o=function(t){return x.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:x.none()}}))}(e).orThunk((function(){return uC(e,Ic(e),"")}));j(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,c,void 0,(function(){!function(t,e,n){Cv(t,"IconsLoadError",Sv("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))}(n,t,e),function(t,e){xe.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){vv.load(n,e,c,void 0,(function(){kv(t,e,n)})),t.settings.plugins+=" "+n})),xe.each(Qc(t).split(/[ ,]/),(function(n){if((n=xe.trim(n))&&!vv.urls[n])if(iC(n)){n=n.substr(1,n.length);var r=vv.dependencies(n);xe.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=vv.createUrl(r,n);vv.load(o.resource,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};vv.load(n,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||rC(t)}),t,(function(){t.removed||rC(t)}))}))},cC={"font-size":"size","font-family":"face"},sC=function(t){return function(e,n){return x.from(n).map(Te).filter(Be).bind((function(n){return function(t,e,n){return Ld(Te(n),(function(e){return function(e){return Jn(e,t).orThunk((function(){return"font"===Me(e)?dt(cC,t).bind((function(t){return Gn(e,t)})):x.none()}))}(e)}),(function(t){return Ne(Te(e),t)}))}(t,e,n.dom).or(function(t,e){return x.from(Qu.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},lC=sC("font-size"),fC=s((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),sC("font-family")),dC=function(t){return al(t.getBody()).map((function(t){var e=t.container();return Mn(e)?e.parentNode:e}))},mC=function(t,e){return function(t){return x.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?x.none():x.from(t.selection.getStart(!0))}))}(t).orThunk(d(dC,t)).map(Te).filter(Be).map(e)},gC=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return xe.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return xe.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},hC=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return-1===t.indexOf(" ")||Rt(t,'"')||Rt(t,"'")?t:"'"+t+"'"})).join(",")},pC=xe.each,vC=xe.map,bC=xe.inArray,yC=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,xd(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus(),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(pC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;pC(t,(function(t,r){pC(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");pe.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),pC("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n=gC(t,e);t.formatter.toggle("fontname",{value:hC(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:gC(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.undoManager.transact((function(){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}))}(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){!function(t,e){var n=function(t){var e;return"string"!=typeof t?(e=xe.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}}(e);!function(t,e,n){hp(t).editor.insertContent(e,n)}(t,n.content,n.details)}(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Cx(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Sy(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Ln);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return sx(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=vC(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==bC(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return wy(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return mC(t,(function(e){return fC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return mC(t,(function(e){return lC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return mC(t,(function(e){var n=Te(t.getBody());return Ld(e,(function(t){return Jn(t,"line-height")}),d(Ne,n)).getOrThunk((function(){var t=parseFloat(Kn(e,"line-height")),n=parseFloat(Kn(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),wC="data-mce-contenteditable",xC=function(t,e,n){var r,o;ha(t,e)&&!1===n?(o=e,ma(r=t)?r.dom.classList.remove(o):function(t,e){(function(t,e,n){var r=W(da(t,e),(function(t){return t!==n}));r.length>0?Wn(t,e,r.join(" ")):Xn(t,e)})(t,"class",e)}(r,o),function(t){0===(ma(t)?t.dom.classList:function(t){return da(t,"class")}(t)).length&&Xn(t,"class")}(r)):n&&ga(t,e)},CC=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},SC=function(t,e){t.dom.contentEditable=e?"true":"false"},kC=function(t,e){var n=Te(t.getBody());xC(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){x.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,SC(n,!1),j(va(n,'*[contenteditable="true"]'),(function(t){Wn(t,wC,"true"),SC(t,!1)}))):(t.readonly=!1,SC(n,!0),j(va(n,'*[data-mce-contenteditable="true"]'),(function(t){Xn(t,wC),SC(t,!0)})),CC(t,"StyleWithCSS",!1),CC(t,"enableInlineTableEditing",!1),CC(t,"enableObjectResizing",!1),function(t){return Nd(t)||function(t){return cd().filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&Od(t,e.dom);var n})).isSome()}(t)}(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},OC=function(t){return t.readonly},TC=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){OC(t)&&j(e,(function(t){t.attr(wC,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(wC,(function(e){OC(t)&&j(e,(function(t){t.attr("contenteditable",t.attr(wC))}))})),t.serializer.addTempAttr(wC)},_C=xe.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"," "),EC=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||p}return t.isNative=function(t){return!!_C[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=e||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=v},r.stopPropagation=function(){r.isPropagationStopped=v},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=v},r.isDefaultPrevented=p,r.isPropagationStopped=p,r.isImmediatePropagationStopped=p),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=p),e){var o={func:e};r&&xe.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=this.bindings[a]=[],this.toggleEvent(a,!0)),n?c.unshift(o):c.push(o)}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return it(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e)for(var a=u.length;a--;)u[a].func===e&&(u=u.slice(0,a).concat(u.slice(a+1)),this.bindings[i]=u);else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else it(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),AC=function(t){return t._eventDispatcher||(t._eventDispatcher=new EC({scope:t,toggleEvent:function(e,n){EC.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},NC={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=AC(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return AC(this).on(t,e,n)},off:function(t,e){return AC(this).off(t,e)},once:function(t,e){return AC(this).once(t,e)},hasEventListeners:function(t){return AC(this).has(t)}},RC=Qu.DOM,MC=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=Gc(t);return n?(t.eventRoot||(t.eventRoot=RC.select(n)[0]),t.eventRoot):t.getBody()},zC=function(t,e,n){!function(t){return!t.hidden&&!OC(t)}(t)?OC(t)&&function(t,e){if(function(t){return"click"===t.type}(e)&&!Cf.metaKeyPressed(e)){var n=Te(e.target);(function(t,e){return xr(e,"a",(function(e){return Ne(e,Te(t.getBody()))})).bind((function(t){return Gn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Rt(o=n,"#")?function(t,e){return t.substring(e)}(o,"#".length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o}))}}(t,n):t.fire(e,n)},DC=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=MC(t,e);if(Gc(t)){if(Gy||(Gy={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Gy&&(it(Gy,(function(e,n){t.dom.unbind(MC(t,n))})),Gy=null)}))),Gy[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||RC.isChildOf(r,u))&&zC(o[i],e,n)}},Gy[e]=n,RC.bind(r,e,n)}else n=function(n){zC(t,e,n)},RC.bind(r,e,n),t.delegates[e]=n}},BC=St(St({},NC),{bindPendingEventDelegates:function(){var t=this;xe.each(t._pendingNativeEvents,(function(e){DC(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(e?n.initialized?DC(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(MC(n,t),t,n.delegates[t]),delete n.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(it(t.delegates,(function(e,n){t.dom.unbind(MC(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),PC=["design","readonly"],IC=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&kC(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},LC=xe.each,HC=xe.explode,FC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},VC=xe.makeMap("alt,ctrl,shift,meta,access"),jC=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(LC(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return LC(HC(xe.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:xe.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.parseShortcut=function(t){var e,n={};LC(HC(t.toLowerCase(),"+"),(function(t){t in VC?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=FC[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in VC)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,pe.mac?n.ctrl=!0:n.shift=!0),n.meta&&(pe.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=xe.map(HC(t,">"),this.parseShortcut);return o[o.length-1]=xe.extend(o[o.length-1],{func:n,scope:r||this.editor}),xe.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),UC=xe.each,WC=xe.trim,qC="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),$C={ftp:21,http:80,https:443,mailto:25},GC=function(){function t(e,n){e=WC(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);UC(qC,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=$C[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(UC(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?J(i).join("/"):a.slice(0,n).join("/")+"/"+J(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),XC=Qu.DOM,KC=xe.extend,YC=xe.each,JC=xe.resolve,QC=pe.ie,ZC=function(){function t(t,e,n){var r,o,i,u,a,s,l,f,d,m=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,KC(this,BC),this.settings=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:nv(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"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",indent_after:"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",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return St(St({},i),r?Zp:{})}(o,e,n,Kp,t);return uv(Yp||Jp,Yp,i,r,o)}(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(na.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Qu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),sa.languageLoad=this.settings.language_load,sa.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new GC(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new jC(this),this.editorCommands=new yC(this),this.settings.cache_suffix&&(pe.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:(o={},i={},u={},a={},s={},l={},d={addButton:(f=function(t,e){return function(n,r){return t[n.toLowerCase()]=St(St({},r),{type:e})}})(r={},"button"),addGroupToolbarButton:f(r,"grouptoolbarbutton"),addToggleButton:f(r,"togglebutton"),addMenuButton:f(r,"menubutton"),addSplitButton:f(r,"splitbutton"),addMenuItem:f(o,"menuitem"),addNestedMenuItem:f(o,"nestedmenuitem"),addToggleMenuItem:f(o,"togglemenuitem"),addAutocompleter:f(i,"autocompleter"),addContextMenu:f(a,"contextmenu"),addContextToolbar:f(s,"contexttoolbar"),addContextForm:f(s,"contextform"),addSidebar:f(l,"sidebar"),addIcon:function(t,e){return u[t.toLowerCase()]=e},getAll:function(){return{buttons:r,menuItems:o,icons:u,popups:i,contextMenus:a,contextToolbars:s,sidebars:l}}},{addAutocompleter:d.addAutocompleter,addButton:d.addButton,addContextForm:d.addContextForm,addContextMenu:d.addContextMenu,addContextToolbar:d.addContextToolbar,addIcon:d.addIcon,addMenuButton:d.addMenuButton,addMenuItem:d.addMenuItem,addNestedMenuItem:d.addNestedMenuItem,addSidebar:d.addSidebar,addSplitButton:d.addSplitButton,addToggleButton:d.addToggleButton,addGroupToolbarButton:d.addGroupToolbarButton,addToggleMenuItem:d.addToggleMenuItem,getAll:d.getAll}),styleSheetLoader:void 0,show:c,hide:c,enable:c,disable:c,isDisabled:p};var g,h,v,b=(g=this,h=ra("design"),v=ra({design:{activate:c,deactivate:c,editorReadOnly:!1},readonly:{activate:c,deactivate:c,editorReadOnly:!0}}),function(t){t.serializer?TC(t):t.on("PreInit",(function(){TC(t)}))}(g),function(t){t.on("ShowCaret",(function(e){OC(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){OC(t)&&e.preventDefault()}))}(g),{isReadOnly:function(){return OC(g)},set:function(t){return function(t,e,n,r){if(r!==n.get()){if(!mt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?IC(t,n,e,r):t.on("init",(function(){return IC(t,n,e,r)}))}}(g,v.get(),h,t)},get:function(){return h.get()},register:function(t,e){v.set(function(t,e,n){var r;if(H(PC,e))throw new Error("Cannot override default mode "+e);return St(St({},t),((r={})[e]=St(St({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(v.get(),t,e))}});this.mode=b,this.setMode=b.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Wu.overrideDefaults((function(){return{context:m.inline?m.getBody():m.getDoc(),element:m.getBody()}}))}return t.prototype.render=function(){!function(t){var e=t.id;aa.setCode(Wc(t));var n=function(){oC.unbind(window,"ready",n),t.render()};if(xi.Event.domLoaded){if(t.getElement()&&pe.contentEditable){var r=Te(t.getElement()),o=function(t){return $(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){U(r.dom.attributes,(function(t){return Xn(r,t.name)})),qn(r,o)})),t.ui.styleSheetLoader=function(t,e){return Er.forElement(t,{contentCssCors:Jc(e),referrerPolicy:Uc(e)})}(r,t),function(t){return t.getParam("inline")}(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||oC.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Rn(t.getElement())&&(oC.insertAfter(oC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},oC.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=yv(t),t.notificationManager=pv(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=oC.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),aC(t,t.suffix)}}else oC.bind(window,"ready",n)}(this)},t.prototype.focus=function(t){!function(t,e){t.removed||(e?Rd(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===Nd(t)&&xd(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return Ad(o),Ed(t,r),void Rd(t);t.inline||(pe.opera||Ad(n),t.getWin().focus()),(pe.gecko||t.inline)&&(Ad(n),Ed(t,r)),Rd(t)}(t))}(this,t)},t.prototype.hasFocus=function(){return Nd(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?JC(r):0,i=JC(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return aa.translate(t)},t.prototype.getParam=function(t,e,n){return function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?j(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[xe.trim(n[0])]=xe.trim(n[1]):e[xe.trim(n[0])]=xe.trim(n[0])})):e=t,e}(i):"string"===r?av(O,t,e).getOr(n):"number"===r?av(D,t,e).getOr(n):"boolean"===r?av(A,t,e).getOr(n):"object"===r?av(T,t,e).getOr(n):"array"===r?av(_,t,e).getOr(n):"string[]"===r?av((o=O,function(t){return _(t)&&Y(t,o)}),t,e).getOr(n):"function"===r?av(z,t,e).getOr(n):i}(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!(!H(Qc(this).split(/[ ,]/),t)||e&&void 0===vv.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(XC.show(t.getContainer()),XC.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(QC&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(XC.hide(t.getContainer()),XC.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=Rn(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Rn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=XC.getParent(r.id,"form"))&&YC(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return Up(this,t,e)},t.prototype.getContent=function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return hp(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")}(this,t)},t.prototype.insertContent=function(t,e){e&&(t=KC({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?Up(this,this.startContent,{format:"raw"}):Up(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=XC.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=XC.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){!function(t,e){(function(t,e){pp(t).editor.addVisual(e)})(t,e)}(this,t)},t.prototype.remove=function(){!function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Wp.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Wp.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Wp.remove(t.getContainer()),qp(e),qp(n),t.destroy()}}(this)},t.prototype.destroy=function(t){!function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),qp(n),qp(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Wp.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())}(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),tS=Qu.DOM,eS=xe.explode,nS=xe.each,rS=xe.extend,oS=0,iS=!1,uS=[],aS=[],cS=function(t){var e=t.type;nS(dS.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},sS=function(t){t!==iS&&(t?Wu(window).on("resize scroll",cS):Wu(window).off("resize scroll",cS),iS=t)},lS=function(t){var e=aS;delete uS[t.id];for(var n=0;n<uS.length;n++)if(uS[n]===t){uS.splice(n,1);break}return aS=W(aS,(function(e){return t!==e})),dS.activeEditor===t&&(dS.activeEditor=aS.length>0?aS[0]:null),dS.focusedEditor===t&&(dS.focusedEditor=null),e.length!==aS.length},fS="CSS1Compat"!==document.compatMode,dS=St(St({},NC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Wu,majorVersion:"5",minorVersion:"6.2",releaseDate:"2020-12-08",editors:uS,i18n:aa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=GC.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c;if(""!==(c=u[a].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}!t&&document.currentScript&&(-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/")))}n.baseURL=new GC(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new GC(n.baseURL),n.suffix=r,(o=n).on("AddEditor",d(Td,o)),o.on("RemoveEditor",d(_d,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&it(r,(function(t,e){sa.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=xe.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"," "),o=function(t){var e=t.id;return e||(e=dt(t,"name").filter((function(t){return!tS.get(t)})).getOrThunk(tS.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):tS.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new ZC(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};tS.unbind(window,"ready",a),function(e){var r=t[e];r&&r.apply(n,Array.prototype.slice.call(arguments,2))}("onpageload"),e=Wu.unique(function(t){var e=[];if(pe.browser.isIE()&&pe.browser.version.major<11)return Ov("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(fS)return Ov("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return nS(t.types,(function(t){e=e.concat(tS.select(t.selector))})),e;if(t.selector)return tS.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&nS(eS(n),(function(t){var n=tS.get(t);n?e.push(n):nS(document.forms,(function(n){nS(n.elements,(function(n){n.name===t&&(t="mce_editor_"+oS++,tS.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":nS(tS.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?nS(t.types,(function(n){xe.each(e,(function(e){return!tS.is(e,n.selector)||(l(o(e),rS({},t,n),e),!1)}))})):(xe.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(lS(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=xe.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):nS(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):Ov("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,tS.bind(window,"ready",a),new Cr((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?aS.slice(0):O(t)?G(aS,(function(e){return e.id===t})).getOr(null):D(t)&&aS[t]?aS[t]:null},add:function(t){var e=this;return uS[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(uS[t.id]=t),uS.push(t),aS.push(t)),sS(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Xy||(Xy=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Xy))),t},createEditor:function(t,e){return this.add(new ZC(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!O(t))return n=t,E(r.get(n.id))?null:(lS(n)&&r.fire("RemoveEditor",{editor:n}),0===aS.length&&window.removeEventListener("beforeunload",Xy),n.remove(),sS(aS.length>0),n);nS(tS.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=aS.length-1;e>=0;e--)r.remove(aS[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new ZC(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",0,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){nS(aS,(function(t){t.save()}))},addI18n:function(t,e){aa.add(t,e)},translate:function(t){return aa.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new GC(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new GC(this.baseURL)}});dS.setup();var mS,gS,hS,pS,vS=Math.min,bS=Math.max,yS=Math.round,wS=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=yS(c/2)),"c"===s[1]&&(r+=yS(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=yS(u/2)),"c"===s[4]&&(r-=yS(i/2)),xS(r,o,i,u)},xS=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},CS={inflate:function(t,e,n){return xS(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:wS,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=wS(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=bS(t.x,e.x),r=bS(t.y,e.y),o=vS(t.x+t.w,e.x+e.w),i=vS(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:xS(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=bS(0,e.x-r),l=bS(0,e.y-o),f=bS(0,i-a),d=bS(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),xS(r,o,(i-=f)-r,(u-=d)-o)},create:xS,fromClientRect:function(t){return xS(t.left,t.top,t.width,t.height)}},SS=(mS={},gS={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==mS[t])return mS[t];var o=new Cr((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);gS[t]=u.resolve,na.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return mS[t]=o,o},add:function(t,e){void 0!==gS[t]&&(gS[t](e),delete gS[t]),mS[t]=Cr.resolve(e)}}),kS=xe.each,OS=xe.extend,TS=function(){};TS.extend=hS=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!pS&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};pS=!0;var o=new this;return pS=!1,t.Mixins&&(kS(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&kS(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&kS(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&kS(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=OS({},e.Defaults,t.Defaults)),it(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=hS,n};var _S,ES=Math.min,AS=Math.max,NS=Math.round,RS={serialize:function(t){var e=JSON.stringify(t);return O(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},MS={callbacks:{},count:0,send:function(t){var e=this,n=Qu.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},zS=St(St({},NC),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Tr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",zS.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&xe.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=zS.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Tr.setTimeout(r,10)}}),DS=xe.extend,BS=function(){function t(t){this.settings=DS({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=DS(this.settings,t);r.success=function(t,o){void 0===(t=RS.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=RS.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",zS.send(r)},t}();try{var PS="__storage_test__";(_S=window.localStorage).setItem(PS,PS),_S.removeItem(PS)}catch(t){_S=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var IS={geom:{Rect:CS},util:{Promise:Cr,Delay:Tr,Tools:xe,VK:Cf,URI:GC,Class:TS,EventDispatcher:EC,Observable:NC,I18n:aa,XHR:zS,JSON:RS,JSONRequest:BS,JSONP:MS,LocalStorage:_S,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=AS(0,ES(e,1)),i=AS(0,ES(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=NS(255*(n+s)),r=NS(255*(r+s)),o=NS(255*(o+s))}else n=r=o=NS(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=ES(t/=255,ES(e/=255,n/=255)),u=AS(t,AS(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:NS(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:NS(100*r),v:NS(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:xi,Sizzle:ou,DomQuery:Wu,TreeWalker:Ar,TextSeeker:Na,DOMUtils:Qu,ScriptLoader:na,RangeUtils:Vf,Serializer:jp,StyleSheetLoader:_r,ControlSelection:kf,BookmarkManager:yf,Selection:Cp,Event:xi.Event},html:{Styles:di,Entities:Io,Node:Jd,Schema:Go,SaxParser:um,DomParser:Hp,Writer:Zd,Serializer:tm},Env:pe,AddOnManager:sa,Annotator:vf,Formatter:Bv,UndoManager:Pv,EditorCommands:yC,WindowManager:yv,NotificationManager:pv,EditorObservable:BC,Shortcuts:jC,Editor:ZC,FocusManager:Cd,EditorManager:dS,DOM:Qu.DOM,ScriptLoader:na.ScriptLoader,PluginManager:vv,ThemeManager:bv,IconManager:cv,Resource:SS,trim:xe.trim,isArray:xe.isArray,is:xe.is,toArray:xe.toArray,makeMap:xe.makeMap,each:xe.each,map:xe.map,grep:xe.grep,inArray:xe.inArray,extend:xe.extend,create:xe.create,walk:xe.walk,createNS:xe.createNS,resolve:xe.resolve,explode:xe.explode,_addCacheSuffix:xe._addCacheSuffix,isOpera:pe.opera,isWebKit:pe.webkit,isIE:pe.ie,isGecko:pe.gecko,isMac:pe.mac},LS=xe.extend(dS,IS);!function(t){window.tinymce=t,window.tinyMCE=t}(LS),function(e){try{t.exports=e}catch(t){}}(LS)}()}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{"use strict";n(7575),n(6890),n(8860),n(5209),n(3356),n(2875),n(8619),n(2540),n(8190),n(1295),n(2170),n(2682),n(1236),n(6884),n(4400),n(8208),n(6586),n(5053),n(7259),n(4926),n(5031),n(397),n(1933),n(5187),n.g.current_selection_range=null,n.g.editor=null})()})();\ No newline at end of file+(()=>{var t={2968:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.css"},6202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.min.css"},7286:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.css"},7362:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.min.css"},287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.css"},2271:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.min.css"},5417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.css"},874:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.min.css"},3341:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.css"},8786:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.css"},4243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.min.css"},9702:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.min.css"},1389:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.css"},3513:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.min.css"},1064:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/fonts/tinymce-mobile.woff"},8057:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.css"},6332:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.min.css"},4429:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.css"},18:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.min.css"},7899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.css"},7548:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.min.css"},9506:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.css"},8273:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.css"},7251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.min.css"},6122:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.min.css"},993:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.css"},8215:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.min.css"},9916:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/fonts/tinymce-mobile.woff"},8382:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.css"},4522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.min.css"},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.css"},8537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.min.css"},818:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.css"},6913:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.min.css"},8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-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 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-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 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.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 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 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 01-.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 00-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 010 2H5a1 1 0 010-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 110-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 01-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></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 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 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 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 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.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.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 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.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 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 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 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-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>',"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 01-.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 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-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.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.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 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.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 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-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 010-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 010-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 010-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-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 010-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 010-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 010-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 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.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 010-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.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-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 010-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 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-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.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.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 01-.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 01-.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 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.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 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.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 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 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 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-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 01-1-1v-2H7V9H5a1 1 0 110-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 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 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 017 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 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.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 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 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.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-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 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.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 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-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 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-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-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-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 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.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 0119 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 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.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 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-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 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 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 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-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 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-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 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-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 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 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.7l2.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-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 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.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 00-.8.8.8.8 0 01-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 012.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 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 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 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-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 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.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 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 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.7l-.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>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-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 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.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 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 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.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.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.6L34.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 00-.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 00-.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 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.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 17l-.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 01-.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 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-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 110-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 01-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="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.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 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.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 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 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 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.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 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-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 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-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 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-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 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 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 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.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 012.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 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-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 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.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 11-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 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-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.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-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 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 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 01-.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 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 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 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.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 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-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 01-.2-.6V8H5a1 1 0 110-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 01-.2-.6V13H5a1 1 0 010-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 01-.2-.6V18H5a1 1 0 010-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 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.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 010-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 00-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 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 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 017 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 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.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 00-.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 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.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-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-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 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.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 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.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 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-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 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-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 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-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 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.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.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.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 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-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 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.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 010-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 01-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 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 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 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.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 01-.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 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-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 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.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>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.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 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.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 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},6890:(t,e,n)=>{n(8785)},4400:(t,e,n)=>{n(2242)},2242:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},m=function(t,e,n){var r=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(e.parents,d),o=-1!==r?e.parents.slice(0,r):e.parents,u=i.grep(o,function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&function(t,e){return t.$.contains(t.getBody(),e)}(t,e)}}(t));return u.length>0&&u[0].nodeName===n},g=function(t,e,n,r,u,a){t.ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===u?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(i.map(a,(function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===u?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t)}})))},onAction:function(){return t.execCommand(r)},onItemAction:function(e,n){o(t,u,n)},select:function(e){return function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return function(t){return null==t?l:f(t)}(t.dom.getStyle(e,"listStyleType"))}(t).map((function(t){return e===t})).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(m(t,n,u))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}})},h=function(t,e,n,r,o,i){i.length>1?g(t,e,n,r,o,i):function(t,e,n,r,o,i){t.ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(m(t,n,o))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},onAction:function(){return t.execCommand(r)}})}(t,e,n,r,o)};r.add("advlist",(function(t){t.hasPlugin("lists")&&(function(t){h(t,"numlist","Numbered list","InsertOrderedList","OL",function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]}(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",function(t){var e=t.getParam("advlist_bullet_styles","default,circle,square");return e?e.split(/[ ,]/):[]}(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(e,n){o(t,"UL",n["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(e,n){o(t,"OL",n["list-style-type"])}))}(t))}))}()},6884:(t,e,n)=>{n(7652)},7652:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},r=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,n(e,r)):t.setStartBefore(e)},o=function(t,e,r){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,n(e,r)):t.setEndAfter(e)},i=function(t,e,n){var i,u,a,c,s,l,f,d=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i)}(t),m=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var g=t.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(l=s.length,r(g,s,l),o(g,s,l),g.endOffset<5)return;i=g.endOffset,u=s}else{if(3!==(u=g.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(r(g,u,0),o(g,u,u.nodeValue.length))}i=1===g.endOffset?2:g.endOffset-1-e}var h=i;do{r(g,u,i>=2?i-2:0),o(g,u,i>=1?i-1:0),i-=1,f=g.toString()}while(" "!==f&&""!==f&&160!==f.charCodeAt(0)&&i-2>=0&&f!==n);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(g.toString(),n)?0===g.startOffset?(r(g,u,0),o(g,u,h)):(r(g,u,i),o(g,u,h)):(r(g,u,i),o(g,u,h),i+=1),"."===(c=g.toString()).charAt(c.length-1)&&o(g,u,h-1);var p=(c=g.toString().trim()).match(d),v=function(t){return t.getParam("link_default_protocol","http","string")}(t);p&&("www."===p[1]?p[1]=v+"://www.":/@$/.test(p[1])&&!/^mailto:/.test(p[1])&&(p[1]="mailto:"+p[1]),a=t.selection.getBookmark(),t.selection.setRng(g),t.execCommand("createlink",!1,p[1]+p[2]),!1!==m&&t.dom.setAttrib(t.selection.getNode(),"target",m),t.selection.moveToBookmark(a),t.nodeChanged())}};t.add("autolink",(function(t){!function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){i(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){i(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){i(t,0,"")}(t)})))}(t)}))}()},5209:(t,e,n)=>{n(8578)},8578:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=tinymce.util.Tools.resolve("tinymce.util.Delay"),r=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},o=function(t,e,r,i,u){n.setEditorTimeout(t,(function(){a(t,e),r--?o(t,e,r,i,u):u&&u()}),i)},i=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},u=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},a=function(t,n){var o=t.dom,c=t.getDoc();if(c)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))i(t,!0);else{var s=c.documentElement,l=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),f=r(t),d=u(o,s,"margin-top",!0),m=u(o,s,"margin-bottom",!0),g=s.offsetHeight+d+m+l;g<0&&(g=0);var h=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;g+h>r(t)&&(f=g+h);var p=function(t){return t.getParam("max_height",0,"number")}(t);if(p&&f>p?(f=p,i(t,!0)):i(t,!1),f!==n.get()){var v=f-n.get();if(o.setStyle(t.getContainer(),"height",f+"px"),n.set(f),function(t){t.fire("ResizeEditor")}(t),e.browser.isSafari()&&e.mac){var b=t.getWin();b.scrollTo(b.pageXOffset,b.pageYOffset)}t.hasFocus()&&t.selection.scrollIntoView(t.selection.getNode()),e.webkit&&v<0&&a(t,n)}}};t.add("autoresize",(function(t){if(t.settings.hasOwnProperty("resize")||(t.settings.resize=!1),!t.inline){var e=(n=0,{get:function(){return n},set:function(t){n=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){a(t,e)}))}(t,e),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(){a(t,e)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){o(t,e,20,100,(function(){o(t,e,5,1e3)}))}))}(t,e)}var n}))}()},8190:(t,e,n)=>{n(7440)},7440:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.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:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})};t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){e(t)}))}(t),function(t){t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return e(t)}}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return e(t)}})}(t),{}}))}()},7259:(t,e,n)=>{n(8492)},8492:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var n,r=t.dom,i=t.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),o.each(i,(function(t){r.getParent(t.parentNode,'*[dir="'+e+'"]',r.getRoot())||r.setAttrib(t,"dir",n!==e?e:null)})),t.nodeChanged())},u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return"function"==typeof t},g=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},h=g,p=("undefined"!=typeof window?window:Function("return this;")(),function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}}),v=p(3),b=p(9),y=p(11),w=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode)?function(t){return h(t.dom.getRootNode())}:function(t){return b(t)?t:h(t.dom.ownerDocument)},x=function(t){return h(t.dom.host)},C=function(t){var e=v(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o,i,u=e.ownerDocument;return(o=h(e),i=w(o),y(i)?d.some(i):d.none()).fold((function(){return u.body.contains(e)}),(n=C,r=x,function(t){return n(r(t))}))},S=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||C(t)?r:function(t,e){return function(t){return void 0!==t.style&&m(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""}(n,e)}(t,"direction")?"rtl":"ltr"},k=function(t,e){return function(n){var r=function(t){var r=h(t.element);n.setActive(S(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};r.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){i(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){i(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:k(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:k(t,"rtl")})}(t)}))}()},4926:(t,e,n)=>{n(755)},755:()=>{!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})}(t)}))}()},2170:(t,e,n)=>{n(3302)},3302:()=>{!function(){"use strict";var t,e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},c=u("string"),s=u("object"),l=u("array"),f=(null,function(t){return null===t}),d=a("boolean"),m=a("number"),g=function(){},h=function(t){return function(){return t}},p=h(!1),v=h(!0),b=function(){return y},y=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:r,orThunk:n,map:b,each:g,bind:b,exists:p,forall:v,filter:b,equals:e,equals_:e,toArray:function(){return[]},toString:h("none()")}),w=function(t){var e=h(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.push,S=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!l(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);C.apply(e,t[n])}return e},k=("undefined"!=typeof window?window:Function("return this;")(),function(t,e,n){!function(t,e,n){if(!(c(n)||d(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)}),O=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},T=O,_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),A=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(t){return t.getParam("image_dimensions",!0,"boolean")},R=function(t){return t.getParam("images_upload_url","","string")},M=function(t){return t.getParam("images_upload_handler",void 0,"function")},z=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},D=function(t){return t&&(t=t.replace(/px$/,"")),t},B=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},P=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},I=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},L=_.DOM,H=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?D(t.style.marginLeft):""},F=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?D(t.style.marginTop):""},V=function(t){return t.style.borderWidth?D(t.style.borderWidth):""},j=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},U=function(t,e){return t.style[e]?t.style[e]:""},W=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},q=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},$=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},G=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=B(r),$(t,e)):q(t,n,r)}},X=function(t,e){return t.style[e]?D(t.style[e]):j(t,e)},K=function(t,e){var n=B(e);t.style.marginLeft=n,t.style.marginRight=n},Y=function(t,e){var n=B(e);t.style.marginTop=n,t.style.marginBottom=n},J=function(t,e){var n=B(e);t.style.borderWidth=n},Q=function(t,e){t.style.borderStyle=e},Z=function(t){return"FIGURE"===t.nodeName},tt=function(t){return 0===L.getAttrib(t,"alt").length&&"presentation"===L.getAttrib(t,"role")},et=function(t){return tt(t)?"":j(t,"alt")},nt=function(t,e){return{src:j(e,"src"),alt:et(e),title:j(e,"title"),width:X(e,"width"),height:X(e,"height"),class:j(e,"class"),style:t(j(e,"style")),caption:W(e),hspace:H(e),vspace:F(e),border:V(e),borderStyle:U(e,"borderStyle"),isDecorative:tt(e)}},rt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},ot=function(t,e,n){if(n){L.setAttrib(t,"role","presentation");var r=T(t);k(r,"alt","")}else f(e)?("alt",(r=T(t)).dom.removeAttribute("alt")):(r=T(t),k(r,"alt",e)),"presentation"===L.getAttrib(t,"role")&&L.setAttrib(t,"role","")},it=function(t,e){return function(n,r,o){t(n,o),$(n,e)}},ut=function(t,e,n){var r=nt(t,n);rt(n,r,e,"caption",(function(t,e,n){return function(t){W(t)?function(t){var e=t.parentNode;L.insertAfter(t,e),L.remove(e)}(t):function(t){var e=L.create("figure",{class:"image"});L.insertAfter(e,t),e.appendChild(t),e.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)}(t)})),rt(n,r,e,"src",q),rt(n,r,e,"title",q),rt(n,r,e,"width",G(0,t)),rt(n,r,e,"height",G(0,t)),rt(n,r,e,"class",q),rt(n,r,e,"style",it((function(t,e){return q(t,"style",e)}),t)),rt(n,r,e,"hspace",it(K,t)),rt(n,r,e,"vspace",it(Y,t)),rt(n,r,e,"border",it(J,t)),rt(n,r,e,"borderStyle",it(Q,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||ot(t,n.alt,n.isDecorative)}(n,r,e)},at=function(t,e){var n=t.dom.styles.parse(e),r=P(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},ct=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||I(e))?null:e},st=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,(function(e){return!!t.schema.getTextBlockElements()[e.nodeName]}),t.getBody());return r?n.split(r,e):e},lt=Object.prototype.hasOwnProperty,ft=(t=function(t,e){return s(t)&&s(e)?ft(t,e):e},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)lt.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}),dt=tinymce.util.Tools.resolve("tinymce.util.Tools"),mt=function(t){return c(t.value)?t.value:""},gt=function(t,e){var n=[];return dt.each(t,(function(t){var r=function(t){return c(t.text)?t.text:c(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=gt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},ht=function(t){return void 0===t&&(t=mt),function(e){return e?x.from(e).map((function(e){return gt(e,t)})):x.none()}},pt=function(t,e){return function(t,n){for(var r=0;r<t.length;r++){var o=function(t){return Object.prototype.hasOwnProperty.call(t,"items")}(i=t[r])?pt(i.items,e):i.value===e?x.some(i):x.none();if(o.isSome())return o}var i;return x.none()}(t)},vt=ht,bt=function(t,e){return t.bind((function(t){return pt(t,e)}))};var yt=function(t){var e,n=vt((function(e){return t.convertURL(e.value||e.url,"src")})),r=new E((function(e){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);"string"==typeof n?A.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}(t,(function(t){e(n(t).map((function(t){return S([[{text:"None",value:""}],t])})))}))})),o=(e=function(t){return t.getParam("image_class_list")}(t),ht(mt)(e)),i=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),u=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return!!R(t)}(t),s=function(t){return!!M(t)}(t),l=function(t){var e=ct(t);return e?nt((function(e){return at(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),f=function(t){return t.getParam("image_description",!0,"boolean")}(t),d=function(t){return t.getParam("image_title",!1,"boolean")}(t),m=N(t),g=function(t){return t.getParam("image_caption",!1,"boolean")}(t),h=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),p=R(t),v=function(t){return t.getParam("images_upload_base_path",void 0,"string")}(t),b=function(t){return t.getParam("images_upload_credentials",!1,"boolean")}(t),y=M(t),w=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),C=x.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return c(t)&&t.length>0}));return r.then((function(t){return{image:l,imageList:t,classList:o,hasAdvTab:i,hasUploadTab:u,hasUploadUrl:a,hasUploadHandler:s,hasDescription:f,hasImageTitle:d,hasDimensions:m,hasImageCaption:g,url:p,basePath:v,credentials:b,handler:y,prependURL:C,hasAccessibilityOptions:h,automaticUploads:w}}))},wt=function(t){var e=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),n={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},r=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[n]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:S([r.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},xt=function(t){return{title:"General",name:"general",items:wt(t)}},Ct=wt,St=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},kt=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Ot=function(t,e,n,r){(function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?x.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?x.some(t+e):x.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))})(e,r),function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=ft({},n);!function(t,e,n){t.hasDescription&&c(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&c(n.title)&&(e.title=n.title),t.hasDimensions&&(c(n.width)&&(e.dimensions.width=n.width),c(n.height)&&(e.dimensions.height=n.height)),c(n.class)&&bt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&d(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(c(n.style)&&(e.style=n.style),c(n.vspace)&&(e.vspace=n.vspace),c(n.border)&&(e.border=n.border),c(n.hspace)&&(e.hspace=n.hspace),c(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}}(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=bt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Tt=function(t,e,n,r){var o,i=r.getData();r.block("Uploading image"),(o=i.fileinput,function(t,e){return 0<t.length?x.some(t[0]):x.none()}(o)).fold((function(){r.unblock()}),(function(o){var i,u,a,c=URL.createObjectURL(o),s=(u={url:e.url,basePath:e.basePath,credentials:e.credentials,handler:e.handler},a=function(t,e,n,r){var o=new XMLHttpRequest;o.open("POST",u.url),o.withCredentials=u.credentials,o.upload.onprogress=function(t){r(t.loaded/t.total*100)},o.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){if(o.status<200||o.status>=300)n("HTTP Error: "+o.status);else{var t,r,i=JSON.parse(o.responseText);i&&"string"==typeof i.location?e((t=u.basePath,r=i.location,t?t.replace(/\/$/,"")+"/"+r.replace(/^\//,""):r)):n("Invalid JSON: "+o.responseText)}};var i=new FormData;i.append("file",t.blob(),t.filename()),o.send(i)},u=dt.extend({credentials:!1,handler:a},u),{upload:function(t){return u.url||u.handler!==a?function(t,e){return new E((function(n,r){try{e(t,n,r,g)}catch(t){r(t.message)}}))}(t,u.handler):E.reject("Upload url missing from the settings.")}}),l=function(){r.unblock(),URL.revokeObjectURL(c)},f=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ot(t,e,n,r)};(i=o,new E((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,c,n);e.automaticUploads?s.upload(i).then((function(t){f(t),l()})).catch((function(e){l(),t.alertErr(e)})):(t.addToBlobCache(i),f(i.blobUri()),r.unblock())}))}))},_t=function(t,e,n){return function(r,o){"src"===o.name?Ot(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=bt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ot(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=function(t,e,n){var r=P(t(n.style)),o=ft({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?D(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?D(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?D(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o}(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=ft(St(e.image),n.getData()),o=function(t,e){var n=document.createElement("img");return q(n,"style",e.style),(H(n)||""!==e.hspace)&&K(n,e.hspace),(F(n)||""!==e.vspace)&&Y(n,e.vspace),(V(n)||""!==e.border)&&J(n,e.border),(function(t){return U(t,"borderStyle")}(n)||""!==e.borderStyle)&&Q(n,e.borderStyle),t(n.getAttribute("style"))}(t.normalizeCss,kt(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?Tt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Et=function(t){return function(){t.open=!1}},At=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:S([[xt(t)],t.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{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"}]}]}]}]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Ct(t)}},Nt=function(t){return function(e){return function(n){var r=ft(St(e.image),n.getData());t.execCommand("mceUpdateImage",!1,kt(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Rt=function(t){return function(e){return function(t){return new E((function(e){var n=document.createElement("img"),r=function(t){n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:z(n.width,n.clientWidth),height:z(n.height,n.clientHeight)};r(E.resolve(t))},n.onerror=function(){r(E.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},Mt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Dt=function(t){return function(e){t.windowManager.alert(e)}},Bt=function(t){return function(e){return at(t,e)}},Pt=function(t){return function(e){return t.dom.parseStyle(e)}},It=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},Lt=function(t){var e={onSubmit:Nt(t),imageSize:Rt(t),addToBlobCache:zt(t),createBlobCache:Mt(t),alertErr:Dt(t),normalizeCss:Bt(t),parseStyle:Pt(t),serializeStyle:It(t)};return{open:function(){yt(t).then(function(t){return function(e){var n=function(t){return{prevImage:bt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:At(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:St(e.image),onSubmit:t.onSubmit(e),onChange:_t(t,e,n),onClose:Et(n)}}}(e)).then(t.windowManager.open)}}},Ht=function(t){t.addCommand("mceImage",Lt(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return function(t,e){var n=ct(t);if(n){var r=nt((function(e){return at(t,e)}),n),o=i(i({},r),e);o.src?function(t,e){var n=ct(t);if(ut((function(e){return at(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),Z(n.parentNode)){var r=n.parentNode;st(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!N(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)}(t,o):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&function(t,e){var n=function(t,e){var n=document.createElement("img");if(ut(t,i(i({},e),{caption:!1}),n),ot(n,e.alt,e.isDecorative),e.caption){var r=L.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(L.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return at(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Z(r)){var o=st(t,r);t.selection.select(o)}else t.selection.select(r)}(t,i(i({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))}(t,n)}))}))},Ft=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},Vt=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];Ft(o)&&(o.attr("contenteditable",t?"false":null),dt.each(o.getAll("figcaption"),r))}}};o.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",Vt(!0)),t.serializer.addNodeFilter("figure",Vt(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Lt(t).open,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Lt(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return Z(t)||"IMG"===t.nodeName&&!I(t)?["image"]:[]}})}(t),Ht(t)}))}()},5053:(t,e,n)=>{n(3253)},3253:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return l},l=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:s,each:function(){},bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),f=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return!function(t){return null==t}(t)},g=("function",function(t){return"function"==typeof t});function h(t,e){return b(document.createElement("canvas"),t,e)}function p(t){var e=h(t.width,t.height);return v(e).drawImage(t,0,0),e}function v(t){return t.getContext("2d")}function b(t,e,n){return t.width=e,t.height=n,t}var y=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function w(t){return new y((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}function x(t){return new y((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return d.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,m=Math.min(f+i,a),g=new Array(m-f),h=f,p=0;h<m;++p,++h)g[p]=u[h].charCodeAt(0);s[l]=new Uint8Array(g)}return d.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))}function C(t,e,n){return e=e||"image/png",g(HTMLCanvasElement.prototype.toBlob)?new y((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):x(t.toDataURL(e,n))}var S=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()}(t,e,a)};function k(t,e,n){var r=e.type;function o(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:u(r),toBlob:function(){return y.resolve(e)},toDataURL:u(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return C(t,e,n)}))},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(p)}}}function O(t){return function(t){return new y((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return k(function(t){return w(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=h(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return v(e).drawImage(t,0,0),e}))}(t),t,e)}))}function T(t,e){return C(t,e).then((function(e){return k(y.resolve(t),e,t.toDataURL())}))}var _=Object.keys,E=function(t,e,n){return void 0===n&&(n=!1),new y((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=_(t),r=0,i=n.length;r<i;r++){var u=n[r];a=t[u],c=u,o.setRequestHeader(c,a)}var a,c}(e),o.responseType="blob",o.send()}))},A=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],N=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],R=function(t){var e=function(t){return"ImageProxy HTTP error: "+S(A,(function(e){return t===e.code})).fold(u("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return y.reject(e)},M=function(t){return S(N,(function(e){return e.type===t})).fold(u("Unknown service error"),(function(t){return t.message}))},z=function(t){return function(t){return new y((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=function(t){return"ImageProxy Service error: "+function(t){try{return d.some(JSON.parse(t))}catch(t){return d.none()}}(t).bind((function(t){return(e=t,n=["error","type"],r=function(t,e){return m(t)?t[e]:void 0},o=e,function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(n,(function(t){o=r(o,t)})),i=o,d.from(i)).map(M);var e,n,r,o,i})).getOr("Invalid JSON in service error message")}(t);return y.reject(e)}))},D=function(t){return t<200||t>=300},B=function(t,e,n){return void 0===n&&(n=!1),e?function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return E(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return D(t.status)?function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e=t.status,n=t.blob)?z(n):R(e):y.resolve(t.blob);var e,n}))}(t,e):function(t,e){return E(t,{},e).then((function(t){return D(t.status)?R(t.status):y.resolve(t.blob)}))}(t,n)},P=function(t){return O(t)},I=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},L=I,H=("undefined"!=typeof window?window:Function("return this;")(),function(t,e){return function(t,n){return S(t.dom.childNodes,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(L(t),e)})).map(L)}(t)}),F=tinymce.util.Tools.resolve("tinymce.util.Delay"),V=tinymce.util.Tools.resolve("tinymce.util.Promise"),j=tinymce.util.Tools.resolve("tinymce.util.URI"),U=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},W=function(t){return t.getParam("imagetools_proxy")};function q(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)}function $(t){return{w:t.naturalWidth,h:t.naturalHeight}}var G=0,X=function(t){return H(L(t),"img")},K=function(t,e){return t.dom.is(e,"figure")},Y=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},J=function(t,e){var n=function(e){return Y(t,e)&&(et(t,e)||nt(t,e)||m(W(t)))};return K(t,e)?X(e).bind((function(t){return n(t.dom)?d.some(t.dom):d.none()})):n(e)?d.some(e):d.none()},Q=function(t,e){t.notificationManager.open({text:e,type:"error"})},Z=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&K(t,n)?X(n):Y(t,e)?d.some(L(e)):d.none()},tt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return m(r)?t.dom.encode(r[n]):null},et=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new j(n).host===t.documentBaseURI.host},nt=function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new j(e.src).host)},rt=function(t,e){if(nt(t,e))return B(e.src,null,function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new j(e.src).host)}(t,e));if(!et(t,e)){var n=W(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return B(r,o,!1)}return function(t){var e,n=t.src;return 0===n.indexOf("data:")?x(n):(e=n,new y((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(){200===this.status&&t(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()})))}(e)},ot=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?V.resolve(n.blob()):function(t,e){return function(t){return d.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return rt(t,e)}),(function(t){return t(e)}))}(t,e)},it=function(t){F.clearTimeout(t.get())},ut=function(t,e,n,r,o,i,u){return n.toBlob().then((function(a){var c,s,l,f,d=t.editorUpload.blobCache;c=i.src;var g=e.type===a.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(f=d.getByUri(c),m(f)?(c=f.uri(),s=f.name(),l=f.filename()):(s=tt(t,c,2),l=tt(t,c,1))),f=d.create({id:"imagetools"+G++,blob:a,base64:n.toBase64(),uri:c,name:s,filename:g?l:void 0}),d.add(f),t.undoManager.transact((function(){t.$(i).on("load",(function e(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(it(o),function(t,e){var n=F.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))})),u&&t.$(i).attr({width:u.w,height:u.h}),t.$(i).attr({src:f.blobUri()}).removeAttr("data-mce-src")})),f}))},at=function(t,e,n,r){return function(){return Z(t).fold((function(){Q(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return ot(t,o.dom)})).then((function(i){return P(i).then(n).then((function(n){return ut(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){Q(t,e)}))}))}},ct=function(t,e,n){return function(){var r=Z(t).fold((function(){return null}),(function(t){var e=q(t.dom);return e?{w:e.h,h:e.w}:null}));return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||b(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}),r)()}},st=function(t,e,n){return function(){return at(t,e,(function(t){return function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=h(t.width,t.height),o=v(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),T(r,e)}(n,t.getType(),e)}))}(t,e)}(t,n)}))()}},lt=function(t,e){return function(){var n=Z(t),r=n.map((function(t){return $(t.dom)}));n.each((function(o){J(t,o.dom).each((function(i){ot(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){!function(t,e,n,r,o){(function(t){return w(t)})(o).then((function(t){var e=$(t);return r.w===e.w&&r.h===e.h||q(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(P).then((function(r){return ut(t,o,r,!0,e,n)})).catch((function(){}))}(t,e,n.dom,r,i)}))})),o.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};o.add("imagetools",(function(t){var e=r(0),n=r(null);!function(t,e){i.each({mceImageRotateLeft:ct(t,e,-90),mceImageRotateRight:ct(t,e,90),mceImageFlipVertical:st(t,e,"v"),mceImageFlipHorizontal:st(t,e,"h"),mceEditImage:lt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:e("mceImageRotateLeft")}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:e("mceImageRotateRight")}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:e("mceImageFlipVertical")}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:e("mceImageFlipHorizontal")}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:e("mceEditImage"),onSetup:function(e){var n=function(){var n=Z(t).forall((function(e){return J(t,e.dom).isNone()}));e.setDisabled(n)};return t.on("NodeChange",n),function(){t.off("NodeChange",n)}}}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:e("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(n){return J(t,n).fold((function(){return[]}),(function(t){return[{text:"Edit image",icon:"edit-image",onAction:e("mceEditImage")}]}))}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:U(t),predicate:function(e){return J(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=J(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(it(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},2682:(t,e,n)=>{n(7384)},7384:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(null,function(t){return null===t}),l=u("boolean"),f=u("function"),d=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},m=function(t){return t.getParam("default_link_target")},g=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},p=function(t){return t.getParam("link_title",!0,"boolean")},v=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},b=function(t){return t.getParam("link_default_protocol","http","string")},y=function(){},w=function(t){return function(){return t}},x=w(!1),C=w(!0),S=function(){return k},k=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:x,isSome:x,isNone:C,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:w(null),getOrUndefined:w(void 0),or:n,orThunk:e,map:S,each:y,bind:S,exists:x,forall:C,filter:S,equals:t,equals_:t,toArray:function(){return[]},toString:w("none()")}),O=function(t){var e=w(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:C,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return O(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:k},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(x,(function(e){return n(t,e)}))}};return o},T={some:O,none:S,from:function(t){return null==t?k:O(t)}},_=Array.prototype.indexOf,E=Array.prototype.push,A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},N=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return T.none()},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},M=function(t,e){return t?T.some(e):T.none()},z=tinymce.util.Tools.resolve("tinymce.util.Tools"),D=function(t){return a(t.value)?t.value:""},B=function(t,e){var n=[];return z.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=B(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},P=function(t){return void 0===t&&(t=D),function(e){return T.from(e).map((function(e){return B(e,t)}))}},I=function(t){return P(D)(t)},L=P,H=function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},F=D,V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=Object.keys,U=Object.hasOwnProperty,W=function(t,e){return U.call(t,e)},q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t){return t&&"a"===t.nodeName.toLowerCase()},G=function(t){return $(t)&&!!Y(t)},X=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new q(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},K=function(t){return/^\w+:/i.test(t)},Y=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},J=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===z.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return z.trim(t.sort().join(" "))}(i):""},Q=function(t,e){return e=e||t.selection.getNode(),nt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},Z=function(t,e){return(e?e.innerText||e.textContent:t.getContent({format:"text"})).replace(/\uFEFF/g,"")},tt=function(t){return z.grep(t,G).length>0},et=function(t){var e=t.schema.getTextInlineElements();return 0===X(t.selection.getRng(),(function(t){return 1===t.nodeType&&!$(t)&&!W(e,t.nodeName.toLowerCase())})).length},nt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},rt=function(t,e,n){var r=t.selection.getNode(),o=Q(t,r),i=function(t,e){var n=V({},e);if(!(h(t).length>0)&&!1===v(t)){var r=J(n.rel,"_blank"===n.target);n.rel=r||null}return T.from(n.target).isNone()&&!1===g(t)&&(n.target=m(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||K(t)?t:e+"://"+t}(n.href,d(t)),n}(t,function(t){return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(e,(function(t){r=n(r,t)})),r;var e,n,r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){nt(e)?ct(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},ot=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return function(t,e,n,r){(function(t,e){for(var n=j(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}})(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,(function(t,e){return!1===s(t)}),(n=r,function(t,e){n[e]=t}),y),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()})},it=function(t,e,n){t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ot(n)):rt(t,e,n)},ut=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();nt(e)?at(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},at=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},ct=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},st=function(t,e){return N(e,(function(e){return function(t){return W(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n}(e)?st(t,e.items):M(e.value===t,e)}))},lt=function(t,e){var n={text:t.text,title:t.title},r=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:T.none()).getOr([]);return function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?st(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:y}},text:i?t:e.text}})):T.none()}(n.text,r.name,u,t)};return{onChange:function(t,e){var o,i,u,a,c=e.name;return"url"===c?(o=t(),i=o.url,u=M(n.text.length<=0,T.from(i.meta.text).getOr(i.value)),a=function(t){return M(n.title.length<=0,T.from(t.meta.title).getOr(""))}(o.url),u.isSome()||a.isSome()?T.some(V(V({},u.map((function(t){return{text:t}})).getOr({})),a.map((function(t){return{title:t}})).getOr({}))):T.none()):function(t,e){return _.call(t,e)}(["anchor","link"],c)>-1?r(t(),e):"text"===c||"title"===c?(n[c]=t()[c],T.none()):T.none()}}},ft=tinymce.util.Tools.resolve("tinymce.util.Delay"),dt=tinymce.util.Tools.resolve("tinymce.util.Promise"),mt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?T.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return V(V({},t),{href:"mailto:"+e})}}):T.none()},gt=function(t,e){return function(n){var r=n.href;return 1===t&&!K(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?T.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return V(V({},t),{href:e+"://"+r})}}):T.none()}},ht=function(t){var e=t.dom.select("a:not([href])"),n=A(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]})));return n.length>0?T.some([{text:"None",value:""}].concat(n)):T.none()},pt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?I(e):T.none()},vt=tinymce.util.Tools.resolve("tinymce.util.XHR"),bt=function(t,e){var n=h(t);if(n.length>0){var r=e.is("_blank");return(!1===v(t)?L((function(t){return J(F(t),r)})):I)(n)}return T.none()},yt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],wt=function(t){var e=g(t);return c(e)?I(e).orThunk((function(){return T.some(yt)})):!1===e?T.none():T.some(yt)},xt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?T.some(r):T.none()},Ct=function(t,e){return function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new dt((function(t){a(n)?vt.send({url:n,success:function(e){return t(function(t){try{return T.some(JSON.parse(t))}catch(t){return T.none()}}(e))},error:function(e){return t(T.none())}}):f(n)?n((function(e){return t(T.some(e))})):t(T.from(n))})).then((function(t){return t.bind(L(e)).map((function(t){return t.length>0?[{text:"None",value:""}].concat(t):t}))}))}(t).then((function(n){var r=function(t,e){var n=t.dom,r=et(t)?T.some(Z(t.selection,e)):T.none(),o=e?T.some(n.getAttrib(e,"href")):T.none(),i=e?T.from(n.getAttrib(e,"target")):T.none(),u=xt(n,e,"rel"),a=xt(n,e,"class");return{url:o,text:r,title:xt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:wt(t),rels:bt(t,r.target),classes:pt(t),anchor:ht(t),link:n},optNode:T.from(e),flags:{titleEnabled:p(t)}}}))},St=function(t){(function(t){var e=Q(t);return Ct(t,e)})(t).then((function(e){var n=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ut(t),void n.close();var o=function(t){return T.from(r[t]).filter((function(n){return!e.anchor[t].is(n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};(function(t,e){return N([mt,gt(d(t),b(t))],(function(t){return t(e)})).fold((function(){return dt.resolve(e)}),(function(n){return new dt((function(r){!function(t,e,n){var r=t.selection.getRng();ft.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))})(t,i).then((function(e){it(t,u,e)})),n.close()}}(t,e);return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,T.from(m(n))),u=t.catalogs,a=lt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:A([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([u.anchor.map(H("anchor","Anchors")),u.rels.map(H("rel","Rel")),u.targets.map(H("target","Open link in...")),u.link.map(H("link","Link list")),u.classes.map(H("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,n,t)})).then((function(e){t.windowManager.open(e)}))},kt=function(t,e){return t.dom.getParent(e,"a[href]")},Ot=function(t){return kt(t,t.selection.getStart())},Tt=function(t,e){if(e){var n=Y(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else!function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)}(e.href)}},_t=function(t){return function(){St(t)}},Et=function(t){return function(){Tt(t,Ot(t))}},At=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Nt=function(t){return function(e){return At(t,(function(){e.setActive(!t.mode.isReadOnly()&&null!==Q(t,t.selection.getNode()))}))}},Rt=function(t){return function(e){var n=function(){return e.setDisabled(null===Q(t,t.selection.getNode()))};return n(),At(t,n)}},Mt=function(t){return function(e){var n=function(e){return tt(e)||(n=t.selection.getRng(),X(n,G).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),At(t,(function(t){return e.setDisabled(!n(t.parents))}))}};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:_t(t),onSetup:Nt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Et(t),onSetup:Rt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:_t(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ut(t)},onSetup:Mt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return tt(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!Q(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Nt(t)},label:"Link",predicate:function(e){return!!Q(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=Q(t);return e?Y(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!Q(t,n)),Nt(t)(e)},onAction:function(e){var n=Q(t),r=e.getValue();if(n)t.undoManager.transact((function(){t.dom.setAttrib(n,"href",r),function(t){t.selection.collapse(!1)}(t),e.hide()}));else{var o={href:r,attach:function(){}},i=et(t)?T.some(Z(t.selection,n)).filter((function(t){return t.length>0})).or(T.from(r)):T.none();it(t,o,{href:r,text:i,title:T.none(),rel:T.none(),target:T.none(),class:T.none()}),e.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ut(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Et(t)(),e.hide()}}]})}(t),function(t){t.on("click",(function(e){var n=kt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Tt(t,n))})),t.on("keydown",(function(e){var n=Ot(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Tt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?_t(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},1236:(t,e,n)=>{n(7585)},7585:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){},i=function(t){return function(){return t}},u=function(t){return function(e){return!t(e)}},a=i(!1),c=i(!0),s=function(){return l},l=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:s,each:o,bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}}(),f=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return o},d={some:f,none:s,from:function(t){return null==t?l:f(t)}},m=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},g=function(t){return function(e){return typeof e===t}},h=m("string"),p=m("array"),v=g("boolean"),b=g("function"),y=g("number"),w=Array.prototype.slice,x=Array.prototype.push,C=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},k=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},O=function(t,e,n){return S(t,(function(t){n=e(n,t)})),n},T=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return d.some(i);if(n(i,r))break}return d.none()},_=function(t,e){return T(t,e,a)},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!p(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e}(C(t,e))},A=function(t){var e=w.call(t,0);return e.reverse(),e},N=function(t,e){return e>=0&&e<t.length?d.some(t[e]):d.none()},R=function(t){return N(t,0)},M=function(t){return N(t,t.length-1)},z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(){return B(0,0)},B=function(t,e){return{major:t,minor:e}},P=function(t,e){var n=String(e).toLowerCase();return 0===t.length?D():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return B(r(1),r(2))}(t,n)},I=D,L=function(t,e){var n=String(e).toLowerCase();return _(t,(function(t){return t.search(n)}))},H=function(t,e){return-1!==t.indexOf(e)},F=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,V=function(t){return function(e){return H(e,t)}},j=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return H(t,"edge/")&&H(t,"chrome")&&H(t,"safari")&&H(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,F],search:function(t){return H(t,"chrome")&&!H(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return H(t,"msie")||H(t,"trident")}},{name:"Opera",versionRegexes:[F,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:V("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:V("firefox")},{name:"Safari",versionRegexes:[F,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(H(t,"safari")||H(t,"mobile/"))&&H(t,"applewebkit")}}],U=[{name:"Windows",search:V("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return H(t,"iphone")||H(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:V("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:V("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:V("linux"),versionRegexes:[]},{name:"Solaris",search:V("sunos"),versionRegexes:[]},{name:"FreeBSD",search:V("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:V("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],W={browsers:i(j),oses:i(U)},q="Edge",$="Chrome",G="Opera",X="Firefox",K="Safari",Y=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(q),isChrome:r($),isIE:r("IE"),isOpera:r(G),isFirefox:r(X),isSafari:r(K)}},J=function(){return Y({current:void 0,version:I()})},Q=Y,Z=(i(q),i($),i("IE"),i(G),i(X),i(K),"Windows"),tt="Android",et="Linux",nt="Solaris",rt="FreeBSD",ot="ChromeOS",it=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Z),isiOS:r("iOS"),isAndroid:r(tt),isOSX:r("OSX"),isLinux:r(et),isSolaris:r(nt),isFreeBSD:r(rt),isChromeOS:r(ot)}},ut=function(){return it({current:void 0,version:I()})},at=it,ct=(i(Z),i("iOS"),i(tt),i(et),i("OSX"),i(nt),i(rt),i(ot),function(t,e){var n=W.browsers(),r=W.oses(),o=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(J,Q),u=function(t,e){return L(t,e).map((function(t){var n=P(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ut,at),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}}(u,o,t,e);return{browser:o,os:u,deviceType:a}}),st=function(t){return window.matchMedia(t).matches},lt=(t=function(){return ct(navigator.userAgent,st)},n=!1,function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}),ft=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},dt=function(t,e){var n=(e||document).createElement(t);return ft(n)},mt=ft,gt=function(t,e){return t.dom===e.dom},ht=function(t,e){return lt().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},pt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},vt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),yt=tinymce.util.Tools.resolve("tinymce.util.VK"),wt=Object.keys,xt=function(t,e){for(var n=wt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ct=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),St=(1,function(t){return 1===function(t){return t.dom.nodeType}(t)}),kt=function(t,e){var n=t.dom;xt(e,(function(t,e){!function(t,e,n){if(!(h(n)||v(n)||y(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Ot=function(t){return O(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Tt=function(t){return d.from(t.dom.parentNode).map(mt)},_t=function(t){return C(t.dom.childNodes,mt)},Et=function(t,e){var n=t.dom.childNodes;return d.from(n[e]).map(mt)},At=function(t){return Et(t,0)},Nt=function(t){return Et(t,t.dom.childNodes.length-1)},Rt=function(t,e){Tt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Mt=function(t,e){t.dom.appendChild(e.dom)},zt=function(t,e){S(e,(function(e){Mt(t,e)}))},Dt=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Bt=function(t){return function(t,e){return mt(t.dom.cloneNode(!0))}(t)},Pt=function(t,e){var n=function(t,e){var n=dt(e),r=Ot(t);return kt(n,r),n}(t,e);Rt(t,n);var r=_t(t);return zt(n,r),Dt(t),n},It=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ht=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ft=function(t){return function(e){return e&&t.test(e.nodeName)}},Vt=function(t){return t&&3===t.nodeType},jt=Ft(/^(OL|UL|DL)$/),Ut=Ft(/^(OL|UL)$/),Wt=Ht("ol"),qt=Ft(/^(LI|DT|DD)$/),$t=Ft(/^(DT|DD)$/),Gt=Ft(/^(TH|TD)$/),Xt=Ht("br"),Kt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Yt=function(t,e){return t&&t.nodeName in e},Jt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Qt=function(t,e){return t.isChildOf(e,t.getRoot())},Zt=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Yt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Yt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},te=It.DOM,ee=function(t){pt(t,"dt")&&Pt(t,"dd")},ne=function(t,e){if(Vt(t))return{container:t,offset:e};var n=vt.getNode(t,e);return Vt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Vt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Vt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},re=function(t){var e=t.cloneRange(),n=ne(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=ne(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},oe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ie=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ae(t,n))},ue=function(t){var e=t.selection.getSelectedBlocks();return Lt.grep(function(t,e){var n=Lt.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",ae(t,e))||e}));return oe.unique(n)}(t,e),(function(t){return qt(t)}))},ae=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ce=function(t,e){var n=t.dom.getParents(e,"ol,ul",ae(t,e));return M(n)},se=function(t,e){var n=C(e,(function(e){return ce(t,e).getOr(e)}));return oe.unique(n)},le=function(t,e,n){return t.isSome()&&e.isSome()?d.some(n(t.getOrDie(),e.getOrDie())):d.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!h(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&b(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){Mt(t.item,e.list)},ge=function(t,e){var n={list:dt(e,t),item:dt("li",t)};return Mt(n.list,n.item),n},he=function(t){return pt(t,"OL,UL")},pe=function(t){return At(t).map(he).getOr(!1)},ve=function(t){return t.depth>0},be=function(t){return t.isSelected},ye=function(t){var e=_t(t),n=Nt(t).map(he).getOr(!1)?e.slice(0,-1):e;return C(n,Bt)},we=function(t){return S(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return T(A(t.slice(0,e)),r,o).orThunk((function(){return T(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=function(t,e){var n={};return function(t,e,n,r){xt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),o),n}(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=z({},r.listAttributes));var n,r}))})),t},xe=function(t,e,n,r){return At(r).filter(he).fold((function(){e.each((function(t){gt(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return Tt(t).filter(St).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:ye(t),itemAttributes:Ot(t),listAttributes:Ot(r),listType:Ct(r)}}))}(r,t,n.get());e.each((function(t){gt(t.end,r)&&n.set(!1)}));var i=Nt(r).filter(he).map((function(r){return Ce(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Ce(t,e,n,r)}))},Ce=function(t,e,n,r){return E(_t(r),(function(r){return(he(r)?Ce:xe)(t+1,e,n,r)}))},Se=function(t,e){var n=we(e);return function(t,e){var n=O(e,(function(e,n){return n.depth>e.length?function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item.dom,de(r,"list-style-type","none");var r;M(t).each((function(t){kt(t.list,e.listAttributes),kt(t.item,e.itemAttributes),zt(t.item,e.content)}))}(o,n),r=o,le(M(e),R(r),me),e.concat(o)}(t,e,n):function(t,e,n){var r=e.slice(0,n.depth);return M(r).each((function(e){!function(t,e){Mt(t.list,e),t.item=e}(e,function(t,e,n){var r=dt("li",t);return kt(r,e),zt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){Ct(t.list)!==e.listType&&(t.list=Pt(t.list,e.listType)),kt(t.list,e.listAttributes)}(e,n)})),r}(t,e,n)}),[]);return R(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},ke=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return C(t,(function(t){return{sourceList:t,entries:Ce(0,e,r,t)}}))}(e,function(t){var e=C(ue(t),mt);return le(_(e,u(pe)),_(A(e),u(pe)),(function(t,e){return{start:t,end:e}}))}(t));S(r,(function(e){!function(t,e){S(k(t,be),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return E(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ve),(function(e){return R(e).map(ve).getOr(!1)?Se(t,e):function(t,e){var n=we(e);return C(n,(function(e){var n,r,o=(n=e.content,r=document.createDocumentFragment(),S(n,(function(t){r.appendChild(t.dom)})),mt(r));return mt(Zt(t,o.dom))}))}(t,e)}))}(t,e.entries);S(o,(function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,S(o,(function(t){Rt(r,t)})),Dt(e.sourceList)}))},Oe=function(t,e){var n=C(function(t){var e=function(t){var e=ce(t,t.selection.getStart()),n=k(t.selection.getSelectedBlocks(),Ut);return e.toArray().concat(n)}(t);return se(t,e)}(t),mt),r=C(function(t){return k(ue(t),$t)}(t),mt),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();ke(t,n,e),function(t,e,n){S(n,"Indent"===e?ee:function(e){return function(t,e){pt(e,"dd")?Pt(e,"dt"):pt(e,"dt")&&Tt(e).each((function(n){return function(t,e,n){var r=te.select('span[data-mce-type="bookmark"]',e),o=Zt(t,n),i=te.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){te.remove(c);break}t.dom.isEmpty(a)||te.insertAfter(a,e),te.insertAfter(o,e),Jt(t.dom,n.parentNode)&&(u=n.parentNode,Lt.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),te.remove(u)),te.remove(n),Jt(t.dom,e)&&te.remove(e)}(t,n.dom,e.dom)}))}(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(re(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Te=function(t){return Oe(t,"Indent")},_e=function(t){return Oe(t,"Outdent")},Ee=function(t){return Oe(t,"Flatten")},Ae=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Ne=It.DOM,Re=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=Ne.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):Ne.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},Me=function(t){function e(e){var n,r,o;n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(n),n=n.parentNode,Ne.remove(o),!n.hasChildNodes()&&Ne.isBlock(n)&&n.appendChild(Ne.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Ne.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),re(n)},ze=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},De=function(t){return/\btox\-/.test(t.className)},Be=function(t,e,n){var r=function(t){var r=T(t.parents,jt,Gt).filter((function(t){return t.nodeName===e&&!De(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Pe=function(t,e){Lt.each(e,(function(e,n){t.setAttribute(n,e)}))},Ie=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Pe(e,n["list-attributes"]),Lt.each(t.select("li",e),(function(t){Pe(t,n["list-item-attributes"])}))}(t,e,n)},Le=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Xt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Kt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},He=function(t,e,n){return function(t,e){return t&&e&&jt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Fe=function(t,e){var n,r;if(n=e.nextSibling,He(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,He(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},Ve=function(t){return"list-style-type"in t},je=function(t,e,n){var r=ie(t),o=function(t){var e=ie(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return Lt.grep(t.querySelectorAll("ol,ul,dl"),(function(t){return jt(t)}))}(e):Lt.grep(n,(function(t){return jt(t)&&e!==t}))}(t);n=n||{},r&&o.length>0?function(t,e,n,r,o){if(e.nodeName!==r||Ve(o)){var i=Re(t.selection.getRng(!0));Lt.each([e].concat(n),(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Ie(t.dom,o,r),fe(t,ze(n),o)}else Ie(t.dom,e,r),fe(t,ze(n),e)}(t,e,r,o)})),t.selection.setRng(Me(i))}else Ee(t)}(t,r,o,e,n):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Ve(r)||De(e)){var o=Re(t.selection.getRng(!0));Ie(t.dom,e,r);var i=t.dom.rename(e,n);Fe(t.dom,i),t.selection.setRng(Me(o)),fe(t,ze(n),i)}else Ee(t);else(function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=ae(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=Re(r);Lt.each(function(t,e,n){for(var r,o=[],i=t.dom,u=Le(t,e,!0,n),a=Le(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Lt.each(c,(function(e){if(Kt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Xt(e))return Xt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Ae.isBookmarkNode(e)&&(Kt(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i),(function(r){var i,a=r.previousSibling;a&&jt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Lt.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r),Ie(u,i,n),Fe(t.dom,i)})),t.selection.setRng(Me(a))}})(t,n,r),fe(t,ze(n),e)}(t,r,e,n)},Ue=It.DOM,We=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Vt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=vt.getNode(o,i));var a=new bt(o,r);for(n&&function(t,e){return!!Xt(e)&&t.isBlock(e.nextSibling)&&!Xt(e.previousSibling)}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Vt(o)&&o.data.length>0)return o}},qe=function(t,e){var n=e.childNodes;return 1===n.length&&!jt(n[0])&&t.isBlock(n[0])},$e=function(t,e,n){var r,o=e.parentNode;if(Qt(t,e)&&Qt(t,n)){jt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Xt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Xt(i)&&e.hasChildNodes()&&t.remove(i),Jt(t,n,!0)&&t.$(n).empty(),function(t,e,n){var r,o=qe(t,n)?n.firstChild:n;if(function(t,e){qe(t,e)&&t.remove(e.firstChild,!0)}(t,e),!Jt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)}(t,e,n),r&&n.appendChild(r);var u=ht(mt(n),mt(e))?t.getParents(e,jt,n):[];t.remove(e),S(u,(function(e){Jt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Ge=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ae(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&Jt(n,a))return!0;var c=re(r.getRng()),s=n.getParent(We(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),$e(t.dom,e,n),t.selection.setCursorLocation(n)}(t,n,r);else{var i=Re(e);$e(o,n,r),t.selection.setRng(Me(i))}}(t,c,s,u):(n=u).parentNode.firstChild===n?_e(t):function(t,e,n,r){var o=Re(e);$e(t.dom,n,r);var i=Me(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Ee(t)})),!0}return!1},Xe=function(t,e){return t.selection.isCollapsed()?function(t,e){return Ge(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ae(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=re(t.selection.getRng()),a=n.getParent(We(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Fe(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)}(t,e):function(t){var e=t.selection.getStart(),n=ae(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||ue(t).length>0)&&(t.undoManager.transact((function(){var e,n;t.execCommand("Delete"),e=t.dom,n=t.getBody(),Lt.each(Lt.grep(e.select("ol,ul",n)),(function(t){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),Jt(t,r)&&Ue.remove(r)):Ue.setStyle(r,"listStyleType","none")),jt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(e,t)}))})),!0)}(t)},Ke=function(t){var e=t.dom,n=ie(t);Wt(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact((function(){e.setAttrib(ie(t),"start","1"===r.start?"":r.start)})),n.close()}})},Ye=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}};r.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)&&(function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==yt.TAB||yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?_e(t):Te(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===yt.BACKSPACE?Xe(t,!1)&&e.preventDefault():e.keyCode===yt.DELETE&&Xe(t,!0)&&e.preventDefault()}))}(t)}(t),function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Te(t):"outdent"===n&&_e(t)})),t.addCommand("InsertUnorderedList",(function(e,n){je(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){je(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){je(t,"DL",n)})),t.addCommand("RemoveList",(function(){Ee(t)})),t.addCommand("mceListProps",(function(){Ke(t)})),t.addQueryStateHandler("InsertUnorderedList",Ye(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Ye(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Ye(t,"DL"))}(t)),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Be(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Be(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return Ke(t)},onSetup:function(e){return Be(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ie(t,e);return Wt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){Xe(t,e)}}}(t)}))}()},2540:(t,e,n)=>{n(3167)},3167:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},m=d("string"),g=d("object"),h=d("array"),p=Array.prototype.push,v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!h(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);p.apply(e,t[n])}return e},y=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},w=Object.keys,x=Object.hasOwnProperty,C=function(t,e){return S(t,e)?f.from(t[e]):f.none()},S=function(t,e){return x.call(t,e)},k=function(t){return t.getParam("media_scripts")},O=function(t){return t.getParam("media_live_embeds",!0)},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},N=_.DOM,R=function(t){return t.replace(/px$/,"")},M=function(t,e){var n=y(!1),r={};return E({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(S(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?N.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:C(n,"max-width").map(R).getOr(""),height:C(n,"max-height").map(R).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=T.extend(o.map,r)),"script"===e){var i=A(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=function(t){return{mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()]||""},D=tinymce.util.Tools.resolve("tinymce.html.Schema"),B=tinymce.util.Tools.resolve("tinymce.html.Writer"),P=_.DOM,I=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},L=function(t,e){!function(t,e){for(var n=w(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},H=["source","altsource"],F=function(t,e,n){var r,o=B(),i=y(!1),u=0;return E({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(S(a.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?P.parseStyle(n):{};r["max-width"]=I(t.width),r["max-height"]=I(t.height),L(e,{style:P.serializeStyle(r)})}(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&L(a,{width:e.width,height:e.height})}if(n)switch(t){case"video":L(a,{poster:e.poster,src:""}),e.altsource&&L(a,{src:""});break;case"iframe":L(a,{src:e.source});break;case"source":if(u<2&&(L(a,{src:e[H[u]],type:e[H[u]+"mime"]}),!e[H[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[H[a]]){var c=[];c.map={},u<=a&&(L(c,{src:e[H[a]],type:e[H[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},L(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},D({})).parse(t),o.getContent()},V=[{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&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}],j=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},U=function(t,e){var n=T.extend({},e);if(!n.source&&(T.extend(n,M(k(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=z(n.source),n.altsourcemime=z(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=V.filter((function(t){return t.regex.test(r)}))).length>0?T.extend({},o[0],{url:j(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowFullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return F(n.embed,n,!0);var u=A(k(t),n.source);u&&(n.type="script",n.width=String(u.width),n.height=String(u.height));var a=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",T.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,a):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},W=tinymce.util.Tools.resolve("tinymce.util.Promise"),q={},$=function(t){return function(e){return U(t,e)}},G=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new W((function(r,o){var i=function(n){return n.html&&(q[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};q[t.source]?i(q[t.source]):n({url:t.source},i,o)}))}(e,$(t),n):function(t,e){return new W((function(n){n({html:e(t),url:t.source})}))}(e,$(t))},X=function(t,e){return C(e,t).bind((function(t){return C(t,"meta")}))},K=function(t,e,n){return function(r){var o,i=function(){return C(t,r)},u=function(){return C(e,r)},a=function(t){return C(t,"value").bind((function(t){return t.length>0?f.some(t):f.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return g(t)?a(t).orThunk(u):u().orThunk((function(){return f.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return g(t)?a(t):f.from(t)}))}))).getOr(""),o}},Y=function(t,e){var n={};return C(t,"dimensions").each((function(t){v(["width","height"],(function(r){C(e,r).orThunk((function(){return C(t,r)})).each((function(t){return n[r]=t}))}))})),n},J=function(t,e){var n=e?X(e,t).getOr({}):{},r=K(t,n,e);return o(o(o(o(o({},r("source")),r("altsource")),r("poster")),r("embed")),Y(t,n))},Q=function(t){var e=o(o({},t),{source:{value:C(t,"source").getOr("")},altsource:{value:C(t,"altsource").getOr("")},poster:{value:C(t,"poster").getOr("")}});return v(["width","height"],(function(n){C(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Z=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},tt=function(t,e){return M(k(t),e)},et=function(t,e){return function(n){if(m(n.url)&&n.url.trim().length>0){var r=n.html,i=tt(e,r),u=o(o({},i),{source:n.url,embed:r});t.setData(Q(u))}}},nt=function(t,e){var n=t.dom.select("img[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("img[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},rt=function(t){var e=function(t){var e=t.selection.getNode(),n=function(t){return t.getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")}(e)?t.serializer.serialize(e,{selection:!0}):"";return o({embed:n},M(k(t),n))}(t),n=y(e),r=Q(e),i=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],u={title:"General",name:"general",items:b([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},a=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&a.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&a.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var c={title:"Advanced",name:"advanced",items:a},s=[u,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];a.length>0&&s.push(c);var l={type:"tabpanel",tabs:s},f=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=J(e.getData());(function(t,e,n){var r;e.embed=F(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,q.hasOwnProperty(r)))?nt(n,e.embed):G(n,e).then((function(t){nt(n,t.html)})).catch(Z(n))})(n.get(),r,t),e.close()},onChange:function(e,r){switch(r.name){case"source":!function(e,n){var r=J(n.getData(),"source");e.source!==r.source&&(et(f,t)({url:r.source,html:""}),G(t,r).then(et(f,t)).catch(Z(t)))}(n.get(),e);break;case"embed":!function(e){var n=J(e.getData()),r=tt(t,n.embed);e.setData(Q(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var r=J(e.getData(),n),i=U(t,r);e.setData(Q(o(o({},r),{embed:i})))}(e,r.name)}n.set(J(e.getData()))},initialData:r})},ot=tinymce.util.Tools.resolve("tinymce.html.Node"),it=tinymce.util.Tools.resolve("tinymce.Env"),ut=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=B();return E({validate:!1,allow_conditional_comments:!1,comment:function(t){r.comment(t)},cdata:function(t){r.cdata(t)},text:function(t,e){r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},D({})).parse(e),r.getContent()},at=function(t,e){var n=e.name,r=new ot("img",1);return r.shortEnded=!0,st(t,e,r),r.attr({width:e.attr("width")||"300",height:e.attr("height")||("audio"===n?"30":"150"),style:e.attr("style"),src:it.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},ct=function(t,e){var n=e.name,r=new ot("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),st(t,e,r);var o=new ot(n,1);o.attr({src:e.attr("src"),allowfullscreen:e.attr("allowfullscreen"),style:e.attr("style"),class:e.attr("class"),width:e.attr("width"),height:e.attr("height"),frameborder:"0"});var i=new ot("span",1);return i.attr("class","mce-shim"),r.append(o),r.append(i),r},st=function(t,e,n){var r,o,i,u=e.attributes;for(i=u.length;i--;)r=u[i].name,o=u[i].value,"width"!==r&&"height"!==r&&"style"!==r&&("data"!==r&&"src"!==r||(o=t.convertURL(o,r)),n.attr("data-mce-p-"+r,o));var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(ut(t,a))),n.firstChild=null)},lt=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},ft=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||lt(t))return!0;return!1},dt=function(t,e){return function(n){return t.selection.selectorChangedWithUnbind(e.join(","),n.setActive).unbind}};r.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){rt(t)}))}(t),function(t){t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){t.execCommand("mceMedia")},onSetup:dt(t,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){t.execCommand("mceMedia")}})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();T.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();T.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=A(k(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),"iframe"===n.name&&O(t)&&it.ceFalse?ft(n)||n.replace(ct(t,n)):ft(n)||n.replace(at(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,u,a,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new ot(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(u=r.attributes).length;i--;){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new ot("#text",3)).raw=!0,c.value=ut(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))}(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){var e=t.target.getAttribute("data-mce-object");"audio"!==e&&"script"!==e||t.preventDefault()})),t.on("ObjectResized",(function(t){var e,n=t.target;n.getAttribute("data-mce-object")&&(e=n.getAttribute("data-mce-html"))&&(e=unescape(e),n.setAttribute("data-mce-html",escape(F(e,{width:String(t.width),height:String(t.height)}))))}))}(t),function(t){return{showDialog:function(){rt(t)}}}(t)}))}()},8208:(t,e,n)=>{n(8931)},8931:(t,e,n)=>{const{EventDispatcher:r}=n(7575);!function(){"use strict";tinymce.PluginManager.add("mychecklist",(function(t,e){function n(){t.undoManager.transact((function(){t.insertContent('<ul class="tox-checklist"><li></li></ul>')}))}t.addCommand("InsertCheckList",(function(t,e){n()})),t.ui.registry.addButton("mychecklist",{icon:"checklist",tooltip:"Insert check list",onAction:n});let r=null;t.on("mousedown",(function(e){r=t.selection.getRng();var n=e.target,o=n.parentElement;e.offsetX>0||"tox-checklist"!==o.className||t.undoManager.transact((function(){e.preventDefault(),"tox-checklist"===o.className&&(n.scrollIntoView(!1),"LI"===n.nodeName&&"tox-checklist--checked"===n.className?n.className="":"LI"===n.nodeName&&""===n.className&&(n.className="tox-checklist--checked"))}))}),{capture:!0,passive:!1}),t.on("touchstart",(function(e){r=t.selection.getRng();var n=e.target,o=n.parentElement;e.targetTouches.length>0||e.targetTouches[0].clientX>45||"tox-checklist"!==o.className||t.undoManager.transact((function(){e.preventDefault(),"tox-checklist"===o.className&&(n.scrollIntoView(!1),"LI"===n.nodeName&&"tox-checklist--checked"===n.className?n.className="":"LI"===n.nodeName&&""===n.className&&(n.className="tox-checklist--checked"))}))}),{capture:!0,passive:!1}),t.on("NodeChange",(function(t){var e=t.target,n=e?.parentElement;n&&"tox-checklist"===n.className&&"LI"===e.nodeName&&"tox-checklist--checked"===e.className&&(e.className="")})),t.on("NewBlock",(function(t){"LI"===t.newBlock.nodeName&&"tox-checklist--checked"===t.newBlock.className&&(t.newBlock.className="")}))}))}()},1933:(t,e,n)=>{n(4129)},4129:(t,e,n)=>{"use strict";n.r(e);var r,o,i,u=n(7575);r=n.n(u)().util.Tools.resolve("tinymce.PluginManager"),o=function(t,e,n){if(e&&e.isActive&&e.isActive())t.execCommand("mceInsertNewLine",!1,{shiftKey:!0});else{var r=t.selection.getContent({format:"text"});r=r.replace(/^\n/gm,""),"shortcut"===n&&(r="<br>"),r.length>0?(t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,`<pre class='codeblock'>${r}</pre>`)})),t.selection.setCursorLocation(),t.nodeChanged()):function(t,e){let n=t.selection.getNode();t.undoManager.transact((function(){t.execCommand("mceInsertContent",!1,(t=>`<pre class='codeblock'>${t.innerHTML.replace(/\n/gm,"<br>")}</pre>`)(n))})),n=t.selection.getNode(),t.focus(),t.selection.setCursorLocation(n,5),t.nodeChanged()}(t)}},i=function(t){return function(e){var n=function(t){e.setActive("PRE"===t.element.tagName)},r=function(e){"<pre></pre>"===e.content&&(e.preventDefault(),t.creatingCodeBlock=!0,o(t,void 0,"shortcut"))},i=function(e){console.log(e),t.creatingCodeBlock&&"mceInsertNewLine"===e.command&&(e.preventDefault(),t.creatingCodeBlock=!1)};return t.on("BeforeExecCommand",i),t.on("BeforeSetContent",r),t.on("NodeChange",n),function(){return t.off("BeforeExecCommand",i),t.off("BeforeSetContent",r),t.off("NodeChange",n)}}},r.add("mycode",(function(t){return function(t){t.addCommand("CodeBlock",(function(e){o(t,e)}))}(t),function(t){t.ui.registry.addToggleButton("code",{icon:"sourcecode",tooltip:"Code",onAction:function(e){return o(t,e)},onSetup:i(t)})}(t),{}}))},6586:(t,e,n)=>{n(9586)},9586:()=>{!function(){"use strict";tinymce.PluginManager.add("myimage",(function(t,e){function n(){var e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.onchange=function(){var e=this.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=function(){r(n.result,600,"image/jpeg",(e=>{var r=`<img src="${e}">`;t.insertContent(r),n.onerror=null}),.7),n.onerror=function(t){n.onerror=null}}},e.dispatchEvent(new MouseEvent("click"))}t.ui.registry.addButton("myimage",{icon:"image",tooltip:"Insert image",onAction:n});var r=function(t,e,n="image/jpeg",r,o=.7){var i,u,a,c,s,l;new Promise((function(e){(i=new Image).src=t,e("Done : ")})).then((t=>{u=i.width,a=i.height,c=Math.floor(a/u*e),(s=document.createElement("canvas")).width=e,s.height=c,s.getContext("2d").drawImage(i,0,0,e,c),l=s.toDataURL(n,o),r(l)}))};t.addCommand("InsertImage",(function(t,e){n()}))}))}()},5031:(t,e,n)=>{n(7814)},7814:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return function(e){return-1!==(" "+e.attr("class")+" ").indexOf(t)}},o=function(t,e,n){return function(r){var o=arguments,i=o[o.length-2],u=i>0?e.charAt(i-1):"";if('"'===u)return r;if(">"===u){var a=e.lastIndexOf("<",i);if(-1!==a){var c=e.substring(a,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+t.dom.encode(o[0])+'">'+t.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}};t.add("noneditable",(function(t){!function(t){var i="contenteditable",u=" "+e.trim(function(t){return t.getParam("noneditable_editable_class","mceEditable")}(t))+" ",a=" "+e.trim(n(t))+" ",c=r(u),s=r(a),l=function(t){var e=t.getParam("noneditable_regexp",[]);return e&&e.constructor===RegExp?[e]:e}(t);t.on("PreInit",(function(){l.length>0&&t.on("BeforeSetContent",(function(e){!function(t,e,r){var i=e.length,u=r.content;if("raw"!==r.format){for(;i--;)u=u.replace(e[i],o(t,u,n(t)));r.content=u}}(t,l,e)})),t.parser.addAttributeFilter("class",(function(t){for(var e,n=t.length;n--;)e=t[n],c(e)?e.attr(i,"true"):s(e)&&e.attr(i,"false")})),t.serializer.addAttributeFilter(i,(function(t){for(var e,n=t.length;n--;)e=t[n],(c(e)||s(e))&&(l.length>0&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(i,null))}))}))}(t)}))}()},2875:(t,e,n)=>{n(5103)},5103:()=>{!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return function(){return t}},u=i(!1),a=i(!0),c=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:u,isSome:u,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:c,each:function(){},bind:c,exists:u,forall:a,filter:c,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),l=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,(function(e){return n(t,e)}))}};return o},f={some:l,none:c,from:function(t){return null==t?s:l(t)}},d=function(t){return!function(t){return null==t}(t)},m=("function",function(t){return"function"==typeof t}),g=Array.prototype.slice,h=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},p=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},v=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},b=m(Array.from)?Array.from:function(t){return g.call(t)},y=function(){var t=r(f.none());return{clear:function(){return t.set(f.none())},set:function(e){return t.set(f.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},w=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},x=tinymce.util.Tools.resolve("tinymce.Env"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=tinymce.util.Tools.resolve("tinymce.util.Promise"),k=tinymce.util.Tools.resolve("tinymce.util.VK"),O=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=function(t){return t.getParam("paste_data_images",!1)},E=function(t){return t.getParam("paste_merge_formats",!0)},A=function(t){return t.getParam("paste_retain_style_properties")},N=function(t){return t.getParam("validate")},R=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},M=function(t){return t.getParam("paste_data_images",!1,"boolean")},z=function(t){return T.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},D="\x3c!-- x-tinymce/html --\x3e",B=function(t){return-1!==t.indexOf(D)},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),I=tinymce.util.Tools.resolve("tinymce.html.DomParser"),L=tinymce.util.Tools.resolve("tinymce.html.Serializer"),H=" ",F=tinymce.util.Tools.resolve("tinymce.html.Node"),V=tinymce.util.Tools.resolve("tinymce.html.Schema");function j(t,e){return T.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t}function U(t){return j(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?H:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function W(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}function q(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),T.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e}function $(t){var e,n,r=1;function o(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e}function i(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0}function u(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{u(t)}while(t=t.next)}function a(t,o,a){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new F(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,u(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)}for(var c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){a(t,"ul");continue}if(q(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),a(t,"ol",m);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}function G(t,e,n,r){var o,i={},u=t.dom.parseStyle(r);return T.each(u,(function(u,a){switch(a){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(u)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":a="text-align";break;case"vert-align":a="vertical-align";break;case"font-color":case"mso-foreground":a="color";break;case"mso-background":case"mso-highlight":a="background";break;case"font-weight":case"font-style":return void("normal"!==u&&(i[a]=u));case"mso-element":if(/^(comment|comment-list)$/i.test(u))return void n.remove()}0!==a.indexOf("mso-comment")?0!==a.indexOf("mso-")&&("all"===A(t)||e&&e[a])&&(i[a]=u):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new F("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new F("i",1))),(i=t.dom.serializeStyle(i,n.name))||null}var X,K=function(t,e){return{content:t,cancelled:e}},Y=function(t,e){return t.insertContent(e,{merge:E(t),paste:!0}),!0},J=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},Q=function(t,e){return J(e)&&h(z(t),(function(t){return w(n=e,r="."+t,n.length-r.length);var n,r}))},Z=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!J(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},tt=function(t,e,n){return!!Q(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},et=function(t){return"\n"===t||"\r"===t},nt=function(t,e,n,r){var o=function(t,e,n){var r=W(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?function(t,e){var n,r=A(t);r&&(n=T.makeMap(r.split(/[, ]/))),e=j(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,H],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(H):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=V({valid_elements:o,valid_children:"-li[p]"});T.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var u=I({},i);u.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",G(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),u.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),u.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),u.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var a=u.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&$(a),L({validate:N(t)},i).serialize(a)}(t,e):e}(t,e):e;return function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=I({},t.schema);n.addNodeFilter("meta",(function(t){T.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return L({validate:N(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return K(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):K(i,o.isDefaultPrevented())}(t,o,n,r)}(t,e,n);!1===o.cancelled&&function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?Y(t,e):function(t,e){T.each([Z,tt,Y],(function(n){return!0!==n(t,e,Y)}))}(t,e)}(t,o.content,r)},rt=function(t,e,n){var r=n||B(e);nt(t,function(t){return t.replace(D,"")}(e),r,!1)},ot=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=T.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===u.length?u[0]:T.map(u,(function(t){return o+t+i})).join("")}(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(function(t,e){var n,r,o,i=(n=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(n+1).join(" "),u=e.replace(/\t/g,i);return(r=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===H?t.pcIsSpace||""===t.str||t.str.length===u.length-1||function(t,e){return e<t.length&&e>=0&&et(t[e])}(u,t.str.length+1)?{pcIsSpace:!1,str:t.str+H}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:et(e),str:t.str+e}},o={pcIsSpace:!1,str:""},v(u,(function(t){o=r(o,t)})),o).str}(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));nt(t,r,!1,!0)},it=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},ut=function(t,e){return e in t&&t[e].length>0},at=function(t){return ut(t,"text/html")||ut(t,"text/plain")},ct=("mceclip",X=0,function(){return"mceclip"+X++}),st=function(t,e,n){var r,o="paste"===e.type?e.clipboardData:e.dataTransfer;if(M(t)&&o){var i=function(t,e){var n=e.items?p(b(e.items),(function(t){return t.getAsFile()})):[],r=e.files?b(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,function(t){var e=z(t);return function(t){return n=t.type,w(n,"image/",0)&&h(e,(function(e){return n=e,r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(T.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}));var n}}(t))}(t,o);if(i.length>0)return e.preventDefault(),(r=i,S.all(p(r,(function(t){return new S((function(e){var n=function(t){return d(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))).then((function(e){n&&t.selection.setRng(n),v(e,(function(e){!function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,u=o.type,a=ct(),c=e.blob,s=new Image;if(s.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,s)){var l=t.editorUpload.blobCache,f=void 0,m=l.getByData(i,u);if(m)f=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&d(c.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return d(n)?t.dom.encode(n[1]):null}(t,c.name):a,p=g?c.name:void 0;f=l.create(a,c,i,h,p),l.add(f)}rt(t,'<img src="'+f.blobUri()+'">',!1)}else rt(t,'<img src="'+e.uri+'">',!1)}(t,e)}))})),!0}return!1},lt=function(t){return k.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},ft=function(t){return x.ie&&t.inline?document.body:t.getBody()},dt=function(t){return t.dom.get("mcepastebin")},mt=function(t,e){return e===t},gt=function(t,e){var n,r=dt(t);return(n=r)&&"mcepastebin"===n.id&&mt(e,r.innerHTML)},ht=function(t){var e=r(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(ft(t),"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"},n);(x.ie||x.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),function(t,e,n){(function(t){return ft(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){gt(t,n)||t.fire("paste")}))}(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(dt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return dt(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=T.grep(ft(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();T.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var u=t.dom.create("div");r.insertBefore(u,o[i]),e(u,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return gt(t,n)},isDefaultContent:function(t){return mt(n,t)}}},pt=function(t,e){var n=ht(t);return t.on("PreInit",(function(){return function(t,e,n){var r;(function(t,e,n){var r,o=y(),i=y();function u(t,n,r,o,i){var u;ut(n,"text/html")?u=n["text/html"]:(u=e.getHtml(),i=i||B(u),e.isDefaultContent(u)&&(o=!0)),u=U(u),e.remove();var a,c,s,l,f,d,m,g=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(u),h=Q(t,u);(!u.length||g&&!h)&&(o=!0),(o||h)&&(u=ut(n,"text/plain")&&g?n["text/plain"]:(a=u,c=V(),s=I({},c),l="",f=c.getShortEndedElements(),d=T.makeMap("script noscript style textarea video audio iframe object"," "),m=c.getBlockElements(),a=j(a,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(f[n]&&(l+=" "),d[n])l+=" ";else{if(3===e.type&&(l+=e.value),!e.shortEnded&&(e=e.firstChild))do{t(e)}while(e=e.next);m[n]&&r.next&&(l+="\n","p"===n&&(l+="\n"))}}else l+="\n"}(s.parse(a)),l)),e.isDefaultContent(u)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?ot(t,u):rt(t,u,i)}t.on("keyup",i.clear),t.on("keydown",(function(n){var u=function(t){lt(t)&&!t.isDefaultPrevented()&&e.remove()};if(lt(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&x.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),x.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:!0})}(t);e.remove(),e.create(),t.once("keyup",u),t.once("paste",(function(){t.off("keyup",u)}))}})),t.on("paste",(function(a){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return it(e.clipboardData||t.getDoc().dataTransfer)}(t,a),l="text"===n.get()||r,f=ut(s,"x-tinymce/html");r=!1,a.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(a)?e.remove():at(s)||!st(t,a,e.getLastRng()||t.selection.getRng())?(c||a.preventDefault(),!x.ie||c&&!a.ieFake||ut(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),ut(s,"text/html")?(a.preventDefault(),f||(f=B(s["text/html"])),u(t,s,c,l,f)):C.setEditorTimeout(t,(function(){u(t,s,c,l,f)}),0)):e.remove()}))})(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i,u=function(t){return 0===t.indexOf("webkit-fake-url")},a=function(t){return 0===t.indexOf("data:")};if(!M(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var c=e.length;c--;)(r=e[c].attr("src"))&&(u(r)||!R(t)&&a(r))&&((i=e[c]).attr("data-mce-object")||r===x.transparentSrc||i.remove())}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return rt(t,e,n)},pasteText:function(e){return ot(t,e)},pasteImageData:function(e,n){return st(t,e,n)},getDataTransferItems:it,hasHtmlOrText:at,hasContentType:ut}},vt=function(t,e,n,r){!function(t,e,n){if(!function(t){return!1===x.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData("x-tinymce/html",e),!0}catch(t){return!1}}(t.clipboardData,e.html,e.text)?n(e.html,r):(t.preventDefault(),r())},bt=function(t){return function(e,n){var r=function(t){return D+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var u=t.selection.getRng();i.focus();var a=t.dom.createRng();a.selectNodeContents(i),t.selection.setRng(a),C.setTimeout((function(){t.selection.setRng(u),o.parentNode.removeChild(o),n()}),0)}},yt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},wt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},xt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ct=function(t,e){return xt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},St=function(t,e){t.focus(),t.selection.setRng(e)};function kt(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))}function Ot(t,e){if(!W(e))return e;var n=[];return T.each(t.schema.getBlockElements(),(function(t,e){n.push(e)})),e=j(e,[[new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g"),"$1"]]),j(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Tt(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var u=t.dom,a=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=u.parseStyle(u.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=u.getStyle(a,o[s],!0);/color/.test(o[s])&&(l=u.toHex(l),f=u.toHex(f)),f!==l&&(c[o[s]]=l)}return(c=u.serializeStyle(c,"span"))?e+' style="'+c+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))}function _t(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))}var Et=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};o.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=r(!1),n=r(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),o=pt(t,n),i=function(t){x.webkit&&kt(t,Tt),x.ie&&(kt(t,Ot),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,_t))}(t);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Et(t,e)})}(t,o),function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),O(t,!1)):(e.pasteFormat.set("text"),O(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))}(t,o),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),function(t){t.on("cut",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){if(x.browser.isChrome()||x.browser.isFirefox()){var e=t.selection.getRng();C.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){wt(t)&&vt(e,yt(t),bt(t),(function(){}))}}(t))}(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),_(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ct(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,u=e.getDataTransferItems(r.dataTransfer),a=e.hasContentType(u,"x-tinymce/html");if((e.hasHtmlOrText(u)&&(!(i=u["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=u["mce-internal"]||u["text/html"]||u["text/plain"];c&&(r.preventDefault(),C.setEditorTimeout(t,(function(){t.undoManager.transact((function(){u["mce-internal"]&&t.execCommand("Delete"),St(t,o),c=U(c),u["text/html"]?e.pasteHtml(c,a):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){_(t)&&!1===n.get()&&(e.preventDefault(),St(t,Ct(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,o,e),function(t,e){return{clipboard:t,quirks:e}}(o,i)}}))}()},1295:(t,e,n)=>{n(6834)},6834:()=>{!function(){"use strict";var t,e,n,r,o,i=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},c=function(t){return function(){return t}},s=c(!1),l=c(!0),f=c("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),d=function(){return m},m=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:s,isSome:s,isNone:l,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:n,orThunk:e,map:d,each:function(){},bind:d,exists:s,forall:l,filter:d,equals:t,equals_:t,toArray:function(){return[]},toString:c("none()")}),g=function(t){var e=c(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,(function(e){return n(t,e)}))}};return o},h={some:g,none:d,from:function(t){return null==t?m:g(t)}},p=f,v=tinymce.util.Tools.resolve("tinymce.util.Tools"),b=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},y=function(t){return function(e){return typeof e===t}},w=b("string"),x=b("array"),C=y("boolean"),S=y("number"),k=Array.prototype.slice,O=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},_=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},E=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!x(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e}(T(t,e))},N=Object.hasOwnProperty,R=function(t,e){return N.call(t,e)},M=("undefined"!=typeof window?window:Function("return this;")(),3,function(t){return 3===function(t){return t.dom.nodeType}(t)}),z=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},D=z,B=function(t,e){return{element:t,offset:e}},P=function(t,e){(function(t,e){(function(t){return h.from(t.dom.parentNode).map(D)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))})(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},I=(r=M,"text",{get:function(t){if(!r(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o=function(t){return r(t)?h.from(t.dom.nodeValue):h.none()},set:function(t,e){if(!r(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}}),L=function(t){return I.get(t)},H=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),F=function(t,e){return t.isBlock(e)||R(t.schema.getShortEndedElements(),e.nodeName)},V=function(t,e){return"false"===t.getContentEditable(e)},j=function(t,e){return!t.isBlock(e)&&R(t.schema.getWhiteSpaceElements(),e.nodeName)},U=function(t,e){return function(t,e){var n=function(t){return T(t.dom.childNodes,D)}(t);return n.length>0&&e<n.length?B(n[e],0):B(t,e)}(D(t),e)},W=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var u=i?e(!1):n;u;){var a=V(t,u);if(a||j(t,u)){if(a?r.cef(u):r.boundary(u))break;u=e(!0)}else{if(F(t,u)){if(r.boundary(u))break}else 3===u.nodeType&&r.text(u);if(u===o)break;u=e(!1)}}},q=function(t,e,n,r,o){if(!function(t,e){return F(t,e)||V(t,e)||j(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),u=new H(n,i),a=o?u.next:u.prev;W(t,a,n,{boundary:l,cef:l,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(D(t))}})}},$=function(t,e,n,r,o,i){void 0===i&&(i=!0);var u=new H(n,e),a=[],c={sOffset:0,fOffset:0,elements:[]};q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(a.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return W(t,u.next,n,{boundary:s,cef:function(t){return s(),o&&a.push.apply(a,o.cef(t)),!1},text:function(t){c.elements.push(D(t)),o&&o.text(t,c)}},r,i),r&&q(t,c,r,e,!0),s(),a},G=function(t,e){var n=U(e.startContainer,e.startOffset),r=n.element.dom,o=U(e.endContainer,e.endOffset),i=o.element.dom;return $(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i;return n=A((i=D(e),function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),D)}("*[contenteditable=true]",i)),(function(e){var n=e.dom;return $(t,n,n)})),r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=k.call(n,0)).sort(r),o}},!1)},X=function(t,e){return e.collapsed?[]:G(t,e)},K=function(t,e){var n=t.createRng();return n.selectNode(e),X(t,n)},Y=function(t,e){return A(e,(function(e){var n=e.elements,r=T(n,L).join("");return function(t,e){var n,r,o;return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}((n=t,r=function(t,n){var r=L(n),o=t.last,i=o+r.length,u=A(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(u),last:i}},o={results:[],last:0},_(n,(function(t){o=r(o,t)})),o).results,(function(t){return t.matchId}))}(n,function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,u=[];i=o.exec(t);){var a=i[e.matchIndex],c=i.index+i[0].indexOf(a),s=c+a.length;if(s>r)break;u.push({start:c,finish:s}),o.lastIndex=s}return u}(r,t,e.sOffset,r.length-e.fOffset))}))},J=function(t,e){E(t,(function(t,n){E(t,(function(t){var r,o,i=D(e.cloneNode(!1));r="data-mce-index",o=n,function(t,e,n){if(!(w(n)||C(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(i.dom,r,o);var u=t.element.dom;if(u.length===t.finish&&0===t.start)P(t.element,i);else{u.length!==t.finish&&u.splitText(t.finish);var a=u.splitText(t.start);P(D(a),i)}}))}))},Q=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},Z=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return st(t,e,!1),r?function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),u=i.length>0?function(t,e){return A(e,(function(e){return K(t,e)}))}(t,i):X(t,n.getRng()),a=Y(e,u);return J(a,r),n.moveToBookmark(o),a.length}(t.dom,n,t.selection,o):function(t,e,n,r){var o=K(t,n),i=Y(e,o);return J(i,r),i.length}(t.dom,n,i,o)},tt=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},et=function(t,e){var n=[],r=v.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=Q(r[o]);null!==i&&i.length&&i===e.toString()&&n.push(r[o])}return n},nt=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(et(t,r.index),"mce-match-marker-selected");var u=et(t,o);return u.length?(i.addClass(et(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(u[0]),o):-1},rt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},ot=function(t,e,n,r,o,i){var u=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+p()+")"+n+"(?=$|\\s|"+p()+")":n}(n,o),a={regex:new RegExp(u,r?"g":"gi"),matchIndex:1},c=Z(t,e,a,i);if(c){var s=nt(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},it=function(t,e){var n=nt(t,e,!0);e.set(a(a({},e.get()),{index:n}))},ut=function(t,e){var n=nt(t,e,!1);e.set(a(a({},e.get()),{index:n}))},at=function(t){var e=Q(t);return null!==e&&e.length>0},ct=function(t,e,n,r,o){var i,u=e.get(),c=u.index,s=c;r=!1!==r;for(var l=t.getBody(),f=v.grep(v.toArray(l.getElementsByTagName("span")),at),d=0;d<f.length;d++){var m=Q(f[d]),g=i=parseInt(m,10);if(o||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,tt(f[d])):rt(t.dom,f[d]);f[++d];){if((g=parseInt(Q(f[d]),10))!==i){d--;break}rt(t.dom,f[d])}r&&s--}else i>c&&f[d].setAttribute("data-mce-index",String(i-1))}return e.set(a(a({},u),{count:o?0:u.count-1,index:s})),r?it(t,e):ut(t,e),!o&&e.get().count>0},st=function(t,e,n){var r,o,i,u=e.get(),c=v.toArray(t.getBody().getElementsByTagName("span"));for(r=0;r<c.length;r++){var s=Q(c[r]);null!==s&&s.length&&(s===u.index.toString()&&(o||(o=c[r].firstChild),i=c[r].firstChild),tt(c[r]))}if(e.set(a(a({},u),{index:-1,count:0,text:""})),o&&i){var l=t.dom.createRng();return l.setStart(o,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},lt=tinymce.util.Tools.resolve("tinymce.Env"),ft=function(t,e){var n,r=(n=i(h.none()),{clear:function(){return n.set(h.none())},set:function(t){return n.set(h.some(t))},isSet:function(){return n.get().isSome()},on:function(t){return n.get().each(t)}});t.undoManager.add();var o=v.trim(t.selection.getContent({format:"text"}));function u(t){(!function(t,e){return e.get().count>1}(0,e)?t.disable:t.enable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")}var c=function(t,e){var n=e?t.disable:t.enable;_(["replace","replaceall","prev","next"],n)},s=function(t,e){lt.browser.isSafari()&<.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},l=function(n){st(t,e,!1),c(n,!0),u(n)},f=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)it(t,e);else{var i=ot(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);i<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),c(n,0===i)}u(n)}else l(n)},d=e.get(),m={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:o,replacetext:"",wholewords:d.wholeWord,matchcase:d.matchCase,inselection:d.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&l(t)},onAction:function(n,r){var o=n.getData();switch(r.name){case"find":f(n);break;case"replace":ct(t,e,o.replacetext)?u(n):l(n);break;case"replaceall":ct(t,e,o.replacetext,!0,!0),l(n);break;case"prev":ut(t,e),u(n);break;case"next":it(t,e),u(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(a(a({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),l(n)}s(n,r.name)},onSubmit:function(t){f(t),s(t,"find")},onClose:function(){t.focus(),st(t,e),t.undoManager.add()}};r.set(t.windowManager.open(m,{inline:"toolbar"}))},dt=function(t,e){return function(){ft(t,e)}};u.add("searchreplace",(function(t){var e=i({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){ft(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:dt(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:dt(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",dt(t,e))}(t,e),function(t,e){return{done:function(n){return st(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),ot(t,e,n,r,o,i)},next:function(){return it(t,e)},prev:function(){return ut(t,e)},replace:function(n,r,o){return ct(t,e,n,r,o)}}}(t,e)}))}()},8619:(t,e,n)=>{n(2590)},2590:()=>{!function(){"use strict";var t=function(){},e=function(t){return function(){return t}},n=function(t){return t};function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var o,i,u,a=function(t){return function(e){return!t(e)}},c=e(!1),s=e(!0),l=function(){return f},f=(o=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:u=function(t){return t},getOrThunk:i=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:e(null),getOrUndefined:e(void 0),or:u,orThunk:i,map:l,each:t,bind:l,exists:c,forall:s,filter:l,equals:o,equals_:o,toArray:function(){return[]},toString:e("none()")}),d=function(t){var n=e(t),r=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(e){return d(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=function(t){return function(e){return typeof e===t}},p=g("string"),v=g("object"),b=g("array"),y=h("boolean"),w=(void 0,function(t){return undefined===t}),x=function(t){return!function(t){return null==t}(t)},C=h("function"),S=h("number"),k=Array.prototype.slice,O=Array.prototype.indexOf,T=Array.prototype.push,_=function(t,e){return function(t,e){return O.call(t,e)}(t,e)>-1},E=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},N=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},R=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},M=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},z=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},D=function(t,e,n){return R(t,(function(t){n=e(n,t)})),n},B=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,e,c)},P=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return m.some(n);return m.none()},I=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!b(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);T.apply(e,t[n])}return e},L=function(t,e){return I(N(t,e))},H=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},F=function(t){return[t]},V=function(t,e){return e>=0&&e<t.length?m.some(t[e]):m.none()},j=function(t){return V(t,t.length-1)},U=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return m.none()},W=function(){return(W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function q(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var $=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},G=function(){return X(0,0)},X=function(t,e){return{major:t,minor:e}},K=function(t,e){var n=String(e).toLowerCase();return 0===t.length?G():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return X(r(1),r(2))}(t,n)},Y=G,J=function(t,e){var n=String(e).toLowerCase();return B(t,(function(t){return t.search(n)}))},Q=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Z=function(t,e){return-1!==t.indexOf(e)},tt=function(t,e){return Q(t,e,0)},et=function(t,e){return Q(t,e,t.length-e.length)},nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),rt=function(t){return t.length>0},ot=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,it=function(t){return function(e){return Z(e,t)}},ut=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Z(t,"edge/")&&Z(t,"chrome")&&Z(t,"safari")&&Z(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ot],search:function(t){return Z(t,"chrome")&&!Z(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Z(t,"msie")||Z(t,"trident")}},{name:"Opera",versionRegexes:[ot,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:it("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:it("firefox")},{name:"Safari",versionRegexes:[ot,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Z(t,"safari")||Z(t,"mobile/"))&&Z(t,"applewebkit")}}],at=[{name:"Windows",search:it("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Z(t,"iphone")||Z(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:it("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:it("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:it("linux"),versionRegexes:[]},{name:"Solaris",search:it("sunos"),versionRegexes:[]},{name:"FreeBSD",search:it("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:it("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ct={browsers:e(ut),oses:e(at)},st="Edge",lt="Chrome",ft="Opera",dt="Firefox",mt="Safari",gt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(st),isChrome:r(lt),isIE:r("IE"),isOpera:r(ft),isFirefox:r(dt),isSafari:r(mt)}},ht=function(){return gt({current:void 0,version:Y()})},pt=gt,vt=(e(st),e(lt),e("IE"),e(ft),e(dt),e(mt),"Windows"),bt="Android",yt="Linux",wt="Solaris",xt="FreeBSD",Ct="ChromeOS",St=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r("iOS"),isAndroid:r(bt),isOSX:r("OSX"),isLinux:r(yt),isSolaris:r(wt),isFreeBSD:r(xt),isChromeOS:r(Ct)}},kt=function(){return St({current:void 0,version:Y()})},Ot=St,Tt=(e(vt),e("iOS"),e(bt),e(yt),e("OSX"),e(wt),e(xt),e(Ct),function(t,n){var r=ct.browsers(),o=ct.oses(),i=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ht,pt),u=function(t,e){return J(t,e).map((function(t){var n=K(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kt,Ot),a=function(t,n,r,o){var i=t.isiOS()&&!0===/ipad/i.test(r),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),d=!l&&!s&&!f;return{isiPad:e(i),isiPhone:e(u),isTablet:e(s),isPhone:e(l),isTouch:e(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:e(f),isDesktop:e(d)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}}),_t=function(t){return window.matchMedia(t).matches},Et=$((function(){return Tt(navigator.userAgent,_t)})),At=function(){return Et()},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Nt(n)},fromDom:Nt,fromPoint:function(t,e,n){return m.from(t.dom.elementFromPoint(e,n)).map(Nt)}},Mt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Dt=function(t,e){return t.dom===e.dom},Bt=function(t,e){return At().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Pt=Mt,It=Object.keys,Lt=Object.hasOwnProperty,Ht=function(t,e){for(var n=It(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Ft=function(t,e){return Vt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Vt=function(t,e){var n={};return Ht(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},jt=function(e,n){var r={};return function(t,e,n,r){Ht(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r},Ut=function(t,e){return Wt(t,e)?m.from(t[e]):m.none()},Wt=function(t,e){return Lt.call(t,e)},qt=["tfoot","thead","tbody","colgroup"],$t=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Gt=function(t,e,n){return{element:t,cells:e,section:n}},Xt=function(t,e){return{element:t,isNew:e}},Kt=function(t,e){return{cells:t,section:e}},Yt=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),Jt=function(t){return t.dom.nodeType},Qt=function(t){return function(e){return Jt(e)===t}},Zt=function(t){return 8===Jt(t)||"#comment"===Yt(t)},te=Qt(1),ee=Qt(3),ne=Qt(9),re=Qt(11),oe=function(t){return Rt.fromDom(t.dom.ownerDocument)},ie=function(t){return ne(t)?t:oe(t)},ue=function(t){return m.from(t.dom.parentNode).map(Rt.fromDom)},ae=function(t,e){for(var n=C(e)?e:c,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Rt.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ce=function(t){return m.from(t.dom.previousSibling).map(Rt.fromDom)},se=function(t){return m.from(t.dom.nextSibling).map(Rt.fromDom)},le=function(t){return N(t.dom.childNodes,Rt.fromDom)},fe=function(t,e){var n=t.dom.childNodes;return m.from(n[e]).map(Rt.fromDom)},de=C(Element.prototype.attachShadow)&&C(Node.prototype.getRootNode),me=e(de),ge=de?function(t){return Rt.fromDom(t.dom.getRootNode())}:ie,he=function(t){return Rt.fromDom(t.dom.host)},pe=function(t){return x(t.dom.shadowRoot)},ve=function(t){var e=ee(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=ge(t);return re(e)?m.some(e):m.none()}(Rt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=ve,r=he,function(t){return n(r(t))}))},be=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Rt.fromDom(e)},ye=function(t,e){var n=[];return R(le(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(ye(t,e))})),n},we=function(t,e,n){return function(t,n,r){return M(ae(t,r),(function(t){return Mt(t,e)}))}(t,0,n)},xe=function(t,e){return function(t,n){return M(le(t),(function(t){return Mt(t,e)}))}(t)},Ce=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:N(n.querySelectorAll(t),Rt.fromDom)}(e,t)};function Se(t,e,n,r,o){return t(n,r)?m.some(n):C(o)&&o(n)?m.none():e(n,r,o)}var ke=function(t,e,n){for(var r=t.dom,o=C(n)?n:c;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(e(i))return m.some(i);if(o(i))break}return m.none()},Oe=function(t,e,n){return ke(t,(function(t){return Mt(t,e)}),n)},Te=function(t,e){return function(t,n){return B(t.dom.childNodes,(function(t){return n=Rt.fromDom(t),Mt(n,e);var n})).map(Rt.fromDom)}(t)},_e=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?m.none():m.from(n.querySelector(t)).map(Rt.fromDom)}(e,t)},Ee=function(t,e,n){return Se((function(t,e){return Mt(t,e)}),Oe,t,e,n)},Ae=function(t,e,n){if(!(p(n)||y(n)||S(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ne=function(t,e,n){Ae(t.dom,e,n)},Re=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ae(n,e,t)}))},Me=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},ze=function(t,e){return m.from(Me(t,e))},De=function(t,e){t.dom.removeAttribute(e)},Be=function(t){return D(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Pe=function(t){return void 0!==t.style&&C(t.style.getPropertyValue)},Ie=function(t,e,n){if(!p(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Pe(t)&&t.style.setProperty(e,n)},Le=function(t,e,n){var r=t.dom;Ie(r,e,n)},He=function(t,e){var n=t.dom;Ht(e,(function(t,e){Ie(n,e,t)}))},Fe=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||ve(t)?r:Ve(n,e)},Ve=function(t,e){return Pe(t)?t.style.getPropertyValue(e):""},je=function(t,e){var n=t.dom,r=Ve(n,e);return m.from(r).filter((function(t){return t.length>0}))},Ue=function(t,e){!function(t,e){Pe(t)&&t.style.removeProperty(e)}(t.dom,e),ze(t,"style").map(nt).is("")&&De(t,"style")},We=function(t,e,n){return void 0===n&&(n=0),ze(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},qe=function(t,e){return We(t,e,1)},$e=function(t){return qe(t,"colspan")>1},Ge=function(t){return qe(t,"rowspan")>1},Xe=function(t,e){return parseInt(Fe(t,e),10)},Ke=e(10),Ye=e(10),Je=function(t,e){return Qe(t,e,s)},Qe=function(t,e,n){return L(le(t),(function(t){return Mt(t,e)?n(t)?[t]:[]:Qe(t,e,n)}))},Ze=function(t,e){return function(t,e,n){return void 0===n&&(n=c),n(e)?m.none():_(t,Yt(e))?m.some(e):Oe(e,t.join(","),(function(t){return Mt(t,"table")||n(t)}))}(["td","th"],t,e)},tn=function(t){return Je(t,"th,td")},en=function(t){return Mt(t,"colgroup")?xe(t,"col"):L(on(t),(function(t){return xe(t,"col")}))},nn=function(t,e){return Ee(t,"table",e)},rn=function(t){return Je(t,"tr")},on=function(t){return nn(t).fold(e([]),(function(t){return xe(t,"colgroup")}))},un=function(t,e){return N(t,(function(t){if("colgroup"===Yt(t)){var n=N(en(t),(function(t){var e=We(t,"span",1);return $t(t,1,e)}));return Gt(t,n,"colgroup")}return n=N(tn(t),(function(t){var e=We(t,"rowspan",1),n=We(t,"colspan",1);return $t(t,e,n)})),Gt(t,n,e(t))}))},an=function(t){return ue(t).map((function(t){var e=Yt(t);return function(t){return _(qt,t)}(e)?e:"tbody"})).getOr("tbody")},cn=function(t){var e=rn(t),n=q(on(t),e);return un(n,an)},sn=function(t,e){return t+","+e},ln=function(t,e){var n=L(t.all,(function(t){return t.cells}));return M(n,e)},fn=function(t){var e={},n=[],r={},o=0,i=0,u=0;return R(t,(function(t){if("colgroup"===t.section)r=function(t){var e={},n=0;return R(t.cells,(function(t){var r=t.colspan;A(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);else{var a=[];R(t.cells,(function(t){for(var n=0;void 0!==e[sn(u,n)];)n++;for(var r=(f=t.element,d=t.rowspan,m=t.colspan,{element:f,rowspan:d,colspan:m,row:u,column:n}),o=0;o<t.colspan;o++)for(var c=0;c<t.rowspan;c++){var s=n+o,l=sn(u+c,s);e[l]=r,i=Math.max(i,s+1)}var f,d,m;a.push(r)})),o++,n.push(Gt(t.element,a,t.section)),u++}})),{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:r}},dn=function(t){var e=cn(t);return fn(e)},mn=fn,gn=function(t,e,n){var r=t.access[sn(e,n)];return void 0!==r?m.some(r):m.none()},hn=function(t,e,n){var r=ln(t,(function(t){return n(e,t.element)}));return r.length>0?m.some(r[0]):m.none()},pn=ln,vn=function(t){return L(t.all,(function(t){return t.cells}))},bn=function(t){return function(t,e){var n=[];return Ht(t,(function(t,e){n.push(t)})),n}(t.columns)},yn=function(t){return It(t.columns).length>0},wn=function(t,e){return m.from(t.columns[e])},xn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Cn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Sn=function(t,e,n){var r=hn(t,e,Dt),o=hn(t,n,Dt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,{startRow:Math.min(n.row,r.row),startCol:Math.min(n.column,r.column),finishRow:Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),finishCol:Math.max(n.column+n.colspan-1,r.column+r.colspan-1)};var n,r}))}))},kn=function(t,e,n){return Sn(t,e,n).map((function(e){var n=pn(t,r(xn,e));return N(n,(function(t){return t.element}))}))},On=function(t,e){return hn(t,e,(function(t,e){return Bt(e,t)})).map((function(t){return t.element}))},Tn=function(t,e,n){var r=En(t);return kn(r,e,n)},_n=function(t,e,n,r,o){var i=En(t),u=Dt(t,n)?m.some(e):On(i,e),a=Dt(t,o)?m.some(r):On(i,r);return u.bind((function(t){return a.bind((function(e){return kn(i,t,e)}))}))},En=dn,An=function(t,e){ue(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Nn=function(t,e){se(t).fold((function(){ue(t).each((function(t){Mn(t,e)}))}),(function(t){An(t,e)}))},Rn=function(t,e){(function(t){return fe(t,0)})(t).fold((function(){Mn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Mn=function(t,e){t.dom.appendChild(e.dom)},zn=function(t,e){An(t,e),Mn(e,t)},Dn=function(t,e){R(e,(function(n,r){var o=0===r?t:e[r-1];Nn(o,n)}))},Bn=function(t,e){R(e,(function(e){Mn(t,e)}))},Pn=function(t){t.dom.textContent="",R(le(t),(function(t){In(t)}))},In=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ln=function(t){var e,n=le(t);n.length>0&&(e=t,R(n,(function(t){An(e,t)}))),In(t)},Hn=function(t,e){var n=function(e){return t(e)?m.from(e.dom.nodeValue):m.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(ee),Fn=function(t){return Hn.get(t)},Vn=function(t){return Hn.getOption(t)},jn=function(t,e){return Hn.set(t,e)},Un=["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"];function Wn(){return{up:e({selector:Oe,closest:Ee,predicate:ke,all:ae}),down:e({selector:Ce,predicate:ye}),styles:e({get:Fe,getRaw:je,set:Le,remove:Ue}),attrs:e({get:Me,set:Ne,remove:De,copyTo:function(t,e){var n=Be(t);Re(e,n)}}),insert:e({before:An,after:Nn,afterAll:Dn,append:Mn,appendAll:Bn,prepend:Rn,wrap:zn}),remove:e({unwrap:Ln,remove:In}),create:e({nu:Rt.fromTag,clone:function(t){return Rt.fromDom(t.dom.cloneNode(!1))},text:Rt.fromText}),query:e({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ce,nextSibling:se}),property:e({children:le,name:Yt,parent:ue,document:function(t){return ie(t).dom},isText:ee,isComment:Zt,isElement:te,getText:Fn,setText:jn,isBoundary:function(t){return!!te(t)&&("body"===Yt(t)||_(Un,Yt(t)))},isEmptyTag:function(t){return!!te(t)&&_(["br","img","hr","input"],Yt(t))},isNonEditable:function(t){return te(t)&&"false"===Me(t,"contenteditable")}}),eq:Dt,is:Pt}}var qn=function(t,e,n,r){var o=e(t,n);return z(r,(function(n,r){var o=e(t,r);return $n(t,n,o)}),o)},$n=function(t,e,n){return e.bind((function(e){return n.filter(r(t.eq,e))}))},Gn=Wn(),Xn=function(t,e){return function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,qn):m.none()}(Gn,(function(e,n){return t(n)}),e)},Kn=function(t){return Oe(t,"table")},Yn=function(t,e,n){var o=function(t){return function(e){return void 0!==n&&n(e)||Dt(e,t)}};return Dt(t,e)?m.some({boxes:m.some([t]),start:t,finish:e}):Kn(t).bind((function(i){return Kn(e).bind((function(u){if(Dt(i,u))return m.some({boxes:Tn(i,t,e),start:t,finish:e});if(Bt(i,u)){var a=(s=we(e,"td,th",o(i))).length>0?s[s.length-1]:e;return m.some({boxes:_n(i,t,i,e,u),start:t,finish:a})}if(Bt(u,i)){var s,l=(s=we(t,"td,th",o(u))).length>0?s[s.length-1]:t;return m.some({boxes:_n(u,t,i,e,u),start:t,finish:l})}return function(t,e,n){return function(t,e,n,o){void 0===o&&(o=c);var i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return P(t,o).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},s=a(i),l=a(u),f=B(s,(function(e){return E(l,function(t,e){return r(t.eq,e)}(t,e))}));return{firstpath:s,secondpath:l,shared:f}}(Gn,t,e,void 0)}(t,e).shared.bind((function(r){return Ee(r,"table",n).bind((function(n){var r=we(e,"td,th",o(n)),a=r.length>0?r[r.length-1]:e,c=we(t,"td,th",o(n)),s=c.length>0?c[c.length-1]:t;return m.some({boxes:_n(n,t,i,e,u),start:s,finish:a})}))}))}))}))},Jn=function(t,e){var n=Ce(t,e);return n.length>0?m.some(n):m.none()},Qn=function(t,e,n){return _e(t,e).bind((function(e){return _e(t,n).bind((function(t){return Xn(Kn,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Zn=function(t,e,n,r,o){return function(t,e){return B(t,(function(t){return Mt(t,e)}))}(t,o).bind((function(t){return function(t,e,n){return nn(t).bind((function(r){return function(t,e,n,r){return hn(t,e,Dt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return gn(t,o+n,i+r).map((function(t){return t.element}))}))}(En(r),t,e,n)}))}(t,e,n).bind((function(t){return function(t,e){return Oe(t,"table").bind((function(n){return _e(n,e).bind((function(e){return Yn(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},tr=function(t,e){return Jn(t,e)},er=function(t,e,n){return Qn(t,e,n).bind((function(e){var n=function(e){return Dt(t,e)},o="thead,tfoot,tbody,table",i=Oe(e.first,o,n),u=Oe(e.last,o,n);return i.bind((function(t){return u.bind((function(n){return Dt(t,n)?function(t,e,n){return function(t,e,n){return Sn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,o=r(Cn,e),i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)n=n&&gn(t,i,u).exists(o);return n?m.some(e):m.none()}(t,e)}))}(En(t),e,n)}(e.table,e.first,e.last):m.none()}))}))}))},nr=function(t){if(!b(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return R(t,(function(r,o){var i=It(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!b(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=It(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!H(e,(function(t){return _(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},rr=nr([{none:[]},{multiple:["elements"]},{single:["element"]}]),or=function(t,e,n,r){return t.fold(e,n,r)},ir=rr.none,ur=rr.multiple,ar=rr.single,cr=tinymce.util.Tools.resolve("tinymce.PluginManager"),sr=function(t,e,n){var r=t[n].element,o=Rt.fromTag("td");Mn(o,Rt.fromTag("br")),(e?Mn:Rn)(r,o)},lr=function(t,e){var n=function(t){return Mt(t.element,e)},r=cn(t),o=mn(r),i=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0;return Ht(t.access,(function(t){if(e(t)){var n=t.row,a=n+t.rowspan-1,c=t.column,s=c+t.colspan-1;n<r?r=n:a>i&&(i=a),c<o?o=c:s>u&&(u=s)}})),function(t,e,n,r){return{minRow:t,minCol:e,maxRow:n,maxCol:r}}(r,o,i,u)}(o,n),u="th:not("+e+"),td:not("+e+")",a=Qe(t,"th,td",(function(t){return Mt(t,u)}));return R(a,In),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol||(gn(e,u,c).filter(r).isNone()?sr(t,a,u):a=!0)}(r,o,i,n),function(t,e){var n=M(Je(t,"tr"),(function(t){return 0===t.dom.childElementCount}));R(n,In),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||R(Je(t,"th,td"),(function(t){De(t,"rowspan"),De(t,"colspan")})),De(t,"width"),De(t,"height"),Ue(t,"width"),Ue(t,"height")}(t,i),t},fr=function(t){return"img"===Yt(t)?1:Vn(t).fold((function(){return le(t).length}),(function(t){return t.length}))},dr=["img","br"],mr=function(t){return Vn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||_(dr,Yt(t))},gr=function(t){return e=mr,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Rt.fromDom(t.childNodes[r]);if(e(o))return m.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return m.none()})(t.dom);var e,n},hr=function(t){return pr(t,mr)},pr=function(t,e){var n=function(t){for(var r=le(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return m.some(i);var u=n(i);if(u.isSome())return u}return m.none()};return n(t)},vr=function(t,e){return Rt.fromDom(t.dom.cloneNode(e))},br=function(t){return vr(t,!1)},yr=function(t){return vr(t,!0)},wr={scope:["row","col"]},xr=function(){var t=Rt.fromTag("td");return Mn(t,Rt.fromTag("br")),t},Cr=function(){return Rt.fromTag("col")},Sr=function(){return Rt.fromTag("colgroup")},kr=function(t,e,n){var r=function(t,e){var n=function(t,e){var n=Rt.fromTag(e),r=Be(t);return Re(n,r),n}(t,e),r=le(yr(t));return Bn(n,r),n}(t,e);return Ht(n,(function(t,e){null===t?De(r,e):Ne(r,e,t)})),r},Or=function(t){return t},Tr=function(t){return function(){return Rt.fromTag("tr",t.dom)}},_r=function(t,e,n){var r=function(t,e){var n,r,o;n=e,r=t.element.dom,o=n.dom,Pe(r)&&Pe(o)&&(o.style.cssText=r.style.cssText),Ue(e,"height"),1!==t.colspan&&Ue(t.element,"width")};return{col:function(e){var n=oe(e.element),o=Rt.fromTag(Yt(e.element),n.dom);return r(e,o),t(e.element,o),o},colgroup:Sr,row:Tr(e),cell:function(e){var o=oe(e.element),i=Rt.fromTag(Yt(e.element),o.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?function(t,e,n){return gr(t).map((function(r){var o=n.join(","),i=we(r,o,(function(e){return Dt(e,t)}));return z(i,(function(t,e){var n=br(e);return De(n,"contenteditable"),Mn(t,n),n}),e)})).getOr(e)}(e.element,i,u):i;return Mn(a,Rt.fromTag("br")),r(e,i),function(t,e){Ht(wr,(function(n,r){return ze(t,r).filter((function(t){return _(n,t)})).each((function(t){return Ne(e,r,t)}))}))}(e.element,i),t(e.element,i),i},replace:kr,gap:xr}},Er=function(t){return{col:Cr,colgroup:Sr,row:Tr(t),cell:xr,replace:Or,gap:xr}},Ar=function(t){return N(t,Rt.fromDom)},Nr=function(t){return or(t.get(),e([]),n,F)},Rr=function(t){var e=function(t,e){return ze(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Nr(t);return n.length>0&&H(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?m.some(n):m.none()},Mr=function(t,e,n){return or(e.get(),m.none,(function(e){return e.length<=1?m.none():er(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),m.none)},zr={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Dr=function(t){return{element:t,mergable:m.none(),unmergable:m.none(),selection:[t]}},Br=function(t,e,n){return{element:n,mergable:Mr(e,t,zr),unmergable:Rr(t),selection:Nr(t)}},Pr=nr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ir=W({},Pr),Lr=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e};function Hr(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Fe(n,t);return parseFloat(o)||0}return r},r=function(t,e){return D(e,(function(e,n){var r=Fe(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!S(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Pe(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var Fr,Vr,jr,Ur=Hr("width",(function(t){return t.dom.offsetWidth})),Wr=function(t){return Ur.get(t)},qr=function(t){return Ur.getOuter(t)},$r=function(t){var e=t.grid,r=A(e.columns,n),o=A(e.rows,n);return N(r,(function(e){return Gr((function(){return L(o,(function(n){return gn(t,n,e).filter((function(t){return t.column===e})).toArray()}))}),(function(t){return 1===t.colspan}),(function(){return gn(t,0,e)}))}))},Gr=function(t,e,n){var r=t();return B(r,e).orThunk((function(){return m.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Xr=function(t){var r=t.grid,o=A(r.rows,n),i=A(r.columns,n);return N(o,(function(n){return Gr((function(){return L(i,(function(r){return gn(t,n,r).filter((function(t){return t.row===n})).fold(e([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return gn(t,n,0)}))}))},Kr=function(t,e){return function(n){return"rtl"===Yr(n)?e:t}},Yr=function(t){return"rtl"===Fe(t,"direction")?"rtl":"ltr"},Jr=Hr("height",(function(t){var e=t.dom;return ve(t)?e.getBoundingClientRect().height:e.offsetHeight})),Qr=function(t){return Jr.get(t)},Zr=function(t){return Jr.getOuter(t)},to=function(t,e){return{left:t,top:e,translate:function(n,r){return to(t+n,e+r)}}},eo=to,no=function(t,e){return void 0!==t?t:void 0!==e?e:0},ro=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return eo(n.offsetLeft,n.offsetTop);var i=no(null==r?void 0:r.pageYOffset,o.scrollTop),u=no(null==r?void 0:r.pageXOffset,o.scrollLeft),a=no(o.clientTop,n.clientTop),c=no(o.clientLeft,n.clientLeft);return oo(t).translate(u-c,i-a)},oo=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?eo(n.offsetLeft,n.offsetTop):ve(t)?function(t){var e=t.getBoundingClientRect();return eo(e.left,e.top)}(e):eo(0,0)},io=function(t,e){return{row:t,y:e}},uo=function(t,e){return{col:t,x:e}},ao=function(t){return ro(t).left+qr(t)},co=function(t){return ro(t).left},so=function(t,e){return uo(t,co(e))},lo=function(t,e){return uo(t,ao(e))},fo=function(t){return ro(t).top},mo=function(t,e){return io(t,fo(e))},go=function(t,e){return io(t,fo(e)+Zr(e))},ho=function(t,e,n){if(0===n.length)return[];var r=N(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},po={delta:n,positions:function(t){return ho(mo,go,t)},edge:fo},vo=Kr({delta:n,edge:co,positions:function(t){return ho(so,lo,t)}},{delta:function(t){return-t},edge:ao,positions:function(t){return ho(lo,so,t)}}),bo={delta:function(t,e){return vo(e).delta(t,e)},positions:function(t,e){return vo(e).positions(t,e)},edge:function(t){return vo(t).edge(t)}},yo={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:[""]},wo=(Fr="[eE][+-]?[0-9]+",jr=["Infinity","[0-9]+\\."+(Vr=function(t){return"(?:"+t+")?"})("[0-9]+")+Vr(Fr),"\\.[0-9]+"+Vr(Fr),"[0-9]+"+Vr(Fr)].join("|"),new RegExp("^([+-]?(?:"+jr+"))(.*)$")),xo=function(){var t=At().browser;return t.isIE()||t.isEdge()},Co=function(t,e,n){return function(t,e){var n=parseFloat(t);return isNaN(n)?e:n}(Fe(t,e),n)},So=function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().width;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-left",0)-Co(t,"padding-right",0)-(Co(t,"border-left-width",0)+Co(t,"border-right-width",0))}(t):Co(t,"width",Wr(t))},ko=/(\d+(\.\d+)?)%/,Oo=/(\d+(\.\d+)?)px|em/,To=function(t,e){Le(t,"width",e+"px")},_o=function(t,e){Le(t,"width",e+"%")},Eo=function(t,e){Le(t,"height",e+"px")},Ao=function(t){var e=function(t){return je(t,"height").getOrThunk((function(){return function(t){return xo()?function(t){var e=t.dom.getBoundingClientRect().height;return"border-box"===Fe(t,"box-sizing")?e:e-Co(t,"padding-top",0)-Co(t,"padding-bottom",0)-(Co(t,"border-top-width",0)+Co(t,"border-bottom-width",0))}(t):Co(t,"height",Qr(t))}(t)+"px"}))}(t);return e?function(t,e,n,r){var o=parseInt(t,10);return et(t,"%")&&"table"!==Yt(e)?function(t,e,n,r){var o=nn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o}(e,t,Qr,Eo):Qr(t)},No=function(t){return je(t,"width").fold((function(){return m.from(Me(t,"width"))}),(function(t){return m.some(t)}))},Ro=function(t,e){return t/e.pixelWidth()*100},Mo=function(t,e){return No(t).fold((function(){var n=Wr(t);return Ro(n,e)}),(function(n){return function(t,e,n){var r=ko.exec(e);if(null!==r)return parseFloat(r[1]);var o=So(t);return Ro(o,n)}(t,n,e)}))},zo=function(t,e){return No(t).fold((function(){return So(t)}),(function(n){return function(t,e,n){var r=Oo.exec(e);if(null!==r)return parseInt(r[1],10);var o=ko.exec(e);return null!==o?function(t,e){return t/100*e.pixelWidth()}(parseFloat(o[1]),n):So(t)}(t,n,e)}))},Do=function(t){return function(t,e,n){return n(t)/qe(t,"rowspan")}(t,0,Ao)},Bo=function(t,e,n){Le(t,"width",e+n)},Po=function(t){return n=Wr,o=(r=e=t,m.from(r.dom.offsetParent).map(Rt.fromDom)).getOr(be(oe(e))),n(e)/n(o)*100+"%";var e,n,r,o},Io=e(ko),Lo=e(Oo),Ho=("col",function(t){return te(t)&&"col"===Yt(t)}),Fo=function(t,e,n){return je(t,e).fold((function(){return n(t)+"px"}),(function(t){return t}))},Vo=function(t,e){return Fo(t,"width",(function(t){return Ho(t)?Wr(t):zo(t,e)}))},jo=function(t){return Fo(t,"height",Do)},Uo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(function(t,e){if(e<0||e>=t.length-1)return m.none();var n=t[e].fold((function(){var n=function(t){var e=k.call(t,0);return e.reverse(),e}(t.slice(0,e));return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return U(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return m.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))}(n,e))}),(function(t){return o(t)}))},Wo=function(t,e,r,o,i){var u=$r(t),c=yn(t)?function(t){return N(bn(t),(function(t){return m.from(t.element)}))}(t):u,s=[m.some(bo.edge(e))].concat(N(bo.positions(u,e),(function(t){return t.map((function(t){return t.x}))}))),l=a($e);return N(c,(function(t,e){return Uo(t,e,s,l,(function(t){if(function(t){return!Ho(t)||je(t,"width").isSome()}(t))return r(t,i);var a,c=null!=(a=u[e])?n(a):m.none();return Uo(c,e,s,l,(function(t){return o(m.some(Wr(t)))}),o)}),o)}))},qo=function(t){return t.map((function(t){return t+"px"})).getOr("")},$o=function(t,e,n){return Wo(t,e,zo,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Go=function(t,e,n,r,o){var i=Xr(t),u=[m.some(n.edge(e))].concat(N(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return N(i,(function(t,e){return Uo(t,e,u,a(Ge),r,o)}))},Xo=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ko=function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Yo=function(t,e,n){var r=function(t,e){return yn(t)?function(t,e){var n=bn(t);return N(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=vn(t);return N(n,(function(t){var n=Xo(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)}(t,e);R(r,(function(t){n.setElementWidth(t.element,t.width)}))},Jo=function(t,n,r,o,i){var u=dn(t),a=i.getCellDelta(n),c=i.getWidths(u,i),s=r===u.grid.columns-1,l=o.clampTableDelta(c,r,a,i.minCellWidth(),s),f=function(t,n,r,o,i){var u=t.slice(0),a=function(t,e){return 0===t.length?Ir.none():1===t.length?Ir.only(0):0===e?Ir.left(0,1):e===t.length-1?Ir.right(e-1,e):e>0&&e<t.length-1?Ir.middle(e-1,e,e+1):Ir.none()}(t,n),c=e(N(u,e(0)));return a.fold(c,(function(t){return o.singleColumnWidth(u[t],r)}),(function(t,e){return i.calcLeftEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}),(function(t,e,n){return i.calcMiddleDeltas(u,t,e,n,r,o.minCellWidth(),o.isRelative)}),(function(t,e){return i.calcRightEdgeDeltas(u,t,e,r,o.minCellWidth(),o.isRelative)}))}(c,r,l,i,o),d=N(f,(function(t,e){return t+c[e]}));Yo(u,d,i),o.resizeTable(i.adjustTableWidth,l,s)},Qo=function(t){return N(t,e(0))},Zo=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},ti=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},ei=ti((function(t){return t<0})),ni=ti(s),ri=function(t,n){var r=m.from(t.dom.documentElement).map(Rt.fromDom).getOr(t);return{parent:e(r),view:e(t),origin:e(eo(0,0)),isResizable:n}},oi=nr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),ii=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):oi.invalid(n)},ui=W(W({},oi),{from:function(t){return et(t,"%")?ii("%",oi.percent,t):et(t,"px")?ii("px",oi.pixels,t):oi.invalid(t)}}),ai=function(t,n,r){var o=ui.from(r),i=H(t,(function(t){return"0px"===t}))?function(t,n){var r=t.fold((function(){return e("")}),(function(t){return e(t/n+"px")}),(function(){return e(100/n+"%")}));return A(n,r)}(o,t.length):function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return N(t,(function(t){return ui.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))}(o,t,n);return li(i)},ci=function(t,r){return 0===t.length?r:z(t,(function(t,r){return ui.from(r).fold(e(0),n,n)+t}),0)},si=function(t,n){return ui.from(t).fold(e(t),(function(t){return t+n+"px"}),(function(t){return t+n+"%"}))},li=function(t){if(0===t.length)return t;var e=z(t,(function(t,e){var n=ui.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+"px",remainder:t-n}}(t)}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([si(n[n.length-1],Math.round(e.remainder))])},fi=ui.from,di=function(t){return fi(t).fold(e("px"),e("px"),e("%"))},mi=function(t,e,n,r){var o=dn(t),i=o.all,u=vn(o),a=bn(o);e.each((function(e){var n=di(e),i=Wr(t),c=function(t,e,n){return Wo(t,e,Vo,qo,n)}(o,t,r),s=ai(c,i,e);yn(o)?function(t,e,n){R(e,(function(e,r){var o=ci([t[r]],Ke());Le(e.element,"width",o+n)}))}(s,a,n):function(t,e,n){R(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=ci(r,Ke());Le(e.element,"width",o+n)}))}(s,u,n),Le(t,"width",e)})),n.each((function(e){var n=di(e),r=Qr(t),a=function(t,e,n){return Go(t,e,n,jo,qo)}(o,t,po);!function(t,e,n,r){R(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=ci(n,Ye());Le(e.element,"height",o+r)})),R(e,(function(e,n){Le(e.element,"height",t[n])}))}(ai(a,r,e),i,u,n),Le(t,"height",e)}))},gi=function(t){return No(t).exists((function(t){return ko.test(t)}))},hi=function(t){return No(t).exists((function(t){return Oo.test(t)}))},pi=function(t){return No(t).isNone()},vi=Po,bi=function(t){return dn(t).grid},yi=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=M(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};R(t,(function(t,e){o[t]=n[e]})),R(e,(function(t){t(o)}))}}},wi=function(t){return{registry:Ft(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Ft(t,(function(t){return t.trigger}))}},xi=function(t){return t.slice(0).sort()},Ci=function(t,e){var n=M(e,(function(e){return!_(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+xi(t).join(", "))}(n)},Si=function(t){return function(t,e){return function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var r;return function(t,e){if(!b(e))throw new Error("The required fields must be an array. Was: "+e+".");R(e,(function(e){if(!p(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),r=xi(e),B(r,(function(t,e){return e<r.length-1&&t===r[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+r.join(", ")+"].")})),function(r){var o=It(r);H(e,(function(t){return _(o,t)}))||function(t,e){throw new Error("All required keys ("+xi(t).join(", ")+") were not specified. Specified keys were: "+xi(e).join(", ")+".")}(e,o),t(e,o);var i=M(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+xi(t).join(", ")+") were not.")}(i,n.label),r}}(t,e,{validate:C,label:"function"})}(Ci,t)},ki=Si(["compare","extract","mutate","sink"]),Oi=Si(["element","start","stop","destroy"]),Ti=Si(["forceDrop","drop","move","delayDrop"]);function _i(){var e,n,r={onEvent:t,reset:t},o=(e=m.none(),{onEvent:function(t,r){r.extract(t).each((function(t){(function(t,n){var r=e.map((function(e){return t.compare(e,n)}));return e=m.some(n),r})(r,t).each((function(t){n.trigger.move(t)}))}))},reset:function(){e=m.none()},events:(n=wi({move:yi(["info"])})).registry}),i=r;return{on:function(){i.reset(),i=o},off:function(){i.reset(),i=r},isOn:function(){return i===o},onEvent:function(t,e){i.onEvent(t,e)},events:o.events}}var Ei=function(t){var e,n,r=Rt.fromDom(function(t){if(me()&&x(t.target)){var e=Rt.fromDom(t.target);if(te(e)&&pe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return V(n,0)}}return m.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Ai=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ni=s,Ri=function(t,e,n){return function(t,e,n,o){return function(t,e,n,o,i){var u=function(t,e){return function(n){t(n)&&e(Ei(n))}}(n,o);return t.dom.addEventListener(e,u,i),{unbind:r(Ai,t,e,u,i)}}(t,e,n,o,!1)}(t,e,Ni,n)},Mi=Ei,zi=function(t){return void 0!==t.dom.classList},Di=function(t,e){return function(t,e,n){var r=function(t,e){var n=Me(t,e);return void 0===n||""===n?[]:n.split(" ")}(t,e).concat([n]);return Ne(t,e,r.join(" ")),!0}(t,"class",e)},Bi=function(t,e){zi(t)?t.dom.classList.add(e):Di(t,e)},Pi=function(t,e){return zi(t)&&t.dom.classList.contains(e)},Ii=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Li=Ii("ephox-dragster"),Hi=Li.resolve,Fi=ki({compare:function(t,e){return eo(e.left-t.left,e.top-t.top)},extract:function(t){return m.some(eo(t.x,t.y))},sink:function(t,e){var n=function(t){var e=W({layerClass:Hi("blocker")},t),n=Rt.fromTag("div");return Ne(n,"role","presentation"),He(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Bi(n,Hi("blocker")),Bi(n,e.layerClass),{element:function(){return n},destroy:function(){In(n)}}}(e),r=Ri(n.element(),"mousedown",t.forceDrop),o=Ri(n.element(),"mouseup",t.drop),i=Ri(n.element(),"mousemove",t.move),u=Ri(n.element(),"mouseout",t.delayDrop);return Oi({element:n.element,start:function(t){Mn(t,n.element())},stop:function(){In(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Vi=function(t){return"true"===Me(t,"contenteditable")},ji=Ii("ephox-snooker"),Ui=ji.resolve,Wi=Ui("resizer-bar"),qi=Ui("resizer-rows"),$i=Ui("resizer-cols"),Gi=function(t){var e=Ce(t.parent(),"."+Wi);R(e,In)},Xi=function(t,e,n){var r=t.origin();R(e,(function(e){e.each((function(e){var o=n(r,e);Bi(o,Wi),Mn(t.parent(),o)}))}))},Ki=function(t,e,n,r,o){var i=ro(n),u=e.isResizable,a=r.length>0?po.positions(r,n):[],c=a.length>0?function(t,e){return L(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Rt.fromTag("div");return He(i,{position:"absolute",left:e+"px",top:n-3.5+"px",height:"7px",width:r+"px"}),Re(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r);return Bi(o,qi),o}))}(e,M(a,(function(t,e){return E(c,(function(t){return e===t}))})),i,qr(n));var s=o.length>0?bo.positions(o,n):[],l=s.length>0?function(t,e){var n=[];return A(t.grid.columns,(function(r){wn(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),M(n,(function(n){var r=pn(t,(function(t){return t.column===n}));return H(r,(function(t){return e(t.element)}))}))}(t,u):[];!function(t,e,n,r){Xi(t,e,(function(t,e){var o,i,u,a,c,s=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=r,c=Rt.fromTag("div"),He(c,{position:"absolute",left:i-3.5+"px",top:u+"px",height:a+"px",width:"7px"}),Re(c,{"data-column":o,role:"presentation"}),c);return Bi(s,$i),s}))}(e,M(s,(function(t,e){return E(l,(function(t){return e===t}))})),i,Zr(n))},Yi=function(t,e){if(Gi(t),t.isResizable(e)){var n=dn(e),r=Xr(n),o=$r(n);Ki(n,t,e,r,o)}},Ji=function(t,e){var n=Ce(t.parent(),"."+Wi);R(n,e)},Qi=function(t){Ji(t,(function(t){Le(t,"display","none")}))},Zi=function(t){Ji(t,(function(t){Le(t,"display","block")}))},tu=Ui("resizer-bar-dragging"),eu=function(t){var e=function(){var t=wi({drag:yi(["xDelta","yDelta","target"])}),e=m.none(),n=function(){var t=wi({drag:yi(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();return n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))})),{assign:function(t){e=m.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}}(),n=function(t,e){return void 0===e&&(e={}),function(t,e,n){var r,o,i=!1,u=wi({start:yi([]),stop:yi([])}),a=_i(),c=function(){f.stop(),a.isOn()&&(a.off(),u.trigger.stop())},s=(r=c,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout((function(){r.apply(null,t),o=null}),200)}});a.events.move.bind((function(n){e.mutate(t,n.info)}));var l=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i&&t.apply(null,e)}},f=e.sink(Ti({forceDrop:c,drop:l(c),move:l((function(t){s.cancel(),a.onEvent(t,e)})),delayDrop:l(s.throttle)}),n);return{element:f.element,go:function(t){f.start(t),a.on(),u.trigger.start()},on:function(){i=!0},off:function(){i=!1},destroy:function(){f.destroy()},events:u.registry}}(t,void 0!==e.mode?e.mode:Fi,e)}(e,{}),o=m.none(),i=function(t,e){return m.from(Me(t,e))};e.events.drag.bind((function(t){i(t.target,"data-row").each((function(e){var n=Xe(t.target,"top");Le(t.target,"top",n+t.yDelta+"px")})),i(t.target,"data-column").each((function(e){var n=Xe(t.target,"left");Le(t.target,"left",n+t.xDelta+"px")}))}));var u=function(t,e){return Xe(t,e)-We(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){o.each((function(n){i(e,"data-row").each((function(t){var r=u(e,"top");De(e,"data-initial-top"),f.trigger.adjustHeight(n,r,parseInt(t,10))})),i(e,"data-column").each((function(t){var r=u(e,"left");De(e,"data-initial-left"),f.trigger.adjustWidth(n,r,parseInt(t,10))})),Yi(t,n)}))}))}));var a=function(r,o){f.trigger.startAdjust(),e.assign(r),Ne(r,"data-initial-"+o,Xe(r,o)),Bi(r,tu),Le(r,"opacity","0.2"),n.go(t.parent())},c=Ri(t.parent(),"mousedown",(function(t){var e;e=t.target,Pi(e,qi)&&a(t.target,"top"),function(t){return Pi(t,$i)}(t.target)&&a(t.target,"left")})),s=function(e){return Dt(e,t.view())},l=Ri(t.view(),"mouseover",(function(e){var n;(n=e.target,Ee(n,"table",s).filter((function(t){return function(t,e){return Ee(t,"[contenteditable]",e)}(t,s).exists(Vi)}))).fold((function(){ve(e.target)&&Gi(t)}),(function(e){o=m.some(e),Yi(t,e)}))})),f=wi({adjustHeight:yi(["table","delta","row"]),adjustWidth:yi(["table","delta","column"]),startAdjust:yi([])});return{destroy:function(){c.unbind(),l.unbind(),n.destroy(),Gi(t)},refresh:function(e){Yi(t,e)},on:n.on,off:n.off,hideBars:r(Qi,t),showBars:r(Zi,t),events:f.registry}},nu=function(t,e,n){var r=po,o=bo,i=eu(t),u=wi({beforeResize:yi(["table","type"]),afterResize:yi(["table","type"]),startDrag:yi([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row"),function(t,e,n,r){var o=dn(t),i=function(t,e,n){return Go(t,e,n,Do,(function(t){return t.getOrThunk(Ye)}))}(o,t,r),u=N(i,(function(t,r){return n===r?Math.max(e+t,Ye()):t})),a=Ko(o,u),c=function(t,e){return N(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);R(c,(function(t){Eo(t.element,t.height)})),R(a,(function(t){Eo(t.element,t.height)}));var s=z(u,(function(t,e){return t+e}),0);Eo(t,s)}(e,r.delta(t.delta,e),t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Jo(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},ru=function(t,e){return t.fire("newrow",{node:e})},ou=function(t,e){return t.fire("newcell",{node:e})},iu=function(t,e,n){t.fire("TableModified",W(W({},n),{table:e}))},uu={"border-collapse":"collapse",width:"100%"},au={border:"1"},cu="preservetable",su=function(t){return t.getParam("table_sizing_mode","auto")},lu=function(t){return t.getParam("table_responsive_width")},fu=function(t){return t.getParam("table_default_attributes",au,"object")},du=function(t){return t.getParam("table_default_styles",function(t){if(bu(t)){var e=t.getBody().offsetWidth;return W(W({},uu),{width:e+"px"})}return yu(t)?jt(uu,(function(t,e){return"width"!==e})):uu}(t),"object")},mu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},gu=function(t){return t.getParam("table_row_advtab",!0,"boolean")},hu=function(t){return t.getParam("table_advtab",!0,"boolean")},pu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},vu=function(t){return"relative"===su(t)||!0===lu(t)},bu=function(t){return"fixed"===su(t)||!1===lu(t)},yu=function(t){return"responsive"===su(t)},wu=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},xu=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return _(["section","cells","sectionCells","auto"],n)?n:e},Cu=function(t){var e=t.getParam("table_column_resizing",cu,"string");return B(["preservetable","resizetable"],(function(t){return t===e})).getOr(cu)},Su=function(t){return"preservetable"===Cu(t)},ku=function(t){var e=t.getParam("table_clone_elements");return p(e)?m.some(e.split(/[ ,]/)):Array.isArray(e)?m.some(e):m.none()},Ou=function(t){return t.nodeName.toLowerCase()},Tu=function(t){return Rt.fromDom(t.getBody())},_u=function(t){return t.getBoundingClientRect().width},Eu=function(t){return t.getBoundingClientRect().height},Au=function(t){return function(e){return Dt(e,Tu(t))}},Nu=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Ru=function(t){De(t,"data-mce-style");var e=function(t){return De(t,"data-mce-style")};R(tn(t),e),R(en(t),e)},Mu=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return m.from(n).filter(rt)},zu=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},Du=function(t){return Rt.fromDom(t.selection.getStart())},Bu=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Pu=function(t,e){var n=Bu(parseFloat(t)),r=Bu(Wr(e));return{width:n.get,pixelWidth:r.get,getWidths:function(t,n){return function(t,e,n){return Wo(t,e,Mo,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)}(t,e,n)},getCellDelta:function(t){return t/r.get()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Ke()/r.get()*100},setElementWidth:_o,adjustTableWidth:function(t){var o=n.get(),i=o+t/100*o;_o(e,i),n.set(i),r.set(Wr(e))},isRelative:!0,label:"percent"}},Iu=function(t,e){var r=Bu(t),o=r.get;return{width:o,pixelWidth:o,getWidths:function(t,n){return $o(t,e,n)},getCellDelta:n,singleColumnWidth:function(t,e){return[Math.max(Ke(),t+e)-t]},minCellWidth:Ke,setElementWidth:To,adjustTableWidth:function(t){var n=o()+t;To(e,n),r.set(n)},isRelative:!1,label:"pixel"}},Lu=function(n){return No(n).fold((function(){return function(n){var r=function(){return Wr(n)},o=e(0);return{width:r,pixelWidth:r,getWidths:function(t,e){return $o(t,n,e)},getCellDelta:o,singleColumnWidth:e([0]),minCellWidth:o,setElementWidth:t,adjustTableWidth:t,isRelative:!0,label:"none"}}(n)}),(function(t){return function(t,e){var n=Io().exec(e);if(null!==n)return Pu(n[1],t);var r=Lo().exec(e);if(null!==r){var o=parseInt(r[1],10);return Iu(o,t)}var i=Wr(t);return Iu(i,t)}(n,t)}))},Hu=Iu,Fu=Pu,Vu=function(t,e){if(vu(t)){var n=Mu(t,e.dom).filter(zu).getOrThunk((function(){return vi(e)}));return Fu(n,e)}return bu(t)?Hu(Wr(e),e):Lu(e)},ju=function(t){De(t,"width")},Uu=function(t,e){!function(t,e){var n=Po(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},Wu=function(t,e){!function(t,e){var n=function(t){return Wr(t)+"px"}(t);mi(t,m.some(n),m.none(),e),ju(t)}(e,Vu(t,e))},qu=function(t){Ue(t,"width");var e=en(t),n=e.length>0?e:tn(t);R(n,(function(t){Ue(t,"width"),ju(t)})),ju(t)},$u="bar-",Gu=function(t){return"false"!==Me(t,"data-mce-resize")},Xu=function(t){var n,r,o=m.none(),i=m.none(),u=m.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Vu(t,e)},l=function(){return Su(t)?{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=D(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ei(t,e,n,r)},calcLeftEdgeDeltas:n=function(t,e,n,r,o){var i=ni(t,r>=0?n:e,r,o);return Zo(t,e,n+1,[i,-i],Qo)},calcMiddleDeltas:function(t,e,r,o,i,u){return n(t,r,o,i,u)},calcRightEdgeDeltas:function(t,n,r,o,i,u){if(u)return Qo(t);var a=o/t.length;return N(t,e(a))}}:function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return N(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=ei(t,e,r,o);return Zo(t,e,n+1,[i,0],Qo)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ei,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=ei(e,r,o,i);return Qo(e.slice(0,r)).concat([a])}}}();var n};return t.on("init",(function(){var n=function(t,n){return t.inline?function(t,n,r){return{parent:e(n),view:e(t),origin:e(eo(0,0)),isResizable:r}}(Tu(t),(r=Rt.fromTag("div"),He(r,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Mn(be(Rt.fromDom(document)),r),r),n):ri(Rt.fromDom(t.getDoc()),n);var r}(t,Gu);if(u=m.some(n),function(t){var e=t.getParam("object_resizing",!0);return p(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var r=l(),a=nu(n,r,s);a.on(),a.events.startDrag.bind((function(e){o=m.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,_u(n),Eu(n),$u+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Ru(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,_u(r),Eu(r),$u+e.type),t.undoManager.add()})),i=m.some(a)}})),t.on("ObjectResizeStart",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o);R(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Cu(t)+"-columns")})),!hi(i)&&bu(t)?Wu(t,i):!gi(i)&&vu(t)&&Uu(t,i),pi(i)&&tt(e.origin,$u)&&Uu(t,i),n=e.width,r=yu(t)?"":Mu(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var o=e.target;if(a(o)){var i=Rt.fromDom(o),u=e.origin;tt(u,"corner-")&&function(e,o,i){var u=et(o,"e");if(""===r&&Uu(t,e),i!==n&&""!==r){Le(e,"width",r);var a=l(),c=s(e),f=Su(t)||u?function(t){return bi(t).columns}(e)-1:0;Jo(e,i-n,f,a,c)}else if(zu(r)){var d=parseFloat(r.replace("%",""));Le(e,"width",i*d/n+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(r)&&function(t){var e=dn(t);yn(e)||R(tn(t),(function(t){var e=Fe(t,"width");Le(t,"width",e),De(t,"width")}))}(e)}(i,u,e.width),Ru(i),iu(t,i.dom)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr(ri(Rt.fromDom(t.getBody()),Gu))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&In(e.parent())}(t,e)}))}}},Ku=function(t,e){return{element:t,offset:e}},Yu=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return Yu(t,e,n).orThunk((function(){return m.some(e)}))})):m.none()},Ju=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},Qu=function(t,e){var n=Yu(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return Ku(n,Ju(t,n));var r=t.property().children(n);return r.length>0?Qu(t,r[r.length-1]):Ku(n,Ju(t,n))},Zu=Qu,ta=Wn(),ea=function(t,e){(function(t){return No(t).bind((function(t){return e=t,n=["fixed","relative","empty"],m.from(wo.exec(e)).bind((function(t){var e=Number(t[1]),r=t[2];return function(t,e){return E(e,(function(e){return E(yo[e],(function(e){return t===e}))}))}(r,n)?m.some({value:e,unit:r}):m.none()}));var e,n}))})(t).each((function(n){var r=n.value/2;Bo(t,r,n.unit),Bo(e,r,n.unit)}))},na=function(t,e,n){t.cells[e]=n},ra=function(t,e){return Kt(e,t.section)},oa=function(t,e){var n=t.cells,r=N(n,e);return Kt(r,t.section)},ia=function(t,e){return t.cells[e]},ua=function(t,e){return ia(t,e).element},aa=function(t){return t.cells.length},ca=function(t){var e=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(a=u,"colgroup"===a.section?n:r).push(u)}var a;return{pass:n,fail:r}}(t);return{rows:e.fail,cols:e.pass}},sa=function(t,e,n,r){n===r?De(t,e):Ne(t,e,n)},la=function(t,e,n){j(xe(t,e)).fold((function(){return Rn(t,n)}),(function(t){return Nn(t,n)}))},fa=function(t,e){var n=[],r=[],o=function(t){return N(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return Pn(e),R(t.cells,(function(t){t.isNew&&r.push(t.element),sa(t.element,"colspan",t.colspan,1),sa(t.element,"rowspan",t.rowspan,1),Mn(e,t.element)})),e}))},i=function(t){return L(t,(function(t){return N(t.cells,(function(t){return sa(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Te(t,e).getOrThunk((function(){var n=Rt.fromTag(e,oe(t).dom);return"thead"===e?la(t,"caption,colgroup",n):"colgroup"===e?la(t,"caption",n):Mn(t,n),n}));return Pn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Bn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Te(t,e).each(In)}(n)},c=[],s=[],l=[],f=[];return R(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},da=function(t,e){if(0===t.length)return 0;var n=t[0];return P(t,(function(t){return!e(n.element,t.element)})).fold((function(){return t.length}),(function(t){return t}))},ma=function(t,e){var n=N(t,(function(t){return N(t.cells,c)}));return N(t,(function(r,o){return i=L(r.cells,(function(r,i){if(!1===n[o][i]){var u=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e).cells.slice(n),i=da(o,r),u=function(t,e){return N(t,(function(t){return ia(t,e)}))}(t,n).slice(e);return{colspan:i,rowspan:da(u,r)}}(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l})),u=r.section,{details:i,section:u};var i,u}))},ga=function(t,e,n){var r=[];if(yn(t)){var o=N(bn(t),(function(t){return Xt(t.element,n)}));r.push(Kt(o,"colgroup"))}for(var i=0;i<t.grid.rows;i++){for(var u=[],a=0;a<t.grid.columns;a++){var c=gn(t,i,a).map((function(t){return Xt(t.element,n)})).getOrThunk((function(){return Xt(e.gap(),!0)}));u.push(c)}var s=Kt(u,t.all[i].section);r.push(s)}return r},ha=function(t,e){return function(t,e){return N(t,(function(t){var n=function(t){return U(t,(function(t){return ue(t.element).map((function(t){var e=ue(t).isNone();return Xt(t,e)}))})).getOrThunk((function(){return Xt(e.row(),!0)}))}(t.details);return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(n.element,t.details,t.section,n.isNew)}))}(ma(t,Dt),e)},pa=function(t,e){return U(t.all,(function(t){return B(t.cells,(function(t){return Dt(e,t.element)}))}))},va=function(t,e,n,r,o){return function(i,u,a,c,s){var l=dn(u);return e(l,a).map((function(e){var n=function(t,e){return ga(t,e,!1)}(l,c),r=t(n,e,Dt,o(c));return{grid:ha(r.grid,c),cursor:r.cursor}})).fold((function(){return m.none()}),(function(t){var e=fa(u,t.grid),o=m.from(s).getOrThunk((function(){return Lu(u)}));return n(u,t.grid,o),r(u),Yi(i,u),m.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},ba=function(t,e){return Ze(e.element).bind((function(e){return pa(t,e)}))},ya=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some({cells:r,generators:e.generators,clipboard:e.clipboard}):m.none()},wa=function(t,e){var n=N(e.selection,(function(e){return Ze(e).bind((function(e){return pa(t,e)}))})),r=Lr(n);return r.length>0?m.some(r):m.none()},xa=function(t,e,n,r){for(var o=ca(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<aa(o[0]);a++){var c=n(ua(o[u],a),e);!0===c&&!1===i?na(o[u],a,Xt(r(),!0)):!0===c&&(i=!1)}return t},Ca=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:e(t),getOrThunk:e(t),getOrDie:e(t),or:function(e){return Ca(t)},orThunk:function(e){return Ca(t)},fold:function(e,n){return n(t)},map:function(e){return Ca(e(t))},mapError:function(e){return Ca(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},Sa=function(e){return{is:c,isValue:c,isError:s,getOr:n,getOrThunk:function(t){return t()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return Sa(e)},mapError:function(t){return Sa(t(e))},each:t,bind:function(t){return Sa(e)},exists:c,forall:s,toOptional:m.none}},ka={value:Ca,error:Sa,fromOption:function(t,e){return t.fold((function(){return Sa(e)}),Ca)}},Oa=function(t,e){return{rowDelta:0,colDelta:aa(t[0])-aa(e[0])}},Ta=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},_a=function(t,e,n){var r="colgroup"===e.section?n.col:n.cell;return N(t,(function(){return Xt(r(),!0)}))},Ea=function(t,e,n){return t.concat(A(e,(function(){var e=t[t.length-1];return ra(e,_a(e.cells,e,n))})))},Aa=function(t,e,r){return N(t,(function(t){var o=_a(A(e,n),t,r);return ra(t,t.cells.concat(o))}))},Na=function(t,e,r){var o=e.colDelta<0?Aa:n;return(e.rowDelta<0?Ea:n)(o(t,Math.abs(e.colDelta),r),Math.abs(e.rowDelta),r)},Ra=function(t,e,n,o){var i=r(o,ia(t[e],n).element),u=t[e];return t.length>1&&aa(u)>1&&(n>0&&i(ua(u,n-1))||n<u.cells.length-1&&i(ua(u,n+1))||e>0&&i(ua(t[e-1],n))||e<t.length-1&&i(ua(t[e+1],n)))},Ma=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&R(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&na(t,e,Xt(r(),!0))}))}(e,t,o,r.cell);var i=Ta(n,e),u=Na(n,i,r),a=Ta(e,u),c=Na(e,a,r);return N(c,(function(e,n){var r=e.cells.slice(0,t).concat(u[n].cells).concat(e.cells.slice(t,e.cells.length));return ra(e,r)}))},za=function(t,e,n,r,o){!function(t,e,n,r){var o=ca(t).rows;if(e>0&&e<o.length){var i=function(t,e){return D(t,(function(t,n){return E(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);R(i,(function(t){for(var i=m.none(),u=function(e){for(var u=function(u){var a=o[e].cells[u];n(a.element,t.element)&&(i.isNone()&&(i=m.some(r())),i.each((function(t){na(o[e],u,Xt(t,!0))})))},a=0;a<aa(o[0]);a++)u(a)},a=e;a<o.length;a++)u(a)}))}}(e,t,o,r.cell);var i=Oa(n,e),u=Na(n,i,r),a=Oa(e,u),c=Na(e,a,r),s=ca(c),l=s.cols,f=s.rows;return l.concat(f.slice(0,t)).concat(u).concat(f.slice(t,f.length))},Da=function(t,e,n,r,o){var i=ca(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=oa(u[n],(function(t,n){return e>0&&e<u.length&&r(ua(u[e-1],n),ua(u[e],n))?ia(u[e],n):Xt(o(t.element,r),!0)}));return a.concat(c).concat([l]).concat(s)},Ba=function(t,e,n,r,o){return N(t,(function(t){var i=e>0&&e<aa(t)&&r(ua(t,e-1),ua(t,e)),u=function(t,e,n,r,o,i,u){return"colgroup"!==n&&r?ia(t,e):Xt(u(ua(t,o),i),!0)}(t,e,t.section,i,n,r,o);return function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat([n]).concat(i);return ra(t,u)}(t,e,u)}))},Pa=function(t,e,n,r){return N(t,(function(t){return oa(t,(function(t){return function(t){return E(e,(function(e){return n(t.element,e.element)}))}(t)?Xt(r(t.element,n),!0):t}))}))},Ia=function(t,e,n,r){return void 0!==ua(t[e],n)&&e>0&&r(ua(t[e-1],n),ua(t[e],n))},La=function(t,e,n){return e>0&&n(ua(t,e-1),ua(t,e))},Ha=function(t,e,n,r){var o=L(t,(function(r,o){return Ia(t,o,e,n)||La(r,e,n)?[]:[ia(r,e)]}));return Pa(t,o,n,r)},Fa=function(t,e,n,r){var o=ca(t).rows,i=o[e],u=L(i.cells,(function(t,r){return Ia(o,e,r,n)||La(i,r,n)?[]:[t]}));return Pa(t,u,n,r)},Va=Si(["cell","row","replace","gap","col","colgroup"]),ja=function(t){return{element:t,colspan:We(t,"colspan",1),rowspan:We(t,"rowspan",1)}},Ua=function(t,e){void 0===e&&(e=ja),Va(t);var n=Bu(m.none()),r=function(r){var i=function(n){return function(e){switch(Yt(e.element)){case"col":return t.col(e);default:return t.cell(e)}}(e(n))}(r);return n.get().isNone()&&n.set(m.some(i)),o=m.some({item:r,replacement:i}),i},o=m.none();return{getOrInit:function(t,e){return o.fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.replacement:r(t)}))},cursor:n.get}},Wa=function(t,e){return function(n){var r=Bu(m.none());Va(n);var o=[],i=function(i){var u={scope:t},a=n.replace(i,e,u);return o.push({item:i,sub:a}),r.get().isNone()&&r.set(m.some(a)),a};return{replaceOrInit:function(t,e){return function(t,e){return B(o,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return i(t)}),(function(n){return e(t,n.item)?n.sub:i(t)}))},cursor:r.get}}},qa=function(t){Va(t);var e=Bu(m.none());return{combine:function(n){return e.get().isNone()&&e.set(m.some(n)),function(){var e=t.cell({element:n,colspan:1,rowspan:1});return Ue(e,"width"),Ue(n,"width"),e}},cursor:e.get}},$a=["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"],Ga=Wn(),Xa=function(t){return function(t,e){var n=t.property().name(e);return _($a,n)}(Ga,t)},Ka=function(t){return function(t,e){var n=t.property().name(e);return _(["ol","ul"],n)}(Ga,t)},Ya=function(t){var e,n=function(t){return"br"===Yt(t)},r=function(t){return hr(t).bind((function(e){var r=se(e).map((function(t){return!!Xa(t)||!!function(t,e){return _(["br","img","hr","input"],t.property().name(e))}(Ga,t)&&"img"!==Yt(t)})).getOr(!1);return ue(e).map((function(o){return!0===r||("li"===Yt(i=o)||ke(i,Ka).isSome())||n(e)||Xa(o)&&!Dt(t,o)?[]:[Rt.fromTag("br")];var i}))})).getOr([])},o=0===(e=L(t,(function(t){var e=le(t);return function(t){return H(t,(function(t){return n(t)||ee(t)&&0===Fn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Rt.fromTag("br")]:e;Pn(t[0]),Bn(t[0],o)},Ja=function(t){0===tn(t).length&&In(t)},Qa=function(t,e){return{grid:t,cursor:e}},Za=function(t,e,n){var r=ca(t).rows;return tc(r,e,n).orThunk((function(){return tc(r,0,0)}))},tc=function(t,e,n){return m.from(t[e]).bind((function(t){return m.from(t.cells[n]).bind((function(t){return m.from(t.element)}))}))},ec=function(t,e,n){var r=ca(t).rows;return Qa(t,tc(r,e,n))},nc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},rc=function(t){return D(t,(function(t,e){return E(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},oc=function(t,e,n){var r,o,i=(r=t,o=n.section,un(r,(function(){return o}))),u=mn(i);return ga(u,e,!0)},ic=function(t,e){var n=M(t,e);return 0===n.length?m.some("td"):n.length===t.length?m.some("th"):m.none()},uc=function(t,e,n){var r=mn(e),o=n.getWidths(r,n);Yo(r,o,n)},ac=va((function(t,e,n,r){var o=e[0].row,i=e[0].row,u=nc(e),a=D(u,(function(t,e){return Da(t,i,o,n,r.getOrInit)}),t);return ec(a,i,e[0].column)}),wa,t,t,Ua),cc=va((function(t,e,n,r){var o=nc(e),i=o[o.length-1].row,u=o[o.length-1].row+o[o.length-1].rowspan,a=D(o,(function(t,e){return Da(t,u,i,n,r.getOrInit)}),t);return ec(a,u,e[0].column)}),wa,t,t,Ua),sc=va((function(t,e,n,r){var o=rc(e),i=o[0].column,u=o[0].column,a=D(o,(function(t,e){return Ba(t,u,i,n,r.getOrInit)}),t);return ec(a,e[0].row,u)}),wa,uc,t,Ua),lc=va((function(t,e,n,r){var o=e[e.length-1].column,i=e[e.length-1].column+e[e.length-1].colspan,u=rc(e),a=D(u,(function(t,e){return Ba(t,i,o,n,r.getOrInit)}),t);return ec(a,e[0].row,i)}),wa,uc,t,Ua),fc=va((function(t,e,n,r){var o=rc(e),i=function(t,e,n){var r=N(t,(function(t){var r=t.cells.slice(0,e).concat(t.cells.slice(n+1));return Kt(r,t.section)}));return M(r,(function(t){return t.cells.length>0}))}(t,o[0].column,o[o.length-1].column),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,uc,Ja,Ua),dc=va((function(t,e,n,r){var o=nc(e),i=function(t,e,n){var r=ca(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=Za(i,e[0].row,e[0].column);return Qa(i,u)}),wa,t,Ja,Ua),mc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("row","th")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("row","th"))),gc=(va((function(t,e,n,r){var o=Ha(t,e.column,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=rc(e),i=D(o,(function(t,e){return Ha(t,e.column,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td"))),hc=(va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa("col","th")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa("col","th")),va((function(t,e,n,r){var o=Fa(t,e.row,n,r.replaceOrInit);return ec(o,e.row,e.column)}),ba,t,t,Wa(null,"td")),va((function(t,e,n,r){var o=nc(e),i=D(o,(function(t,e){return Fa(t,e.row,n,r.replaceOrInit)}),t);return ec(i,e[0].row,e[0].column)}),wa,t,t,Wa(null,"td")),va((function(t,n,r,o){var i=n.cells;Ya(i);var u=function(t,e,n,r){var o=ca(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++)na(o[i],u,Xt(r(),!1));return t}(t,n.bounds,0,e(i[0]));return Qa(u,m.from(i[0]))}),(function(t,e){return e.mergable}),t,t,qa)),pc=va((function(t,e,n,r){var o=z(e,(function(t,e){return xa(t,e,n,r.combine(e))}),t);return Qa(o,m.from(e[0]))}),(function(t,e){return e.unmergable}),uc,t,qa),vc=va((function(t,e,n,r){var o,i,u=function(t,e){var n=dn(t);return ga(n,e,!0)}(e.clipboard,e.generators);return function(t,e,n,r,o){return function(t,e,n){if(t.row>=e.length||t.column>aa(e[0]))return ka.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=aa(n[0]),u=n.length;return ka.value({rowDelta:r.length-u,colDelta:o.length-i})}(t,e,n).map((function(i){var u=Na(e,i,r);return function(t,e,n,r,o){for(var i=t.row,u=t.column,a=i+n.length,c=u+aa(n[0]),s=i;s<a;s++)for(var l=u;l<c;l++){Ra(e,s,l,o)&&xa(e,ua(e[s],l),o,r.cell);var f=ua(n[s-i],l-u),d=r.replace(f);na(e[s],l,Xt(d,!0))}return e}(t,u,n,r,o)}))}((o=e.row,i=e.column,{row:o,column:i}),t,u,e.generators,n).fold((function(){return Qa(t,m.some(e.element))}),(function(t){var n=Za(t,e.row,e.column);return Qa(t,n)}))}),(function(t,e){return Ze(e.element).bind((function(n){return pa(t,n).map((function(t){return W(W({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),uc,t,Ua),bc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),yc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=Ma(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),wc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[0].row,u=o[i],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),xc=va((function(t,e,n,r){var o=ca(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=oc(e.clipboard,e.generators,u),c=za(i,t,a,e.generators,n),s=Za(c,e.cells[0].row,e.cells[0].column);return Qa(c,s)}),ya,t,t,Ua),Cc=function(t,e){var n=dn(t);return wa(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=I(N(n.all,(function(t){return M(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return ic(i,(function(t){return"th"===Yt(t.element)}))})).getOr("")},Sc=function(t){return Ou(t.parentNode)},kc=function(t,e){var n="thead"===Sc(e),r=!E(e.cells,(function(t){return"th"!==Ou(t)}));return n||r?m.some({thead:n,ths:r}):m.none()},Oc=function(t,e){return"thead"===(n=kc(0,e).fold((function(){return Sc(e)}),(function(t){return"thead"})))?"header":"tfoot"===n?"footer":"body";var n},Tc=function(t,e,n){var r=t.getParent(e,"table"),o=e.parentNode,i=Ou(o);if(n!==i){var u=t.select(n,r)[0];if(!u){u=t.create(n);var a=r.firstChild;"thead"===n?j(xe(Rt.fromDom(r),"caption,colgroup")).fold((function(){return r.insertBefore(u,a)}),(function(e){return t.insertAfter(u,e.dom)})):r.appendChild(u)}"tbody"===n&&"thead"===i&&u.firstChild?u.insertBefore(e,u.firstChild):u.appendChild(e),o.hasChildNodes()||t.remove(o)}},_c=function(t,e,n,r){var o=t.dom,i=function(t,e,n){if(x(n)&&Ou(e)!==n){var r=t.dom.rename(e,n);return ou(t,r),r}return e}(t,e,n);return w(r)||o.setAttrib(i,"scope",r),i},Ec=function(t,e,n,r){return R(e,(function(e){return _c(t,e,n,r)}))},Ac=function(t,e,n){var r,o=t.dom;if("header"===n){var i=xu(t),u="auto"===i?(r=nn(Rt.fromDom(e.cells[0])).map((function(t){return rn(t)})).getOr([]),U(r,(function(t){return kc(0,t.dom)})).map((function(t){return t.thead&&t.ths?"sectionCells":t.thead?"section":"cells"})).getOr("section")):i;Ec(t,e.cells,"section"===u?"td":"th","col"),Tc(o,e,"cells"===u?"tbody":"thead")}else Ec(t,e.cells,"td",null),Tc(o,e,"footer"===n?"tfoot":"tbody")},Nc=function(t){return function(e){var n=Yt(e),r="col"===n||"colgroup"===n?function(t){return nn(t).bind((function(t){return tr(t,zr.firstSelectedSelector)})).fold((function(){return t}),(function(t){return t[0]}))}(e):e;return Ee(r,t)}},Rc=Nc("th,td"),Mc=Nc("th,td,caption"),zc=function(t,e){return Rc(t).map((function(t){return Nr(e)})).getOr([])},Dc=function(t,e){var n,r,o,i=Rc(t),u=i.bind((function(t){return nn(t)})).map((function(t){return rn(t)}));return(n=i,r=u,o=function(t,n){return M(n,(function(n){return E(Ar(n.dom.cells),(function(n){return"1"===Me(n,e)||Dt(n,t)}))}))},n.isSome()&&r.isSome()?m.some(o(n.getOrDie(),r.getOrDie())):m.none()).getOr([])},Bc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Pc=function(t,e,n,r){return A(t,(function(t){return function(t,e,n,r){for(var o=Rt.fromTag("tr"),i=0;i<t;i++){var u=Rt.fromTag(r<e||i<n?"th":"td");i<n&&Ne(u,"scope","row"),r<e&&Ne(u,"scope","col"),Mn(u,Rt.fromTag("br")),Mn(o,u)}return o}(e,n,r,t)}))},Ic=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Lc=function(t,e,n,o,i){var u=du(t),a={styles:u,attributes:fu(t),colGroups:wu(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=Bc);var u=Rt.fromTag("table"),a="cells"!==o;He(u,i.styles),Re(u,i.attributes),i.colGroups&&Mn(u,function(t){var e=Rt.fromTag("colgroup");return A(t,(function(){return Mn(e,Rt.fromTag("col"))})),e}(e));var c=Math.min(t,n);if(a&&n>0){var s=Rt.fromTag("thead");Mn(u,s);var l=Pc(n,e,"sectionCells"===o?c:0,r);Bn(s,l)}var f=Rt.fromTag("tbody");Mn(u,f);var d=Pc(a?t-c:t,e,a?0:n,r);return Bn(f,d),u}(n,e,i,o,xu(t),a);Ne(r,"data-mce-id","__mce");var u=function(t){var e=Rt.fromTag("div"),n=Rt.fromDom(t.dom.cloneNode(!0));return Mn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),_e(Tu(t),'table[data-mce-id="__mce"]').map((function(e){return bu(t)?Wu(t,e):yu(t)?qu(e):(vu(t)||function(t){return p(t)&&-1!==t.indexOf("%")}(u.width))&&Uu(t,e),Ru(e),De(e,"data-mce-id"),function(t,e){R(Ce(e,"tr"),(function(e){ru(t,e.dom),R(Ce(e,"th,td"),(function(e){ou(t,e.dom)}))}))}(t,e),function(t,e){_e(e,"td,th").each(r(Ic,t))}(t,e),e.dom})).getOr(null)},Hc=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return S(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return Lc(t,n,e,a,u)}return console.error(o),null},Fc=function(t){return function(){return t().fold((function(){return[]}),(function(t){return N(t,(function(t){return t.dom}))}))}},Vc=function(t){return function(e){var n=e.length>0?m.some(Ar(e)):m.none();t(n)}},jc=function(t){return function(e,n,r){void 0===r&&(r={});var o=Hc(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Uc=function(t,e,n){var r=We(t,e,1);1===n||r<=1?De(t,e):Ne(t,e,Math.min(n,r))},Wc=tinymce.util.Tools.resolve("tinymce.util.Tools"),qc=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},$c=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Gc=function(t,e){Wc.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Xc=function(t,e){return function(t,e){return e.concat(N(t,(function(t){var e=t.text||t.title;return function(t){return e=t,Wt(e,"menu")&&void 0!==e.menu&&null!==e.menu;var e}(t)?{text:e,items:Xc(t.menu)}:{text:e,value:t.value}})))}(t,e||[])},Kc=function(t){return function(e){return tt(e,"rgb")?t.toHex(e):e}},Yc=function(t,e){var n=Rt.fromDom(e);return{borderwidth:je(n,"border-width").getOr(""),borderstyle:je(n,"border-style").getOr(""),bordercolor:je(n,"border-color").map(Kc(t)).getOr(""),backgroundcolor:je(n,"background-color").map(Kc(t)).getOr("")}},Jc=function(t){var e=t[0],n=t.slice(1);return R(n,(function(t){R(It(e),(function(n){Ht(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},Qc=function(t){var e=[{name:"borderstyle",type:"listbox",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"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(e):e}},Zc=function(t,e,n,r){return B(t,(function(t){return n.formatter.matchNode(r,e+t)})).getOr("")},ts=r(Zc,["left","center","right"],"align"),es=r(Zc,["top","middle","bottom"],"valign"),ns=[{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:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],rs=function(t){return ns.concat(function(t){var e=Xc(function(t){return t.getParam("table_cell_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},os=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},is={normal:os(!1),ifTruthy:os(!0)},us=function(t){return nn(t[0]).map((function(e){var n=dn(e),r=vn(n),o=M(r,(function(e){return E(t,(function(t){return Dt(e.element,t)}))}));return N(o,(function(t){return{element:t.element.dom,column:wn(n,t.column).map((function(t){return t.element.dom}))}}))}))},as=function(t,e,n){var r=n.getData();n.close(),t.undoManager.transact((function(){(function(t,e,n){var r=1===e.length;if(e.length>=1){var o=nn(e[0]);us(e).each((function(e){R(e,(function(e){var o=_c(t,e.element,n.celltype),i=r?is.normal(t,o):is.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Nu(n.height)),e.setStyle("width",Nu(n.width))}(i,e.column.map((function(e){return r?is.normal(t,e):is.ifTruthy(t,e)})).getOr(i),n),mu(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Nu(e.borderwidth))}(i,n),r&&(Gc(t,o),function(t,e){Wc.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&$c(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))})),o.each((function(e){return iu(t,e.dom)}))}})(t,e,r),t.focus()}))},cs=function(t,e){var n=zc(Du(t),e);if(0!==n.length){var o=function(t,e){var n=us(e).map((function(e){return N(e,(function(e){return function(t,e,n,r){var o=t.dom,i=r.getOr(e),u=function(t,e){return o.getStyle(t,e)||o.getAttrib(t,e)};return W({width:u(i,"width"),height:u(e,"height"),scope:o.getAttrib(e,"scope"),celltype:Ou(e),class:o.getAttrib(e,"class",""),halign:ts(t,e),valign:es(t,e)},n?Yc(o,e):{})}(t,e.element,mu(t),e.column)}))}));return Jc(n.getOrDie())}(t,n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:rs(t)},Qc("cell")]},u={type:"panel",items:[{type:"grid",columns:2,items:rs(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:mu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(as,t,n)})}},ss=[{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"}],ls=function(t){return ss.concat(function(t){var e=Xc(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?m.some({name:"class",type:"listbox",label:"Class",items:e}):m.none()}(t).toArray())},fs=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){(function(t,e,n,r){var o=1===e.length;R(e,(function(e){r.type!==Ou(e.parentNode)&&Ac(t,e,r.type);var i=o?is.normal(t,e):is.ifTruthy(t,e);!function(t,e){t.setAttrib("scope",e.scope),t.setAttrib("class",e.class),t.setStyle("height",Nu(e.height))}(i,r),gu(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,r),r.align!==n.align&&(Gc(t,e),$c(t,e,r.align))})),nn(Rt.fromDom(e[0])).each((function(e){return iu(t,e.dom)}))})(t,e,n,o),t.focus()}))},ds=function(t){var e=Dc(Du(t),zr.selected);if(0!==e.length){var n=N(e,(function(e){return function(t,e,n){var r=t.dom;return W({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),class:r.getAttrib(e,"class",""),type:Oc(0,e),align:ts(t,e)},n?Yc(r,e):{})}(t,e.dom,gu(t))})),o=Jc(n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:ls(t)},Qc("row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ls(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:gu(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:r(fs,t,N(e,(function(t){return t.dom})),o)})}},ms=tinymce.util.Tools.resolve("tinymce.Env"),gs=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{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"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},hs=function(t,e,n,r){if("TD"===e.tagName||"TH"===e.tagName)p(n)?t.setStyle(e,n,r):t.setStyle(e,n);else if(e.children)for(var o=0;o<e.children.length;o++)hs(t,e.children[o],n,r)},ps=function(t,e,n){var r,o=t.dom,i=n.getData();n.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,u=parseInt(i.rows,10)||1;e=Lc(t,n,u,0,0)}!function(t,e,n){var r,o=t.dom,i={},u={};if(i.class=n.class,u.height=Nu(n.height),o.getAttrib(e,"width")&&!pu(t)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Nu(n.width),pu(t)?(u["border-width"]=Nu(n.border),u["border-spacing"]=Nu(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),pu(t)&&e.children)for(var a=0;a<e.children.length;a++)hs(o,e.children[a],{"border-width":Nu(n.border),padding:Nu(n.cellpadding)}),hu(t)&&hs(o,e.children[a],{"border-color":n.bordercolor});hu(t)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(W(W({},du(t)),u)),o.setAttribs(e,W(W({},fu(t)),i)),iu(t,e)}(t,e,i),(r=o.select("caption",e)[0])&&!i.caption&&o.remove(r),!r&&i.caption&&((r=o.create("caption")).innerHTML=ms.ie?" ":'<br data-mce-bogus="1"/>',e.insertBefore(r,e.firstChild)),""===i.align?Gc(t,e):$c(t,e,i.align),t.focus(),t.addVisual()}))},vs=function(t,e){var n,o=t.dom,i=function(t,e){var n,r,o,i,u=du(t),a=fu(t),c=e?(n=t.dom,{borderstyle:Ut(u,"border-style").getOr(""),bordercolor:Kc(n)(Ut(u,"border-color").getOr("")),backgroundcolor:Kc(n)(Ut(u,"background-color").getOr(""))}):{};return W(W(W(W(W(W({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],pu(t)&&i?{border:i}:Ut(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Ut(u,"border-spacing").or(Ut(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Ut(u,"border-padding").or(Ut(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),W(W({},r),o)))}(t,hu(t));!1===e?(n=o.getParent(t.selection.getStart(),"table"))?i=function(t,e,n){var r=t.dom;return W({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"),cellpadding:r.getAttrib(e,"cellpadding")||qc(t.dom,e,"padding"),border:function(e,n){var r=je(Rt.fromDom(n),"border-width");return pu(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||qc(t.dom,n,"border-width")||qc(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:ts(t,e)},n?Yc(r,e):{})}(t,n,hu(t)):hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""):(i.cols="1",i.rows="1",hu(t)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""));var u=Xc(function(t){return t.getParam("table_class_list",[],"array")}(t));u.length>0&&i.class&&(i.class=i.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:gs(t,u,e)},c=hu(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},Qc("table")]}:{type:"panel",items:[a]};t.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:r(ps,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i})},bs=function(t){return Mc(Du(t))},ys=function(t){return Rc(Du(t))},ws=function(e,n,o,i,u){var c=Au(e),s=function(t){return nn(t,c)},l=function(t){return function(n){e.selection.setRng(n),e.focus(),o.clear(t),Ru(t),iu(e,t.dom)}},f=function(t){return ys(e).each((function(e){s(e).each((function(n){var r=Br(i,n,e);t(n,r).each(l(n))}))}))},d=function(){return ys(e).map((function(n){return s(n).bind((function(r){return function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1),o=ca(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan);return function(t){return N(t,(function(t){var e=br(t.element);return R(t.cells,(function(t){var n=yr(t.element);sa(n,"colspan",t.colspan,1),sa(n,"rowspan",t.rowspan,1),Mn(e,n)})),e}))}(ha(o,n))}))}(r,Br(i,r,n),_r(t,Rt.fromDom(e.getDoc()),m.none()))}))}))},g=function(){return ys(e).map((function(t){return s(t).bind((function(e){return function(t,e){var n=dn(t);return wa(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan;return q(function(t,e,n){if(yn(t)){var r=M(bn(t),(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"span",n-e),r})),i=Rt.fromTag("colgroup");return Bn(i,o),[i]}return[]}(n,r,o),function(t,e,n){return N(t.all,(function(t){var r=M(t.cells,(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=yr(t.element);return Uc(r,"colspan",n-e),r})),i=Rt.fromTag("tr");return Bn(i,o),i}))}(n,r,o))}))}(e,Br(i,e,t))}))}))},h=function(t,n){return n().each((function(n){var r=N(n,(function(t){return yr(t)}));ys(e).each((function(n){return s(n).each((function(n){var o=Er(Rt.fromDom(e.getDoc())),u=function(t,e,n,r){return{selection:Nr(t),clipboard:n,generators:r}}(i,0,r,o);t(n,u).each(l(n))}))}))}))};Ht({mceTableSplitCells:function(){return f(n.unmergeCells)},mceTableMergeCells:function(){return f(n.mergeCells)},mceTableInsertRowBefore:function(){return f(n.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(n.insertRowsAfter)},mceTableInsertColBefore:function(){return f(n.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(n.insertColumnsAfter)},mceTableDeleteCol:function(){return f(n.deleteColumn)},mceTableDeleteRow:function(){return f(n.deleteRow)},mceTableCutCol:function(t){return g().each((function(t){u.setColumns(t),f(n.deleteColumn)}))},mceTableCutRow:function(t){return d().each((function(t){u.setRows(t),f(n.deleteRow)}))},mceTableCopyCol:function(t){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(t){return d().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(t){return h(n.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(t){return h(n.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(t){return h(n.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(t){return h(n.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return bs(e).each((function(t){nn(t,c).filter(a(c)).each((function(t){var n=Rt.fromText("");if(Nn(t,n),In(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{var r=e.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),e.selection.setRng(r),e.nodeChanged()}}))}))},mceTableSizingMode:function(t,n){return function(t){return bs(e).each((function(n){yu(e)||bu(e)||vu(e)||nn(n,c).each((function(n){"relative"!==t||gi(n)?"fixed"!==t||hi(n)?"responsive"!==t||pi(n)||qu(n):Wu(e,n):Uu(e,n),Ru(n),iu(e,n.dom)}))}))}(n)}},(function(t,n){return e.addCommand(n,t)}));var b=function(t,e){e.each((function(e){iu(t,e.dom)}))};Ht({mceTableCellType:function(t,r){var o=nn(Du(e),c);n.setTableCellType(e,r),b(e,o)},mceTableRowType:function(t,r){var o=nn(Du(e),c);n.setTableRowType(e,r),b(e,o)}},(function(t,n){return e.addCommand(n,t)})),e.addCommand("mceTableColType",(function(t,e){return Ut(e,"type").each((function(t){return f("th"===t?n.makeColumnsHeader:n.unmakeColumnsHeader)}))})),Ht({mceTableProps:r(vs,e,!1),mceTableRowProps:r(ds,e),mceTableCellProps:r(cs,e,i)},(function(t,n){return e.addCommand(n,(function(){return t()}))})),e.addCommand("mceInsertTable",(function(t,n){v(n)&&It(n).length>0?Hc(e,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):vs(e,!0)})),e.addCommand("mceTableApplyCellStyle",(function(t,n){var r=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(v(n)){var o=zc(Du(e),i);if(0!==o.length){var u=jt(n,(function(t,n){return e.formatter.has(r(n))&&p(t)}));(function(t){for(var e in t)if(Lt.call(t,e))return!1;return!0})(u)||(Ht(u,(function(t,n){R(o,(function(o){is.normal(e,o.dom).setFormat(r(n),t)}))})),s(o[0]).each((function(t){return iu(e,t.dom,{structure:!1,style:!0})})))}}}))},xs={tablecellbackgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},tablecellbordercolor:{selector:"td,th",styles:{borderColor:"%value"},remove_similar:!0},tablecellborderstyle:{selector:"td,th",styles:{borderStyle:"%value"},remove_similar:!0},tablecellborderwidth:{selector:"td,th",styles:{borderWidth:"%value"},remove_similar:!0}},Cs=nr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Ss=W(W({},Cs),{none:function(t){return void 0===t&&(t=void 0),Cs.none(t)}}),ks=function(t,e){return nn(t,e).bind((function(e){var n=tn(e);return P(n,(function(e){return Dt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Os=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ts=nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_s={before:Ts.before,on:Ts.on,after:Ts.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(n,n,n)}},Es=nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),As={domRange:Es.domRange,relative:Es.relative,exact:Es.exact,exactFromRange:function(t){return Es.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Rt.fromDom(t.startContainer)},relative:function(t,e){return _s.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return Rt.fromDom(ie(e).dom.defaultView)},range:Os},Ns=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rs=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ms=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zs=nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ds=function(t,e,n){return e(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},Bs=function(t,n){return r=function(t,n){return n.match({domRange:function(t){return{ltr:e(t),rtl:m.none}},relative:function(e,n){return{ltr:$((function(){return Ns(t,e,n)})),rtl:$((function(){return m.some(Ns(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:$((function(){return Rs(t,e,n,r,o)})),rtl:$((function(){return m.some(Rs(t,r,o,e,n))}))}}})}(t,n),(o=r.ltr()).collapsed?r.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zs.rtl(Rt.fromDom(t.endContainer),t.endOffset,Rt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ds(0,zs.ltr,o)})):Ds(0,zs.ltr,o);var r,o},Ps=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})},Is=(zs.ltr,zs.rtl,function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom}),Ls=function(t,e,n,r){return ee(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return U(i,(function(t){return Is(t,n,r)?m.some(t):m.none()})).map((function(o){return function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Fn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,a=1;a<o;a++){var c=i(a).getBoundingClientRect(),s=Math.abs(e-c.left);if(n<=c.bottom){if(n<c.top||s>u)return a-1;u=s}}return 0}(0,n,r,o.right,u);return i(a)}(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=le(e);return U(i,(function(e){return o.selectNode(e.dom),Is(o.getBoundingClientRect(),n,r)?Ls(t,e,n,r):m.none()}))}(t,e,n,r)},Hs=function(t,e){return e-t.left<t.right-e},Fs=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Vs=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Hs(o,n);return(!0===i?gr:hr)(e).map((function(e){return Fs(t,e,i)}))},js=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Hs(r,n);return m.some(Fs(t,e,o))},Us=document.caretPositionFromPoint?function(t,e,n){return m.from(t.dom.caretPositionFromPoint(e,n)).bind((function(e){if(null===e.offsetNode)return m.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),m.some(n)}))}:document.caretRangeFromPoint?function(t,e,n){return m.from(t.dom.caretRangeFromPoint(e,n))}:function(t,e,n){return Rt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===le(e).length?js:Vs)(t,e,n)}(t,r,e)};return 0===le(r).length?o():function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Ls(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))}(t,r,e,n).orThunk(o)}))},Ws=function(t,e){var n=Yt(t);return"input"===n?_s.after(t):_(["br","img"],n)?0===e?_s.before(t):_s.after(t):_s.on(t,e)},qs=function(t,e){var n=t.fold(_s.before,Ws,_s.after),r=e.fold(_s.before,Ws,_s.after);return As.relative(n,r)},$s=function(t,e,n,r){var o=Ws(t,e),i=Ws(n,r);return As.relative(o,i)},Gs=function(t){return m.from(t.getSelection())},Xs=function(t,e){Gs(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},Ks=function(t,e,n,r,o){var i=Rs(t,e,n,r,o);Xs(t,i)},Ys=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){Ks(t,e,n,r,o)},rtl:function(e,n,r,o){Gs(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Ks(t,r,o,e,n)}else Ks(t,r,o,e,n)}))}})},Js=function(t,e,n,r,o){var i=$s(e,n,r,o);Ys(t,i)},Qs=function(t,e,n){var r=qs(e,n);Ys(t,r)},Zs=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return m.some(Os(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(n.endContainer),n.endOffset))}return m.none()},tl=function(t){if(null===t.anchorNode||null===t.focusNode)return Zs(t);var e=Rt.fromDom(t.anchorNode),n=Rt.fromDom(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=oe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Dt(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?m.some(Os(e,t.anchorOffset,n,t.focusOffset)):Zs(t)},el=function(t){return function(t){return Gs(t).filter((function(t){return t.rangeCount>0})).bind(tl)}(t).map((function(t){return As.exact(t.start,t.soffset,t.finish,t.foffset)}))},nl=tinymce.util.Tools.resolve("tinymce.util.VK"),rl=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none(o)}),(function(t){return t.index+1<t.all.length?Ss.middle(o,t.all[t.index+1]):Ss.last(o)})),r);var o},ol=function(t,e,n,r){return ul(t,e,ks(o=n,void 0).fold((function(){return Ss.none()}),(function(t){return t.index-1>=0?Ss.middle(o,t.all[t.index-1]):Ss.first(o)})),r);var o},il=function(t,e){return function(t){var e=As.getWin(t).dom,n=function(t,n,r,o){return Rs(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Rt.fromDom(t.startContainer),n=Rt.fromDom(t.endContainer);return $s(e,t.startOffset,n,t.endOffset)},relative:qs,exact:$s})}(t);return Bs(e,r).match({ltr:n,rtl:n})}(As.exact(e,0,e,0))},ul=function(t,e,n,r){return n.fold(m.none,m.none,(function(t,e){return gr(e).map((function(t){return il(0,t)}))}),(function(n){return nn(n,e).bind((function(e){var o=Dr(n);return t.undoManager.transact((function(){r.insertRowsAfter(e,o)})),function(t,e){var n=Ce(e,"tr");return j(n).bind((function(t){return _e(t,"td,th").map((function(t){return il(0,t)}))}))}(0,e)}))}))},al=["table","li","dl"],cl=function(t,e){return{selection:t,kill:e}},sl=function(t,e,n,r){return{start:_s.on(t,e),finish:_s.on(n,r)}},ll=function(t,e){var n=Ps(t,e);return Os(Rt.fromDom(n.startContainer),n.startOffset,Rt.fromDom(n.endContainer),n.endOffset)},fl=sl,dl=function(t,e,n,r,o){return Dt(n,r)?m.none():Yn(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>0?(o(t,r,e.start,e.finish),m.some(cl(m.some(fl(n,0,n,fr(n))),!0))):m.none()}))},ml=function(t,e){return{item:t,mode:e}},gl=function(t,e,n,r){return void 0===r&&(r=hl),t.property().parent(e).map((function(t){return ml(t,r)}))},hl=function(t,e,n,r){return void 0===r&&(r=pl),n.sibling(t,e).map((function(t){return ml(t,r)}))},pl=function(t,e,n,r){void 0===r&&(r=pl);var o=t.property().children(e);return n.first(o).map((function(t){return ml(t,r)}))},vl=[{current:gl,next:hl,fallback:m.none()},{current:hl,next:pl,fallback:m.some(gl)},{current:pl,next:pl,fallback:m.some(hl)}],bl=function(t,e,n,r,o){return void 0===o&&(o=vl),B(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return bl(t,e,n,r)}))}))}))},yl=function(t,e,n,r,o,i){return bl(t,e,r,o).bind((function(e){return i(e.item)?m.none():n(e.item)?m.some(e.item):yl(t,e.item,n,e.mode,o,i)}))},wl=function(t){return function(e){return 0===t.property().children(e).length}},xl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?m.some(t[t.length-1]):m.none()}},r)},Cl=function(t,e,n,r){return yl(t,e,n,hl,{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?m.some(t[0]):m.none()}},r)},Sl=Wn(),kl=function(t,e){return function(t,e,n){return xl(t,e,wl(t),n)}(Sl,t,e)},Ol=function(t,e){return function(t,e,n){return Cl(t,e,wl(t),n)}(Sl,t,e)},Tl=nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),_l=function(t){return Ee(t,"tr")},El=W(W({},Tl),{verify:function(t,e,n,r,o,i,u){return Ee(r,"td,th",u).bind((function(n){return Ee(e,"td,th",u).map((function(e){return Dt(n,e)?Dt(r,n)&&fr(n)===o?i(e):Tl.none("in same cell"):Xn(_l,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?Tl.success():i(e)}),(function(t){return i(e)}))}))})).getOr(Tl.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Al=function(t){return"br"===Yt(t)},Nl=function(t,e,n){return e(t,n).bind((function(t){return ee(t)&&0===Fn(t).trim().length?Nl(t,e,n):m.some(t)}))},Rl=function(t,e,n,o){return function(t,e){return fe(t,e).filter(Al).orThunk((function(){return fe(t,e-1).filter(Al)}))}(e,n).bind((function(e){return o.traverse(e).fold((function(){return Nl(e,o.gather,t).map(o.relative)}),(function(t){return function(t){return ue(t).bind((function(e){var n=le(e);return function(t,e){return P(t,r(Dt,e))}(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return _s.on(t.parent,t.index)}))}))}))},Ml=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},zl=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},Dl=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Bl=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Pl=function(t,e){return m.some(t.getRect(e))},Il=function(t,e,n){return te(e)?Pl(t,e).map(Bl):ee(e)?function(t,e,n){return n>=0&&n<fr(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):m.none()}(t,e,n).map(Bl):m.none()},Ll=function(t,e){return te(e)?Pl(t,e).map(Bl):ee(e)?t.getRangedRect(e,0,e,fr(e)).map(Bl):m.none()},Hl=nr([{none:[]},{retry:["caret"]}]),Fl=function(t,e,n){return(r=e,o=Xa,Se((function(t,e){return e(t)}),ke,r,o,undefined)).fold(c,(function(e){return Ll(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o},Vl={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=Ml(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?Hl.retry(i):n.top===o.bottom?Hl.retry(Ml(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:Ml,gather:Ol},jl=function(t,e,n,r,o){return 0===o?m.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===Yt(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return jl(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(m.none,(function(i){return Ll(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(m.none,(function(r){return jl(t,e,n,r,o-1)}))})).orThunk((function(){return m.some(r)}))}),m.none)}))},Ul=function(t,e,n){var r=t.move(n,5),o=jl(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?m.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?m.some(-t.point(e)):m.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Wl={tryUp:r(Ul,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=zl(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?Hl.retry(i):n.bottom===o.top?Hl.retry(zl(o,1)):Fl(t,e,o)?Hl.retry(Dl(i,5,0)):Hl.none()},move:zl,gather:kl}),tryDown:r(Ul,Vl),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:e(5)},ql=function(t,e,n){return t.getSelection().bind((function(r){return function(t,e,n,r){return(Al(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Nl(e,n.gather,t)})).map(n.relative)}(t,e,r):Rl(t,e,n,r)).map((function(t){return{start:t,finish:t}}))}(e,r.finish,r.foffset,n).fold((function(){return m.some(Ku(r.finish,r.foffset))}),(function(o){var i,u=t.fromSitus(o);return i=El.verify(t,r.finish,r.foffset,u.finish,u.foffset,n.failure,e),El.cata(i,(function(t){return m.none()}),(function(){return m.none()}),(function(t){return m.some(Ku(t,0))}),(function(t){return m.some(Ku(t,fr(t)))}))}))}))},$l=function(t,e,n,r,o,i){return 0===i?m.none():Kl(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=El.verify(t,n,r,a.finish,a.foffset,o.failure,e);return El.cata(c,(function(){return m.none()}),(function(){return m.some(u)}),(function(u){return Dt(n,u)&&0===r?Gl(t,n,r,zl,o):$l(t,e,u,0,o,i-1)}),(function(u){return Dt(n,u)&&r===fr(u)?Gl(t,n,r,Ml,o):$l(t,e,u,fr(u),o,i-1)}))}))},Gl=function(t,e,n,r,o){return Il(t,e,n).bind((function(e){return Xl(t,o,r(e,Wl.getJumpSize()))}))},Xl=function(t,e,n){var r=At().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):m.none()},Kl=function(t,e,n,r,o){return Il(t,n,r).bind((function(e){return Xl(t,o,e)}))},Yl=function(t,e,n,r,o){return Ee(r,"td,th",e).bind((function(r){return Ee(r,"table",e).bind((function(i){return function(t,e){return ke(t,(function(t){return ue(t).exists((function(t){return Dt(t,e)}))}),void 0).isSome()}(o,i)?function(t,e,n){return ql(t,e,n).bind((function(r){return $l(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Ee(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):m.none()}))}))},Jl=function(t,e,n,r,o,i){return At().browser.isIE()?m.none():i(r,e).orThunk((function(){return Yl(t,e,n,r,o).map((function(t){var e=t.range;return cl(m.some(fl(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Ql=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[0])?function(t,e,n){return xl(Sl,t,(function(t){return hr(t).isSome()}),n)}(n,0,e).map((function(t){var e=fr(t);return cl(m.some(fl(t,e,t,e)),!0)})):m.none()}))}))},Zl=function(t,e){return Ee(t,"tr",e).bind((function(t){return Ee(t,"table",e).bind((function(n){var r=Ce(n,"tr");return Dt(t,r[r.length-1])?function(t,e,n){return Cl(Sl,t,(function(t){return gr(t).isSome()}),n)}(n,0,e).map((function(t){return cl(m.some(fl(t,0,t,0)),!0)})):m.none()}))}))},tf=function(t,e,n,r,o,i,u){return Yl(t,n,r,o,i).bind((function(t){return dl(e,n,t.start,t.finish,u)}))},ef=function(t,e){return Ee(t,"td,th",e)};var nf={traverse:se,gather:Ol,relative:_s.before,otherRetry:Wl.tryDown,ieRetry:Wl.ieTryDown,failure:El.failedDown},rf={traverse:ce,gather:kl,relative:_s.before,otherRetry:Wl.tryUp,ieRetry:Wl.ieTryUp,failure:El.failedUp},of=function(t){return function(e){return e===t}},uf=of(38),af=of(40),cf=function(t){return t>=37&&t<=40},sf={isBackward:of(37),isForward:of(39)},lf={isBackward:of(39),isForward:of(37)},ff=function(t){return{elementFromPoint:function(e,n){return Rt.fromPoint(Rt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=As.exact(e,n,r,o);return function(t,e){return n=Ps(t,e),r=n.getClientRects(),(o=r.length>0?r[0]:n.getBoundingClientRect()).width>0||o.height>0?m.some(o).map(Ms):m.none();var n,r,o}(t,i)},getSelection:function(){return el(t).map((function(e){return ll(t,e)}))},fromSitus:function(e){var n=As.relative(e.start,e.finish);return ll(t,n)},situsFromPoint:function(e,n){return function(t,e,n){return function(t,e,n){var r=Rt.fromDom(t.document);return Us(r,e,n).map((function(t){return Os(Rt.fromDom(t.startContainer),t.startOffset,Rt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)}(t,e,n).map((function(t){return sl(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){Gs(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),el(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Qs(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;Js(t,u,a,u,a)}))}))},setSelection:function(e){Js(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Qs(t,e,n)},selectContents:function(e){!function(t,e){var n=function(t,e){var n=t.document.createRange();return function(t,e){t.selectNodeContents(e.dom)}(n,e),n}(t,e);Xs(t,n)}(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Rt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,eo(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Rt.fromDom(t.document))}}},df=function(t,e){return{rows:t,cols:e}},mf=function(t){return!1===Pi(Rt.fromDom(t.target),"ephox-snooker-resizer-bar")};function gf(e,n,o){var i=function(t,e,n){var r=function(e){De(e,t.selected),De(e,t.firstSelected),De(e,t.lastSelected)},o=function(e){Ne(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=Ce(e,t.selectedSelector);R(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),R(r,o),Ne(u,t.firstSelected,"1"),Ne(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}}(zr,(function(n,r,i){o.targets().each((function(o){nn(r).each((function(u){var a=ku(e),c=_r(t,Rt.fromDom(e.getDoc()),a),s=function(t,e,n){var r=dn(t);return wa(r,e).map((function(t){var e=ga(r,n,!1);return{upOrLeftCells:function(t,e,n){var r=t.slice(0,e[e.length-1].row+1),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return N(n,(function(t){return t.element}))}))}(e,t,n),downOrRightCells:function(t,e,n){var r=t.slice(e[0].row+e[0].rowspan-1,t.length),o=ha(r,n);return L(o,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return N(n,(function(t){return t.element}))}))}(e,t,n)}}))}(u,o,c);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(e,n,r,i,s)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(e)}));return e.on("init",(function(o){var u=e.getWin(),a=Tu(e),c=Au(e),s=function(t,e,n,r){var o=function(t,e,n,r){var o,i=(o=Bu(m.none()),{clear:function(){return o.set(m.none())},set:function(t){return o.set(m.some(t))},isSet:function(){return o.get().isSome()},on:function(t){return o.get().each(t)}}),u=i.clear;return{clearstate:u,mousedown:function(t){r.clear(e),ef(t.target,n).each(i.set)},mouseover:function(o){i.on((function(i){r.clearBeforeUpdate(e),ef(o.target,n).each((function(o){Yn(i,o,n).each((function(n){var u=n.boxes.getOr([]);(u.length>1||1===u.length&&!Dt(i,o))&&(r.selectRange(e,u,n.start,n.finish),t.selectContents(o))}))}))}))},mouseup:function(t){u()}}}(ff(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}}(u,a,c,i),l=function(t,e,n,o){var i=ff(t),u=function(){return o.clear(e),m.none()};return{keydown:function(t,a,c,s,l,f){var d=t.raw,g=d.which,h=!0===d.shiftKey;return Jn(e,o.selectedSelector).fold((function(){return af(g)&&h?r(tf,i,e,n,nf,s,a,o.selectRange):uf(g)&&h?r(tf,i,e,n,rf,s,a,o.selectRange):af(g)?r(Jl,i,n,nf,s,a,Zl):uf(g)?r(Jl,i,n,rf,s,a,Ql):m.none}),(function(t){var n=function(n){return function(){return U(n,(function(n){return function(t,e,n,r,o){return Zn(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,o)})).fold((function(){return Qn(e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){var n=af(g)||f.isForward(g)?_s.after:_s.before;return i.setRelativeSelection(_s.on(t.first,0),n(t.table)),o.clear(e),cl(m.none(),!0)}))}),(function(t){return m.some(cl(m.none(),!0))}))}};return af(g)&&h?n([df(1,0)]):uf(g)&&h?n([df(-1,0)]):f.isBackward(g)&&h?n([df(0,-1),df(-1,0)]):f.isForward(g)&&h?n([df(0,1),df(1,0)]):cf(g)&&!1===h?u:m.none}))()},keyup:function(t,r,i,u,a){return Jn(e,o.selectedSelector).fold((function(){var c=t.raw,s=c.which;return 0==(!0===c.shiftKey)?m.none():cf(s)?function(t,e,n,r,o,i,u){return Dt(n,o)&&r===i?m.none():Ee(n,"td,th",e).bind((function(n){return Ee(o,"td,th",e).bind((function(r){return dl(t,e,n,r,u)}))}))}(e,n,r,i,u,a,o.selectRange):m.none()}),m.none)}}}(u,a,c,i),f=function(t,e,n,r){var o=ff(t);return function(t,i){r.clearBeforeUpdate(e),Yn(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(u,a,c,i);e.on("TableSelectorChange",(function(t){return f(t.start,t.finish)}));var d,g,h=function(t,n){(function(t){return!0===t.raw.shiftKey})(t)&&(n.kill&&t.kill(),n.selection.each((function(t){var n=As.relative(t.start,t.finish),r=Ps(u,n);e.selection.setRng(r)})))},p=function(t){return 0===t.button},v=(d=Bu(Rt.fromDom(a)),g=Bu(0),{touchEnd:function(t){var e=Rt.fromDom(t.target);if("td"===Yt(e)||"th"===Yt(e)){var n=d.get(),r=g.get();Dt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),f(e,e))}d.set(e),g.set(t.timeStamp)}});e.on("dragstart",(function(t){s.clearstate()})),e.on("mousedown",(function(t){p(t)&&mf(t)&&s.mousedown(Mi(t))})),e.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||ms.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&mf(t)&&s.mouseover(Mi(t))})),e.on("mouseup",(function(t){p(t)&&mf(t)&&s.mouseup(Mi(t))})),e.on("touchend",v.touchEnd),e.on("keyup",(function(t){var n=Mi(t);if(n.raw.shiftKey&&cf(n.raw.which)){var r=e.selection.getRng(),o=Rt.fromDom(r.startContainer),i=Rt.fromDom(r.endContainer);l.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){h(n,t)}))}})),e.on("keydown",(function(t){var r=Mi(t);n().each((function(t){return t.hideBars()}));var o=e.selection.getRng(),i=Rt.fromDom(o.startContainer),u=Rt.fromDom(o.endContainer),a=Kr(sf,lf)(Rt.fromDom(e.selection.getStart()));l.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){h(r,t)})),n().each((function(t){return t.showBars()}))})),e.on("NodeChange",(function(){var n=e.selection,r=Rt.fromDom(n.getStart()),o=Rt.fromDom(n.getEnd());Xn(nn,[r,o]).fold((function(){return i.clear(a)}),t)}))})),{clear:i.clear}}cr.add("table",(function(e){var n,r=(n=zr.selectedSelector,{get:function(){return tr(Tu(e),n).fold((function(){return Mc(Du(e)).map(ar).getOrThunk(ir)}),(function(t){return ur(t)}))}}),o=function(t,e){var n=Bu(m.none()),r=Bu([]),o=function(){return Mc(Du(t)).bind((function(t){return nn(t).map((function(n){return"caption"===Yt(t)?Dr(t):Br(e,n,t)}))}))},i=function(){n.set($(o)()),R(r.get(),(function(t){return t()}))},u=function(t,e){var o=function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))};return o(),r.set(r.get().concat([o])),function(){r.set(M(r.get(),(function(t){return t!==o})))}};return t.on("NodeChange ExecCommand TableSelectorChange",i),{onSetupTable:function(t){return u(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return u(t,(function(t){return"caption"===Yt(t.element)}))},onSetupPasteable:function(t){return function(e){return u(e,(function(e){return"caption"===Yt(e.element)||t().isNone()}))}},onSetupMergeable:function(t){return u(t,(function(t){return t.mergable.isNone()}))},onSetupUnmergeable:function(t){return u(t,(function(t){return t.unmergable.isNone()}))},resetTargets:i,targets:function(){return n.get()}}}(e,r),i=Xu(e),u=gf(e,i.lazyResize,o),a=function(e,n,r){var o=function(t){return"table"===Yt(Tu(t))},i=ku(e),u=function(t,n,r,o){return function(u,a){Ru(u);var c=o(),s=Rt.fromDom(e.getDoc()),l=_r(r,s,i),f=Vu(e,u);return n(u)?t(c,u,a,l,f).bind((function(t){return R(t.newRows,(function(t){ru(e,t.dom)})),R(t.newCells,(function(t){ou(e,t.dom)})),t.cursor.map((function(t){var n=Zu(ta,t),r=e.dom.createRng();return r.setStart(n.element.dom,n.offset),r.setEnd(n.element.dom,n.offset),r}))})):m.none()}},a=u(dc,(function(t){return!1===o(e)||bi(t).rows>1}),t,n),c=u(fc,(function(t){return!1===o(e)||bi(t).columns>1}),t,n),l=u(ac,s,t,n),f=u(cc,s,t,n),d=u(sc,s,ea,n),g=u(lc,s,ea,n),h=u(hc,s,t,n),p=u(pc,s,t,n),v=u(bc,s,t,n),b=u(yc,s,t,n),y=u(wc,s,t,n),w=u(xc,s,t,n),x=u(vc,s,t,n),C=function(t,e){return Ut(t,"type").filter((function(t){return _(e,t)}))};return{deleteRow:a,deleteColumn:c,insertRowsBefore:l,insertRowsAfter:f,insertColumnsBefore:d,insertColumnsAfter:g,mergeCells:h,unmergeCells:p,pasteColsBefore:v,pasteColsAfter:b,pasteRowsBefore:y,pasteRowsAfter:w,pasteCells:x,setTableCellType:function(t,e){return C(e,["td","th"]).each((function(e){var n=N(zc(Du(t),r),(function(t){return t.dom}));Ec(t,n,e,null)}))},setTableRowType:function(t,e){return C(e,["header","body","footer"]).each((function(e){N(Dc(Du(t),zr.selected),(function(n){return Ac(t,n.dom,e)}))}))},makeColumnsHeader:u(mc,s,t,n),unmakeColumnsHeader:u(gc,s,t,n),getTableRowType:function(t){var e=Dc(Du(t),zr.selected);if(e.length>0){var n=N(e,(function(t){return Oc(0,t.dom)})),r=_(n,"header"),o=_(n,"footer");if(r||o){var i=_(n,"body");return!r||i||o?r||i||!o?"":"footer":"header"}return"body"}},getTableCellType:function(t){return ic(zc(Du(t),r),(function(t){return"th"===Yt(t)})).getOr("")},getTableColType:Cc}}(e,i.lazyWire,r),c=function(){var t=Bu(m.none()),e=Bu(m.none()),n=function(t){t.set(m.none())};return{getRows:t.get,setRows:function(r){t.set(r),n(e)},clearRows:function(){return n(t)},getColumns:e.get,setColumns:function(r){e.set(r),n(t)},clearColumns:function(){return n(e)}}}();return ws(e,a,u,r,c),function(t,e,n){var r=Au(t);Ht({mceTableRowType:function(){return e.getTableRowType(t)},mceTableCellType:function(){return e.getTableCellType(t)},mceTableColType:function(){return Rc(Du(t)).bind((function(t){return function(t){return nn(t,r)}(t).map((function(r){var o=Br(n,r,t);return e.getTableColType(r,o)}))})).getOr("")}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(e,a,r),function(e,n,r,o){e.on("BeforeGetContent",(function(r){!0===r.selection&&or(n.get(),t,(function(t){r.preventDefault(),function(t){return nn(t[0]).map(yr).map((function(t){return[lr(t,"[data-mce-selected]")]}))}(t).each((function(t){r.content="text"===r.format?function(t){return N(t,(function(t){return t.dom.innerText})).join("")}(t):function(t,e){return N(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(e,t)}))}),t)})),e.on("BeforeSetContent",(function(t){!0===t.selection&&!0===t.paste&&m.from(e.dom.getParent(e.selection.getStart(),"th,td")).each((function(n){var i=Rt.fromDom(n);nn(i).each((function(n){var u,a,c,s=M((u=t.content,(a=document.createElement("div")).innerHTML=u,le(Rt.fromDom(a))),(function(t){return"meta"!==Yt(t)}));if(1===s.length&&(c=s[0],"table"===Yt(c))){t.preventDefault();var l=Rt.fromDom(e.getDoc()),f=Er(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(i,s[0],f);r.pasteCells(n,d).each((function(t){e.selection.setRng(t),e.focus(),o.clear(n)}))}}))}))}))}(e,r,a,u),function(t,e,n){var r=function(e){return function(){return t.execCommand(e)}},o=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},i={text:"Table properties",onSetup:e.onSetupTable,onAction:r("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:r("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:e.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}),!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",i),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}}),t.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter"}}),t.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}}),t.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold((function(){return""}),(function(t){return"caption"===Yt(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}})}(e,o,c),function(t,e,n){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})}(e,o,c),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(e),e.on("PreInit",(function(){e.serializer.addTempAttr(zr.firstSelected),e.serializer.addTempAttr(zr.lastSelected),function(t){t.formatter.register(xs)}(e)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(e)&&e.on("keydown",(function(t){!function(t,e,n){if(t.keyCode===nl.TAB){var r=Tu(e),o=function(t){var e=Yt(t);return Dt(t,r)||_(al,e)},i=e.selection.getRng();if(i.collapsed){var u=Rt.fromDom(i.startContainer);Ze(u,o).each((function(r){t.preventDefault(),(t.shiftKey?ol:rl)(e,o,r,n).each((function(t){e.selection.setRng(t)}))}))}}}(t,e,a)})),e.on("remove",(function(){i.destroy()})),function(t,e,n,r){return{insertTable:jc(t),setClipboardRows:Vc(e.setRows),getClipboardRows:Fc(e.getRows),setClipboardCols:Vc(e.setColumns),getClipboardCols:Fc(e.getColumns),resizeHandler:n,selectionTargets:r}}(e,c,i,o)}))}()},397:(t,e,n)=>{n(2738)},2738:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(){},u=function(t){return function(){return t}},a=function(t){return t},c=u(!1),s=u(!0),l=function(){return f},f=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:l,each:i,bind:l,exists:c,forall:s,filter:l,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),d=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},m={some:d,none:l,from:function(t){return null==t?f:d(t)}},g=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},h=g("string"),p=g("object"),v=g("array"),b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(t,e){return n=t,r=e,y.call(n,r)>-1;var n,r},x=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},C=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},S=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},k=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},O=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},T=Object.keys,_=Object.hasOwnProperty,E=(function(t){if(!v(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};C(t,(function(r,o){var i=T(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!v(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=T(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!O(e,(function(t){return w(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}}))}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var e=[],n=[];return C(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}),A=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:u(t),getOrThunk:u(t),getOrDie:u(t),or:function(e){return A(t)},orThunk:function(e){return A(t)},fold:function(e,n){return n(t)},map:function(e){return A(e(t))},mapError:function(e){return A(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return m.some(t)}}},N=function(t){return{is:c,isValue:c,isError:s,getOr:a,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return N(t)},mapError:function(e){return N(e(t))},each:i,bind:function(e){return N(t)},exists:c,forall:s,toOptional:m.none}},R={value:A,error:N,fromOption:function(t,e){return t.fold((function(){return N(e)}),A)}},M=function(t){return"inline-command"===t.type||"inline-format"===t.type},z=function(t){return"block-command"===t.type||"block-format"===t.type},D=function(t){return e=t,n=function(t,e){return t.start.length===e.start.length?0:t.start.length>e.start.length?-1:1},(r=b.call(e,0)).sort(n),r;var e,n,r},B=function(t){var e=function(e){return R.error({message:e,pattern:t})},n=function(n,r,o){if(void 0!==t.format){var i=void 0;if(v(t.format)){if(!O(t.format,h))return e(n+" pattern has non-string items in the `format` array");i=t.format}else{if(!h(t.format))return e(n+" pattern has non-string `format` parameter");i=[t.format]}return R.value(r(i))}return void 0!==t.cmd?h(t.cmd)?R.value(o(t.cmd,t.value)):e(n+" pattern has non-string `cmd` parameter"):e(n+" pattern is missing both `format` and `cmd` parameters")};if(!p(t))return e("Raw pattern is not an object");if(!h(t.start))return e("Raw pattern is missing `start` parameter");if(void 0!==t.end){if(!h(t.end))return e("Inline pattern has non-string `end` parameter");if(0===t.start.length&&0===t.end.length)return e("Inline pattern has empty `start` and `end` parameters");var r=t.start,o=t.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(t){return{type:"inline-format",start:r,end:o,format:t}}),(function(t,e){return{type:"inline-command",start:r,end:o,cmd:t,value:e}}))}return void 0!==t.replacement?h(t.replacement)?0===t.start.length?e("Replacement pattern has empty `start` parameter"):R.value({type:"inline-command",start:"",end:t.start,cmd:"mceInsertContent",value:t.replacement}):e("Replacement pattern has non-string `replacement` parameter"):0===t.start.length?e("Block pattern has empty `start` parameter"):n("Block",(function(e){return{type:"block-format",start:t.start,format:e[0]}}),(function(e,n){return{type:"block-command",start:t.start,cmd:e,value:n}}))},P=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},I=function(t){return{inlinePatterns:S(t,M),blockPatterns:D(S(t,z))}},L="undefined"!=typeof window?window:Function("return this;")(),H=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=L.console;n&&(n.error?n.error.apply(n,t):n.log.apply(n,t))},F=[{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"}],V=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},j=tinymce.util.Tools.resolve("tinymce.util.Delay"),U=tinymce.util.Tools.resolve("tinymce.util.VK"),W=tinymce.util.Tools.resolve("tinymce.util.Tools"),q=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),G=function(t,e){return{container:t,offset:e}},X=function(t){return t.nodeType===Node.TEXT_NODE},K=function(t,e,n){if(e&&t.isEmpty(e)&&!n(e)){var r=e.parentNode;t.remove(e),K(t,r,n)}},Y=function(t,e,n,r){void 0===r&&(r=!0);var o=e.startContainer.parentNode,i=e.endContainer.parentNode;e.deleteContents(),r&&!n(e.startContainer)&&(X(e.startContainer)&&0===e.startContainer.data.length&&t.remove(e.startContainer),X(e.endContainer)&&0===e.endContainer.data.length&&t.remove(e.endContainer),K(t,o,n),o!==i&&K(t,i,n))},J=function(t,e){var n,r=e.get(t);return v(r)&&(n=r,function(t,e){return 0<t.length?m.some(t[0]):m.none()}(n)).exists((function(t){return e=t,"block",_.call(e,"block");var e}))},Q=function(t){return 0===t.start.length},Z=function(t,e){var n=m.from(t.dom.getParent(e.startContainer,t.dom.isBlock));return""===V(t)?n.orThunk((function(){return m.some(t.getBody())})):n},tt=q.DOM,et=function(t){return function(e){return t===e?-1:0}},nt=function(t,e,n){if(X(t)&&e>=0)return m.some(G(t,e));var r=$(tt);return m.from(r.backwards(t,e,et(t),n)).map((function(t){return G(t.container,t.container.data.length)}))},rt=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e>=0&&e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.backwards(t,e,et(t),n)).bind((function(t){var r=t.container.data;return rt(t.container,e+r.length,n)}))},ot=function(t,e,n){if(!X(t))return m.none();var r=t.textContent;if(e<=r.length)return m.some(G(t,e));var o=$(tt);return m.from(o.forwards(t,e,et(t),n)).bind((function(t){return ot(t.container,e-r.length,n)}))},it=function(t,e,n){if(X(e)&&(n<0||n>e.data.length))return[];for(var r=[n],o=e;o!==t&&o.parentNode;){for(var i=o.parentNode,u=0;u<i.childNodes.length;u++)if(i.childNodes[u]===o){r.push(u);break}o=i}return o===t?r.reverse():[]},ut=function(t,e,n,r,o){return{start:it(t,e,n),end:it(t,r,o)}},at=function(t,e){var n,r,o,i=e.slice(),u=i.pop();return(n=i,r=function(t,e){return t.bind((function(t){return m.from(t.childNodes[e])}))},o=m.some(t),C(n,(function(t){o=r(o,t)})),o).bind((function(t){return X(t)&&(u<0||u>t.data.length)?m.none():m.some({node:t,offset:u})}))},ct=function(t,e){return at(t,e.start).bind((function(n){var r=n.node,o=n.offset;return at(t,e.end).map((function(t){var e=t.node,n=t.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(e,n),i}))}))},st=function(t,e,n){(function(t,e,n){if(X(t)&&0>=t.length)return m.some(G(t,0));var r=$(tt);return m.from(r.forwards(t,0,et(t),n)).map((function(t){return G(t.container,0)}))})(e,0,e).each((function(r){var o=r.container;ot(o,n.start.length,e).each((function(n){var r=t.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Y(t,r,(function(t){return t===e}))}))}))},lt=function(t,e){var n=t.dom,r=t.selection.getRng();return Z(t,r).filter((function(e){var r=V(t),o=""===r&&n.is(e,"body")||n.is(e,r);return null!==e&&o})).bind((function(t){var r=t.textContent;return function(t,e){var n=e.replace(" "," ");return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m.some(i);if(n(i,r))break}return m.none()}(t,(function(t){return 0===e.indexOf(t.start)||0===n.indexOf(t.start)}),c)}(e,r).map((function(e){return W.trim(r).length===e.start.length?[]:[{pattern:e,range:ut(n.getRoot(),t,0,t,0)}]}))})).getOr([])},ft=0,dt=function(t,e){return t.create("span",{"data-mce-type":"bookmark",id:e})},mt=function(t,e){var n=t.createRng();return n.setStartAfter(e.start),n.setEndBefore(e.end),n},gt=function(t,e,n){var r=ct(t.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,u=0===r.endOffset?i:i.splitText(r.endOffset),a=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:e,end:u.parentNode.insertBefore(dt(t,e+"-end"),u),start:a.parentNode.insertBefore(dt(t,e+"-start"),a)}},ht=function(t,e,n){K(t,t.get(e.prefix+"-end"),n),K(t,t.get(e.prefix+"-start"),n)},pt=function(t,e,n,r){var o,i=e.start;return function(t,e,n,r,o){var i=$(t,function(t){return function(e){return t.isBlock(e)||w(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}}(t));return m.from(i.backwards(e,n,r,o))}(t,r.container,r.offset,(o=i,function(t,e){var n=t.data.substring(0,e),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=t.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),m.some(o)}var u=r.offset-i.length;return rt(r.container,u,n).map((function(e){var n=t.createRng();return n.setStart(e.container,e.offset),n.setEnd(r.container,r.offset),n})).filter((function(t){return t.toString()===i})).orThunk((function(){return pt(t,e,n,G(r.container,0))}))}))},vt=function(t,e,n){var r=t.dom,o=r.getRoot(),i=n.pattern,u=n.position.container,a=n.position.offset;return rt(u,a-n.pattern.end.length,e).bind((function(c){var s=ut(o,c.container,c.offset,u,a);if(Q(i))return m.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=bt(t,n.remainingPatterns,c.container,c.offset,e),f=l.getOr({matches:[],position:c}),d=f.position;return function(t,e,n,r,o,i){if(void 0===i&&(i=!1),0===e.start.length&&!i){var u=t.createRng();return u.setStart(n,r),u.setEnd(n,r),m.some(u)}return nt(n,r,o).bind((function(n){return pt(t,e,o,n).bind((function(t){if(i){if(t.endContainer===n.container&&t.endOffset===n.offset)return m.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return m.none()}return m.some(t)}))}))}(r,i,d.container,d.offset,e,l.isNone()).map((function(t){var e=function(t,e){return ut(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}(o,t);return{matches:f.matches.concat([{pattern:i,startRng:e,endRng:s}]),position:G(t.startContainer,t.startOffset)}}))}))},bt=function(t,e,n,r,o){var i=t.dom;return nt(n,r,i.getRoot()).bind((function(u){var a=i.createRng();a.setStart(o,0),a.setEnd(n,r);for(var c,s,l=a.toString(),f=0;f<e.length;f++){var d=e[f];if(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(c=l,s=d.end,c.length-s.length)){var g=e.slice();g.splice(f,1);var h=vt(t,o,{pattern:d,remainingPatterns:g,position:u});if(h.isSome())return h}}return m.none()}))},yt=function(t,e,n){t.selection.setRng(n),"inline-format"===e.type?C(e.format,(function(e){t.formatter.apply(e)})):t.execCommand(e.cmd,!1,e.value)},wt=function(t,e,n){var r=t.selection.getRng();return!1===r.collapsed?[]:Z(t,r).bind((function(o){var i=r.startOffset-(n?1:0);return bt(t,e,r.startContainer,i,o)})).fold((function(){return[]}),(function(t){return t.matches}))},xt=function(t,e){if(0!==e.length){var n=t.dom,r=t.selection.getBookmark(),i=function(t,e){var n,r=(n=(new Date).getTime(),"mce_textpattern_"+Math.floor(1e9*Math.random())+ ++ft+String(n)),i=k(e,(function(e,n){var i=gt(t,r+"_end"+e.length,n.endRng);return e.concat([o(o({},n),{endMarker:i})])}),[]);return k(i,(function(e,n){var u=i.length-e.length-1,a=Q(n.pattern)?n.endMarker:gt(t,r+"_start"+u,n.startRng);return e.concat([o(o({},n),{startMarker:a})])}),[])}(n,e);C(i,(function(e){var r=n.getParent(e.startMarker.start,n.isBlock),o=function(t){return t===r};Q(e.pattern)?function(t,e,n,r){var o=mt(t.dom,n);Y(t.dom,o,r),yt(t,e,o)}(t,e.pattern,e.endMarker,o):function(t,e,n,r,o){var i=t.dom,u=mt(i,r),a=mt(i,n);Y(i,a,o),Y(i,u,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=mt(i,c);yt(t,e,s)}(t,e.pattern,e.startMarker,e.endMarker,o),ht(n,e.endMarker,o),ht(n,e.startMarker,o)})),t.selection.moveToBookmark(r)}},Ct=function(t,e){var n=wt(t,e.inlinePatterns,!0);n.length>0&&t.undoManager.transact((function(){xt(t,n)}))},St=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0},kt=function(t,e){var n=[",",".",";",":","!","?"],r=[32];t.on("keydown",(function(n){13!==n.keyCode||U.modifierPressed(n)||function(t,e){if(!t.selection.isCollapsed())return!1;var n=wt(t,e.inlinePatterns,!1),r=lt(t,e.blockPatterns);return(r.length>0||n.length>0)&&(t.undoManager.add(),t.undoManager.extra((function(){t.execCommand("mceInsertNewLine")}),(function(){t.insertContent("\ufeff"),xt(t,n),function(t,e){if(0!==e.length){var n=t.selection.getBookmark();C(e,(function(e){return function(t,e){var n=t.dom,r=e.pattern,o=ct(n.getRoot(),e.range).getOrDie("Unable to resolve path range");return Z(t,o).each((function(e){"block-format"===r.type?J(r.format,t.formatter)&&t.undoManager.transact((function(){st(t.dom,e,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((function(){st(t.dom,e,r),t.execCommand(r.cmd,!1,r.value)}))})),!0}(t,e)})),t.selection.moveToBookmark(n)}}(t,r);var e=t.selection.getRng(),o=nt(e.startContainer,e.startOffset,t.dom.getRoot());t.execCommand("mceInsertNewLine"),o.each((function(e){var n=e.container;"\ufeff"===n.data.charAt(e.offset-1)&&(n.deleteData(e.offset-1,1),K(t.dom,n.parentNode,(function(e){return e===t.dom.getRoot()})))}))})),!0)}(t,e.get())&&n.preventDefault()}),!0),t.on("keyup",(function(n){St(r,n,(function(t,e){return t===e.keyCode&&!1===U.modifierPressed(e)}))&&Ct(t,e.get())})),t.on("keypress",(function(r){St(n,r,(function(t,e){return t.charCodeAt(0)===e.charCode}))&&j.setEditorTimeout(t,(function(){Ct(t,e.get())}))}))};r.add("textpattern",(function(t){var e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(function(t){var e=t.getParam("textpattern_patterns",F,"array");if(!v(e))return H("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=E(x(e,B));return C(n.errors,(function(t){return H(t.message,t.pattern)})),I(n.values)}(t));return kt(t,e),function(t){return{setPatterns:function(e){var n=E(x(e,B));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}t.set(I(n.values))},getPatterns:function(){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}(x(t.get().inlinePatterns,P),x(t.get().blockPatterns,P))}}}(e)}))}()},3356:(t,e,n)=>{n(3562)},3562:()=>{!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp("[-'\\.‘’․﹒'.]"),new RegExp("[:··״‧︓﹕:]"),new RegExp("[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]"),new RegExp("[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]"),new RegExp("\\r"),new RegExp("\\n"),new RegExp("[\v\f \u2028\u2029]"),new RegExp("[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]"),new RegExp("[-឴឵---\ufeff-]"),new RegExp("[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]"),new RegExp("[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]"),new RegExp("@")],i=new RegExp("^[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]$"),u=o,a=function(t){for(var e=13,n=u.length,r=0;r<n;++r){var o=u[r];if(o&&o.test(t)){e=r;break}}return e},c=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(0===n&&0===r)return!1;var o=t[e+2];if(0===n&&(2===r||1===r||12===r)&&0===o)return!1;var i=t[e-1];return(2!==n&&1!==n&&12!==r||0!==r||0!==i)&&(4!==n&&0!==n||4!==r&&0!==r)&&(3!==n&&1!==n||4!==r||4!==i)&&(4!==n||3!==r&&1!==r||4!==o)&&8!==n&&9!==n&&8!==i&&9!==i&&8!==r&&9!==r&&(5!==n||6!==r)&&(7===n||5===n||6===n||7===r||5===r||6===r||(10!==n||10!==r)&&(11!==r||0!==n&&4!==n&&10!==n&&11!==n)&&(11!==n||0!==r&&4!==r&&10!==r)&&12!==n)},s=/^\s+$/,l=i,f=function(t){return"http"===t||"https"===t},d=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],u=0;u<t.length;u++){var d=e(t[u]);"\ufeff"!==d&&(o.push(t[u]),i.push(d))}return function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),c(n,u)){var a=e[u];if((r.includeWhitespace||!s.test(a))&&(r.includePunctuation||!l.test(a))){var d=u-i.length+1,m=u+1,g=e.slice(d,m).join("");if(f(g)){var h=(y=void 0,y=function(t,e){var n;for(n=e;n<t.length&&!s.test(t[n]);n++);return n}(v=e,(b=u)+1),"://"===v.slice(b+1,y).join("").substr(0,3)?y:b),p=t.slice(m,h);Array.prototype.push.apply(i,p),u=h}o.push(i)}i=[]}var v,b,y;return o}(o,i,function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(i,(m=a,g={},function(t){if(g[t])return g[t];var e=m(t);return g[t]=e,e})),n);var m,g},m=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),g=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],u="",a=new m(t,t);t=a.next();)3===t.nodeType?u+=t.data.replace(/\uFEFF/g,""):o(t)&&u.length&&(i.push(u),u="");return u.length&&i.push(u),i},h=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},p=function(t,e){var r=g(t,e).join("\n");return d(r.split(""),n).length},v=function(t,e){var n=g(t,e).join("");return h(n)},b=function(t,e){var n=g(t,e).join("").replace(/\s/g,"");return h(n)},y=function(t,e){return function(){return e(t.getBody(),t.schema)}},w=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},x=function(t){return y(t,p)},C=tinymce.util.Tools.resolve("tinymce.util.Delay"),S=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)},k=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};void 0===t&&(t=300),e.add("wordcount",(function(e){var n=function(t){return{body:{getWordCount:x(t),getCharacterCount:y(t,v),getCharacterCountWithoutSpaces:y(t,b)},selection:{getWordCount:w(t,p),getCharacterCount:w(t,v),getCharacterCountWithoutSpaces:w(t,b)},getCount:x(t)}}(e);return function(t,e){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return k(t,e)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return k(t,e)}})}(e,n),function(t,e,n){var r=C.debounce((function(){return S(t,e)}),n);t.on("init",(function(){S(t,e),C.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)}),0)}))}(e,n,t),n}))}()},5187:(t,e,n)=>{var r={"./content/dark/content.css":2968,"./content/dark/content.min.css":6202,"./content/default/content.css":7286,"./content/default/content.min.css":7362,"./content/document/content.css":287,"./content/document/content.min.css":2271,"./content/writer/content.css":5417,"./content/writer/content.min.css":874,"./ui/oxide-dark/content.css":3341,"./ui/oxide-dark/content.inline.css":8786,"./ui/oxide-dark/content.inline.min.css":4243,"./ui/oxide-dark/content.min.css":9702,"./ui/oxide-dark/content.mobile.css":1389,"./ui/oxide-dark/content.mobile.min.css":3513,"./ui/oxide-dark/fonts/tinymce-mobile.woff":1064,"./ui/oxide-dark/skin.css":8057,"./ui/oxide-dark/skin.min.css":6332,"./ui/oxide-dark/skin.mobile.css":4429,"./ui/oxide-dark/skin.mobile.min.css":18,"./ui/oxide-dark/skin.shadowdom.css":7899,"./ui/oxide-dark/skin.shadowdom.min.css":7548,"./ui/oxide/content.css":9506,"./ui/oxide/content.inline.css":8273,"./ui/oxide/content.inline.min.css":7251,"./ui/oxide/content.min.css":6122,"./ui/oxide/content.mobile.css":993,"./ui/oxide/content.mobile.min.css":8215,"./ui/oxide/fonts/tinymce-mobile.woff":9916,"./ui/oxide/skin.css":8382,"./ui/oxide/skin.min.css":4522,"./ui/oxide/skin.mobile.css":108,"./ui/oxide/skin.mobile.min.css":8537,"./ui/oxide/skin.shadowdom.css":818,"./ui/oxide/skin.shadowdom.min.css":6913};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=5187},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(){},e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},r=function(t){return function(){return t}},o=function(t){return t};function i(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var u=function(t){return function(e){return!t(e)}},a=function(t){return function(){throw new Error(t)}},c=r(!1),s=r(!0),l=tinymce.util.Tools.resolve("tinymce.ThemeManager"),f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var g,h,p,v,b=function(){return y},y=(h=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:v=function(t){return t},getOrThunk:p=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:v,orThunk:p,map:b,each:t,bind:b,exists:c,forall:s,filter:b,equals:h,equals_:h,toArray:function(){return[]},toString:r("none()")}),w=function(t){var e=r(t),n=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=C("string"),O=C("object"),T=C("array"),_=S("boolean"),E=function(t){return void 0===t},A=function(t){return!function(t){return null==t}(t)},N=S("function"),R=S("number"),M=function(t,e){if(T(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},z=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,P=function(t,e){return D.call(t,e)},I=function(t,e){return P(t,e)>-1},L=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},H=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},F=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=z.call(t,r,r+e);n.push(o)}return n},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,c)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!T(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},Y=function(t,e){return K(V(t,e))},J=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},Q=function(t){var e=z.call(t,0);return e.reverse(),e},Z=function(t,e){return W(t,(function(t){return!I(e,t)}))},tt=function(t,e){var n=z.call(t,0);return n.sort(e),n},et=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},nt=function(t){return et(t,0)},rt=function(t){return et(t,t.length-1)},ot=N(Array.from)?Array.from:function(t){return z.call(t)},it=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},ut=function(t){return{is:function(e){return t===e},isValue:s,isError:c,getOr:r(t),getOrThunk:r(t),getOrDie:r(t),or:function(e){return ut(t)},orThunk:function(e){return ut(t)},fold:function(e,n){return n(t)},map:function(e){return ut(e(t))},mapError:function(e){return ut(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},at=function(e){return{is:c,isValue:c,isError:s,getOr:o,getOrThunk:function(t){return t()},getOrDie:function(){return a(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return at(e)},mapError:function(t){return at(t(e))},each:t,bind:function(t){return at(e)},exists:c,forall:s,toOptional:x.none}},ct={value:ut,error:at,fromOption:function(t,e){return t.fold((function(){return at(e)}),ut)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(g||(g={}));var st=function(t,e,n){return t.stype===g.Error?e(t.serror):n(t.svalue)},lt=function(t){return{stype:g.Value,svalue:t}},ft=function(t){return{stype:g.Error,serror:t}},dt=lt,mt=function(t){var e=[],n=[];return j(t,(function(t){st(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},gt=ft,ht=function(t,e){return t.stype===g.Value?e(t.svalue):t},pt=function(t,e){return t.stype===g.Value?{stype:g.Value,svalue:e(t.svalue)}:t},vt=Object.keys,bt=Object.hasOwnProperty,yt=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},wt=function(t,e){return xt(t,(function(t,n){return{k:n,v:e(t,n)}}))},xt=function(t,e){var n={};return yt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ct=function(t,e){var n=[];return yt(t,(function(t,r){n.push(e(t,r))})),n},St=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return x.some(u)}return x.none()},kt=function(t){return Ct(t,(function(t){return t}))},Ot=function(t,e){return Tt(t,e)?x.from(t[e]):x.none()},Tt=function(t,e){return bt.call(t,e)},_t=function(t,e){return Tt(t,e)&&void 0!==t[e]&&null!==t[e]},Et=function(t){if(!T(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=vt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!T(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=vt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!J(e,(function(t){return I(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},At=Object.prototype.hasOwnProperty,Nt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)At.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Rt=Nt((function(t,e){return O(t)&&O(e)?Rt(t,e):e})),Mt=Nt((function(t,e){return e})),zt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Dt=Et([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Bt=function(t){return Dt.defaultedThunk(r(t))},Pt=Dt.strict,It=Dt.asOption,Lt=Dt.defaultedThunk,Ht=(Dt.asDefaultedOptionThunk,Dt.mergeWithThunk),Ft=(Et([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){var n;return(n={})[t]=e,n}),Vt=function(t,e){return Ft(t,e)},jt=function(t){return function(t){var e={};return j(t,(function(t){e[t.key]=t.value})),e}(t)},Ut=function(t){return e(gt,K)(t)},Wt=function(t){var e=mt(t);return e.errors.length>0?Ut(e.errors):dt(e.values)},qt=function(t){return O(t)&&vt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},$t=function(t,e){return gt([{path:t,getErrorInfo:e}])},Gt=Et([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Xt=function(t,e,n){var r=Ot(t,e).fold((function(){return n(t)}),o);return dt(r)},Kt=function(t,e,n,o){return n.fold((function(n,i,u,a){var c=function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(t))}))},s=function(e){return e.fold((function(){var t=Ft(i,o(x.none()));return dt(t)}),(function(e){var r=a.extract(t.concat([n]),o,e);return pt(r,(function(t){return Ft(i,o(x.some(t)))}))}))};return u.fold((function(){return ht(function(t,e,n){return Ot(e,n).fold((function(){return function(t,e,n){return $t(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+qt(n)}))}(t,n,e)}),dt)}(t,e,n),c)}),(function(t){return ht(Xt(e,n,t),c)}),(function(){return ht(function(t,e){return dt(Ot(t,e))}(e,n),s)}),(function(t){return ht(function(t,e,n){var r=Ot(t,e).map((function(e){return!0===e?n(t):e}));return dt(r)}(e,n,t),s)}),(function(t){var o=t(e),i=pt(Xt(e,n,r({})),(function(t){return Rt(o,t)}));return ht(i,c)}))}),(function(t,n){var r=n(e);return dt(Ft(t,o(r)))}))},Yt=function(t){return{extract:function(e,n,r){return o=t(r,n),i=function(t){return function(t,e){return $t(t,(function(){return e}))}(e,t)},o.stype===g.Error?i(o.serror):o;var o,i},toString:function(){return"val"}}},Jt=function(e){return vt(function(e,n){var r={};return function(t,e,n,r){yt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r}(e,(function(t){return null!=t})))},Qt=function(t){var e=Zt(t),n=q(t,(function(t,e){return e.fold((function(e){return Rt(t,Vt(e,!0))}),r(t))}),{});return{extract:function(t,r,o){var i=_(o)?[]:Jt(o),u=W(i,(function(t){return!_t(n,t)}));return 0===u.length?e.extract(t,r,o):function(t,e){return $t(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,u)},toString:e.toString}},Zt=function(t){return{extract:function(e,n,r){return function(t,e,n,r){return function(t,e){var n=mt(t);return n.errors.length>0?Ut(n.errors):function(t,e){return t.length>0?dt(Rt(e,Mt.apply(void 0,t))):dt(e)}(n.values,e)}(V(n,(function(n){return Kt(t,e,n,r)})),{})}(e,r,t,n)},toString:function(){return"obj{\n"+V(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},te=function(t){return{extract:function(e,n,r){var o=V(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return Wt(o)},toString:function(){return"array("+t.toString()+")"}}},ee=function(t){return{extract:function(e,n,r){for(var o=[],i=0,u=t;i<u.length;i++){var a=u[i].extract(e,n,r);if(a.stype===g.Value)return a;o.push(a)}return Wt(o)},toString:function(){return"oneOf("+V(t,(function(t){return t.toString()})).join(", ")+")"}}},ne=r(Yt(dt)),re=e(te,Zt),oe=Gt.state,ie=Gt.field,ue=function(t,e){return{extract:function(n,r,o){return Ot(o,t).fold((function(){return function(t,e){return $t(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return function(t,e,n,r,o){return Ot(r,o).fold((function(){return function(t,e,n){return $t(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+qt(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))}(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+vt(e)}}},ae=Yt(dt),ce=function(t){return re(t)},se=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}},le=function(t){return Yt((function(e){return t(e).fold(gt,dt)}))},fe=function(t,e){return function(t,e){return{extract:function(n,r,i){var u=vt(i),a=function(e,n){return te(Yt(t)).extract(e,o,n)}(n,u);return ht(a,(function(t){var o=V(t,(function(t){return Gt.field(t,t,Pt(),e)}));return Zt(o).extract(n,r,i)}))},toString:function(){return"setOf("+e.toString()+")"}}}((function(e){return t(e).fold(ft,lt)}),e)},de=function(t,e,n){return r=function(t,e,n,r){return function(t,e){return t.stype===g.Error?{stype:g.Error,serror:e(t.serror)}:t}(e.extract([t],n,r),(function(t){return{input:r,errors:t}}))}(t,e,o,n),st(r,ct.error,ct.value);var r},me=function(t){return t.fold((function(t){throw new Error(he(t))}),o)},ge=function(t,e,n){return me(de(t,e,n))},he=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,V(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+qt(t.input);var e,n},pe=function(t,e){return ue(t,e)},ve=function(t,e){return ue(t,wt(e,Zt))},be=r(ae),ye=function(t,e){return Yt((function(n){var r=typeof n;return t(n)?dt(n):gt("Expected type: "+e+" but got: "+r)}))},we=ye(R,"number"),xe=ye(k,"string"),Ce=ye(_,"boolean"),Se=ye(N,"function"),ke=function(t){var e=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every((function(e){return ke(t[e])}));case"Map":return e(t.keys(),ke)&&e(t.values(),ke);case"Set":return e(t.keys(),ke);default:return!1}},Oe=Yt((function(t){return ke(t)?dt(t):gt("Expected value to be acceptable for sending via postMessage")})),Te=function(t){return le((function(e){return I(t,e)?ct.value(e):ct.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},_e=function(t){return ie(t,t,Pt(),ne())},Ee=function(t,e){return ie(t,t,Pt(),e)},Ae=function(t){return Ee(t,we)},Ne=function(t){return Ee(t,xe)},Re=function(t,e){return ie(t,t,Pt(),Te(e))},Me=function(t){return Ee(t,Se)},ze=function(t,e){return ie(t,t,Pt(),Zt(e))},De=function(t,e){return ie(t,t,Pt(),re(e))},Be=function(t,e){return ie(t,t,Pt(),te(e))},Pe=function(t){return ie(t,t,It(),ne())},Ie=function(t,e){return ie(t,t,It(),e)},Le=function(t){return Ie(t,we)},He=function(t){return Ie(t,xe)},Fe=function(t){return Ie(t,Se)},Ve=function(t,e){return Ie(t,Zt(e))},je=function(t,e){return ie(t,t,Bt(e),ne())},Ue=function(t,e,n){return ie(t,t,Bt(e),n)},We=function(t,e){return Ue(t,e,we)},qe=function(t,e){return Ue(t,e,xe)},$e=function(t,e,n){return Ue(t,e,Te(n))},Ge=function(t,e){return Ue(t,e,Ce)},Xe=function(t,e){return Ue(t,e,Se)},Ke=function(t,e,n){return Ue(t,e,te(n))},Ye=function(t,e,n){return Ue(t,e,Zt(n))},Je=function(t,e){return oe(t,e)},Qe=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Ze=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},tn=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ze(n.childNodes[0])},en=function(t,e){var n=(e||document).createElement(t);return Ze(n)},nn=function(t,e){var n=(e||document).createTextNode(t);return Ze(n)},rn=Ze,on=function(){return un(0,0)},un=function(t,e){return{major:t,minor:e}},an=function(t,e){var n=String(e).toLowerCase();return 0===t.length?on():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return un(r(1),r(2))}(t,n)},cn=on,sn=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},ln=function(t,e){return-1!==t.indexOf(e)},fn=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,t.length-e.length)},dn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),mn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,gn=function(t){return function(e){return ln(e,t)}},hn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ln(t,"edge/")&&ln(t,"chrome")&&ln(t,"safari")&&ln(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,mn],search:function(t){return ln(t,"chrome")&&!ln(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ln(t,"msie")||ln(t,"trident")}},{name:"Opera",versionRegexes:[mn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:gn("firefox")},{name:"Safari",versionRegexes:[mn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ln(t,"safari")||ln(t,"mobile/"))&&ln(t,"applewebkit")}}],pn=[{name:"Windows",search:gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ln(t,"iphone")||ln(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:gn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:gn("linux"),versionRegexes:[]},{name:"Solaris",search:gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:gn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:gn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],vn={browsers:r(hn),oses:r(pn)},bn="Edge",yn="Chrome",wn="Opera",xn="Firefox",Cn="Safari",Sn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(bn),isChrome:r(yn),isIE:r("IE"),isOpera:r(wn),isFirefox:r(xn),isSafari:r(Cn)}},kn=function(){return Sn({current:void 0,version:cn()})},On=Sn,Tn=(r(bn),r(yn),r("IE"),r(wn),r(xn),r(Cn),"Windows"),_n="Android",En="Linux",An="Solaris",Nn="FreeBSD",Rn="ChromeOS",Mn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Tn),isiOS:r("iOS"),isAndroid:r(_n),isOSX:r("OSX"),isLinux:r(En),isSolaris:r(An),isFreeBSD:r(Nn),isChromeOS:r(Rn)}},zn=function(){return Mn({current:void 0,version:cn()})},Dn=Mn,Bn=(r(Tn),r("iOS"),r(_n),r(En),r("OSX"),r(An),r(Nn),r(Rn),function(t,e){var n=vn.browsers(),o=vn.oses(),i=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(kn,On),u=function(t,e){return sn(t,e).map((function(t){var n=an(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(zn,Dn),a=function(t,e,n,o){var i=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:r(i),isiPhone:r(u),isTablet:r(s),isPhone:r(l),isTouch:r(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:r(f),isDesktop:r(d)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}}),Pn=function(t){return window.matchMedia(t).matches},In=zt((function(){return Bn(navigator.userAgent,Pn)})),Ln=function(){return In()},Hn=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Fn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Vn=function(t,e){return t.dom===e.dom},jn=function(t,e){return Ln().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Un=function(t){return N(t)?t:c},Wn=function(t,e,n){for(var r=t.dom,o=Un(n);r.parentNode;){r=r.parentNode;var i=rn(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()},qn=function(t,e,n){var r=e(t),o=Un(n);return r.orThunk((function(){return o(t)?x.none():Wn(t,e,o)}))},$n=function(t,e){return Vn(t.element,e.event.target)},Gn=function(e){if(!_t(e,"can")&&!_t(e,"abort")&&!_t(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return ge("Extracting event.handler",Qt([je("can",s),je("abort",c),je("run",t)]),e)},Xn=r,Kn=Xn("touchstart"),Yn=Xn("touchmove"),Jn=Xn("touchend"),Qn=Xn("touchcancel"),Zn=Xn("mousedown"),tr=Xn("mousemove"),er=Xn("mouseout"),nr=Xn("mouseup"),rr=Xn("mouseover"),or=Xn("focusin"),ir=Xn("focusout"),ur=Xn("keydown"),ar=Xn("keyup"),cr=Xn("input"),sr=Xn("change"),lr=Xn("click"),fr=Xn("transitionend"),dr=Xn("selectstart"),mr=function(t){return r("alloy."+t)},gr={tap:mr("tap")},hr=mr("focus"),pr=mr("blur.post"),vr=mr("paste.post"),br=mr("receive"),yr=mr("execute"),wr=mr("focus.item"),xr=gr.tap,Cr=mr("longpress"),Sr=mr("sandbox.close"),kr=mr("typeahead.cancel"),Or=mr("system.init"),Tr=mr("system.touchmove"),_r=mr("system.touchend"),Er=mr("system.scroll"),Ar=mr("system.resize"),Nr=mr("system.attached"),Rr=mr("system.detached"),Mr=mr("system.dismissRequested"),zr=mr("system.repositionRequested"),Dr=mr("focusmanager.shifted"),Br=mr("slotcontainer.visibility"),Pr=mr("change.tab"),Ir=mr("dismiss.tab"),Lr=mr("highlight"),Hr=mr("dehighlight"),Fr=function(t,e){Wr(t,t.element,e,{})},Vr=function(t,e,n){Wr(t,t.element,e,n)},jr=function(t){Fr(t,yr())},Ur=function(t,e,n){Wr(t,e,n,{})},Wr=function(t,e,n,r){var o=f({target:e},r);t.getSystem().triggerEvent(n,e,o)},qr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},$r=function(t){return jt(t)},Gr=function(t,e){return{key:t,value:Gn({abort:e})}},Xr=function(t){return{key:t,value:Gn({run:function(t,e){e.event.prevent()}})}},Kr=function(t,e){return{key:t,value:Gn({run:e})}},Yr=function(t,e,n){return{key:t,value:Gn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Jr=function(t){return function(e){return{key:t,value:Gn({run:function(t,n){$n(t,n)&&e(t,n)}})}}},Qr=function(t,e,n){return function(t,e){return Kr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){qr(e,e.element,t,r)}))}))}(t,e.partUids[n])},Zr=function(t,e){return Kr(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).fold((function(){return qn(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),c).getOr(t)}),(function(t){return t}));e(t,o,n)}))},to=function(t){return Kr(t,(function(t,e){e.cut()}))},eo=function(t){return Kr(t,(function(t,e){e.stop()}))},no=function(t,e){return Jr(t)(e)},ro=Jr(Nr()),oo=Jr(Rr()),io=Jr(Or()),uo=function(t){return function(e){return Kr(t,e)}}(yr()),ao=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),co=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},so=co(1),lo=co(3),fo=co(9),mo=co(11),go=function(t){return rn(t.dom.ownerDocument)},ho=function(t){return fo(t)?t:go(t)},po=function(t){return rn(ho(t).dom.documentElement)},vo=function(t){return rn(ho(t).dom.defaultView)},bo=function(t){return x.from(t.dom.parentNode).map(rn)},yo=function(t){return x.from(t.dom.offsetParent).map(rn)},wo=function(t){return V(t.dom.childNodes,rn)},xo=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rn)},Co=function(t,e){bo(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},So=function(t,e){(function(t){return x.from(t.dom.nextSibling).map(rn)})(t).fold((function(){bo(t).each((function(t){Oo(t,e)}))}),(function(t){Co(t,e)}))},ko=function(t,e){(function(t){return xo(t,0)})(t).fold((function(){Oo(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Oo=function(t,e){t.dom.appendChild(e.dom)},To=function(t,e){j(e,(function(e){Oo(t,e)}))},_o=function(t){t.dom.textContent="",j(wo(t),(function(t){Eo(t)}))},Eo=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ao=function(t){var e,n=wo(t);n.length>0&&(e=t,j(n,(function(t){Co(e,t)}))),Eo(t)},No=function(t){return t.dom.innerHTML},Ro=function(t,e){var n,r,o=go(t).dom,i=rn(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,wo(rn(r)));To(i,u),_o(t),Oo(t,i)},Mo=function(t,e,n){if(!(k(n)||_(n)||R(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},zo=function(t,e,n){Mo(t.dom,e,n)},Do=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Bo=function(t,e){return x.from(Do(t,e))},Po=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Io=function(t,e){t.dom.removeAttribute(e)},Lo=function(t){return function(t){var e=en("div"),n=rn(t.dom.cloneNode(!0));return Oo(e,n),No(e)}(function(t){return function(t,e){return rn(t.dom.cloneNode(!1))}(t)}(t))},Ho=function(t){return Lo(t)},Fo=$r([function(t,e){return{key:t,value:Gn({can:function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return Vn(e,t.element)&&!Vn(e,n)}(t,r,o)||(console.warn(hr()+" did not get interpreted by the desired target. \nOriginator: "+Ho(r)+"\nTarget: "+Ho(o)+"\nCheck the "+hr()+" event handlers"),!1)}})}}(hr())]),Vo=Object.freeze({__proto__:null,events:Fo}),jo=0,Uo=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++jo+String(e)},Wo=r("alloy-id-"),qo=r("data-alloy-id"),$o=Wo(),Go=qo(),Xo=function(t,e){Object.defineProperty(t.dom,Go,{value:e,writable:!0})},Ko=function(t){var e=so(t)?t.dom[Go]:null;return x.from(e)},Yo=function(t){return Uo(t)},Jo=o,Qo=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Ho(t().element)+" is not in context.":""))}};return{debugInfo:r("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:c}},Zo=Qo(),ti=function(t){return V(t,(function(t){return fn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},ei=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(i)}},t},ni=Uo("alloy-premade"),ri=function(t){return Vt(ni,t)},oi=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ti(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,m([e.getApis(),e],n))}),t)},ii={init:function(){return ui({readState:function(){return"No State required"}})}},ui=function(t){return t},ai=function(t,e){var n={};return yt(t,(function(t,r){yt(t,(function(t,o){var i=Ot(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},ci=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},si=function(t){return t.cHandler},li=function(t,e){return{name:t,handler:e}},fi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=tt(n,(function(e,n){var o=e.name,i=n.name,u=r.indexOf(o),a=r.indexOf(i);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));return u<a?-1:a<u?1:0}));return ct.value(o)}catch(t){return ct.error([t])}}("Event: "+n,0,t,r).map((function(t){return function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return Gn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,(function(t){t.run.apply(void 0,e)}))}})}(V(t,(function(t){return t.handler})))})):function(t,e){return ct.error(["The event ("+t+') 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(V(e,(function(t){return t.name})),null,2)])}(n,t)},di=function(t,e){var n,o,i,u=Ct(t,(function(t,n){return(1===t.length?ct.value(t[0].handler):fi(t,e,n)).map((function(o){var i=function(t){var e=function(t){return N(t)?{can:r(!0),abort:r(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}}(o),u=t.length>1?W(e[n],(function(e){return L(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Vt(n,function(t,e){return{handler:t,purpose:e}}(i,u))}))}));return n={},(i=function(t){var e=[],n=[];return j(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(u)).errors.length>0?(o=i.errors,ct.error(K(o))):function(t,e){return 0===t.length?ct.value(e):ct.value(Rt(e,Mt.apply(void 0,t)))}(i.values,n)},mi="alloy.base.behaviour",gi=function(t){return t.events},hi=function(t,e){var n=Do(t,e);return void 0===n||""===n?[]:n.split(" ")},pi=function(t){return void 0!==t.dom.classList},vi=function(t,e){pi(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=hi(t,e).concat([n]);zo(t,e,r.join(" "))})(t,"class",e)}(t,e)},bi=function(t,e){pi(t)?t.dom.classList.remove(e):function(t,e){(function(t,e,n){var r=W(hi(t,e),(function(t){return t!==n}));r.length>0?zo(t,e,r.join(" ")):Io(t,e)})(t,"class",e)}(t,e),function(t){0===(pi(t)?t.dom.classList:function(t){return hi(t,"class")}(t)).length&&Io(t,"class")}(t)},yi=function(t,e){return pi(t)&&t.dom.classList.contains(e)},wi=function(t,e){j(e,(function(e){vi(t,e)}))},xi=function(t,e){j(e,(function(e){bi(t,e)}))},Ci=function(t){return void 0!==t.style&&N(t.style.getPropertyValue)},Si=function(t){return mo(t)},ki=N(Element.prototype.attachShadow)&&N(Node.prototype.getRootNode),Oi=r(ki),Ti=ki?function(t){return rn(t.dom.getRootNode())}:ho,_i=function(t){return Si(t)?t:rn(ho(t).dom.body)},Ei=function(t){var e=Ti(t);return Si(e)?x.some(e):x.none()},Ai=function(t){return rn(t.dom.host)},Ni=function(t){var e=lo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Ei(rn(e)).fold((function(){return o.body.contains(e)}),(n=Ni,r=Ai,function(t){return n(r(t))}))},Ri=function(){return Mi(rn(document))},Mi=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return rn(e)},zi=function(t,e,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ci(t)&&t.style.setProperty(e,n)},Di=function(t,e){Ci(t)&&t.style.removeProperty(e)},Bi=function(t,e,n){var r=t.dom;zi(r,e,n)},Pi=function(t,e){var n=t.dom;yt(e,(function(t,e){zi(n,e,t)}))},Ii=function(t,e){var n=t.dom;yt(e,(function(t,e){t.fold((function(){Di(n,e)}),(function(t){zi(n,e,t)}))}))},Li=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ni(t)?r:Hi(n,e)},Hi=function(t,e){return Ci(t)?t.style.getPropertyValue(e):""},Fi=function(t,e){var n=t.dom,r=Hi(n,e);return x.from(r).filter((function(t){return t.length>0}))},Vi=function(t){var e={},n=t.dom;if(Ci(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},ji=function(t,e,n){var r=en(t);return Bi(r,e,n),Fi(r,e).isSome()},Ui=function(t,e){var n=t.dom;Di(n,e),Bo(t,"style").map(dn).is("")&&Io(t,"style")},Wi=function(t){return t.dom.offsetWidth},qi=function(t){return t.dom.value},$i=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Gi=function(t){return function(t,e){return function(t,e){var n=V(e,(function(t){return Ve(t.name(),[_e("config"),je("state",ii)])})),r=de("component.behaviours",Zt(n),t.behaviours).fold((function(e){throw new Error(he(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:wt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)}(t,function(t){var e=Ot(t,"behaviours").getOr({}),n=W(vt(e),(function(t){return void 0!==e[t]}));return V(n,(function(t){return e[t].me}))}(t))},Xi=function(t,e,n){var r={"alloy.base.behaviour":gi(t)};return function(t,e,n,r){var o=function(t,e,n){var r=f(f({},n),function(t,e){var n={};return j(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return ai(r,li)}(t,n,r);return di(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ki=function(t){var e=function(){return d},n=Qe(Zo),o=me(function(t){var e,n;return de("custom.definition",Zt([ie("dom","dom",Pt(),Zt([_e("tag"),je("styles",{}),je("classes",[]),je("attributes",{}),Pe("value"),Pe("innerHtml")])),_e("components"),_e("uid"),je("events",{}),je("apis",{}),ie("eventOrder","eventOrder",(e={},e[yr()]=["disabling",mi,"toggling","typeaheadevents"],e[hr()]=[mi,"focusing","keying"],e[Or()]=[mi,"disabling","toggling","representing"],e[cr()]=[mi,"representing","streaming","invalidating"],e[Rr()]=[mi,"representing","item-events","tooltipping"],e[Zn()]=["focusing",mi,"item-type-events"],e[Kn()]=["focusing",mi,"item-type-events"],e[rr()]=["item-type-events","tooltipping"],e[br()]=["receiving","reflecting","tooltipping"],n=e,Dt.mergeWithThunk(r(n))),be()),Pe("domModification")]),t)}(t)),i=Gi(t),u=function(t){return t.list}(i),a=function(t){return t.data}(i),c=function(t){var e=en(t.tag);!function(t,e){var n=t.dom;yt(e,(function(t,e){Mo(n,e,t)}))}(e,t.attributes),wi(e,t.classes),Pi(e,t.styles),t.innerHtml.each((function(t){return Ro(e,t)}));var n=t.domChildren;return To(e,n),t.value.each((function(t){$i(e,t)})),t.uid,Xo(e,t.uid),e}(function(t,e,n){var r,o,i,u=f(f({},(r=t).dom),{uid:r.uid,domChildren:V(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return ci({})}),ci)}(t),c={"alloy.base.modification":a};return i=e.length>0?function(t,e,n,r){var o=f({},e);j(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=ai(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return q(t,(function(t,e){return f(f({},e.modification),t)}),{})},a=q(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return ci({classes:a,attributes:c,styles:s})}(n,c,e,u):a,f(f({},o=u),{attributes:f(f({},o.attributes),i.attributes),styles:f(f({},o.styles),i.styles),classes:o.classes.concat(i.classes)})}(o,u,a)),s=Xi(o,u,a),l=Qe(o.components),d={getSystem:n.get,config:function(e){var n=a;return(N(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return N(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Qo(e))},element:c,syncComponents:function(){var t=wo(c),e=Y(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));l.set(e)},components:l.get,events:s};return d},Yi=function(t){var e=nn(t);return Ji({element:e})},Ji=function(e){var n=ge("external.component",Qt([_e("element"),Pe("uid")]),e),o=Qe(Qo());n.uid.each((function(t){Xo(n.element,t)}));var i={getSystem:o.get,config:x.none,hasConfigured:c,connect:function(t){o.set(t)},disconnect:function(){o.set(Qo((function(){return i})))},getApis:function(){return{}},element:n.element,spec:e,readState:r("No state"),syncComponents:t,components:r([]),events:{}};return ri(i)},Qi=Yo,Zi=function(t){return function(t){return Ot(t,ni)}(t).fold((function(){return function(t){var e=Jo(t),n=e.events,r=d(e,["events"]),o=function(t){var e=Ot(t,"components").getOr([]);return V(e,Zi)}(r),i=f(f({},r),{events:f(f({},Vo),n),components:o});return ct.value(Ki(i))}(t.hasOwnProperty("uid")?t:f({uid:Qi("")},t)).getOrDie()}),(function(t){return t}))},tu=ri;function eu(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Li(n,t);return parseFloat(o)||0}return r},r=function(t,e){return $(e,(function(e,n){var r=Li(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!R(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ci(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var nu=eu("height",(function(t){var e=t.dom;return Ni(t)?e.getBoundingClientRect().height:e.offsetHeight})),ru=function(t){return nu.get(t)},ou=function(t){return nu.getOuter(t)},iu=function(t,e){return{left:t,top:e,translate:function(n,r){return iu(t+n,e+r)}}},uu=iu,au=function(t,e){return void 0!==t?t:void 0!==e?e:0},cu=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return uu(n.offsetLeft,n.offsetTop);var i=au(null==r?void 0:r.pageYOffset,o.scrollTop),u=au(null==r?void 0:r.pageXOffset,o.scrollLeft),a=au(o.clientTop,n.clientTop),c=au(o.clientLeft,n.clientLeft);return su(t).translate(u-c,i-a)},su=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?uu(n.offsetLeft,n.offsetTop):Ni(t)?function(t){var e=t.getBoundingClientRect();return uu(e.left,e.top)}(e):uu(0,0)},lu=eu("width",(function(t){return t.dom.offsetWidth})),fu=function(t){return lu.get(t)},du=function(t){return lu.getOuter(t)},mu=function(t){var n=rn(function(t){if(Oi()&&A(t.target)){var e=rn(t.target);if(so(e)&&function(t){return A(t.dom.shadowRoot)}(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return nt(n)}}return x.from(t.target)}(t).getOr(t.target)),r=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=e(o,r);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(n,t.clientX,t.clientY,r,o,i,t)},gu=function(t,e,n,r,o){var u=function(t,e){return function(n){t(n)&&e(mu(n))}}(n,r);return t.dom.addEventListener(e,u,o),{unbind:i(hu,t,e,u,o)}},hu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},pu=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return uu(n,r)},vu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},bu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},yu=function(t){var e=void 0===t?window:t,n=e.document,r=pu(rn(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return bu(r.left,r.top,n,o)}),(function(t){return bu(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},wu=function(t,e){return t.view(e).fold(r([]),(function(e){var n=t.owner(e),r=wu(t,n);return[e].concat(r)}))},xu=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(rn)},owner:function(t){return go(t)}}),Cu=function(t){var e=rn(document),n=pu(e);return function(t,e){var n=e.owner(t),r=wu(e,n);return x.some(r)}(t,xu).fold(i(cu,t),(function(e){var r=su(t),o=q(e,(function(t,e){var n=su(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return uu(o.left+r.left+n.left,o.top+r.top+n.top)}))},Su=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ku=function(t){var e=cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Ou=function(t){var e=Cu(t),n=du(t),r=ou(t);return Su(e.left,e.top,n,r)},Tu=function(){return yu(window)};function _u(t,e,n,r,o){return t(n,r)?x.some(n):N(o)&&o(n)?x.none():e(n,r,o)}var Eu,Au=function(t,e,n){for(var r=t.dom,o=N(n)?n:c;r.parentNode;){r=r.parentNode;var i=rn(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},Nu=function(t,e,n){return _u((function(t,e){return e(t)}),Au,t,e,n)},Ru=function(t,e,n){return Nu(t,e,n).isSome()},Mu=function(t,e,n){return Au(t,(function(t){return Hn(t,e)}),n)},zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?x.none():x.from(n.querySelector(t)).map(rn)}(e,t)},Du=function(t,e,n){return _u((function(t,e){return Hn(t,e)}),Mu,t,e,n)},Bu=function(){var t=Uo("aria-owns");return{id:t,link:function(e){zo(e,"aria-owns",t)},unlink:function(t){Io(t,"aria-owns")}}},Pu=function(t,e){return Ru(e,(function(e){return Vn(e,t.element)}),c)||function(t,e){return function(t){return Nu(t,(function(t){if(!so(t))return!1;var e=Do(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Do(t,"id"),n=Ti(t);return zu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return Pu(t,e)}))}(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Eu||(Eu={}));var Iu,Lu=Qe({}),Hu=["alloy/data/Fields","alloy/debugging/Debugging"],Fu=function(t,e,n){return function(t,e,n){switch(Ot(Lu.get(),t).orThunk((function(){var e=vt(Lu.get());return it(e,(function(e){return t.indexOf(e)>-1?x.some(Lu.get()[e]):x.none()}))})).getOr(Eu.NORMAL)){case Eu.NORMAL:return n(Vu());case Eu.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();I(["mousemove","mouseover","mouseout",Or()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:V(n,(function(t){return I(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ho(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case Eu.STOP:return!0}}(t,e,n)},Vu=r({logEventCut:t,logEventStopped:t,logNoParent:t,logEventNoHandlers:t,logEventResponse:t,write:t}),ju=r([_e("menu"),_e("selectedMenu")]),Uu=r([_e("item"),_e("selectedItem")]),Wu=(r(Zt(Uu().concat(ju()))),r(Zt(Uu()))),qu=ze("initSize",[_e("numColumns"),_e("numRows")]),$u=function(){return ze("markers",[_e("backgroundMenu")].concat(ju()).concat(Uu()))},Gu=function(t){return ze("markers",V(t,_e))},Xu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");G(e,(function(t){return t.indexOf("alloy")>0&&!L(Hu,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),ie(e,e,n,le((function(t){return ct.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},Ku=function(e){return Xu(0,e,Bt(t))},Yu=function(t){return Xu(0,t,Bt(x.none))},Ju=function(t){return Xu(0,t,Pt())},Qu=function(t){return Xu(0,t,Pt())},Zu=function(t,e){return Je(t,r(e))},ta=function(t){return Je(t,o)},ea=r(qu),na=function(t,e,n,r,o,i){return{x:t,y:e,bubble:n,direction:r,boundsRestriction:o,label:i}},ra=Et([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),oa=ra.southeast,ia=ra.southwest,ua=ra.northeast,aa=ra.northwest,ca=ra.south,sa=ra.north,la=ra.east,fa=ra.west,da=function(t,e){return function(n,r){for(var o={},i=0,u=n.length;i<u;i++){var a=n[i];o[String(a)]=Ot(e,a).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}return o}(["left","right","top","bottom"])},ma=function(t){return t.x},ga=function(t,e){return t.x+t.width/2-e.width/2},ha=function(t,e){return t.x+t.width-e.width},pa=function(t,e){return t.y-e.height},va=function(t){return t.y+t.height},ba=function(t,e){return t.y+t.height/2-e.height/2},ya=function(t,e,n){return na(ma(t),va(t),n.southeast(),oa(),da(t,{left:1,top:3}),"layout-se")},wa=function(t,e,n){return na(ha(t,e),va(t),n.southwest(),ia(),da(t,{right:0,top:3}),"layout-sw")},xa=function(t,e,n){return na(ma(t),pa(t,e),n.northeast(),ua(),da(t,{left:1,bottom:2}),"layout-ne")},Ca=function(t,e,n){return na(ha(t,e),pa(t,e),n.northwest(),aa(),da(t,{right:0,bottom:2}),"layout-nw")},Sa=function(t,e,n){return na(ga(t,e),pa(t,e),n.north(),sa(),da(t,{bottom:2}),"layout-n")},ka=function(t,e,n){return na(ga(t,e),va(t),n.south(),ca(),da(t,{top:3}),"layout-s")},Oa=function(t,e,n){return na(function(t){return t.x+t.width}(t),ba(t,e),n.east(),la(),da(t,{left:0}),"layout-e")},Ta=function(t,e,n){return na(function(t,e){return t.x-e.width}(t,e),ba(t,e),n.west(),fa(),da(t,{right:1}),"layout-w")},_a=function(){return[ya,wa,xa,Ca,ka,Sa,Oa,Ta]},Ea=function(){return[wa,ya,Ca,xa,ka,Sa,Oa,Ta]},Aa=function(){return[xa,Ca,ya,wa,Sa,ka]},Na=function(){return[Ca,xa,wa,ya,Sa,ka]},Ra=function(){return[ya,wa,xa,Ca,ka,Sa]},Ma=function(){return[wa,ya,Ca,xa,ka,Sa]},za=Object.freeze({__proto__:null,events:function(t){return $r([Kr(br(),(function(e,n){var r=t.channels,o=vt(r),i=n,u=function(t,e){return e.universal?t:W(t,(function(t){return I(e.channels,t)}))}(o,i);j(u,(function(t){var n=r[t],o=n.schema,u=ge("channel["+t+"] data\nReceiver: "+Ho(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),Da=[Ee("channels",fe(ct.value,Qt([Ju("onReceive"),je("schema",be())])))],Ba=function(t,e,n){return io((function(r,o){n(r,t,e)}))},Pa=function(t){return{key:t,value:void 0}},Ia=function(t,e,n,o,u,a,c){var s=function(t){return _t(t,n)?t[n]():x.none()},l=wt(u,(function(t,e){return function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ti(u.slice(0,1).concat(u.slice(3)))}},t}((function(o){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:r(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[o,t.config,t.state].concat(n))}))}),n,e)}(n,t,e)})),d=wt(a,(function(t,e){return ei(t,e)})),m=f(f(f({},d),l),{revoke:i(Pa,n),config:function(e){var r=ge(n+"-config",t,e);return{key:n,value:{config:r,me:m,configAsRaw:zt((function(){return ge(n+"-config",t,e)})),initialConfig:e,state:c}}},schema:function(){return e},exhibit:function(t,e){return s(t).bind((function(t){return Ot(o,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(ci({}))},name:function(){return n},handlers:function(t){return s(t).map((function(t){return Ot(o,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return m},La=function(t){return jt(t)},Ha=Qt([_e("fields"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),Fa=function(t){var e=ge("Creating behaviour: "+t.name,Ha,t);return function(t,e,n,r,o,i){var u,a=Qt(t),c=Ve(e,[("config",u=t,Ie("config",Qt(u)))]);return Ia(a,c,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Va=Qt([_e("branchKey"),_e("branches"),_e("name"),je("active",{}),je("apis",{}),je("state",ii),je("extra",{})]),ja=function(t){var e=ge("Creating behaviour: "+t.name,Va,t);return function(t,e,n,r,o,i){var u=t,a=Ve(e,[Ie("config",t)]);return Ia(u,a,e,n,r,o,i)}(ve(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Ua=r(void 0),Wa=Fa({fields:Da,name:"receiving",active:za}),qa=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),$a=function(t){return t.dom.focus()},Ga=function(t){return void 0===t&&(t=rn(document)),x.from(t.dom.activeElement).map(rn)},Xa=function(t){return Ga(Ti(t)).filter((function(e){return t.dom.contains(e.dom)}))},Ka=function(e,n){var r=Ti(n),o=Ga(r).bind((function(t){var e,r,o=function(e){return Vn(t,e)};return o(n)?x.some(n):(e=o,(r=function(t){for(var n=0;n<t.childNodes.length;n++){var o=rn(t.childNodes[n]);if(e(o))return x.some(o);var i=r(t.childNodes[n]);if(i.isSome())return i}return x.none()})(n.dom))})),i=e(n);return o.each((function(e){Ga(r).filter((function(t){return Vn(t,e)})).fold((function(){$a(e)}),t)})),i},Ya=function(t,e,n,r,o){return{position:t,left:e,top:n,right:r,bottom:o}},Ja=function(t,e){var n=function(t){return t+"px"};Ii(t,{position:x.some(e.position),left:e.left.map(n),top:e.top.map(n),right:e.right.map(n),bottom:e.bottom.map(n)})},Qa=Et([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Za=function(t,e,n,r,o,i){var u=e.x-n,a=e.y-r,c=o-(u+e.width),s=i-(a+e.height),l=x.some(u),f=x.some(a),d=x.some(c),m=x.some(s),g=x.none();return e.direction.fold((function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,g,g,d,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,l,g,g,m)}),(function(){return Ya(t,l,f,g,g)}),(function(){return Ya(t,g,f,d,g)}))},tc=function(t,e){var n=i(Cu,e),r=t.fold(n,n,(function(){var t=pu();return Cu(e).translate(-t.left,-t.top)})),o=du(e),u=ou(e);return Su(r.left,r.top,o,u)},ec=function(t,e){return e.fold((function(){return t.fold(Tu,Tu,Su)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=nc(t,n.x,n.y);return Su(r.left,r.top,n.width,n.height)}))}))},nc=function(t,e,n){var o=uu(e,n);return t.fold(r(o),r(o),(function(){var t=pu();return o.translate(-t.left,-t.top)}))},rc=(Qa.none,Qa.relative),oc=Qa.fixed,ic=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},uc=function(t,e,n){return Math.min(Math.max(t,e),n)},ac=Et([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),cc=function(t,e,n,u){Ui(e,"max-height"),Ui(e,"max-width");var a,c={width:du(a=e),height:ou(a)};return function(t,e,n,u,a){var c=n.width,s=n.height,l=function(t,i,l,f){return function(t,e,n,i){var u=t.x,a=t.y,c=t.bubble.offset,s=c.left,l=c.top,f=function(t,e,n){var r=function(t,r){var i="top"===t||"bottom"===t?n.top:n.left;return Ot(e,t).bind(o).bind((function(e){return"left"===t||"top"===t?e>=r?x.some(e):x.none():e<=r?x.some(e):x.none()})).map((function(t){return t+i})).getOr(r)},i=r("left",t.x),u=r("top",t.y),a=r("right",t.right),c=r("bottom",t.bottom);return Su(i,u,a-i,c-u)}(i,t.boundsRestriction,c),d=f.y,m=f.bottom,g=f.x,h=f.right,p=a+l,v=function(t,e,n,r,o){var i=o.x,u=o.y,a=o.width,c=o.height,s=t>=i,l=e>=u,f=s&&l,d=t+n<=i+a&&e+r<=u+c,m=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),g=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),h=Math.max(o.x,o.right-n),p=Math.max(o.y,o.bottom-r);return{originInBounds:f,sizeInBounds:d,limitX:uc(t,o.x,h),limitY:uc(e,o.y,p),deltaW:m,deltaH:g}}(u+s,p,e,n,f),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,C=v.limitY,S=v.deltaW,k=v.deltaH,O=r(C+k-d),T=r(m-C),_=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction,T,T,O),E=r(w+S-g),A=r(h-w),N={x:w,y:C,width:S,height:k,maxHeight:_,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction,A,A,E),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:p};return b&&y?ac.fit(N):ac.nofit(N,S,k)}(t(e,n,u),c,s,a).fold(ac.fit,(function(t,e,n){return n>f||e>l?ac.nofit(t,e,n):ac.nofit(i,l,f)}))};return $(t,(function(t,e){var n=i(l,e);return t.fold(ac.fit,n)}),ac.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:oa(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(o,o)}(u.preference,t,c,n,u.bounds)},sc=function(t,e){!function(t,e){var n=nu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Bi(t,"max-height",n+"px")}(t,Math.floor(e))},lc=r((function(t,e){sc(t,e),Pi(t,{"overflow-x":"hidden","overflow-y":"auto"})})),fc=r((function(t,e){sc(t,e)})),dc=function(t,e,n){return void 0===t[e]?n:t[e]},mc=function(t,e,n,r){var o=cc(t,e,n,r);(function(t,e,n){Ja(t,function(t,e){return t.fold((function(){return Ya("absolute",x.some(e.x),x.some(e.y),x.none(),x.none())}),(function(t,n,r,o){return Za("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Za("fixed",e,t,n,r,o)}))}(n.origin,e))})(e,o,r),function(t,e){var n=e.classes;xi(t,n.off),wi(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r)},gc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],hc=function(t,e,n){var r=function(t){return Ot(n,t).getOr([])},o=function(t,e,n){var o=Z(gc,n);return{offset:uu(t,e),classesOn:Y(n,r),classesOff:Y(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},pc=function(){return hc(0,0,{})},vc=function(t,e){return function(n){return"rtl"===bc(n)?e:t}},bc=function(t){return"rtl"===Li(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Iu||(Iu={}));var yc="data-alloy-vertical-dir",wc=function(t){return Ru(t,(function(t){return so(t)&&Do(t,"data-alloy-vertical-dir")===Iu.BottomToTop}))},xc=function(){return Ve("layouts",[_e("onLtr"),_e("onRtl"),Pe("onBottomLtr"),Pe("onBottomRtl")])},Cc=function(t,e,n,r,o,i,u){var a=u.map(wc).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return vc(l,f)(t)},Sc=[_e("hotspot"),Pe("bubble"),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=e.hotspot,o=tc(n,r.element),i=Cc(t.element,e,Ra(),Ma(),Aa(),Na(),x.some(e.hotspot.element));return x.some({anchorBox:o,bubble:e.bubble.getOr(pc()),overrides:e.overrides,layouts:i,placer:x.none()})}))],kc=[_e("x"),_e("y"),je("height",0),je("width",0),je("bubble",pc()),je("overrides",{}),xc(),Zu("placement",(function(t,e,n){var r=nc(n,e.x,e.y),o=Su(r.left,r.top,e.width,e.height),i=Cc(t.element,e,_a(),Ea(),_a(),Ea(),x.none());return x.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:x.none()})}))],Oc=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Tc=Et([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_c=(Tc.before,Tc.on,Tc.after,function(t){return t.fold(o,o,o)}),Ec=Et([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ac={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(t){return Ec.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return rn(t.startContainer)},relative:function(t,e){return _c(t)},exact:function(t,e,n,r){return t}})}(t);return vo(e)},range:Oc},Nc=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rc=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Mc=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zc=Et([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Dc=function(t,e,n){return e(rn(n.startContainer),n.startOffset,rn(n.endContainer),n.endOffset)};zc.ltr,zc.rtl;var Bc,Pc=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(lo),Ic=function(t){return Pc.getOption(t)},Lc=["img","br"],Hc=function(t){return Ic(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||I(Lc,ao(t))},Fc=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Fn(n)?[]:V(n.querySelectorAll(t),rn)}(e,t)},Vc=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return x.some(Oc(rn(e.startContainer),e.startOffset,rn(n.endContainer),n.endOffset))}return x.none()},jc=function(t){if(null===t.anchorNode||null===t.focusNode)return Vc(t);var e=rn(t.anchorNode),n=rn(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=go(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Vn(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?x.some(Oc(e,t.anchorOffset,n,t.focusOffset)):Vc(t)},Uc=function(t,e){return n=function(t,e){return function(t,e){return n=function(t,e){return e.match({domRange:function(t){return{ltr:r(t),rtl:x.none}},relative:function(e,n){return{ltr:zt((function(){return Nc(t,e,n)})),rtl:zt((function(){return x.some(Nc(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:zt((function(){return Rc(t,e,n,r,o)})),rtl:zt((function(){return x.some(Rc(t,r,o,e,n))}))}}})}(t,e),(o=n.ltr()).collapsed?n.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return zc.rtl(rn(t.endContainer),t.endOffset,rn(t.startContainer),t.startOffset)})).getOrThunk((function(){return Dc(0,zc.ltr,o)})):Dc(0,zc.ltr,o);var n,o}(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e),o=n.getClientRects(),(i=o.length>0?o[0]:n.getBoundingClientRect()).width>0||i.height>0?x.some(i).map(Mc):x.none();var n,o,i},Wc=function(t,e){return{element:t,offset:e}},qc=Et([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$c=function(t){return t.fold(o,(function(t,e,n){return t.translate(-e,-n)}))},Gc=function(t){return t.fold(o,o)},Xc=function(t){return $(t,(function(t,e){return t.translate(e.left,e.top)}),uu(0,0))},Kc=function(t){var e=V(t,Gc);return Xc(e)},Yc=qc.screen,Jc=qc.absolute,Qc=function(t,e,n){var r=go(t.element),o=pu(r),i=function(t,e,n){var r=vo(n.root).dom;return x.from(r.frameElement).map(rn).filter((function(e){var n=go(e),r=go(t.element);return Vn(n,r)})).map(cu)}(t,0,n).getOr(o);return Jc(i,o.left,o.top)},Zc=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=Yc(uu(o,i));return x.some(function(t,e,n){return{point:t,width:e,height:n}}(c,u,a))},ts=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c,s,l,f,d=[e,t.point],m=(i=function(){return Kc(d)},u=function(){return Kc(d)},a=function(){return function(t){var e=V(t,$c);return Xc(e)}(d)},r.fold(i,u,a)),g=(c=m.left,s=m.top,l=t.width,f=t.height,{x:c,y:s,width:l,height:f}),h=n.showAbove?Aa():Ra(),p=n.showAbove?Na():Ma(),v=Cc(o,n,h,p,h,p,x.none());return{anchorBox:g,bubble:n.bubble.getOr(pc()),overrides:n.overrides,layouts:v,placer:x.none()}}))},es=function(t,e){return lo(t)?Wc(t,e):function(t,e){var n=wo(t);if(0===n.length)return Wc(t,e);if(e<n.length)return Wc(n[e],0);var r=n[n.length-1],o=lo(r)?function(t){return Pc.get(t)}(r).length:wo(r).length;return Wc(r,o)}(t,e)},ns=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return function(t){return function(t){return x.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(jc)}(t)}}))().map((function(t){var e=es(t.start,t.soffset),n=es(t.finish,t.foffset);return Ac.range(e.element,e.offset,n.element,n.offset)}))},rs=[Pe("getSelection"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=vo(e.root).dom,o=Qc(t,0,e),i=ns(r,e).bind((function(t){return Uc(r,Ac.exactFromRange(t)).orThunk((function(){var e=nn("\ufeff");return Co(t.start,e),Uc(r,Ac.exact(e,0,e,1)).map((function(t){return Eo(e),t}))})).bind((function(t){return Zc(t.left,t.top,t.width,t.height)}))})),u=ns(r,e).bind((function(t){return so(t.start)?x.some(t.start):function(t){return bo(t)}(t.start)})).getOr(t.element);return ts(i,o,e,n,u)}))],os=[_e("node"),_e("root"),Pe("bubble"),xc(),je("overrides",{}),je("showAbove",!1),Zu("placement",(function(t,e,n){var r=Qc(t,0,e);return e.node.bind((function(o){var i=o.dom.getBoundingClientRect(),u=Zc(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return ts(u,r,e,n,a)}))}))],is=function(t){return t.x+t.width},us=function(t,e){return t.x-e.width},as=function(t,e){return t.y-e.height+t.height},cs=function(t){return t.y},ss=function(t,e,n){return na(is(t),cs(t),n.southeast(),oa(),da(t,{left:0,top:2}),"link-layout-se")},ls=function(t,e,n){return na(us(t,e),cs(t),n.southwest(),ia(),da(t,{right:1,top:2}),"link-layout-sw")},fs=function(t,e,n){return na(is(t),as(t,e),n.northeast(),ua(),da(t,{left:0,bottom:3}),"link-layout-ne")},ds=function(t,e,n){return na(us(t,e),as(t,e),n.northwest(),aa(),da(t,{right:1,bottom:3}),"link-layout-nw")},ms=function(){return[ss,ls,fs,ds]},gs=function(){return[ls,ss,ds,fs]},hs=[_e("item"),xc(),je("overrides",{}),Zu("placement",(function(t,e,n){var r=tc(n,e.item.element),o=Cc(t.element,e,ms(),gs(),ms(),gs(),x.none());return x.some({anchorBox:r,bubble:pc(),overrides:e.overrides,layouts:o,placer:x.none()})}))],ps=ve("anchor",{selection:rs,node:os,hotspot:Sc,submenu:hs,makeshift:kc}),vs=function(e,n,r,o,i){!function(e,n,r,o,i,u){var a=dc(u,"maxHeightFunction",lc()),c=dc(u,"maxWidthFunction",t),s=e.anchorBox,l=e.origin,f={bounds:ec(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};mc(s,n,r,f)}(function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)}(r.anchorBox,n),i.element,r.bubble,r.layouts,o,r.overrides)},bs=function(t,e,n,r,o,i){var u=i.map(ku);return ys(t,e,n,r,o,u)},ys=function(t,e,n,o,i,u){var a=ge("positioning anchor.info",ps,o);Ka((function(){Bi(i.element,"position","fixed");var n=Fi(i.element,"visibility");Bi(i.element,"visibility","hidden");var o,c=e.useFixed()?(o=document.documentElement,oc(0,0,o.clientWidth,o.clientHeight)):function(t){var e=cu(t.element),n=t.element.dom.getBoundingClientRect();return rc(e.left,e.top,n.width,n.height)}(t),s=a.placement,l=u.map(r).or(e.getBounds);s(t,a,c).each((function(e){e.placer.getOr(vs)(t,c,e,l,i)})),n.fold((function(){Ui(i.element,"visibility")}),(function(t){Bi(i.element,"visibility",t)})),Fi(i.element,"left").isNone()&&Fi(i.element,"top").isNone()&&Fi(i.element,"right").isNone()&&Fi(i.element,"bottom").isNone()&&Fi(i.element,"position").is("fixed")&&Ui(i.element,"position")}),i.element)},ws=Object.freeze({__proto__:null,position:function(t,e,n,r,o){bs(t,e,n,r,o,x.none())},positionWithin:bs,positionWithinBounds:ys,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),xs=[je("useFixed",c),Pe("getBounds")],Cs=Fa({fields:xs,name:"positioning",active:qa,apis:ws}),Ss=function(t){Fr(t,Rr());var e=t.components();j(e,Ss)},ks=function(t){var e=t.components();j(e,ks),Fr(t,Nr())},Os=function(t,e){Oo(t.element,e.element)},Ts=function(t,e){var n=t.components();!function(t){j(t.components(),(function(t){return Eo(t.element)})),_o(t.element),t.syncComponents()}(t);var r=Z(n,e);j(r,(function(e){Ss(e),t.getSystem().removeFromWorld(e)})),j(e,(function(e){e.getSystem().isConnected()?Os(t,e):(t.getSystem().addToWorld(e),Os(t,e),Ni(t.element)&&ks(e)),t.syncComponents()}))},_s=function(t,e){Es(t,e,Oo)},Es=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ni(t.element)&&ks(e),t.syncComponents()},As=function(t){Ss(t),Eo(t.element),t.getSystem().removeFromWorld(t)},Ns=function(t){var e=bo(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));As(t),e.each((function(t){t.syncComponents()}))},Rs=function(t){var e=t.components();j(e,As),_o(t.element),t.syncComponents()},Ms=function(t,e){zs(t,e,Oo)},zs=function(t,e,n){n(t,e.element);var r=wo(e.element);j(r,(function(t){e.getByDom(t).each(ks)}))},Ds=function(t){var e=wo(t.element);j(e,(function(e){t.getByDom(e).each(Ss)})),Eo(t.element)},Bs=function(t,e,n,r){n.get().each((function(e){Rs(t)}));var o=e.getAttachPoint(t);_s(o,t);var i=t.getSystem().build(r);return _s(t,i),n.set(i),i},Ps=function(t,e,n,r){var o=Bs(t,e,n,r);return e.onOpen(t,o),o},Is=function(t,e,n){n.get().each((function(r){Rs(t),Ns(t),e.onClose(t,r),n.clear()}))},Ls=function(t,e,n){return n.isOpen()},Hs=function(t,e,n){var r=e.getAttachPoint(t);Bi(t.element,"position",Cs.getMode(r)),function(t,e,n,r){Fi(t.element,e).fold((function(){Io(t.element,n)}),(function(e){zo(t.element,n,e)})),Bi(t.element,e,"hidden")}(t,"visibility",e.cloakVisibilityAttr)},Fs=function(t,e,n){(function(t){return L(["top","left","right","bottom"],(function(e){return Fi(t,e).isSome()}))})(t.element)||Ui(t.element,"position"),function(t,e,n){Bo(t.element,n).fold((function(){return Ui(t.element,e)}),(function(n){return Bi(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Vs=Object.freeze({__proto__:null,cloak:Hs,decloak:Fs,open:Ps,openWhileCloaked:function(t,e,n,r,o){Hs(t,e),Ps(t,e,n,r),o(),Fs(t,e)},close:Is,isOpen:Ls,isPartOf:function(t,e,n,r){return Ls(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Bs(t,e,n,r)}))}}),js=Object.freeze({__proto__:null,events:function(t,e){return $r([Kr(Sr(),(function(n,r){Is(n,t,e)}))])}}),Us=[Ku("onOpen"),Ku("onClose"),_e("isPartOf"),_e("getAttachPoint"),je("cloakVisibilityAttr","data-precloak-visibility")],Ws=Fa({fields:Us,name:"sandboxing",active:js,apis:Vs,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=r("not-implemented");return ui({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(x.none())},set:function(e){t.set(x.some(e))},get:function(){return t.get()}})}})}),qs=r("dismiss.popups"),$s=r("reposition.popups"),Gs=r("mouse.released"),Xs=Qt([je("isExtraPart",c),Ve("fireEventInstead",[je("event",Mr())])]),Ks=function(t){var e,n=ge("Dismissal",Xs,t);return(e={})[qs()]={schema:Qt([_e("target")]),onReceive:function(t,e){Ws.isOpen(t)&&(Ws.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Ws.close(t)}),(function(e){return Fr(t,e.event)})))}},e},Ys=Qt([Ve("fireEventInstead",[je("event",zr())]),Me("doReposition")]),Js=function(t){var e,n=ge("Reposition",Ys,t);return(e={})[$s()]={onReceive:function(t){Ws.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Fr(t,e.event)}))}},e},Qs=function(t,e,n){e.store.manager.onLoad(t,e,n)},Zs=function(t,e,n){e.store.manager.onUnload(t,e,n)},tl=Object.freeze({__proto__:null,onLoad:Qs,onUnload:Zs,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),el=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[ro((function(n,r){Qs(n,t,e)})),oo((function(n,r){Zs(n,t,e)}))]:[Ba(t,e,Qs)];return $r(n)}}),nl=function(){var t=Qe(null);return ui({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},rl=function(){var t=Qe({}),e=Qe({});return ui({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Ot(t.get(),n).orThunk((function(){return Ot(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};j(n,(function(t){i[t.value]=t,Ot(t,"meta").each((function(e){Ot(e,"text").each((function(e){u[e]=t}))}))})),t.set(f(f({},r),i)),e.set(f(f({},o),u))},clear:function(){t.set({}),e.set({})}})},ol=Object.freeze({__proto__:null,memory:nl,dataset:rl,manual:function(){return ui({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),il=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},ul=[Pe("initialValue"),_e("getFallbackEntry"),_e("getDataKey"),_e("setValue"),Zu("manager",{setValue:il,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){il(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:rl})],al=[_e("getValue"),je("setValue",t),Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:t,state:ii.init})],cl=[Pe("initialValue"),Zu("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:nl})],sl=[Ue("store",{mode:"memory"},ve("mode",{memory:cl,manual:al,dataset:ul})),Ku("onSetValue"),je("resetOnDom",!1)],ll=Fa({fields:sl,name:"representing",active:el,apis:tl,extra:{setValueFrom:function(t,e){var n=ll.getValue(e);ll.setValue(t,n)}},state:ol}),fl=function(t,e){return Ye(t,{},V(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,ie(n,n,It(),Yt((function(t){return gt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Je("dump",o)]))},dl=function(t){return t.dump},ml=function(t,e){return f(f({},t.dump),La(e))},gl=fl,hl=ml,pl="placeholder",vl=Et([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),bl=function(t){return Tt(t,"uiType")},yl=function(t,e,n,i){return function(t,e,n,o){return bl(n)&&n.uiType===pl?function(t,e,n,o){return t.exists((function(t){return t!==n.owner}))?vl.single(!0,r(n)):Ot(o,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+vt(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,o):vl.single(!1,r(n))}(t,0,n,i).fold((function(r,o){var u=bl(n)?o(e,n.config,n.validated):o(e),a=Ot(u,"components").getOr([]),c=Y(a,(function(n){return yl(t,e,n,i)}));return[f(f({},u),{components:c})]}),(function(t,r){if(bl(n)){var i=r(e,n.config,n.validated);return n.validated.preprocess.getOr(o)(i)}return r(e)}))},wl=vl.single,xl=vl.multiple,Cl=r(pl),Sl=Et([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),kl=je("factory",{sketch:o}),Ol=je("schema",[]),Tl=_e("name"),_l=ie("pname","pname",Lt((function(t){return"<alloy."+Uo(t.name)+">"})),be()),El=Je("schema",(function(){return[Pe("preprocess")]})),Al=je("defaults",r({})),Nl=je("overrides",r({})),Rl=Zt([kl,Ol,Tl,_l,Al,Nl]),Ml=Zt([kl,Ol,Tl,Al,Nl]),zl=Zt([kl,Ol,Tl,_l,Al,Nl]),Dl=Zt([kl,El,Tl,_e("unit"),_l,Al,Nl]),Bl=function(t){return t.fold(x.some,x.none,x.some,x.some)},Pl=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Il=function(t,e){return function(n){var r=ge("Converting part type",e,n);return t(r)}},Ll=Il(Sl.required,Rl),Hl=Il(Sl.external,Ml),Fl=Il(Sl.optional,zl),Vl=Il(Sl.group,Dl),jl=r("entirety"),Ul=Object.freeze({__proto__:null,required:Ll,external:Hl,optional:Fl,group:Vl,asNamedPart:Bl,name:Pl,asCommon:function(t){return t.fold(o,o,o,o)},original:jl}),Wl=function(t,e,n,r){return Rt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},ql=function(t,e){var n={};return j(e,(function(e){Bl(e).each((function(e){var r=$l(t,e.pname);n[e.name]=function(n){var o=ge("Part: "+e.name+" in "+t,Zt(e.schema),n);return f(f({},r),{config:n,validated:o})}}))})),n},$l=function(t,e){return{uiType:Cl(),owner:t,name:e}},Gl=function(t,e,n){return{uiType:Cl(),owner:t,name:e,config:n,validated:{}}},Xl=function(t){return Y(t,(function(t){return t.fold(x.none,x.some,x.none,x.none).map((function(t){return ze(t.name,t.schema.concat([ta(jl())]))})).toArray()}))},Kl=function(t){return V(t,Pl)},Yl=function(t,e,n){return function(t,e,n){var o={},i={};return j(n,(function(t){t.fold((function(t){o[t.pname]=wl(!0,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];i[t.name]=r(t.factory.sketch(Wl(e,t,n[jl()]),n))}),(function(t){o[t.pname]=wl(!1,(function(e,n,r){return t.factory.sketch(Wl(e,t,n,r))}))}),(function(t){o[t.pname]=xl(!0,(function(e,n,r){var o=e[t.name];return V(o,(function(n){return t.factory.sketch(Rt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:r(o),externals:r(i)}}(0,e,n)},Jl=function(t,e,n){return function(t,e,n,o){var i=wt(o,(function(t,e){return o=t,i=!1,{name:r(n=e),required:function(){return o.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+n);return i=!0,o}};var n,o,i})),u=function(t,e,n,r){return Y(n,(function(n){return yl(t,e,n,r)}))}(t,e,n,i);return yt(i,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),u}(x.some(t),e,e.components,n)},Ql=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Zl=function(t,e,n){return Ql(t,e,n).getOrDie("Could not find part: "+n)},tf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]))})),o},ef=function(t,e){var n=t.getSystem();return wt(e.partUids,(function(t,e){return r(n.getByUid(t))}))},nf=function(t){return vt(t.partUids)},rf=function(t,e,n){var o={},i=e.partUids,u=t.getSystem();return j(n,(function(t){o[t]=r(u.getByUid(i[t]).getOrDie())})),o},of=function(t,e){var n=Kl(e);return jt(V(n,(function(e){return{key:e,value:t+"-"+e}})))},uf=function(t){return ie("partUids","partUids",Ht((function(e){return of(e.uid,t)})),be())},af=Object.freeze({__proto__:null,generate:ql,generateOne:Gl,schemas:Xl,names:Kl,substitutes:Yl,components:Jl,defaultUids:of,defaultUidsSchema:uf,getAllParts:ef,getAllPartNames:nf,getPart:Ql,getPartOrDie:Zl,getParts:tf,getPartsOrDie:rf}),cf=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[ze("parts",t)]:[]).concat([_e("uid"),je("dom",{}),je("components",[]),ta("originalSpec"),je("debug.sketcher",{})]).concat(e)}(r,o);return ge(t+" [SpecSchema]",Qt(i.concat(e)),n)},sf=function(t,e,n,r,o){var i=lf(o),u=Xl(n),a=uf(n),c=cf(t,e,i,u,[a]),s=Yl(0,c,n);return r(c,Jl(t,c,s.internals()),i,s.externals())},lf=function(t){return function(t){return Tt(t,"uid")}(t)?t:f(f({},t),{uid:Yo("uid")})},ff=Qt([_e("name"),_e("factory"),_e("configFields"),je("apis",{}),je("extraApis",{})]),df=Qt([_e("name"),_e("factory"),_e("configFields"),_e("partFields"),je("apis",{}),je("extraApis",{})]),mf=function(t){var e=ge("Sketcher for "+t.name,ff,t),n=wt(e.apis,oi),r=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=lf(r);return n(cf(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},gf=function(t){var e=ge("Sketcher for "+t.name,df,t),n=ql(e.name,e.partFields),r=wt(e.apis,oi),o=wt(e.extraApis,(function(t,e){return ei(t,e)}));return f(f({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return sf(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},hf=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},pf=function(t,e){return t?x.some(e):x.none()},vf=function(t){return"input"===ao(t)&&"radio"!==Do(t,"type")||"textarea"===ao(t)},bf=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),yf=[_e("find")],wf=Fa({fields:yf,name:"composing",apis:bf}),xf=function(t,e,n,r){var o=Fc(t.element,"."+e.highlightClass);j(o,(function(n){L(r,(function(t){return t.element===n}))||(bi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Fr(n,Hr())})))}))},Cf=function(t,e,n,r){xf(t,e,0,[r]),Sf(t,e,n,r)||(vi(r.element,e.highlightClass),e.onHighlight(t,r),Fr(r,Lr()))},Sf=function(t,e,n,r){return yi(r.element,e.highlightClass)},kf=function(t,e,n){return zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Of=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return(r.length>0?x.some(r[r.length-1]):x.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Tf=function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return X(o,(function(t){return yi(t,e.highlightClass)})).bind((function(e){var n=ic(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},_f=function(t,e,n){var r=Fc(t.element,"."+e.itemClass);return hf(V(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ef=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return xf(t,e,0,[])},dehighlight:function(t,e,n,r){Sf(t,e,n,r)&&(bi(r.element,e.highlightClass),e.onDehighlight(t,r),Fr(r,Hr()))},highlight:Cf,highlightFirst:function(t,e,n){kf(t,e).each((function(r){Cf(t,e,n,r)}))},highlightLast:function(t,e,n){Of(t,e).each((function(r){Cf(t,e,n,r)}))},highlightAt:function(t,e,n,r){(function(t,e,n,r){var o=Fc(t.element,"."+e.itemClass);return x.from(o[r]).fold((function(){return ct.error("No element found with index "+r)}),t.getSystem().getByDom)})(t,e,0,r).fold((function(t){throw new Error(t)}),(function(r){Cf(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=_f(t,e);G(o,r).each((function(r){Cf(t,e,n,r)}))},isHighlighted:Sf,getHighlighted:function(t,e,n){return zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:kf,getLast:Of,getPrevious:function(t,e,n){return Tf(t,e,0,-1)},getNext:function(t,e,n){return Tf(t,e,0,1)},getCandidates:_f}),Af=[_e("highlightClass"),_e("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],Nf=Fa({fields:Af,name:"highlighting",apis:Ef}),Rf=[8],Mf=[9],zf=[13],Df=[27],Bf=[32],Pf=[37],If=[38],Lf=[39],Hf=[40],Ff=function(t,e,n){var r=Q(t.slice(0,e)),o=Q(t.slice(e+1));return G(r.concat(o),n)},Vf=function(t,e,n){var r=Q(t.slice(0,e));return G(r,n)},jf=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return G(o.concat(r),n)},Uf=function(t,e,n){var r=t.slice(e+1);return G(r,n)},Wf=function(t){return function(e){var n=e.raw;return I(t,n.which)}},qf=function(t){return function(e){return J(t,(function(t){return t(e)}))}},$f=function(t){return!0===t.raw.shiftKey},Gf=function(t){return!0===t.raw.ctrlKey},Xf=u($f),Kf=function(t,e){return{matches:t,classification:e}},Yf=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Vn(e,t)}))}))||Vr(t,Dr(),{prevFocus:e,newFocus:n})},Jf=function(){var t=function(t){return Xa(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Yf(e,r,o)}}},Qf=function(){var e=function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))};return{get:e,set:function(n,r){var o=e(n);n.getSystem().getByDom(r).fold(t,(function(t){Nf.highlight(n,t)}));var i=e(n);Yf(n,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Bc||(Bc={}));var Zf=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u;return(i=n(t,e,r,o),u=e.event,G(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([je("focusManager",Jf()),Ue("focusInside","onFocus",le((function(t){return I(["onFocus","onEnterOrSpace","onApi"],t)?ct.value(t):ct.error("Invalid value for focusInside")}))),Zu("handler",u),Zu("state",e),Zu("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Bc.OnFocusMode?x.none():o(t).map((function(n){return Kr(hr(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Kr(ur(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=Wf(Bf.concat(zf))(r.event);t.focusInside===Bc.OnEnterOrSpaceMode&&i&&$n(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Kr(ar(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return $r(u.toArray().concat(a))}};return u},td=function(t){var e=[Pe("onEscape"),Pe("onEnter"),je("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),je("firstTabstop",0),je("useTabstopAt",s),Pe("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Du(e,t)})).getOr(e);return ru(n)>0},o=function(t,e,r){(function(t,e){var r=Fc(t.element,e.selector),o=W(r,(function(t){return n(e,t)}));return x.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},u=function(t,e,r,o){var u=Fc(t.element,r.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,r).bind((function(e){return X(u,i(Vn,e)).bind((function(e){return function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?x.some(!0):x.none()}),(function(e){return o.focusManager.set(t,e),x.some(!0)}))}(t,u,e,r,o)}))}))},a=r([Kf(qf([$f,Wf(Mf)]),(function(t,e,n){var r=n.cyclic?Ff:Vf;return u(t,0,n,r)})),Kf(Wf(Mf),(function(t,e,n){var r=n.cyclic?jf:Uf;return u(t,0,n,r)})),Kf(Wf(Df),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Kf(qf([Xf,Wf(zf)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),c=r([]);return Zf(e,ii.init,a,c,(function(){return x.some(o)}))},ed=td(Je("cyclic",c)),nd=td(Je("cyclic",s)),rd=function(t,e,n){return vf(n)&&Wf(Bf)(e.event)?x.none():function(t,e,n){return Ur(t,n,yr()),x.some(!0)}(t,0,n)},od=function(t,e){return x.some(!0)},id=[je("execute",rd),je("useSpace",!1),je("useEnter",!0),je("useControlEnter",!1),je("useDown",!1)],ud=function(t,e,n){return n.execute(t,e,t.element)},ad=Zf(id,ii.init,(function(t,e,n,r){var o=n.useSpace&&!vf(t.element)?Bf:[],i=n.useEnter?zf:[],u=n.useDown?Hf:[],a=o.concat(i).concat(u);return[Kf(Wf(a),ud)].concat(n.useControlEnter?[Kf(qf([Gf,Wf(zf)]),ud)]:[])}),(function(t,e,n,r){return n.useSpace&&!vf(t.element)?[Kf(Wf(Bf),od)]:[]}),(function(){return x.none()})),cd=function(){var t=Qe(x.none());return ui({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(x.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},sd=Object.freeze({__proto__:null,flatgrid:cd,init:function(t){return t.state(t)}}),ld=function(t){return function(e,n,r,o){var i=t(e.element);return gd(i,e,n,r,o)}},fd=function(t,e){var n=vc(t,e);return ld(n)},dd=function(t,e){var n=vc(e,t);return ld(n)},md=function(t){return function(e,n,r,o){return gd(t,e,n,r,o)}},gd=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},hd=md,pd=md,vd=md,bd=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},yd=function(t,e,n){var r=Fc(t,n);return function(t,n){return X(t,(function(t){return Vn(t,e)})).map((function(e){return{index:e,candidates:t}}))}(W(r,bd))},wd=function(t,e){return X(t,(function(t){return Vn(e,t)}))},xd=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?x.some(t[r]):x.none()}))},Cd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=ic(i,o,0,u-1);return x.some({row:e,column:a})}))},Sd=function(t,e,n,r,o){return xd(t,e,r,(function(e,i){var u=ic(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=uc(i,0,a-1);return x.some({row:u,column:c})}))},kd=[_e("selector"),je("execute",rd),Yu("onEscape"),je("captureTab",!1),ea()],Od=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Td=function(t){return function(e,n,r,o){return yd(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},_d=function(t,e,n){return n.captureTab?x.some(!0):x.none()},Ed=Td((function(t,e,n,r){return Cd(t,e,n,r,-1)})),Ad=Td((function(t,e,n,r){return Cd(t,e,n,r,1)})),Nd=Td((function(t,e,n,r){return Sd(t,e,n,r,-1)})),Rd=Td((function(t,e,n,r){return Sd(t,e,n,r,1)})),Md=r([Kf(Wf(Pf),fd(Ed,Ad)),Kf(Wf(Lf),dd(Ed,Ad)),Kf(Wf(If),hd(Nd)),Kf(Wf(Hf),pd(Rd)),Kf(qf([$f,Wf(Mf)]),_d),Kf(qf([Xf,Wf(Mf)]),_d),Kf(Wf(Df),(function(t,e,n){return n.onEscape(t,e)})),Kf(Wf(Bf.concat(zf)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),zd=r([Kf(Wf(Bf),od)]),Dd=Zf(kd,cd,Md,zd,(function(){return x.some(Od)})),Bd=function(t,e,n,r){var o=function(t,e,n){var i,u=ic(e,r,0,n.length-1);return u===t?x.none():(i=n[u],"button"===ao(i)&&"disabled"===Do(i,"disabled")?o(t,u,n):x.from(n[u]))};return yd(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Pd=[_e("selector"),je("getInitial",x.none),je("execute",rd),Yu("onEscape"),je("executeOnMove",!1),je("allowVertical",!0)],Id=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return Du(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Ld=function(t,e,n){e.getInitial(t).orThunk((function(){return zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Hd=function(t,e,n){return Bd(t,n.selector,e,-1)},Fd=function(t,e,n){return Bd(t,n.selector,e,1)},Vd=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Id(e,n,r):x.some(!0)}))}},jd=function(t,e,n){return n.onEscape(t,e)},Ud=r([Kf(Wf(Bf),od)]),Wd=Zf(Pd,ii.init,(function(t,e,n,r){var o=Pf.concat(n.allowVertical?If:[]),i=Lf.concat(n.allowVertical?Hf:[]);return[Kf(Wf(o),Vd(fd(Hd,Fd))),Kf(Wf(i),Vd(dd(Hd,Fd))),Kf(Wf(zf),Id),Kf(Wf(Bf),Id),Kf(Wf(Df),jd)]}),Ud,(function(){return x.some(Ld)})),qd=function(t,e,n){return x.from(t[e]).bind((function(t){return x.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},$d=function(t,e,n,r){var o=t[e].length,i=ic(n,r,0,o-1);return qd(t,e,i)},Gd=function(t,e,n,r){var o=ic(n,r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Xd=function(t,e,n,r){var o=t[e].length,i=uc(n+r,0,o-1);return qd(t,e,i)},Kd=function(t,e,n,r){var o=uc(n+r,0,t.length-1),i=t[o].length,u=uc(e,0,i-1);return qd(t,o,u)},Yd=[ze("selectors",[_e("row"),_e("cell")]),je("cycles",!0),je("previousSelector",x.none),je("execute",rd)],Jd=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return zu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Qd=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Du(r,o.selectors.row).bind((function(t){var e=Fc(t,o.selectors.cell);return wd(e,r).bind((function(e){var r=Fc(n,o.selectors.row);return wd(r,t).bind((function(t){var n=function(t,e){return V(t,(function(t){return Fc(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Zd=Qd((function(t,e,n){return $d(t,e,n,-1)}),(function(t,e,n){return Xd(t,e,n,-1)})),tm=Qd((function(t,e,n){return $d(t,e,n,1)}),(function(t,e,n){return Xd(t,e,n,1)})),em=Qd((function(t,e,n){return Gd(t,n,e,-1)}),(function(t,e,n){return Kd(t,n,e,-1)})),nm=Qd((function(t,e,n){return Gd(t,n,e,1)}),(function(t,e,n){return Kd(t,n,e,1)})),rm=r([Kf(Wf(Pf),fd(Zd,tm)),Kf(Wf(Lf),dd(Zd,tm)),Kf(Wf(If),hd(em)),Kf(Wf(Hf),pd(nm)),Kf(Wf(Bf.concat(zf)),(function(t,e,n){return Xa(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),om=r([Kf(Wf(Bf),od)]),im=Zf(Yd,ii.init,rm,om,(function(){return x.some(Jd)})),um=[_e("selector"),je("execute",rd),je("moveOnTab",!1)],am=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},cm=function(t,e,n){zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},sm=function(t,e,n){return Bd(t,n.selector,e,-1)},lm=function(t,e,n){return Bd(t,n.selector,e,1)},fm=r([Kf(Wf(If),vd(sm)),Kf(Wf(Hf),vd(lm)),Kf(qf([$f,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(sm)(t,e,n,r):x.none()})),Kf(qf([Xf,Wf(Mf)]),(function(t,e,n,r){return n.moveOnTab?vd(lm)(t,e,n,r):x.none()})),Kf(Wf(zf),am),Kf(Wf(Bf),am)]),dm=r([Kf(Wf(Bf),od)]),mm=Zf(um,ii.init,fm,dm,(function(){return x.some(cm)})),gm=[Yu("onSpace"),Yu("onEnter"),Yu("onShiftEnter"),Yu("onLeft"),Yu("onRight"),Yu("onTab"),Yu("onShiftTab"),Yu("onUp"),Yu("onDown"),Yu("onEscape"),je("stopSpaceKeyup",!1),Pe("focusIn")],hm=Zf(gm,ii.init,(function(t,e,n){return[Kf(Wf(Bf),n.onSpace),Kf(qf([Xf,Wf(zf)]),n.onEnter),Kf(qf([$f,Wf(zf)]),n.onShiftEnter),Kf(qf([$f,Wf(Mf)]),n.onShiftTab),Kf(qf([Xf,Wf(Mf)]),n.onTab),Kf(Wf(If),n.onUp),Kf(Wf(Hf),n.onDown),Kf(Wf(Pf),n.onLeft),Kf(Wf(Lf),n.onRight),Kf(Wf(Bf),n.onSpace),Kf(Wf(Df),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Kf(Wf(Bf),od)]:[]}),(function(t){return t.focusIn})),pm=ed.schema(),vm=nd.schema(),bm=Wd.schema(),ym=Dd.schema(),wm=im.schema(),xm=ad.schema(),Cm=mm.schema(),Sm=hm.schema(),km=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:pm,cyclic:vm,flow:bm,flatgrid:ym,matrix:wm,execution:xm,menu:Cm,special:Sm}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return _t(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:sd}),Om=function(t,e,n,r){var o=t.getSystem().build(r);Es(t,o,n)},Tm=function(t,e,n,r){var o=_m(t);G(o,(function(t){return Vn(r.element,t.element)})).each(Ns)},_m=function(t,e){return t.components()},Em=function(t,e,n,r,o){var i=_m(t);return x.from(i[r]).map((function(e){return Tm(t,0,0,e),o.each((function(e){Om(t,0,(function(t,e){!function(t,e,n){xo(t,n).fold((function(){Oo(t,e)}),(function(t){Co(t,e)}))}(t,e,r)}),e)})),e}))},Am=Fa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Om(t,0,Oo,r)},prepend:function(t,e,n,r){Om(t,0,ko,r)},remove:Tm,replaceAt:Em,replaceBy:function(t,e,n,r,o){var i=_m(t);return X(i,r).bind((function(e){return Em(t,0,0,e,o)}))},set:function(t,e,n,r){Ka((function(){var e=V(r,t.getSystem().build);Ts(t,e)}),t.element)},contents:_m})}),Nm=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=$r(e);return Fa({fields:[_e("enabled")],name:t,active:{events:r(n)}})}(t,e),configAsRaw:r({}),initialConfig:{},state:ii}}},Rm=function(t,e){e.ignore||($a(t.element),e.onFocus(t))},Mm=Object.freeze({__proto__:null,focus:Rm,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return function(t){var e=Ti(t).dom;return t.dom===e.activeElement}(t.element)}}),zm=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return ci(n)},events:function(t){return $r([Kr(hr(),(function(e,n){Rm(e,t),n.stop()}))].concat(t.stopMousedown?[Kr(Zn(),(function(t,e){e.event.prevent()}))]:[]))}}),Dm=[Ku("onFocus"),je("stopMousedown",!1),je("ignore",!1)],Bm=Fa({fields:Dm,name:"focusing",active:zm,apis:Mm}),Pm=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Im=function(t,e,n){e.toggleClass.each((function(e){n.get()?vi(t.element,e):bi(t.element,e)}))},Lm=function(t,e,n){Vm(t,e,n,!n.get())},Hm=function(t,e,n){n.set(!0),Im(t,e,n),Pm(t,e,n)},Fm=function(t,e,n){n.set(!1),Im(t,e,n),Pm(t,e,n)},Vm=function(t,e,n,r){(r?Hm:Fm)(t,e,n)},jm=function(t,e,n){Vm(t,e,n,e.selected)},Um=Object.freeze({__proto__:null,onLoad:jm,toggle:Lm,isOn:function(t,e,n){return n.get()},on:Hm,off:Fm,set:Vm}),Wm=Object.freeze({__proto__:null,exhibit:function(){return ci({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Lm,uo((function(t){o(t,n,r)}))),u=Ba(t,e,jm);return $r(K([t.toggleOnExecute?[i]:[],[u]]))}}),qm=function(t,e,n){zo(t.element,"aria-expanded",n)},$m=[je("selected",!1),Pe("toggleClass"),je("toggleOnExecute",!0),Ue("aria",{mode:"none"},ve("mode",{pressed:[je("syncWithExpanded",!1),Zu("update",(function(t,e,n){zo(t.element,"aria-pressed",n),e.syncWithExpanded&&qm(t,0,n)}))],checked:[Zu("update",(function(t,e,n){zo(t.element,"aria-checked",n)}))],expanded:[Zu("update",qm)],selected:[Zu("update",(function(t,e,n){zo(t.element,"aria-selected",n)}))],none:[Zu("update",t)]}))],Gm=Fa({fields:$m,name:"toggling",active:Wm,apis:Um,state:(!1,{init:function(){var t=Qe(false);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(false)},readState:function(){return t.get()}}}})}),Xm=function(){var t=function(t,e){e.stop(),jr(t)};return[Kr(lr(),t),Kr(xr(),t),to(Kn()),to(Zn())]},Km=function(t){return $r(K([t.map((function(t){return uo((function(e,n){t(e),n.stop()}))})).toArray(),Xm()]))},Ym="alloy.item-hover",Jm="alloy.item-focus",Qm=function(t){(Xa(t.element).isNone()||Bm.isFocused(t))&&(Bm.isFocused(t)||Bm.focus(t),Vr(t,Ym,{item:t}))},Zm=function(t){Vr(t,Jm,{item:t})},tg=r(Ym),eg=r(Jm),ng=[_e("data"),_e("components"),_e("dom"),je("hasSubmenu",!1),Pe("toggling"),gl("itemBehaviours",[Gm,Bm,km,ll]),je("ignoreFocus",!1),je("domModification",{}),Zu("builder",(function(t){return{dom:t.dom,domModification:f(f({},t.domModification),{attributes:f(f(f({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:hl(t.itemBehaviours,[t.toggling.fold(Gm.revoke,(function(t){return Gm.config(f({aria:{mode:"checked"}},t))})),Bm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"execution"}),ll.config({store:{mode:"memory",initialValue:t.data}}),Nm("item-type-events",m(Xm(),[Kr(rr(),Qm),Kr(wr(),Bm.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),je("eventOrder",{})],rg=[_e("dom"),_e("components"),Zu("builder",(function(t){return{dom:t.dom,components:t.components,events:$r([eo(wr())])}}))],og=r([Ll({name:"widget",overrides:function(t){return{behaviours:La([ll.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),ig=[_e("uid"),_e("data"),_e("components"),_e("dom"),je("autofocus",!1),je("ignoreFocus",!1),gl("widgetBehaviours",[ll,Bm,km]),je("domModification",{}),uf(og()),Zu("builder",(function(t){var e=Yl(0,t,og()),n=Jl("item-widget",t,e.internals()),r=function(e){return Ql(e,t,"widget").map((function(t){return km.focusIn(t),t}))},o=function(e,n){return vf(n.event.target)?x.none():t.autofocus?(n.setSource(e.element),x.none()):x.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:$r([uo((function(t,e){r(t).each((function(t){e.stop()}))})),Kr(rr(),Qm),Kr(wr(),(function(e,n){t.autofocus?r(e):Bm.focus(e)}))]),behaviours:hl(t.widgetBehaviours,[ll.config({store:{mode:"memory",initialValue:t.data}}),Bm.config({ignore:t.ignoreFocus,onFocus:function(t){Zm(t)}}),km.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Ua(),onLeft:o,onRight:o,onEscape:function(e,n){return Bm.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),x.none()):x.none():(Bm.focus(e),x.some(!0))}})])}}))],ug=ve("type",{widget:ig,item:ng,separator:rg}),ag=r([Vl({factory:{sketch:function(t){var e=ge("menu.spec item",ug,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:f(f({},e),{uid:Yo("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),cg=r([_e("value"),_e("items"),_e("dom"),_e("components"),je("eventOrder",{}),fl("menuBehaviours",[Nf,ll,wf,km]),Ue("movement",{mode:"menu",moveOnTab:!0},ve("mode",{grid:[ea(),Zu("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Zu("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),_e("rowSelector")],menu:[je("moveOnTab",!0),Zu("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Ee("markers",Wu()),je("fakeFocus",!1),je("focusManager",Jf()),Ku("onHighlight")]),sg=r("alloy.menu-focus"),lg=gf({name:"Menu",configFields:cg(),partFields:ag(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.menuBehaviours,[Nf.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),ll.config({store:{mode:"memory",initialValue:t.value}}),wf.config({find:x.some}),km.config(t.movement.config(t,t.movement))]),events:$r([Kr(eg(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Nf.highlight(t,n),e.stop(),Vr(t,sg(),{menu:t,item:n})}))})),Kr(tg(),(function(t,e){var n=e.event.item;Nf.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),fg=function(t,e,n,r){return Ot(n,r).bind((function(r){return Ot(t,r).bind((function(r){var o=fg(t,e,n,r);return x.some([r].concat(o))}))})).getOr([])},dg=function(t){return"prepared"===t.type?x.some(t.menu):x.none()},mg=function(){var t=Qe({}),e=Qe({}),n=Qe({}),r=Qe(x.none()),o=Qe({}),i=function(t){return u(t).bind(dg)},u=function(t){return Ot(e.get(),t)},a=function(e){return Ot(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(f(f({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(x.some(i)),t.set(a),e.set(u),o.set(c);var s=function(t,e){var n={};yt(t,(function(t,e){j(t,(function(t){n[t]=e}))}));var r=e,o=xt(e,(function(t,e){return{k:t,v:e}})),i=wt(o,(function(t,e){return[e].concat(fg(n,r,o,e))}));return wt(n,(function(t){return Ot(i,t).getOr([t])}))}(c,a);n.set(s)},expand:function(e){return Ot(t.get(),e).map((function(t){var r=Ot(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Ot(n.get(),t)},collapse:function(t){return Ot(n.get(),t).bind((function(t){return t.length>1?x.some(t.slice(1)):x.none()}))},lookupMenu:u,lookupItem:a,otherMenus:function(t){var e=o.get();return Z(vt(e),t)},getPrimary:function(){return r.get().bind(i)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(x.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(e,o){var u=W(a(e).toArray(),(function(t){return i(t).isSome()}));return Ot(n.get(),e).bind((function(e){var n=Q(u.concat(e));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return x.none();e.push(r.getOrDie())}return x.some(e)}(Y(n,(function(e,u){return function(e,n,r){return i(e).bind((function(o){return function(e){return St(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))}(e,o,n.slice(0,u+1)).fold((function(){return r.get().is(e)?[]:[x.none()]}),(function(t){return[x.some(t)]}))})))}))}}},gg=dg,hg=r("collapse-item"),pg=mf({name:"TieredMenu",configFields:[Qu("onExecute"),Qu("onEscape"),Ju("onOpenMenu"),Ju("onOpenSubmenu"),Ku("onRepositionMenu"),Ku("onCollapseMenu"),je("highlightImmediately",!0),ze("data",[_e("primary"),_e("menus"),_e("expansions")]),je("fakeFocus",!1),Ku("onHighlight"),Ku("onHover"),$u(),_e("dom"),je("navigateOnHover",!0),je("stayInDom",!1),fl("tmenuBehaviours",[km,Nf,wf,Am]),je("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Qe(x.none()),o=mg(),i=function(t){return ll.getValue(t).value},u=function(e){return wt(t.data.menus,(function(t,e){return Y(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},a=function(t,e){Nf.highlight(t,e),Nf.getHighlighted(e).orThunk((function(){return Nf.getFirst(e)})).each((function(e){Ur(t,e.element,wr())}))},c=function(t,e){return hf(V(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?x.some(t.menu):x.none()}))})))},s=function(e,n,r){var o=c(n,n.otherMenus(r));j(o,(function(n){xi(n.element,[t.markers.backgroundMenu]),t.stayInDom||Am.remove(e,n)}))},l=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=Fc(e.element,"."+t.markers.item),u=W(o,(function(t){return"true"===Do(t,"aria-haspopup")}));return j(u,(function(t){e.getSystem().getByDom(t).each((function(t){var e=i(t);n[e]=t}))})),r.set(x.some(n)),n}))}(e);yt(o,(function(t,e){var r=I(n,e);zo(t.element,"aria-expanded",r)}))},d=function(e,n,r){return x.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return x.none();var i=o.menu,u=c(n,r.slice(1));return j(u,(function(e){vi(e.element,t.markers.backgroundMenu)})),Ni(i.element)||Am.append(e,tu(i)),xi(i.element,[t.markers.backgroundMenu]),a(e,i),s(e,n,r),x.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,u){void 0===u&&(u=n.HighlightSubmenu);var a=i(r);return o.expand(a).bind((function(i){return l(e,i),x.from(i[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ni(s.element)||Am.append(e,tu(s)),t.onOpenSubmenu(e,r,s,Q(i)),u===n.HighlightSubmenu?(Nf.highlightFirst(s),d(e,o,i)):(Nf.dehighlightAll(s),x.some(r))}))}))}))},g=function(e,n){var r=i(n);return o.collapse(r).bind((function(r){return l(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},h=function(e){return function(n,r){return Du(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},p=$r([Kr(sg(),(function(t,e){var n=e.event.item;o.lookupItem(i(n)).each((function(){var n=e.event.menu;Nf.highlight(t,n);var r=i(e.event.item);o.refresh(r).each((function(e){return s(t,o,e)}))}))})),uo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===i(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),ro((function(e,n){(function(e){var n=function(e,n,r){return wt(r,(function(r,o){var i=function(){return lg.sketch(f(f({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Qf():Jf()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()})(e).each((function(n){Am.append(e,tu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&a(e,n)}))}))].concat(t.navigateOnHover?[Kr(tg(),(function(e,r){var u=r.event.item;!function(t,e){var n=i(e);o.refresh(n).bind((function(e){return l(t,e),d(t,o,e)}))}(e,u),m(e,u,n.HighlightParent),t.onHover(e,u)}))]:[])),v=function(t){return Nf.getHighlighted(t).bind(Nf.getHighlighted)},b={collapseMenu:function(t){v(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){a(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return v(e).bind((function(t){var e=i(t),n=kt(o.getMenus()),r=hf(V(n,gg));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return it(e,(function(t){if(!t.getSystem().isConnected())return x.none();var e=Nf.getCandidates(t);return G(e,(function(t){return i(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return x.from(t.components()[0]).filter((function(t){return"menu"===Do(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:ml(t.tmenuBehaviours,[km.config({mode:"special",onRight:h((function(t,e){return vf(e.element)?x.none():m(t,e,n.HighlightSubmenu)})),onLeft:h((function(t,e){return vf(e.element)?x.none():g(t,e)})),onEscape:h((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ur(t,e.element,wr())}))}}),Nf.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),wf.config({find:function(t){return Nf.getHighlighted(t)}}),Am.config({})]),eventOrder:t.eventOrder,apis:b,events:p}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Vt(t,e),expansions:{}}},collapseItem:function(t){return{value:Uo(hg()),meta:{text:t}}}}}),vg=mf({name:"InlineView",configFields:[_e("lazySink"),Ku("onShow"),Ku("onHide"),Fe("onEscape"),fl("inlineBehaviours",[Ws,ll,Wa]),Ve("fireDismissalEventInstead",[je("event",Mr())]),Ve("fireRepositionEventInstead",[je("event",zr())]),je("getRelated",x.none),je("isExtraPart",c),je("eventOrder",x.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return ku(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Ws.openWhileCloaked(e,r,(function(){return Cs.positionWithinBounds(i,n,e,o())})),ll.setValue(e,x.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Ra()},onRtl:function(){return Ma()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return pg.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Ws.close(e),t.onEscape.map((function(t){return t(e)})),x.some(!0)},onExecute:function(){return x.some(!0)},onOpenMenu:function(t,e){Cs.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Cs.position(o,f({anchor:"submenu",item:e},a(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Cs.positionWithinBounds(u,n,e,o()),j(r,(function(t){var e=a(t.triggeringPath);Cs.position(u,f({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})}(t,e,n,r,o);Ws.open(e,i),ll.setValue(e,x.some({mode:"menu",menu:i}))},i=function(e){Ws.isOpen(e)&&ll.getValue(e).each((function(n){switch(n.mode){case"menu":Ws.getState(e).each((function(t){pg.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Cs.positionWithinBounds(r,n.anchor,e,n.getBounds())}}))},u={setContent:function(t,e){Ws.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,x.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,(function(){return x.none()}))},showMenuWithinBounds:o,hide:function(t){Ws.isOpen(t)&&(ll.setValue(t,x.none()),Ws.close(t))},getContent:function(t){return Ws.getState(t)},reposition:i,isOpen:Ws.isOpen};return{uid:t.uid,dom:t.dom,behaviours:ml(t.inlineBehaviours,[Ws.config({isPartOf:function(e,n,r){return Pu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return Pu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),ll.config({store:{mode:"memory",initialValue:x.none()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js(f(f({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),bg=function(t){return t.x},yg=function(t,e){return t.x+t.width/2-e.width/2},wg=function(t,e){return t.x+t.width-e.width},xg=function(t){return t.y},Cg=function(t,e){return t.y+t.height-e.height},Sg=function(t,e,n){return na(wg(t,e),Cg(t,e),n.innerSoutheast(),aa(),da(t,{right:0,bottom:3}),"layout-inner-se")},kg=function(t,e,n){return na(bg(t),Cg(t,e),n.innerSouthwest(),ua(),da(t,{left:1,bottom:3}),"layout-inner-sw")},Og=function(t,e,n){return na(wg(t,e),xg(t),n.innerNortheast(),ia(),da(t,{right:0,top:2}),"layout-inner-ne")},Tg=function(t,e,n){return na(bg(t),xg(t),n.innerNorthwest(),oa(),da(t,{left:1,top:2}),"layout-inner-nw")},_g=function(t,e,n){return na(yg(t,e),xg(t),n.innerNorth(),ca(),da(t,{top:2}),"layout-inner-n")},Eg=function(t,e,n){return na(yg(t,e),Cg(t,e),n.innerSouth(),sa(),da(t,{bottom:3}),"layout-inner-s")},Ag=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ng=mf({name:"Button",factory:function(t){var e=Km(t.action),n=t.dom.tag,r=function(e){return Ot(t.dom,"attributes").bind((function(t){return Ot(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:hl(t.buttonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return f({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[je("uid",void 0),_e("dom"),je("components",[]),gl("buttonBehaviours",[Bm,km]),Pe("action"),Pe("role"),je("eventOrder",{})]}),Rg=function(t){var e=function(t){return void 0!==t.uid}(t)&&_t(t,"uid")?t.uid:Yo("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return f(f({},t),{uid:e})}}},Mg=function(t){return x.from(t()["temporary-placeholder"]).getOr("!not found!")},zg=function(t,e){return x.from(e()[t.toLowerCase()]).getOrThunk((function(){return Mg(e)}))},Dg=function(t,e){return it(t,(function(t){return x.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Mg(e)}))},Bg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Pg=mf({name:"Notification",factory:function(t){var e=Rg({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:La([Am.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Rg({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:La([Am.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Am.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Am.set(r,[Yi(n)])}}},u=K([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return x.from(Bg[t])})).toArray()]),a=Rg(Ng.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),c=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Dg(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:La([Am.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:La([Bm.config({}),Nm("notification-events",[Kr(or(),(function(t){a.getOpt(t).each(Bm.focus)}))])]),components:c.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[a.asSpec()]:[]),apis:i}},configFields:[Pe("level"),_e("progress"),_e("icon"),_e("onAction"),_e("text"),_e("iconProvider"),_e("translationProvider"),Ge("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});var Ig,Lg=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Hg=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Fg=function(t,e,n,r,o){var i=Hg(t,(function(e){return function(t,e){return t.isBlock(e)||I(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return x.from(i.backwards(e,n,r,o))},Vg=function(t,e){return jg(rn(t.selection.getNode())).getOrThunk((function(){var n=tn('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Oo(n,rn(e.extractContents())),e.insertNode(n.dom),bo(n).each((function(t){return t.dom.normalize()})),function(t){return e=Hc,(n=function(t){for(var r=wo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return x.some(i);var u=n(i);if(u.isSome())return u}return x.none()})(t);var e,n}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===ao(t)?1:Ic(t).fold((function(){return wo(t).length}),(function(t){return t.length}))}(e))})),n}))},jg=function(t){return Du(t,"[data-mce-autocompleter]")},Ug=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Wg=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},qg=function(t,e){return t.substring(e.length)},$g=function(t,e,n,r){return void 0===r&&(r=0),jg(rn(e.startContainer)).fold((function(){return function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return x.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Fg(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Wg(o))return x.none();if(o===n)break}return x.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return x.none();var i=Ug(o);return 0!==i.lastIndexOf(n)||qg(i,n).length<r?x.none():x.some({text:qg(i,n),range:o,triggerChar:n})}))}(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Ug(r);return x.some({range:r,text:qg(o,n),triggerChar:n})}))},Gg=tinymce.util.Tools.resolve("tinymce.util.Promise"),Xg=function(t,e){return{container:t,offset:e}},Kg=function(t){if(function(t){return 3===t.nodeType}(t))return Xg(t,t.data.length);var e=t.childNodes;return e.length>0?Kg(e[e.length-1]):Xg(t,e.length)},Yg=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Yg(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Kg(n[n.length-1]):Xg(t,e)},Jg=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=W(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return function(t){return function(e){var n=Yg(e.startContainer,e.startOffset);return!function(t,e){return Fg(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Wg(e)})).isSome()}(t,n)}}(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return x.none();var a=Gg.all(V(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return x.some({lookupData:a,context:n})},Qg=Zt([Ne("type"),He("text")]),Zg=Zt([je("type","autocompleteitem"),je("active",!1),je("disabled",!1),je("meta",{}),Ne("value"),He("text"),He("icon")]),th=Zt([Ne("type"),Ne("ch"),We("minChars",1),je("columns",1),We("maxResults",10),Fe("matches"),Me("fetch"),Me("onAction"),Ke("highlightOn",[],xe)]),eh=[Ge("disabled",!1),He("tooltip"),He("icon"),He("text"),Xe("onSetup",(function(){return t}))],nh=Zt([Ne("type"),Me("onAction")].concat(eh)),rh=function(t){return de("toolbarbutton",nh,t)},oh=[Ge("active",!1)].concat(eh),ih=Zt(oh.concat([Ne("type"),Me("onAction")])),uh=function(t){return de("ToggleButton",ih,t)},ah=[Xe("predicate",(function(){return!1})),$e("scope","node",["node","editor"]),$e("position","selection",["node","selection","line"])],ch=eh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),sh=oh.concat([je("type","contextformbutton"),je("primary",!1),Me("onAction"),Je("original",o)]),lh=eh.concat([je("type","contextformbutton")]),fh=oh.concat([je("type","contextformtogglebutton")]),dh=ve("type",{contextformbutton:ch,contextformtogglebutton:sh}),mh=Zt([je("type","contextform"),Xe("initValue",(function(){return""})),He("label"),Be("commands",dh),Ie("launch",ve("type",{contextformbutton:lh,contextformtogglebutton:fh}))].concat(ah)),gh=Zt([je("type","contexttoolbar"),Ne("items")].concat(ah));!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ig||(Ig={}));var hh,ph=Ig,vh="tox-menu-nav__js",bh="tox-collection__item",yh={normal:vh,color:"tox-swatch"},wh="tox-collection__item--enabled",xh="tox-collection__item-label",Ch="tox-collection__item-caret",Sh="tox-collection__item--active",kh="tox-collection__item-container",Oh="tox-collection__item-container--row",Th=function(t){return Ot(yh,t).getOr(vh)},_h=function(t){return"color"===t?"tox-swatches":"tox-menu"},Eh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:_h(t),tieredMenu:"tox-tiered-menu"}},Ah=function(t){var e=Eh(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Th(t)}},Nh=function(t,e,n){var r=Eh(n);return{tag:"div",classes:K([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Rh=[lg.parts.items({})],Mh=function(t,e,n){var r=Eh(n);return{dom:{tag:"div",classes:K([[r.tieredMenu]])},markers:Ah(n)}},zh=function(t,e){return function(n){var r=F(n,e);return V(r,(function(e){return{dom:t,components:e}}))}},Dh=function(t,e){var n=[],r=[];return j(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Tt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),V(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Bh=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[lg.parts.items({preprocess:function(n){return"auto"!==t&&t>1?zh({tag:"div",classes:["tox-collection__group"]},t)(n):Dh(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ph=function(t){return L(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Ih=function(t){return console.error(he(t)),console.log(t),x.none()},Lh=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[lg.parts.items({preprocess:function(t){return Dh(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},Hh=function(t,e,n,r,i){var u;return"color"===i?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[lg.parts.items({preprocess:"auto"!==t?zh({tag:"div",classes:["tox-swatches__row"]},t):o})]}]}}(r)).dom,components:u.components,items:n}:"normal"===i&&"auto"===r?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"normal"===i&&1===r?{value:t,dom:(u=Bh(1,n)).dom,components:u.components,items:n}:"normal"===i?{value:t,dom:(u=Bh(r,n)).dom,components:u.components,items:n}:"listpreview"===i&&"auto"!==r?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[lg.parts.items({preprocess:zh({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:u.components,items:n}:{value:t,dom:Nh(e,r,i),components:Rh,items:n}},Fh=[Ne("type"),Ne("src"),He("alt"),Ke("classes",[],xe)],Vh=Zt(Fh),jh=[Ne("type"),Ne("text"),He("name"),Ke("classes",["tox-collection__item-label"],xe)],Uh=Zt(jh),Wh=se((function(){return pe("type",{cardimage:Vh,cardtext:Uh,cardcontainer:qh})})),qh=Zt([Ne("type"),qe("direction","horizontal"),qe("align","left"),qe("valign","middle"),Be("items",Wh)]),$h=[Ge("disabled",!1),He("text"),He("shortcut"),ie("value","value",Lt((function(){return Uo("menuitem-value")})),be()),je("meta",{})],Gh=Zt([Ne("type"),He("label"),Be("items",Wh),Xe("onSetup",(function(){return t})),Xe("onAction",t)].concat($h)),Xh=Zt([Ne("type"),Ge("active",!1),He("icon")].concat($h)),Kh=Zt([Ne("type"),Re("fancytype",["inserttable","colorswatch"]),Xe("onAction",t)]),Yh=Zt([Ne("type"),Xe("onSetup",(function(){return t})),Xe("onAction",t),He("icon")].concat($h)),Jh=Zt([Ne("type"),Me("getSubmenuItems"),Xe("onSetup",(function(){return t})),He("icon")].concat($h)),Qh=Zt([Ne("type"),He("icon"),Ge("active",!1),Xe("onSetup",(function(){return t})),Me("onAction")].concat($h)),Zh=function(t,e,n){var r=Fc(t.element,"."+n);if(r.length>0){var o=X(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return x.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return x.none()},tp=function(t){return function(t,e){return La([Nm(t,e)])}(Uo("unnamed-events"),t)},ep=[_e("lazySink"),_e("tooltipDom"),je("exclusive",!0),je("tooltipComponents",[]),je("delay",300),$e("mode","normal",["normal","follow-highlight"]),je("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:r([ka,Sa,ya,xa,wa,Ca]),onRtl:r([ka,Sa,ya,xa,wa,Ca])}}})),Ku("onHide"),Ku("onShow")],np=Object.freeze({__proto__:null,init:function(){var t=Qe(x.none()),e=Qe(x.none()),n=function(){t.get().each((function(t){clearTimeout(t)}))},o=r("not-implemented");return ui({getTooltip:function(){return e.get()},isShowing:function(){return e.get().isSome()},setTooltip:function(t){e.set(x.some(t))},clearTooltip:function(){e.set(x.none())},clearTimer:n,resetTimer:function(e,r){n(),t.set(x.some(setTimeout((function(){e()}),r)))},readState:o})}}),rp=Uo("tooltip.exclusive"),op=Uo("tooltip.show"),ip=Uo("tooltip.hide"),up=function(t,e,n){t.getSystem().broadcastOn([rp],{})},ap=Object.freeze({__proto__:null,hideAllExclusive:up,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Am.set(t,r)}))}}),cp=Fa({fields:ep,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Ns(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return $r(K([[Kr(op,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){up(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:$r("normal"===t.mode?[Kr(rr(),(function(t){Fr(n,op)})),Kr(er(),(function(t){Fr(n,ip)}))]:[]),behaviours:La([Am.config({})])});e.setTooltip(o),_s(r,o),t.onShow(n,o),Cs.position(r,t.anchor(n),o)}}(n)}),t.delay)})),Kr(ip,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Kr(br(),(function(t,e){var r=e;r.universal||I(r.channels,rp)&&n(t)})),oo((function(t){n(t)}))],"normal"===t.mode?[Kr(or(),(function(t){Fr(t,op)})),Kr(pr(),(function(t){Fr(t,ip)})),Kr(rr(),(function(t){Fr(t,op)})),Kr(er(),(function(t){Fr(t,ip)}))]:[Kr(Lr(),(function(t,e){Fr(t,op)})),Kr(Hr(),(function(t){Fr(t,ip)}))]]))}}),state:np,apis:ap}),sp=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),lp=tinymce.util.Tools.resolve("tinymce.util.I18n"),fp=["input","button","textarea","select"],dp=function(t,e,n){(e.disabled()?bp:yp)(t,e)},mp=function(t,e){return!0===e.useNative&&I(fp,ao(t.element))},gp=function(t){zo(t.element,"disabled","disabled")},hp=function(t){Io(t.element,"disabled")},pp=function(t){zo(t.element,"aria-disabled","true")},vp=function(t){zo(t.element,"aria-disabled","false")},bp=function(t,e,n){e.disableClass.each((function(e){vi(t.element,e)})),(mp(t,e)?gp:pp)(t),e.onDisabled(t)},yp=function(t,e,n){e.disableClass.each((function(e){bi(t.element,e)})),(mp(t,e)?hp:vp)(t),e.onEnabled(t)},wp=function(t,e){return mp(t,e)?function(t){return Po(t.element,"disabled")}(t):function(t){return"true"===Do(t.element,"aria-disabled")}(t)},xp=Object.freeze({__proto__:null,enable:yp,disable:bp,isDisabled:wp,onLoad:dp,set:function(t,e,n,r){(r?bp:yp)(t,e)}}),Cp=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return $r([Gr(yr(),(function(e,n){return wp(e,t)})),Ba(t,e,dp)])}}),Sp=[Xe("disabled",c),je("useNative",!0),Pe("disableClass"),Ku("onDisabled"),Ku("onEnabled")],kp=Fa({fields:Sp,name:"disabling",active:Cp,apis:xp}),Op=tinymce.util.Tools.resolve("tinymce.EditorManager"),Tp=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},_p=function(t){return t.getParam("width",sp.DOM.getStyle(t.getElement(),"width"))},Ep=function(t){return x.from(t.getParam("min_width")).filter(R)},Ap=function(t){return x.from(t.getParam("min_height")).filter(R)},Np=function(t){return x.from(t.getParam("max_width")).filter(R)},Rp=function(t){return x.from(t.getParam("max_height")).filter(R)},Mp=function(t){return!1!==t.getParam("menubar",!0,"boolean")},zp=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=k(e),o=T(e)&&e.length>0;return!Bp(t)&&(o||r||n)},Dp=function(t){var e=H(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=W(e,(function(t){return"string"==typeof t}));return n.length>0?x.some(n):x.none()},Bp=function(t){return Dp(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),(function(){return!0}))};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(hh||(hh={}));var Pp,Ip=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Pp||(Pp={}));var Lp,Hp,Fp=function(t){return t.getParam("toolbar_location",Pp.auto,"string")},Vp=function(t){return Fp(t)===Pp.bottom},jp=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?zu(Ri(),e):x.none()},Up=function(t){return t.inline&&jp(t).isSome()},Wp=function(t){return jp(t).getOrThunk((function(){return _i(Ti(rn(t.getElement())))}))},qp=function(t){return t.inline&&!Mp(t)&&!zp(t)&&!Bp(t)},$p=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Up(t)&&!qp(t)},Gp=function(t){var e=t.getParam("menu");return e?wt(e,(function(t){return f(f({},t),{items:t.items})})):{}},Xp=function(t){return t.getParam("menubar")},Kp=function(t){return t.getParam("anchor_top","#top")},Yp=function(t){return t.getParam("anchor_bottom","#bottom")},Jp="silver.readonly",Qp=Zt([("readonly",Ee("readonly",Ce))]),Zp=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([qs()],{target:n}),t.uiMothership.broadcastOn([qs()],{target:n})),t.mothership.broadcastOn([Jp],{readonly:e}),t.uiMothership.broadcastOn([Jp],{readonly:e})},tv=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Zp(e,!0)})),t.on("SwitchMode",(function(){return Zp(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},ev=function(){var t;return Wa.config({channels:(t={},t[Jp]={schema:Qp,onReceive:function(t,e){kp.set(t,e.readonly)}},t)})},nv=function(t){return kp.config({disabled:t})},rv=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},ov=function(t){return kp.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},iv=function(t,e){var n=t.getApi(e);return function(t){t(n)}},uv=function(t,e){return ro((function(n){iv(t,n)((function(n){var r=t.onSetup(n);null!=r&&e.set(r)}))}))},av=function(t,e){return oo((function(n){return iv(t,n)(e.get())}))},cv=function(t,e){return uo((function(n,r){iv(t,n)(t.onAction),t.triggersSubmenu||e!==ph.CLOSE_ON_EXECUTE||(Fr(n,Sr()),r.stop())}))},sv=((Lp={})[yr()]=["disabling","alloy.base.behaviour","toggling","item-events"],Lp),lv=function(t){return Y(t,(function(t){return t.toArray()}))},fv=function(e,n,r,o){var i,u=Qe(t);return{type:"item",dom:n.dom,components:lv(n.optComponents),data:e.data,eventOrder:sv,hasSubmenu:e.triggersSubmenu,itemBehaviours:La([Nm("item-events",[cv(e,r),uv(e,u),av(e,u)]),(i=function(){return e.disabled||o.isDisabled()},kp.config({disabled:i,disableClass:"tox-collection__item--state-disabled"})),ev(),Am.config({})].concat(e.itemBehaviours))}},dv=function(t){return{value:t.value,meta:f({text:t.text.getOr("")},t.meta)}},mv=tinymce.util.Tools.resolve("tinymce.Env"),gv=function(t){var e=mv.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=V(n,(function(t){var n=t.toLowerCase().trim();return Tt(e,n)?e[n]:t}));return mv.mac?r.join(""):r.join("+")},hv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},pv=function(t){return{dom:{tag:"div",classes:[xh]},components:[Yi(lp.translate(t))]}},vv=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},bv=function(t,e){return{dom:{tag:"div",classes:[xh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(lp.translate(e))]}]}},yv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:gv(t)}}},wv=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:zg("checkmark",t)}}},xv=function(t,e){var n=e.map((function(t){return{attributes:{title:lp.translate(t)}}})).getOr({});return f({tag:"div",classes:[vh,bh].concat(t?["tox-collection__item-icon-rtl"]:[])},n)},Cv=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Sv=["list-bull-circle","list-bull-default","list-bull-square"],kv=function(t,e,n,r){void 0===r&&(r=x.none());var o,u=lp.isRtl()&&t.iconContent.exists((function(t){return I(Sv,t)})),a=(o=t.iconContent,o.map((function(t){return lp.isRtl()&&I(Cv,t)?t+"-rtl":t}))).map((function(t){return function(t,e,n){return x.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Mg(e)}))}(t,e.icons,r)})),c=x.from(t.meta).fold((function(){return pv}),(function(t){return Tt(t,"style")?i(bv,t.style):pv}));return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=n.getOr(""),i={tag:"div",attributes:t.map((function(t){return{title:r.translate(t)}})).getOr({}),classes:["tox-swatch"]},f(f({},i),"custom"===e?{tag:"button",classes:m(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:m(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:f(f({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,a,e):function(t,e,n,r,o){var i=n?e.or(x.some("")).map(hv):x.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return x.some(vv(t,[xh]))}));return{dom:xv(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(yv),u,t.caret]}}(t,a,n,c,u)},Ov=function(t,e){return Ot(t,"tooltipWorker").map((function(t){return[cp.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:fc}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){cp.setComponents(e,[Ji({element:rn(t)})])}))}})]})).getOr([])},Tv=function(t,e){var n=function(t){return sp.DOM.encode(t)}(lp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},_v=ql("item-widget",og()),Ev=function(t){return{value:t}},Av=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Nv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Rv=function(t){return Av.test(t)||Nv.test(t)},Mv=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},zv=function(t){var e=Mv(t.red)+Mv(t.green)+Mv(t.blue);return Ev(e)},Dv=Math.min,Bv=Math.max,Pv=Math.round,Iv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Lv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Hv=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Fv=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Vv=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Bv(0,Dv(i,1)),u=Bv(0,Dv(u,1)),0===i)return e=n=r=Pv(255*u),Hv(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Pv(255*(e+l)),n=Pv(255*(n+l)),r=Pv(255*(r+l)),Hv(e,n,r,1)},jv=function(t){var e,n,r=(e=function(t){return{value:t.value.replace(Av,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),null===(n=Nv.exec(e.value))?["FFFFFF","FF","FF","FF"]:n),o=parseInt(r[1],16),i=parseInt(r[2],16),u=parseInt(r[3],16);return Hv(o,i,u,1)},Uv=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Hv(o,i,u,a)},Wv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},qv=Hv(255,0,0,1),$v=function(t,e){return t.fire("ResizeContent",e)},Gv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Xv="tinymce-custom-colors",Kv="choiceitem",Yv=[{type:Kv,text:"Light Green",value:"#BFEDD2"},{type:Kv,text:"Light Yellow",value:"#FBEEB8"},{type:Kv,text:"Light Red",value:"#F8CAC6"},{type:Kv,text:"Light Purple",value:"#ECCAFA"},{type:Kv,text:"Light Blue",value:"#C2E0F4"},{type:Kv,text:"Green",value:"#2DC26B"},{type:Kv,text:"Yellow",value:"#F1C40F"},{type:Kv,text:"Red",value:"#E03E2D"},{type:Kv,text:"Purple",value:"#B96AD9"},{type:Kv,text:"Blue",value:"#3598DB"},{type:Kv,text:"Dark Turquoise",value:"#169179"},{type:Kv,text:"Orange",value:"#E67E23"},{type:Kv,text:"Dark Red",value:"#BA372A"},{type:Kv,text:"Dark Purple",value:"#843FA1"},{type:Kv,text:"Dark Blue",value:"#236FA1"},{type:Kv,text:"Light Gray",value:"#ECF0F1"},{type:Kv,text:"Medium Gray",value:"#CED4D9"},{type:Kv,text:"Gray",value:"#95A5A6"},{type:Kv,text:"Dark Gray",value:"#7E8C8D"},{type:Kv,text:"Navy Blue",value:"#34495E"},{type:Kv,text:"Black",value:"#000000"},{type:Kv,text:"White",value:"#ffffff"}],Jv=function(t){void 0===t&&(t=10);var e,n=Gv.getItem(Xv),r=k(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=P(t,e);return-1===n?x.none():x.some(n)})(o,e).each(i),o.unshift(e),o.length>t&&o.pop(),Gv.setItem(Xv,JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),Qv=function(t){return!1!==t.getParam("custom_colors")},Zv=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u<t.length;u+=2)e.push({text:t[u+1],value:i(t[u]),type:"choiceitem"});return e}(e):Yv},tb=function(t){Jv.add(t)},eb=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,(e=Zv(t).length,Math.max(5,Math.ceil(Math.sqrt(e)))));var e},nb=function(t,e,n,r){"custom"===n?cb(t)((function(n){n.each((function(n){tb(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},rb=function(t,e){return t.concat(V(Jv.state(),(function(t){return{type:Kv,text:t,value:t}})).concat(function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]}(e)))},ob=function(t,e){return function(n){n(rb(t,e))}},ib=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},ub=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return x.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return function(t){if("transparent"===t)return x.some(Hv(0,0,0,0));var e=Iv.exec(t);if(null!==e)return x.some(Uv(e[1],e[2],e[3],"1"));var n=Lv.exec(t);return null!==n?x.some(Uv(n[1],n[2],n[3],n[4])):x.none()}(t).map((function(t){var n=zv(t).value;return ln(e.toLowerCase(),n)}))})).getOr(!1)},columns:eb(t),fetch:ob(Zv(t),Qv(t)),onAction:function(e){null!==o.get()&&nb(t,n,o.get(),(function(){}))},onItemAction:function(r,i){nb(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&ib(n,e,o.get());var r=function(t){t.name===e&&ib(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},ab=function(e,n,r,o){e.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){nb(e,r,n.value,t)}}]}})},cb=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(x.from(n.colorpicker)),e.close()}}(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(x.none())}})}},sb=function(t,e,n,r,o,i,u,a){var c=Ph(e),s=lb(e,n,r,"color"!==o?"normal":"color",i,u,a);return Hh(t,c,s,r,o)},lb=function(t,e,n,r,o,i,u){return hf(V(t,(function(a){return"choiceitem"===a.type?(c=a,de("choicemenuitem",Xh,c)).fold(Ih,(function(c){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:n,textContent:e?t.text:x.none(),htmlContent:x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:x.none(),checkMark:e?x.some(wv(u.icons)):x.none(),caret:x.none(),value:t.value},u,a);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,Ph(t)))})):x.none();var c})))},fb=function(t,e){var n=Ah(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},db=Uo("cell-over"),mb=Uo("cell-execute"),gb=function(t,e,n){var r,o=function(n){return Vr(n,mb,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Zi({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:La([Nm("insert-table-picker-cell",[Kr(rr(),Bm.focus),Kr(yr(),o),Kr(lr(),i),Kr(xr(),i)]),Gm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Bm.config({onFocus:function(n){return Vr(n,db,{row:t,col:e})}})])})},hb=function(t){return Y(t,(function(t){return V(t,tu)}))},pb=function(t,e){return Yi(e+1+"x"+(t+1))},vb={inserttable:function(t){var e=Uo("size-label"),n=function(t,e,n){for(var r=[],o=0;o<10;o++){for(var i=[],u=0;u<10;u++)i.push(gb(o,u,t));r.push(i)}return r}(e),r=Rg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Yi("0x0")],behaviours:La([Am.config({})])});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:hb(n).concat(r.asSpec()),behaviours:La([Nm("insert-table-picker",[Zr(db,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<10;i++)for(var u=0;u<10;u++)Gm.set(t[i][u],i<=e&&u<=n)}(n,i,u),Am.set(r.get(t),[pb(i,u)])})),Zr(mb,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Fr(e,Sr())}))]),km.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=rb(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o="color",i=sb(Uo("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),u=f(f({},i),{markers:Ah(o),movement:fb(r,o)});return{type:"widget",data:{value:Uo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[_v.widget(lg.sketch(u))]}}},bb=function(t,e){return V(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Oh,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[kh,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,bb(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return I(e.cardText.highlightOn,t)}))?x.from(e.cardText.matchText).getOr(""):"";return vv(Tv(t.text,n),t.classes)}}))},yb=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:f({tag:"div",classes:[bh,"tox-collection__group-heading"]},e),components:[]}};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Hp||(Hp={}));var wb=function(e,n,r,o,i){var u,a=r.shared.providers,c=function(t){return i?f(f({},t),{shortcut:x.none(),icon:t.text.isSome()?x.none():t.icon}):t};switch(e.type){case"menuitem":return(u=e,de("menuitem",Yh,u)).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,caret:x.none(),checkMark:x.none(),shortcutContent:t.shortcut},n,r);return fv({data:dv(t),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)}(c(t),n,a,o))}));case"nestedmenuitem":return function(t){return de("nestedmenuitem",Jh,t)}(e).fold(Ih,(function(e){return x.some(function(e,n,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var u,a=i?(u=r.icons,{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-down",u)}}):function(t){return{dom:{tag:"div",classes:[Ch],innerHtml:zg("chevron-right",t)}}}(r.icons),c=kv({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:x.none(),ariaLabel:e.text,caret:x.some(a),checkMark:x.none(),shortcutContent:e.shortcut},r,o);return fv({data:dv(e),getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},disabled:e.disabled,onAction:t,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,r)}(c(e),n,a,o,i))}));case"togglemenuitem":return function(t){return de("togglemenuitem",Qh,t)}(e).fold(Ih,(function(t){return x.some(function(t,e,n,r){void 0===r&&(r=!0);var o=kv({iconContent:t.icon,textContent:t.text,htmlContent:x.none(),ariaLabel:t.text,checkMark:x.some(wv(n.icons)),caret:x.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Rt(fv({data:dv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:wh,toggleOnExecute:!1,selected:t.active}})}(c(t),n,a,o))}));case"separator":return function(t){return de("separatormenuitem",Qg,t)}(e).fold(Ih,(function(t){return x.some(yb(t))}));case"fancymenuitem":return function(t){return de("fancymenuitem",Kh,t)}(e).fold(Ih,(function(t){return function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?x.some(t[e]):x.none()}(vb,t.fancytype).map((function(n){return n(t,e)}))}(c(t),r)}));default:return console.error("Unknown item in general menu",e),x.none()}},xb=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Ph(t);return hf(V(t,(function(t){switch(t.type){case"separator":return(r=t,de("Autocompleter.Separator",Qg,r)).fold(Ih,(function(t){return x.some(yb(t))}));case"cardmenuitem":return function(t){return de("cardmenuitem",Gh,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r){var o={dom:xv(!1,t.label),optComponents:[x.some({dom:{tag:"div",classes:[kh,Oh]},components:bb(t.items,r)})]};return fv({data:dv(f({text:x.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){kp.set(t,e),j(Fc(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(kp)&&kp.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:x.from(r.itemBehaviours).getOr([])},o,e,n.providers)}(f(f({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Ov(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return de("Autocompleter.Item",Zg,t)}(t).fold(Ih,(function(t){return x.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=kv({presets:r,textContent:x.none(),htmlContent:n?t.text.map((function(t){return Tv(t,e)})):x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:x.none(),checkMark:x.none(),caret:x.none(),value:t.value},u.providers,a,t.icon);return fv({data:dv(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:Ov(t.meta,u)},c,i,u.providers)}(t,e,a,"normal",n,o,i,c))}))}var r})))},Cb=function(t,e,n,r,o){var i=Ph(e),u=hf(V(e,(function(t){var e=function(t){return wb(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(f(f({},t),{disabled:!0})):e(t)})));return(o?Lh:Hh)(t,i,u,1,"normal")},Sb=function(t){return pg.singleData(t.value,t)},kb=function(t,e){var n=Qe(x.none()),r=Qe(!1),o=Zi(vg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissAutocompleter",[Kr(Mr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&vg.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));jg(e.getOr(rn(t.selection.getNode()))).each(Ao),u(),n.set(x.none()),r.set(!1)}},c=zt((function(){return function(t){var e,n,r=t.ui.registry.getAll().popups,o=wt(r,(function(t){return(e=t,de("Autocompleter",th,e)).fold((function(t){throw new Error(he(t))}),(function(t){return t}));var e})),i=(e=Ct(o,(function(t){return t.ch})),n={},j(e,(function(t){n[t]={}})),vt(n)),u=kt(o);return{dataset:o,triggerChars:i,lookupByChar:function(t){return W(u,(function(e){return e.ch===t}))}}}(t)})),s=function(l){(function(e){return n.get().map((function(n){return $g(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Jg(t,c,n,e)}))})).getOrThunk((function(){return function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return it(n.triggerChars,(function(n){return $g(t,e,n)}))}(t.dom,r,n).bind((function(n){return Jg(t,e,n)}))}(t,c)}))})(l).fold(a,(function(c){!function(e){if(!i()){var o=Vg(t,e.range);n.set(x.some({triggerChar:e.triggerChar,element:o,matchLength:e.text.length})),r.set(!1)}}(c.context),c.lookupData.then((function(i){n.get().map((function(n){var l,f,d,m=c.context;if(n.triggerChar===m.triggerChar){var g=(l=m.triggerChar,d=it(f=i,(function(t){return x.from(t.columns)})).getOr(1),Y(f,(function(n){var o=n.items;return xb(o,n.matchText,(function(e,o){var i=t.selection.getRng();$g(t.dom,i,l).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),s(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,ph.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?function(e,n,r,i){e.matchLength=n.text.length;var u=it(r,(function(t){return x.from(t.columns)})).getOr(1);vg.showAt(o,{anchor:"node",root:rn(t.getBody()),node:x.from(e.element)},lg.sketch(function(t,e,n,r){var o=n===Hp.ContentFocus?Qf():Jf(),i=fb(e,r),u=Ah(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===Hp.ContentFocus,focusManager:o,menuBehaviours:tp("auto"!==e?[]:[ro((function(t,e){Zh(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;km.setGridSize(t,r,n)}))}))])}}(Hh("autocompleter-value",!0,i,u,"normal"),u,Hp.ContentFocus,"normal"))),vg.getContent(o).each(Nf.highlightFirst)}(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},l={onKeypress:Lg((function(t){27!==t.which&&s()}),50),cancelIfNecessary:a,isMenuOpen:function(){return vg.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return vg.getContent(o)}};!1===t.hasPlugin("rtc")&&function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Vr(t,ur(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Nf.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(jr),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Nf.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&jg(rn(e.element)).isNone()&&t.cancelIfNecessary()}))}(l,t)},Ob=s,Tb=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!1)}(t,e,Ob,n)},_b=function(t,e,n){return function(t,e,n,r){return gu(t,e,n,r,!0)}(t,e,Ob,n)},Eb=mu,Ab=function(t,e,n){return Du(t,e,n).isSome()};function Nb(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}}var Rb=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?x.none():x.some(e.touches[0])},Mb=function(){return Ln().browser.isFirefox()},zb=Qt([Me("triggerEvent"),je("stopBackspace",!0)]),Db=function(t,e){var n=ge("Getting GUI events settings",zb,e),r=function(t){var e=Qe(x.none()),n=Qe(!1),r=Nb((function(e){t.triggerEvent(Cr(),e),n.set(!0)}),400),o=jt([{key:Kn(),value:function(t){return Rb(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(x.some(i))})),x.none()}},{key:Yn(),value:function(t){return r.cancel(),Rb(t).each((function(t){e.get().each((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(x.none())}))})),x.none()}},{key:Jn(),value:function(o){return r.cancel(),e.get().filter((function(t){return Vn(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(xr(),o)}))}}]);return{fireIfReady:function(t,e){return Ot(o,e).bind((function(e){return e(t)}))}}}(n),o=V(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return Tb(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Qe(x.none()),u=Tb(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(x.some(setTimeout((function(){n.triggerEvent(vr(),t)}),0)))})),a=Tb(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===Rf[0]&&!I(["input","textarea"],ao(t.target))&&!Ab(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Mb()?_b(t,"focus",e):Tb(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Qe(x.none()),l=function(t,e){return Mb()?_b(t,"blur",e):Tb(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(x.some(setTimeout((function(){n.triggerEvent(pr(),t)}),0)))}));return{unbind:function(){j(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.get().each(clearTimeout),s.get().each(clearTimeout)}}},Bb=function(t,e){var n=Ot(t,"target").getOr(e);return Qe(n)},Pb=Et([{stopped:[]},{resume:["element"]},{complete:[]}]),Ib=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=Qe(!1),r=Qe(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),Pb.complete()}),(function(t){var n=t.descHandler;return si(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Pb.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Pb.complete()):bo(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Pb.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Pb.resume(r)}))}))},Lb=function(t,e,n,r,o,i){return Ib(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return Lb(t,e,n,r,o,i)}),(function(){return!1}))},Hb=function(t,e,n,r,o){var i=Bb(n,r);return Lb(t,e,n,r,i,o)};function Fb(){var t,e=(t={},{registerId:function(e,n,r){yt(r,(function(r,o){var u=void 0!==t[o]?t[o]:{};u[n]=function(t,e){return{cHandler:i.apply(void 0,[t.handler].concat(e)),purpose:t.purpose}}(r,e),t[o]=u}))},unregisterId:function(e){yt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return Ot(t,e).map((function(t){return Ct(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Ot(t,n);return qn(r,(function(t){return function(t,e){return Ko(e).fold((function(){return x.none()}),(function(n){return t.bind((function(t){return Ot(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}),n={},r=function(t){Ko(t.element).each((function(t){delete n[t],e.unregisterId(t)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(t){var o=function(t){var e=t.element;return Ko(e).fold((function(){return function(t,e){var n=Uo($o+"uid-");return Xo(e,n),n}(0,t.element)}),(function(t){return t}))}(t);_t(n,o)&&function(t,e){var o=n[e];if(o!==t)throw new Error('The tagId "'+e+'" is already used by: '+Ho(o.element)+"\nCannot use it for: "+Ho(t.element)+"\nThe conflicting element is"+(Ni(o.element)?" ":" not ")+"already in the DOM");r(t)}(t,o);var i=[t];e.registerId(i,o,t.events),n[o]=t},unregister:r,getById:function(t){return Ot(n,t)}}}var Vb=mf({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=d(e,["attributes"]);return{uid:t.uid,dom:f({tag:"div",attributes:f({role:"presentation"},n)},r),components:t.components,behaviours:dl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[je("components",[]),fl("containerBehaviours",[]),je("events",{}),je("domModification",{}),je("eventOrder",{})]}),jb=function(e){var n=function(t){return bo(e.element).fold((function(){return!0}),(function(e){return Vn(t,e)}))},o=Fb(),i=function(t,e){return o.find(n,t,e)},u=Db(e.element,{triggerEvent:function(t,e){return Fu(t,e.target,(function(n){return function(t,e,n,r){return Hb(t,e,n,n.target,r)}(i,t,e,n)}))}}),l={debugInfo:r("real"),triggerEvent:function(t,e,n){Fu(t,e,(function(r){return Hb(i,t,n,e,r)}))},triggerFocus:function(e,n){Ko(e).fold((function(){$a(e)}),(function(r){Fu(hr(),e,(function(r){return function(t,e,n,r,o){var i=Bb(n,r);Ib(t,e,n,r,i,o)}(i,hr(),{originator:n,kill:t,prevent:t,target:e},e,r),!1}))}))},triggerEscape:function(t,e){l.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return y(t)},getByDom:function(t){return w(t)},build:Zi,addToGui:function(t){m(t)},removeFromGui:function(t){g(t)},addToWorld:function(t){f(t)},removeFromWorld:function(t){d(t)},broadcast:function(t){p(t)},broadcastOn:function(t,e){v(t,e)},broadcastEvent:function(t,e){b(t,e)},isConnected:s},f=function(t){t.connect(l),lo(t.element)||(o.register(t),j(t.components(),f),l.triggerEvent(Or(),t.element,{target:t.element}))},d=function(t){lo(t.element)||(j(t.components(),d),o.unregister(t)),t.disconnect()},m=function(t){_s(e,t)},g=function(t){Ns(t)},h=function(t){var e=o.filter(br());j(e,(function(e){var n=e.descHandler;si(n)(t)}))},p=function(t){h({universal:!0,data:t})},v=function(t,e){h({universal:!1,channels:t,data:e})},b=function(e,n){return function(e,n,r){var o=function(e){var n=Qe(!1);return{stop:function(){n.set(!0)},cut:t,isStopped:n.get,isCut:c,event:e,setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")}}(n);return j(e,(function(t){var e=t.descHandler;si(e)(o)})),o.isStopped()}(o.filter(e),n)},y=function(t){return o.getById(t).fold((function(){return ct.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ct.value)},w=function(t){var e=Ko(t).getOr("not found");return y(e)};return f(e),{root:e,element:e.element,destroy:function(){u.unbind(),Eo(e.element)},add:m,remove:g,getByUid:y,getByDom:w,addToWorld:f,removeFromWorld:d,broadcast:p,broadcastOn:v,broadcastEvent:b}},Ub=r([je("prefix","form-field"),fl("fieldBehaviours",[wf,ll])]),Wb=r([Fl({schema:[_e("dom")],name:"label"}),Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Ll({factory:{sketch:function(t){var e=function(t,e){var n={};return yt(t,(function(t,r){I(e,r)||(n[r]=t)})),n}(t,["factory"]);return t.factory.sketch(e)}},schema:[_e("factory")],name:"field"})]),qb=gf({name:"FormField",configFields:Ub(),partFields:Wb(),factory:function(t,e,n,r){var o=ml(t.fieldBehaviours,[wf.config({find:function(e){return Ql(e,t,"field")}}),ll.config({store:{mode:"manual",getValue:function(t){return wf.getCurrent(t).bind(ll.getValue)},setValue:function(t,e){wf.getCurrent(t).each((function(t){ll.setValue(t,e)}))}}})]),i=$r([ro((function(e,n){var r=tf(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Uo(t.prefix);r.label().each((function(t){zo(t.element,"for",n),zo(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Uo(t.prefix);zo(n.element,"id",r),zo(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Ql(e,t,"field")},getLabel:function(e){return Ql(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),$b=Object.freeze({__proto__:null,exhibit:function(t,e){return ci({attributes:jt([{key:e.tabAttr,value:"true"}])})}}),Gb=[je("tabAttr","data-alloy-tabstop")],Xb=Fa({fields:Gb,name:"tabstopping",active:$b}),Kb=tinymce.util.Tools.resolve("tinymce.html.Entities"),Yb=function(t,e,n,r){var o=Jb(t,e,n,r);return qb.sketch(o)},Jb=function(t,e,n,r){return{dom:Qb(n),components:t.toArray().concat([e]),fieldBehaviours:La(r)}},Qb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Zb=function(t,e){return qb.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ty=Uo("form-component-change"),ey=Uo("form-close"),ny=Uo("form-cancel"),ry=Uo("form-action"),oy=Uo("form-submit"),iy=Uo("form-block"),uy=Uo("form-unblock"),ay=Uo("form-tabchange"),cy=Uo("form-resize"),sy=r([Pe("data"),je("inputAttributes",{}),je("inputStyles",{}),je("tag","input"),je("inputClasses",[]),Ku("onSetValue"),je("styles",{}),je("eventOrder",{}),fl("inputBehaviours",[ll,Bm]),je("selectOnFocus",!0)]),ly=function(e){return La([Bm.config({onFocus:e.selectOnFocus?function(t){var e=t.element,n=qi(e);e.dom.setSelectionRange(0,n.length)}:t})])},fy=function(t){return f(f({},ly(t)),ml(t.inputBehaviours,[ll.config({store:f(f({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return qi(t.element)},setValue:function(t,e){qi(t.element)!==e&&$i(t.element,e)}}),onSetValue:t.onSetValue})]))},dy=function(t){return{tag:t.tag,attributes:f({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},my=mf({name:"Input",configFields:sy(),factory:function(t,e){return{uid:t.uid,dom:dy(t),components:[],behaviours:fy(t),eventOrder:t.eventOrder}}}),gy={},hy={exports:gy};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,gy,hy);var py,vy=hy.exports.boltExport,by=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return by((function(e){r((function(n){e(t(n))}))}))},isReady:o}},yy={nu:by,pure:function(t){return by((function(e){e(t)}))}},wy=function(t){setTimeout((function(){throw t}),0)},xy=function(t){var e=function(e){t().then(e,wy)};return{map:function(e){return xy((function(){return t().then(e)}))},bind:function(e){return xy((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return xy((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return yy.nu(e)},toCached:function(){var e=null;return xy((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Cy=function(t){return xy((function(){return new vy(t)}))},Sy=function(t){return xy((function(){return vy.resolve(t)}))},ky=["input","textarea"],Oy=function(t){var e=ao(t);return I(ky,e)},Ty=function(t,e){var n=e.getRoot(t).getOr(t.element);bi(n,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ro(t,e.validHtml)})),e.onValid(t)}))},_y=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);vi(o,e.invalidClass),e.notify.each((function(e){Oy(t.element)&&zo(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ro(t,r)})),e.onInvalid(t,r)}))},Ey=function(t,e,n){return e.validator.fold((function(){return Sy(ct.value(!0))}),(function(e){return e.validate(t)}))},Ay=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Ey(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return _y(t,e,0,n),ct.error(n)}),(function(n){return Ty(t,e),ct.value(n)})):ct.error("No longer in system")}))},Ny=Object.freeze({__proto__:null,markValid:Ty,markInvalid:_y,query:Ey,run:Ay,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return yi(n,e.invalidClass)}}),Ry=Object.freeze({__proto__:null,events:function(e,n){return e.validator.map((function(n){return $r([Kr(n.onEvent,(function(t){Ay(t,e).get(o)}))].concat(n.validateOnLoad?[ro((function(n){Ay(n,e).get(t)}))]:[]))})).getOr({})}}),My=[_e("invalidClass"),je("getRoot",x.none),Ve("notify",[je("aria","alert"),je("getContainer",x.none),je("validHtml",""),Ku("onValid"),Ku("onInvalid"),Ku("onValidate")]),Ve("validator",[_e("validate"),je("onEvent","input"),je("validateOnLoad",!0)])],zy=Fa({fields:My,name:"invalidating",active:Ry,apis:Ny,extra:{validation:function(t){return function(e){var n=ll.getValue(e);return Sy(t(n))}}}}),Dy=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),By=[Ee("others",fe(ct.value,be()))],Py=Fa({fields:By,name:"coupling",apis:Dy,state:Object.freeze({__proto__:null,init:function(){var t={},e=r({});return ui({readState:e,getOrCreate:function(e,n,r){var o=vt(n.others);if(o)return Ot(t,r).getOrThunk((function(){var o=Ot(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),Iy=r("sink"),Ly=r(Fl({name:Iy(),overrides:r({dom:{tag:"div"},behaviours:La([Cs.config({useFixed:s})]),events:$r([to(ur()),to(Zn()),to(lr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(py||(py={}));var Hy=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},Fy=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Uy(r,t);return a.map((function(t){return t.bind((function(t){return x.from(pg.sketch(f(f({},i.menu()),{uid:Yo(""),data:t,highlightImmediately:u===py.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Cs.position(r,n,e),Ws.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Cs.position(r,{anchor:"submenu",item:e},n),Ws.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Cs.position(o,n,e),j(r,(function(t){Cs.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Bm.focus(r),Ws.close(o),x.some(!0)}})))}))}))}(t,e,Hy(t,n),n,r,o,u).map((function(t){return t.fold((function(){Ws.isOpen(r)&&Ws.close(r)}),(function(t){Ws.cloak(r),Ws.open(r,t),i(r)})),r}))},Vy=function(t,e,n,r,o,i,u){return Ws.close(r),Sy(r)},jy=function(t,e,n,r,o,i){var u=Py.getCoupled(n,"sandbox");return(Ws.isOpen(u)?Vy:Fy)(t,e,n,u,r,o,i)},Uy=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Iy()).map((function(t){return function(){return ct.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return ct.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Wy=function(t){Ws.getState(t).each((function(t){pg.repositionMenus(t)}))},qy=function(t,e,n){var r=Bu(),o=Uy(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:hl(t.sandboxBehaviours,[ll.config({store:{mode:"memory",initialValue:e}}),Ws.config({onOpen:function(o,i){var u=Hy(t,e);r.link(e.element),t.matchWidth&&function(t,e,n){var r=wf.getCurrent(e).getOr(e),o=fu(t.element);n?Bi(r.element,"min-width",o+"px"):function(t,e){lu.set(t,e)}(r.element,o)}(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return Pu(n,r)||Pu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),wf.config({find:function(t){return Ws.getState(t).bind((function(t){return wf.getCurrent(t)}))}}),Wa.config({channels:f(f({},Ks({isExtraPart:c})),Js({doReposition:Wy}))})])}},$y=function(t){var e=Py.getCoupled(t,"sandbox");Wy(e)},Gy=function(){return[je("sandboxClasses",[]),gl("sandboxBehaviours",[wf,Wa,Ws,ll])]},Xy=r([_e("dom"),_e("fetch"),Ku("onOpen"),Yu("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),fl("dropdownBehaviours",[Gm,Py,km,Bm]),_e("toggleClass"),je("eventOrder",{}),Pe("lazySink"),je("matchWidth",!1),je("useMinWidth",!1),Pe("role")].concat(Gy())),Ky=r([Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Ly()]),Yy=gf({name:"Dropdown",configFields:Xy(),partFields:Ky(),factory:function(e,n,r,o){var i,u=function(t){Ws.getState(t).each((function(t){pg.highlightPrimary(t)}))},a={expand:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightNone).get(t)},open:function(n){Gm.isOn(n)||jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},isOpen:Gm.isOn,close:function(n){Gm.isOn(n)&&jy(e,(function(t){return t}),n,o,t,py.HighlightFirst).get(t)},repositionMenus:function(t){Gm.isOn(t)&&$y(t)}},c=function(t,e){return jr(t),x.some(!0)};return{uid:e.uid,dom:e.dom,components:n,behaviours:ml(e.dropdownBehaviours,[Gm.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){Gm.on(t)},onClose:function(){Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Yy.isOpen(t)){var n=Py.getCoupled(t,"sandbox");u(n)}else Yy.open(t);return x.some(!0)},onEscape:function(t,e){return Yy.isOpen(t)?(Yy.close(t),x.some(!0)):x.none()}}),Bm.config({})]),events:Km(x.some((function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)}))),eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:a,domModification:{attributes:f(f({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===e.dom.tag?{type:("type",Ot(e.dom,"attributes").bind((function(t){return Ot(t,"type")}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Jy=Fa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return $r([Gr(dr(),s)])},exhibit:function(){return ci({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Qy=Uo("color-input-change"),Zy=Uo("color-swatch-change"),tw=Uo("color-picker-cancel"),ew=function(t,e,n){return{hue:t,saturation:e,value:n}},nw=Uo("rgb-hex-update"),rw=Uo("slider-update"),ow=Uo("palette-update"),iw=Fl({schema:[_e("dom")],name:"label"}),uw=function(t){return Fl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:$r([Yr(Kn(),(function(e,n,r){return t(e,r)}),[e]),Yr(Zn(),(function(e,n,r){return t(e,r)}),[e]),Yr(tr(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},aw=uw("top-left"),cw=uw("top"),sw=uw("top-right"),lw=uw("right"),fw=uw("bottom-right"),dw=uw("bottom"),mw=uw("bottom-left"),gw=[iw,uw("left"),lw,cw,dw,aw,sw,mw,fw,Ll({name:"thumb",defaults:r({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:$r([Qr(Kn(),t,"spectrum"),Qr(Yn(),t,"spectrum"),Qr(Jn(),t,"spectrum"),Qr(Zn(),t,"spectrum"),Qr(tr(),t,"spectrum"),Qr(nr(),t,"spectrum")])}}}),Ll({schema:[Je("mouseIsDown",(function(){return Qe(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:La([km.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Bm.config({})]),events:$r([Kr(Kn(),n),Kr(Yn(),n),Kr(Zn(),n),Kr(tr(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],hw=r("slider.change.value"),pw=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?x.some(n.touches[0]).map((function(t){return uu(t.clientX,t.clientY)})):x.none()}var r=e;return void 0!==r.clientX?x.some(r).map((function(t){return uu(t.clientX,t.clientY)})):x.none()},vw=function(t){return t.model.minX},bw=function(t){return t.model.minY},yw=function(t){return t.model.minX-1},ww=function(t){return t.model.minY-1},xw=function(t){return t.model.maxX},Cw=function(t){return t.model.maxY},Sw=function(t){return t.model.maxX+1},kw=function(t){return t.model.maxY+1},Ow=function(t,e,n){return e(t)-n(t)},Tw=function(t){return Ow(t,xw,vw)},_w=function(t){return Ow(t,Cw,bw)},Ew=function(t){return Tw(t)/2},Aw=function(t){return _w(t)/2},Nw=function(t){return t.stepSize},Rw=function(t){return t.snapToGrid},Mw=function(t){return t.snapStart},zw=function(t){return t.rounded},Dw=function(t,e){return void 0!==t[e+"-edge"]},Bw=function(t){return Dw(t,"left")},Pw=function(t){return Dw(t,"right")},Iw=function(t){return Dw(t,"top")},Lw=function(t){return Dw(t,"bottom")},Hw=function(t){return t.model.value.get()},Fw=function(t){return{x:t}},Vw=function(t){return{y:t}},jw=function(t,e){return{x:t,y:e}},Uw=function(t,e){Vr(t,hw(),{value:e})},Ww=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},qw=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},$w=function(t,e,n){return Math.max(e,Math.min(n,t))},Gw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=$w(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return $w(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},Xw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},Kw="top",Yw="right",Jw="bottom",Qw="left",Zw=function(t){return t.element.dom.getBoundingClientRect()},tx=function(t,e){return t[e]},ex=function(t){var e=Zw(t);return tx(e,Qw)},nx=function(t){var e=Zw(t);return tx(e,Yw)},rx=function(t){var e=Zw(t);return tx(e,Kw)},ox=function(t){var e=Zw(t);return tx(e,Jw)},ix=function(t){var e=Zw(t);return tx(e,"width")},ux=function(t){var e=Zw(t);return tx(e,"height")},ax=function(t,e,n){return(t+e)/2-n},cx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Qw),i=tx(n,Yw),u=tx(r,Qw);return ax(o,i,u)},sx=function(t,e){var n=Zw(t),r=Zw(e),o=tx(n,Kw),i=tx(n,Jw),u=tx(r,Kw);return ax(o,i,u)},lx=function(t,e){Vr(t,hw(),{value:e})},fx=function(t){return{x:t}},dx=function(t,e,n){var r={min:vw(e),max:xw(e),range:Tw(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),maxBound:nx(t),screenRange:ix(t)};return Gw(r)},mx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).x,vw(n),xw(n),Nw(n));return lx(e,fx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},gx=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ix(t),u=r.bind((function(e){return x.some(cx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(cx(e,t))})).getOr(i),c={min:vw(e),max:xw(e),range:Tw(e),value:n,hasMinEdge:Bw(e),hasMaxEdge:Pw(e),minBound:ex(t),minOffset:0,maxBound:nx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return ex(e)-ex(t)+u},hx=mx(-1),px=mx(1),vx=x.none,bx=x.none,yx={"top-left":x.none(),top:x.none(),"top-right":x.none(),right:x.some((function(t,e){Uw(t,Fw(Sw(e)))})),"bottom-right":x.none(),bottom:x.none(),"bottom-left":x.none(),left:x.some((function(t,e){Uw(t,Fw(yw(e)))}))},wx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n),o=fx(r);return lx(t,o),r},setToMin:function(t,e){var n=vw(e);lx(t,fx(n))},setToMax:function(t,e){var n=xw(e);lx(t,fx(n))},findValueOfOffset:dx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.left}))},findPositionOfValue:gx,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=fu(e.element)/2;Bi(e.element,"left",i-u+"px")},onLeft:hx,onRight:px,onUp:vx,onDown:bx,edgeActions:yx}),xx=function(t,e){Vr(t,hw(),{value:e})},Cx=function(t){return{y:t}},Sx=function(t,e,n){var r={min:bw(e),max:Cw(e),range:_w(e),value:n,step:Nw(e),snap:Rw(e),snapStart:Mw(e),rounded:zw(e),hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),maxBound:ox(t),screenRange:ux(t)};return Gw(r)},kx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?qw:Ww)(Hw(n).y,bw(n),Cw(n),Nw(n));return xx(e,Cx(r)),x.some(r)}(t,e,n).map((function(){return!0}))}},Ox=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=ux(t),u=r.bind((function(e){return x.some(sx(e,t))})).getOr(0),a=o.bind((function(e){return x.some(sx(e,t))})).getOr(i),c={min:bw(e),max:Cw(e),range:_w(e),value:n,hasMinEdge:Iw(e),hasMaxEdge:Lw(e),minBound:rx(t),minOffset:0,maxBound:ox(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Xw(c)}(e,i,n,r,o);return rx(e)-rx(t)+u},Tx=x.none,_x=x.none,Ex=kx(-1),Ax=kx(1),Nx={"top-left":x.none(),top:x.some((function(t,e){Uw(t,Vw(ww(e)))})),"top-right":x.none(),right:x.none(),"bottom-right":x.none(),bottom:x.some((function(t,e){Uw(t,Vw(kw(e)))})),"bottom-left":x.none(),left:x.none()},Rx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Sx(t,e,n),o=Cx(r);return xx(t,o),r},setToMin:function(t,e){var n=bw(e);xx(t,Cx(n))},setToMax:function(t,e){var n=Cw(e);xx(t,Cx(n))},findValueOfOffset:Sx,getValueFromEvent:function(t){return pw(t).map((function(t){return t.top}))},findPositionOfValue:Ox,setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ru(e.element)/2;Bi(e.element,"top",i-u+"px")},onLeft:Tx,onRight:_x,onUp:Ex,onDown:Ax,edgeActions:Nx}),Mx=function(t,e){Vr(t,hw(),{value:e})},zx=function(t,e){return{x:t,y:e}},Dx=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?qw:Ww,i=e?Hw(r).x:o(Hw(r).x,vw(r),xw(r),Nw(r)),u=e?o(Hw(r).y,bw(r),Cw(r),Nw(r)):Hw(r).y;return Mx(n,zx(i,u)),x.some(i)}(t,e,n,r).map((function(){return!0}))}},Bx=Dx(-1,!1),Px=Dx(1,!1),Ix=Dx(-1,!0),Lx=Dx(1,!0),Hx={"top-left":x.some((function(t,e){Uw(t,jw(yw(e),ww(e)))})),top:x.some((function(t,e){Uw(t,jw(Ew(e),ww(e)))})),"top-right":x.some((function(t,e){Uw(t,jw(Sw(e),ww(e)))})),right:x.some((function(t,e){Uw(t,jw(Sw(e),Aw(e)))})),"bottom-right":x.some((function(t,e){Uw(t,jw(Sw(e),kw(e)))})),bottom:x.some((function(t,e){Uw(t,jw(Ew(e),kw(e)))})),"bottom-left":x.some((function(t,e){Uw(t,jw(yw(e),kw(e)))})),left:x.some((function(t,e){Uw(t,jw(yw(e),Aw(e)))}))},Fx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=dx(t,e,n.left),o=Sx(t,e,n.top),i=zx(r,o);return Mx(t,i),i},setToMin:function(t,e){var n=vw(e),r=bw(e);Mx(t,zx(n,r))},setToMax:function(t,e){var n=xw(e),r=Cw(e);Mx(t,zx(n,r))},getValueFromEvent:function(t){return pw(t)},setPositionFromValue:function(t,e,n,r){var o=Hw(n),i=gx(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Ox(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=fu(e.element)/2,c=ru(e.element)/2;Bi(e.element,"left",i-a+"px"),Bi(e.element,"top",u-c+"px")},onLeft:Bx,onRight:Px,onUp:Ix,onDown:Lx,edgeActions:Hx}),Vx=gf({name:"Slider",configFields:[je("stepSize",1),je("onChange",t),je("onChoose",t),je("onInit",t),je("onDragStart",t),je("onDragEnd",t),je("snapToGrid",!1),je("rounded",!0),Pe("snapStart"),Ee("model",ve("mode",{x:[je("minX",0),je("maxX",100),Je("value",(function(t){return Qe(t.mode.minX)})),_e("getInitialValue"),Zu("manager",wx)],y:[je("minY",0),je("maxY",100),Je("value",(function(t){return Qe(t.mode.minY)})),_e("getInitialValue"),Zu("manager",Rx)],xy:[je("minX",0),je("maxX",100),je("minY",0),je("maxY",100),Je("value",(function(t){return Qe({x:t.mode.minX,y:t.mode.minY})})),_e("getInitialValue"),Zu("manager",Fx)]})),fl("sliderBehaviours",[km,ll]),Je("mouseIsDown",(function(){return Qe(!1)}))],partFields:gw,factory:function(t,e,n,r){var o,i=function(e){return Zl(e,t,"thumb")},u=function(e){return Zl(e,t,"spectrum")},a=function(e){return Ql(e,t,"left-edge")},c=function(e){return Ql(e,t,"right-edge")},l=function(e){return Ql(e,t,"top-edge")},f=function(e){return Ql(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:l,getBottomEdge:f,getSpectrum:u})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),x.some(!0)},p=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Ql(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},b=function(e,n){n.stop(),t.onDragEnd(e,i(e)),p(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.sliderBehaviours,[km.config({mode:"special",focusIn:function(e){return Ql(e,t,"spectrum").map(km.focusIn).map(s)}}),ll.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),Wa.config({channels:(o={},o[Gs()]={onReceive:p},o)})]),events:$r([Kr(hw(),(function(t,e){h(t,e.event.value)})),ro((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),Kr(Kn(),v),Kr(Jn(),b),Kr(Zn(),v),Kr(nr(),b)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),jx=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Vx.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return Vx.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:r({y:0})},components:[n,o],sliderBehaviours:La([Bm.config({})]),onChange:function(t,e,n){Vr(t,rw,{value:n})}})},Ux="form",Wx=[fl("formBehaviours",[ll])],qx=function(t){return"<alloy.field."+t+">"},$x=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.formBehaviours,[ll.config({store:{mode:"manual",getValue:function(e){var n=ef(e,t);return wt(n,(function(t,e){return t().bind((function(t){var n,r;return n=wf.getCurrent(t),r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ho(t.element)),n.fold((function(){return ct.error(r)}),ct.value)})).map(ll.getValue)}))},setValue:function(e,n){yt(n,(function(n,r){Ql(e,t,r).each((function(t){wf.getCurrent(t).each((function(t){ll.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Ql(e,t,n).bind(wf.getCurrent)}}}},Gx={getField:oi((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),Gl(Ux,qx(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:qx(t)})}));return sf(Ux,Wx,o,$x,n)}},Xx=Uo("valid-input"),Kx=Uo("invalid-input"),Yx=Uo("validating-input"),Jx="colorcustom.rgb.",Qx=function(e,n,r,o){var i=function(t,r){return zy.config({invalidClass:n("invalid"),notify:{onValidate:function(e){Vr(e,Yx,{type:t})},onValid:function(e){Vr(e,Xx,{type:t,value:ll.getValue(e)})},onInvalid:function(e){Vr(e,Kx,{type:t,value:ll.getValue(e)})}},validator:{validate:function(t){var n=ll.getValue(t),o=r(n)?ct.value(!0):ct.error(e("aria.input.invalid"));return Sy(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=e("colorcustom.rgb.range"),l=[qb.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),qb.parts.field({data:c,factory:my,inputAttributes:f({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:La([i(o,r),Xb.config({})]),onSetValue:function(e){zy.isInvalid(e)&&zy.run(e).get(t)}})],d="hex"!==o?[qb.parts["aria-descriptor"]({text:s})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(d)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;ll.setValue(t,{red:n,green:r,blue:o})},c=Rg({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Bi(t.element,"background-color","#"+e.value)}))};return mf({factory:function(){var t={red:Qe(x.some(255)),green:Qe(x.some(255)),blue:Qe(x.some(255)),hex:Qe(x.some("ffffff"))},i=function(e){return t[e].get()},l=function(e,n){t[e].set(n)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",x.some(e)),l("green",x.some(n)),l("blue",x.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,x.none()):o(t)},m=function(t,e){var n=e.event;!function(t){return"hex"===t.type}(n)?function(t,e,n){var r=parseInt(n,10);l(e,x.some(r)),i("red").bind((function(t){return i("green").bind((function(e){return i("blue").map((function(n){return Hv(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=zv(e);return Gx.getField(t,"hex").each((function(e){Bm.isFocused(e)||ll.setValue(t,{hex:n.value})})),n}(t,e);s(t,n)}))}(t,n.type,n.value):function(t,e){r(t);var n=Ev(e);l("hex",x.some(e));var o=jv(n);a(t,o),f(o),Vr(t,nw,{hex:n}),s(t,n)}(t,n.value)},g=function(t){return{label:e(Jx+t+".label"),description:e(Jx+t+".description")}},h=g("red"),p=g("green"),v=g("blue"),b=g("hex");return Rt(Gx.sketch((function(t){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[t.field("red",qb.sketch(u(Fv,"red",h.label,h.description,255))),t.field("green",qb.sketch(u(Fv,"green",p.label,p.description,255))),t.field("blue",qb.sketch(u(Fv,"blue",v.label,v.description,255))),t.field("hex",qb.sketch(u(Rv,"hex",b.label,b.description,"ffffff"))),c.asSpec()],formBehaviours:La([zy.config({invalidClass:n("form-invalid")}),Nm("rgb-form-events",[Kr(Xx,m),Kr(Kx,d),Kr(Yx,d)])])}})),{apis:{updateHex:function(t,e){ll.setValue(t,{hex:e.value}),function(t,e){var n=jv(e);a(t,n),f(n)}(t,e),s(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Zx=function(e,n){return mf({name:"ColourPicker",configFields:[_e("dom"),je("onValidHex",t),je("onInvalidHex",t)],factory:function(t){var o,i=Qx(e,n,t.onValidHex,t.onInvalidHex),u=function(t,e){var n=Vx.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),o=Vx.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return mf({factory:function(t){var u=r({x:0,y:0}),a=La([wf.config({find:x.some}),Bm.config({})]);return Vx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[n,o],onChange:function(t,e,n){Vr(t,ow,{value:n})},onInit:function(t,e,n,r){i(n.element.dom,Wv(qv))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom;i(n,Wv(e))}(e,n)}},extraApis:{}})}(0,n),a={paletteRgba:Qe(qv)},c=Rg(u.sketch({})),s=Rg(i.sketch({})),l=function(t,e){c.getOpt(t).each((function(t){var n=jv(e);a.paletteRgba.set(n),u.setRgba(t,n)}))},f=function(t,e){s.getOpt(t).each((function(t){i.updateHex(t,e)}))},d=function(t,e,n){j(n,(function(n){n(t,e)}))};return{uid:t.uid,dom:t.dom,components:[c.asSpec(),jx(0,n),s.asSpec()],behaviours:La([Nm("colour-picker-events",[Kr(ow,(o=[f],function(t,e){var n=e.event.value,r=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?ew(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,ew(Math.round(n),Math.round(100*e),Math.round(100*r)))}(a.paletteRgba.get()),i=ew(r.hue,n.x,100-n.y),u=Vv(i),c=zv(u);d(t,c,o)})),Kr(rw,function(){var t=[l,f];return function(e,n){var r=function(t){var e=ew((100-t)/100*360,100,100),n=Vv(e);return zv(n)}(n.event.value.y);d(e,r,t)}}())]),wf.config({find:function(t){return s.getOpt(t)}}),km.config({mode:"acyclic"})])}}})},tC=function(){return wf.config({find:x.some})},eC=function(t){return wf.config({find:function(e){return xo(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},nC={"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","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},rC=function(t){return function(t){return nC[t]}(t)},oC=tinymce.util.Tools.resolve("tinymce.Resource"),iC=tinymce.util.Tools.resolve("tinymce.util.Tools"),uC=Zt([je("preprocess",o),je("postprocess",o)]),aC=function(t,e,n){return ll.config(Rt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},cC=function(t,e){var n=ge("RepresentingConfigs.memento processors",uC,e);return ll.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=ll.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);ll.setValue(i,o)}}})},sC=aC,lC=function(t){return e=No,n=Ro,aC(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}));var e,n},fC=function(t){return ll.config({store:{mode:"memory",initialValue:t}})},dC=Uo("alloy-fake-before-tabstop"),mC=Uo("alloy-fake-after-tabstop"),gC=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:La([Bm.config({ignore:!0}),Xb.config({})])}},hC=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[gC([dC]),t,gC([mC])],behaviours:La([eC(1)])}},pC=function(t,e){Vr(t,ur(),{raw:{which:9,shiftKey:e}})},vC=function(t,e){var n=e.element;yi(n,dC)?pC(t,!0):yi(n,mC)&&pC(t,!1)},bC=function(t){return Ab(t,["."+dC,"."+mC].join(","),c)},yC=!(Ln().browser.isIE()||Ln().browser.isEdge());function wC(t,e){return SC(document.createElement("canvas"),t,e)}function xC(t){var e=wC(t.width,t.height);return CC(e).drawImage(t,0,0),e}function CC(t){return t.getContext("2d")}function SC(t,e,n){return t.width=e,t.height=n,t}function kC(t){return t.naturalWidth||t.width}function OC(t){return t.naturalHeight||t.height}var TC=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function _C(t,e,n){return e=e||"image/png",N(HTMLCanvasElement.prototype.toBlob)?new TC((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):(r=t.toDataURL(e,n),new TC((function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return x.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,a),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=u[g].charCodeAt(0);s[l]=new Uint8Array(m)}return x.some(new Blob(s,{type:r}))})(r).fold((function(){e("uri is not base64: "+r)}),t)})));var r}function EC(t,e,n){var o=e.type;function i(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:r(o),toBlob:function(){return TC.resolve(e)},toDataURL:r(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return _C(t,e,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(xC)}}}function AC(t){return function(t){return new TC((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return EC(function(t){return function(t){return new TC((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=wC(kC(t),OC(t));return CC(e).drawImage(t,0,0),e}))}(t),t,e)}))}function NC(t,e){return _C(t,e).then((function(e){return EC(TC.resolve(t),e,t.toDataURL())}))}function RC(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var MC=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function zC(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o}function DC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t);var o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*O+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),NC(t,e)}(n,t.getType(),e)}))}function BC(t){return function(e,n){return DC(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var PC,IC,LC=function(t){return function(e){return DC(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),HC=BC((function(t,e){return zC(t,[1,0,0,0,e=RC(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),FC=BC((function(t,e){var n;return e=RC(e,-1,1),zC(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?MC[e]:MC[Math.floor(e)]*(1-n)+MC[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),VC=(PC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=CC(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),NC(t,e)}(n,t.getType(),e)}))}(t,PC)}),jC=(IC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=CC(t),o=new Array(256),i=0;i<o.length;i++)o[i]=IC(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),NC(t,e)}(n,t.getType(),e)}))});function UC(t,e,n){var r=kC(t),o=OC(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=function(t,e,n){return new TC((function(r){var o=kC(t),i=OC(t),u=Math.floor(o*e),a=Math.floor(i*n),c=wC(u,a);CC(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}(t,i,u);return a?c.then((function(t){return UC(t,e,n)})):c}var WC,qC=function(t){return LC(t)},$C=function(t){return VC(t)},GC=function(t,e){return jC(t,e)},XC=function(t,e){return HC(t,e)},KC=function(t,e){return FC(t,e)},YC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),NC(r,e)}(n,t.getType(),e)}))}(t,e)},JC=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return UC(r,e,n).then((function(e){return NC(e,t.getType())}))}))}(t,e,n)},QC=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=wC(t.width,t.height),o=CC(r),i=0,u=0;return 90!==(n=n<0?360+n:n)&&270!==n||SC(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),NC(r,e)}(n,t.getType(),e)}))}(t,e)},ZC=function(t,e){return f({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},tS=function(t,e){return ZC(zg(t,e),{})},eS=function(t,e){return ZC(zg(t,e),{behaviours:La([Am.config({})])})},nS=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:La([Am.config({})])}},rS=Uo("toolbar.button.execute"),oS=((WC={})[yr()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],WC),iS=Uo("update-menu-text"),uS=Uo("update-menu-icon"),aS=function(e,n,r){var o=Qe(t),u=e.text.map((function(t){return Rg(nS(t,n,r.providers))})),a=e.icon.map((function(t){return Rg(eS(t,r.providers.icons))})),c=function(t,e){var n=ll.getValue(t);return Bm.focus(n),Vr(n,"keydown",{raw:e.event.raw}),Yy.close(n),x.some(!0)},s=e.role.fold((function(){return{}}),(function(t){return{role:t}})),l=e.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}}));return Rg(Yy.sketch(f(f(f({},e.uid?{uid:e.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(V(e.classes,(function(t){return n+"--"+t}))),attributes:f({},l)},components:lv([a.map((function(t){return t.asSpec()})),u.map((function(t){return t.asSpec()})),x.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:zg("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:La(m(e.dropdownBehaviours,[nv((function(){return e.disabled||r.providers.isDisabled()})),ev(),Jy.config({}),Am.config({}),Nm("dropdown-events",[uv(e,o),av(e,o)]),Nm("menubutton-update-display-text",[Kr(iS,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[Yi(r.providers.translate(e.event.text))])}))})),Kr(uS,(function(t,e){a.bind((function(e){return e.getOpt(t)})).each((function(t){Am.set(t,[eS(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Rt(oS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:La([km.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:Mh(0,e.columns,e.presets)},fetch:function(t){return Cy(i(e.fetch,t))}}))).asSpec()},cS=function(t){return"separator"===t.type},sS={type:"separator"},lS=function(t,e){var n=function(t,e){var n=$(t,(function(t,n){return function(t){return k(t)}(n)?""===n?t:"|"===n?t.length>0&&!cS(t[t.length-1])?t.concat([sS]):t:Tt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&cS(n[n.length-1])&&n.pop(),n}(k(t)?t.split(" "):t,e);return q(n,(function(t,n){var r=function(t,e){return function(t){return Tt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=lS(n,e);return{item:t,menus:Rt(r.menus,Vt(t.value,r.items)),expansions:Rt(r.expansions,Vt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}}(function(t){if(cS(t))return t;var e=Ot(t,"value").getOrThunk((function(){return Uo("generated-menu-item")}));return Rt({value:e},t)}(n),e);return{menus:Rt(t.menus,r.menus),items:[r.item].concat(t.items),expansions:Rt(t.expansions,r.expansions)}}),{menus:{},expansions:{},items:[]})},fS=function(t,e,n,r){var o=Uo("primary-menu"),i=lS(t,n.shared.providers.menuItems());if(0===i.items.length)return x.none();var u=Cb(o,i.items,e,n,r),a=wt(i.menus,(function(t,r){return Cb(r,t,e,n,!1)})),c=Rt(a,Vt(o,u));return x.from(pg.tieredData(o,c,i.expansions))},dS=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setActive:function(e){var n=t.element;e?(vi(n,"tox-tbtn--enabled"),zo(n,"aria-pressed",!0)):(bi(n,"tox-tbtn--enabled"),Io(n,"aria-pressed"))},isActive:function(){return yi(t.element,"tox-tbtn--enabled")}}},mS=function(t,e,n,r){return aS({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(fS(t,ph.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:dS,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({})]},e,n.shared)},gS=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){$a(e.element),Vr(e,ry,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(V(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return f(f({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},hS=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=f({buttonBehaviours:La([nv((function(){return t.disabled||i.isDisabled()})),ev(),Xb.config({}),Nm("button press",[Xr("click"),Xr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Rt(a,{dom:r});return Rt(c,{components:o})},pS=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return tS(t,n.icons)})),u=lv([i]);return hS(t,e,r,o,u,n)},vS=function(t,e,n,r){void 0===r&&(r=[]);var o=pS(t,x.some(e),n,r);return Ng.sketch(o)},bS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return tS(t,n.icons)})):x.none(),a=u.isSome()?lv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=m(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=f(f({tag:"button",classes:s},c),{attributes:{title:i}});return hS(t,e,r,l,a,n)},yS=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=bS(t,x.some(e),n,r,o);return Ng.sketch(i)},wS=function(t,e){return function(n){"custom"===e?Vr(n,ry,{name:t,value:{}}):"submit"===e?Fr(n,oy):"cancel"===e?Fr(n,ny):console.error("Unknown button type: ",e)}},xS=function(e,n,r){if(function(t,e){return"menu"===e}(0,n)){var o=e,i=f(f({},e),{onSetup:function(n){return n.setDisabled(e.disabled),t},fetch:gS(o.items,(function(){return u}),r)}),u=Rg(mS(i,"tox-tbtn",r,x.none()));return u.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,n)){var a=wS(e.name,n),c=f(f({},e),{borderless:!1});return yS(c,a,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},CS=r([je("field1Name","field1"),je("field2Name","field2"),Ju("onLockedChange"),Gu(["lockClass"]),je("locked",!1),gl("coupledFieldBehaviours",[wf,ll])]),SS=function(t,e){return Ll({factory:qb,name:t,overrides:function(t){return{fieldBehaviours:La([Nm("coupled-input-behaviour",[Kr(cr(),(function(n){(function(t,e,n){return Ql(t,e,n).bind(wf.getCurrent)})(n,t,e).each((function(e){Ql(n,t,"lock").each((function(r){Gm.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},kS=r([SS("field1","field2"),SS("field2","field1"),Ll({factory:Ng,schema:[_e("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:La([Gm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),OS=gf({name:"FormCoupledInputs",configFields:CS(),partFields:kS(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hl(t.coupledFieldBehaviours,[wf.config({find:x.some}),ll.config({store:{mode:"manual",getValue:function(e){var n,r=rf(e,t,["field1","field2"]);return(n={})[t.field1Name]=ll.getValue(r.field1()),n[t.field2Name]=ll.getValue(r.field2()),n},setValue:function(e,n){var r=rf(e,t,["field1","field2"]);_t(n,t.field1Name)&&ll.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&ll.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Ql(e,t,"field1")},getField2:function(e){return Ql(e,t,"field2")},getLock:function(e){return Ql(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),TS=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return ct.value({value:n,unit:r})}return ct.error(t)},_S=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?x.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?x.some(t.value):x.some(t.value/n[t.unit]*n[e]):x.none()},ES=function(t){return x.none()},AS=function(t,e){var n=ES,r=Uo("ratio-event"),o=OS.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:zg("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:zg("unlock",e.icons)}}],buttonBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return qb.parts.field({factory:my,inputClasses:["tox-textfield"],inputBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),Xb.config({}),Nm("size-input-events",[Kr(or(),(function(t,e){Vr(t,r,{isField1:n})})),Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=OS.parts.field1(i([qb.parts.label(a("Width")),u(!0)])),s=OS.parts.field2(i([qb.parts.label(a("Height")),u(!1)]));return OS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){TS(ll.getValue(t)).each((function(t){n(t).each((function(t){ll.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.disable),OS.getField2(t).bind(qb.getField).each(kp.disable),OS.getLock(t).each(kp.disable)},onEnabled:function(t){OS.getField1(t).bind(qb.getField).each(kp.enable),OS.getField2(t).bind(qb.getField).each(kp.enable),OS.getLock(t).each(kp.enable)}}),ev(),Nm("size-input-events2",[Kr(r,(function(t,e){var r,o,i,u,a=e.event.isField1,c=a?OS.getField1(t):OS.getField2(t),s=a?OS.getField2(t):OS.getField1(t),l=c.map(ll.getValue).getOr(""),f=s.map(ll.getValue).getOr("");r=f,n=(o=TS(l).toOptional(),i=TS(r).toOptional(),u=function(t,e){return _S(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return _S(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(ES)},o.isSome()&&i.isSome()?x.some(u(o.getOrDie(),i.getOrDie())):x.none()).getOr(ES)}))])])})},NS={undo:r(Uo("undo")),redo:r(Uo("redo")),zoom:r(Uo("zoom")),back:r(Uo("back")),apply:r(Uo("apply")),swap:r(Uo("swap")),transform:r(Uo("transform")),tempTransform:r(Uo("temp-transform")),transformApply:r(Uo("transform-apply"))},RS=r("save-state"),MS=r("disable"),zS=r("enable"),DS={formActionEvent:ry,saveState:RS,disable:MS,enable:zS},BS=function(e,n){var o=function(t,e,r,o){return Rg(yS({name:t,text:t,disabled:r,primary:o,icon:x.none(),borderless:!1},e,n))},i=function(t,e,r,o){return Rg(vS({name:t,icon:x.some(t),tooltip:x.some(e),disabled:o,primary:!1,borderless:!1},r,n))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(kp)&&kp.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=t,l=function(t,e,n){Vr(t,e,n)},f=function(t){return Fr(t,DS.disable())},d=function(t){return Fr(t,DS.enable())},m=function(t,e){f(t),l(t,NS.transform(),{transform:e}),d(t)},g=function(t){return function(){et.getOpt(t).each((function(t){Am.set(t,[Z])}))}},h=function(t,e){f(t),l(t,NS.transformApply(),{transform:e,swap:g(t)}),d(t)},p=function(){return o("Back",(function(t){return l(t,NS.back(),{swap:g(t)})}),!1,!1)},v=function(){return Rg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:La([kp.config({})])})},b=function(){return o("Apply",(function(t){return l(t,NS.apply(),{swap:g(t)})}),!0,!0)},y=function(){return function(t){var n=e.getRect();return function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return function(t,e,n,r,o,i){var u=wC(o,i);return CC(u).drawImage(t,-n,-r),NC(u,e)}(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)}(t,n.x,n.y,n.w,n.h)}},w=[p(),v(),o("Apply",(function(t){var n=y();h(t,n),e.hideCrop()}),!1,!0)],C=Vb.sketch({dom:c,components:w.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-crop-buttons-events",[Kr(DS.disable(),(function(t,e){u(w,t)})),Kr(DS.enable(),(function(t,e){a(w,t)}))])])}),S=Rg(AS({name:"size",label:x.none(),constrain:!0,disabled:!1},n)),k=[p(),v(),S,v(),o("Apply",(function(t){S.getOpt(t).each((function(e){var n,r,o=ll.getValue(e),i=(n=parseInt(o.width,10),r=parseInt(o.height,10),function(t){return JC(t,n,r)});h(t,i)}))}),!1,!0)],O=Vb.sketch({dom:c,components:k.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-resize-buttons-events",[Kr(DS.disable(),(function(t,e){u(k,t)})),Kr(DS.enable(),(function(t,e){a(k,t)}))])])}),T=function(t,e){return function(n){return t(n,e)}},_=T(YC,"h"),E=T(YC,"v"),A=T(QC,-90),N=T(QC,90),R=function(t,e){!function(t,e){f(t),l(t,NS.tempTransform(),{transform:e}),d(t)}(t,e)},M=[p(),v(),i("flip-horizontally","Flip horizontally",(function(t){R(t,_)}),!1),i("flip-vertically","Flip vertically",(function(t){R(t,E)}),!1),i("rotate-left","Rotate counterclockwise",(function(t){R(t,A)}),!1),i("rotate-right","Rotate clockwise",(function(t){R(t,N)}),!1),v(),b()],z=Vb.sketch({dom:c,components:M.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-fliprotate-buttons-events",[Kr(DS.disable(),(function(t,e){u(M,t)})),Kr(DS.enable(),(function(t,e){a(M,t)}))])])}),D=function(t,e,o,i,u){var a=Vx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}),c=Vx.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=Vx.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Rg(Vx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:u,getInitialValue:r({x:i})},components:[a,c,s],sliderBehaviours:La([Bm.config({})]),onChoose:e}))},B=function(t,e,n,r,o){return D(t,(function(t,n,r){var o=T(e,r.x/100);m(t,o)}),n,r,o)},P=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[p(),B(t,e,n,r,o),b()]}(t,e,n,r,o);return Vb.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:La([Nm("image-tools-filter-panel-buttons-events",[Kr(DS.disable(),(function(t,e){u(i,t)})),Kr(DS.enable(),(function(t,e){a(i,t)}))])])})},I=[p(),v(),b()],L=Vb.sketch({dom:c,components:I.map((function(t){return t.asSpec()}))}),H=P("Brightness",XC,-100,0,100),F=P("Contrast",KC,-100,0,100),V=P("Gamma",GC,-100,0,100),j=function(t,e,n){return function(r){return function(t,e,n,r){return function(t,e,n,r){return DC(t,function(t,e,n,r){return zC([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[e=RC(e,0,2),0,0,0,0,0,n=RC(n,0,2),0,0,0,0,0,r=RC(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}(0,e,n,r))}(t,e,n,r)}(r,t,e,n)}},U=function(t){return D(t,(function(t,e,n){var r=W.getOpt(t),o=$.getOpt(t),i=q.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=ll.getValue(e).x/100,i=ll.getValue(r).x/100,u=ll.getValue(n).x/100,a=j(o,i,u);m(t,a)}))}))}))}),0,100,200)},W=U("R"),q=U("G"),$=U("B"),G=[p(),W,q,$,b()],X=Vb.sketch({dom:c,components:G.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){l(r,NS.swap(),{transform:e,swap:function(){et.getOpt(r).each((function(e){Am.set(e,[t]),n(e)}))}})}},Y=x.some($C),J=x.some(qC),Q=[i("crop","Crop",K(C,x.none(),(function(t){e.showCrop()})),!1),i("resize","Resize",K(O,x.none(),(function(t){S.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;ll.setValue(t,{width:r,height:o})}))})),!1),i("orientation","Orientation",K(z,x.none(),s),!1),i("brightness","Brightness",K(H,x.none(),s),!1),i("sharpen","Sharpen",K(L,Y,s),!1),i("contrast","Contrast",K(F,x.none(),s),!1),i("color-levels","Color levels",K(X,x.none(),s),!1),i("gamma","Gamma",K(V,x.none(),s),!1),i("invert","Invert",K(L,J,s),!1)],Z=Vb.sketch({dom:c,components:Q.map((function(t){return t.asSpec()}))}),tt=Vb.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:La([Am.config({})])}),et=Rg(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},PS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),IS=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),LS=tinymce.util.Tools.resolve("tinymce.util.Observable"),HS=tinymce.util.Tools.resolve("tinymce.util.VK");function FS(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function VS(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(FS(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){FS(t),IS(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};this.destroy=function(){IS(a).off()},IS(a).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);FS(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=IS("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(u.body),IS(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)}))}var jS,US=0,WS=function(t){var e=Rg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=Qe(1),r=Qe(x.none()),o=Qe({x:0,y:0,w:1,h:1}),i=Qe({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=fu(t.element),c=ru(t.element),s=i.dom.naturalWidth*u,l=i.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Pi(i,m),e.getOpt(t).each((function(t){Pi(t.element,m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=en("img");return zo(a,"src",e),(r=a.dom,new Gg((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){return s.getOpt(t).map((function(t){var e=Ji({element:a});Am.replaceAt(t,1,x.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=PS.inflate(c,-20,-20);return o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=fu(t.element),o=ru(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a),a}))}))},c=Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:La([Nm("image-panel-crop-events",[ro((function(t){s.getOpt(t).each((function(t){var e=function(t,e,n,r,o){var i,u="tox-crid-"+US++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function l(e,r,o,i){var u,a,c,l,f;u=r.x,a=r.y,c=r.w,l=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=PS.clamp({x:u,y:a,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)}function f(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),IS("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}iC.each(a,(function(e){IS("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){f(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}IS('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),iC.each(c,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),iC.each(a,(function(t){IS("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=iC.map(a,(function(e){var n;return new VS(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),IS(r).on("focusin focusout",(function(t){IS(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),IS(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)}switch(iC.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1})),e.keyCode){case HS.LEFT:r(e,0,t,-10,0);break;case HS.RIGHT:r(e,0,t,10,0);break;case HS.UP:r(e,0,t,0,-10);break;case HS.DOWN:r(e,0,t,0,10);break;case HS.ENTER:case HS.SPACEBAR:e.preventDefault(),o()}}));var g=iC.extend({toggleVisibility:function(t){var e=iC.map(a,(function(t){return"#"+u+"-"+t.name})).concat(iC.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?IS(e,r).show():IS(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){iC.each(i,(function(t){t.destroy()})),i=[]}},LS);return g}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element.dom,(function(){}));e.toggleVisibility(!1),e.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(x.some(e))}))}))])])}],containerBehaviours:La([Am.config({}),Nm("image-panel-events",[ro((function(e){a(e,t)}))])])}),s=Rg(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.get().each((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.get().each((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},qS=function(t,e,n,r,o){return vS({name:t,icon:x.some(e),disabled:n,tooltip:x.some(t),primary:!1,borderless:!1},r,o)},$S=function(t,e){e?kp.enable(t):kp.disable(t)},GS=function(e,n){var r=function(t){var e=Qe(t),n=Qe(x.none()),r=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();r.add(t);var o=function(t){e.set(t)},i=function(t){return{blob:t,url:URL.createObjectURL(t)}},u=function(t){URL.revokeObjectURL(t.url)},a=function(){n.get().each(u),n.set(x.none())},c=function(t){var e,n=i(t);return o(n),e=r.add(n).removed,iC.each(e,u),n.url};return{getBlobState:function(){return e.get()},setBlobState:o,addBlobState:c,getTempState:function(){return n.get().fold((function(){return e.get()}),(function(t){return t}))},updateTempState:function(t){var e=i(t);return a(),n.set(x.some(e)),e.url},addTempState:function(t){var e=i(t);return n.set(x.some(e)),e.url},applyTempState:function(t){return n.get().fold((function(){}),(function(e){c(e.blob),t()}))},destroyTempState:a,undo:function(){var t=r.undo();return o(t),t.url},redo:function(){var t=r.redo();return o(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}}(e.currentState),o=function(t){var e=r.getHistoryStates();m.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Vr(t,DS.formActionEvent,{name:DS.saveState(),value:e.undoEnabled})},i=function(t){return t.toBlob()},u=function(t){Vr(t,DS.formActionEvent,{name:DS.disable(),value:{}})},a=function(t){g.getApplyButton(t).each((function(t){kp.enable(t)})),Vr(t,DS.formActionEvent,{name:DS.enable(),value:{}})},c=function(t,e){return u(t),d.updateSrc(t,e)},s=function(t,e,n,r,s){return u(t),function(t){return AC(t)}(e).then(n).then(i).then(r).then((function(e){return c(t,e).then((function(e){return o(t),s(),a(t),e}))})).catch((function(e){return console.log(e),a(t),e}))},l=function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(t){return r.updateTempState(t)}),n)},f=function(t){var e=r.getBlobState().url;return r.destroyTempState(),o(t),e},d=WS(e.currentState.url),m=function(t){var e=Rg(qS("Undo","undo",!0,(function(t){Vr(t,NS.undo(),{direction:1})}),t)),n=Rg(qS("Redo","redo",!0,(function(t){Vr(t,NS.redo(),{direction:1})}),t));return{container:Vb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),qS("Zoom in","zoom-in",!1,(function(t){Vr(t,NS.zoom(),{direction:1})}),t),qS("Zoom out","zoom-out",!1,(function(t){Vr(t,NS.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){$S(t,r)})),n.getOpt(t).each((function(t){$S(t,o)}))}}}(n),g=BS(d,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[g.memContainer.asSpec(),d.memContainer.asSpec(),m.container],behaviours:La([ll.config({store:{mode:"manual",getValue:function(){return r.getBlobState()}}}),Nm("image-tools-events",[Kr(NS.undo(),(function(t,e){var n=r.undo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.redo(),(function(t,e){var n=r.redo();c(t,n).then((function(e){a(t),o(t)}))})),Kr(NS.zoom(),(function(t,e){var n=e.event.direction;d.zoom(t,n)})),Kr(NS.back(),(function(t,e){!function(t){var e=f(t);c(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),d.hideCrop()})),Kr(NS.apply(),(function(t,e){r.applyTempState((function(){f(t),(0,e.event.swap)()}))})),Kr(NS.transform(),(function(e,n){return l(e,n.event.transform,t)})),Kr(NS.tempTransform(),(function(e,n){return function(e,n){var o=r.getTempState().blob;s(e,o,n,(function(t){return r.addTempState(t)}),t)}(e,n.event.transform)})),Kr(NS.transformApply(),(function(t,e){return function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(e){var n=r.addBlobState(e);return f(t),n}),n)}(t,e.event.transform,e.event.swap)})),Kr(NS.swap(),(function(t,e){!function(t){m.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){l(t,e,r)}))}))]),tC()])}},XS=function(t){return!Tt(t,"items")},KS="data-value",YS=function(t,e,n,r){return V(n,(function(n){return XS(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){ll.setValue(t,n.value),Vr(t,ty,{name:e}),Bm.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return YS(t,e,n.items,r)}}}))},JS=function(t,e){return it(t,(function(t){return XS(t)?pf(t.value===e,t):JS(t.items,e)}))},QS=mf({name:"HtmlSelect",configFields:[_e("options"),fl("selectBehaviours",[Bm,ll]),je("selectClasses",[]),je("selectAttributes",{}),Pe("data")],factory:function(t,e){var n=V(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Vt("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:ml(t.selectBehaviours,[Bm.config({}),ll.config({store:f({mode:"manual",getValue:function(t){return qi(t.element)},setValue:function(e,n){G(t.options,(function(t){return t.value===n})).isSome()&&$i(e.element,n)}},r)})])}}}),ZS=function(t,e){var n=t.label.map((function(t){return Zb(t,e)})),o=[kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),ev(),km.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Fr(t,oy),x.some(!0)}}),Nm("textfield-change",[Kr(cr(),(function(e,n){Vr(e,ty,{name:t.name})})),Kr(vr(),(function(e,n){Vr(e,ty,{name:t.name})}))]),Xb.config({})],i=t.validation.map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=ll.getValue(e),r=t.validator(n);return Sy(!0===r?ct.value(n):ct.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),u=t.placeholder.fold(r({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(r({}),(function(t){return{inputmode:t}})),c=f(f({},u),a),s=qb.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:c,inputClasses:[t.classname],inputBehaviours:La(K([o,i])),selectOnFocus:!1,factory:my}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),d=[kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()];return Yb(n,s,l,d)},tk=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return $r([Kr(t.event,n),oo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Kr(t,(function(){return e.cancel()}))]})).getOr([])))}}),ek=function(t){var e=Qe(null);return ui({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},nk=Object.freeze({__proto__:null,throttle:ek,init:function(t){return t.stream.streams.state(t)}}),rk=[Ee("stream",ve("mode",{throttle:[_e("delay"),je("stopEvent",!0),Zu("streams",{setup:function(t,e){var n=t.stream,r=Lg(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:ek})]})),je("event","input"),Pe("cancelEvent"),Ju("onStream")],ok=Fa({fields:rk,name:"streaming",active:tk,state:nk}),ik=function(t,e,n){var r=ll.getValue(n);ll.setValue(e,r),ak(e)},uk=function(t,e){var n=t.element,r=qi(n),o=n.dom;"number"!==Do(n,"type")&&e(o,r)},ak=function(t){uk(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},ck=r("alloy.typeahead.itemexecute"),sk=r([Pe("lazySink"),_e("fetch"),je("minChars",5),je("responseTime",1e3),Ku("onOpen"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),je("layouts",x.none()),je("eventOrder",{}),Ye("model",{},[je("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),je("selectsOver",!0),je("populateFromBrowse",!0)]),Ku("onSetValue"),Yu("onExecute"),Ku("onItemExecute"),je("inputClasses",[]),je("inputAttributes",{}),je("inputStyles",{}),je("matchWidth",!0),je("useMinWidth",!1),je("dismissOnBlur",!0),Gu(["openClass"]),Pe("initialData"),fl("typeaheadBehaviours",[Bm,ll,ok,km,Gm,Py]),Je("previewing",(function(){return Qe(!0)}))].concat(sy()).concat(Gy())),lk=r([Hl({schema:[$u()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){(function(t,e,n){if(t.selectsOver){var r=ll.getValue(e),o=t.getDisplayText(r),i=ll.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?x.some((function(){ik(0,e,n),function(t,e){uk(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):x.none()}return x.none()})(t.model,r,n).fold((function(){return Nf.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Vr(t,ck(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&ik(t.model,e,n)}))}}}})]),fk=gf({name:"Typeahead",configFields:sk(),partFields:lk(),factory:function(e,n,r,o){var i=function(n,r,i){e.previewing.set(!1);var u=Py.getCoupled(n,"sandbox");Ws.isOpen(u)?wf.getCurrent(u).each((function(t){Nf.getHighlighted(t).fold((function(){i(t)}),(function(){qr(u,t.element,"keydown",r)}))})):Fy(e,a(n),n,u,o,(function(t){wf.getCurrent(t).each(i)}),py.HighlightFirst).get(t)},u=ly(e),a=function(t){return function(e){return e.map((function(e){var n=kt(e.menus),r=Y(n,(function(t){return W(t.items,(function(t){return"item"===t.type}))}));return ll.getState(t).update(V(r,(function(t){return t.data}))),e}))}},c=[Bm.config({}),ll.config({onSetValue:e.onSetValue,store:f({mode:"dataset",getDataKey:function(t){return qi(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){$i(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(t){return Vt("initialValue",t)})).getOr({}))}),ok.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(n,r){var i=Py.getCoupled(n,"sandbox");if(Bm.isFocused(n)&&qi(n.element).length>=e.minChars){var u=wf.getCurrent(i).bind((function(t){return Nf.getHighlighted(t).map(ll.getValue)}));e.previewing.set(!0),Fy(e,a(n),n,i,o,(function(t){wf.getCurrent(i).each((function(t){u.fold((function(){e.model.selectsOver&&Nf.highlightFirst(t)}),(function(e){Nf.highlightBy(t,(function(t){return ll.getValue(t).value===e.value})),Nf.getHighlighted(t).orThunk((function(){return Nf.highlightFirst(t),x.none()}))}))}))}),py.HighlightFirst).get(t)}},cancelEvent:kr()}),km.config({mode:"special",onDown:function(t,e){return i(t,e,Nf.highlightFirst),x.some(!0)},onEscape:function(t){var e=Py.getCoupled(t,"sandbox");return Ws.isOpen(e)?(Ws.close(e),x.some(!0)):x.none()},onUp:function(t,e){return i(t,e,Nf.highlightLast),x.some(!0)},onEnter:function(t){var n=Py.getCoupled(t,"sandbox"),r=Ws.isOpen(n);if(r&&!e.previewing.get())return wf.getCurrent(n).bind((function(t){return Nf.getHighlighted(t)})).map((function(e){return Vr(t,ck(),{item:e}),!0}));var o=ll.getValue(t);return Fr(t,kr()),e.onExecute(n,t,o),r&&Ws.close(n),x.some(!0)}}),Gm.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Py.config({others:{sandbox:function(t){return qy(e,t,{onOpen:function(){return Gm.on(t)},onClose:function(){return Gm.off(t)}})}}}),Nm("typeaheadevents",[uo((function(n){var r=t;jy(e,a(n),n,o,r,py.HighlightFirst).get(t)})),Kr(ck(),(function(t,n){var r=Py.getCoupled(t,"sandbox");ik(e.model,t,n.event.item),Fr(t,kr()),e.onItemExecute(t,r,n.event.item,ll.getValue(t)),Ws.close(r),ak(t)}))].concat(e.dismissOnBlur?[Kr(pr(),(function(t){var e=Py.getCoupled(t,"sandbox");Xa(e.element).isNone()&&Ws.close(e)}))]:[]))];return{uid:e.uid,dom:dy(Rt(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:f(f({},u),ml(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}}}),dk=function(t){return f(f({},t),{toCached:function(){return dk(t.toCached())},bindFuture:function(e){return dk(t.bind((function(t){return t.fold((function(t){return Sy(ct.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return dk(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return dk(t.map((function(t){return t.map(e)})))},mapError:function(e){return dk(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return dk(Cy((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ct.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},mk=function(t){return dk(Cy(t))},gk={type:"separator"},hk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},pk=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},vk=function(t,e){return function(t){return V(t,hk)}(function(t,e){return W(e,(function(e){return e.type===t}))}(t,e))},bk=function(t){return vk("header",t.targets)},yk=function(t){return vk("anchor",t.targets)},wk=function(t){return x.from(t.anchorTop).map((function(t){return pk("<top>",t)})).toArray()},xk=function(t){return x.from(t.anchorBottom).map((function(t){return pk("<bottom>",t)})).toArray()},Ck=function(t,e){var n=t.toLowerCase();return W(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return ln(e.toLowerCase(),n)||ln(t.value.toLowerCase(),n)}))},Sk=Uo("aria-invalid"),kk=function(t){return function(e,n,r){return Ot(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},Ok={bar:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),collection:kk((function(t,e){return function(t,e){var n,r,i=t.label.map((function(t){return Zb(t,e)})),u=function(t){return function(e,n){Du(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Do(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||Vr(n,ry,{name:t.name,value:i})})),c=[Kr(rr(),u((function(t,e,n){$a(n)}))),Kr(lr(),a),Kr(xr(),a),Kr(or(),u((function(t,e,n){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)})),vi(n,Sh)}))),Kr(ir(),u((function(t){zu(t.element,"."+Sh).each((function(t){bi(t,Sh)}))}))),uo(u((function(e,n,r,o){Vr(e,ry,{name:t.name,value:o})})))],s=function(t,e){return V(Fc(t.element,".tox-collection__item"),e)},l=qb.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:o},behaviours:La([kp.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){vi(t,"tox-collection__item--state-disabled"),zo(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){bi(t,"tox-collection__item--state-disabled"),Io(t,"aria-disabled")}))}}),ev(),Am.config({}),ll.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=V(r,(function(n){var r=lp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Kb.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?F(o,t.columns):[o],u=V(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ro(n.element,u.join(""))}(n,r),"auto"===t.columns&&Zh(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;km.setGridSize(n,e,r)})),Fr(n,cy)}}),Xb.config({}),km.config((r=t.columns,1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+bh}})),Nm("collection-events",c)]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Yb(i,l,["tox-form__group--collection"],[])}(t,e.shared.providers)})),alertbanner:kk((function(t,e){return function(t,e){return Vb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:zg(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Vr(e,ry,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:kk((function(t,e){return function(t,e){return ZS({name:t.name,multiline:!0,label:t.label,inputMode:x.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:x.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:kk((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=V(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:La([tC(),Am.config({}),lC(x.none()),km.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Rt(n,{source:"dynamic"});return kk(t)(e,o,r)}}((function(t,e){return function(t,e){var n=yC&&t.sandboxed,r=f(f({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=Qe("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)zo(n.element,"srcdoc",r);else{zo(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Zb(t,e)})),u=qb.parts.field({factory:{sketch:function(t){return hC({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:La([Xb.config({}),Bm.config({}),sC(x.none(),o.getValue,o.setValue)])})}}});return Yb(i,u,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),button:kk((function(t,e){return function(t,e){var n,r,o=wS(t.name,"custom");return n=x.none(),r=qb.parts.field(f({factory:Ng},bS(t,x.some(o),e,[fC(""),tC()]))),Yb(n,r,[],[])}(t,e.shared.providers)})),checkbox:kk((function(t,e){return function(t,e){var n=ll.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),x.some(!0)},i=qb.parts.field({factory:{sketch:o},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:La([tC(),kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Bm.config({}),n,km.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Nm("checkbox-events",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),u=qb.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:La([Jy.config({})])}),a=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:zg("checked"===t?"selected":"unselected",e.icons)}}},c=Rg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return qb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,c.asSpec(),u],fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),colorinput:kk((function(t,e){return function(t,e,n){var r=qb.parts.field({factory:my,inputClasses:["tox-textfield"],onSetValue:function(t){return zy.run(t).get((function(){}))},inputBehaviours:La([kp.config({disabled:e.providers.isDisabled}),ev(),Xb.config({}),zy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return bo(t.element)},notify:{onValid:function(t){var e=ll.getValue(t);Vr(t,Qy,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=ll.getValue(t);if(0===e.length)return Sy(ct.value(!0));var n=en("span");Bi(n,"background-color",e);var r=Fi(n,"background-color").fold((function(){return ct.error("blah")}),(function(t){return ct.value(e)}));return Sy(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Zb(t,e.providers)})),i=function(t,e){Vr(t,Zy,{value:e})},u=Rg(function(t,e){return Yy.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:La([nv(e.providers.isDisabled),ev(),Jy.config({}),Xb.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Cy((function(e){return t.fetch(e)})).map((function(r){return x.from(Sb(Rt(sb(Uo("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,ph.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:fb(t.columns,t.presets)})))}))},parts:{menu:Mh(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[wa,ya,ka]},onLtr:function(){return[ya,wa,ka]}},components:[],fetch:ob(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Fr(t,tw)}),(function(e){i(t,e),tb(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:La([Nm("form-field-events",[Kr(Qy,(function(e,n){u.getOpt(e).each((function(t){Bi(t.element,"background-color",n.event.color)})),Vr(e,ty,{name:t.name})})),Kr(Zy,(function(t,e){qb.getField(t).each((function(n){ll.setValue(n,e.event.value),wf.getCurrent(t).each(Bm.focus)}))})),Kr(tw,(function(t,e){qb.getField(t).each((function(e){wf.getCurrent(t).each(Bm.focus)}))}))])])})}(t,e.shared,e.colorinput)})),colorpicker:kk((function(t){var e=function(t){return"tox-"+t},n=Zx(rC,e),r=Rg(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Vr(t,ry,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:La([ll.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return wf.getCurrent(e).bind((function(t){return ll.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);wf.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){ll.setValue(t,{hex:x.from(n[1]).getOr("")}),Gx.getField(t,"hex").each((function(t){Fr(t,cr())}))}))}}}),tC()])}})),dropzone:kk((function(t,e){return function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,(function(t){t(e,n)}))}},o=function(t,e){if(!kp.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){ll.setValue(n,function(t,e){var n=iC.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return W(ot(t),(function(t){return L(n,(function(e){return fn(t.name,"."+e)}))}))}(r,e)),Vr(n,ty,{name:t.name})},a=Rg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:La([Nm("input-file-events",[to(lr()),to(xr())])])}),c=t.label.map((function(t){return Zb(t,e)})),s=qb.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:La([fC([]),tC(),kp.config({}),Gm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Nm("dropzone-events",[Kr("dragenter",r([n,Gm.toggle])),Kr("dragleave",r([n,Gm.toggle])),Kr("dragover",n),Kr("drop",r([n,o])),Kr(sr(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Ng.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:La([Xb.config({}),nv(e.isDisabled),ev()])})]}]}}}});return Yb(c,s,["tox-form__group--stretched"],[])}(t,e.shared.providers)})),grid:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:V(t.items,e.interpreter)}}(t,e.shared)})),listbox:kk((function(e,n){return function(e,n){var o=n.shared.providers,i=nt(e.items).filter(XS),u=e.label.map((function(t){return Zb(t,o)})),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[qb.parts.field({dom:{},factory:{sketch:function(o){return aS({uid:o.uid,text:i.map((function(t){return t.text})),icon:x.none(),tooltip:e.label,role:x.none(),fetch:function(t,r){var o=YS(t,e.name,e.items,ll.getValue(t));r(fS(o,ph.CLOSE_ON_EXECUTE,n,!1))},onSetup:r(t),getApi:r({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xb.config({}),ll.config({store:{mode:"manual",initialValue:i.map((function(t){return t.value})).getOr(""),getValue:function(t){return Do(t.element,KS)},setValue:function(t,n){JS(e.items,n).each((function(e){zo(t.element,KS,e.value),Vr(t,iS,{text:e.text})}))}}})]},"tox-listbox",n.shared)}}})]};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([u.toArray(),[a]]),fieldBehaviours:La([kp.config({disabled:r(e.disabled),onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}})])})}(e,n)})),selectbox:kk((function(t,e){return function(t,e){var n=V(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Zb(t,e)})),o=qb.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:QS,selectBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()}}),Xb.config({}),Nm("selectbox-change",[Kr(sr(),(function(e,n){Vr(e,ty,{name:t.name})}))])])}),i=t.size>1?x.none():x.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:zg("chevron-down",e.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:K([[o],i.toArray()])};return qb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:K([r.toArray(),[u]]),fieldBehaviours:La([kp.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable)}}),ev()])})}(t,e.shared.providers)})),sizeinput:kk((function(t,e){return AS(t,e.shared.providers)})),urlinput:kk((function(e,n){return function(e,n,r){var o,i=n.shared.providers,u=function(t){var n=ll.getValue(t);r.addToHistory(n.value,e.filetype)},a=qb.parts.field({factory:fk,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":Sk,type:"url"},minChars:0,responseTime:0,fetch:function(t){var o=function(t,e,n){var r=ll.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=Ck(o,function(t){return V(t,(function(t){return pk(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,Ck(o,bk(e)),Ck(o,K([wk(e),yk(e),xk(e)]))],$(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(gk,e)}),[])):i}))}(e.filetype,t,r),i=fS(o,ph.BUBBLE_TO_SANDBOX,n,!1);return Sy(i)},getHotspot:function(t){return g.getOpt(t)},onSetValue:function(e,n){e.hasConfigured(zy)&&zy.run(e).get(t)},typeaheadBehaviours:La(K([r.getValidationHandler().map((function(t){return zy.config({getRoot:function(t){return bo(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){zo(t.element,"title",i.translate(e))}))}},validator:{validate:function(n){var r=ll.getValue(n);return mk((function(n){t({type:e.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ct.error(t.message);n(e)}else{var r=ct.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[kp.config({disabled:function(){return e.disabled||i.isDisabled()}}),Xb.config({}),Nm("urlinput-events",K(["file"===e.filetype?[Kr(cr(),(function(t){Vr(t,ty,{name:e.name})}))]:[],[Kr(sr(),(function(t){Vr(t,ty,{name:e.name}),u(t)})),Kr(vr(),(function(t){Vr(t,ty,{name:e.name}),u(t)}))]]))]])),eventOrder:(o={},o[cr()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:Mh(0,0,"normal")},onExecute:function(t,e,n){Vr(e,oy,{})},onItemExecute:function(t,n,r,o){u(t),Vr(t,ty,{name:e.name})}}),c=e.label.map((function(t){return Zb(t,i)})),s=Rg(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:zg(n,i.icons),attributes:f({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}}("invalid",x.some(Sk),"warning")),l=Rg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),d=r.getUrlPicker(e.filetype),m=Uo("browser.url.event"),g=Rg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()}})])}),h=Rg(yS({name:e.name,icon:x.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(t){return Fr(t,m)}),i,[],["tox-browse-url"]));return qb.sketch({dom:Qb([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:K([[g.asSpec()],d.map((function(){return h.asSpec()})).toArray()])}]),fieldBehaviours:La([kp.config({disabled:function(){return e.disabled||i.isDisabled()},onDisabled:function(t){qb.getField(t).each(kp.disable),h.getOpt(t).each(kp.disable)},onEnabled:function(t){qb.getField(t).each(kp.enable),h.getOpt(t).each(kp.enable)}}),ev(),Nm("url-input-events",[Kr(m,(function(t){wf.getCurrent(t).each((function(n){var r=ll.getValue(n),o=f({fieldname:e.name},r);d.each((function(r){r(o).get((function(r){ll.setValue(n,r),Vr(t,ty,{name:e.name})}))}))}))}))])])})}(e,n,n.urlinput)})),customeditor:kk((function(t){var e=Qe(x.none()),n=Rg({dom:{tag:t.tag}}),r=Qe(x.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:La([Nm("custom-editor-events",[ro((function(o){n.getOpt(o).each((function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?oC.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(x.none()),e.set(x.some(t))}))}))}))]),ll.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(x.some(n))}),(function(t){return t.setValue(n)}))}}}),tC()]),components:[n.asSpec()]}})),htmlpanel:kk((function(t){return"presentation"===t.presets?Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Vb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:La([Xb.config({}),Bm.config({})])})})),imagetools:kk((function(t,e){return GS(t,e.shared.providers)})),table:kk((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(r,(function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}}))}]}),(n=t.cells,{dom:{tag:"tbody"},components:V(n,(function(t){return{dom:{tag:"tr"},components:V(t,o)}}))})],behaviours:La([Xb.config({}),Bm.config({})])}}(t,e.shared.providers)})),panel:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:V(t.items,e.shared.interpreter)}}(t,e)}))},Tk={field:function(t,e){return e}},_k=function(t,e,n){var r=Rt(n,{shared:{interpreter:function(e){return Ek(t,e,r)}}});return Ek(t,e,r)},Ek=function(t,e,n){return Ot(Ok,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},Ak={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Nk=function(t,e,n){var r=hc(-12,12,Ak),o={maxHeightFunction:fc()};return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),bubble:r,layouts:{onRtl:function(){return[Tg]},onLtr:function(){return[Og]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[ya]},onLtr:function(){return[wa]}},overrides:o}}},Rk=function(t,e,n){return function(){return n()?{anchor:"node",root:_i(t()),node:x.from(t()),layouts:{onRtl:function(){return[_g]},onLtr:function(){return[_g]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ka]},onLtr:function(){return[ka]}}}}},Mk=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return x.some(Ac.range(rn(e.startContainer),e.startOffset,rn(e.endContainer),e.endOffset))}}}},zk=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},Dk=function(t,e,n){var r=Up(t),o=function(){return rn(t.getBody())},i=function(){return rn(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:Nk(i,e,u),banner:Rk(i,e,u),cursor:Mk(t,o),node:zk(o)}},Bk=function(t){return function(e,n){cb(t)(e,n)}},Pk=function(t){return function(){return Qv(t)}},Ik=function(t){return function(){return Zv(t)}},Lk=function(t){return function(){return eb(t)}},Hk=function(t){return{colorPicker:Bk(t),hasCustomColors:Pk(t),getColors:Ik(t),getColorCols:Lk(t)}},Fk=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},Vk=function(t){return{isDraggableModal:Fk(t)}},jk=[{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"}]}],Uk=function(t){return $(t,(function(t,e){if(Tt(e,"items")){var n=Uk(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(Tt(e,"inline")||function(t){return Tt(t,"block")}(e)||function(t){return Tt(t,"selector")}(e)){var r="custom-"+(k(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return f(f({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},Wk=function(t){return function(t){return x.from(t.getParam("style_formats")).filter(T)}(t).map((function(e){var n=function(t,e){var n=Uk(e),r=function(e){j(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?jk.concat(n):n})).getOr(jk)},qk=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Rt(t,r)},$k=function(t,e,n,r){var o=function(e){return V(e,(function(e){var i=vt(e);if(_t(e,"items")){var u=o(e.items);return Rt(function(t){return Rt(t,{type:"submenu"})}(e),{getStyleItems:function(){return u}})}return _t(e,"format")?function(t){return qk(t,n,r)}(e):1===i.length&&I(i,"title")?Rt(e,{type:"separator"}):function(e){var o=k(e.name)?e.name:Uo(e.title),i="custom-"+o,u={type:"formatter",format:i,isSelected:n(i),getStylePreview:r(i)},a=Rt(e,u);return t.formatter.register(o,a),a}(e)}))};return o(e)},Gk=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,r):[t.format]},o=Qe([]),i=Qe([]),u=Qe([]),a=Qe([]),c=Qe(!1);return t.on("PreInit",(function(u){var a=Wk(t),c=$k(t,a,e,n);o.set(c),i.set(Y(c,r))})),t.on("addStyleModifications",(function(o){var i=$k(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Y(i,r))})),{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},Xk=iC.trim,Kk=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Yk=Kk("true"),Jk=Kk("false"),Qk=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},Zk=function(t){return t.innerText||t.textContent},tO=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&nO(t)},eO=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},nO=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Yk(t)}return!1}(t)&&!Jk(t)},rO=function(t){return eO(t)&&nO(t)},oO=function(t){var e=function(t){return t.id?t.id:Uo("h")}(t);return Qk("header",Zk(t),"#"+e,function(t){return eO(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},iO=function(e){var n=e.id||e.name,r=Zk(e);return Qk("anchor",r||"#"+n,"#"+n,0,t)},uO=function(t){return Xk(t.title).length>0},aO=function(t){var e=function(t){return V(Fc(rn(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),(function(t){return t.dom}))}(t);return W(function(t){return V(W(t,rO),oO)}(e).concat(function(t){return V(W(t,tO),iO)}(e)),uO)},cO="tinymce-url-history",sO=function(t){return k(t)&&/^https?/.test(t)},lO=function(t){return O(t)&&St(t,(function(t){return!(T(e=t)&&e.length<=5&&J(e,sO));var e})).isNone()},fO=function(){var t,e=Gv.getItem(cO);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+cO+" was not valid JSON",t),{};throw t}return lO(t)?t:(console.log("Local storage "+cO+" was not valid format",t),{})},dO=function(t){var e=fO();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},mO=function(t,e){if(sO(t)){var n=fO(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=W(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!lO(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Gv.setItem(cO,JSON.stringify(t))}(n)}},gO=function(t){return!!t},hO=function(t){return wt(iC.makeMap(t,/[, ]/),gO)},pO=function(t){return x.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(N)},vO=function(t){return x.from(t).filter(k).getOrUndefined()},bO=function(t){return{getHistory:dO,addToHistory:mO,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?x.none():x.some({targets:aO(t.getBody()),anchorTop:vO(Kp(t)),anchorBottom:vO(Yp(t))})}(t)},getValidationHandler:function(){return function(t){return x.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return function(t,e){var n=function(t){var e=x.some(function(t){return t.getParam("file_picker_types")}(t)).filter(gO),n=x.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(gO),r=e.or(n).map(hO);return pO(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return vt(t).length>0&&t}))}))}(t);return _(n)?n?pO(t):x.none():n[e]?pO(t):x.none()}(t,e).map((function(n){return function(r){return Cy((function(o){var i=f({filetype:e,fieldname:r.fieldname},x.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!k(t))throw new Error("Expected value to be string");if(void 0!==e&&!O(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})}),r.value,i)}))}}))}(t,e)}}},yO=r((function(t,e){!function(t,e){var n=lu.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Bi(t,"max-width",n+"px")}(t,Math.floor(e))})),wO="contexttoolbar-hide",xO=r([_e("dom"),je("shell",!0),fl("toolbarBehaviours",[Am])]),CO=r([Fl({name:"groups",overrides:function(){return{behaviours:La([Am.config({})])}}})]),SO=gf({name:"Toolbar",configFields:xO(),partFields:CO(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.toolbarBehaviours,o.behaviours),apis:{setGroups:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"groups")).fold((function(){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")}),(function(t){Am.set(t,n)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),kO=function(t,e,n){return{within:t,extra:e,withinWidth:n}},OO=function(t,e,n){var o,i=(o=function(t,e){var r=n(t);return x.some({element:t,start:e,finish:e+r,width:r})},$(t,(function(t,e){return o(e,t.len).fold(r(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),u=W(i,(function(t){return t.finish<=e})),a=q(u,(function(t,e){return t+e.width}),0);return{within:u,extra:i.slice(u.length),withinWidth:a}},TO=function(t){return V(t,(function(t){return t.element}))},_O=function(t,e){var n=V(e,(function(t){return tu(t)}));SO.setGroups(t,n)},EO=function(t,e,n){var r=Zl(t,e,"primary"),o=Py.getCoupled(t,"overflowGroup");Bi(r.element,"visibility","hidden");var i=e.builtGroups.get().concat([o]),u=it(i,(function(t){return Xa(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),_O(r,i);var a=function(t,e,n,r){var o=function(t,e,n){var r=OO(e,t,n);return 0===r.extra.length?x.some(r):x.none()}(t,e,n).getOrThunk((function(){return OO(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=TO(t.concat(e));return kO(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=TO(t).concat([n]);return kO(o,TO(e),r)}(i,u,r,a):function(t,e,n){return kO(TO(t),[],n)}(i,0,a)}(fu(r.element),e.builtGroups.get(),(function(t){return fu(t.element)}),o);0===a.extra.length?(Am.remove(r,o),n([])):(_O(r,a.within),n(a.extra)),Ui(r.element,"visibility"),Wi(r.element),u.each(Bm.focus)},AO=r([fl("splitToolbarBehaviours",[Py]),Je("builtGroups",(function(){return Qe([])}))]),NO=r([Gu(["overflowToggledClass"]),Fe("getOverflowBounds"),_e("lazySink"),Je("overflowGroups",(function(){return Qe([])}))].concat(AO())),RO=r([Ll({factory:SO,schema:xO(),name:"primary"}),Hl({schema:xO(),name:"overflow"}),Hl({name:"overflow-button"}),Hl({name:"overflow-group"})]),MO=r([Gu(["toggledClass"]),_e("lazySink"),Me("fetch"),Fe("getBounds"),Ve("fireDismissalEventInstead",[je("event",Mr())]),xc()]),zO=r([Hl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:La([Gm.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Hl({factory:SO,schema:xO(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:La([km.config({mode:"cyclic",onEscape:function(e){return Ql(e,t,"button").each(Bm.focus),x.none()}})])}}})]),DO=function(t,e){var n=Py.getCoupled(t,"toolbarSandbox");Ws.isOpen(n)?Ws.close(n):Ws.open(n,e.toolbar())},BO=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Cs.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:yO()}},e,o)},PO=function(t,e,n,r,o){SO.setGroups(e,o),BO(t,e,n,r),Gm.on(t)},IO=gf({name:"FloatingToolbarButton",factory:function(t,e,n,r){return f(f({},Ng.sketch(f(f({},r.button()),{action:function(t){DO(t,r)},buttonBehaviours:hl({dump:r.button().buttonBehaviours},[Py.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Bu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:La([km.config({mode:"special",onEscape:function(t){return Ws.close(t),x.some(!0)}}),Ws.config({onOpen:function(o,i){n.fetch().get((function(o){PO(t,i,n,e.layouts,o),r.link(t.element),km.focusIn(i)}))},onClose:function(){Gm.off(t),Bm.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return Pu(n,r)||Pu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Wa.config({channels:f(f({},Ks(f({isExtraPart:c},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Js({doReposition:function(){Ws.getState(Py.getCoupled(t,"toolbarSandbox")).each((function(r){BO(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(o){PO(e,o,t,n.layouts,r)}))},reposition:function(e){Ws.getState(Py.getCoupled(e,"toolbarSandbox")).each((function(r){BO(e,r,t,n.layouts)}))},toggle:function(t){DO(t,r)},getToolbar:function(t){return Ws.getState(Py.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Ws.isOpen(Py.getCoupled(t,"toolbarSandbox"))}}})},configFields:MO(),partFields:zO(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),LO=r([_e("items"),Gu(["itemSelector"]),fl("tgroupBehaviours",[km])]),HO=r([Vl({name:"items",unit:"item"})]),FO=gf({name:"ToolbarGroup",configFields:LO(),partFields:HO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.tgroupBehaviours,[km.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),VO=function(t){return V(t,(function(t){return tu(t)}))},jO=function(t,e,n){EO(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){IO.setGroups(t,VO(r))}))}))},UO=gf({name:"SplitFloatingToolbar",configFields:NO(),partFields:RO(),factory:function(t,e,n,r){var o=Rg(IO.sketch({fetch:function(){return Cy((function(e){e(VO(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[wa,ya]},onRtl:function(){return[ya,wa]},onBottomLtr:function(){return[Ca,xa]},onBottomRtl:function(){return[xa,Ca]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(){return FO.sketch(f(f({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(V(n,e.getSystem().build)),jO(e,o,t)},refresh:function(e){return jO(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){IO.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(IO.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){IO.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(IO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),WO=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},qO=function(t){return t.dimension.property},$O=function(t,e){return t.dimension.getDimension(e)},GO=function(t,e){var n=WO(t,e);xi(n,[e.shrinkingClass,e.growingClass])},XO=function(t,e){bi(t.element,e.openClass),vi(t.element,e.closedClass),Bi(t.element,qO(e),"0px"),Wi(t.element)},KO=function(t,e){bi(t.element,e.closedClass),vi(t.element,e.openClass),Ui(t.element,qO(e))},YO=function(t,e,n,r){n.setCollapsed(),Bi(t.element,qO(e),$O(e,t.element)),Wi(t.element),GO(t,e),XO(t,e),e.onStartShrink(t),e.onShrunk(t)},JO=function(t,e,n,r){var o=r.getOrThunk((function(){return $O(e,t.element)}));n.setCollapsed(),Bi(t.element,qO(e),o),Wi(t.element);var i=WO(t,e);bi(i,e.growingClass),vi(i,e.shrinkingClass),XO(t,e),e.onStartShrink(t)},QO=function(t,e,n){var r=$O(e,t.element);("0px"===r?YO:JO)(t,e,n,x.some(r))},ZO=function(t,e,n){var r=WO(t,e),o=yi(r,e.shrinkingClass),i=$O(e,t.element);KO(t,e);var u=$O(e,t.element);(o?function(){Bi(t.element,qO(e),i),Wi(t.element)}:function(){XO(t,e)})(),bi(r,e.shrinkingClass),vi(r,e.growingClass),KO(t,e),Bi(t.element,qO(e),u),n.setExpanded(),e.onStartGrow(t)},tT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.growingClass)},eT=function(t,e,n){var r=WO(t,e);return!0===yi(r,e.shrinkingClass)},nT=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Ui(t.element,qO(e));var r=$O(e,t.element);Bi(t.element,qO(e),r)}},grow:function(t,e,n){n.isExpanded()||ZO(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&QO(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&YO(t,e,n,x.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:tT,isShrinking:eT,isTransitioning:function(t,e,n){return!0===tT(t,e)||!0===eT(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?QO:ZO)(t,e,n)},disableTransitions:GO}),rT=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return ci(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Vt(e.dimension.property,"0px")})},events:function(t,e){return $r([no(fr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(GO(n,t),e.isExpanded()&&Ui(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),oT=[_e("closedClass"),_e("openClass"),_e("shrinkingClass"),_e("growingClass"),Pe("getAnimationRoot"),Ku("onShrunk"),Ku("onStartShrink"),Ku("onGrown"),Ku("onStartGrow"),je("expanded",!1),Ee("dimension",ve("property",{width:[Zu("property","width"),Zu("getDimension",(function(t){return fu(t)+"px"}))],height:[Zu("property","height"),Zu("getDimension",(function(t){return ru(t)+"px"}))]}))],iT=Fa({fields:oT,name:"sliding",active:rT,apis:nT,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(t.expanded);return ui({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:i(e.set,!1),setExpanded:i(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),uT=r([Gu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ku("onOpened"),Ku("onClosed")].concat(AO())),aT=r([Ll({factory:SO,schema:xO(),name:"primary"}),Ll({factory:SO,schema:xO(),name:"overflow",overrides:function(t){return{toolbarBehaviours:La([iT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Ql(e,t,"overflow-button").each((function(t){Gm.off(t),Bm.focus(t)})),t.onClosed(e)},onGrown:function(e){km.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Ql(e,t,"overflow-button").each(Gm.on)}}),km.config({mode:"acyclic",onEscape:function(e){return Ql(e,t,"overflow-button").each(Bm.focus),x.some(!0)}})])}}}),Hl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:La([Gm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Hl({name:"overflow-group"})]),cT=function(t,e){Ql(t,e,"overflow-button").bind((function(){return Ql(t,e,"overflow")})).each((function(n){sT(t,e),iT.toggleGrow(n)}))},sT=function(t,e){Ql(t,e,"overflow").each((function(n){EO(t,e,(function(t){var e=V(t,(function(t){return tu(t)}));SO.setGroups(n,e)})),Ql(t,e,"overflow-button").each((function(t){iT.hasGrown(n)&&Gm.on(t)})),iT.refresh(n)}))},lT=gf({name:"SplitSlidingToolbar",configFields:uT(),partFields:aT(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:ml(t.splitToolbarBehaviours,[Py.config({others:{overflowGroup:function(t){return FO.sketch(f(f({},r["overflow-group"]()),{items:[Ng.sketch(f(f({},r["overflow-button"]()),{action:function(e){Fr(t,o)}}))]}))}}}),Nm("toolbar-toggle-events",[Kr(o,(function(e){cT(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=V(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),sT(e,t)},refresh:function(e){return sT(e,t)},toggle:function(e){return cT(e,t)},isOpen:function(e){return function(t,e){return Ql(t,e,"overflow").map(iT.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),fT=r(Uo("toolbar-height-change")),dT=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:f({tag:"div",classes:["tox-toolbar__group"]},e),components:[FO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:La([Xb.config({}),Bm.config({})])}},mT=function(t){return FO.sketch(dT(t))},gT=function(t,e){var n=ro((function(e){var n=V(t.initGroups,mT);SO.setGroups(e,n)}));return La([ov(t.providers.isDisabled),ev(),km.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Nm("toolbar-events",[n])])},hT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":dT({title:x.none(),items:[]}),"overflow-button":pS({name:"more",icon:x.some("more-drawer"),disabled:!1,tooltip:x.some("More..."),primary:!1,borderless:!1},x.none(),t.providers)},splitToolbarBehaviours:gT(t,e)}},pT=function(t){var e=hT(t),n=UO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return UO.sketch(f(f({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Ou(e),r=po(e),o=Ou(r),i=Math.max(r.dom.scrollHeight,o.height);return Su(n.x+4,o.y,n.width-8,i)},parts:f(f({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},vT=function(t){var e=lT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=lT.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=hT(t);return lT.sketch(f(f({},r),{components:[e,n],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:function(t){t.getSystem().broadcastOn([fT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([fT()],{type:"closed"})}}))},bT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return SO.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===hh.scrolling?["tox-toolbar--scrolling"]:[])},components:[SO.parts.groups({})],toolbarBehaviours:gT(t,e)})},yT=Zt([Ne("type"),Ee("items",ee([ce([Ne("name"),Be("items",xe)]),xe]))].concat(eh)),wT=[He("text"),He("tooltip"),He("icon"),Me("fetch"),Xe("onSetup",(function(){return t}))],xT=Zt(m([Ne("type")],wT)),CT=function(t){return de("menubutton",xT,t)},ST=Zt([Ne("type"),He("tooltip"),He("icon"),He("text"),Fe("select"),Me("fetch"),Xe("onSetup",(function(){return t})),$e("presets","normal",["normal","color","listpreview"]),je("columns",1),Me("onAction"),Me("onItemAction")]),kT=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=V(o,n.getSystem().build);Ts(n,i)}))};return $r([Kr(br(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;I(o.channels,i)&&n(e,o.data)}})),ro((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),OT=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),TT=[_e("channel"),Pe("renderComponents"),Pe("updateState"),Pe("initialData")],_T=Fa({fields:TT,name:"reflecting",active:kT,apis:OT,state:Object.freeze({__proto__:null,init:function(){var t=Qe(x.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(t){return t}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(x.none())}}}})}),ET=r([_e("toggleClass"),_e("fetch"),Ju("onExecute"),je("getHotspot",x.some),je("getAnchorOverrides",r({})),xc(),Ju("onItemExecute"),Pe("lazySink"),_e("dom"),Ku("onOpen"),fl("splitDropdownBehaviours",[Py,km,Bm]),je("matchWidth",!1),je("useMinWidth",!1),je("eventOrder",{}),Pe("role")].concat(Gy())),AT=Ll({factory:Ng,schema:[_e("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(jr)},buttonBehaviours:La([Gm.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),NT=Ll({factory:Ng,schema:[_e("dom")],name:"button",defaults:function(){return{buttonBehaviours:La([Bm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),RT=r([AT,NT,Fl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),Hl({schema:[$u()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Ly()]),MT=gf({name:"SplitDropdown",configFields:ET(),partFields:RT(),factory:function(e,n,r,o){var i,u=function(t){wf.getCurrent(t).each((function(t){Nf.highlightFirst(t),km.focusIn(t)}))},a=function(n){jy(e,(function(t){return t}),n,o,u,py.HighlightFirst).get(t)},c=function(t){var n=Zl(t,e,"button");return jr(n),x.some(!0)},s=f(f({},$r([ro((function(t,n){Ql(t,e,"aria-descriptor").each((function(e){var n=Uo("aria");zo(e.element,"id",n),zo(t.element,"aria-describedby",n)}))}))])),Km(x.some(a))),l={repositionMenus:function(t){Gm.isOn(t)&&$y(t)}};return{uid:e.uid,dom:e.dom,components:n,apis:l,eventOrder:f(f({},e.eventOrder),(i={},i[yr()]=["disabling","toggling","alloy.base.behaviour"],i)),events:s,behaviours:ml(e.splitDropdownBehaviours,[Py.config({others:{sandbox:function(t){var n=Zl(t,e,"arrow");return qy(e,t,{onOpen:function(){Gm.on(n),Gm.on(t)},onClose:function(){Gm.off(n),Gm.off(t)}})}}}),km.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t){return a(t),x.some(!0)}}),Bm.config({}),Gm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),zT=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},DT=function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)}}},BT=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},PT=Uo("focus-button"),IT=["checklist","ordered-list"],LT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],HT=function(t,e,n,r,o,i){var u,a=function(t){return lp.isRtl()&&I(IT,t)?t+"-rtl":t},c=lp.isRtl()&&t.exists((function(t){return I(LT,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:BT(n,i)},components:lv([t.map((function(t){return tS(a(t),i.icons)})),e.map((function(t){return nS(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Zn()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:La([ov(i.isDisabled),ev(),Nm("common-button-display-events",[Kr(Zn(),(function(t,e){e.event.prevent(),Fr(t,PT)}))])].concat(r.map((function(n){return _T.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return lv([t.icon.map((function(t){return tS(a(t),i.icons)})),t.text.map((function(t){return nS(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},FT=function(e,n,r){var o,i=Qe(t),u=HT(e.icon,e.text,e.tooltip,x.none(),x.none(),r);return Ng.sketch({dom:u.dom,components:u.components,eventOrder:oS,buttonBehaviours:La([Nm("toolbar-button-events",[(o={onAction:e.onAction,getApi:n.getApi},uo((function(t,e){iv(o,t)((function(e){Vr(t,rS,{buttonApi:e}),o.onAction(e)}))}))),uv(n,i),av(n,i)]),ov((function(){return e.disabled||r.isDisabled()})),ev()].concat(n.toolbarButtonBehaviours))})},VT=function(t,e,n){return FT(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Nm("toolbarButtonWith",n)]:[]),getApi:zT,onSetup:t.onSetup},e)},jT=function(t,e,n){return Rt(FT(t,{toolbarButtonBehaviours:[Am.config({}),Gm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Nm("toolbarToggleButtonWith",n)]:[]),getApi:DT,onSetup:t.onSetup},e))},UT=function(t,e,n){return function(r){return Cy((function(t){return e.fetch(t)})).map((function(o){return x.from(Sb(Rt(sb(Uo("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,ph.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:fb(e.columns,e.presets),menuBehaviours:tp("auto"!==e.columns?[]:[ro((function(t,n){Zh(t,4,Th(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;km.setGridSize(t,n,r)}))}))])})))}))}},WT=function(t,e){return Kr(rS,(function(n,r){var o=function(t){return{hide:function(){return Fr(t,Sr())},getValue:function(){return ll.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},qT=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Rg(my.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:La([km.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return jr(t),!0}))},onLeft:function(t,e){return e.cut(),x.none()},onRight:function(t,e){return e.cut(),x.none()}})])})),o=function(t,e,n){var r=V(e,(function(e){return Rg(function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(uh(f(f({},o),{type:"togglebutton",onAction:function(){}})));return jT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,d(r,["primary"])),i=me(rh(f(f({},o),{type:"button",onAction:function(){}})));return VT(i,n.backstage.shared.providers,[WT(t,e)])}(t,e,r)}(t,e,n))}));return{asSpecs:function(){return V(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return it(e,(function(e,n){return e.primary?x.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(u(kp.isDisabled)):x.none()}))}}}(r,t.commands,e);return[{title:x.none(),items:[r.asSpec()]},{title:x.none(),items:o.asSpecs()}]},$T=function(t,e){var n=yu(window),r=ku(rn(t.getContentAreaContainer())),o=Mp(t)||zp(t)||Bp(t),i=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(r,n),u=i.x,a=i.width;if(t.inline&&!o)return Su(u,n.y,a,n.height);var c=function(t,e,n,r){var o=rn(t.getContainer()),i=zu(o,".tox-editor-header").getOr(o),u=ku(i),a=u.y>=e.bottom,c=r&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,n.y),bottom:n.bottom};if(t.inline&&!c)return{y:n.y,bottom:Math.min(u.y,n.bottom)};var s=ku(o);return c?{y:Math.max(u.bottom,n.y),bottom:Math.min(s.bottom,n.bottom)}:{y:Math.max(s.y,n.y),bottom:Math.min(u.y,n.bottom)}}(t,r,n,e.header.isPositionedAtTop()),s=c.y,l=c.bottom;return Su(u,s,a,l-s)},GT=function(t,e){var n=W(e,(function(e){return e.predicate(t.dom)})),r=U(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},XT=function(t,e){var n={},r=[],o=[],i={},u={},a=vt(t);return j(a,(function(a){var c=t[a];"contextform"===c.type?function(t,a){var c=me(de("ContextForm",mh,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=f(f({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c}(a,c):"contexttoolbar"===c.type&&function(t,e){var n;(n=e,de("ContextToolbar",gh,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))}(a,c)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},KT=Uo("forward-slide"),YT=Uo("backward-slide"),JT=Uo("change-slide-event"),QT="tox-pop--resizing",ZT=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return x.some({type:"separator",text:a});if("submenu"===t.type){var c=Y(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?x.none():x.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Y(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return x.some(f({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Y(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(fS(u,ph.CLOSE_ON_EXECUTE,t,!1))}}}},t_=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return V(r.data,(function(t){return qk(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:ZT(0,e,n),getStyleItems:o}},e_=function(e,n,r){var o=t_(0,n,r),i=o.items,u=o.getStyleItems;return aS({text:r.icon.isSome()?x.none():x.some(""),icon:r.icon,tooltip:x.from(r.tooltip),role:x.none(),fetch:i.getFetch(n,u),onSetup:function(n){return r.setInitialValue.each((function(t){return t(n.getComponent())})),r.nodeChangeHandler.map((function(t){var r=t(n.getComponent());return e.on("NodeChange",r),function(){e.off("NodeChange",r)}})).getOr(t)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(jS||(jS={}));var n_,r_,o_,i_,u_=function(t,e,n,r){return{type:"basic",data:(o=function(t,e){return e===jS.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r),V(o,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}})))};var o},a_=[{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"}],c_=function(t){var e=function(e){var n=G(a_,(function(e){return t.formatter.match(e.format)})).fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));Vr(e,uS,{icon:"align-"+n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o={type:"basic",data:a_};return{tooltip:"Align",icon:x.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(t){return function(){return x.none()}},onAction:function(e){return function(){return G(a_,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},s_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],l_=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},f_=function(t){var e=function(){var e=function(t){return t?l_(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:G(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return function(t){var e;return 0===t.indexOf("-apple-system")&&(e=l_(t.toLowerCase()),J(s_,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(o)?x.from({title:"System Font",format:o}):x.none()})),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)})),i=u_(t,"font_formats","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",jS.SemiColon);return{tooltip:"Fonts",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return x.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},d_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},m_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},g_=function(t){var e=function(){var e=x.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":Ot(m_,t).getOr(t)}(r,t),i=function(t){return Ot(d_,t).getOr("")}(o);e=G(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=r(x.none),o=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));Vr(t,iS,{text:i})},i=x.some((function(t){return function(){return o(t)}})),u=x.some((function(t){return o(t)})),a=u_(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",jS.Space);return{tooltip:"Font sizes",icon:x.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},setInitialValue:u,nodeChangeHandler:i,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},h_=function(t,e){var n=e(),r=V(n,(function(t){return t.format}));return x.from(t.formatter.closest(r)).bind((function(t){return G(n,(function(e){return e.format===t}))})).orThunk((function(){return pf(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},p_=function(t){var e=Qe(x.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(x.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(x.some(t))}}},v_=function(){return p_((function(t){return t.destroy()}))},b_=function(){return p_((function(t){return t.unbind()}))},y_=function(t,e){return function(n){var r=b_(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.on("init",o),r.clear}},w_=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},x_=function(t){var e=function(e){var n=h_(t,(function(){return o.data})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:n})},n=x.some((function(t){return function(){return e(t)}})),r=x.some((function(t){return e(t)})),o=u_(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",jS.SemiColon);return{tooltip:"Blocks",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:w_(t),setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},C_=function(t,e){var n=function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Y(e,n):[{title:t.title,format:t.format}]},r=Y(Wk(t),n),o=h_(t,(function(){return r})).fold((function(){return"Paragraph"}),(function(t){return t.title}));Vr(e,iS,{text:o})},r=x.some((function(t){return function(){return n(t)}})),o=x.some((function(t){return n(t)}));return{tooltip:"Formats",icon:x.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:x.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?x.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):x.none()}},onAction:w_(t),setInitialValue:o,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},S_=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{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"]}],k_=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return he(t)})).getOrDie();return e(i,r,o)}},O_={button:k_(rh,(function(t,e){return n=t,r=e.backstage.shared.providers,VT(n,r,[]);var n,r})),togglebutton:k_(uh,(function(t,e){return n=t,r=e.backstage.shared.providers,jT(n,r,[]);var n,r})),menubutton:k_(CT,(function(t,e){return mS(t,"tox-tbtn",e.backstage,x.none())})),splitbutton:k_((function(t){return de("SplitButton",ST,t)}),(function(e,n){return function(e,n){var r,o=Uo("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return kp.isDisabled(t)},setDisabled:function(e){return kp.set(t,e)},setIconFill:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"fill",n)}))},setIconStroke:function(e,n){zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){zo(t,"stroke",n)}))},setActive:function(e){zo(t.element,"aria-pressed",e),zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Gm.set(t,e)}))}))},isActive:function(){return zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(Gm.isOn)}))}}},u=Qe(t),a={getApi:i,onSetup:e.onSetup};return MT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:f({"aria-pressed":!1},BT(e.tooltip,n.providers))},onExecute:function(t){e.onAction(i(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:La([rv(n.providers.isDisabled),ev(),Nm("split-dropdown-events",[Kr(PT,Bm.focus),uv(a,u),av(a,u)]),Jy.config({})]),eventOrder:(r={},r[Nr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:UT(i,e,n.providers),parts:{menu:Mh(0,e.columns,e.presets)},components:[MT.parts.button(HT(e.icon,e.text,x.none(),x.some(o),x.some([Gm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),MT.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:zg("chevron-down",n.providers.icons)},buttonBehaviours:La([rv(n.providers.isDisabled),ev()])}),MT.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(e,n.backstage.shared)})),grouptoolbarbutton:k_((function(t){return de("GroupToolbarButton",yT,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[yc]=e.backstage.shared.header.isPositionedAtTop()?Iu.TopToBottom:Iu.BottomToTop,r);switch(Ip(n)){case hh.floating:return function(t,e,n,r){var o=e.shared;return IO.sketch({lazySink:o.getSink,fetch:function(){return Cy((function(e){e(V(n(t.items),mT))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:HT(t.icon,t.text,t.tooltip,x.none(),x.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return __(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,x.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=f({type:"advanced"},e.styleselect);return e_(t,e,C_(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return e_(t,e,g_(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return e_(t,e,f_(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return e_(t,e,x_(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return e_(t,e,c_(t))}(t,e.backstage)}},T_={styleselect:O_.styleSelectButton,fontsizeselect:O_.fontsizeSelectButton,fontselect:O_.fontSelectButton,formatselect:O_.formatButton,align:O_.alignMenuButton},__=function(t,e,n,r){var o=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=V(S_,(function(e){var n=W(e.items,(function(e){return Tt(t,e)||Tt(T_,e)}));return{name:e.name,items:n}}));return W(e,(function(t){return t.items.length>0}))}(r):k(n)?(e=n.split("|"),V(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return M(t,(function(t){return Tt(t,"name")&&Tt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}(e),i=V(o,(function(o){var i=Y(o.items,(function(o){return 0===o.trim().length?[]:function(t,e,n,r,o,i){return Ot(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return it(t,(function(t){return Ot(e,t+n.toLowerCase())}))}))})).fold((function(){return Ot(T_,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return x.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return Ot(O_,t.type).fold((function(){return console.error("skipping button defined by",t),x.none()}),(function(r){return x.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),x.none())}))}(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:x.from(t.translate(o.name)),items:i}}));return W(i,(function(t){return t.items.length>0}))},E_={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"]},A_={maxHeightFunction:fc(),maxWidthFunction:yO()},N_={onLtr:function(){return[Sa,ka,xa,ya,Ca,wa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[Sa,ka,Ca,wa,xa,ya,_g,Eg,Tg,kg,Og,Sg]}},R_={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},M_=function(t,e,n,r){var o,i,u=Ln().deviceType.isTouch,a=Zi((o={sink:n,onEscape:function(){return t.focus(),x.some(!0)}},i=Qe([]),vg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),vg.getContent(t).each((function(t){Ui(t.element,"visibility")})),bi(t.element,QT),Ui(t.element,"width")},inlineBehaviours:La([Nm("context-toolbar-events",[no(fr(),(function(t,e){bi(t.element,QT),Ui(t.element,"width")})),Kr(JT,(function(t,e){Ui(t.element,"width");var n=fu(t.element);vg.setContent(t,e.event.contents),vi(t.element,QT);var r=fu(t.element);Bi(t.element,"width",n+"px"),vg.getContent(t).each((function(n){e.event.focus.bind((function(e){return $a(e),Xa(t.element)})).orThunk((function(){return km.focusIn(n),Ga()}))})),Ag.setTimeout((function(){Bi(t.element,"width",r+"px")}),0)})),Kr(KT,(function(t,e){vg.getContent(t).each((function(t){i.set(i.get().concat([{bar:t,focus:Ga()}]))})),Vr(t,JT,{contents:e.event.forwardContents,focus:x.none()})})),Kr(YT,(function(t,e){rt(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Vr(t,JT,{contents:tu(e.bar),focus:e.focus})}))}))]),km.config({mode:"special",onEscape:function(t){return rt(i.get()).fold((function(){return o.onEscape()}),(function(e){return Fr(t,YT),x.some(!0)}))}})]),lazySink:function(){return ct.value(o.sink)}}))),c=function(){return $T(t,r.backstage.shared)},s=function(){if(u()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,a,s,l=(e=g.get().filter((function(t){return Ni(rn(t))})).map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?pu().top:Ou(rn(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),f=c();return o=l.y,i=l.bottom,a=f.y,s=f.bottom,!(Math.max(o,a)<=Math.min(i,s))},l=function(){vg.hide(a)},d=function(){m.get().each((function(t){var e=a.element;Ui(e,"display"),s()?Bi(e,"display","none"):Cs.positionWithinBounds(n,t,a,x.some(c()))}))},m=Qe(x.none()),g=Qe(x.none()),h=Qe(null),p=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:La([km.config({mode:"acyclic"}),Nm("pop-dialog-wrap-events",[ro((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return km.focusIn(e)}))})),oo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},v=zt((function(){return XT(e,(function(t){var e=b([t]);Vr(a,KT,{forwardContents:p(e)})}))})),b=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=f(f({},n),o.formNavigators),u=Ip(t)===hh.scrolling?hh.scrolling:hh.default,a=K(V(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return __(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,x.some(["form:"]))}(i,e):function(t,e){return qT(t,e)}(e,r.backstage.shared.providers)})));return bT({type:u,uid:Uo("context-toolbar"),initGroups:a,onEscape:x.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",(function(e){var n=v();Ot(n.lookupTable,e.toolbarKey).each((function(n){y([n],e.target===t?x.none():x.some(e)),vg.getContent(a).each(km.focusIn)}))}));var y=function(t,e){if(C(),!u()||!r.backstage.isContextMenuOpen()){var n=b(t),o=e.map(rn),i=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Rt(n,function(t,e){return"line"===t?{bubble:hc(12,0,E_),layouts:{onLtr:function(){return[Oa]},onRtl:function(){return[Ta]}},overrides:A_}:{bubble:hc(0,12,E_),layouts:e?R_:N_,overrides:A_}}(t,u()))}(t[0].position,o);m.set(x.some(i)),g.set(e);var l=a.element;Ui(l,"display"),vg.showWithinBounds(a,i,p(n),(function(){return x.some(c())})),s()&&Bi(l,"display","none")}},w=function(){t.hasFocus()&&function(t,e){var n=rn(e.getBody()),r=function(t){return Vn(t,n)},o=rn(e.selection.getNode());return function(t){return!r(t)&&!jn(n,t)}(o)?x.none():function(t,e,n){var r=GT(t,e);if(r.contextForms.length>0)return x.some({elem:t,toolbars:[r.contextForms[0]]});var o=GT(t,n);if(o.contextForms.length>0)return x.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return L(t,(function(t){return t.position===e}))},n=function(e){return W(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=V(n("selection"),(function(t){return f(f({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return x.some({elem:t,toolbars:i})}return x.none()}(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return function(t,e,n){return t(e)?x.none():Wn(e,(function(t){var e=GT(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return G(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return W(t,(function(t){return t.position===e}))}))}(r);return i.length>0?x.some({elem:t,toolbars:i}):x.none()}),t)}(r,o,t)}))}(v(),t).fold((function(){m.set(x.none()),vg.hide(a)}),(function(t){y(t.toolbars,x.some(t.elem.dom))}))},C=function(){var t=h.get();null!==t&&(Ag.clearTimeout(t),h.set(null))},S=function(t){C(),h.set(t)};t.on("init",(function(){t.on(wO,l),t.on("ScrollContent ScrollWindow longpress",d),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){S(Ag.setEditorTimeout(t,w,0))})),t.on("focusout",(function(e){Ag.setEditorTimeout(t,(function(){Xa(n.element).isNone()&&Xa(a.element).isNone()&&(m.set(x.none()),vg.hide(a))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(m.set(x.none()),vg.hide(a))})),t.on("NodeChange",(function(e){Xa(a.element).fold((function(){S(Ag.setEditorTimeout(t,w,0))}),(function(t){}))}))}))},z_=af,D_=Ul,B_=r([je("shell",!1),_e("makeItem"),je("setupItem",t),gl("listBehaviours",[Am])]),P_=Fl({name:"items",overrides:function(){return{behaviours:La([Am.config({})])}}}),I_=r([P_]),L_=gf({name:r("CustomList")(),configFields:B_(),partFields:I_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Am.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:ml(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){var r;(r=e,t.shell?x.some(r):Ql(r,t,"items")).fold((function(){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")}),(function(r){var o=Am.contents(r),i=n.length,u=i-o.length,a=u>0?H(u,(function(){return t.makeItem()})):[],c=o.slice(i);j(c,(function(t){return Am.remove(r,t)})),j(a,(function(t){return Am.append(r,t)}));var s=Am.contents(r);j(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),H_=t,F_=c,V_=r([]),j_=Object.freeze({__proto__:null,setup:H_,isDocked:F_,getBehaviours:V_}),U_=function(t){return(Fi(t,"position").is("fixed")?x.none():yo(t)).orThunk((function(){var e=en("span");return bo(t).bind((function(t){Oo(t,e);var n=yo(e);return Eo(e),n}))}))},W_=function(t){return U_(t).map(cu).getOrThunk((function(){return uu(0,0)}))},q_=Et([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),$_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeOutClass),vi(n,e.fadeInClass),e.onShow(t)},G_=function(t,e){var n=t.element;vi(n,e.transitionClass),bi(n,e.fadeInClass),vi(n,e.fadeOutClass),e.onHide(t)},X_=function(t,e,n){return J(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},K_=function(t,e){return e.getInitialPosition().map((function(e){return Su(e.bounds.x,e.bounds.y,fu(t),ru(t))}))},Y_=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(x.none()),r.position){case"static":return x.some(q_.static());case"absolute":var o=U_(t).map(ku).getOrThunk((function(){return ku(Ri())}));return x.some(q_.absolute(Ya("absolute",Ot(r.style,"left").map((function(t){return e.x-o.x})),Ot(r.style,"top").map((function(t){return e.y-o.y})),Ot(r.style,"right").map((function(t){return o.right-e.right})),Ot(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return x.none()}}))},J_=function(t,e,n){var r=t.element;return Fi(r,"position").is("fixed")?function(t,e,n){return K_(t,n).filter((function(t){return X_(n.getModes(),t,e)})).bind((function(e){return Y_(t,e,n)}))}(r,e,n):function(t,e,n){var r=ku(t);if(X_(n.getModes(),r,e))return x.none();!function(t,e,n){n.setInitialPosition(x.some({style:Vi(t),position:Li(t,"position")||"static",bounds:e}))}(t,r,n);var o=Tu(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return x.some(q_.fixed(Ya("fixed",x.some(i),c?x.some(u):x.none(),x.none(),c?x.none():x.some(a))))}(r,e,n)},Q_=function(t,e){j(["left","right","top","bottom","position"],(function(e){return Ui(t.element,e)})),e.onUndocked(t)},Z_=function(t,e,n){Ja(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},tE=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(wi(t.element,[e.fadeOutClass]),e.onHide(t)):(u?$_:G_)(t,e))}))}))},eE=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&tE(t,e,n,r),J_(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return Q_(t,e)}),(function(n){return Z_(t,e,n)}),(function(o){tE(t,e,n,r,!0),Z_(t,e,o)}))}))}(t,e,n)},nE=function(e,n,r){r.isDocked()&&function(e,n,r){var o=e.element;r.setDocked(!1),function(t,e){var n=t.element;return K_(n,e).bind((function(t){return Y_(n,t,e)}))}(e,r).each((function(r){r.fold((function(){return Q_(e,n)}),(function(t){return Z_(e,n,t)}),t)})),r.setVisible(!0),n.contextual.each((function(t){xi(o,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),eE(e,n,r)}(e,n,r)},rE=Object.freeze({__proto__:null,refresh:eE,reset:nE,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),oE=Object.freeze({__proto__:null,events:function(t,e){return $r([no(fr(),(function(n,r){t.contextual.each((function(t){yi(n.element,t.transitionClass)&&(xi(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n)),r.stop()}))})),Kr(Er(),(function(n,r){eE(n,t,e)})),Kr(Ar(),(function(n,r){nE(n,t,e)}))])}}),iE=[Ve("contextual",[Ne("fadeInClass"),Ne("fadeOutClass"),Ne("transitionClass"),Me("lazyContext"),Ku("onShow"),Ku("onShown"),Ku("onHide"),Ku("onHidden")]),Xe("lazyViewport",Tu),Ke("modes",["top","bottom"],xe),Ku("onDocked"),Ku("onUndocked")],uE=Fa({fields:iE,name:"docking",active:oE,apis:rE,state:Object.freeze({__proto__:null,init:function(t){var e=Qe(!1),n=Qe(!0),r=Qe(x.none()),o=Qe(t.modes);return ui({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),aE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},cE="tox-tinymce--toolbar-sticky-on",sE="tox-tinymce--toolbar-sticky-off",lE=function(t){var e=t.element;bo(e).each((function(n){var r="padding-"+uE.getModes(t)[0];if(uE.isDocked(t)){var o=fu(n);Bi(e,"width",o+"px"),Bi(n,r,function(t){return ou(t)+(parseInt(Li(t,"margin-top"),10)||0)+(parseInt(Li(t,"margin-bottom"),10)||0)}(e)+"px")}else Ui(e,"width"),Ui(n,r)}))},fE=function(t,e){e?(bi(t,aE.fadeOutClass),wi(t,[aE.transitionClass,aE.fadeInClass])):(bi(t,aE.fadeInClass),wi(t,[aE.fadeOutClass,aE.transitionClass]))},dE=function(t,e){var n=rn(t.getContainer());e?(vi(n,cE),bi(n,sE)):(vi(n,sE),bi(n,cE))},mE=function(t,e){var n=Qe(x.none()),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||lE(e),dE(t,uE.isDocked(e)),e.getSystem().broadcastOn([$s()],{}),r().each((function(t){return t.getSystem().broadcastOn([$s()],{})}))},u=t.inline?[]:function(){var t;return[Wa.config({channels:(t={},t[fT()]={onReceive:lE},t)})]}();return m([Bm.config({}),uE.config({contextual:f({lazyContext:function(e){var n,r=ou(e.element),o=t.inline?t.getContentAreaContainer():t.getContainer(),i=ku(rn(o)),u=i.height-r,a=i.y+(n=e,"top",I(uE.getModes(n),"top")?0:r);return x.some(Su(i.x,a,i.width,u))},onShow:function(){o((function(t){return fE(t,!0)}))},onShown:function(t){o((function(t){return xi(t,[aE.transitionClass,aE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=go(o=e),Ga(i).filter((function(t){return!Vn(o,t)})).filter((function(t){return Vn(t,rn(i.dom.body))||jn(r,t)})).each((function(){return $a(o)})),n.set(x.none())}))},onHide:function(t){n.set(function(t,e){return Xa(t).orThunk((function(){return e().toOptional().bind((function(t){return Xa(t.element)}))}))}(t.element,r)),o((function(t){return fE(t,!1)}))},onHidden:function(){o((function(t){return xi(t,[aE.transitionClass])}))}},aE),modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},gE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(uE.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(lE)})),t.on("SkinLoaded",(function(){n().each((function(t){uE.isDocked(t)?uE.reset(t):uE.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(uE.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){uE.refresh(e);var n=e.element;bd(n)&&function(t,e){var n=go(e),r=n.dom.defaultView.innerHeight,o=pu(n),i=rn(t.elm),u=Ou(i),a=ru(i),c=u.y,s=c+a,l=cu(e),f=ru(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)vu(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;vu(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){dE(t,!1)}))},isDocked:function(t){return t().map(uE.isDocked).getOr(!1)},getBehaviours:mE}),hE=mf({factory:function(t,e){var n={focus:km.focusIn,setMenus:function(t,n){var r=V(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=CT(n).mapError((function(t){return he(t)})).getOrDie();return mS(r,"tox-mbtn",e.backstage,x.some("menuitem"))}));Am.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:La([Am.config({}),Nm("menubar-events",[ro((function(e){t.onSetup(e)})),Kr(rr(),(function(t,e){zu(t.element,".tox-mbtn--active").each((function(n){Du(e.event.target,".tox-mbtn").each((function(e){Vn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Yy.expand(t),Yy.close(n),Bm.focus(t)}))}))}))}))})),Kr(Dr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Yy.isOpen(n)&&(Yy.expand(t),Yy.close(n))}))}))}))]),km.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),x.some(!0)}}),Xb.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[_e("dom"),_e("uid"),_e("onEscape"),_e("backstage"),je("onSetup",t)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),pE="container",vE=[fl("slotBehaviours",[])],bE=function(t){return"<alloy.field."+t+">"},yE=function(t,e){var n,r=function(e){return nf(t)},o=function(e,n){return function(r,o){return Ql(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Do(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Bi(n,"display","none"),zo(n,"aria-hidden","true"),Vr(t,Br(),{name:e,visible:!1})}})),c=(n=a,function(t,e){j(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;Ui(n,"display"),Io(n,"aria-hidden"),Vr(t,Br(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return Ql(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.slotBehaviours),apis:l}},wE=wt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return oi(t)})),xE=f(f({},wE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Gl(pE,bE(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=V(r,(function(t){return Ll({name:t,pname:bE(t)})}));return sf(pE,vE,o,yE,n)}}),CE=Zt([He("icon"),He("tooltip"),Xe("onShow",t),Xe("onHide",t),Xe("onSetup",(function(){return t}))]),SE=function(t){return{element:function(){return t.element.dom}}},kE=function(e,n){var r=V(vt(n),(function(t){var e=n[t],r=me(function(t){return de("sidebar",CE,t)}(e));return{name:t,getApi:SE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return V(r,(function(n){var o=Qe(t);return e.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:tp([uv(n,o),av(n,o),Kr(Br(),(function(t,e){var n=e.event;G(r,(function(t){return t.name===n.name})).each((function(e){(n.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},OE=function(t){return xE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:kE(e,t),slotBehaviours:tp([ro((function(t){return xE.hideAllSlots(t)}))])}}))},TE=function(t){return wf.getCurrent(t).bind((function(t){return iT.isGrowing(t)||iT.hasGrown(t)?wf.getCurrent(t).bind((function(t){return G(xE.getSlotNames(t),(function(e){return xE.isShowing(t,e)}))})):x.none()}))},_E=Uo("FixSizeEvent"),EE=Uo("AutoSizeEvent"),AE=function(t){var e=tn(t),n=wo(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return $(e,(function(t,e){var n;return"class"===e.name?t:f(f({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:No(e)};return f({tag:ao(e),classes:o,attributes:r},i)},NE=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})])}},RE=D_.optional({factory:hE,name:"menubar",schema:[_e("backstage")]}),ME=D_.optional({factory:{sketch:function(t){return L_.sketch({uid:t.uid,dom:t.dom,listBehaviours:La([km.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return bT({type:t.type,uid:Uo("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),x.some(!0)}})},setupItem:function(t,e,n,r){SO.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[_e("dom"),_e("onEscape")]}),zE=D_.optional({factory:{sketch:function(t){return function(t){return t.type===hh.sliding?vT:t.type===hh.floating?pT:bT}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),x.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[_e("dom"),_e("onEscape"),_e("getSink")]}),DE=D_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?mE:V_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:La(n(e,t.sharedBackstage))}}},name:"header",schema:[_e("dom")]}),BE=D_.optional({name:"socket",schema:[_e("dom")]}),PE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:La([Xb.config({}),Bm.config({}),iT.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:function(t){wf.getCurrent(t).each(xE.hideAllSlots),Fr(t,EE)},onGrown:function(t){Fr(t,EE)},onStartGrow:function(t){Vr(t,_E,{width:Fi(t.element,"width").getOr("")})},onStartShrink:function(t){Vr(t,_E,{width:fu(t.element)+"px"})}}),Am.config({}),wf.config({find:function(t){var e=Am.contents(t);return nt(e)}})])}],behaviours:La([eC(0),Nm("sidebar-sliding-events",[Kr(_E,(function(t,e){Bi(t.element,"width",e.event.width)})),Kr(EE,(function(t,e){Ui(t.element,"width")}))])])}}},name:"sidebar",schema:[_e("dom")]}),IE=D_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:La([Am.config({})]),components:[]}}},name:"throbber",schema:[_e("dom")]}),LE=gf({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return z_.getPart(e,t,"socket")},setSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){return Am.set(t,[OE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){z_.getPart(e,t,"sidebar").each((function(t){return function(t,e){wf.getCurrent(t).each((function(t){wf.getCurrent(t).each((function(n){iT.hasGrown(t)?xE.isShowing(n,e)?iT.shrink(t):(xE.hideAllSlots(n),xE.showSlot(n,e)):(xE.hideAllSlots(n),xE.showSlot(n,e),iT.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return z_.getPart(e,t,"sidebar").bind(TE).getOrNull()},getHeader:function(e){return z_.getPart(e,t,"header")},getToolbar:function(e){return z_.getPart(e,t,"toolbar")},setToolbar:function(e,n){z_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){z_.getPart(e,t,"multiple-toolbar").each((function(t){L_.setItems(t,n)}))},refreshToolbar:function(e){z_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){z_.getPart(e,t,"toolbar").each((function(t){var e,n;n=function(e){return e(t)},null!=(e=t.getApis().toggle)?x.some(n(e)):x.none()}))},isToolbarDrawerToggled:function(e){return z_.getPart(e,t,"toolbar").bind((function(t){return x.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return z_.getPart(e,t,"throbber")},focusToolbar:function(e){z_.getPart(e,t,"toolbar").orThunk((function(){return z_.getPart(e,t,"multiple-toolbar")})).each((function(t){km.focusIn(t)}))},setMenubar:function(e,n){z_.getPart(e,t,"menubar").each((function(t){hE.setMenus(t,n)}))},focusMenubar:function(e){z_.getPart(e,t,"menubar").each((function(t){hE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[_e("dom"),_e("behaviours")],partFields:[DE,RE,zE,ME,BE,PE,IE],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=V(n,(function(t){return mT(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=V(n,(function(t){return V(t,mT)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),HE={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 toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},FE=function(t){return"string"==typeof t?t.split(" "):t},VE=function(t,e){var n=f(f({},HE),e.menus),r=vt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?FE("file edit view insert format tools table help"):FE(!1===e.menubar?"":e.menubar),i=W(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||HE.hasOwnProperty(t)})),u=V(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Y(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||L(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:FE(o.items)},e,t)}));return W(u,(function(t){return t.getItems().length>0&&L(t.getItems(),(function(t){return"separator"!==t.type}))}))},jE=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},UE=function(t,e,n){return new Gg((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},WE=function(t,e){return UE(t,e+"/skin.min.css",t.ui.styleSheetLoader)},qE=function(t,e){var n;return n=rn(t.getElement()),Ei(n).isSome()?UE(t,e+"/skin.shadowdom.min.css",sp.DOM.styleSheetLoader):Gg.resolve()},$E=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Op.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&k(n)?Gg.all([WE(e,n),qE(e,n)]).then(jE(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:"Skin could not be loaded"})}}(e)):jE(e)()},GE=i($E,!1),XE=i($E,!0),KE=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,u=n.buttons;if(M(i,k)){var a=i.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return __(t,o,{backstage:r},x.none())}));LE.setToolbars(o,a)}else LE.setToolbar(o,__(t,n,{backstage:r},x.none()))},YE=Ln(),JE=YE.os.isiOS()&&YE.os.version.major<=12,QE=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=Qe(0),u=e.outerContainer;GE(t);var a=rn(o.targetNode),c=_i(Ti(a));!function(t,e){zs(t,e,So)}(a,e.mothership),Ms(c,e.uiMothership),t.on("PostRender",(function(){KE(t,e,n,r),i.set(t.getWin().innerWidth),LE.setMenubar(u,VE(t,n)),LE.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=Qe(uu(r.innerWidth,r.innerHeight)),u=Qe(uu(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(uu(r.innerWidth,r.innerHeight)),$v(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(uu(e.offsetWidth,e.offsetHeight)),$v(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=_b(rn(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Bi(f,"display","none")})),t.on("show",(function(){Ui(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var s,l,f=LE.getSocket(u).getOrDie("Could not find expected socket element");if(JE){Pi(f.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var d=(s=function(){t.fire("ScrollContent")},20,l=null,{cancel:function(){null!==l&&(clearTimeout(l),l=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===l&&(l=setTimeout((function(){s.apply(null,t),l=null}),20))}}),m=Tb(f.element,"scroll",d.throttle);t.on("remove",m.unbind)}tv(t,e),t.addCommand("ToggleSidebar",(function(e,n){LE.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return LE.whichSidebar(u)}));var g=Ip(t);g!==hh.sliding&&g!==hh.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(LE.refreshToolbar(e.outerContainer),i.set(n))}));var h={enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(u)}};return{iframeContainer:f.element.dom,editorContainer:u.element.dom,api:h}}}),ZE=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?x.some(parseInt(""+t,10)):x.none()},tA=function(t){return R(t)?t+"px":t},eA=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},nA=function(t){var e=_p(t),n=Ep(t),r=Np(t);return ZE(e).map((function(t){return eA(t,n,r)}))},rA=function(t,e){var n=ku(t);return{pos:e?n.y:n.bottom,bounds:n}},oA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=Qe(null),s=rn(o.targetNode),l=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=sp.DOM,c=Up(t),s=$p(t),l=Np(t).or(nA(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Ip(t),g=m===hh.sliding||m===hh.floating,h=Qe(!1),p=function(){return h.get()&&!t.removed},v=function(t){return g?t.fold((function(){return 0}),(function(t){return t.components().length>1?ru(t.components()[1].element):0})):0},b=function(){i.broadcastOn([$s()],{})},y=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=ZE(Li(Ri(),"margin-left")).getOr(0);return fu(Ri())-cu(e).left+t})),Bi(o.get().element,"max-width",n+"px")),g&&LE.refreshToolbar(u),c||function(){var t=LE.getToolbar(u),n=v(t),r=ku(e),i=d()?Math.max(r.y-ru(o.get().element)+n,0):r.bottom;Pi(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?uE.reset(r):uE.refresh(r)}b()}},w=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Fp(t)){case Pp.auto:var r=LE.getToolbar(u),o=v(r),i=ru(n.element)-o,a=ku(e);if(a.y>i)return"top";var c=po(e),s=Math.max(c.dom.scrollHeight,ru(c));return a.bottom<s-i||Tu().bottom<a.bottom-i?"bottom":"top";case Pp.bottom:return"bottom";case Pp.top:default:return"top"}}(o.get());i!==r&&(function(t){var e=o.get();uE.setModes(e,[t]),f.setDockingMode(t);var n=d()?Iu.TopToBottom:Iu.BottomToTop;zo(e.element,yc,n)}(i),n&&y(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Bi(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Ui(i.element,"display"),w(!1),y()},hide:function(){h.set(!1),n.outerContainer&&(Bi(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Bi(i.element,"display","none")},update:y,updateMode:w,repositionPopups:b}}(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);XE(t);var d=function(){if(c.get())l.show();else{c.set(LE.getHeader(a).getOrDie());var o=Wp(t);Ms(o,i),Ms(o,u),KE(t,e,n,r),LE.setMenubar(a,VE(t,n)),l.show(),function(t,e,n,r){var o=Qe(rA(e,n.isPositionedAtTop())),i=function(r){var i=rA(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&$v(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Ag.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=b_();u.set(_b(rn(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&d()})),tv(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Zp(e,!1)},disable:function(){Zp(e,!0)},isDisabled:function(){return kp.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),iA=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},uA=function(t){(function(t){!function(t){iC.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"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:y_(t,e.name),onAction:iA(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:y_(t,n),onAction:iA(t,n)})}}(t),function(t){iC.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"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))}(t),function(t){iC.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:y_(t,e.name)})}))}(t)})(t),function(t){iC.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",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{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"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:iA(t,"code")})}(t)},aA=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},cA={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:[""]},sA=(n_="[eE][+-]?[0-9]+",o_=["Infinity","[0-9]+\\."+(r_=function(t){return"(?:"+t+")?"})("[0-9]+")+r_(n_),"\\.[0-9]+"+r_(n_),"[0-9]+"+r_(n_)].join("|"),new RegExp("^([+-]?(?:"+o_+"))(.*)$")),lA=function(t){return function(t,e){return function(t,e){return x.from(sA.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return L(e,(function(e){return L(cA[e],(function(e){return t===e}))}))}(r,e)?x.some({value:n,unit:r}):x.none()}))}(t,["fixed","relative","empty"]).map((function(t){return t.value+t.unit}))}(t).getOr(t)},fA=function(t){var e=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")}(t),n=new Map,r=v_(),o=function(){var e=lA(t.queryCommandValue("LineHeight"));x.from(n.get(e)).fold((function(){return r.clear()}),(function(t){r.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)}))};return t.on("nodeChange",o),V(e,(function(i,u){return{type:"togglemenuitem",text:i,onSetup:function(a){return n.set(lA(i),a),u+1===e.length&&o(),function(){0===u&&(t.off("nodeChange",o),r.clear())}},onAction:function(){return t.execCommand("LineHeight",!1,i)}}}))},dA=function(t,e){!function(t){iC.each([{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"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:y_(t,e.name)})}));t.ui.registry.addButton("alignnone",{tooltip:"No alignment",onAction:function(){return t.execCommand("JustifyNone")},icon:"align-none"})}(t),uA(t),function(t,e){!function(t,e){var n=t_(0,e,c_(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,f_(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=f({type:"advanced"},e.styleselect),r=t_(0,e,C_(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,x_(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=t_(0,e,g_(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)}(t,e),function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return aA(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return aA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)}(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=Qe(null),n=Qe(null);ub(t,"forecolor","forecolor","Text color",e),ub(t,"backcolor","hilitecolor","Background color",n),ab(t,"forecolor","forecolor","Text color"),ab(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t),function(t){!function(t){t.ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return fA(t)}})}(t),function(t){t.ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(e){return e(fA(t))}})}(t)}(t)},mA=function(t,e){return{anchor:"makeshift",x:t,y:e}},gA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},hA=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(gA(t)){var e=t.touches[0];return mA(e.pageX,e.pageY)}return mA(t.pageX,t.pageY)}(e):function(t,e){var n=sp.DOM.getPos(t);return function(t,e,n){return mA(t.x+e,t.y+n)}(e,n.x,n.y)}(t.getContentAreaContainer(),function(t){if(gA(t)){var e=t.touches[0];return mA(e.clientX,e.clientY)}return mA(t.clientX,t.clientY)}(e)):pA(t)},pA=function(t){return{anchor:"selection",root:rn(t.selection.getNode())}},vA=function(t){return{anchor:"node",node:x.some(rn(t.selection.getNode())),root:rn(t.getBody())}},bA=function(t,e,n,r,o,i){var u=n(),a=i?vA(t):hA(t,e);fS(u,ph.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),vg.showMenuAt(o,a,{menu:{markers:Ah("normal")},data:t})}))},yA={onLtr:function(){return[ka,ya,wa,xa,Ca,Sa,_g,Eg,Og,Sg,Tg,kg]},onRtl:function(){return[ka,wa,ya,Ca,xa,Sa,_g,Eg,Tg,kg,Og,Sg]}},wA={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"]},xA=function(t,e,n,r,o,i){var u=Ln(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),d=function(){var u=n();!function(t,e,n,r,o,i,u){var a=i?vA(t):function(t,e){return f({bubble:hc(0,12,wA),layouts:yA,overrides:{maxWidthFunction:yO(),maxHeightFunction:fc()}},hA(t,e))}(t,e);fS(n,ph.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),vg.showMenuWithinBounds(o,a,{menu:{markers:Ah("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return x.some($T(t,r.shared))})),t.fire(wO)}))}(t,e,u,r,o,i,!(s||a||c&&l))};if(!c&&!a||i)s&&!i&&t.selection.setCursorLocation(e.target,0),d();else{var m=function(){!function(t){var e=t.selection.getRng(),n=function(){Ag.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),d()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Uc(t.getWin(),Ac.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)}))):m()}},CA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},SA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},kA=function(t){return k(t)?"|"===t:"separator"===t.type},OA={type:"separator"},TA=function(t){if(k(t))return t;switch(t.type){case"separator":return OA;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return k(e)?e:V(e,TA)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(e=t.onAction,function(){return e()})}}var e},_A=function(t,e){if(0===e.length)return t;var n=rt(t).filter((function(t){return!kA(t)})).fold((function(){return[]}),(function(t){return[OA]}));return t.concat(n).concat(e).concat([OA])},EA=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},AA=function(t,e){return EA(t,e)?t.selection.getStart(!0):e.target},NA=function(t,e,n){var r=Ln().deviceType.isTouch,o=Zi(vg.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:La([Nm("dismissContextMenu",[Kr(Mr(),(function(e,n){Ws.close(e),t.focus()}))])])})),i=function(t){return vg.hide(o)},u=function(e){if(SA(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!SA(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t);if(EA(t,e))return!0;if(n){var r=AA(t,e);return Ab(rn(r),n)}return!1}(t,e);(r()?xA:bA)(t,e,(function(){var n=AA(t,e),r=t.ui.registry.getAll(),o=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return x.from(t.getParam("contextmenu")).map(CA).getOrThunk((function(){return W(CA("link linkchecker image imagetools table spellchecker configurepermanentpen"),(function(t){return Tt(r,t)}))}))}(t)}(t);return function(t,e,n){var r=$(e,(function(e,r){if(Tt(t,r)){var o=t[r].update(n);if(k(o))return _A(e,o.split(" "));if(o.length>0){var i=V(o,TA);return _A(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&kA(r[r.length-1])&&r.pop(),r}(r.contextMenus,o,n)}),n,o,i)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",u)}))},RA=Et([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),MA=function(t){return function(e){return e.translate(-t.left,-t.top)}},zA=function(t){return function(e){return e.translate(t.left,t.top)}},DA=function(t){return function(e,n){return $(t,(function(t,e){return e(t)}),uu(e,n))}},BA=function(t,e,n){return t.fold(DA([zA(n),MA(e)]),DA([MA(e)]),DA([]))},PA=function(t,e,n){return t.fold(DA([zA(n)]),DA([]),DA([zA(e)]))},IA=function(t,e,n){return t.fold(DA([]),DA([MA(n)]),DA([zA(e),MA(n)]))},LA=function(t,e,n){var r=t.fold((function(t,e){return{position:x.some("absolute"),left:x.some(t+"px"),top:x.some(e+"px")}}),(function(t,e){return{position:x.some("absolute"),left:x.some(t-n.left+"px"),top:x.some(e-n.top+"px")}}),(function(t,e){return{position:x.some("fixed"),left:x.some(t+"px"),top:x.some(e+"px")}}));return f({right:x.none(),bottom:x.none()},r)},HA=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(IA,FA),o(PA,VA),o(BA,jA))},FA=RA.offset,VA=RA.absolute,jA=RA.fixed,UA=function(t,e){var n=Do(t,e);return E(n)?NaN:parseInt(n,10)},WA=function(t,e,n,r,o,i){var u=function(t,e,n,r){return function(t,e){var n=t.element,r=UA(n,e.leftAttr),o=UA(n,e.topAttr);return isNaN(r)||isNaN(o)?x.none():x.some(uu(r,o))}(t,e).fold((function(){return n}),(function(t){return jA(t.left+r.left,t.top+r.top)}))}(t,e,n,r),a=e.mustSnap?$A(t,e,u,o,i):GA(t,e,u,o,i),c=BA(u,o,i);return function(t,e,n){var r=t.element;zo(r,e.leftAttr,n.left+"px"),zo(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:jA(c.left,c.top),extra:x.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},qA=function(t,e,n,r){return it(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?x.some({output:HA(t.output,e,n,r),extra:t.extra}):x.none()}))},$A=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o).orThunk((function(){return $(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=PA(t,o,i),a=PA(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return uu(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:x.some(u),snap:x.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:x.some(u),snap:x.some(e)}:t}))}),{deltas:x.none(),snap:x.none()}).snap.map((function(t){return{output:HA(t.output,n,r,o),extra:t.extra}}))}))},GA=function(t,e,n,r,o){var i=e.getSnapPoints(t);return qA(i,n,r,o)},XA=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t,e,n){return{coord:HA(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=LA(c.coord,0,a);Ii(o,s)}}}),KA="data-initial-z-index",YA=function(t,e){t.getSystem().addToGui(e),function(t){bo(t.element).filter(so).each((function(e){Fi(e,"z-index").each((function(t){zo(e,KA,t)})),Bi(e,"z-index",Li(t.element,"z-index"))}))}(e)},JA=function(t){!function(t){bo(t.element).filter(so).each((function(t){Bo(t,KA).fold((function(){return Ui(t,"z-index")}),(function(e){return Bi(t,"z-index",e)})),Io(t,KA)}))}(t),t.getSystem().removeFromGui(t)},QA=function(t,e,n){return t.getSystem().build(Vb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},ZA=Ve("snaps",[_e("getSnapPoints"),Ku("onSensor"),_e("leftAttr"),_e("topAttr"),je("lazyViewport",Tu),je("mustSnap",!1)]),tN=[je("useFixed",c),_e("blockerClass"),je("getTarget",o),je("onDrag",t),je("repositionTarget",!0),je("onDrop",t),Xe("getBounds",Tu),ZA],eN=function(t,e){return{bounds:t.getBounds(),height:ou(e.element),width:du(e.element)}},nN=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return eN(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=go(t.element),u=pu(i),a=W_(o),c=function(t){return(e=Fi(t,"left"),n=Fi(t,"top"),r=Fi(t,"position"),o=function(t,e,n){return("fixed"===n?jA:FA)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?x.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):x.none()).getOrThunk((function(){var e=cu(t);return VA(e.left,e.top)}));var e,n,r,o}(o),s=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=PA(e,n,r),a=uc(u.left,i.x,i.x+i.width-o.width),c=uc(u.top,i.y,i.y+i.height-o.height),s=VA(a,c);return e.fold((function(){var t=IA(s,n,r);return FA(t.left,t.top)}),(function(){return s}),(function(){var t=BA(s,n,r);return jA(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return FA(t+e,n+u)}),(function(t,n){return VA(t+e,n+u)}),(function(t,n){return jA(t+e,n+u)}))),c=BA(a,r,o);return jA(c.left,c.top)}),(function(e){var u=WA(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)}(t,e.snaps,c,u,a,r,n),l=LA(s,0,a);Ii(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},rN=function(t,e,n,r){e.each(JA),n.snaps.each((function(e){!function(t,e){!function(t,e){var n=t.element;Io(n,e.leftAttr),Io(n,e.topAttr)}(t,e)}(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},oN=function(t){return function(e,n){var r=function(t){n.setStartData(eN(e,t))};return $r(m([Kr(Er(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},iN=Object.freeze({__proto__:null,getData:function(t){return x.from(uu(t.x,t.y))},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),uN=function(t,e,n){return[Kr(Zn(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return rN(r,x.some(c),t,e)},u=Nb(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),nN(r,t,e,iN,n)}},c=QA(r,t.blockerClass,function(t){return $r([Kr(Zn(),t.forceDrop),Kr(nr(),t.drop),Kr(tr(),(function(e,n){t.move(n.event)})),Kr(er(),t.delayDrop)])}(a));n(r),YA(r,c)}}))]},aN=m(tN,[Zu("dragger",{handlers:oN(uN)})]),cN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return x.some(uu(e.clientX,e.clientY))}(e):x.none()},getDelta:function(t,e){return uu(e.left-t.left,e.top-t.top)}}),sN=function(t,e,n){var r=Qe(x.none());return[Kr(Kn(),(function(o,i){i.stop();var u=function(){rN(o,r.get(),t,e),r.set(x.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(n){nN(o,t,e,cN,n)}},c=QA(o,t.blockerClass,function(t){return $r([Kr(Kn(),t.forceDrop),Kr(Jn(),t.drop),Kr(Qn(),t.drop),Kr(Yn(),(function(e,n){t.move(n.event)}))])}(a));r.set(x.some(c)),n(o),YA(o,c)})),Kr(Yn(),(function(n,r){r.stop(),nN(n,t,e,cN,r.event)})),Kr(Jn(),(function(n,o){o.stop(),rN(n,r.get(),t,e),r.set(x.none())})),Kr(Qn(),(function(n){rN(n,r.get(),t,e),r.set(x.none())}))]},lN=aN,fN=m(tN,[Zu("dragger",{handlers:oN(sN)})]),dN=m(tN,[Zu("dragger",{handlers:oN((function(t,e,n){return m(uN(t,e,n),sN(t,e,n))}))})]),mN=ja({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:lN,touch:fN,mouseOrTouch:dN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:x.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=x.none(),e=x.none(),n=r({});return ui({readState:n,reset:function(){t=x.none(),e=x.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=x.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=x.some(t)}})}}),apis:XA}),gN=function(t,e,n,r,o,i){return t.fold((function(){return mN.snap({sensor:VA(n-20,r-20),range:uu(o,i),output:VA(x.some(n),x.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return mN.snap({sensor:VA(o,i),range:uu(40,40),output:VA(x.some(n-u.width/2),x.some(r-u.height/2)),extra:{td:e}})}))},hN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Vn(t,e)}))})(e.get(),o)||(e.set(x.some(o)),n(o))},mustSnap:!0}},pN=function(t){return Rg(Ng.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:La([mN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Jy.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},vN=function(t,e){var n=Qe([]),r=Qe([]),o=Qe(!1),i=Qe(x.none()),u=Qe(x.none()),a=function(t){var n=Ou(t);return gN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Ou(t);return gN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=hN((function(){return V(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=hN((function(){return V(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=pN(s),d=pN(l),m=Zi(f.asSpec()),g=Zi(d.asSpec()),h=function(e,n,r,o){var i=r(n);mN.snapTo(e,i),function(e,n,r,i){var u=n.dom.getBoundingClientRect();Ui(e.element,"display");var a=vo(rn(t.getBody())).dom.innerHeight,c=u[o]<0,s=function(t,e){return t[o]>e}(u,a);(c||s)&&Bi(e.element,"display","none")}(e,n)},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};Ln().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(_s(e,m),_s(e,g),o.set(!0)),i.set(x.some(t.start)),u.set(x.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Ns(m),Ns(g),o.set(!1)),i.set(x.none()),u.set(x.none())})))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(i_||(i_={}));var bN,yN,wN,xN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},CN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(function(t,e,n){return e.delimiter||(e.delimiter="»"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:La([km.config({mode:"flow",selector:"div[role=button]"}),kp.config({disabled:n.isDisabled}),ev(),Xb.config({}),Am.config({}),Nm("elementPathEvents",[ro((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return km.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!xN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?Am.set(r,(i=V(a||[],(function(e,r){return Ng.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:La([nv(n.isDisabled),ev()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},$(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):Am.set(r,[])}))}))])]),components:[]}}(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Am.set(t,[Yi(e.translate(["{0} "+r,n[r]]))])};return Ng.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:La([nv(e.isDisabled),ev(),Xb.config({}),Am.config({}),ll.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Nm("wordcount-events",[uo((function(t){var e=ll.getValue(t),n="words"===e.mode?"characters":"words";ll.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),ro((function(e){t.on("wordCountUpdate",(function(t){var n=ll.getValue(e).mode;ll.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=lp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?i_.None:"both"===n?i_.Both:i_.Vertical}(t);return o!==i_.None&&r.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:zg("resize-handle",e.icons)},behaviours:La([mN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){!function(t,e,n){var r=rn(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=eA(r+e.top,Ap(t),Rp(t)),n===i_.Both&&(i.width=eA(o+e.left,Ep(t),Np(t))),i}(t,e,n,ru(r),fu(r));yt(o,(function(t,e){return Bi(r,e,tA(t))})),function(t){t.fire("ResizeEditor")}(t)}(t,o,n)},blockerClass:"tox-blocker"})])}}(o)),r}()}},SN=function(t){var e,n,r,o,i=t.inline,u=i?oA:QE,a=$p(t)?gE:j_,c=x.none(),s=Ln(),l=s.browser.isIE()?["tox-platform-ie"]:[],d=s.deviceType.isTouch()?["tox-platform-touch"]:[],m=Vp(t),g=Wp(t),h=lp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[yc]=m?Iu.BottomToTop:Iu.TopToBottom,e)},v=function(){return c.bind(LE.getHeader)},b=Zi((n=Vn(Ri(),g)&&"grid"===Li(g,"display"),r={dom:f({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(d)},h),behaviours:La([Cs.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:$r([Kr(Ar(),(function(){Bi(q.element,"width",document.body.clientWidth+"px")}))])},Rt(r,n?o:{}))),y=function(){return ct.value(b)},w=Rg({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return LE.getThrobber(t)})).getOrDie("Could not find throbber element")},S=function(t,e,n){var r=Qe(!1),o=function(t){var e=Qe(Vp(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:lp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return Ek(Tk,t,e)}(t,i)},anchors:Dk(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ct.value(t)}},urlinput:bO(e),styleselect:Gk(e),colorinput:Hk(e),dialog:Vk(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i}(b,t,(function(){return c.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=LE.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=Ip(t),T=LE.parts.toolbar(f({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind((function(t){return LE.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),_=LE.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),E=LE.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),A=LE.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),N=LE.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),M=t.getParam("statusbar",!0,"boolean")&&!i?x.some(CN(t,S.shared.providers)):x.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[E,A]},D=Bp(t),B=zp(t),P=Mp(t),I=LE.parts.header({dom:f({tag:"div",classes:["tox-editor-header"]},p),components:K([P?[k]:[],D?[_]:B?[T]:[],Up(t)?[]:[w.asSpec()]]),sticky:$p(t),editor:t,sharedBackstage:S.shared}),L=K([m?[]:[I],i?[]:[z],m?[I]:[]]),H=K([[{dom:{tag:"div",classes:["tox-editor-container"]},components:L}],i?[]:M.toArray(),[N]]),F=qp(t),V=f(f({role:"application"},lp.isRtl()?{dir:"rtl"}:{}),F?{"aria-hidden":"true"}:{}),U=Zi(LE.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d).concat(l),styles:f({visibility:"hidden"},F?{opacity:"0",border:"0"}:{}),attributes:V},components:H,behaviours:La([ev(),kp.config({disableClass:"tox-tinymce--disabled"}),km.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"})])}));c=x.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){LE.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){LE.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){LE.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return LE.isToolbarDrawerToggled(U)}));var W=jb(U),q=jb(b);!function(t,e,n){var r=function(t,r){j([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){j([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(qs(),{target:t.target})},u=Tb(rn(document),"touchstart",i),a=Tb(rn(document),"touchmove",(function(t){return r(Tr(),t)})),c=Tb(rn(document),"touchend",(function(t){return r(_r(),t)})),s=Tb(rn(document),"mousedown",i),l=Tb(rn(document),"mouseup",(function(t){0===t.raw.button&&o(Gs(),{target:t.target})})),f=function(t){return o(qs(),{target:rn(t.target)})},d=function(t){0===t.button&&o(Gs(),{target:rn(t.target)})},m=function(t){return r(Er(),Eb(t))},g=function(t){o($s(),{}),r(Ar(),Eb(t))},h=function(){return o($s(),{})};t.on("PostRender",(function(){t.on("click",f),t.on("tap",f),t.on("mouseup",d),t.on("ScrollWindow",m),t.on("ResizeWindow",g),t.on("ResizeEditor",h)})),t.on("remove",(function(){t.off("click",f),t.off("tap",f),t.off("mouseup",d),t.off("ScrollWindow",m),t.off("ResizeWindow",g),t.off("ResizeEditor",h),s.unbind(),u.unbind(),a.unbind(),c.unbind(),l.unbind()})),t.on("detach",(function(){Ds(e),Ds(n),e.destroy(),n.destroy()}))}(t,W,q);var $=function(){var e=tA(function(t){return function(t){var e=Tp(t),n=Ap(t),r=Rp(t);return ZE(e).map((function(t){return eA(t,n,r)}))}(t).getOr(Tp(t))}(t)),n=tA(function(t){return nA(t).getOr(_p(t))}(t));return t.inline||(ji("div","width",n)&&Bi(U.element,"width",n),ji("div","height",e)?Bi(U.element,"height",e):Bi(U.element,"height","200px")),e};return{mothership:W,uiMothership:q,backstage:S,renderUI:function(){a.setup(t,S.shared,v),dA(t,S),NA(t,y,S),function(t){var e=t.ui.registry.getAll().sidebars;j(vt(e),(function(n){var r=e[n],o=function(){return x.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),function(t,e,n){var r=Qe(!1),o=Qe(x.none()),i=function(t){t!==r.get()&&(function(t,e,n){var r=t.element;!0===e?(Am.set(t,[NE(n)]),Ui(r,"display"),Io(r,"aria-hidden")):(Am.set(t,[]),Bi(r,"display","none"),zo(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(Ag.clearTimeout),R(e.time)){var n=Ag.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(x.some(n))}else i(e.state),o.set(x.none())}))}(t,C,S.shared),wt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Dp(t),s={menuItems:r,menus:Gp(t),menubar:Xp(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===hh.floating,buttons:n,sidebar:i};M_(t,o,b,{backstage:S}),vN(t,b);var l=t.getElement(),f=$(),d={mothership:W,uiMothership:q,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:q.broadcast,broadcastOn:q.broadcastOn,register:function(){}}}}}},kN=r([_e("lazySink"),Pe("dragBlockClass"),Xe("getBounds",Tu),je("useTabstopAt",s),je("eventOrder",{}),fl("modalBehaviours",[km]),Yu("onExecute"),Qu("onEscape")]),ON={sketch:o},TN=r([Fl({name:"draghandle",overrides:function(t,e){return{behaviours:La([mN.config({mode:"mouse",getTarget:function(t){return Mu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Ll({schema:[_e("dom")],name:"title"}),Ll({factory:ON,schema:[_e("dom")],name:"close"}),Ll({factory:ON,schema:[_e("dom")],name:"body"}),Fl({factory:ON,schema:[_e("dom")],name:"footer"}),Hl({factory:{sketch:function(t,e){return f(f({},t),{dom:e.dom,components:e.components})}},schema:[je("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),je("components",[])],name:"blocker"})]),_N=Object.freeze({__proto__:null,block:function(t,e,n,r){zo(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=La([km.config({mode:"special",onTab:function(){return x.some(!0)},onShiftTab:function(){return x.some(!0)}}),Bm.config({})]),u=r(o,i),a=o.getSystem().build(u);Am.append(o,tu(a)),a.hasConfigured(km)&&km.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Am.remove(o,a)}))},unblock:function(t,e,n){Io(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),EN=[Xe("getRoot",x.none),Ku("onBlock"),Ku("onUnblock")],AN=Fa({fields:EN,name:"blocking",apis:_N,state:Object.freeze({__proto__:null,init:function(){var t=v_();return ui({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NN=gf({name:"ModalDialog",configFields:kN(),partFields:TN(),factory:function(t,e,n,r){var i,u=Qe(x.none()),a=Uo("modal-events"),c=f(f({},t.eventOrder),((i={})[Nr()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),i));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){u.set(x.some(e));var n=t.lazySink(e).getOrDie(),o=r.blocker(),i=n.getSystem().build(f(f({},o),{components:o.components.concat([tu(e)]),behaviours:La([Bm.config({}),Nm("dialog-blocker-events",[no(or(),(function(){km.focusIn(e)}))])])}));_s(n,i),km.focusIn(e)},hide:function(t){u.set(x.none()),bo(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Ns(t)}))}))},getBody:function(e){return Zl(e,t,"body")},getFooter:function(e){return Zl(e,t,"footer")},setIdle:function(t){AN.unblock(t)},setBusy:function(t,e){AN.block(t,e)}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:ml(t.modalBehaviours,[Am.config({}),km.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),AN.config({getRoot:u.get}),Nm(a,[ro((function(e){var n,r,i,u,a,c;n=e.element,r=Zl(e,t,"title").element,i=Bo(n,"id").fold((function(){var t=Uo("dialog-label");return zo(r,"id",t),t}),o),zo(n,"aria-labelledby",i),u=e.element,a=Zl(e,t,"body").element,c=x.from(Do(u,"id")).fold((function(){var t=Uo("dialog-describe");return zo(a,"id",t),t}),o),zo(u,"aria-describedby",c)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),RN=Zt([Ne("type"),Ne("name")].concat($h)),MN=Ce,zN=[ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),$e("align","end",["start","end"]),Ge("primary",!1),Ge("disabled",!1)],DN=m(zN,[Ne("text")]),BN=m([Re("type",["submit","cancel","custom"])],DN),PN=m([Re("type",["menu"]),He("text"),He("tooltip"),He("icon"),Be("items",RN)],zN),IN=ve("type",{submit:BN,cancel:BN,custom:BN,menu:PN}),LN=[Ne("type"),Ne("text"),Re("level",["info","warn","error","success"]),Ne("icon"),je("url","")],HN=Zt(LN),FN=[Ne("type"),Ne("text"),Ge("disabled",!1),Ge("primary",!1),ie("name","name",Lt((function(){return Uo("button-name")})),xe),He("icon"),Ge("borderless",!1)],VN=Zt(FN),jN=[Ne("type"),Ne("name"),Ne("label"),Ge("disabled",!1)],UN=Zt(jN),WN=Ce,qN=[Ne("type"),Ne("name")],$N=qN.concat([He("label")]),GN=$N.concat([je("columns","auto")]),XN=Zt(GN),KN=ce([Ne("value"),Ne("text"),Ne("icon")]),YN=Zt($N),JN=xe,QN=Zt($N),ZN=xe,tR=qN.concat([qe("tag","textarea"),Ne("scriptId"),Ne("scriptUrl"),Ue("settings",void 0,Oe)]),eR=qN.concat([qe("tag","textarea"),Me("init")]),nR=le((function(t){return de("customeditor.old",Qt(eR),t).orThunk((function(){return de("customeditor.new",Qt(tR),t)}))})),rR=xe,oR=Zt($N),iR=te(ae),uR=function(t){return[Ne("type"),Ae("columns"),t]},aR=[Ne("type"),Ne("html"),$e("presets","presentation",["presentation","document"])],cR=Zt(aR),sR=$N.concat([Ge("sandboxed",!0)]),lR=Zt(sR),fR=xe,dR=$N.concat([Ee("currentState",Zt([_e("blob"),Ne("url")]))]),mR=Zt(dR),gR=$N.concat([He("inputMode"),He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),hR=Zt(gR),pR=xe,vR=function(t){return[Ne("type"),Ne("label"),t]},bR=[Ne("text"),Ne("value")],yR=[Ne("text"),Be("items",(yN=function(){return wR},wN=zt((function(){return yN()})),{extract:function(t,e,n){return wN().extract(t,e,n)},toString:function(){return wN().toString()}}))],wR=ee([Zt(bR),Zt(yR)]),xR=$N.concat([Be("items",wR),Ge("disabled",!1)]),CR=Zt(xR),SR=xe,kR=$N.concat([De("items",[Ne("text"),Ne("value")]),We("size",1),Ge("disabled",!1)]),OR=Zt(kR),TR=xe,_R=$N.concat([Ge("constrain",!0),Ge("disabled",!1)]),ER=Zt(_R),AR=Zt([Ne("width"),Ne("height")]),NR=[Ne("type"),Be("header",xe),Be("cells",te(xe))],RR=Zt(NR),MR=$N.concat([He("placeholder"),Ge("maximized",!1),Ge("disabled",!1)]),zR=Zt(MR),DR=xe,BR=$N.concat([$e("filetype","file",["image","media","file"]),je("disabled",!1)]),PR=Zt(BR),IR=Zt([Ne("value"),je("meta",{})]),LR=function(t){return ie("items","items",Pt(),te(le((function(e){return de("Checking item of "+t,HR,e).fold((function(t){return ct.error(he(t))}),(function(t){return ct.value(t)}))}))))},HR=se((function(){return pe("type",{alertbanner:HN,bar:Zt((t=LR("bar"),[Ne("type"),t])),button:VN,checkbox:UN,colorinput:YN,colorpicker:QN,dropzone:oR,grid:Zt(uR(LR("grid"))),iframe:lR,input:hR,listbox:CR,selectbox:OR,sizeinput:ER,textarea:zR,urlinput:PR,customeditor:nR,htmlpanel:cR,imagetools:mR,collection:XN,label:Zt(vR(LR("label"))),table:RR,panel:VR});var t})),FR=[Ne("type"),je("classes",[]),Be("items",HR)],VR=Zt(FR),jR=[ie("name","name",Lt((function(){return Uo("tab-name")})),xe),Ne("title"),Be("items",HR)],UR=[Ne("type"),De("tabs",jR)],WR=Zt(UR),qR=DN,$R=IN,GR=Zt([Ne("title"),Ee("body",pe("type",{panel:VR,tabpanel:WR})),qe("size","normal"),Be("buttons",$R),je("initialData",{}),Xe("onAction",t),Xe("onChange",t),Xe("onSubmit",t),Xe("onClose",t),Xe("onCancel",t),je("onTabChange",t)]),XR=Zt(m([Re("type",["cancel","custom"])],qR)),KR=Zt([Ne("title"),Ne("url"),Le("height"),Le("width"),(bN=XR,Ie("buttons",te(bN))),Xe("onAction",t),Xe("onCancel",t),Xe("onClose",t),Xe("onMessage",t)]),YR=function(t){return O(t)?[t].concat(Y(kt(t),YR)):T(t)?Y(t,YR):[]},JR=function(t){return k(t.type)&&k(t.name)},QR={checkbox:WN,colorinput:JN,colorpicker:ZN,dropzone:iR,input:pR,iframe:fR,sizeinput:AR,selectbox:TR,listbox:SR,size:AR,textarea:DR,urlinput:IR,customeditor:rR,collection:KN,togglemenuitem:MN},ZR=function(t){var e=function(t){return W(YR(t),JR)}(t),n=Y(e,(function(t){return function(t){return x.from(QR[t.type])}(t).fold((function(){return[]}),(function(e){return[Ee(t.name,e)]}))}));return Zt(n)},tM=function(t){return{internalDialog:me(de("dialog",GR,t)),dataValidator:ZR(t),initialData:t.initialData}},eM={open:function(t,e){var n=tM(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(me(de("dialog",KR,e)))},redial:function(t){return tM(t)}},nM=function(t){var e=[],n={};return yt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ct.error(e):ct.value(n)},rM=function(t,e){var n,r=Rg(Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:V(t.items,(function(t){return _k(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),(n=r,wf.config({find:n.getOpt})),cC(r,{postprocess:function(t){return nM(t).fold((function(t){return console.error(t),{}}),(function(t){return t}))}})])}},oM=mf({name:"TabButton",configFields:[je("uid",void 0),_e("value"),ie("dom","dom",Ht((function(){return{attributes:{role:"tab",id:Uo("aria"),"aria-selected":"false"}}})),be()),Pe("action"),je("domModification",{}),fl("tabButtonBehaviours",[Bm,km,ll]),_e("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Km(t.action),behaviours:ml(t.tabButtonBehaviours,[Bm.config({}),km.config({mode:"execution",useSpace:!0,useEnter:!0}),ll.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),iM=r([_e("tabs"),_e("dom"),je("clickToDismiss",!1),fl("tabbarBehaviours",[Nf,km]),Gu(["tabClass","selectedClass"])]),uM=Vl({factory:oM,name:"tabs",unit:"tab",overrides:function(e){var n=function(t,e){Nf.dehighlight(t,e),Vr(t,Ir(),{tabbar:t,button:e})},r=function(t,e){Nf.highlight(t,e),Vr(t,Pr(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(e.uid).getOrDie(),u=Nf.isHighlighted(i,o);(u&&e.clickToDismiss?n:u?t:r)(i,o)},domModification:{classes:[e.markers.tabClass]}}}}),aM=r([uM]),cM=gf({name:"Tabbar",configFields:iM(),partFields:aM(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:ml(t.tabbarBehaviours,[Nf.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){zo(e.element,"aria-selected","true")},onDehighlight:function(t,e){zo(e.element,"aria-selected","false")}}),km.config({mode:"flow",getInitial:function(t){return Nf.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),sM=mf({name:"Tabview",configFields:[fl("tabviewBehaviours",[Am])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:ml(t.tabviewBehaviours,[Am.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),lM=r([je("selectFirst",!0),Ku("onChangeTab"),Ku("onDismissTab"),je("tabs",[]),fl("tabSectionBehaviours",[])]),fM=Ll({factory:cM,schema:[_e("dom"),ze("markers",[_e("tabClass"),_e("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),dM=Ll({factory:sM,name:"tabview"}),mM=r([fM,dM]),gM=gf({name:"TabSection",configFields:lM(),partFields:mM(),factory:function(t,e,n,r){var o=function(e,n){Ql(e,t,"tabbar").each((function(t){n(t).each(jr)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:dl(t.tabSectionBehaviours),events:$r(K([t.selectFirst?[ro((function(t,e){o(t,Nf.getFirst)}))]:[],[Kr(Pr(),(function(e,n){var r,o;r=n.event.button,o=ll.getValue(r),Ql(r,t,"tabview").each((function(e){G(t.tabs,(function(t){return t.value===o})).each((function(n){var o=n.view();Bo(r.element,"id").each((function(t){zo(e.element,"aria-labelledby",t)})),Am.set(e,o),t.onChangeTab(e,r,o)}))}))})),Kr(Ir(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Ql(e,t,"tabview").map((function(t){return Am.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Nf.getCandidates(t);return G(n,(function(t){return ll.getValue(t)===e})).filter((function(e){return!Nf.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),hM=function(t,e){Bi(t,"height",e+"px"),Ln().browser.isIE()?Ui(t,"flex-basis"):Bi(t,"flex-basis",e+"px")},pM=function(t,e,n){Mu(t,'[role="dialog"]').each((function(t){zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Bi(e,"height","0"),Bi(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=po(t).dom,i=Mu(t,".tox-dialog-wrap").getOr(t);r="fixed"===Li(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=ru(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+fu(n)?Math.max(ru(n),u):u,c=parseInt(Li(t,"margin-top"),10)||0,s=parseInt(Li(t,"margin-bottom"),10)||0;return r-(ru(t)+c+s-a)}(t,e,r))})).each((function(t){hM(e,t)}))}))}))},vM=function(t){return zu(t,'[role="tabpanel"]')},bM="send-data-to-section",yM="send-data-to-view",wM=function(t,e){var n=Qe({}),r=function(t){var e=ll.getValue(t),r=nM(e).getOr({}),o=n.get(),i=Rt(o,r);n.set(i)},o=function(t){var e=n.get();ll.setValue(t,e)},i=Qe(null),a=V(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[Gx.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,(function(t){return _k(n,t,e)})),formBehaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)}),Nm("TabView.form.events",[ro(o),oo(r)]),Wa.config({channels:jt([{key:bM,value:{onReceive:r}},{key:yM,value:{onReceive:o}}])})])}}))]}}})),c=function(t){var e;return{smartTabHeight:(e=Qe(x.none()),{extraEvents:[ro((function(n){var r=n.element;vM(r).each((function(o){Bi(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r,i=(r=function(t,e,n){return V(t,(function(r,o){Am.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Am.set(n,[]),i.height}))}(t,o,n),nt(tt(r,(function(t,e){return t>e?-1:t<e?1:0}))));e.set(i)})),pM(r,o,e),Ui(o,"visibility"),function(t,e){nt(t).each((function(t){return gM.showTab(e,t.value)}))}(t,n),Ag.requestAnimationFrame((function(){pM(r,o,e)}))}))})),Kr(Ar(),(function(t){var n=t.element;vM(n).each((function(t){pM(n,t,e)}))})),Kr(cy,(function(t,n){var r=t.element;vM(r).each((function(t){var n=Ga();Bi(t,"visibility","hidden");var o=Fi(t,"height").map((function(t){return parseInt(t,10)}));Ui(t,"height"),Ui(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(x.from(i)),pM(r,t,e)):o.each((function(e){hM(t,e)})),Ui(t,"visibility"),n.each($a)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}(a).smartTabHeight;return gM.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=ll.getValue(e);Vr(t,ay,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[gM.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[cM.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:La([Xb.config({})])}),gM.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:La([Nm("tabpanel",c.extraEvents),km.config({mode:"acyclic"}),wf.config({find:function(t){return nt(gM.getViewItems(t))}}),ll.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([bM],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([yM],{})}}})])})},xM=Uo("update-dialog"),CM=Uo("update-title"),SM=Uo("update-body"),kM=Uo("update-footer"),OM=Uo("body-send-message"),TM=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:f(f({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:La([eC(0),_T.config({channel:SM,updateState:function(t,e){return x.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[wM(t.body,n)];default:return[rM(t.body,n)]}},initialData:t})])}},_M=mv.deviceType.isTouch(),EM=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},AM=function(t,e){return NN.parts.close(Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:La([Xb.config({})])}))},NM=function(){return NN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},RM=function(t,e){return NN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:AE("<p>"+e.translate(t)+"</p>")}]}]})},MM=function(t){return NN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},zM=function(t,e){return[Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},DM=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return NN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),x.some(!0)},useTabstopAt:function(t){return!bC(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:f({position:"relative"},t.extraStyles)},components:m([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:AE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:_M?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:La(m([Bm.config({}),Nm("dialog-events",t.dialogEvents.concat([no(or(),(function(t,e){km.focusIn(t)}))])),Nm("scroll-lock",[ro((function(){vi(Ri(),i)})),oo((function(){bi(Ri(),i)}))])],t.extraBehaviours)),eventOrder:f((e={},e[yr()]=["dialog-events"],e[Nr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Rr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},BM=function(t){return Ng.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:zg("close",t.icons)}}],action:function(t){Fr(t,ny)}})},PM=function(t,e,n){var r=function(t){return[Yi(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:f({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:La([_T.config({channel:CM,renderComponents:r})])}},IM=function(){return{dom:AE('<div class="tox-dialog__draghandle"></div>')}},LM=function(t,e){return function(t,e){var n=NN.parts.title(PM(t,x.none(),e)),r=NN.parts.draghandle(IM()),o=NN.parts.close(BM(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},HM=function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:AE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},FM=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){NN.setBusy(t(),(function(t,n){return HM(e.message,n)}))},onUnblock:function(){NN.setIdle(t())}}},VM=function(t,e,n,r){var o;return Zi(DM(f(f({},t),{lazySink:r.shared.getSink,extraBehaviours:m([_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:e}),fC({})],t.extraBehaviours),onEscape:function(t){Fr(t,ny)},dialogEvents:n,eventOrder:(o={},o[br()]=[_T.name(),Wa.name()],o[Nr()]=["scroll-lock",_T.name(),"messages","dialog-events","alloy.base.behaviour"],o[Rr()]=["alloy.base.behaviour","dialog-events","messages",_T.name(),"scroll-lock"],o)})))},jM=function(t){return V(t,(function(t){return"menu"===t.type?function(t){var e=V(t.items,(function(t){var e=Qe(!1);return f(f({},t),{storage:e})}));return f(f({},t),{items:e})}(t):t}))},UM=function(t){return $(t,(function(t,e){return"menu"===e.type?$(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},WM=function(t,e){return[Zr(or(),vC),t(ey,(function(t,n){e.onClose(),n.onClose()})),t(ny,(function(t,e,n,r){e.onCancel(t),Fr(r,ey)})),Kr(uy,(function(t,n){return e.onUnblock()})),Kr(iy,(function(t,n){return e.onBlock(n.event)}))]},qM=function(t,e,n){var r=function(e,n){return Kr(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){_T.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return m(WM(r,e),[r(oy,(function(t,e){return e.onSubmit(t)})),r(ty,(function(t,e,n){e.onChange(t,{name:n.name})})),r(ry,(function(t,e,r,o){var i=function(){return km.focusIn(o)},u=function(t){return Po(t,"disabled")||Bo(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Ti(o.element),c=Ga(a);e.onAction(t,{name:r.name,value:r.value}),Ga(a).fold(i,(function(t){u(t)||c.exists((function(e){return jn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!jn(e.element,t)})).each(i)}))})),r(ay,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),oo((function(e){var n=t();ll.setValue(e,n.getData())}))])},$M=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=U(n,(function(t){return"start"===t.align})),o=function(t,e){return Vb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},GM=function(t,e){return{dom:AE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:La([_T.config({channel:kM,initialData:t,updateState:function(t,n){var r=V(n.buttons,(function(t){var n=Rg(function(t,e){return xS(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return x.some({lookupByName:function(t,e){return function(t,e,n){return G(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:$M})])}},XM=function(t,e){return NN.parts.footer(GM(t,e))},KM=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=wf.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return Gx.getField(n,e).fold((function(){var r=t.getFooter();return _T.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return x.some(t)}))}return x.none()},YM=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=ll.getValue(r),i=wt(n,(function(t){return t.get()}));return f(f({},o),i)},setData:function(e){r((function(r){var i=o.getData(),u=f(f({},i),e),a=function(t,e){var n=t.getRoot();return _T.getState(n).get().map((function(t){return me(de("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();ll.setValue(c,a),yt(n,(function(t,e){Tt(u,e)&&t.set(u[e])}))}))},disable:function(e){KM(t,e).each(kp.disable)},enable:function(e){KM(t,e).each(kp.enable)},focus:function(e){KM(t,e).each(Bm.focus)},block:function(t){if(!k(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Vr(e,iy,{message:t})}))},unblock:function(){r((function(t){Fr(t,uy)}))},showTab:function(e){r((function(n){var r=t.getBody();_T.getState(r).get().exists((function(t){return t.isTabPanel()}))&&wf.getCurrent(r).each((function(t){gM.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([xM],r),n.getSystem().broadcastOn([CM],r.internalDialog),n.getSystem().broadcastOn([SM],r.internalDialog),n.getSystem().broadcastOn([kM],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(t){Fr(t,ey)}))}};return o},JM=tinymce.util.Tools.resolve("tinymce.util.URI"),QM=["insertContent","setContent","execCommand","close","block","unblock"],ZM=function(t){return O(t)&&-1!==QM.indexOf(t.mceAction)},tz=function(t,e,n,r){var o,i,a,c,s,l,d,g,h=LM(t.title,r),p=(g={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[hC({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:La([Xb.config({}),Bm.config({})])})]}],behaviours:La([km.config({mode:"acyclic",useTabstopAt:u(bC)})])},NN.parts.body(g)),v=t.buttons.bind((function(t){return 0===t.length?x.none():x.some(XM({buttons:t},r))})),b=(c=function(){return N},s=FM((function(){return A}),e),l=function(t,e){return Kr(t,(function(t,n){d(t,(function(r,o){e(c(),r,n.event,t)}))}))},d=function(t,e){_T.getState(t).get().each((function(n){e(n,t)}))},m(WM(l,s),[l(ry,(function(t,e,n){e.onAction(t,{name:n.name})}))])),y=f(f({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),w=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],C=new JM(t.url,{base_uri:new JM(window.location.href)}),S=C.protocol+"://"+C.host+(C.port?":"+C.port:""),T=Qe(x.none()),E=[Nm("messages",[ro((function(){var e=Tb(rn(window),"message",(function(e){if(C.isSameOrigin(new JM(e.raw.origin))){var r=e.raw.data;ZM(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!_(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,N,r):function(t){return!ZM(t)&&O(t)&&Tt(t,"mceAction")}(r)&&t.onMessage(N,r)}}));T.set(x.some(e))})),oo((function(){T.get().each((function(t){return t.unbind()}))}))]),Wa.config({channels:(o={},o[OM]={onReceive:function(t,e){zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,S)}))}},o)})],A=VM({header:h,body:p,footer:v,extraClasses:w,extraBehaviours:E,extraStyles:y},t,b,r),N=(i=A,a=function(t){i.getSystem().isConnected()&&t(i)},{block:function(t){if(!k(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a((function(e){Vr(e,iy,{message:t})}))},unblock:function(){a((function(t){Fr(t,uy)}))},close:function(){a((function(t){Fr(t,ey)}))},sendMessage:function(t){a((function(e){e.getSystem().broadcastOn([OM],t)}))}});return{dialog:A,instanceApi:N}},ez=function(t,e,n){return e&&n?[]:[uE.config({contextual:{lazyContext:function(){return x.some(ku(rn(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},nz=function(t){var e=t.backstage,n=t.editor,r=$p(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){NN.hide(c),r()},i=Rg(xS({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage)),u=NM(),a=AM(o,e.providers),c=Zi(DM({lazySink:function(){return e.getSink()},header:EM(u,a),body:RM(n,e.providers),footer:x.some(MM(zM([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,o)],eventOrder:{}}));NN.show(c);var s=i.get(c);Bm.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){NN.hide(s),r(t)},i=Rg(xS({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:x.none()},"submit",t.backstage)),u=xS({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:x.none()},"cancel",t.backstage),a=NM(),c=AM((function(){return o(!1)}),e.providers),s=Zi(DM({lazySink:function(){return e.getSink()},header:EM(a,c),body:RM(n,e.providers),footer:x.some(MM(zM([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(ny,(function(){return o(!1)})),Kr(oy,(function(){return o(!0)}))],eventOrder:{}}));NN.show(s);var l=i.get(s);Bm.focus(l)}}}(t),u=function(t,n){return eM.open((function(t,r,o){var i=r,u=function(t,e,n){var r=LM(t.internalDialog.title,n),o=function(t,e){var n=TM(t,x.none(),e,!1);return NN.parts.body(n)}({body:t.internalDialog.body},n),i=jM(t.internalDialog.buttons),u=UM(i),a=XM({buttons:i},n),c=qM((function(){return d}),FM((function(){return f}),e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:x.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=VM(l,t,c,n),d=YM({getRoot:function(){return f},getBody:function(){return NN.getBody(f)},getFooter:function(){return NN.getFooter(f)},getFormWrapper:function(){var t=NN.getBody(f);return wf.getCurrent(t).getOr(t)}},e.redial,u);return{dialog:f,instanceApi:d}}({dataValidator:o,initialData:i,internalDialog:t},{redial:eM.redial,closeWindow:function(){NN.hide(u.dialog),n(u.instanceApi)}},e);return NN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},a=function(t,o,i,u){return eM.open((function(t,a,c){var s,l=me(de("data",c,a)),d=(s=Qe(x.none()),{clear:function(){return s.set(x.none())},set:function(t){return s.set(x.some(t))},isSet:function(){return s.get().isSome()},on:function(t){return s.get().each(t)}}),g=e.shared.header.isPositionedAtTop(),h=function(){return d.on((function(t){vg.reposition(t),uE.refresh(t)}))},p=function(t,e,n,r){var o,i,u,a,c,s=Uo("dialog-label"),l=Uo("dialog-content"),f=Rg((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,Vb.sketch({dom:AE('<div class="tox-dialog__header"></div>'),components:[PM(u,x.some(a),c),IM(),BM(c)],containerBehaviours:La([mN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Du(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Rg(function(t,e,n,r){return TM(t,x.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=jM(t.internalDialog.buttons),g=UM(m),h=Rg(function(t,e){return GM(t,e)}({buttons:m},n)),p=qM((function(){return b}),{onBlock:function(t){AN.block(v,(function(e,n){return HM(t.message,n)}))},onUnblock:function(){AN.unblock(v)},onClose:function(){return e.closeWindow()}},n.shared.getSink),v=Zi({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=""+l,o)},eventOrder:(i={},i[br()]=[_T.name(),Wa.name()],i[yr()]=["execute-on-form"],i[Nr()]=["reflecting","execute-on-form"],i),behaviours:La([km.config({mode:"cyclic",onEscape:function(t){return Fr(t,ey),x.some(!0)},useTabstopAt:function(t){return!bC(t)&&("button"!==ao(t)||"disabled"!==Do(t,"disabled"))}}),_T.config({channel:xM,updateState:function(t,e){return x.some(e)},initialData:t}),Bm.config({}),Nm("execute-on-form",p.concat([no(or(),(function(t,e){km.focusIn(t)}))])),AN.config({getRoot:function(){return x.some(v)}}),Am.config({}),fC({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),b=YM({getRoot:function(){return v},getFooter:function(){return h.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var t=d.get(v);return wf.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:v,instanceApi:b}}({dataValidator:c,initialData:l,internalDialog:t},{redial:eM.redial,closeWindow:function(){d.on(vg.hide),n.off("ResizeEditor",h),d.clear(),i(p.instanceApi)}},e,u),v=Zi(vg.sketch(f(f({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},g?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:La(m([Nm("window-manager-inline-events",[Kr(Mr(),(function(t,e){Fr(p.dialog,ny)}))])],ez(n,r,g))),isExtraPart:function(t,e){return function(t){return Ab(t,".tox-alert-dialog")||Ab(t,".tox-confirm-dialog")}(e)}})));return d.set(v),vg.showWithin(v,o,tu(p.dialog),x.some(Ri())),r&&g||(uE.refresh(v),n.on("ResizeEditor",h)),p.instanceApi.setData(l),km.focusIn(p.dialog),p.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?a(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?a(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,r){return function(t,r){return eM.openUrl((function(t){var o=tz(t,{closeWindow:function(){NN.hide(o.dialog),r(o.instanceApi)}},n,e);return NN.show(o.dialog),o.instanceApi}),t)}(t,r)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};l.add("silver",(function(t){var e=SN(t),n=e.uiMothership,o=e.backstage,i=e.renderUI,u=e.getUi;kb(t,o.shared);var a=nz({editor:t,backstage:o});return{renderUI:i,getWindowManagerImpl:r(a),getNotificationManagerImpl:function(){return function(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),u=function(){o(),vg.hide(c)},a=Zi(Pg.sketch({text:t.text,level:I(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:x.from(t.icon),closeButton:!i,onAction:u,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),c=Zi(vg.sketch(f({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(c),t.timeout>0&&Ag.setTimeout((function(){u()}),t.timeout),{close:u,moveTo:function(t,e){vg.showAt(c,{anchor:"makeshift",x:t,y:e},tu(a))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(t){case"bc-bc":return Eg;case"tc-tc":return _g;case"tc-bc":return Sa;case"bc-tc":default:return ka}}(n),o={anchor:"node",root:Ri(),node:x.some(rn(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};vg.showAt(c,o,tu(a))}else vg.showAt(c,e.backstage.shared.anchors.banner(),tu(a))},text:function(t){Pg.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){Pg.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){j(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(nt(t).each((function(t){return t.moveRel(null,"banner")})),j(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}(0,{backstage:o},n)},ui:u()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t){return r((function(e,n){var u=Object.keys(e),a=Object.keys(n);if(!function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))}(o).eq(u,a))return!1;for(var c=u.length,s=0;s<c;s++){var l=u[s];if(!t.eq(e[l],n[l]))return!1}return!0}))},a=r((function(t,n){if(t===n)return!0;var r=e(t);return r===e(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===n:"array"===r?i(a).eq(t,n):"object"===r&&u(a).eq(t,n))})),c=function(){},s=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},l=function(t){return function(){return t}},f=function(t){return t};function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var m=function(t){return function(e){return!t(e)}},g=function(t){return function(){throw new Error(t)}},h=function(t){t()},p=l(!1),v=l(!0),b=function(){return y},y=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:p,isSome:p,isNone:v,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:e,map:b,each:c,bind:b,exists:p,forall:v,filter:b,equals:t,equals_:t,toArray:function(){return[]},toString:l("none()")}}(),w=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(p,(function(e){return n(t,e)}))}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},S=function(t){return function(e){return typeof e===t}},k=function(t){return function(e){return t===e}},O=C("string"),T=C("object"),_=C("array"),E=k(null),A=S("boolean"),N=k(void 0),R=function(t){return null==t},M=function(t){return!R(t)},z=S("function"),D=S("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(t,e){return P.call(t,e)},H=function(t,e){return L(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},V=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},U=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},W=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},q=function(t,e,n){return U(t,(function(t){n=e(n,t)})),n},$=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},G=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()}(t,e,p)},X=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return x.some(n);return x.none()},K=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!_(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);I.apply(e,t[n])}return e}(V(t,e))},Y=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},J=function(t){var e=B.call(t,0);return e.reverse(),e},Q=function(t,e){return W(t,(function(t){return!H(e,t)}))},Z=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},tt=function(t){return Z(t,0)},et=function(t){return Z(t,t.length-1)},nt=z(Array.from)?Array.from:function(t){return B.call(t)},rt=Object.keys,ot=Object.hasOwnProperty,it=function(t,e){for(var n=rt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ut=function(t,e){return at(t,(function(t,n){return{k:n,v:e(t,n)}}))},at=function(t,e){var n={};return it(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ct=function(t){return function(e,n){t[n]=e}},st=function(t,e,n,r){return it(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},lt=function(t,e){var n={},r={};return st(t,e,ct(n),ct(r)),{t:n,f:r}},ft=function(t,e){var n={};return st(t,e,ct(n),c),n},dt=function(t,e){return mt(t,e)?x.from(t[e]):x.none()},mt=function(t,e){return ot.call(t,e)},gt=function(t,e){return mt(t,e)&&void 0!==t[e]&&null!==t[e]},ht=Array.isArray,pt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return!1;return!0},vt=function(t,e){var n=[];return pt(t,(function(r,o){n.push(e(r,o,t))})),n},bt=function(t,e){var n=[];return pt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},yt=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},wt=function(t,e,n,r){for(var o=N(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},xt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Ct=function(t){return t[t.length-1]},St=function(){return(St=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function kt(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var Ot=function(){return Tt(0,0)},Tt=function(t,e){return{major:t,minor:e}},_t=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ot():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Tt(r(1),r(2))}(t,n)},Et=Ot,At=function(t,e){var n=String(e).toLowerCase();return G(t,(function(t){return t.search(n)}))},Nt=function(t,e){return-1!==t.indexOf(e)},Rt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(0,0+e.length)===e}(t,e)},Mt=function(t){return function(e){return e.replace(t,"")}},zt=Mt(/^\s+|\s+$/g),Dt=Mt(/^\s+/g),Bt=Mt(/\s+$/g),Pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,It=function(t){return function(e){return Nt(e,t)}},Lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Nt(t,"edge/")&&Nt(t,"chrome")&&Nt(t,"safari")&&Nt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pt],search:function(t){return Nt(t,"chrome")&&!Nt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Nt(t,"msie")||Nt(t,"trident")}},{name:"Opera",versionRegexes:[Pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:It("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:It("firefox")},{name:"Safari",versionRegexes:[Pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Nt(t,"safari")||Nt(t,"mobile/"))&&Nt(t,"applewebkit")}}],Ht=[{name:"Windows",search:It("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Nt(t,"iphone")||Nt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:It("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:It("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:It("linux"),versionRegexes:[]},{name:"Solaris",search:It("sunos"),versionRegexes:[]},{name:"FreeBSD",search:It("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:It("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ft={browsers:l(Lt),oses:l(Ht)},Vt="Edge",jt="Chrome",Ut="Opera",Wt="Firefox",qt="Safari",$t=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Vt),isChrome:r(jt),isIE:r("IE"),isOpera:r(Ut),isFirefox:r(Wt),isSafari:r(qt)}},Gt=function(){return $t({current:void 0,version:Et()})},Xt=$t,Kt=(l(Vt),l(jt),l("IE"),l(Ut),l(Wt),l(qt),"Windows"),Yt="Android",Jt="Linux",Qt="Solaris",Zt="FreeBSD",te="ChromeOS",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Kt),isiOS:r("iOS"),isAndroid:r(Yt),isOSX:r("OSX"),isLinux:r(Jt),isSolaris:r(Qt),isFreeBSD:r(Zt),isChromeOS:r(te)}},ne=function(){return ee({current:void 0,version:Et()})},re=ee,oe=(l(Kt),l("iOS"),l(Yt),l(Jt),l("OSX"),l(Qt),l(Zt),l(te),function(t,e){var n=Ft.browsers(),r=Ft.oses(),o=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(n,t).fold(Gt,Xt),i=function(t,e){return At(t,e).map((function(t){var n=_t(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t).fold(ne,re),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,t,e);return{browser:o,os:i,deviceType:u}}),ie=function(t){return window.matchMedia(t).matches},ue=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return oe(navigator.userAgent,ie)})),ae=function(){return ue()},ce=navigator.userAgent,se=ae(),le=se.browser,fe=se.os,de=se.deviceType,me=/WebKit/.test(ce)&&!le.isEdge(),ge="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,he=-1!==ce.indexOf("Windows Phone"),pe={opera:le.isOpera(),webkit:me,ie:!(!le.isIE()&&!le.isEdge())&&le.version.major,gecko:le.isFirefox(),mac:fe.isOSX()||fe.isiOS(),iOS:de.isiPad()||de.isiPhone(),android:fe.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:le.isIE()?document.documentMode||7:10,fileApi:ge,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!le.isIE(),desktop:de.isDesktop(),windowsPhone:he,browser:{current:le.current,version:le.version,isChrome:le.isChrome,isEdge:le.isEdge,isFirefox:le.isFirefox,isIE:le.isIE,isOpera:le.isOpera,isSafari:le.isSafari},os:{current:fe.current,version:fe.version,isAndroid:fe.isAndroid,isChromeOS:fe.isChromeOS,isFreeBSD:fe.isFreeBSD,isiOS:fe.isiOS,isLinux:fe.isLinux,isOSX:fe.isOSX,isSolaris:fe.isSolaris,isWindows:fe.isWindows},deviceType:{isDesktop:de.isDesktop,isiPad:de.isiPad,isiPhone:de.isiPhone,isPhone:de.isPhone,isTablet:de.isTablet,isTouch:de.isTouch,isWebView:de.isWebView}},ve=/^\s*|\s*$/g,be=function(t){return null==t?"":(""+t).replace(ve,"")},ye=function(t,e){return e?!("array"!==e||!ht(t))||typeof t===e:void 0!==t},we=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),pt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;we(t,e,n,r)})))},xe={trim:be,isArray:ht,is:ye,toArray:function(t){if(ht(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:pt,map:vt,grep:bt,inArray:yt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=this,a=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},walk:we,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||ye(t,"array")?t:vt(t.split(e||","),be)},_addCacheSuffix:function(t){var e=pe.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Ce=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Se=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ce(n.childNodes[0])},ke=function(t,e){var n=(e||document).createElement(t);return Ce(n)},Oe=function(t,e){var n=(e||document).createTextNode(t);return Ce(n)},Te=Ce,_e=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Ee=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ae=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ne=function(t,e){return t.dom===e.dom},Re=function(t,e){return ae().browser.isIE()?function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t.dom,e.dom,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Me=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),ze=function(t){return t.dom.nodeType},De=function(t){return function(e){return ze(e)===t}},Be=De(1),Pe=De(3),Ie=De(9),Le=De(11),He=function(t){return Te(t.dom.ownerDocument)},Fe=function(t){return Ie(t)?t:He(t)},Ve=function(t){return Te(Fe(t).dom.defaultView)},je=function(t){return x.from(t.dom.parentNode).map(Te)},Ue=function(t){return x.from(t.dom.previousSibling).map(Te)},We=function(t){return x.from(t.dom.nextSibling).map(Te)},qe=function(t){return J(_e(t,Ue))},$e=function(t){return _e(t,We)},Ge=function(t){return V(t.dom.childNodes,Te)},Xe=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(Te)},Ke=function(t){return Xe(t,0)},Ye=function(t){return Xe(t,t.dom.childNodes.length-1)},Je=function(t){return Le(t)},Qe=z(Element.prototype.attachShadow)&&z(Node.prototype.getRootNode),Ze=l(Qe),tn=Qe?function(t){return Te(t.dom.getRootNode())}:Fe,en=function(t){return Je(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Te(e)}(Fe(t))},nn=function(t){return Te(t.dom.host)},rn=function(t,e){je(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},on=function(t,e){We(t).fold((function(){je(t).each((function(t){an(t,e)}))}),(function(t){rn(t,e)}))},un=function(t,e){Ke(t).fold((function(){an(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},an=function(t,e){t.dom.appendChild(e.dom)},cn=function(t,e){j(e,(function(e){an(t,e)}))},sn=function(t){t.dom.textContent="",j(Ge(t),(function(t){ln(t)}))},ln=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},fn=function(t){var e,n=Ge(t);n.length>0&&(e=t,j(n,(function(t){rn(e,t)}))),ln(t)},dn=function(t){var e=Pe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=tn(t);return Je(e)?x.some(e):x.none()}(Te(e)).fold((function(){return o.body.contains(e)}),(n=dn,r=nn,function(t){return n(r(t))}))},mn=function(t,e){return{left:t,top:e,translate:function(n,r){return mn(t+n,e+r)}}},gn=mn,hn=function(t,e){return void 0!==t?t:void 0!==e?e:0},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?gn(n.offsetLeft,n.offsetTop):dn(t)?function(t){var e=t.getBoundingClientRect();return gn(e.left,e.top)}(e):gn(0,0)},vn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return gn(n,r)},bn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},yn=function(t,e){ae().browser.isSafari()&&z(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},wn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},xn=function(t){var e=void 0===t?window:t,n=e.document,r=vn(Te(n));return function(t){var e=void 0===t?window:t;return x.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return wn(r.left,r.top,n,o)}),(function(t){return wn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Cn=function(t){return function(e){return!!e&&e.nodeType===t}},Sn=function(t){return!!t&&!Object.getPrototypeOf(t)},kn=Cn(1),On=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return H(e,n)}return!1}},Tn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(kn(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},_n=function(t){return function(e){return kn(e)&&e.hasAttribute(t)}},En=function(t){return kn(t)&&t.hasAttribute("data-mce-bogus")},An=function(t){return kn(t)&&"TABLE"===t.tagName},Nn=function(t){return function(e){if(kn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Rn=On(["textarea","input"]),Mn=Cn(3),zn=Cn(8),Dn=Cn(9),Bn=Cn(11),Pn=On(["br"]),In=On(["img"]),Ln=Nn("true"),Hn=Nn("false"),Fn=On(["td","th"]),Vn=On(["video","audio","object","embed"]),jn=function(t){return void 0!==t.style&&z(t.style.getPropertyValue)},Un=function(t,e,n){if(!(O(n)||A(n)||D(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Wn=function(t,e,n){Un(t.dom,e,n)},qn=function(t,e){var n=t.dom;it(e,(function(t,e){Un(n,e,t)}))},$n=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Gn=function(t,e){return x.from($n(t,e))},Xn=function(t,e){t.dom.removeAttribute(e)},Kn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||dn(t)?r:Yn(n,e)},Yn=function(t,e){return jn(t)?t.style.getPropertyValue(e):""},Jn=function(t,e){var n=t.dom,r=Yn(n,e);return x.from(r).filter((function(t){return t.length>0}))},Qn=function(t){var e={},n=t.dom;if(jn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Zn=ae().browser,tr=function(t){return G(t,Be)},er=function(t,e){return t.children&&H(t.children,e)},nr={},rr={exports:nr};!function(t,e,r,o){!function(t){"object"==typeof e&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[u]={exports:{}};e[u][0].call(l.exports,(function(t){return o(e[u][1][t]||t)}),l,l.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(0,nr,rr);var or=rr.exports.boltExport,ir=function(t){var e=x.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=x.some(t),j(n,i),n=[])})),{get:r,map:function(t){return ir((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ur={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ar=function(t){setTimeout((function(){throw t}),0)},cr=function(t){var e=function(e){t().then(e,ar)};return{map:function(e){return cr((function(){return t().then(e)}))},bind:function(e){return cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sr=function(t){return cr((function(){return new or(t)}))},lr=function(t){return{is:function(e){return t===e},isValue:v,isError:p,getOr:l(t),getOrThunk:l(t),getOrDie:l(t),or:function(e){return lr(t)},orThunk:function(e){return lr(t)},fold:function(e,n){return n(t)},map:function(e){return lr(e(t))},mapError:function(e){return lr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return x.some(t)}}},fr=function(t){return{is:p,isValue:p,isError:v,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return g(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return fr(t)},mapError:function(e){return fr(e(t))},each:c,bind:function(e){return fr(t)},exists:p,forall:v,toOptional:x.none}},dr={value:lr,error:fr,fromOption:function(t,e){return t.fold((function(){return fr(e)}),lr)}},mr=function(t){if(!_(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var i=rt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!_(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=rt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!Y(e,(function(t){return H(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},gr=(mr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(f,f)});function hr(t,e,n,r,o){return t(n,r)?x.some(n):z(o)&&o(n)?x.none():e(n,r,o)}var pr,vr=function(t,e,n){for(var r=t.dom,o=z(n)?n:p;r.parentNode;){r=r.parentNode;var i=Te(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},br=function(t,e,n){return hr((function(t,e){return e(t)}),vr,t,e,n)},yr=function(t,e,n){return vr(t,(function(t){return Ee(t,e)}),n)},wr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?x.none():x.from(n.querySelector(t)).map(Te)}(e,t)},xr=function(t,e,n){return hr((function(t,e){return Ee(t,e)}),yr,t,e,n)},Cr=window.Promise?window.Promise:function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(e,t(i,this),t(u,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};function o(t){var e=this;null!==this._state?r((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function i(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void s(t(n,e),t(i,this),t(u,this))}this._state=!0,this._value=e,a.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n((function(n,i){o.call(r,new c(t,e,n,i))}))},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new n((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}t[i]=u,0==--r&&e(t)}catch(t){n(t)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.race=function(t){return new n((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},n}(),Sr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},kr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Or=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Sr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Tr={requestAnimationFrame:function(t,e){pr?pr.then(t):pr=new Cr((function(t){e||(e=document.body),function(t,e){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(t){window.setTimeout(t,0)}),r(t,e)}(t,e)})).then(t)},setTimeout:Sr,setInterval:kr,setEditorTimeout:function(t,e,n){return Sr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=kr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Or,throttle:Or,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}};function _r(t,e){void 0===e&&(e={});var n=0,r={},o=Te(t),i=Fe(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=xe._addCacheSuffix(a),d=function(t){return dt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?Tr.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=ke("link",i.dom);qn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Wn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Wn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,an(en(o),b),Wn(v,"href",f)}else h();else g()},c=function(t){return sr((function(e){a(t,s(e,l(dr.value(t))),s(e,l(dr.error(t))))}))},f=function(t){var e=xe._addCacheSuffix(t);dt(r,e).each((function(t){var n,i;0==--t.count&&(delete r[e],n=t.id,i=en(o),wr(i,"#"+n).each(ln))}))};return{load:a,loadAll:function(t,e,n){var r;(r=V(t,c),function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):j(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))}(r,sr)).get((function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(gr)):e(r.pass.map(gr))}))},unload:f,unloadAll:function(t){j(t,(function(t){f(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var Er=function(){var t=new WeakMap;return{forElement:function(e,n){var r=tn(e).dom;return x.from(t.get(r)).getOrThunk((function(){var e=_r(r,n);return t.set(r,e),e}))}}}(),Ar=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Nr=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,v)).hasOwnProperty(Me(n))}},Rr=Nr(["h1","h2","h3","h4","h5","h6"]),Mr=Nr(["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"]),zr=function(t){return Be(t)&&!Mr(t)},Dr=function(t){return Be(t)&&"br"===Me(t)},Br=Nr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Pr=Nr(["ul","ol","dl"]),Ir=Nr(["li","dd","dt"]),Lr=Nr(["thead","tbody","tfoot"]),Hr=Nr(["td","th"]),Fr=Nr(["pre","script","textarea","style"]),Vr=" ",jr="\ufeff",Ur=function(t){return"\ufeff"===t},Wr=function(t){return t.replace(/\uFEFF/g,"")},qr=kn,$r=Mn,Gr=function(t){return $r(t)&&(t=t.parentNode),qr(t)&&t.hasAttribute("data-mce-caret")},Xr=function(t){return $r(t)&&Ur(t.data)},Kr=function(t){return Gr(t)||Xr(t)},Yr=function(t){return t.firstChild!==t.lastChild||!Pn(t.firstChild)},Jr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset())===jr||t.isAtStart()&&Xr(e.previousSibling))},Qr=function(t){var e=t.container();return!!Mn(e)&&(e.data.charAt(t.offset()-1)===jr||t.isAtEnd()&&Xr(e.nextSibling))},Zr=function(t){return $r(t)&&t.data[0]===jr},to=function(t){return $r(t)&&t.data[t.data.length-1]===jr},eo=function(t){return t&&t.hasAttribute("data-mce-caret")?(n=(e=t.getElementsByTagName("br"))[e.length-1],En(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},no=Ln,ro=Hn,oo=Pn,io=Mn,uo=On(["script","style","textarea"]),ao=On(["img","input","textarea","hr","iframe","video","audio","object","embed"]),co=On(["table"]),so=Kr,lo=function(t){return!so(t)&&(io(t)?!uo(t.parentNode):ao(t)||oo(t)||co(t)||fo(t))},fo=function(t){return!1===function(t){return kn(t)&&"true"===t.getAttribute("unselectable")}(t)&&ro(t)},mo=function(t,e){return lo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(fo(t))return!1;if(no(t))return!0}return!0}(t,e)},go=/^[ \t\r\n]*$/,ho=function(t){return go.test(t)},po=function(t,e){return lo(t)&&!1===function(t,e){return Mn(t)&&ho(t.data)&&!1===function(t,e){var n,r,o=Te(e);return n=Te(t),r=d(Ne,o),yr(n,"pre,code",r).isSome()}(t,e)}(t,e)||function(t){return kn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||vo(t)},vo=_n("data-mce-bookmark"),bo=_n("data-mce-bogus"),yo=("data-mce-bogus","all",function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}),wo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(po(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new Ar(n,t);do{if(e){if(yo(n)){n=o.next(!0);continue}if(bo(n)){n=o.next();continue}}if(Pn(n))r++,n=o.next();else{if(po(n,t))return!1;n=o.next()}}while(n);return r<=1}(t.dom,e)},xo=function(t,e){return M(t)&&(po(t,e)||zr(Te(t)))},Co=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},So=function(t,e,n){var r=n||e;if(kn(e)&&Co(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)So(t,o[i],r);if(kn(e)){var u=e.childNodes;1===u.length&&Co(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Bn(t)||Dn(t)}(e)||po(e,r)||function(t){return!!kn(t)&&t.childNodes.length>0}(e)||function(t,e){return Mn(t)&&t.data.length>0&&function(t,e){var n=new Ar(t,e).prev(!1),r=new Ar(t,e).next(!1),o=N(n)||xo(n,e),i=N(r)||xo(r,e);return o&&i}(t,e)}(e,r)||t.remove(e),e},ko=xe.makeMap,Oo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,To=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_o=/[<>&\"\']/g,Eo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ao={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:"Ÿ"},No={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Ro={"<":"<",">":">","&":"&",""":'"',"'":"'"},Mo=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),No[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},zo=Mo("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),Do=function(t,e){return t.replace(e?Oo:To,(function(t){return No[t]||t}))},Bo=function(t,e){return t.replace(e?Oo:To,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":No[t]||"&#"+t.charCodeAt(0)+";"}))},Po=function(t,e,n){return n=n||zo,t.replace(e?Oo:To,(function(t){return No[t]||n[t]||t}))},Io={encodeRaw:Do,encodeAllRaw:function(t){return(""+t).replace(_o,(function(t){return No[t]||t}))},encodeNumeric:Bo,encodeNamed:Po,getEncodeFunc:function(t,e){var n=Mo(e)||zo,r=ko(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Oo:To,(function(t){return void 0!==No[t]?No[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Po(t,e,n)}:Po:r.numeric?Bo:Do},decode:function(t){return t.replace(Eo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Ao[e]||String.fromCharCode(e):Ro[t]||zo[t]||function(t){var e=ke("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},Lo={},Ho={},Fo=xe.makeMap,Vo=xe.each,jo=xe.extend,Uo=xe.explode,Wo=xe.inArray,qo=function(t,e){return(t=xe.trim(t))?t.split(e||" "):[]},$o=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Vo(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Fo(t,/[, ]/):Uo(t,/[, ]/)}))),n};function Go(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=Fo(o,/[, ]/,Fo(o.toUpperCase(),/[, ]/)):(o=Lo[e])||(o=Fo(n," ",Fo(n.toUpperCase()," ")),o=jo(o,r),Lo[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=qo(r));var s=qo(t);for(o=s.length;o--;)u={attributes:c(i=qo([e,n].join(" "))),attributesOrder:i,children:c(r,Ho)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=qo(t);n=u.length;for(var c=qo(e);n--;)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return Lo[t]?Lo[t]:(e="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"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),Vo(qo(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Vo(qo(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("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),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("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"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Vo(qo("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,Lo[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=$o(t.valid_styles),s=$o(t.invalid_styles,"map"),l=$o(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h="td th iframe video audio object script code",p=u("non_empty_elements",h+" pre",m),v=u("move_caret_before_on_enter_elements",h+" table",m),b=u("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"),y=u("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",b),w=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");Vo((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=qo(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(p=a[1],f=a[2],v=a[3],l=a[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(it(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=qo(l,"|")).length;i<u;i++)if(a=S.exec(l[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],w=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(Wo(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===p&&(s.validValues=Fo(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=x(f),r.push(c)):e[f]=c}}},S=function(t){e={},r=[],C(t),Vo(a,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(Lo.text_block_elements=Lo.block_elements=null,Vo(qo(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[a];delete(s=jo({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Vo(n,(function(t,e){t[a]&&(n[e]=t=jo({},n[e]),t[c]=t[a])}))})))},O=function(e){var r=/^([+\-]?)([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]+)\[([^\]]+)]$/;Lo[t.schema]=null,e&&Vo(qo(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Vo(qo(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},T=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};return t.valid_elements?S(t.valid_elements):(Vo(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Vo(qo("strong/b em/i"),(function(t){var n=qo(t,"/");e[n[1]].outputName=n[0]})),Vo(qo("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Vo(qo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Vo(qo("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Vo({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"},(function(t,n){e[n]&&(e[n].parentsRequired=qo(t))})),t.invalid_elements&&Vo(Uo(t.invalid_elements),(function(t){e[t]&&delete e[t]})),T("span")||C("span[!data-mce-type|*]"),{children:n,elements:e,getValidStyles:function(){return c},getValidClasses:function(){return l},getBlockElements:function(){return y},getInvalidStyles:function(){return s},getShortEndedElements:function(){return m},getTextBlockElements:function(){return b},getTextInlineElements:function(){return w},getBoolAttrs:function(){return g},getElementRule:T,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return p},getMoveCaretBeforeOnEnterElements:function(){return v},getWhiteSpaceElements:function(){return f},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=T(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}}var Xo,Ko,Yo,Jo,Qo,Zo,ti,ei,ni,ri,oi,ii,ui,ai,ci,si,li,fi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},di=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,a=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<l.length;n++)s[l[n]]="\ufeff"+n,s["\ufeff"+n]=l[n];return{toHex:function(t){return t.replace(i,fi)},parse:function(e){var r,o,l,f,d,m,g,h={},p=t.url_converter,v=t.url_converter_scope||this,b=function(t,e,r){var o=h[t+"-top"+e];if(o){var i=h[t+"-right"+e];if(i){var u=h[t+"-bottom"+e];if(u){var a=h[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(h[t+e]=-1===n?c[0]:c.join(" "),delete h[t+"-top"+e],delete h[t+"-right"+e],delete h[t+"-bottom"+e],delete h[t+"-left"+e])}}}}},y=function(t){var e,n=h[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return h[t]=n[0],!0}},w=function(t){return f=!0,s[t]},x=function(t,e){return f&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return s[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},C=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},S=function(t){return t.replace(/\\[0-9a-f]+/gi,C)},k=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=x(i)).replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return p&&(n=p.call(v,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));r=a.exec(e);)if(a.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),l=r[2].replace(c,""),o&&l){if(o=S(o),l=S(l),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===o&&"700"===l?l="bold":"color"!==o&&"background-color"!==o||(l=l.toLowerCase()),l=(l=l.replace(i,fi)).replace(u,k),h[o]=f?x(l,!0):l}b("border","",!0),b("border","-width"),b("border","-color"),b("border","-style"),b("padding",""),b("margin",""),"border",m="border-style",g="border-color",y(d="border-width")&&y(m)&&y(g)&&(h.border=h[d]+" "+h[m]+" "+h[g],delete h[d],delete h[m],delete h[g]),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):it(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},mi=/^(?:mouse|contextmenu)|click/,gi={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},hi=function(){return!1},pi=function(){return!0},vi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},bi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},yi=function(t,e){var n,r=e||{};for(n in t)gi[n]||(r[n]=t[n]);if(r.target||(r.target=r.srcElement||document),r.composedPath&&(r.composedPath=function(){return t.composedPath()}),t&&function(t){return mi.test(t.type)}(t)&&void 0===t.pageX&&void 0!==t.clientX){var o=r.target.ownerDocument||document,i=o.documentElement,u=o.body;r.pageX=t.clientX+(i&&i.scrollLeft||u&&u.scrollLeft||0)-(i&&i.clientLeft||u&&u.clientLeft||0),r.pageY=t.clientY+(i&&i.scrollTop||u&&u.scrollTop||0)-(i&&i.clientTop||u&&u.clientTop||0)}return r.preventDefault=function(){r.isDefaultPrevented=pi,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},r.stopPropagation=function(){r.isPropagationStopped=pi,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=pi,r.stopPropagation()},!1===function(t){return t.isDefaultPrevented===pi||t.isDefaultPrevented===hi}(r)&&(r.isDefaultPrevented=hi,r.isPropagationStopped=hi,r.isImmediatePropagationStopped=hi),void 0===r.metaKey&&(r.metaKey=!1),r},wi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){bi(t,"DOMContentLoaded",i),bi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():vi(t,"DOMContentLoaded",i),n.domLoaded||vi(t,"load",i)}},xi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(yi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,yi({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=yi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=yi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(yi({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?wi(t,s,f):vi(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],bi(t,r.fakeName||u,r.nativeHandler,r.capture))}}else it(a,(function(e,n){bi(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(mt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=yi(null,n);o.type=e,o.target=t;do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Ci="sizzle"+-new Date,Si=window.document,ki=0,Oi=0,Ti=iu(),_i=iu(),Ei=iu(),Ai=function(t,e){return t===e&&(ri=!0),0},Ni="undefined",Ri=1<<31,Mi={}.hasOwnProperty,zi=[],Di=zi.pop,Bi=zi.push,Pi=zi.push,Ii=zi.slice,Li=zi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Hi="[\\x20\\t\\r\\n\\f]",Fi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Vi="\\[[\\x20\\t\\r\\n\\f]*("+Fi+")(?:"+Hi+"*([*^$|!~]?=)"+Hi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Fi+"))|)"+Hi+"*\\]",ji=":("+Fi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Vi+")*)|.*)\\)|)",Ui=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),Wi=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),qi=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),$i=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),Gi=new RegExp(ji),Xi=new RegExp("^"+Fi+"$"),Ki={ID:new RegExp("^#("+Fi+")"),CLASS:new RegExp("^\\.("+Fi+")"),TAG:new RegExp("^("+Fi+"|[*])"),ATTR:new RegExp("^"+Vi),PSEUDO:new RegExp("^"+ji),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Yi=/^(?:input|select|textarea|button)$/i,Ji=/^h\d$/i,Qi=/^[^{]+\{\s*\[native \w/,Zi=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tu=/[+~]/,eu=/'|\\/g,nu=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ru=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Pi.apply(zi=Ii.call(Si.childNodes),Si.childNodes),zi[Si.childNodes.length].nodeType}catch(t){Pi={apply:zi.length?function(t,e){Bi.apply(t,Ii.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var ou=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Si)!==ii&&oi(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||ii).nodeType)&&9!==a)return[];if(ai&&!r){if(o=Zi.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&li(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Pi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&Xo.getElementsByClassName)return Pi.apply(n,e.getElementsByClassName(u)),n}if(Xo.qsa&&(!ci||!ci.test(t))){if(f=l=Ci,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Qo(t),(l=e.getAttribute("id"))?f=l.replace(eu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+fu(s[c]);d=tu.test(t)&&su(e.parentNode)||e,m=s.join(",")}if(m)try{return Pi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return ti(t.replace(Ui,"$1"),e,n,r)};function iu(){var t=[];return function e(n,r){return t.push(n+" ")>Ko.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function uu(t){return t[Ci]=!0,t}function au(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Ri)-(~t.sourceIndex||Ri);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function cu(t){return uu((function(e){return e=+e,uu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function su(t){return t&&typeof t.getElementsByTagName!==Ni&&t}function lu(){}function fu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function du(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Oi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[ki,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Ci]||(e[Ci]={}))[r])&&a[0]===ki&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function mu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function gu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function hu(t,e,n,r,o,i){return r&&!r[Ci]&&(r=hu(r)),o&&!o[Ci]&&(o=hu(o,i)),uu((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ou(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:gu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=gu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?Li.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=gu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Pi.apply(u,v)}))}function pu(t){for(var e,n,r,o=t.length,i=Ko.relative[t[0].type],u=i||Ko.relative[" "],a=i?1:0,c=du((function(t){return t===e}),u,!0),s=du((function(t){return Li.call(e,t)>-1}),u,!0),l=[function(t,n,r){return!i&&(r||n!==ei)||((e=n).nodeType?c(t,n,r):s(t,n,r))}];a<o;a++)if(n=Ko.relative[t[a].type])l=[du(mu(l),n)];else{if((n=Ko.filter[t[a].type].apply(null,t[a].matches))[Ci]){for(r=++a;r<o&&!Ko.relative[t[r].type];r++);return hu(a>1&&mu(l),a>1&&fu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Ui,"$1"),n,a<r&&pu(t.slice(a,r)),r<o&&pu(t=t.slice(r)),r<o&&fu(t))}l.push(n)}return mu(l)}Xo=ou.support={},Jo=ou.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},oi=ou.setDocument=function(t){var e,n=t?t.ownerDocument||t:Si,r=n.defaultView;return n!==ii&&9===n.nodeType&&n.documentElement?(ii=n,ui=n.documentElement,ai=!Jo(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){oi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){oi()}))),Xo.attributes=!0,Xo.getElementsByTagName=!0,Xo.getElementsByClassName=Qi.test(n.getElementsByClassName),Xo.getById=!0,Ko.find.ID=function(t,e){if(typeof e.getElementById!==Ni&&ai){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Ko.filter.ID=function(t){var e=t.replace(nu,ru);return function(t){return t.getAttribute("id")===e}},Ko.find.TAG=Xo.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Ni)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Ko.find.CLASS=Xo.getElementsByClassName&&function(t,e){if(ai)return e.getElementsByClassName(t)},si=[],ci=[],Xo.disconnectedMatch=!0,ci=ci.length&&new RegExp(ci.join("|")),si=si.length&&new RegExp(si.join("|")),e=Qi.test(ui.compareDocumentPosition),li=e||Qi.test(ui.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ai=e?function(t,e){if(t===e)return ri=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Xo.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Si&&li(Si,t)?-1:e===n||e.ownerDocument===Si&&li(Si,e)?1:ni?Li.call(ni,t)-Li.call(ni,e):0:4&r?-1:1)}:function(t,e){if(t===e)return ri=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:ni?Li.call(ni,t)-Li.call(ni,e):0;if(i===u)return au(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?au(a[o],c[o]):a[o]===Si?-1:c[o]===Si?1:0},n):ii},ou.matches=function(t,e){return ou(t,null,null,e)},ou.matchesSelector=function(t,e){if((t.ownerDocument||t)!==ii&&oi(t),e=e.replace($i,"='$1']"),Xo.matchesSelector&&ai&&(!si||!si.test(e))&&(!ci||!ci.test(e)))try{var n=(void 0).call(t,e);if(n||Xo.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return ou(e,ii,null,[t]).length>0},ou.contains=function(t,e){return(t.ownerDocument||t)!==ii&&oi(t),li(t,e)},ou.attr=function(t,e){(t.ownerDocument||t)!==ii&&oi(t);var n=Ko.attrHandle[e.toLowerCase()],r=n&&Mi.call(Ko.attrHandle,e.toLowerCase())?n(t,e,!ai):void 0;return void 0!==r?r:Xo.attributes||!ai?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},ou.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ou.uniqueSort=function(t){var e,n=[],r=0,o=0;if(ri=!Xo.detectDuplicates,ni=!Xo.sortStable&&t.slice(0),t.sort(Ai),ri){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return ni=null,t},Yo=ou.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Yo(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Yo(e);return n},(Ko=ou.selectors={cacheLength:50,createPseudo:uu,match:Ki,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(nu,ru),t[3]=(t[3]||t[4]||t[5]||"").replace(nu,ru),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ou.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ou.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Ki.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Gi.test(n)&&(e=Qo(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(nu,ru).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Ti[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+Hi+"|$)"))&&Ti(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Ni&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=ou.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[Ci]||(p[Ci]={}))[t]||[])[0]===ki&&s[1],d=s[0]===ki&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[ki,m,d];break}}else if(b&&(s=(e[Ci]||(e[Ci]={}))[t])&&s[0]===ki)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ci]||(f[Ci]={}))[t]=[ki,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Ko.pseudos[t]||Ko.setFilters[t.toLowerCase()]||ou.error("unsupported pseudo: "+t);return r[Ci]?r(e):r.length>1?(n=[t,t,"",e],Ko.setFilters.hasOwnProperty(t.toLowerCase())?uu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Li.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:uu((function(t){var e=[],n=[],r=Zo(t.replace(Ui,"$1"));return r[Ci]?uu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:uu((function(t){return function(e){return ou(t,e).length>0}})),contains:uu((function(t){return t=t.replace(nu,ru),function(e){return(e.textContent||e.innerText||Yo(e)).indexOf(t)>-1}})),lang:uu((function(t){return Xi.test(t||"")||ou.error("unsupported lang: "+t),t=t.replace(nu,ru).toLowerCase(),function(e){var n;do{if(n=ai?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===ui},focus:function(t){return t===ii.activeElement&&(!ii.hasFocus||ii.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Ko.pseudos.empty(t)},header:function(t){return Ji.test(t.nodeName)},input:function(t){return Yi.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:cu((function(){return[0]})),last:cu((function(t,e){return[e-1]})),eq:cu((function(t,e,n){return[n<0?n+e:n]})),even:cu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:cu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:cu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:cu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Ko.pseudos.eq,j(["radio","checkbox","file","password","image"],(function(t){Ko.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),j(["submit","reset"],(function(t){Ko.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),lu.prototype=Ko.filters=Ko.pseudos,Ko.setFilters=new lu,Qo=ou.tokenize=function(t,e){var n,r,o,i,u,a,c,s=_i[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=Ko.preFilter;u;){for(i in n&&!(r=Wi.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=qi.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Ui," ")}),u=u.slice(n.length)),Ko.filter)Ko.filter.hasOwnProperty(i)&&(!(r=Ki[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?ou.error(t):_i(t,a).slice(0)},Zo=ou.compile=function(t,e){var n,r=[],o=[],i=Ei[t+" "];if(!i){for(e||(e=Qo(t)),n=e.length;n--;)(i=pu(e[n]))[Ci]?r.push(i):o.push(i);(i=Ei(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=ei,v=o||r&&Ko.find.TAG("*",c),b=ki+=null==p?1:Math.random()||.1,y=v.length;for(c&&(ei=i!==ii&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(ki=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Di.call(a));h=gu(h)}Pi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&ou.uniqueSort(a)}return c&&(ki=b,ei=p),g};return n?uu(o):o}(o,r))).selector=t}return i},ti=ou.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Qo(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&Xo.getById&&9===e.nodeType&&ai&&Ko.relative[i[1].type]){if(!(e=(Ko.find.ID(u.matches[0].replace(nu,ru),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=Ki.needsContext.test(t)?0:i.length;o--&&(u=i[o],!Ko.relative[a=u.type]);)if((c=Ko.find[a])&&(r=c(u.matches[0].replace(nu,ru),tu.test(i[0].type)&&su(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&fu(i)))return Pi.apply(n,r),n;break}}return(s||Zo(t,l))(r,e,!ai,n,tu.test(t)&&su(e.parentNode)||e),n},Xo.sortStable=Ci.split("").sort(Ai).join("")===Ci,Xo.detectDuplicates=!!ri,oi(),Xo.sortDetached=!0;var vu=document,bu=Array.prototype.push,yu=Array.prototype.slice,wu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,xu=xi.Event,Cu=xe.makeMap("children,contents,next,prev"),Su=function(t){return void 0!==t},ku=function(t){return"string"==typeof t},Ou=function(t,e){var n,r=(e=e||vu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Tu=function(t,e,n,r){var o;if(ku(e))e=Ou(e,Fu(t[0]));else if(e.length&&!e.nodeType){if(e=Wu.makeArray(e),r)for(o=e.length-1;o>=0;o--)Tu(t,e[o],n,r);else for(o=0;o<e.length;o++)Tu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},_u=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Eu=function(t,e,n){var r,o;return e=Wu(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Au=xe.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Nu=xe.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ru={for:"htmlFor",class:"className",readonly:"readOnly"},Mu={float:"cssFloat"},zu={},Du={},Bu=function(t,e){return new Wu.fn.init(t,e)},Pu=/^\s*|\s*$/g,Iu=function(t){return null==t?"":(""+t).replace(Pu,"")},Lu=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Hu=function(t,e){var n=[];return Lu(t,(function(t,r){e(r,t)&&n.push(r)})),n},Fu=function(t){return t?9===t.nodeType?t:t.ownerDocument:vu};Bu.fn=Bu.prototype={constructor:Bu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return Wu(t).attr(e);o.context=e=document}if(ku(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:wu.exec(t)))return Wu(e).find(t);if(n[1])for(r=Ou(t,Fu(e)).firstChild;r;)bu.call(o,r),r=r.nextSibling;else{if(!(r=Fu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return xe.toArray(this)},add:function(t,e){var n,r,o=this;if(ku(t))return o.add(Wu(t));if(!1!==e)for(n=Wu.unique(o.toArray().concat(Wu.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else bu.apply(o,Wu.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)Lu(t,(function(t,e){r.attr(t,e)}));else{if(!Su(e)){if(r[0]&&1===r[0].nodeType){if((n=zu[t])&&n.get)return n.get(r[0],t);if(Nu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=zu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ru[t]||t))Lu(t,(function(t,e){n.prop(t,e)}));else{if(!Su(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)Lu(t,(function(t,e){o.css(t,e)}));else if(Su(e))t=i(t),"number"!=typeof e||Au[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Du[t])&&r.set)r.set(this,e);else{try{this.style[Mu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Du[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],xu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if(Su(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){Wu(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(Su(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Tu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Tu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Wu(t).append(this),this},prependTo:function(t){return Wu(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Eu(this,t)},wrapAll:function(t){return Eu(this,t,!0)},wrapInner:function(t){return this.each((function(){Wu(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Wu(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Wu(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?Lu(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=_u(r,t);if(o!==e){var i=r.className;o?r.className=Iu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return _u(this[0],t)},each:function(t){return Lu(this,t)},on:function(t,e){return this.each((function(){xu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){xu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?xu.fire(this,t.type,t):xu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Wu(yu.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Wu.find(t,this[e],r);return Wu(r)},filter:function(t){return Wu("function"==typeof t?Hu(this.toArray(),(function(e,n){return t(n,e)})):Wu.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Wu&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Wu(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Wu(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:bu,sort:Array.prototype.sort,splice:Array.prototype.splice},xe.extend(Bu,{extend:xe.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:xe.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:xe.isArray,each:Lu,trim:Iu,grep:Hu,find:ou,expr:ou.selectors,unique:ou.uniqueSort,text:ou.getText,contains:ou.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?Wu.find.matchesSelector(e[0],t)?[e[0]]:[]:Wu.find.matches(t,e)}});var Vu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Wu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Wu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},ju=function(t,e,n,r){var o=[];for(r instanceof Wu&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Wu(t).is(r))break}o.push(t)}return o},Uu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Lu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Vu(t,"parentNode")},next:function(t){return Uu(t,"nextSibling",1)},prev:function(t){return Uu(t,"previousSibling",1)},children:function(t){return ju(t.firstChild,"nextSibling",1)},contents:function(t){return xe.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Bu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Wu.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Cu[t]||(r=Wu.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Wu(r);return n?o.filter(n):o}})),Lu({parentsUntil:function(t,e){return Vu(t,"parentNode",e)},nextUntil:function(t,e){return ju(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return ju(t,"previousSibling",1,e).slice(1)}},(function(t,e){Bu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Wu.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Wu.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Wu(o);return r?i.filter(r):i}})),Bu.fn.is=function(t){return!!t&&this.filter(t).length>0},Bu.fn.init.prototype=Bu.fn,Bu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Wu.extend(n,this),n},Bu.attrHooks=zu,Bu.cssHooks=Du;var Wu=Bu,qu=xe.each,$u=xe.grep,Gu=pe.ie,Xu=/^([a-z0-9],?)+$/i,Ku=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Yu=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function Ju(t,e){var n=this;void 0===e&&(e={});var r={},o=window,i={},u=0,a=Er.forElement(Te(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],l=e.schema?e.schema:Go({}),f=di({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new xi:xi.Event,m=l.getBlockElements(),g=Wu.overrideDefaults((function(){return{context:t,element:W.getRoot()}})),h=function(e){return e&&t&&O(e)?t.getElementById(e):e},p=function(t){return g("string"==typeof t?h(t):t)},v=function(t,e,n){var r,o,i=p(t);return i.length&&(o=(r=q[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=h(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=p(t),i=o.attr(n);if(o.length){var u=q[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return function(t,e,n){var r,o,i=0,u=0,a=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Kn(Te(t),"position"))return{x:i=(o=e.getBoundingClientRect()).left+(a.documentElement.scrollLeft||t.scrollLeft)-a.documentElement.clientLeft,y:u=o.top+(a.documentElement.scrollTop||t.scrollTop)-a.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!er(r,n);)i+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!er(r,n);)i-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=function(t){return Zn.isFirefox()&&"table"===Me(t)?tr(Ge(t)).filter((function(t){return"caption"===Me(t)})).bind((function(t){return tr($e(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Te(e))}return{x:i,y:u}}(t.body,h(e),n)},C=function(t,e,n){var r=p(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=pe.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},S=function(t){var e,n;return t=h(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Xu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return ou(e,i[0].ownerDocument||i[0],null,i).length>0},T=function(t,e,n,r){var o,i=[],u=h(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),xe.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return k(t,o)});u&&!(u===n||R(u.nodeType)||Dn(u)||Bn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},E=function(t,e,r){var o,i="string"==typeof t?h(t):t;if(!i)return!1;if(xe.isArray(i)&&(i.length||0===i.length))return o=[],qu(i,(function(t,n){t&&o.push(e.call(r,"string"==typeof t?h(t):t,n))})),o;var u=r||n;return e.call(u,i)},A=function(t,e){p(t).each((function(t,n){qu(e,(function(t,e){y(n,e,t)}))}))},N=function(t,e){var n=p(t);Gu?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Wu("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},M=function(e,n,r,o,i){return E(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&N(u,o)),i?u:e.appendChild(u)}))},z=function(e,n,r){return M(t.createElement(e),e,n,r,!0)},D=Io.encodeAllRaw,B=function(t,e){var n=p(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){p(t).toggleClass(e,n).each((function(){""===this.className&&Wu(this).attr("class",null)}))},I=function(t,e,n){return E(e,(function(e){return xe.is(e,"array")&&(t=t.cloneNode(!0)),n&&qu($u(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(kn(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,r,i,u){if(xe.isArray(n)){for(var a=n.length,c=[];a--;)c[a]=F(n[a],r,i,u);return c}return!e.collect||n!==t&&n!==o||s.push([n,r,i,u]),d.bind(n,r,i,u||W)},V=function(e,n,r){if(xe.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,r);return u}if(s.length>0&&(e===t||e===o))for(i=s.length;i--;){var a=s[i];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||d.unbind(a[0],a[1],a[2])}return d.unbind(e,n,r)},U=function(t){if(t&&kn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},W={doc:t,settings:e,win:o,files:i,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:s,styles:f,schema:l,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:g,$$:p,root:null,clone:function(e,n){if(!Gu||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return qu(b(e),(function(t){y(r,t.nodeName,v(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=xn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=h(t);var e=x(t),n=S(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:S,getParent:function(t,e,n){var r=T(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:T,get:h,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return ou(n,h(r)||e.root_element||t,[])},is:k,add:M,create:z,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+D(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=O(n)?p(t).css(n,r):p(t).css(n);e.update_styles&&Ku(f,o)},getStyle:C,setStyles:function(t,n){var r=p(t).css(n);e.update_styles&&Ku(f,r)},removeAllAttribs:function(t){return E(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(t){return f.parse(t)},serializeStyle:function(t,e){return f.serialize(t,e)},addStyle:function(e){var n,o;if(W!==Ju.DOM&&t===document){if(r[e])return;r[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(n=t.getElementsByTagName("head")[0]).firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),j(t.split(","),(function(t){i[t]=!0,a.load(t,c)}))},addClass:function(t,e){p(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return p(t).hasClass(e)},toggleClass:P,show:function(t){p(t).show()},hide:function(t){p(t).hide()},isHidden:function(t){return"none"===p(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?h(t):t;return kn(e)?e.outerHTML:Wu("<div></div>").append(Wu(e).clone()).html()},setOuterHTML:function(t,e){p(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Wu(this).html(e),!0)}))},decode:Io.decode,encode:D,insertAfter:function(t,e){var n=h(e);return E(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=z(e),qu(b(t),(function(e){y(n,e.nodeName,v(t,e.nodeName))})),I(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return f.toHex(xe.trim(t))},run:E,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Ar(t,t.parentNode),u=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,kn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!ho(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&ho(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:Yu,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,Yu(t)),u.setEnd(e.parentNode,Yu(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,Yu(e)+1),u.setEnd(t.parentNode,Yu(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(So(W,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(So(W,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:U,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=U(t));t=t.parentNode);return n},destroy:function(){if(s.length>0)for(var t=s.length;t--;){var e=s[t];d.unbind(e[0],e[1],e[2])}it(i,(function(t,e){a.unload(e),delete i[e]})),ou.setDocument&&ou.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},q=function(t,e,n){var r=e.keep_values,o={set:function(t,n,r){e.url_converter&&(n=e.url_converter.call(e.url_converter_scope||W,n,r,t[0])),t.attr("data-mce-"+r,n).attr(r,n)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(f,e);return W}!function(t){t.DOM=t(document),t.nodeIndex=Yu}(Ju||(Ju={}));var Qu=Ju,Zu=Qu.DOM,ta=xe.each,ea=xe.grep,na=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=Zu,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=xe._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),z(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ta(o.scriptLoadedCallbacks[e],(function(e){z(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=ea(t);if(t.length=0,ta(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ta(n,(function(t){0===i.length?z(t.success)&&t.success.call(t.scope):z(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),ra=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},oa={},ia=ra("en"),ua=function(){return dt(oa,ia.get())},aa={getData:function(){return ut(oa,(function(t){return St({},t)}))},setCode:function(t){t&&ia.set(t)},getCode:function(){return ia.get()},add:function(t,e){var n=oa[t];n||(oa[t]=n={}),it(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=ua().getOr({}),r=function(t){return z(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return dt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(T(e=t)&&mt(e,"raw"))return r(t.raw);if(function(t){return _(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return mt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return ua().bind((function(t){return dt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return mt(oa,t)}};function ca(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=W(o,(function(n){return n.name===t&&n.state===e}));j(n,(function(t){return t.callback()}))},u=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},c=function(t,e,o,s,l){if(!n[t]){var f="string"==typeof e?e:e.prefix+e.resource+e.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ca.baseURL+"/"+f),n[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){i(t,"loaded"),function(t,e,n,r){var o=u(t);j(o,(function(t){var n=a(e,t);c(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(na))}(t,e,o,s)};r[t]?d():na.ScriptLoader.add(f,d,s,l)}},s=function(t,e,i){void 0===i&&(i="added"),mt(r,t)&&"added"===i||mt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){if(r[t])return r[t].instance},dependencies:u,requireLangPack:function(t,e){!1!==ca.languageLoad&&s(t,(function(){var r=aa.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||na.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},add:function(t,n,o){var u=n;return e.push(u),r[t]={instance:u,dependencies:o},i(t,"added"),u},remove:function(t){delete n[t],delete r[t]},createUrl:a,addComponents:function(e,n){var r=t.urls[e];j(n,(function(t){na.ScriptLoader.add(r+"/"+t)}))},load:c,waitFor:s}}!function(t){t.PluginManager=t(),t.ThemeManager=t()}(ca||(ca={}));var sa=ca,la=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null===n&&(n=setTimeout((function(){t.apply(null,r),n=null}),e))}}},fa=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},da=function(t,e){var n=$n(t,e);return void 0===n||""===n?[]:n.split(" ")},ma=function(t){return void 0!==t.dom.classList},ga=function(t,e){ma(t)?t.dom.classList.add(e):function(t,e){(function(t,e,n){var r=da(t,e).concat([n]);Wn(t,e,r.join(" "))})(t,"class",e)}(t,e)},ha=function(t,e){return ma(t)&&t.dom.classList.contains(e)},pa=function(t,e){var n=[];return j(Ge(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(pa(t,e))})),n},va=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ae(n)?[]:V(n.querySelectorAll(t),Te)}(e,t)},ba=l("mce-annotation"),ya=l("data-mce-annotation"),wa=l("data-mce-annotation-uid"),xa=function(t,e){var n=t.selection.getRng(),r=Te(n.startContainer),o=Te(t.getBody()),i=e.fold((function(){return"."+ba()}),(function(t){return"["+ya()+'="'+t+'"]'})),u=Xe(r,n.startOffset).getOr(r),a=xr(u,i,(function(t){return Ne(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?x.some($n(t,e)):x.none()};return a.bind((function(e){return c(e,""+wa()).bind((function(n){return c(e,""+ya()).map((function(e){var r=Ca(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ca=function(t,e){var n=Te(t.getBody());return va(n,"["+wa()+'="'+e+'"]')},Sa=0,ka=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Sa+String(e)},Oa=function(t,e){var n,r,o=He(t).dom,i=Te(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ge(Te(r)));cn(i,u),sn(t),an(t,i)},Ta=function(t,e){return Te(t.dom.cloneNode(e))},_a=function(t){return Ta(t,!1)},Ea=function(t){return Ta(t,!0)},Aa=function(t,e,n){void 0===n&&(n=p);var r=new Ar(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Mn(e)&&!n(e));return x.from(e).filter(Mn)};return{current:function(){return x.from(r.current()).filter(Mn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Na=function(t,e){var n=e||function(e){return t.isBlock(e)||Pn(e)||Hn(e)},r=function(t,e,n,o){if(Mn(t)){var i=o(t,e,t.data);if(-1!==i)return x.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Aa(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Ra=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},Ma=Math.round,za=function(t){return t?{left:Ma(t.left),top:Ma(t.top),bottom:Ma(t.bottom),right:Ma(t.right),width:Ma(t.width),height:Ma(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Da=function(t,e){return t=za(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Ba=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Pa=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Ba(e.top-t.bottom,t,e)},Ia=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Ba(e.bottom-t.top,t,e)},La=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ha=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Fa=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},Va=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),ja=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Va.test(t)},Ua=kn,Wa=lo,qa=Tn("display","block table"),$a=Tn("float","left right"),Ga=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Ua,Wa,m($a)),Xa=m(Tn("white-space","pre pre-line pre-wrap")),Ka=Mn,Ya=Pn,Ja=Qu.nodeIndex,Qa=Fa,Za=function(t){return"createRange"in t?t.createRange():Qu.DOM.createRng()},tc=function(t){return t&&/[\r\n\t ]/.test(t)},ec=function(t){return!!t.setStart&&!!t.setEnd},nc=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(tc(t.toString())&&Xa(n.parentNode)&&Mn(n)&&(e=n.data,tc(e[r-1])||tc(e[r+1])))},rc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},oc=function(t){var e,n=t.getClientRects();return e=n.length>0?za(n[0]):za(t.getBoundingClientRect()),!ec(t)&&Ya(t)&&rc(e)?function(t){var e=t.ownerDocument,n=Za(e),r=e.createTextNode(Vr),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=za(n.getBoundingClientRect());return o.removeChild(r),i}(t):rc(e)&&ec(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Mn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),oc(i)}return null}(t):e},ic=function(t,e){var n=Da(t,e);return n.width=1,n.right=n.left+1,n};function uc(t,e,n){var r=function(){return n||(n=function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(r.length>0&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=Za(t.ownerDocument);if(e<t.data.length){if(ja(t.data[e]))return r;if(ja(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!nc(n)))return o(ic(oc(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),nc(n)||o(ic(oc(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),nc(n)||o(ic(oc(n),!0)))};if(Ka(t.container()))return i(t.container(),t.offset()),r;if(Ua(t.container()))if(t.isAtEnd())n=Qa(t.container(),t.offset()),Ka(n)&&i(n,n.data.length),Ga(n)&&!Ya(n)&&o(ic(oc(n),!1));else{if(n=Qa(t.container(),t.offset()),Ka(n)&&i(n,0),Ga(n)&&t.isAtEnd())return o(ic(oc(n),!1)),r;e=Qa(t.container(),t.offset()-1),Ga(e)&&!Ya(e)&&(qa(e)||qa(n)||!Ga(n))&&o(ic(oc(e),!1)),Ga(n)&&o(ic(oc(n),!0))}return r}(uc(t,e))),n};return{container:l(t),offset:l(e),toRange:function(){var n=Za(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Ka(t),0===e},isAtEnd:function(){return Ka(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return Qa(t,n?e-1:e)}}}!function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,Ja(e)+1)},t.before=function(e){return t(e.parentNode,Ja(e))},t.isAbove=function(t,e){return Ra(tt(e.getClientRects()),et(t.getClientRects()),Pa).getOr(!1)},t.isBelow=function(t,e){return Ra(et(e.getClientRects()),tt(t.getClientRects()),Ia).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&Mn(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}}(uc||(uc={}));var ac,cc=uc,sc=function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)},lc=function(t,e,n){Bn(n)?function(t,e,n){var r=x.from(n.firstChild),o=x.from(n.lastChild);e.insertNode(n),r.each((function(e){return sc(t,e.previousSibling)})),o.each((function(e){return sc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),sc(t,n.previousSibling),sc(t,n.nextSibling)}(t,e,n)},fc=Mn,dc=En,mc=Qu.nodeIndex,gc=function(t){var e=t.parentNode;return dc(e)?gc(e):e},hc=function(t){return t?wt(t.childNodes,(function(t,e){return dc(e)&&"BR"!==e.nodeName?t=t.concat(hc(e)):t.push(e),t}),[]):[]},pc=function(t){return function(e){return t===e}},vc=function(t){return(fc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=hc(gc(t)),n=xt(e,pc(t),t),e=e.slice(0,n+1);var r=wt(e,(function(t,n,r){return fc(n)&&fc(e[r-1])&&t++,t}),0);return e=bt(e,On([t.nodeName])),(n=xt(e,pc(t),t))-r}(t)+"]"},bc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),fc(n)?o=function(t,e){for(;(t=t.previousSibling)&&fc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(vc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode)r.push(e);return r}(t,n),u=bt(u,m(En)),(a=a.concat(vt(u,(function(t){return vc(t)})))).reverse().join("/")+","+o},yc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=wt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=hc(t);return r=bt(r,(function(t,e){return!fc(t)||!fc(r[e-1])})),(r=bt(r,On([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?fc(i)?function(t,e){for(var n,r=t,o=0;fc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!fc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return fc(t)&&e>t.data.length&&(e=t.data.length),cc(t,e)}(i,parseInt(n,10)):(n="after"===n?mc(i)+1:mc(i),cc(i.parentNode,n)):null},wc=Hn,xc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Mn(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Mn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Cc=function(t,e,n){var r=0;return xe.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Sc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],kn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},kc=function(t){return Sc(t,!0),Sc(t,!1),t},Oc=function(t,e){var n;if(kn(t)&&(t=Fa(t,e),wc(t)))return t;if(Kr(t)){if(Mn(t)&&Gr(t)&&(t=t.parentNode),n=t.previousSibling,wc(n))return n;if(n=t.nextSibling,wc(n))return n}},Tc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(wc(r)||"IMG"===o)return{name:o,index:Cc(n.dom,o,r)};var u=function(t){return Oc(t.startContainer,t.startOffset)||Oc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Cc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=xc(o,t,n,r,!0),e.isCollapsed()||(i.end=xc(o,t,n,r,!1)),i}(t,n,e,i)},_c=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},Ec=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Cc(n,a,u)};var c=kc(r.cloneRange());if(!i){c.collapse(!1);var s=_c(n,o+"_end",e);lc(n,c,s)}(r=kc(r)).collapse(!0);var l=_c(n,o+"_start",e);return lc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Ac=d(Tc,f,!0),Nc=Qu.DOM,Rc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},Mc=function(t){return t.getParam("content_security_policy","")},zc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Dc=function(t){return t.getParam("forced_root_block_attrs",{})},Bc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Pc=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Ic=function(t){return t.getParam("icons","","string")},Lc=function(t){return t.getParam("images_upload_url","","string")},Hc=function(t){return t.getParam("images_upload_base_path","","string")},Fc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Vc=function(t){return t.getParam("images_upload_handler",null,"function")},jc=function(t){return t.getParam("content_css_cors",!1,"boolean")},Uc=function(t){return t.getParam("referrer_policy","","string")},Wc=function(t){return t.getParam("language","en","string")},qc=function(t){return t.getParam("indent_use_margin",!1)},$c=function(t){var e=t.getParam("object_resizing");return!1!==e&&!pe.iOS&&(O(e)?e:"table,img,figure.image,div")},Gc=function(t){return t.getParam("event_root")},Xc=function(t){return t.getParam("theme")},Kc=function(t){return t.getParam("validate")},Yc=function(t){return!1!==t.getParam("inline_boundaries")},Jc=function(t){return t.getParam("content_css_cors")},Qc=function(t){return t.getParam("plugins","","string")},Zc=kn,ts=Mn,es=function(t){var e=t.parentNode;e&&e.removeChild(t)},ns=function(t){var e=Wr(t);return{count:t.length-e.length,text:e}},rs=function(t){for(var e;-1!==(e=t.data.lastIndexOf(jr));)t.deleteData(e,1)},os=function(t,e){return us(t),e},is=function(t,e){return cc.isTextPosition(e)?function(t,e){return ts(t)&&e.container()===t?function(t,e){var n=ns(t.data.substr(0,e.offset())),r=ns(t.data.substr(e.offset()));return(n.text+r.text).length>0?(rs(t),cc(t,e.offset()-n.count)):e}(t,e):os(t,e)}(t,e):function(t,e){return e.container()===t.parentNode?function(t,e){var n=e.container(),r=function(t,e){var n=L(t,e);return-1===n?x.none():x.some(n)}(nt(n.childNodes),t).map((function(t){return t<e.offset()?cc(n,e.offset()-1):e})).getOr(e);return us(t),r}(t,e):os(t,e)}(t,e)},us=function(t){Zc(t)&&Kr(t)&&(Yr(t)?t.removeAttribute("data-mce-caret"):es(t)),ts(t)&&(rs(t),0===t.data.length&&es(t))},as=ae().browser,cs=Hn,ss=Vn,ls=Fn,fs=function(t,e,n){var r,o,i,u,a,c=Da(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(a=t.getBoundingClientRect(),o=t.scrollLeft-a.left,i=t.scrollTop-a.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,(u=e.offsetWidth-e.clientWidth)>0&&(n&&(u*=-1),c.left+=u,c.right+=u),c},ds=function(t,e,n,r){var o,i,u=ra(x.none()),a=zc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=va(Te(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;to(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Zr(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(us(i),i=null),u.get().each((function(t){Wu(t.caret).remove(),u.set(x.none())})),o&&(Tr.clearInterval(o),o=null)};return{show:function(t,a){var l,f;if(s(),ls(a))return null;if(!n(a))return i=function(t,e){var n,r=t.ownerDocument.createTextNode(jr),o=t.parentNode;if(e){if(n=t.previousSibling,$r(n)){if(Kr(n))return n;if(to(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,$r(n)){if(Kr(n))return n;if(Zr(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(a,t),f=a.ownerDocument.createRange(),gs(i.nextSibling)?(f.setStart(i,0),f.setEnd(i,0)):(f.setStart(i,1),f.setEnd(i,1)),f;i=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o}(c,a,t),l=fs(e,a,t),Wu(i).css("top",l.top);var d=Wu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(e)[0];return u.set(x.some({caret:d,element:a,before:t})),u.get().each((function(e){t&&Wu(e.caret).addClass("mce-visual-caret-before")})),o=Tr.setInterval((function(){r()?Wu("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Wu("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500),(f=a.ownerDocument.createRange()).setStart(i,0),f.setEnd(i,0),f},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.get().each((function(t){var n=fs(e,t.element,t.before);Wu(t.caret).css(St({},n))}))},destroy:function(){return Tr.clearInterval(o)}}},ms=function(){return as.isIE()||as.isEdge()||as.isFirefox()},gs=function(t){return cs(t)||ss(t)},hs=function(t){return gs(t)||An(t)&&ms()},ps=Hn,vs=Vn,bs=Tn("display","block table table-cell table-caption list-item"),ys=Kr,ws=Gr,xs=kn,Cs=lo,Ss=function(t){return t>0},ks=function(t){return t<0},Os=function(t,e){for(var n;n=t(e);)if(!ws(n))return n;return null},Ts=function(t,e,n,r,o){var i=new Ar(t,r),u=ps(t)||ws(t);if(ks(e)){if(u&&n(t=Os(i.prev,!0)))return t;for(;t=Os(i.prev,o);)if(n(t))return t}if(Ss(e)){if(u&&n(t=Os(i.next,!0)))return t;for(;t=Os(i.next,o);)if(n(t))return t}return null},_s=function(t,e){for(;t&&t!==e;){if(bs(t))return t;t=t.parentNode}return null},Es=function(t,e,n){return _s(t.container(),n)===_s(e.container(),n)},As=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return xs(n)?n.childNodes[r+t]:null},Ns=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Rs=function(t,e,n){return _s(e,t)===_s(n,t)},Ms=function(t,e,n){var r,o;for(o=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[o],ys(r)&&(r=r[o]),ps(r)||vs(r)){if(Rs(e,r,n))return r;break}if(Cs(r))break;n=n.parentNode}return null},zs=d(Ns,!0),Ds=d(Ns,!1),Bs=function(t,e,n){var r,o,i,u=d(Ms,!0,e),a=d(Ms,!1,e);o=n.startContainer;var c=n.startOffset;if(Gr(o)){if(xs(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,hs(r)))return zs(r);if("after"===i&&(r=o.previousSibling,hs(r)))return Ds(r)}if(!n.collapsed)return n;if(Mn(o)){if(ys(o)){if(1===t){if(r=a(o))return zs(r);if(r=u(o))return Ds(r)}if(-1===t){if(r=u(o))return Ds(r);if(r=a(o))return zs(r)}return n}if(to(o)&&c>=o.data.length-1)return 1===t&&(r=a(o))?zs(r):n;if(Zr(o)&&c<=1)return-1===t&&(r=u(o))?Ds(r):n;if(c===o.data.length)return(r=a(o))?zs(r):n;if(0===c)return(r=u(o))?Ds(r):n}return n},Ps=function(t,e){return x.from(As(t?0:-1,e)).filter(ps)},Is=function(t,e,n){var r=Bs(t,e,n);return-1===t?uc.fromRangeStart(r):uc.fromRangeEnd(r)},Ls=function(t){return x.from(t.getNode()).map(Te)},Hs=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Fs=function(t,e){var n=Es(t,e);return!(n||!Pn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(ac||(ac={}));var Vs=Hn,js=Mn,Us=kn,Ws=Pn,qs=lo,$s=function(t){return ao(t)||function(t){return!!fo(t)&&!0!==$(nt(t.getElementsByTagName("*")),(function(t,e){return t||no(e)}),!1)}(t)},Gs=mo,Xs=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Ks=function(t,e){if(Ss(t)){if(qs(e.previousSibling)&&!js(e.previousSibling))return cc.before(e);if(js(e))return cc(e,0)}if(ks(t)){if(qs(e.nextSibling)&&!js(e.nextSibling))return cc.after(e);if(js(e))return cc(e,e.data.length)}return ks(t)?Ws(e)?cc.before(e):cc.after(e):cc.before(e)},Ys=function(t,e,n){var r,o,i,u;if(!Us(n)||!e)return null;if(e.isEqual(cc.after(n))&&n.lastChild){if(u=cc.after(n.lastChild),ks(t)&&qs(n.lastChild)&&Us(n.lastChild))return Ws(n.lastChild)?cc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(js(a)){if(ks(t)&&c>0)return cc(a,--c);if(Ss(t)&&c<a.length)return cc(a,++c);r=a}else{if(ks(t)&&c>0&&(o=Xs(a,c-1),qs(o)))return!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,i.data.length):cc.after(i):js(o)?cc(o,o.data.length):cc.before(o);if(Ss(t)&&c<a.childNodes.length&&(o=Xs(a,c),qs(o)))return Ws(o)?function(t,e){var n=e.nextSibling;return n&&qs(n)?js(n)?cc(n,0):cc.before(n):Ys(ac.Forwards,cc.after(e),t)}(n,o):!$s(o)&&(i=Ts(o,t,Gs,o))?js(i)?cc(i,0):cc.before(i):js(o)?cc(o,0):cc.after(o);r=o||u.getNode()}if((Ss(t)&&u.isAtEnd()||ks(t)&&u.isAtStart())&&(r=Ts(r,t,v,n,!0),Gs(r,n)))return Ks(t,r);o=Ts(r,t,Gs,n);var s=Ct(W(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),Vs));return!s||o&&s.contains(o)?o?Ks(t,o):null:u=Ss(t)?cc.after(s):cc.before(s)},Js=function(t){return{next:function(e){return Ys(ac.Forwards,e,t)},prev:function(e){return Ys(ac.Backwards,e,t)}}},Qs=function(t){return cc.isTextPosition(t)?0===t.offset():lo(t.getNode())},Zs=function(t){if(cc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return lo(t.getNode(!0))},tl=function(t,e){return!cc.isTextPosition(t)&&!cc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},el=function(t,e,n){var r=Js(e);return x.from(t?r.next(n):r.prev(n))},nl=function(t,e,n){return el(t,e,n).bind((function(r){return Es(n,r,e)&&function(t,e,n){return t?!tl(e,n)&&(r=e,!(!cc.isTextPosition(r)&&Pn(r.getNode())))&&Zs(e)&&Qs(n):!tl(n,e)&&Qs(e)&&Zs(n);var r}(t,n,r)?el(t,e,r):x.some(r)}))},rl=function(t,e,n,r){return nl(t,e,n).bind((function(n){return r(n)?rl(t,e,n,r):x.some(n)}))},ol=function(t,e){var n,r=t?e.firstChild:e.lastChild;return Mn(r)?x.some(cc(r,t?0:r.data.length)):r?lo(r)?x.some(t?cc.before(r):Pn(n=r)?cc.before(n):cc.after(n)):function(t,e,n){var r=t?cc.before(n):cc.after(n);return el(t,e,r)}(t,e,r):x.none()},il=d(el,!0),ul=d(el,!1),al=d(ol,!0),cl=d(ol,!1),sl="_mce_caret",ll=function(t){return kn(t)&&t.id===sl},fl=function(t,e){for(;e&&e!==t;){if(e.id===sl)return e;e=e.parentNode}return null},dl=function(t,e){return kn(e)&&t.isBlock(e)&&!e.innerHTML&&!pe.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},ml=function(t,e){return cl(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},gl=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!fl(t,e)||(function(t,e){var n=t.ownerDocument.createTextNode(jr);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),0))},hl=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,gl(s,i,r))return!0;if(c[o]>a.length-1)return!!gl(s,i,r)||ml(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},pl=function(t){return Mn(t)&&t.data.length>0},vl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.nextSibling)?(r=s.nextSibling,o=0):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):pl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,xe.each(xe.grep(s.childNodes),(function(t){Mn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&Mn(u)&&!pe.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return x.some(cc(a,c))}return x.none()},bl=function(t,e,n){return function(t,e,n){return 2===e?Tc(Wr,n,t):3===e?function(t){var e=t.getRng();return{start:bc(t.dom.getRoot(),cc.fromRangeStart(e)),end:bc(t.dom.getRoot(),cc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Ec(t,!1)}(t,e,n)},yl=function(t,e){(function(t,e){var n=t.dom;if(e){if(function(t){return xe.isArray(t.start)}(e))return function(t,e){var n=t.createRng();return hl(t,!0,e,n)&&hl(t,!1,e,n)?x.some(n):x.none()}(n,e);if(function(t){return"string"==typeof t.start}(e))return x.some(function(t,e){var n,r=t.createRng();return n=yc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=yc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return t.hasOwnProperty("id")}(e))return function(t,e){var n=vl(t,"start",e),r=vl(t,"end",e);return Ra(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(dl(t,e.container()),e.offset()),r.setEnd(dl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return t.hasOwnProperty("name")}(e))return function(t,e){return x.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return t.hasOwnProperty("rng")}(e))return x.some(e.rng)}return x.none()})(t,e).each((function(e){t.setRng(e)}))},wl=function(t){return kn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},xl=(Vr,function(t){return" "===t}),Cl=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Sl=function(t){return!Cl(t)&&!xl(t)},kl=function(t){return!!t.nodeType},Ol=function(t,e,n){var r,o,i,u=n.startOffset,a=n.startContainer;if((n.startContainer!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===a.nodeType)for(u<(i=a.childNodes).length?(a=i[u],r=new Ar(a,t.getParent(a,t.isBlock))):(a=i[i.length-1],(r=new Ar(a,t.getParent(a,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Al(o))return n.setStart(o,0),void e.setRng(n)},Tl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Al(t))return t}},_l=function(t,e){return kl(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},El=function(t,e,n){return t.schema.isValidChild(e,n)},Al=function(t,e){if(void 0===e&&(e=!1),M(t)&&Mn(t)){var n=e?t.data.replace(/ /g," "):t.data;return ho(n)}return!1},Nl=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Rl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Ml=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},zl=function(t,e,n){return Ml(t,t.getStyle(e,n),n)},Dl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Bl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Pl=function(t){return gt(t,"block")},Il=function(t){return gt(t,"selector")},Ll=function(t){return gt(t,"inline")},Hl=wl,Fl=Bl,Vl=Al,jl=_l,Ul=function(t,e){for(var n=e;n;){if(kn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Wl=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},ql=function(t,e,n){return Wl(t,e,n,(function(t){return xl(t)||Cl(t)}))},$l=function(t,e,n){return Wl(t,e,n,Sl)},Gl=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Na(t),c=o?i.backwards:i.forwards;return x.from(c(e,n,(function(t,e){return Hl(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,ql).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),$l):x.some(t)})).orThunk((function(){return u?x.some({container:u,offset:o?0:u.length}):x.none()}))},Xl=function(t,e,n,r,o){Mn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Fl(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!("collapsed"in c)||c.collapsed===n.collapsed)&&t.is(i[u],c.selector))return i[u]}return r},Kl=function(t,e,n,r){var o,i=t.dom,u=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,u)),!o){var a=i.getParent(n,"LI,TD,TH");o=i.getParent(Mn(n)?n.parentNode:n,(function(e){return e!==u&&jl(t,e)}),a)}if(o&&e[0].wrapper&&(o=Fl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Rl(o,"br")););return o||n},Yl=function(t,e,n,r){var o=n.parentNode;return!M(n[r])&&(!(o!==e&&!R(o)&&!t.isBlock(o))||Yl(t,e,o,r))},Jl=function(t,e,n,r,o){var i,u,a=n,c=o?"previousSibling":"nextSibling",s=t.getRoot();if(Mn(n)&&!Vl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(i=a[c];i;i=i[c]){var l=Mn(i)&&!Yl(t,s,i,c);if(!Hl(i)&&(!Pn(u=i)||!u.getAttribute("data-mce-bogus")||u.nextSibling)&&!Vl(i,l))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n},Ql=function(t){return Hl(t.parentNode)||Hl(t)},Zl=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom;return kn(o)&&o.hasChildNodes()&&(o=Fa(o,i),Mn(o)&&(i=0)),kn(u)&&u.hasChildNodes()&&(u=Fa(u,e.collapsed?a:a-1),Mn(u)&&(a=u.nodeValue.length)),o=Ul(c,o),u=Ul(c,u),Ql(o)&&(o=Hl(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Mn(o)&&(i=e.collapsed?o.length:0)),Ql(u)&&(u=Hl(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,Mn(u)&&(a=e.collapsed?0:u.length)),e.collapsed&&(Gl(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Gl(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n}))),(n[0].inline||n[0].block_expand)&&(n[0].inline&&Mn(o)&&0!==i||(o=Jl(c,n,o,i,!0)),n[0].inline&&Mn(u)&&a!==u.nodeValue.length||(u=Jl(c,n,u,a,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=Xl(c,n,e,o,"previousSibling"),u=Xl(c,n,e,u,"nextSibling")),(n[0].block||n[0].selector)&&(o=Kl(t,n,o,"previousSibling"),u=Kl(t,n,u,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=Jl(c,n,o,i,!0)),c.isBlock(u)||(u=Jl(c,n,u,a,!1)))),kn(o)&&(i=c.nodeIndex(o),o=o.parentNode),kn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},tf=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},ef=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,u=e.endOffset,a=function(t){var e;return 3===(e=t[0]).nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===u&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=tf(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=tf(i,u-1)),r===i)return n(a([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=s(r,f)||r,g=s(i,f)||i;l(r,m,!0);var h=c(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);h.length&&n(a(h)),l(i,g)},nf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},rf=function(t,e){var n=va(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:function(t){return W(function(t){return K(t,(function(t){var e=Ha(t);return e?[Te(e)]:[]}))}(t),Hr)}(t)},of=function(t){return rf(nf(t.selection.getSel()),Te(t.getBody()))},uf=function(t){return Ke(t).fold(l([t]),(function(e){return[t].concat(uf(e))}))},af=function(t){return Ye(t).fold(l([t]),(function(e){return"br"===Me(e)?Ue(e).map((function(e){return[t].concat(af(e))})).getOr([]):[t].concat(af(e))}))},cf=function(t,e){return Ra(function(t){var e=t.startContainer,n=t.startOffset;return Mn(e)?0===n?x.some(Te(e)):x.none():x.from(e.childNodes[n]).map(Te)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Mn(e)?n===e.data.length?x.some(Te(e)):x.none():x.from(e.childNodes[n-1]).map(Te)}(e),(function(e,n){var r=G(uf(t),d(Ne,e)),o=G(af(t),d(Ne,n));return r.isSome()&&o.isSome()})).getOr(!1)},sf=function(t,e,n,r){var o=n,i=new Ar(n,o),u=ft(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!H(["td","th","table"],e.toLowerCase())}));do{if(Mn(n)&&0!==xe.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},lf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},ff=function(t,e){var n=of(t);n.length>0?j(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},df=function(t,e,n){var r=Ec(t,e);n(r),t.moveToBookmark(r)},mf=function(t,e){var n=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}}(Pe),gf=function(t){return mf.get(t)},hf=function(t,e,n,r){var o=e.uid,i=void 0===o?ka("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=ke("span",t);ga(a,ba()),Wn(a,""+wa(),i),Wn(a,""+ya(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return qn(a,l),function(t,e){j(e,(function(e){ga(t,e)}))}(a,d),a},pf=function(t,e,n,r,o){var i=[],u=hf(t.getDoc(),o,n,r),a=ra(x.none()),c=function(){a.set(x.none())},s=function(t){j(t,l)},l=function(e){switch(function(t,e,n,r){return je(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Pe(t)&&gf(t)===jr}(e)?"valid":function(t){return Be(t)&&ha(t,ba())}(e)?"existing":ll(e.dom)?"caret":El(t,n,r)&&El(t,Me(o),n)?"valid":"invalid-child"}))}(t,e,"span",Me(e))){case"invalid-child":c();var n=Ge(e);s(n),c();break;case"valid":!function(t,e){rn(t,e),an(e,t)}(e,a.get().getOrThunk((function(){var t=_a(u);return i.push(t),a.set(x.some(t)),t})))}};return ef(t.dom,e,(function(t){c(),function(t){var e=V(t,Te);s(e)}(t)})),i},vf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?x.from(e[t]).map((function(t){return t.settings})):x.none()}});!function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){j(t,(function(t){(function(t){return x.from(t.attr(ya())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))}(t,n);var r=function(t,e){var n=ra({}),r=function(t,e){o(t,(function(t){return e(t),t}))},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:ra(x.none())});r[t]=o,n.set(r)},i=fa((function(){var e,i,u=n.get(),a=(e=rt(u),(i=B.call(e,0)).sort(void 0),i);j(a,(function(e){o(e,(function(n){var o=n.previous.get();return xa(t,x.some(e)).fold((function(){o.isSome()&&(function(t){r(t,(function(e){j(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.set(x.none()))}),(function(t){var e=t.uid,i=t.name,u=t.elements;o.is(e)||(function(t,e,n){r(t,(function(r){j(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:V(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(x.some(e)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()})),{addListener:function(t,e){o(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}}(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){!function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=of(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=Zl(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=hf(t.getDoc(),r,e,n.decorate);Oa(a,Vr),o.getRng().insertNode(a.dom),o.select(a.dom)}else df(o,!1,(function(){ff(t,(function(o){pf(t,o,e,n.decorate,r)}))}))}))}(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){xa(t,x.some(e)).each((function(t){var e=t.elements;j(e,fn)}))},getAll:function(e){var n=function(t,e){var n=Te(t.getBody()),r=va(n,"["+ya()+'="'+e+'"]'),o={};return j(r,(function(t){var e=$n(t,wa()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])})),o}(t,e);return ut(n,(function(t){return V(t,(function(t){return t.dom}))}))}}};function bf(t){return{getBookmark:d(bl,t),moveToBookmark:d(yl,t)}}!function(t){t.isBookmarkNode=wl}(bf||(bf={}));var yf=bf,wf=function(t,e){for(;e&&e!==t;){if(Ln(e)||Hn(e))return e;e=e.parentNode}return null},xf=function(t,e,n){if(n.collapsed)return!1;if(pe.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(kn(r))return F(r.getClientRects(),(function(n){return La(n,t,e)}))}return F(n.getClientRects(),(function(n){return La(n,t,e)}))},Cf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return pe.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Sf=Hn,kf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p=e.dom,v=xe.each,b=e.getDoc(),y=document,w=Math.abs,x=Math.round,C=e.getBody(),S={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},k=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},O=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return k(t.target)&&!xf(n.clientX,n.clientY,e)}return k(t.target)&&!xf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},T=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},_=function(t){var n=$c(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&Ee(Te(t),n)},E=function(t,e,n){p.setStyles(T(t),{width:e,height:n})},A=function(t){var v,b,y,S;v=t.screenX-u,b=t.screenY-a,d=v*i[2]+c,m=b*i[3]+s,d=d<5?5:d,m=m<5?5:m,(k(n)&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Cf.modifierPressed(t):Cf.modifierPressed(t))&&(w(v)>w(b)?(m=x(d*l),d=x(m/l)):(d=x(m/l),m=x(d*l))),E(r,d,m),y=(y=i.startPos.x+v)>0?y:0,S=(S=i.startPos.y+b)>0?S:0,p.setStyles(o,{left:y,top:S,display:"block"}),o.innerHTML=d+" × "+m,i[2]<0&&r.clientWidth<=d&&p.setStyle(r,"left",void 0+(c-d)),i[3]<0&&r.clientHeight<=m&&p.setStyle(r,"top",void 0+(s-m)),(v=C.scrollWidth-g)+(b=C.scrollHeight-h)!=0&&p.setStyles(o,{left:y-v,top:S-b}),f||(function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,c,s,"corner-"+i.name),f=!0)},N=function(){var t=f;f=!1;var u=function(t,r){r&&(n.style[t]||!e.schema.isValid(n.nodeName.toLowerCase(),t)?p.setStyle(T(n),t,r):p.setAttrib(T(n),t,""+r))};t&&(u("width",d),u("height",m)),p.unbind(b,"mousemove",A),p.unbind(b,"mouseup",N),y!==b&&(p.unbind(y,"mousemove",A),p.unbind(y,"mouseup",N)),p.remove(r),p.remove(o),R(n),t&&(function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,d,m,"corner-"+i.name),p.setAttrib(n,"style",p.getAttrib(n,"style"))),e.nodeChanged()},R=function(t){M(),B();var f=p.getPos(t,C),w=f.x,x=f.y,k=t.getBoundingClientRect(),O=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==t&&(n=t,d=m=0);var z=e.fire("ObjectSelected",{target:t});_(t)&&!z.isDefaultPrevented()?v(S,(function(t,e){var f;(f=p.get("mceResizeHandle"+e))&&p.remove(f),f=p.add(C,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===pe.ie&&(f.contentEditable=!1),p.bind(f,"mousedown",(function(f){f.stopImmediatePropagation(),f.preventDefault(),function(f){u=f.screenX,a=f.screenY,c=T(n).clientWidth,s=T(n).clientHeight,l=s/c,(i=t).name=e,i.startPos={x:O*t[0]+w,y:R*t[1]+x},g=C.scrollWidth,h=C.scrollHeight,r=n.cloneNode(!0),p.addClass(r,"mce-clonedresizable"),p.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,p.setStyles(r,{left:w,top:x,margin:0}),E(r,O,R),r.removeAttribute("data-mce-selected"),C.appendChild(r),p.bind(b,"mousemove",A),p.bind(b,"mouseup",N),y!==b&&(p.bind(y,"mousemove",A),p.bind(y,"mouseup",N)),o=p.add(C,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" × "+s)}(f)})),t.elm=f,p.setStyles(f,{left:O*t[0]+w-f.offsetWidth/2,top:R*t[1]+x-f.offsetHeight/2})})):M(),n.setAttribute("data-mce-selected","1")},M=function(){B(),n&&n.removeAttribute("data-mce-selected"),it(S,(function(t,e){var n=p.get("mceResizeHandle"+e);n&&(p.unbind(n),p.remove(n))}))},z=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};f||e.removed||(v(p.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=p.$(r).closest("table,img,figure.image,hr")[0],C)&&(P(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):M())},D=function(t){return Sf(wf(e.getBody(),t))},B=function(){it(S,(function(t){t.elm&&(p.unbind(t.elm),delete t.elm)}))},P=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};return e.on("init",(function(){if(P(),pe.browser.isIE()||pe.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;f||!/^(TABLE|IMG|HR)$/.test(r)||D(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Tr.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(D(t.target)||Vn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};p.bind(C,"mscontrolselect",t),e.on("remove",(function(){return p.unbind(C,"mscontrolselect",t)}))}var r=Tr.throttle((function(t){e.composing||z(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",M),e.on("contextmenu longpress",O,!0)})),e.on("remove",B),{isResizable:_,showResizeRect:R,hideResizeRect:M,updateResizeRect:z,destroy:function(){n=r=null}}},Of=function(t){return Ln(t)||Hn(t)},Tf=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=xe.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Hn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Of))?null:t}(r,n.body)}return r},_f=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Ef=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Af=function(t,e,n){return Ef(t,e,(function(t){return t.nodeName===n}))},Nf=function(t){return t&&"TABLE"===t.nodeName},Rf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Mf=function(t,e){return Kr(t)&&!1===Ef(t,e,ll)},zf=function(t,e,n){for(var r=new Ar(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Pn(e))return!0},Df=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Pn(o)&&e&&t.isEmpty(s))return x.some(uc(o.parentNode,t.nodeIndex(o)));for(var l=new Ar(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Mf(u,a))return x.none();if(Mn(u)&&u.nodeValue.length>0)return!1===Af(u,a,"A")?x.some(uc(u,r?u.nodeValue.length:0)):x.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return x.none();i=u}return n&&i?x.some(uc(i,0)):x.none()},Bf=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=kn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,Kr(o))return x.none();if(kn(o)&&i>o.childNodes.length-1&&(a=!1),Dn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(Kr(u))return x.none();if(f[u.nodeName]||Nf(u))return x.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Mn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Nf(o))return x.none();if(function(t,e){for(;e&&e!==t;){if(Hn(e))return!0;e=e.parentNode}return!1}(c,o)||Kr(o))return x.none();if(o.hasChildNodes()&&!1===Nf(o)){u=o;var d=new Ar(o,c);do{if(Hn(u)||Kr(u)){s=!1;break}if(Mn(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Rf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(Mn(o)&&0===i&&Df(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),kn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Pn(u)||function(t,e){return t.previousSibling&&"A"===t.previousSibling.nodeName}(u)||zf(t,u,!1)||zf(t,u,!0)||Df(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&Mn(o)&&i===o.nodeValue.length&&Df(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?x.some(uc(o,i)):x.none()},Pf=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=uc.fromRangeStart(e);return Bf(t,n,!0,r).each((function(t){n&&uc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Bf(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),_f(e,r)?x.none():x.some(r)},If=function(t,e){return t.splitText(e)},Lf=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Mn(e)?n>0&&n<e.nodeValue.length&&(e=(r=If(e,n)).previousSibling,o>n?(e=r=If(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Mn(e)&&n>0&&n<e.nodeValue.length&&(e=If(e,n),n=0),Mn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=If(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}};function Hf(t){return{walk:function(e,n){return ef(t,e,n)},split:Lf,normalize:function(e){return Pf(t,e).fold(p,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}!function(t){t.compareRanges=_f,t.getCaretRangeFromPoint=Tf,t.getSelectedNode=Ha,t.getNode=Fa}(Hf||(Hf={}));var Ff,Vf=Hf,jf=function(t,e){var n=function(e){var n=function(t){var e=t.dom;return dn(t)?e.getBoundingClientRect().height:e.offsetHeight}(e);if(n<=0||null===n){var r=Kn(e,t);return parseFloat(r)||0}return n},r=function(t,e){return $(e,(function(e,n){var r=Kn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!D(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;jn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height"),Uf=function(t,e){return t.view(e).fold(l([]),(function(e){var n=t.owner(e),r=Uf(t,n);return[e].concat(r)}))},Wf=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Te)},owner:function(t){return Fe(t)}}),qf=function(t){return"textarea"===Me(t)},$f=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return gn(n.offsetLeft,n.offsetTop);var i=hn(null==r?void 0:r.pageYOffset,o.scrollTop),u=hn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=hn(o.clientTop,n.clientTop),c=hn(o.clientLeft,n.clientLeft);return pn(t).translate(u-c,i-a)}(t),r=function(t){return jf.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Gf=function(t,e,n,r){Jf(t,(function(o,i){return Kf(t,e,n,r)}),n)},Xf=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,vn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Kf=function(t,e,n,r){var o=Te(t.getBody()),i=Te(t.getDoc());o.dom.offsetWidth;var u,a,c,s,l=(u=Te(n.startContainer),a=n.startOffset,c=function(t,e){var n=Ge(t);if(0===n.length||qf(t))return{element:t,offset:e};if(e<n.length&&!qf(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return qf(r)?{element:t,offset:e}:"img"===Me(r)?{element:r,offset:1}:Pe(r)?{element:r,offset:gf(r).length}:{element:r,offset:Ge(r).length}}(u,a),s=Se('<span data-mce-bogus="all">\ufeff</span>'),rn(c.element,s),$f(s,(function(){return ln(s)})));Xf(t,i,e,l,r),l.cleanup()},Yf=function(t,e,n,r){var o=Te(t.getDoc());Xf(t,o,n,function(t){return $f(Te(t),c)}(e),r)},Jf=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(Te(r),Te(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Qf=function(t,e,n,r){var o=t.pos;if(n)bn(o.left,o.top,r);else{var i=o.top-e+t.height;bn(o.left,i,r)}},Zf=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;u<e?Qf(r,n,!1!==o,t):u>i?Qf(r,n,c?!1!==o:!0===o,t):a>i&&!c&&Qf(r,n,!0===o,t)},td=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r)},ed=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Zf(t,e,o,n,r);var i=function(t){var e=Te(document),n=vn(e),r=function(t,e){var n=e.owner(t);return Uf(e,n)}(t,Wf),o=pn(t),i=q(r,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return gn(i.left+o.left+n.left,i.top+o.top+n.top)}(n.element),u=xn(window);i.top<u.y?yn(n.element,!1!==r):i.top>u.bottom&&yn(n.element,!0===r)},nd=function(t,e,n){return Gf(t,td,e,n)},rd=function(t,e,n){return Yf(t,e,td,n)},od=function(t,e,n){return Gf(t,ed,e,n)},id=function(t,e,n){return Yf(t,e,ed,n)},ud=function(t,e,n){(t.inline?nd:od)(t,e,n)},ad=function(t){var e=tn(t).dom;return t.dom===e.activeElement},cd=function(t){return void 0===t&&(t=Te(document)),x.from(t.dom.activeElement).map(Te)},sd=mr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ld=(sd.before,sd.on,sd.after,mr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),fd=(ld.domRange,ld.relative,ld.exact,function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}}),dd=ae().browser,md=function(t,e){var n=Pe(e)?gf(e).length:Ge(e).length+1;return t>n?n:t<0?0:t},gd=function(t){return fd(t.start,md(t.soffset,t.start),t.finish,md(t.foffset,t.finish))},hd=function(t,e){return!Sn(e.dom)&&(Re(t,e)||Ne(t,e))},pd=function(t){return function(e){return hd(t,e.start)&&hd(t,e.finish)}},vd=function(t){return!0===t.inline||dd.isIE()},bd=function(t){return fd(Te(t.startContainer),t.startOffset,Te(t.endContainer),t.endOffset)},yd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),x.some(e)}catch(t){return x.none()}},wd=function(t){var e,n,r,o=vd(t)?(e=Te(t.getBody()),(n=Ve(e).dom,r=n.getSelection(),(r&&0!==r.rangeCount?x.from(r.getRangeAt(0)):x.none()).map(bd)).filter(pd(e))):x.none();t.bookmark=o.isSome()?o:t.bookmark},xd=function(t){return(t.bookmark?t.bookmark:x.none()).bind((function(e){return n=Te(t.getBody()),r=e,x.from(r).filter(pd(n)).map(gd);var n,r})).bind(yd)},Cd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Sd=function(t){var e=la((function(){wd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};Qu.DOM.bind(document,"mouseup",n),t.on("remove",(function(){Qu.DOM.unbind(document,"mouseup",n)}))}(t,e),function(t,e){ae().browser.isIE()?function(t){t.on("focusout",(function(){wd(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||wd(t)}))}(t,e)})),t.on("remove",(function(){e.cancel()}))},kd=Qu.DOM,Od=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==kd.getParent(e,(function(e){return function(t){return Cd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},Td=function(t,e){var n=e.editor;Sd(n),n.on("focusin",(function(){var e=this,n=t.focusedEditor;n!==e&&(n&&n.fire("blur",{focusedEditor:e}),t.setActive(e),t.focusedEditor=e,e.fire("focus",{blurredEditor:n}),e.focus(!0))})),n.on("focusout",(function(){var e=this;Tr.setEditorTimeout(e,(function(){var n=t.focusedEditor;Od(e,function(t){try{var e=tn(Te(t.getElement()));return cd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(e))||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ff||(Ff=function(e){var n=t.activeEditor;n&&function(t){if(Ze()&&M(t.target)){var e=Te(t.target);if(Be(e)&&M(e.dom.shadowRoot)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return tt(n)}}return x.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Od(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},kd.bind(document,"focusin",Ff))},_d=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(kd.unbind(document,"focusin",Ff),Ff=null)},Ed=function(t,e){(function(t,e){return function(t){return t.collapsed?x.from(Fa(t.startContainer,t.startOffset)).map(Te):x.none()}(e).bind((function(e){return Lr(e)?x.some(e):!1===Re(t,e)?x.some(t):x.none()}))})(Te(t.getBody()),e).bind((function(t){return al(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},Ad=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},Nd=function(t){return t.inline?function(t){var e,n,r=t.getBody();return r&&(e=Te(r),ad(e)||(n=e,cd(tn(n)).filter((function(t){return n.dom.contains(t.dom)}))).isSome())}(t):function(t){return t.iframeElement&&ad(Te(t.iframeElement))}(t)},Rd=function(t){return t.editorManager.setActive(t)},Md=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return x.from(i).map(Te).map((function(t){return r&&e.collapsed?t:Xe(t,o(t,u)).getOr(t)})).bind((function(t){return Be(t)?x.some(t):je(t).filter(Be)})).map((function(t){return t.dom})).getOr(t)},zd=function(t,e,n){return Md(t,e,!0,n,(function(t,e){return Math.min(t.dom.childNodes.length,e)}))},Dd=function(t,e,n){return Md(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Bd=function(t,e){for(var n=t;t&&Mn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Pd=function(t,e){return V(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Id=function(t){return z(t)?t:p},Ld=function(t,e,n){var r=e(t),o=Id(n);return r.orThunk((function(){return o(t)?x.none():function(t,e,n){for(var r=t.dom,o=Id(n);r.parentNode;){r=r.parentNode;var i=Te(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()}(t,e,o)}))},Hd=Rl,Fd=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},Vd=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!Fd(t,e,n)||e.parentNode===o||!!Wd(t,e,n,r,!0)})),Wd(t,e,n,r))},jd=function(t,e,n){return!!Hd(e,n.inline)||!!Hd(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},Ud=function(t,e,n,r,o,i){var u,a,c,s=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(s)if(void 0===s.length){for(u in s)if(s.hasOwnProperty(u)){if(a="attributes"===r?t.getAttrib(e,u):zl(t,e,u),o&&!a&&!n.exact)return;if((!o||n.exact)&&!Hd(a,Ml(t,Nl(s[u],i),u)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?t.getAttrib(e,s[c]):zl(t,e,s[c]))return n;return n},Wd=function(t,e,n,r,o){var i,u,a,c,s=t.formatter.get(n),l=t.dom;if(s&&e)for(u=0;u<s.length;u++)if(i=s[u],jd(t.dom,e,i)&&Ud(l,e,i,"attributes",o,r)&&Ud(l,e,i,"styles",o,r)){if(c=i.classes)for(a=0;a<c.length;a++)if(!t.dom.hasClass(e,c[a]))return;return i}},qd=function(t,e,n,r){if(r)return Vd(t,r,e,n);if(r=t.selection.getNode(),Vd(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!Vd(t,o,e,n))},$d=function(t,e,n){return $(n,(function(n,r){var o=function(t,e){return F(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return F(["styles","attributes"],(function(n){return dt(t,n).exists((function(t){var n=_(t)?t:function(t,e){var n=[];return it(t,(function(t,e){n.push(t)})),n}(t);return F(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Gd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xd=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},Kd=function(t){if(!ho(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Yd=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Jd=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Gd[e]||1);return n&&it(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&it(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Xd(n,this))n.name===t&&e.push(n);return e},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Xd(n,t))e.push(n);for(var r=e.length;r--;)(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Yd(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Yd(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Kd(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&ho(o.value))return!1;if(n&&n(o))return!1}while(o=Xd(o,r));return!0},t.prototype.walk=function(t){return Xd(this,null,t)},t}(),Qd=xe.makeMap,Zd=function(t){var e=[],n=(t=t||{}).indent,r=Qd(t.indent_before||""),o=Qd(t.indent_after||""),i=Io.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tm=function(t,e){void 0===e&&(e=Go());var n=Zd(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r,a,c,s,l,f,d,m,g,h=i[t.type];if(h)h(t);else{if(r=t.name,a=t.shortEnded,c=t.attributes,o&&c&&c.length>1&&((f=[]).map={},g=e.getElementRule(t.name))){for(d=0,m=g.attributesOrder.length;d<m;d++)(s=g.attributesOrder[d])in c.map&&(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));for(d=0,m=c.length;d<m;d++)(s=c[d].name)in f.map||(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));c=f}if(n.start(t.name,c,a),!a){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},em=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return dt(e.uris,t).getOr(t)}))},nm=["img","video"],rm=function(t,e,n){var r,o,i=1,u=t.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(a.lastIndex=r=n;o=a.exec(e);){if(r=a.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in u)continue;i++}if(0===i)break}return r},om=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function im(t,e){void 0===e&&(e=Go());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,u=t.start?t.start:n,a=t.end?t.end:n,c=t.pi?t.pi:n,s=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");for(var f,d,m,g,h,p,v,b,y,w,x,C,S,k,O,T,_,E,A,N=n.html,M=0,z=[],D=0,B=Io.decode,P=xe.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L="html"===l?0:1,F=function(t){var e,n;for(e=z.length;e--&&z[e].name!==t;);if(e>=0){for(n=z.length-1;n>=e;n--)(t=z[n]).valid&&a(t.name);z.length=e}},V=function(t,e){return i(em(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(em(e,n)))},U=function(t,e){var n=t||"",r=!Rt(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length}(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},W=function(e,r,o,i,u){var a,c;if(o=function(t){return dt(n.uris,t).getOr(t)}((r=r.toLowerCase())in K?r:B(o||i||u||"")),Y&&!b&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(r)){if(!(a=k[r])&&O){for(c=O.length;c--&&!(a=O[c]).pattern.test(r););-1===c&&(a=null)}if(!a)return;if(a.validValues&&!(o in a.validValues))return}if(P[r]&&!t.allow_script_urls){var s=o.replace(/[\s\u0000-\u001F]+/g,"");try{s=decodeURIComponent(s)}catch(t){s=unescape(s)}if(I.test(s))return;if(function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return!(R(t)?H(nm,e):t)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))}(t,s,e))return}b&&(r in P||0===r.indexOf("on"))||(g.map[r]=o,g.push({name:r,value:o}))},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),X=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=N+">";f=q.exec(tt);){var et=f[0];if(M<f.index&&V(B(N.substr(M,f.index-M))),d=f[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=f[8]){if(f.index+et.length>N.length){V(B(N.substr(f.index))),M=f.index+et.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in G,Q&&X[d]&&z.length>0&&z[z.length-1].name===d&&F(d);var nt=om($,f[9]);if(null!==nt){if("all"===nt){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}if(!Y||(w=e.getElementRule(d))){if(x=!0,Y&&(k=w.attributes,O=w.attributePatterns),(S=f[9])?((b=-1!==S.indexOf("data-mce-type"))&&J&&(x=!1),(g=[]).map={},S.replace($,(function(t,e,n,r,o){return W(d,e,n,r,o),""}))):(g=[]).map={},Y&&!b){if(T=w.attributesRequired,_=w.attributesDefault,E=w.attributesForced,w.removeEmptyAttrs&&!g.length&&(x=!1),E)for(h=E.length;h--;)v=(C=E[h]).name,"{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A});if(_)for(h=_.length;h--;)(v=(C=_[h]).name)in g.map||("{$uid}"===(A=C.value)&&(A="mce_"+D++),g.map[v]=A,g.push({name:v,value:A}));if(T){for(h=T.length;h--&&!(T[h]in g.map););-1===h&&(x=!1)}if(C=g.map["data-mce-bogus"]){if("all"===C){M=rm(e,N,q.lastIndex),q.lastIndex=M;continue}x=!1}}x&&u(d,g,y)}else x=!1;if(m=Z[d]){m.lastIndex=M=f.index+et.length,(f=m.exec(N))?(x&&(p=N.substr(M,f.index-M)),M=f.index+f[0].length):(p=N.substr(M),M=N.length),x&&(p.length>0&&V(p,!0),a(d)),q.lastIndex=M;continue}y||(S&&S.indexOf("/")===S.length-1?x&&a(d):z.push({name:d,valid:x}))}else if(d=f[1])j(d);else if(d=f[2]){if(!(1===L||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){M=U("",f.index+2),q.lastIndex=M;continue}o(d)}else if(d=f[3])s(d);else{if((d=f[4])||"<!"===et){M=U(d,f.index+et.length),q.lastIndex=M;continue}if(d=f[5]){if(1!==L){M=U("?",f.index+2),q.lastIndex=M;continue}c(d,f[6])}}M=f.index+et.length}for(M<N.length&&V(B(N.substr(M))),h=z.length-1;h>=0;h--)(d=z[h]).valid&&a(d.name)};return{parse:function(t,e){void 0===e&&(e="html"),l(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=ka("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}return 0===u?{prefix:i,uris:o,html:t}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join("")})}(t),e)}}}!function(t){t.findEndTag=rm}(im||(im={}));var um=im,am=function(t,e){var n,r,o,i,u=e,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=t.schema;u=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),u);for(var s=c.getShortEndedElements();i=a.exec(u);)r=a.lastIndex,o=i[0].length,n=s[i[1]]?r:um.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),a.lastIndex=r-o;return Wr(u)},cm=am,sm=xe.each,lm=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return sm(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||wl(e)||wl(n))}},fm=function(t,e,n){return x.from(n.container()).filter(Mn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},dm=d(fm,!0,Cl),mm=d(fm,!1,Cl),gm=function(t){var e=t.container();return Mn(e)&&(0===e.data.length||Ur(e.data)&&yf.isBookmarkNode(e.parentNode))},hm=function(t,e){return function(n){return x.from(As(t?0:-1,n)).filter(e).isSome()}},pm=function(t){return In(t)&&"block"===Kn(Te(t),"display")},vm=function(t){return Hn(t)&&!function(t){return kn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},bm=hm(!0,pm),ym=hm(!1,pm),wm=hm(!0,Vn),xm=hm(!1,Vn),Cm=hm(!0,An),Sm=hm(!1,An),km=hm(!0,vm),Om=hm(!1,vm),Tm=function(t){sn(t),an(t,Se('<br data-mce-bogus="1">'))},_m=function(t){Ye(t).each((function(e){Ue(e).each((function(n){Mr(t)&&Dr(e)&&Mr(n)&&ln(e)}))}))},Em=function(t,e){return function(t,e,n){return Re(e,t)?function(t,e){for(var n=z(e)?e:p,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Te(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Ne(t,e)})).slice(0,-1):[]}(t,e,p)},Am=function(t,e){return[t].concat(Em(t,e))},Nm=function(t,e,n){return rl(t,e,n,gm)},Rm=function(t,e){return G(Am(Te(e.container()),t),Mr)},Mm=function(t,e,n){return Nm(t,e.dom,n).forall((function(t){return Rm(e,n).fold((function(){return!1===Es(t,n,e.dom)}),(function(r){return!1===Es(t,n,e.dom)&&Re(r,Te(t.container()))}))}))},zm=function(t,e,n){return Rm(e,n).fold((function(){return Nm(t,e.dom,n).forall((function(t){return!1===Es(t,n,e.dom)}))}),(function(e){return Nm(t,e.dom,n).isNone()}))},Dm=d(zm,!1),Bm=d(zm,!0),Pm=d(Mm,!1),Im=d(Mm,!0),Lm=function(t){return Ls(t).exists(Dr)},Hm=function(t,e,n){var r=W(Am(Te(n.container()),e),Mr),o=tt(r).getOr(e);return el(t,o.dom,n).filter(Lm)},Fm=function(t,e){return Ls(e).exists(Dr)||Hm(!0,t,e).isSome()},Vm=function(t,e){return function(t){return x.from(t.getNode(!0)).map(Te)}(e).exists(Dr)||Hm(!1,t,e).isSome()},jm=d(Hm,!1),Um=d(Hm,!0),Wm=function(t){return uc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},qm=function(t,e){var n=W(Am(Te(e.container()),t),Mr);return tt(n).getOr(t)},$m=function(t,e){return Wm(e)?mm(e):mm(e)||ul(qm(t,e).dom,e).exists(mm)},Gm=function(t,e){return Wm(e)?dm(e):dm(e)||il(qm(t,e).dom,e).exists(dm)},Xm=function(t){return Ls(t).bind((function(t){return br(t,Be)})).exists((function(t){return function(t){return H(["pre","pre-wrap"],t)}(Kn(t,"white-space"))}))},Km=function(t,e){return!Xm(e)&&(Dm(t,e)||Pm(t,e)||Vm(t,e)||$m(t,e))},Ym=function(t,e){return!Xm(e)&&(Bm(t,e)||Im(t,e)||Fm(t,e)||Gm(t,e))},Jm=function(t,e){return Km(t,e)||Ym(t,function(t){var e=t.container(),n=t.offset();return Mn(e)&&n<e.data.length?uc(e,n+1):t}(e))},Qm=function(t,e){return xl(t.charAt(e))},Zm=function(t){var e=t.container();return Mn(e)&&Nt(e.data,Vr)},tg=function(t,e){return x.some(e).filter(Zm).bind((function(e){var n,r,o,i=e.container();return function(t,e){var n=e.data,r=uc(e,0);return!(!Qm(n,0)||Jm(t,r)||(e.data=" "+n.slice(1),0))}(t,i)||(r=(n=i).data,(o=function(t){var e=t.split("");return V(e,(function(t,n){return xl(t)&&n>0&&n<e.length-1&&Sl(e[n-1])&&Sl(e[n+1])?" ":t})).join("")}(r))!==r&&(n.data=o,1))||function(t,e){var n=e.data,r=uc(e,n.length-1);return!(!Qm(n,n.length-1)||Jm(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,i)?x.some(e):x.none()}))},eg=function(t){var e=Te(t.getBody());t.selection.isCollapsed()&&tg(e,uc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},ng=function(t,e,n){if(0!==n){var r=Te(t),o=vr(r,Mr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Ym(o,cc(t,t.data.length)),a=0===e&&Km(o,cc(t,0));t.replaceData(e,n,function(t,e,n){return $(t,(function(r,o){return Cl(o)||xl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+Vr}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},rg=function(t,e){var n=t.data.slice(e),r=n.length-Dt(n).length;return ng(t,e,r)},og=function(t,e){var n=t.data.slice(0,e),r=n.length-Bt(n).length;return ng(t,e-r,r)},ig=function(t,e,n,r){void 0===r&&(r=!0);var o=Bt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),ln(Te(u)),n&&rg(i,o),i},ug=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===cc.isTextPosition(t)&&n===e.parentNode&&r>cc.before(e).offset()}(e,t)?cc(e.container(),e.offset()-1):e},ag=function(t){return lo(t.previousSibling)?x.some((e=t.previousSibling,Mn(e)?cc(e,e.data.length):cc.after(e))):t.previousSibling?cl(t.previousSibling):x.none();var e},cg=function(t){return lo(t.nextSibling)?x.some((e=t.nextSibling,Mn(e)?cc(e,0):cc.before(e))):t.nextSibling?al(t.nextSibling):x.none();var e},sg=function(t,e,n){return function(t,e,n){return t?function(t,e){return cg(e).orThunk((function(){return ag(e)})).orThunk((function(){return function(t,e){return il(t,cc.after(e)).fold((function(){return ul(t,cc.before(e))}),x.some)}(t,e)}))}(e,n):function(t,e){return ag(e).orThunk((function(){return cg(e)})).orThunk((function(){return function(t,e){var n=cc.before(e.previousSibling?e.previousSibling:e.parentNode);return ul(t,n).fold((function(){return il(t,cc.after(e))}),x.some)}(t,e)}))}(e,n)}(t,e,n).map(d(ug,n))},lg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},fg=function(t,e){return e&&mt(t.schema.getBlockElements(),Me(e))},dg=function(t){if(wo(t)){var e=Se('<br data-mce-bogus="1">');return sn(t),an(t,e),x.some(cc.before(e.dom))}return x.none()},mg=function(t,e,n,r){void 0===r&&(r=!0);var o,i=sg(e,t.getBody(),n.dom),u=vr(n,d(fg,t),(o=t.getBody(),function(t){return t.dom===o})),a=function(t,e,n){var r,o,i,u,a=Ue(t).filter(Pe),c=We(t).filter(Pe);return ln(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return ig(o,i,n),r.container()===i?cc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?x.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):x.none()).orThunk((function(){return n&&(a.each((function(t){return og(t.dom,t.dom.length)})),c.each((function(t){return rg(t.dom,0)}))),e}))}(n,i,function(t,e){return mt(t.schema.getTextInlineElements(),Me(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(dg).fold((function(){r&&lg(t,e,a)}),(function(n){r&&lg(t,e,x.some(n))}))},gg=function(t,e){return{start:t,end:e}},hg=mr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),pg=function(t,e){return xr(Te(t),"td,th",e)},vg=function(t,e){return yr(t,"table",e)},bg=function(t){return!Ne(t.start,t.end)},yg=function(t,e){return vg(t.start,e).bind((function(n){return vg(t.end,e).bind((function(t){return e=Ne(n,t),r=n,e?x.some(r):x.none();var e,r}))}))},wg=function(t){return va(t,"td,th")},xg=function(t,e){return yg(e,t).isSome()},Cg=function(t,e,n){return t.filter((function(t){return bg(t)&&xg(n,t)})).orThunk((function(){return function(t,e){var n=pg(e.startContainer,t),r=pg(e.endContainer,t);return e.collapsed?x.none():Ra(n,r,gg).fold((function(){return n.fold((function(){return r.bind((function(e){return vg(e,t).bind((function(t){return tt(wg(t)).map((function(t){return gg(t,e)}))}))}))}),(function(e){return vg(e,t).bind((function(t){return et(wg(t)).map((function(t){return gg(e,t)}))}))}))}),(function(e){return xg(t,e)?x.none():function(t,e){return vg(t.start,e).bind((function(e){return et(wg(e)).map((function(e){return gg(t.start,e)}))}))}(e,t)}))}(n,e)})).bind((function(t){return function(t,e){return yg(t,e).map((function(e){return function(t,e,n){return{rng:t,table:e,cells:n}}(t,e,wg(e))}))}(t,n)}))},Sg=function(t,e){return X(t,(function(t){return Ne(t,e)}))},kg=function(t){return function(t){return Ra(Sg(t.cells,t.rng.start),Sg(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))}(t).map((function(e){var n=t.cells;return e.length===n.length?hg.removeTable(t.table):hg.emptyCells(e)}))},Og=function(t,e){var n=function(t){return function(e){return Ne(t,e)}}(t),r=function(t,e){var n=pg(t.startContainer,e),r=pg(t.endContainer,e);return Ra(n,r,gg)}(e,n);return function(t,e,n){return t.filter((function(t){return function(t,e){return!bg(t)&&yg(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&cf(t.start,e)})).map((function(t){return t.start}))}(r,e,n).map((function(t){return hg.deleteCellSelection(e,t)})).orThunk((function(){return Cg(r,e,n).bind(kg)}))},Tg=function(t){var e;return(8===ze(e=t)||"#comment"===Me(e)?Ue(t):Ye(t)).bind(Tg).orThunk((function(){return x.some(t)}))},_g=function(t,e){return j(e,Tm),t.selection.setCursorLocation(e[0].dom,0),!0},Eg=function(t,e,n){e.deleteContents();var r,o=Tg(n).getOr(n),i=Te(t.dom.getParent(o.dom,t.dom.isBlock));if(wo(i)&&(Tm(i),t.selection.setCursorLocation(i.dom,0)),!Ne(n,i)){var u=je(i).is(n)?[]:je(r=i).map(Ge).map((function(t){return W(t,(function(t){return!Ne(r,t)}))})).getOr([]);j(u.concat(Ge(n)),(function(t){Ne(t,i)||Re(t,i)||ln(t)}))}return!0},Ag=function(t,e){return mg(t,!1,e),!0},Ng=function(t,e){return G(Am(e,t),Hr)},Rg=function(t,e){return G(Am(e,t),(function(t){return"caption"===Me(t)}))},Mg=function(t,e){return Tm(e),t.selection.setCursorLocation(e.dom,0),x.some(!0)},zg=function(t,e){return t?Cm(e):Sm(e)},Dg=function(t,e,n){var r=Te(t.getBody());return Rg(r,n).fold((function(){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return Ng(n,r).bind((function(r){return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(t){return Ng(e,Te(t.getNode())).map((function(t){return!1===Ne(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)}(t,e,r,n)||function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return zg(e,n)||el(e,t.getBody(),n).exists((function(t){return zg(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=cc.fromRangeStart(t.selection.getRng());return wo(r)?Mg(t,r):function(t,e,n,r,o){return nl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return al(t.dom).bind((function(o){return cl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Mg(t,e)}(t,r):function(t,e,n){return Rg(t,Te(n.getNode())).map((function(t){return!1===Ne(t,e)}))}(e,r,i)})).or(x.some(!0))}(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Bg=function(t,e){var n=Te(t.selection.getStart(!0)),r=of(t);return t.selection.isCollapsed()&&0===r.length?Dg(t,e,n):function(t,e){var n=Te(t.getBody()),r=t.selection.getRng(),o=of(t);return 0!==o.length?_g(t,o):function(t,e,n,r){return Rg(e,r).fold((function(){return function(t,e,n){return Og(e,n).map((function(e){return e.fold(d(Ag,t),d(_g,t),d(Eg,t))}))}(t,e,n)}),(function(e){return function(t,e){return Mg(t,e)}(t,e)})).getOr(!1)}(t,n,r,e)}(t,n)},Pg=function(t){return t.collapsed?t:function(t){var e=cc.fromRangeStart(t),n=cc.fromRangeEnd(t),r=t.commonAncestorContainer;return el(!1,r,n).map((function(o){return!Es(e,n,r)&&Es(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)}(t)},Ig=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===Vr}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Lg=function(t){return t.length>0&&(!(n=t[t.length-1]).firstChild||(e=n)&&e.firstChild&&e.firstChild===e.lastChild&&function(t){return t.data===Vr||Pn(t)}(e.firstChild))?t.slice(0,-1):t;var e,n},Hg=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Fg=function(t,e){var n=cc.after(t),r=Js(e).prev(n);return r?r.toRange():null},Vg=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Hg(e,n.startContainer),a=Lg((o=i.firstChild,xe.grep(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=cc.fromRangeStart(n),o=Js(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Hg(e,i.getNode())!==u};return s(1)?function(t,e,n){var r=t.parentNode;return xe.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=cc.before(t),r=Js(e).next(n);return r?r.toRange():null}(t,n)}(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Fg(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),xe.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Fg(e[e.length-1],n)}(u,a,c,n)},jg=Fn,Ug=function(t,e,n){var r,o,i,u,a,c,s=t.selection,l=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Te(t.getRoot());return n=Km(r,cc.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Ym(r,cc.fromRangeEnd(e))?n.replace(/( | )(<br( \/)>)?$/," "):n.replace(/ (<br( \/)?>)?$/," ")}(l,s.getRng(),e));var f=t.parser,d=n.merge,m=tm({validate:Kc(t)},t.schema),g='<span id="mce_marker" data-mce-type="bookmark"></span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},(i=t.fire("BeforeSetContent",i)).isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=i.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,g);var h=(a=s.getRng()).startContainer||(a.parentElement?a.parentElement():null),p=t.getBody();h===p&&s.isCollapsed()&&l.isBlock(p.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,p.firstChild)&&l.isEmpty(p.firstChild)&&((a=l.createRng()).setStart(p.firstChild,0),a.setEnd(p.firstChild,0),s.setRng(a)),s.isCollapsed()||function(t){var e=t.dom,n=Pg(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,jg);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,jg)&&cf(Te(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Eg(t,n,Te(r))}(t);var v,b={context:(r=s.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},y=f.parse(e,b);if(!0===n.paste&&Ig(t.schema,y)&&function(t,e){return!!Hg(t,e)}(l,r))return a=Vg(m,l,s.getRng(),y),s.setRng(a),void t.fire("SetContent",i);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(y),"mce_marker"===(c=y.lastChild).attr("id"))for(u=c,c=c.prev;c;c=c.walk(!0))if(3===c.type||!l.isBlock(c.name)){t.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(u,c,"br"===c.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),b.invalid){for(t.selection.setContent(g),r=s.getNode(),o=t.getBody(),9===r.nodeType?r=c=o:c=r;c!==o;)r=c,c=c.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return m.serialize(y)})))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=m.serialize(y),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new lm(r);xe.each(r.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)}))}}(t,d),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){i.scrollIntoView(e);var u=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(u)return o.remove(e),void i.select(u);var a=o.createRng(),c=e.previousSibling;c&&3===c.nodeType?(a.setStart(c,c.nodeValue.length),pe.ie||(r=e.nextSibling)&&3===r.nodeType&&(c.appendData(r.data),r.parentNode.removeChild(r))):(a.setStartBefore(e),a.setEndBefore(e));var s=o.getParent(e,o.isBlock);o.remove(e),s&&o.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),jg(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=cc.fromRangeStart(e);if(n=Js(t.getBody()).next(n))return n.toRange()}(a))?o.add(s,o.create("br",{"data-mce-bogus":"1"})):(a=n,o.remove(s))),i.setRng(a)}}(t,l.get("mce_marker")),v=t.getBody(),xe.each(v.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){x.from(t.getParent(e,"td,th")).map(Te).each(_m)}(l,s.getStart()),t.fire("SetContent",i),t.addVisual()}},Wg=function(t,e){e(t),t.firstChild&&Wg(t.firstChild,e),t.next&&Wg(t.next,e)},qg=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Wg(n.firstChild,(function(n){j(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),j(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(u)&&i.push(r[u]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(t,e,n);j(r,(function(t){j(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},$g=function(t){return t instanceof Jd},Gg=function(t,e){t.dom.setHTML(t.getBody(),e),function(t){Nd(t)&&al(t.getBody()).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Xg=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?function(t,e){return G(t.dom.childNodes,(function(t){return e(Te(t))})).map(Te)}(Te(n.parentNode),(function(n){return!Ne(t,n)&&e(n)})):x.none()}(t,e).isSome()},Kg=jr,Yg="_mce_caret",Jg=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Kg||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Qg=function(t){if(t){var e=new Ar(t,t);for(t=e.current();t;t=e.next())if(Mn(t))return t}return null},Zg=function(t){var e=ke("span");return qn(e,{id:Yg,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&an(e,Oe(Kg)),e},th=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Jg(e))mg(t,!1,Te(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Qg(t);return e&&e.nodeValue.charAt(0)===Kg&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&Tm(Te(u)),o.setRng(i)}},eh=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)th(t,e,n);else if(!(e=fl(t.getBody(),o.getStart())))for(;e=r.get(Yg);)th(t,e,!1)},nh=function(t,e){return t.appendChild(e),e},rh=function(t,e){var n=q(t,(function(t,e){return nh(t,e.cloneNode(!1))}),e);return nh(n,n.ownerDocument.createTextNode(Kg))},oh=function(t,e,n,r){var o,i,c,s=t.dom,l=t.selection,f=[],m=l.getRng(),g=m.startContainer,h=m.startOffset;for(i=g,3===g.nodeType&&(h!==g.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Wd(t,i,e,n,r)){c=i;break}i.nextSibling&&(o=!0),f.push(i),i=i.parentNode}if(c)if(o){var p=l.getBookmark();m.collapse(!0);var v=Zl(t,m,t.formatter.get(e),!0);v=Lf(v),t.formatter.remove(e,n,v,r),l.moveToBookmark(p)}else{var b=fl(t.getBody(),c),y=Zg(!1).dom;!function(t,e,n){var r,o,i,u=t.dom,a=u.getParent(n,d(_l,t));a&&u.isEmpty(a)?n.parentNode.replaceChild(e,n):(r=Te(n),o=va(r,"br"),i=W(function(t){for(var e=[],n=t.dom;n;)e.push(Te(n)),n=n.lastChild;return e}(r).slice(-1),Dr),o.length===i.length&&j(i,ln),u.isEmpty(n)?n.parentNode.replaceChild(e,n):u.insertAfter(e,n))}(t,y,null!==b?b:c);var w=function(t,e,n,r,o,i){var c=t.formatter,s=t.dom,l=W(rt(c.get()),(function(t){return t!==r&&!Nt(t,"removeformat")})),f=$d(t,n,l);if(W(f,(function(e){return!function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return ft(t,(function(t,e){return F(r,(function(t){return t===e}))}))};return F(t.formatter.get(e),(function(e){var r=o(e);return F(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=a),u(n).eq(t,e)}(r,e)}))}))}(t,e,r)})).length>0){var d=n.cloneNode(!1);return s.add(e,d),c.remove(r,o,d,i),s.remove(d),x.some(d)}return x.none()}(t,y,c,e,n,r),C=rh(f.concat(w.toArray()),y);th(t,b,!1),l.setCursorLocation(C,1),s.isEmpty(c)&&s.remove(c)}},ih=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(Me(e))&&!ll(e.dom)&&!En(e.dom)},uh={},ah=bt,ch=pt;uh.pre||(uh.pre=[]),uh.pre.push((function(t){var e,n=t.selection.getRng(),r=On(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),ch(ah(ah(e,r),(function(t){return r(t.previousSibling)&&-1!==yt(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Wu(n=t).remove(),Wu(e).append("<br><br>").append(n.childNodes)})))}));var sh=xe.each,lh=function(t){return kn(t)&&!wl(t)&&!ll(t)&&!En(t)},fh=function(t,e){var n;for(n=t;n;n=n[e]){if(Mn(n)&&0!==n.nodeValue.length)return t;if(kn(n)&&!wl(n))return n}return t},dh=function(t,e,n){var r,o,i=new lm(t);if(e&&n&&(e=fh(e,"previousSibling"),n=fh(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),xe.each(xe.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},mh=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=dh(t,Tl(r),r);dh(t,o,Tl(o,!0))}},gh=function(t,e,n){sh(t.childNodes,(function(t){lh(t)&&(e(t)&&n(t),t.hasChildNodes()&&gh(t,e,n))}))},hh=function(t,e){return function(n){return!(!n||!zl(t,n,e))}},ph=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},vh=mr([{keep:[]},{rename:["name"]},{removed:[]}]),bh=/^(src|href|style)$/,yh=xe.each,wh=Rl,xh=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Ch=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],kn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Mn(r)&&n&&o>=r.nodeValue.length&&(r=new Ar(r,t.getBody()).next()||r),Mn(r)&&!n&&0===o&&(r=new Ar(r,t.getBody()).prev()||r),r},Sh=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},kh=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Oh=function(t,e,n,r,o){var i=Te(e),u=Te(t.create(r,o)),a=n?$e(i):qe(i);return cn(u,a),n?(rn(i,u),un(u,i)):(on(i,u),an(u,i)),u.dom},Th=function(t,e,n,r){return!(e=Tl(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},_h=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!!wh(e,n.inline)||!!wh(e,n.block)||(n.selector?kn(e)&&t.is(e,n.selector):void 0)}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return vh.keep();var a=r;if(e.inline&&"all"===e.remove&&_(e.preserve_attributes)){var c=W(u.getAttribs(a),(function(t){return H(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),j(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return vh.rename("span")}if("all"!==e.remove){yh(e.styles,(function(t,r){t=Ml(u,Nl(t,n),r+""),D(r)&&(r=t,o=null),(e.remove_similar||!o||wh(zl(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),yh(e.attributes,(function(t,r){var i;if(t=Nl(t,n),D(r)&&(r=t,o=null),e.remove_similar||!o||wh(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",j(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);"class"===r&&a.removeAttribute("className"),bh.test(r)&&a.removeAttribute("data-mce-"+r),a.removeAttribute(r)}})),yh(e.classes,(function(t){t=Nl(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return vh.keep()}}return"none"!==e.remove?(function(t,e,n){var r,o=e.parentNode,i=t.dom,u=zc(t);n.block&&(u?o===i.getRoot()&&(n.list_block&&wh(e,n.list_block)||j(nt(e.childNodes),(function(e){El(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=kh(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0}))):i.isBlock(e)&&!i.isBlock(o)&&(Th(i,e,!1)||Th(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Th(i,e,!0)||Th(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!wh(n.inline,e)||i.remove(e,!0)}(t,a,e),vh.removed()):vh.keep()},Eh=function(t,e,n,r,o){return _h(t,e,n,r,o).fold(p,(function(e){return t.dom.rename(r,e),!0}),v)},Ah=function(t,e,n,r){return _h(t,e,n,r,r).fold(l(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),l(null))},Nh=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return j(Bl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=Wd(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=Ah(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),u.inline&&mh(f,u,0,s))}return r}(t,i,a,r,r,0,u,n)},f=function(e){var r,o;kn(e)&&c.getContentEditable(e)&&(r=a,a="true"===c.getContentEditable(e),o=!0);var s=nt(e.childNodes);if(a&&!o)for(var l=0;l<i.length&&!Eh(t,i[l],n,e,e);l++);if(u.deep&&s.length){for(l=0;l<s.length;l++)f(s[l]);o&&(a=r)}},d=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return wl(t)&&kn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),Mn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},m=function(e){var n,r,o=Zl(t,e,i,e.collapsed);if(u.split){if(o=Lf(o),(n=Ch(t,o,!0))!==(r=Ch(t,o))){if(n=Sh(n,!0),r=Sh(r,!1),xh(c,n,r)){var a=x.from(n.firstChild).getOr(n);return l(Oh(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(xh(c,r,n))return a=x.from(r.lastChild).getOr(r),l(Oh(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);n=kh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=kh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),ef(c,s,(function(t){j(t,(function(t){wl(t)||wl(t.parentNode)||l(t)}))})),l(n),l(r),n=d(!0),r=d()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}ef(c,o,(function(e){j(e,(function(e){f(e),j(["underline","line-through","overline"],(function(n){kn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Dl(c,e.parentNode)===n&&Eh(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)if(kl(r)){var g=c.createRng();g.setStartBefore(r),g.setEndAfter(r),m(g)}else m(r);else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&u.inline&&!of(t).length?oh(t,e,n,o):(df(s,!0,(function(){ff(t,m)})),u.inline&&qd(t,e,n,s.getStart())&&Ol(c,s,s.getRng()),t.nodeChanged());else{r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!Eh(t,i[h],n,r,r));h++);}},Rh=xe.each,Mh=xe.each,zh=function(t,e){return gt(t,e)},Dh=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(e=e||i,t){if(e.onformat&&e.onformat(t,e,n,r),Mh(e.styles,(function(e,r){a.setStyle(t,r,Nl(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Mh(e.attributes,(function(e,r){a.setAttrib(t,r,Nl(e,n))})),Mh(e.classes,(function(e){e=Nl(e,n),a.hasClass(t,e)||a.addClass(t,e)}))}},l=function(t,e){var n=!1;return!!Il(i)&&(Mh(t,(function(t){if(!("collapsed"in t)||t.collapsed===u)return a.is(e,t.selector)&&!ll(e)?(s(e,t),n=!0,!1):void 0})),n)},f=function(r,u,a,c){var f=[],d=!0,m=i.inline||i.block,g=r.create(m);s(g),ef(r,u,(function(u){var a,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),y=u.parentNode.nodeName.toLowerCase();if(kn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Pn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Ll(e)){var o=St(St({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=Xg(Te(n),(function(t){return ll(t.dom)}));return gt(o,r)&&wo(Te(n.parentNode),!1)&&!i}return!1}(t,i,u,y))return a=null,void(Pl(i)&&r.remove(u));if(i.wrapper&&Wd(t,u,e,n))a=null;else{if(d&&!p&&Pl(i)&&!i.wrapper&&_l(t,b)&&El(t,y,m)){var w=r.rename(u,m);return s(w),f.push(w),void(a=null)}if(Il(i)){var x=l(o,u);if(!zh(i,"inline")||x)return void(a=null)}!d||p||!El(t,m,b)||!El(t,y,m)||!c&&3===u.nodeType&&1===u.nodeValue.length&&65279===u.nodeValue.charCodeAt(0)||ll(u)||zh(i,"inline")&&r.isBlock(u)?(a=null,Mh(xe.grep(u.childNodes),h),p&&(d=v),a=null):(a||(a=r.clone(g,!1),u.parentNode.insertBefore(a,u),f.push(a)),a.appendChild(u))}};Mh(u,h)})),!0===i.links&&Mh(f,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),Mh(xe.grep(t.childNodes),e)};e(t)})),Mh(f,(function(u){var a=function(t){var e=0;return Mh(t.childNodes,(function(t){(function(t){return M(t)&&Mn(t)&&0===t.length})(t)||wl(t)||e++})),e}(u);!(f.length>1)&&r.isBlock(u)||0!==a?(Ll(i)||i.wrapper)&&(i.exact||1!==a||(u=function(t){var e,n=function(t){var e=!1;return Mh(t.childNodes,(function(t){if(function(t){return t&&1===t.nodeType&&!wl(t)&&!ll(t)&&!En(t)}(t))return e=t,!1})),e}(t);return n&&!wl(n)&&jd(r,n,i)&&(e=r.clone(n,!1),s(e),r.replace(e,t,!0),r.remove(n,!0)),e||t}(u)),function(t,e,n,r){Rh(e,(function(e){Rh(t.dom.select(e.inline,r),(function(r){lh(r)&&Eh(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";sh(t.select(r,n),(function(n){lh(n)&&sh(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))}(t,o,n,u),function(t,e,n,r,o){Wd(t,o.parentNode,n,r)&&Eh(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(Wd(t,i,n,r))return Eh(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&gh(r,hh(t,"fontSize"),ph(t,"backgroundColor",Nl(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Dl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(xe.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(gh(r,hh(t,"fontSize"),ph(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),mh(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(kl(r)){if(!l(o,r)){var d=a.createRng();d.setStartBefore(r),d.setEndAfter(r),f(a,Zl(t,d,o),0,!0)}}else f(a,r,0,!0);else if(u&&Ll(i)&&!of(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=fl(t.getBody(),i.getStart()))&&(o=Qg(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=Zl(t,u,t.formatter.get(e));m=Lf(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Kg||(s=t.getDoc(),l=Zg(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)}(t,e,n);else{var m=c.getNode(),g=o[0];t.settings.forced_root_block||!g.defaultBlock||a.getParent(m,a.isBlock)||Dh(t,g.defaultBlock),c.setRng(Pg(c.getRng())),df(c,!0,(function(e){ff(t,(function(e,n){var r=n?e:Zl(t,e,o);f(a,r)}))})),Ol(a,c,c.getRng()),t.nodeChanged()}!function(t,e){ch(uh[t],(function(t){t(e)}))}(e,t)}}else{r=c.getNode();for(var h=0,p=o.length;h<p;h++){var v=o[h];if(v.ceFalseOverride&&Il(v)&&a.is(r,v.selector))return void s(r,v)}}},Bh=function(t,e,n,r){return lt(t,(function(t,o){return!!mt(e,o)||(j(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},Ph=function(t,e,n,r,o){return null===e.get()&&function(t,e){var n=ra({});t.set({}),e.on("NodeChange",(function(r){!function(t,e,n,r){var o=rt(n.get()),i={},u={},a=W(Bl(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));it(r,(function(e,n){xe.each(a,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(j(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:a})})),i[n]=e.callbacks),u[n]=e.callbacks,!1):!Fd(t,r,n)&&void 0}))}));var c=Bh(n.get(),u,e,a);n.set(St(St({},i),c))}(e,r.element,n,t.get())}))}(e,t),function(t,e,n,r){var o=t.get();j(e.split(","),(function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)})),t.set(o)}(e,n,r,o),{unbind:function(){return function(t,e,n){var r=t.get();j(e.split(","),(function(t){r[t].callbacks=W(r[t].callbacks,(function(t){return t!==n})),0===r[t].callbacks.length&&delete r[t]})),t.set(r)}(e,n,r)}}},Ih=function(t,e){var n=(e||document).createDocumentFragment();return j(t,(function(t){n.appendChild(t.dom)})),Te(n)},Lh=function(t,e,n){return{element:t,width:e,rows:n}},Hh=function(t,e){return{element:t,cells:e}},Fh=function(t,e){return{x:t,y:e}},Vh=function(t,e){var n=parseInt($n(t,e),10);return isNaN(n)?1:n},jh=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Uh=function(t){return $(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},Wh=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Ne(o[i],e))return x.some(Fh(i,r));return x.none()},qh=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Hh(u[a].element,s))}return i},$h=function(t){return function(t,e){var n=_a(t.element),r=ke("tbody");return cn(r,e),an(n,r),n}(t,function(t){return V(t.rows,(function(t){var e=V(t.cells,(function(t){var e=Ea(t);return Xn(e,"colspan"),Xn(e,"rowspan"),e})),n=_a(t.element);return cn(n,e),n}))}(t))},Gh=function(t,e){return G(t,(function(t){return"li"===Me(t)&&cf(t,e)})).fold(l([]),(function(e){return function(t){return G(t,(function(t){return"ul"===Me(t)||"ol"===Me(t)}))}(t).map((function(t){var e=ke(Me(t));return function(t,e){var n=t.dom;it(e,(function(t,e){!function(t,e,n){if(!O(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);jn(t)&&t.style.setProperty(e,n)}(n,e,t)}))}(e,ft(Qn(t),(function(t,e){return Rt(e,"list-style")}))),[ke("li"),e]})).getOr([])}))},Xh=function(){return Ih([])},Kh=function(t,e){return n=Te(e.cloneContents()),r=function(t,e){var n=Te(e.commonAncestorContainer),r=Am(n,t),o=W(r,(function(t){return zr(t)||Rr(t)})),i=Gh(r,e),u=o.concat(i.length?i:function(t){return Ir(t)?je(t).filter(Pr).fold(l([]),(function(e){return[t,e]})):Pr(t)?[t]:[]}(n));return V(u,_a)}(t,e),o=$(r,(function(t,e){return an(e,t),e}),n),r.length>0?Ih([o]):o;var n,r,o},Yh=function(t,e){return(n=t,r=e[0],yr(r,"table",d(Ne,n))).bind((function(t){var n,r,o,i=e[0],u=e[e.length-1],a=function(t){var e=Lh(_a(t),0,[]);return j(va(t,"tr"),(function(t,n){j(va(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=Vh(o,"rowspan"),u=Vh(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Hh(Ea(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:_a(o)}}(e,function(t,e,n){for(;jh(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),Lh(e.element,Uh(e.rows),e.rows)}(t);return(n=a,r=i,o=u,Wh(n,r).bind((function(t){return Wh(n,o).map((function(e){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?qh(t,r,o,i,u):qh(t,r,u,i,o);return Lh(t.element,Uh(a),a)}(n,t,e)}))}))).map((function(t){return Ih([$h(t)])}))})).getOrThunk(Xh);var n,r},Jh=function(t,e){return e>=0&&e<t.length&&Cl(t.charAt(e))},Qh=function(t,e){var n=Wr(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Zh=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return x.from(t.selection.getRng()).map((function(e){var n=x.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=pe.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=Qh(u,i),c=Wr(u.textContent);if(t.dom.remove(u),Jh(c,0)||Jh(c,c.length-1)){var s=n.getOr(r),l=Qh(s,i),f=l.indexOf(a);return-1===f?a:(Jh(l,f-1)?" ":"")+a+(Jh(l,f+a.length)?" ":"")}return a})).getOr("")}(t);n.getInner=!0;var r=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=Pd(t,nf(o)),u=e.contextual?function(t,e){var n=rf(e,t);return n.length>0?Yh(t,n):function(t,e){return e.length>0&&e[0].collapsed?Xh():Kh(t,e[0])}(t,e)}(Te(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)},tp=function(t){return kn(t)?t.outerHTML:Mn(t)?Io.encodeRaw(t.data,!1):zn(t)?"\x3c!--"+t.data+"--\x3e":""},ep=function(t,e){var n,r,o,i,u,a,c,s,l,f=V(nt(e.childNodes),tp);return function(t,e){var n=0;j(t,(function(t){0===t[0]?n++:1===t[0]?(function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)}(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},np=ra(x.none()),rp=function(t){var e,n=(e=t.getBody(),W(V(nt(e.childNodes),tp),(function(t){return t.length>0}))),r=K(n,(function(e){var n=am(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},op=function(t,e,n){"fragmented"===e.type?ep(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},ip=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},up=function(t){var e=ke("body",np.get().getOrThunk((function(){var t=document.implementation.createHTMLDocument("undo");return np.set(x.some(t)),t})));return Oa(e,ip(t)),j(va(e,"*[data-mce-bogus]"),fn),e.dom.innerHTML},ap=function(t,e){return!(!t||!e)&&(!!function(t,e){return ip(t)===ip(e)}(t,e)||function(t,e){return up(t)===up(e)}(t,e))},cp=function(t){return 0===t.get()},sp=function(t,e,n){cp(n)&&(t.typing=e)},lp=function(t,e){t.typing&&(sp(t,!1,e),t.add())},fp=function(t){return t instanceof Jd},dp=function(t,e){qg(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},mp=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){cp(e)&&n.set(x.some(Ac(t.selection)))}(t,e,n)},addUndoLevel:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=rp(t);if(i=i||{},i=xe.extend(i,a),!1===cp(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&ap(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Ac(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,sp(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],op(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],op(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!ap(rp(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return lp(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];op(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r){return qd(t,e,n,r)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&Wd(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return Wd(t,e,n,r,o)},canApply:function(e){return function(t,e){var n,r,o,i,u,a=t.formatter.get(e),c=t.dom;if(a)for(n=t.selection.getStart(),r=Bl(c,n),i=a.length-1;i>=0;i--){if(!(u=a[i].selector)||a[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],u))return!0}return!1}(t,e)},closest:function(e){return function(t,e){var n=function(e){return Ne(e,Te(t.getBody()))};return x.from(t.selection.getStart(!0)).bind((function(r){return Ld(Te(r),(function(n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n]);if(r.isSome())return r}return x.none()}(e,(function(e){return function(e,n){return Wd(t,e.dom,n)?x.some(n):x.none()}(n,e)}))}),n)})).getOrNull()}(t,e)},apply:function(e,n,r){return Dh(t,e,n,r)},remove:function(e,n,r,o){return Nh(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!qd(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Dh(t,e,n,r):Nh(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o){return Ph(t,e,n,r,o)}},editor:{getContent:function(e,n){return function(t,e,n){return x.from(t.getBody()).fold(l("tree"===e.format?new Jd("body",11):""),(function(r){return function(t,e,n,r){var o;return e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),o="raw"===e.format?xe.trim(cm(t.serializer,r.innerHTML)):"text"===e.format?t.dom.isEmpty(r)?"":Wr(r.innerText||r.textContent):"tree"===e.format?t.serializer.serialize(r,e):function(t,e){var n=zc(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,e)),H(["text","tree"],e.format)||Fr(Te(r))?e.content=o:e.content=xe.trim(o),e.no_events||t.fire("GetContent",e),e.content}(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=$g(e)?"":e,n.no_events||t.fire("BeforeSetContent",n),$g(e)||(e=n.content),x.from(t.getBody()).fold(l(e),(function(r){return $g(e)?function(t,e,n,r){qg(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tm({validate:t.validate},t.schema).serialize(n);return r.content=Fr(Te(e))?o:xe.trim(o),Gg(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),(o=zc(t))&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,Dc(t),n)):n||(n='<br data-mce-bogus="1">'),Gg(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=tm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=Fr(Te(e))?n:xe.trim(n),Gg(t,r.content),r.no_events||t.fire("SetContent",r)),r.content}(t,r,e,n)}))}(t,e,n)},insertContent:function(e,n){return Ug(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=M(e)?e:t.getBody();N(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),j(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Zh(t,e,n)}},raw:{getModel:function(){return x.none()}}}},gp=function(t){return mt(t.plugins,"rtc")},hp=function(t){return t.rtcInstance?t.rtcInstance:mp(t)},pp=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},vp=function(t){return 0===t.dom.length?(ln(t),x.none()):x.some(t)},bp=function(t,e,n,r){t.bind((function(t){return(r?og:rg)(t.dom,r?t.dom.length:0),e.filter(Pe).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(ig(o,i,!1,!r),n.setStart(i,u)):(ig(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return yf.isBookmarkNode(t.dom)})).bind(e?We:Ue)}(e,r).or(e).filter(Pe).map((function(t){return function(t,e){je(t).each((function(n){var r=t.dom;e&&Km(n,cc(r,0))?rg(r,0):!e&&Ym(n,cc(r,r.length))&&og(r,r.length)}))}(t,r)}))}))},yp=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=W(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}},wp=function(t){return!!t.select},xp=function(t){return!(!t||!t.ownerDocument)&&Re(Te(t.ownerDocument),Te(t))},Cp=function(t,e,n,r){var o,i,u=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};xe.each(n,(function(e,n){xe.each(i,(function(o){if(t.is(o,n))return r[n]||(xe.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),xe.each(r,(function(t,e){u[e]||(delete r[e],xe.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){yp(n,o,i),yp(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return function(t,e,n){void 0===n&&(n={});var r=function(t,e){return St(St({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e);if(r.no_events||!(r=t.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,St(St({isRootContent:!0,forced_root_block:!1},o),e));return tm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,r);var o=t.selection.getRng();!function(t,e){var n=x.from(e.firstChild).map(Te),r=x.from(e.lastChild).map(Te);t.deleteContents(),t.insertNode(e);var o=n.bind(Ue).filter(Pe).bind(vp),i=r.bind(We).filter(Pe).bind(vp);bp(o,n,t,!0),bp(i,r,t,!1),t.collapse(!1)}(o,o.createContextualFragment(n.content)),t.selection.setRng(o),ud(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)}(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var l=e.document;if(null==l)return null;if(void 0!==r.bookmark&&!1===Nd(r)){var f=xd(r);if(f.isSome())return f.map((function(t){return Pd(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Sn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=Pd(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!wp(t)||xp(t.startContainer)&&xp(t.endContainer))}(t)){var u=wp(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||pe.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Sn(n)||Sn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(sf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return pp(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)}(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return x.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(sf(t,o,e,!0),sf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Bd(r.nextSibling,!0):r.parentNode,o=0===u?Bd(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return zd(r.getBody(),l(),t)},getEnd:function(t){return Dd(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||zd(u,e,e.collapsed),t.isBlock),r=t.getParent(r||Dd(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Ar(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(nf(n).length>1)&&lf(r)){var o=Pf(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?rd:id)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(Tf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?cc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=yf(m),h=kf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Sp=function(t,e){var n=di();e.convert_fonts_to_spans&&function(t,e,n){t.addNodeFilter("font",(function(t){j(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){j(["color","face","size"],(function(e){t.attr(e,null)}))}(t)}))}))}(t,n,xe.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){j(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},kp=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Op=function(t,e){var n;try{n=atob(e)}catch(t){return x.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return x.some(new Blob([r],{type:t}))},Tp=function(t){return 0===t.indexOf("blob:")?function(t){return new Cr((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===this.status?e(this.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new Cr((function(t){var n=kp(e),r=n.type,o=n.data;Op(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},_p=0,Ep=function(t){return(t||"blobid")+_p++};function Ap(t,e){var n={};return{findAll:function(r,o){o||(o=v);var i=W(function(t){return t?nt(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!pe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===pe.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),u=V(i,(function(t){if(void 0!==n[t.src])return new Cr((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Cr((function(n,r){!function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=kp(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):Tp(e.src).then((function(r){(function(t){return new Cr((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=kp(u).data,i=t.create(Ep(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))}(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Cr.all(u)}}}var Np,Rp,Mp=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Jd("br",1)).shortEnded=!0:r.empty().append(new Jd("#text",3)).value=Vr},zp=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Dp=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Bp=xe.makeMap,Pp=xe.each,Ip=xe.explode,Lp=xe.extend,Hp=function(t,e){void 0===e&&(e=Go());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e,u,a;(u=t.name)in n&&((a=o[u])?a.push(t):o[u]=[t]),e=r.length;for(;e--;)(u=r[e].name)in t.attributes.map&&((a=i[u])?a.push(t):i[u]=[t]);return t},a={schema:e,addAttributeFilter:function(t,e){Pp(Ip(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Pp(Ip(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v,b=[];c=c||{},o={},i={};var y=Lp(Bp("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=e.getNonEmptyElements(),x=e.children,C=t.validate,S=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),k=e.getWhiteSpaceElements(),O=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,_=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;p=k.hasOwnProperty(c.context)||k.hasOwnProperty(t.root_name);var A=function(t,e){var r,i=new Jd(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){var n,r,o,i,u=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!u[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},R=um({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(A("#cdata",4)).value=t},text:function(t,e){var n;p||(t=t.replace(_," "),function(t,e){return t&&(e[t.name]||"br"===t.name)}(v.lastChild,y)&&(t=t.replace(O,""))),0!==t.length&&((n=A("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(A("#comment",8)).value=t},pi:function(t,e){v.append(A(t,7)).value=e,N(v)},doctype:function(t){v.append(A("#doctype",10)).value=t,N(v)},start:function(t,n,o){var u,a,c,s,l=C?e.getElementRule(t):{};if(l){for((u=A(l.outputName||t,1)).attributes=n,u.shortEnded=o,v.append(u),(s=x[v.name])&&x[u.name]&&!s[u.name]&&b.push(u),a=r.length;a--;)(c=r[a].name)in n.map&&((g=i[c])?g.push(u):i[c]=[u]);y[t]&&N(u),o||(v=u),!p&&k[t]&&(p=!0)}},end:function(n){var r,o,i,u,a=C?e.getElementRule(n):{};if(a){if(y[n]&&!p){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(O,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(p&&k[n]&&(p=!1),a.removeEmpty&&Dp(e,w,k,v))return u=v.parent,y[v.name]?v.empty().remove():v.unwrap(),void(v=u);a.paddEmpty&&(function(t){return zp(t,"#text")&&t.firstChild.value===Vr}(v)||Dp(e,w,k,v))&&Mp(t,c,y,v),v=v.parent}}},e),M=v=new Jd(c.context||t.root_name,11);if(R.parse(a,c.format),C&&b.length&&(c.context?c.invalid=!0:function(t){var n,r,o,i,a,c,s,l,f,d,m,g=Bp("tr,td,th,tbody,thead,tfoot,table"),h=e.getNonEmptyElements(),p=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if((r=t[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!g[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),a=c=u(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(c.name,i[f].name)?(s=u(i[f].clone()),c.append(s)):s=c,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,s.append(l),l=m;c=s}Dp(e,h,p,a)?o.insert(r,i[0],!0):(o.insert(a,i[0],!0),o.insert(r,a)),o=i[0],(Dp(e,h,p,o)||zp(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ol"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ol"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(u(new Jd("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(u(new Jd("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}}(b)),S&&("body"===M.name||c.isRootContent)&&function(){var n,r,o=M.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(O,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(e.isValidChild(M.name,S.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=A(S,1)).attr(t.forced_root_block_attrs),M.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!c.invalid){for(h in o)if(o.hasOwnProperty(h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return M}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=xe.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Dp(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&Mp(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new Jd("#text",3)).value=Vr,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(void 0,r=(n=i.attr("rel"))?xe.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Jd("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e,r,o,i,u,a,c,s=t.length,l=n.getValidClasses();s--;){for(r=(e=t[s]).attr("class").split(" "),u="",o=0;o<r.length;o++)i=r[o],c=!1,(a=l["*"])&&a[i]&&(c=!0),a=l[e.name],!c&&a&&a[i]&&(c=!0),c&&(u&&(u+=" "),u+=i);u.length||(u=null),e.attr("class",u)}})),function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(function(t){return t.attr("src")===pe.transparentSrc||t.attr("data-mce-placeholder")})(t)||function(t){return t.attr("data-mce-bogus")}(t)||(r=i,o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r),o?x.some({type:o[1],data:decodeURIComponent(o[2])}):x.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),it(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return x.from(n.getByData(r,e)).orThunk((function(){return Op(e,r).map((function(t){var e=n.create(Ep(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return j(t,r)}))}(t,e)}(a,t),function(t,e){e.inline_styles&&Sp(t,e)}(a,t),a},Fp=function(t,e,n){-1===xe.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},Vp=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Qu.DOM,o=e&&e.schema?e.schema:Go(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=Hp(t,o);return function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o,i,u=t.length,a="data-mce-"+r,c=e.url_converter,s=e.url_converter_scope;u--;)void 0!==(i=(o=t[u]).attr(a))?(o.attr(r,i.length>0?i:null),o.attr(a,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))})),t.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r,o=t.length;o--;)"bookmark"!==(r=t[o]).attr("data-mce-type")||n.cleanup||(x.from(r.firstChild).exists((function(t){return!Ur(t.value)}))?r.unwrap():r.remove())})),t.addNodeFilter("noscript",(function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=Io.decode(e.value))})),t.addNodeFilter("script,style",(function(t,n){for(var r,o,i,u=t.length,a=function(t){return t.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,"")};u--;)o=(r=t[u]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+a(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+a(o)+"\n--\x3e")})),t.addNodeFilter("#comment",(function(t){for(var r,o=t.length;o--;)r=t[o],e.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),t.addAttributeFilter("data-mce-type",(function(e){j(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r),{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=St({format:"html"},u),c=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o,i=t.dom;e=e.cloneNode(!0);var u=document.implementation;return u.createHTMLDocument&&(r=u.createHTMLDocument(""),xe.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){r.body.appendChild(r.importNode(t,!0))})),e="BODY"!==e.nodeName?r.body.firstChild:r.body,o=i.doc,i.doc=r),function(t,e){t.fire("PreProcess",e)}(t,St(St({},n),{node:e})),o&&(i.doc=o),e}(t,e,n):e}(e,n,a),s=function(t,e,n){var r=Wr(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||Fr(Te(e))?r:xe.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?St({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,St(St({},e),{content:n})).content:n}(t,o,function(t,e,n){return tm(t,e).serialize(n)}(e,n,r))}(e,t,o,l,a)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:d(Fp,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},jp=function(t,e){var n=Vp(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Up=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return hp(t).editor.setContent(e,n)}(t,e,n)},Wp=Qu.DOM,qp=function(t){return x.from(t).each((function(t){return t.destroy()}))},$p=Object.prototype.hasOwnProperty,Gp=(Np=function(t,e){return T(t)&&T(e)?Gp(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)$p.call(o,i)&&(n[i]=Np(n[i],o[i]))}return n}),Xp=ae().deviceType,Kp=Xp.isTouch(),Yp=Xp.isPhone(),Jp=Xp.isTablet(),Qp=["lists","autolink","autosave"],Zp={table_grid:!1,object_resizing:!1,resize:!1},tv=function(t){var e=_(t)?t.join(" "):t,n=V(O(e)?e.split(" "):[],zt);return W(n,(function(t){return t.length>0}))},ev=function(t,e){return t.sections().hasOwnProperty(e)},nv=function(t,e){return dt(t,"toolbar_mode").orThunk((function(){return dt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},rv=function(t,e){var n={resize:!1,toolbar_mode:nv(t,"scrolling"),toolbar_sticky:!1};return St(St(St({},Zp),n),e?{menubar:!1}:{})},ov=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?xe.extend({},t.external_plugins,n):n},iv=function(t,e,n,r){var o=tv(n.forced_plugins),i=tv(r.plugins),u=function(t,e){return ev(t,e)?t.sections()[e]:{}}(e,"mobile"),a=function(t,e){return[].concat(tv(t)).concat(tv(e))}(o,function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return ev(t,e)&&"mobile"===r[e].theme}(e,"mobile")?W(r,d(H,Qp)):t&&ev(e,"mobile")?r:n}(t,e,i,u.plugins?tv(u.plugins):i));if(pe.browser.isIE()&&H(a,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return xe.extend(r,{plugins:a.join(" ")})},uv=function(t,e,n,r,o){var i=t?{mobile:rv(o.mobile||{},e)}:{},u=function(t,e){var n=lt(e,(function(e,n){return H(t,n)}));return function(t,e){return{sections:l(t),settings:l(e)}}(n.t,n.f)}(["mobile"],Gp(i,o)),a=xe.extend(n,r,u.settings(),function(t,e){return t&&ev(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return xe.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:ov(r,u.settings())});return iv(t,u,r,a)},av=function(t,e,n){return x.from(e.settings[n]).filter(t)},cv=(Rp={},{add:function(t,e){Rp[t]=e},get:function(t){return Rp[t]?Rp[t]:{icons:{}}},has:function(t){return mt(Rp,t)}}),sv=function(t,e){return e.dom[t]},lv=function(t,e){return parseInt(Kn(e,t),10)},fv=d(sv,"clientWidth"),dv=d(sv,"clientHeight"),mv=d(lv,"margin-top"),gv=d(lv,"margin-left"),hv=function(t,e,n){var r=Te(t.getBody()),o=t.inline?r:Te(Fe(r).dom.documentElement),i=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+gv(e):0),y:r-(t?o.top+e.dom.clientTop+mv(e):0)}}(t.inline,o,e,n);return function(t,e,n){var r=fv(t),o=dv(t);return e>=0&&n>=0&&e<=r&&n<=o}(o,i.x,i.y)};function pv(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return x.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){X(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&function(t){var e;return(e=t.inline?t.getBody():t.getContentAreaContainer(),x.from(e).map(Te)).map(dn).getOr(!1)}(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),G(e,(function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(u,(function(){i(a),o(),r().fold((function(){return t.focus()}),(function(t){return Te(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",St({},a)),a}))};return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1)})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Tr.requestAnimationFrame(o)})),t.on("remove",(function(){j(e.slice(),(function(t){n().close(t)}))}))}(t),{open:u,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:function(){return e}}}var vv=sa.PluginManager,bv=sa.ThemeManager,yv=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=W(e,(function(t){return t!==n}))).length&&t.focus()},i=function(n){t.editorManager.setActive(t),wd(t);var r=n();return function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)}(r),r};return t.on("remove",(function(){j(e,(function(t){n().close(t)}))})),{open:function(t,e){return i((function(){return n().open(t,e,o)}))},openUrl:function(t){return i((function(){return n().openUrl(t,o)}))},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){x.from(e[e.length-1]).each((function(t){n().close(t),o(t)}))}}},wv=function(t,e){t.notificationManager.open({type:"error",text:e})},xv=function(t,e){t._skinLoaded?wv(t,e):t.on("SkinLoaded",(function(){wv(t,e)}))},Cv=function(t,e,n){!function(t,e,n){t.fire(e,n)}(t,e,{message:n}),console.error(n)},Sv=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},kv=function(t,e,n){Cv(t,"PluginLoadError",Sv("plugin",e,n))},Ov=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,kt([t],e)):r.log.apply(r,kt([t],e)))};function Tv(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);u&&"string"==typeof u.location?n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o)):r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){xe.each(n[t],(function(t){t(e)})),delete n[t]};return!1===z(e.handler)&&(e.handler=r),{upload:function(a,c){return e.url||e.handler!==r?function(r,a){return r=xe.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Cr.all(xe.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Cr((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new Cr((function(a){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||(c||(c=r()),c.progressBar.value(t))}))}catch(t){a(i(e,t.message,{}))}}))}(r,e.handler,a)})))}(a,c):new Cr((function(t){t([])}))}}}var _v=0,Ev=function(t){return t+_v+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e};var Av,Nv=xe.each,Rv=Qu.DOM,Mv=function(t,e){var n,r,o,i=e&&e.schema||Go({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Rv.create(r.name);return function(t,e){e.classes.length&&Rv.addClass(t,e.classes.join(" ")),Rv.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==xe.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Rv.create("div")).appendChild(t),xe.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Rv.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},zv=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=xe.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==xe.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},Dv=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return O(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=dt(e,"preview");if(c.is(!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),xe.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=xe.map(t.split(/(?:~\+|~|\+)/),zv),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Mv(l,t)):r=Mv([n],t);var f=Rv.select(n,r)[0]||r.firstChild;return Nv(e.styles,(function(t,e){var n=a(t);n&&Rv.setStyle(f,e,n)})),Nv(e.attributes,(function(t,e){var n=a(t);n&&Rv.setAttrib(f,e,n)})),Nv(e.classes,(function(t){var e=a(t);Rv.hasClass(f,e)||Rv.addClass(f,e)})),t.fire("PreviewFormats"),Rv.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Rv.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Nv(u.split(" "),(function(e){var n=Rv.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Rv.getStyle(t.getBody(),e,!0),"#ffffff"===Rv.toHex(n).toLowerCase())||"color"===e&&"#000000"===Rv.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Rv.remove(r),i},Bv=function(t){var e=function(t){var e={},n=function(t,r){t&&("string"!=typeof t?xe.each(t,(function(t,e){n(e,t)})):(_(r)||(r=[r]),xe.each(r,(function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),e[t]=r))};return n(function(t){var e={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",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",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"}],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",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",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:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],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",defaultBlock:"p",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:function(t,e,n){return kn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){xe.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 xe.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return t?e[t]:e},has:function(t){return mt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}}(t),n=ra(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();eh(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Kg||eh(t,fl(r,n.getStart())),37!==e&&39!==e||eh(t,fl(r,n.getStart()))}(t,e.keyCode)}))}(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){pp(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){pp(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){pp(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r){return function(t,e,n,r){return pp(t).formatter.match(e,n,r)}(t,e,n,r)},closest:function(e){return function(t,e){return pp(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return pp(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return pp(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return pp(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o){return function(t,e,n,r,o){return void 0===o&&(o=!1),pp(t).formatter.formatChanged(e,n,r,o)}(t,n,e,r,o)},getCssText:d(Dv,t)}},Pv=function(t){var e=ra(x.none()),n=ra(0),r=ra(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){pp(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return pp(t).undoManager.addUndoLevel(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return pp(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return pp(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){pp(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){pp(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return pp(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return pp(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return pp(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){pp(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){pp(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return gp(t)||function(t,e,n){var r=ra(!1),o=function(t){sp(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(lp(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===ap(rp(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),sp(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Iv=[9,27,Cf.HOME,Cf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Cf.DOWN,Cf.UP,Cf.LEFT,Cf.RIGHT].concat(pe.browser.isFirefox()?[224]:[]),Lv="data-mce-placeholder",Hv=function(t){return"keydown"===t.type||"keyup"===t.type},Fv=function(t){var e=t.keyCode;return e===Cf.BACKSPACE||e===Cf.DELETE},Vv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,jv=function(t,e){return Ee(Te(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Uv=function(t,e,n){var r=function(t,e,n){return W(Qu.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return x.from(r[r.length-1])},Wv=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Xr(n)?Mn(n.nextSibling)?cc(n.nextSibling,0):cc.after(n):Jr(e)?cc(n,r+1):e:Xr(n)?Mn(n.previousSibling)?cc(n.previousSibling,n.previousSibling.data.length):cc.before(n):Qr(e)?cc(n,r-1):e},qv=d(Wv,!0),$v=d(Wv,!1),Gv=function(t,e){return Re(t,e)?br(e,(function(t){return Br(t)||Ir(t)}),function(t){return function(e){return Ne(t,Te(e.dom.parentNode))}}(t)):x.none()},Xv=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Kv=function(t,e){return{from:t,to:e}},Yv=function(t,e){var n=Te(t),r=Te(e.container());return Gv(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},Jv=function(t){var e=Ge(t);return X(e,Mr).fold((function(){return e}),(function(t){return e.slice(0,t)}))},Qv=function(t){var e=Jv(t);return j(e,ln),e},Zv=function(t,e){var n=Am(e,t);return G(n.reverse(),(function(t){return wo(t)})).each(ln)},tb=function(t,e,n,r){if(wo(n))return Tm(n),al(n.dom);0===W(qe(r),(function(t){return!wo(t)})).length&&wo(e)&&rn(r,ke("br"));var o=ul(n.dom,cc.before(r.dom));return j(Qv(e),(function(t){rn(r,t)})),Zv(t,e),o},eb=function(t,e,n){if(wo(n))return ln(n),wo(e)&&Tm(e),al(e.dom);var r=cl(n.dom);return j(Qv(e),(function(t){an(n,t)})),Zv(t,e),r},nb=function(t,e){ol(t,e.dom).map((function(t){return t.getNode()})).map(Te).filter(Dr).each(ln)},rb=function(t,e,n){return nb(!0,e),nb(!1,n),function(t,e){return Re(e,t)?function(t,e){var n=Am(e,t);return x.from(n[n.length-1])}(e,t):x.none()}(e,n).fold(d(eb,t,e,n),d(tb,t,e,n))},ob=function(t,e,n,r){return e?rb(t,r,n):rb(t,n,r)},ib=function(t,e){var n=Te(t.getBody()),r=function(t,e,n){return n.collapsed?function(t,e,n){var r=Yv(t,cc.fromRangeStart(n)),o=r.bind((function(n){return el(e,t,n.position).bind((function(n){return Yv(t,n).map((function(n){return function(t,e,n){return Pn(n.position.getNode())&&!1===wo(n.block)?ol(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?el(e,t,r).bind((function(e){return Yv(t,e)})):x.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Ra(r,o,Kv).filter((function(t){return function(t){return!1===Ne(t.from.block,t.to.block)}(t)&&function(t){return je(t.from.block).bind((function(e){return je(t.to.block).filter((function(t){return Ne(e,t)}))})).isSome()}(t)&&function(t){return!1===Hn(t.from.block.dom)&&!1===Hn(t.to.block.dom)}(t)}))}(t,e,n):x.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ob(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},ub=function(t,e){var n=Te(e),r=d(Ne,t);return vr(n,Hr,r).isSome()},ab=function(t){var e=Te(t.getBody());return function(t,e){var n=ul(t.dom,cc.fromRangeStart(e)).isNone(),r=il(t.dom,cc.fromRangeEnd(e)).isNone();return!function(t,e){return ub(t,e.startContainer)||ub(t,e.endContainer)}(t,e)&&n&&r}(e,t.selection.getRng())?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ra(Gv(t,Te(n.startContainer)),Gv(t,Te(n.endContainer)),(function(r,o){return!1===Ne(r,o)&&(n.deleteContents(),ob(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},cb=function(t,e){return!t.selection.isCollapsed()&&ab(t)},sb=Ln,lb=Hn,fb=function(t,e,n,r,o){return x.from(e._selectionOverrides.showCaret(t,n,r,o))},db=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?x.none():x.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},mb=function(t,e,n){var r=Bs(1,t.getBody(),e),o=cc.fromRangeStart(r),i=o.getNode();if(gs(i))return fb(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(gs(u))return fb(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return lb(t)||sb(t)}));return gs(a)?fb(1,t,a,!1,n):x.none()},gb=function(t,e,n){return e.collapsed?mb(t,e,n).getOr(e):e},hb=function(t){return km(t)||wm(t)},pb=function(t){return Om(t)||xm(t)},vb=function(t,e,n,r,o,i){return fb(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Mn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},bb=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Mn(n.commonAncestorContainer))return!1;var r=e?ac.Forwards:ac.Backwards,o=Js(t.getBody()),i=d(Hs,e?o.next:o.prev),u=e?hb:pb,a=Is(r,t.getBody(),n),c=Wv(e,i(a));if(!c||!Fs(a,c))return!1;if(u(c))return vb(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Fs(c,s))&&vb(t,n,a.getNode(),r,e,s)}(t,e)},yb=mr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),wb=function(t,e,n){return el(e,t,n).bind((function(r){return o=r.getNode(),Hr(Te(o))||Ir(Te(o))||function(t,e,n,r){var o=function(e){return zr(Te(e))&&!Es(n,r,t)};return Ps(!e,n).fold((function(){return Ps(e,r).fold(p,o)}),o)}(t,e,n,r)?x.none():e&&Hn(r.getNode())||!1===e&&Hn(r.getNode(!0))?function(t,e,n,r){var o=r.getNode(!1===e);return Gv(Te(t),Te(n.getNode())).map((function(t){return wo(t)?yb.remove(t.dom):yb.moveToElement(o)})).orThunk((function(){return x.some(yb.moveToElement(o))}))}(t,e,n,r):e&&Om(n)||!1===e&&km(n)?x.some(yb.moveToPosition(r)):x.none();var o}))},xb=function(t,e){return x.from(wf(t.getBody(),e))},Cb=function(t,e){var n=t.selection.getNode();return xb(t,n).filter(Hn).fold((function(){return function(t,e,n){var r=Bs(e?1:-1,t,n),o=cc.fromRangeStart(r),i=Te(t);return!1===e&&Om(o)?x.some(yb.remove(o.getNode(!0))):e&&km(o)?x.some(yb.remove(o.getNode())):!1===e&&km(o)&&Vm(i,o)?jm(i,o).map((function(t){return yb.remove(t.getNode())})):e&&Om(o)&&Fm(i,o)?Um(i,o).map((function(t){return yb.remove(t.getNode())})):function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return kn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Hn(e.nextSibling)?x.some(yb.moveToElement(e.nextSibling)):!1===t&&Hn(e.previousSibling)?x.some(yb.moveToElement(e.previousSibling)):x.none()}(e,n.getNode(!1===e)).fold((function(){return wb(t,e,n)}),x.some):wb(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return x.some(yb.remove(t))}),(function(t){return x.some(yb.moveToElement(t))}),(function(n){return Es(e,n,t)?x.none():x.some(yb.moveToPosition(n))}))}(t,n,e)}))}(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0}}(t,e),function(t,e){return function(n){var r=e?cc.before(n):cc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),v)},Sb=function(t){var e=t.dom,n=t.selection,r=wf(t.getBody(),n.getNode());if(Ln(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(cc.before(o).toRange())}return!0},kb=function(t,e){return t.selection.isCollapsed()?Cb(t,e):function(t,e){var n=t.selection.getNode();return!!Hn(n)&&xb(t,n.parentNode).filter(Hn).fold((function(){var n;return n=Te(t.getBody()),j(va(n,".mce-offscreen-selection"),ln),mg(t,e,Te(t.selection.getNode())),Xv(t),!0}),(function(){return!0}))}(t,e)},Ob=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=cc.fromRangeStart(t.selection.getRng());return el(e,t.getBody(),n).filter((function(t){return e?bm(t):ym(t)})).bind((function(t){return x.from(As(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Tb=Mn,_b=function(t){return Tb(t)&&t.data[0]===jr},Eb=function(t){return Tb(t)&&t.data[t.data.length-1]===jr},Ab=function(t){return t.ownerDocument.createTextNode(jr)},Nb=function(t,e){return t?function(t){if(Tb(t.previousSibling))return Eb(t.previousSibling)||t.previousSibling.appendData(jr),t.previousSibling;if(Tb(t))return _b(t)||t.insertData(0,jr),t;var e=Ab(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Tb(t.nextSibling))return _b(t.nextSibling)||t.nextSibling.insertData(0,jr),t.nextSibling;if(Tb(t))return Eb(t)||t.appendData(jr),t;var e=Ab(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Rb=d(Nb,!0),Mb=d(Nb,!1),zb=function(t,e){return Mn(t.container())?Nb(e,t.container()):Nb(e,t.getNode())},Db=function(t,e){var n=e.get();return n&&t.container()===n&&Xr(n)},Bb=function(t,e){return e.fold((function(e){us(t.get());var n=Rb(e);return t.set(n),x.some(cc(n,n.length-1))}),(function(e){return al(e).map((function(e){if(Db(e,t))return cc(t.get(),1);us(t.get());var n=zb(e,!0);return t.set(n),cc(n,1)}))}),(function(e){return cl(e).map((function(e){if(Db(e,t))return cc(t.get(),t.get().length-1);us(t.get());var n=zb(e,!1);return t.set(n),cc(n,n.length-1)}))}),(function(e){us(t.get());var n=Mb(e);return t.set(n),x.some(cc(n,1))}))},Pb=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return x.none()},Ib=mr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Lb=function(t,e){return _s(e,t)||t},Hb=function(t,e,n){var r=qv(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return il(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.before(t)}))}),x.none)},Fb=function(t,e){return null===fl(t,e)},Vb=function(t,e,n){return Uv(t,e,n).filter(d(Fb,e))},jb=function(t,e,n){var r=$v(n);return Vb(t,e,r).bind((function(t){return ul(t,r).isNone()?x.some(Ib.start(t)):x.none()}))},Ub=function(t,e,n){var r=qv(n);return Vb(t,e,r).bind((function(t){return il(t,r).isNone()?x.some(Ib.end(t)):x.none()}))},Wb=function(t,e,n){var r=$v(n),o=Lb(e,r.container());return Uv(t,o,r).fold((function(){return ul(o,r).bind(d(Uv,t,o)).map((function(t){return Ib.after(t)}))}),x.none)},qb=function(t){return!1===(e=Gb(t),"rtl"===Qu.DOM.getStyle(e,"direction",!0)||(n=e.textContent,Vv.test(n)));var e,n},$b=function(t,e,n){return Pb([Hb,jb,Ub,Wb],[t,e,n]).filter(qb)},Gb=function(t){return t.fold(f,f,f,f)},Xb=function(t){return t.fold(l("before"),l("start"),l("end"),l("after"))},Kb=function(t){return t.fold(Ib.before,Ib.before,Ib.after,Ib.after)},Yb=function(t){return t.fold(Ib.start,Ib.start,Ib.end,Ib.end)},Jb=function(t,e,n,r,o,i){return Ra(Uv(e,n,r),Uv(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=_s(e,t),o=_s(n,t);return r&&r===o}(n,e,r)?Ib.after(t?e:r):i})).getOr(i)},Qb=function(t,e){return t.fold(v,(function(t){return r=e,!(Xb(n=t)===Xb(r)&&Gb(n)===Gb(r));var n,r}))},Zb=function(t,e){return t?e.fold(s(x.some,Ib.start),x.none,s(x.some,Ib.after),x.none):e.fold(x.none,s(x.some,Ib.before),x.none,s(x.some,Ib.end))},ty=function(t,e,n,r){var o=Wv(t,r),i=$b(e,n,o);return $b(e,n,o).bind(d(Zb,t)).orThunk((function(){return function(t,e,n,r,o){var i=Wv(t,o);return el(t,n,i).map(d(Wv,t)).fold((function(){return r.map(Kb)}),(function(o){return $b(e,n,o).map(d(Jb,t,e,n,i,o)).filter(d(Qb,r))})).filter(qb)}(t,e,n,i,r)}))},ey=(d(ty,!1),d(ty,!0),function(t,e,n){var r=t?1:-1;return e.setRng(cc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0}),ny=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},ry=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},oy=function(t,e,n){return Bb(e,n).map((function(e){return ny(t,e),n}))},iy=function(t,e,n){return!!Yc(t)&&function(t,e,n){var r=t.getBody(),o=cc.fromRangeStart(t.selection.getRng()),i=d(jv,t);return ty(n,i,r,o).bind((function(n){return oy(t,e,n)}))}(t,e,n).isSome()},uy=function(t,e,n){return!!Yc(e)&&function(t,e){var n=e.selection.getRng(),r=t?cc.fromRangeEnd(n):cc.fromRangeStart(n);return!!function(t){return z(t.selection.getSel().modify)}(e)&&(t&&Jr(r)?ey(!0,e.selection,r):!(t||!Qr(r))&&ey(!1,e.selection,r))}(t,e)},ay=function(t){var e=ra(null),n=d(jv,t);return t.on("NodeChange",(function(r){!Yc(t)||pe.browser.isIE()&&r.initial||(function(t,e,n){var r=V(va(Te(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=W(r,t),i=W(n,t);j(Q(o,i),d(ry,!1)),j(Q(i,o),d(ry,!0))}(n,t.dom,r.parents),function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=cc.fromRangeStart(t.selection.getRng());cc.isTextPosition(n)&&!1===function(t){return Jr(t)||Qr(t)}(n)&&(ny(t,is(e.get(),n)),e.set(null))}}(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=W(r,t);j(o,(function(r){var o=cc.fromRangeStart(e.selection.getRng());$b(t,e.getBody(),o).bind((function(t){return oy(e,n,t)}))}))}}(n,t,e,r.parents))})),e},cy=d(uy,!0),sy=d(uy,!1),ly=function(t,e){return function(n){return Bb(e,n).exists((function(e){return ny(t,e),!0}))}},fy=function(t,e,n,r){var o=t.getBody(),i=d(jv,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),$b(i,o,cc.fromRangeStart(t.selection.getRng())).map(Yb).map(ly(t,e))})),t.nodeChanged()},dy=function(t,e,n){if(t.selection.isCollapsed()&&Yc(t)){var r=cc.fromRangeStart(t.selection.getRng());return function(t,e,n,r){var o=function(t,e){return _s(e,t)||t}(t.getBody(),r.container()),i=d(jv,t),u=$b(i,o,r);return u.bind((function(t){return n?t.fold(l(x.some(Yb(t))),x.none,l(x.some(Kb(t))),x.none):t.fold(x.none,l(x.some(Kb(t))),x.none,l(x.some(Yb(t))))})).map(ly(t,e)).getOrThunk((function(){var a=nl(n,o,r),c=a.bind((function(t){return $b(i,o,t)}));return Ra(u,c,(function(){return Uv(i,o,r).exists((function(e){return!!function(t){return Ra(al(t),cl(t),(function(e,n){var r=Wv(!0,e),o=Wv(!1,n);return il(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(mg(t,n,Te(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?fy(t,e,r,o):fy(t,e,o,r),!0}))}))})).getOr(!1)}))}(t,e,n,r)}return!1},my=function(t){return 1===Ge(t).length},gy=function(t,e){var n=Te(t.getBody()),r=Te(t.selection.getStart()),o=W(function(t,e){var n=Am(e,t);return X(n,Mr).fold(l(n),(function(t){return n.slice(0,t)}))}(n,r),my);return et(o).exists((function(n){var r,i=cc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ra(al(n),cl(n),(function(r,o){var i=Wv(!0,r),u=Wv(!1,o),a=Wv(!1,e);return t?il(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):ul(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,ll(r.dom)&&Jg(r.dom))||(function(t,e,n,r){var o=d(ih,e),i=V(W(r,o),(function(t){return t.dom}));if(0===i.length)mg(e,t,n);else{var u=function(t,e){var n=Zg(!1),r=rh(e,n.dom);return rn(Te(t),n),ln(Te(t)),cc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}}(e,t,n,o),0))}))},hy=function(t,e){return!!t.selection.isCollapsed()&&gy(t,e)},py=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),mg(t,e,Te(n)),!0},vy=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?wm:xm,r=e?ac.Forwards:ac.Backwards,o=Is(r,t.getBody(),t.selection.getRng());return n(o)?py(t,e,o.getNode(!e)):x.from(Wv(e,o)).filter((function(t){return n(t)&&Fs(o,t)})).exists((function(n){return py(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Vn(n)&&py(t,e,n)}(t,e)},by=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},yy=function(t,e){return(t||"table"===Me(e)?"margin":"padding")+("rtl"===Kn(e,"direction")?"-right":"-left")},wy=function(t){var e=Cy(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return Y(e,(function(e){var n=yy(qc(t),e),r=Jn(e,n).map(by).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},xy=function(t){return Pr(t)||Ir(t)},Cy=function(t){return W(V(t.selection.getSelectedBlocks(),Te),(function(t){return!xy(t)&&!function(t){return je(t).map(xy).getOr(!1)}(t)&&br(t,(function(t){return Ln(t.dom)||Hn(t.dom)})).exists((function(t){return Ln(t.dom)}))}))},Sy=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=qc(t),s=zc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),j(Cy(t),(function(t){!function(t,e,n,r,o,i){var u=yy(n,Te(i));if("outdent"===e){var a=Math.max(0,by(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else a=by(i.style[u])+r+o,t.setStyle(i,u,a)}(n,e,c,a,u,t.dom)}))},ky=function(t,e){if(t.selection.isCollapsed()&&wy(t)){var n=t.dom,r=t.selection.getRng(),o=cc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dm(Te(i),o))return Sy(t,"outdent"),!0}return!1},Oy=function(t,e){t.getDoc().execCommand(e,!1,null)},Ty=function(t){return void 0===t.touches||1!==t.touches.length?x.none():x.some(t.touches[0])},_y=function(t,e){return t.hasOwnProperty(e.nodeName)},Ey=function(t,e){return!!Mn(e)||!!kn(e)&&!_y(t,e)&&!wl(e)},Ay=function(t,e){if(Mn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||_y(t,e.nextSibling)))return!0}return!1},Ny=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=zc(t);if(c&&kn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return F(Em(Te(n),Te(e)),(function(e){return _y(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=Nd(t);for(c=s.firstChild;c;)if(Ey(a,c)){if(Ay(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,Dc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},Ry=function(t,e){e.hasAttribute("data-mce-caret")&&(eo(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},My=function(t,e){var n=function(t){return wr(Te(t.getBody()),"*[data-mce-caret]").fold(l(null),(function(t){return t.dom}))}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Ry(t,n)):void(Yr(n)&&(Ry(t,n),t.undoManager.add()))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(Av||(Av={}));var zy,Dy=function(t,e){return t===ac.Backwards?J(e):e},By=function(t,e,n){return t===ac.Forwards?e.next(n):e.prev(n)},Py=function(t,e,n,r){return Pn(r.getNode(e===ac.Forwards))?Av.Br:!1===Es(n,r)?Av.Block:Av.Wrap},Iy=function(t,e,n,r){for(var o,i=Js(n),u=r,a=[];u&&(o=By(e,i,u));){if(Pn(o.getNode(!1)))return e===ac.Forwards?{positions:Dy(e,a).concat([o]),breakType:Av.Br,breakAt:x.some(o)}:{positions:Dy(e,a),breakType:Av.Br,breakAt:x.some(o)};if(o.isVisible()){if(t(u,o)){var c=Py(0,e,u,o);return{positions:Dy(e,a),breakType:c,breakAt:x.some(o)}}a.push(o),u=o}else u=o}return{positions:Dy(e,a),breakType:Av.Eol,breakAt:x.none()}},Ly=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===ac.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Hy=function(t,e){return $(t,(function(t,n){return t.fold((function(){return x.some(n)}),(function(r){return Ra(tt(r.getClientRects()),tt(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),x.none())},Fy=function(t,e){return tt(e.getClientRects()).bind((function(e){return Hy(t,e.left)}))},Vy=d(Iy,uc.isAbove,-1),jy=d(Iy,uc.isBelow,1),Uy=d(Ly,-1,Vy),Wy=d(Ly,1,jy),qy=function(t){var e=function(e){return V(e,(function(e){return(e=za(e)).node=t,e}))};if(kn(t))return e(t.getClientRects());if(Mn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},$y=function(t){return K(t,qy)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(zy||(zy={}));var Gy,Xy,Ky=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i,c,l;for(l=$y([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(c=l[i],!n(c,s)){if(a.length>0&&e(c,Ct(a))&&u++,c.line=u,o(c))return!0;a.push(c)}},s=Ct(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Ts(r,t,mo,e);)if(n(r))return}(t,r,c,l),a},Yy=d(Ky,zy.Up,Pa,Ia),Jy=d(Ky,zy.Down,Ia,Pa),Qy=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Zy=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},tw=Hn,ew=Ts,nw=function(t,e){return Math.abs(t.left-e)},rw=function(t,e){return Math.abs(t.right-e)},ow=function(t,e){return t>=e.left&&t<=e.right},iw=function(t,e){return t>=e.top&&t<=e.bottom},uw=function(t,e){return wt(t,(function(t,n){var r=Math.min(nw(t,e),rw(t,e)),o=Math.min(nw(n,e),rw(n,e));return ow(e,n)?n:ow(e,t)?t:o===r&&tw(n.node)||o<r?n:t}))},aw=function(t,e,n,r,o){var i=ew(r,t,mo,e,!o);do{if(!i||n(i))return}while(i=ew(i,t,mo,e))},cw=function(t,e){t.selection.setRng(e),ud(t,t.selection.getRng())},sw=function(t,e,n){return x.some(gb(t,e,n))},lw=function(t,e,n,r,o,i){var u=e===ac.Forwards,a=Js(t.getBody()),c=d(Hs,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Ha(n);if(i(l))return fb(e,t,l,e===ac.Backwards,!1)}var f=Is(e,t.getBody(),n);if(s(f))return db(t,f.getNode(!u));var m=Wv(u,c(f)),g=function(t){return Gr(t.startContainer)}(n);if(!m)return g?x.some(n):x.none();if(s(m))return fb(e,t,m.getNode(!u),u,!1);var h=c(m);return h&&s(h)&&Fs(m,h)?fb(e,t,h.getNode(!u),u,!1):g?sw(t,m.toRange(),!1):x.none()},fw=function(t,e,n,r,o,i){var u=Is(e,t.getBody(),n),a=Ct(u.getClientRects()),c=e===zy.Down;if(!a)return x.none();var s,l=(c?Jy:Yy)(t.getBody(),Qy(1),u),f=W(l,Zy(1)),d=a.left,m=uw(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return fb(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Ha(n)){var p=function(t,e,n,r){var o,i,u,a,c,s=Js(e),l=[],f=0,d=function(t){return Ct(t.getClientRects())};1===t?(o=s.next,i=Ia,u=Pa,a=cc.after(r)):(o=s.prev,i=Pa,u=Ia,a=cc.before(r));var m=d(a);do{if(a.isVisible()&&!u(c=d(a),m)){if(l.length>0&&i(c,Ct(l))&&f++,(c=za(c)).position=a,c.line=f,n(c))return l;l.push(c)}}while(a=o(a));return l}(e,t.getBody(),Qy(1),s),v=uw(W(p,Zy(1)),d);if(v)return sw(t,v.position.toRange(),!1);if(v=Ct(W(p,Zy(0))))return sw(t,v.position.toRange(),!1)}return 0===f.length?dw(t,c).filter(c?o:r).map((function(e){return gb(t,e.toRange(),!1)})):x.none()},dw=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=cc.fromRangeEnd(n),i=jy(r,o);return et(i.positions)}return o=cc.fromRangeStart(n),i=Vy(r,o),tt(i.positions)},mw=function(t,e,n){return dw(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},gw=Hn,hw=function(t,e,n){var r=Js(t.getBody()),o=d(Hs,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==zc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(cc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(zc(t));return(!pe.ie||pe.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},pw=function(t,e){return function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return function(t,e,n){return lw(e,t,n,km,Om,gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},vw=function(t,e){return function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return fw(e,t,n,(function(t){return km(t)||Cm(t)}),(function(t){return Om(t)||Sm(t)}),gw)}(n,t,r).orThunk((function(){return hw(t,n,r),x.none()}))}(t,e).exists((function(e){return cw(t,e),!0}))},bw=function(t,e){return mw(t,e,e?Om:km)},yw=function(t){return H(["figcaption"],Me(t))},ww=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},xw=function(t,e,n){n?an(t,e):un(t,e)},Cw=function(t,e){var n=Te(t.getBody()),r=cc.fromRangeStart(t.selection.getRng()),o=zc(t),i=Dc(t);return function(t,e){var n=d(Ne,e);return br(Te(t.container()),Mr,n).filter(yw)}(r,n).exists((function(){if(function(t,e,n){return e?function(t,e){return jy(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Vy(t,e).breakAt.isNone()}(t.dom,n)}(n,e,r)){var u=function(t,e,n,r){return""===e?function(t,e){var n=ke("br");return xw(t,n,e),ww(n)}(t,r):function(t,e,n,r){var o=ke(n),i=ke("br");return qn(o,r),an(o,i),xw(t,o,e),ww(i)}(t,r,e,n)}(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},Sw=function(t,e){return!!t.selection.isCollapsed()&&Cw(t,e)},kw=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},Ow=function(t,e){return G(function(t,e){return K(function(t){return V(t,(function(t){return St({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:c},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))}(t,e),(function(t){return t.action()}))},Tw=function(t,e){var n=e?ac.Forwards:ac.Backwards,r=t.selection.getRng();return lw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},_w=function(t,e){var n=e?1:-1,r=t.selection.getRng();return fw(t,n,r,wm,xm,Vn).exists((function(e){return cw(t,e),!0}))},Ew=function(t,e){return mw(t,e,e?xm:wm)},Aw=function(t,e,n,r,o){var i=va(Te(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return $(t,(function(t,r){return t.fold((function(){return x.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return x.some(i<o?r:t)}))}),x.none())}(W(function(t,e){return K(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+-2,bottom:t.bottom+-2,width:t.width+e,height:t.height+e}}(za(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},Nw=d(Aw,(function(t){return t.bottom}),(function(t,e){return t.y<e})),Rw=d(Aw,(function(t){return t.top}),(function(t,e){return t.y>e})),Mw=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===Av.Wrap&&0===t.positions.length}(r)||!Pn(n.getNode())&&function(t){return t.breakType===Av.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},zw=d(Mw,Vy),Dw=d(Mw,jy),Bw=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!ms()||!function(t,e,n){var r=cc.fromRangeStart(e);return ol(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n)||(fb(i,t,n,!e,!1).each((function(e){cw(t,e)})),0))},Pw=function(t,e,n){var r=function(t,e){var n=e.getNode(t);return kn(n)&&"TABLE"===n.nodeName?x.some(n):x.none()}(!!e,n),o=!1===e;r.fold((function(){return cw(t,n.toRange())}),(function(r){return ol(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return cw(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=zc(e);o?e.undoManager.transact((function(){var r=ke(o);qn(r,Dc(e)),an(r,ke("br")),t?on(Te(n),r):rn(Te(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),cw(e,i)})):cw(e,r.toRange())}(e,t,r,n)}))}))},Iw=function(t,e,n,r){var o=t.selection.getRng(),i=cc.fromRangeStart(o),u=t.getBody();if(!e&&zw(r,i)){var a=function(t,e,n){return function(t,e){return tt(e.getClientRects()).bind((function(e){return Nw(t,e.left,e.top)})).bind((function(t){return Fy(cl(n=t).map((function(t){return Vy(n,t).positions.concat(t)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Uy(t,cc.before(e)),n.left)}))})).getOr(cc.before(e))}(u,n,i);return Pw(t,e,a),!0}return!(!e||!Dw(r,i))&&(a=function(t,e,n){return function(t,e){return et(e.getClientRects()).bind((function(e){return Rw(t,e.left,e.top)})).bind((function(t){return Fy(al(n=t).map((function(t){return[t].concat(jy(n,t).positions)})).getOr([]),e);var n}))}(e,n).orThunk((function(){return tt(n.getClientRects()).bind((function(n){return Hy(Wy(t,cc.after(e)),n.left)}))})).getOr(cc.after(e))}(u,n,i),Pw(t,e,a),!0)},Lw=function(t,e,n){return x.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return x.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},Hw=function(t,e){return Lw(t,e,Bw)},Fw=function(t,e){return Lw(t,e,Iw)},Vw=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(Vr),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Ar(e,e);n=c.current();){if(Mn(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Pn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),ud(t,a)}},jw=function(t){return x.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},Uw=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},Ww=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},qw=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},$w=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!kn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},Gw=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},Xw=function(t){t.innerHTML='<br data-mce-bogus="1">'},Kw=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},Yw=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},Jw=function(t,e,n){return!1===Mn(e)?n:t?1===n&&e.data.charAt(n-1)===jr?0:n:n===e.data.length-1&&e.data.charAt(n)===jr?e.data.length:n},Qw=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Zw=function(t,e){var n=zc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;x.from(n.style).map(r.parseStyle).each((function(t){var n=Qn(Te(e)),o=St(St({},n),t);r.setStyles(e,o)}));var o=x.from(n.class).map((function(t){return t.split(/\s+/)})),i=x.from(e.className).map((function(t){return W(t.split(/\s+/),(function(t){return""!==t}))}));Ra(o,i,(function(t,n){var o=W(n,(function(e){return!H(t,e)})),i=kt(t,o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=ft(n,(function(t,e){return!H(u,e)}));r.setAttribs(e,a)}(t,e,Dc(t))},tx=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(ll(a)||wl(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return Zw(t,n),Xw(u),n},v=function(t){var e,n,u=Jw(t,r,o);if(Mn(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&kn(r)&&r===i.firstChild)return!0;if(Kw(r,"TABLE")||Kw(r,"HR"))return f&&!t||!f&&t;var a=new Ar(r,i);for(Mn(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(kn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Mn(e)&&!ho(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&Yw(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),Vw(t,u)};Pf(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=zc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);kn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Mn(r)?r.nodeValue.length:0);var x=Qw(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=Qw(d,r);if(!(u=d.getParent(r,d.isBlock))||!Yw(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),Zw(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),Zw(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;Ww(a=n)&&Ww(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if($w(n,r,!0)&&$w(n,r,!1))Uw(n,"LI")?i.insertAfter(c,qw(n)):i.replace(c,n);else if($w(n,r,!0))Uw(n,"LI")?(i.insertAfter(c,qw(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n);else if($w(n,r,!1))i.insertAfter(c,qw(n));else{n=qw(n);var s=u.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var l=s.extractContents();"LI"===o&&function(t,e){return t.firstChild&&"LI"===t.firstChild.nodeName}(l)?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n))}i.remove(r),Vw(t,c)}}(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Gr(i)?(u=eo(i),d.isEmpty(i)&&Xw(i),Zw(t,u),Vw(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),Vw(t,Kw(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,Jw(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,Jw(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){j(pa(Te(t),Pe),(function(t){var e=t.dom;e.nodeValue=Wr(e.nodeValue)}))}(a=n.extractContents()),function(t){do{Mn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;kn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||Gw(t,o))&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&Xw(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(Zw(t,u),Vw(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},ex=function(t,e,n){var r=t.create("span",{}," ");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},nx=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},rx=function(t,e){var n=ke("br");rn(Te(e),n),t.undoManager.add()},ox=function(t,e){ix(t.getBody(),e)||on(Te(e),ke("br"));var n=ke("br");on(Te(e),n),ex(t.dom,t.selection,n.dom),nx(t.dom,t.selection,n.dom,!1),t.undoManager.add()},ix=function(t,e){return n=cc.after(e),!!Pn(n.getNode())||il(t,cc.after(e)).map((function(t){return Pn(t.getNode())})).getOr(!1);var n},ux=function(t){return t&&"A"===t.nodeName&&"href"in t},ax=function(t){return t.fold(p,ux,ux,p)},cx=function(t,e){e.fold(c,d(rx,t),d(ox,t),c)},sx=function(t,e){var n=function(t){var e=d(jv,t),n=cc.fromRangeStart(t.selection.getRng());return $b(e,t.getBody(),n).filter(ax)}(t);n.isSome()?n.each(d(cx,t)):function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();Pf(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Ar(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),lc(i,u,n),ex(i,o,n),nx(i,o,n,r),t.undoManager.add()}(t,e)},lx=function(t,e){return jw(t).filter((function(t){return e.length>0&&Ee(Te(t),e)})).isSome()},fx=mr([{br:[]},{block:[]},{none:[]}]),dx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},mx=function(t){return function(e,n){return""===zc(e)===t}},gx=function(t){return function(e,n){return function(t){return jw(t).filter((function(t){return Ir(Te(t))})).isSome()}(e)===t}},hx=function(t,e){return function(n,r){return function(t){return jw(t).fold(l(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},px=function(t){return hx("pre",t)},vx=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},bx=function(t,e){return function(t){return lx(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},yx=function(t,e){return e},wx=function(t){var e=zc(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},xx=function(t,e){return function(n,r){return $(t,(function(t,e){return t&&e(n,r)}),!0)?x.some(e):x.none()}},Cx=function(t,e){(function(t,e){return Pb([xx([dx],fx.none()),xx([hx("summary",!0)],fx.br()),xx([px(!0),vx(!1),yx],fx.br()),xx([px(!0),vx(!1)],fx.block()),xx([px(!0),vx(!0),yx],fx.block()),xx([px(!0),vx(!0)],fx.br()),xx([gx(!0),yx],fx.br()),xx([gx(!0)],fx.block()),xx([mx(!0),yx,wx],fx.block()),xx([mx(!0)],fx.br()),xx([bx],fx.br()),xx([mx(!1),yx],fx.br()),xx([wx],fx.block())],[t,!(!e||!e.shiftKey)]).getOr(fx.none())})(t,e).fold((function(){sx(t,e)}),(function(){tx(t,e)}),c)},Sx=ae().browser,kx=function(t,e){var n=e.container(),r=e.offset();return Mn(n)?(n.insertData(r,t),x.some(uc(n,r+t.length))):Ls(e).map((function(n){var r=Oe(t);return e.isAtEnd()?on(n,r):rn(n,r),uc(r.dom,t.length)}))},Ox=d(kx,Vr),Tx=d(kx," "),_x=function(t,e){return function(n){return function(t,e){return!Xm(e)&&(function(t,e){return function(t,e){return ul(t.dom,e).isNone()}(t,e)||function(t,e){return il(t.dom,e).isNone()}(t,e)||Dm(t,e)||Bm(t,e)||Vm(t,e)||Fm(t,e)}(t,e)||$m(t,e)||Gm(t,e))}(t,n)?Ox(e):Tx(e)}},Ex=function(t){var e=cc.fromRangeStart(t.selection.getRng()),n=Te(t.getBody());if(t.selection.isCollapsed()){var r=d(jv,t),o=cc.fromRangeStart(t.selection.getRng());return $b(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return ul(t.dom,cc.before(e))}),(function(t){return al(t)}),(function(t){return cl(t)}),(function(e){return il(t.dom,cc.after(e))}))}}(n)).bind(_x(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},Ax=function(t){var e=ay(t);return function(t){t.on("keyup compositionstart",d(My,t))}(t),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ae().os;Ow([{keyCode:Cf.RIGHT,action:kw(pw,t,!0)},{keyCode:Cf.LEFT,action:kw(pw,t,!1)},{keyCode:Cf.UP,action:kw(vw,t,!1)},{keyCode:Cf.DOWN,action:kw(vw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Hw,t,!0)},{keyCode:Cf.LEFT,action:kw(Hw,t,!1)},{keyCode:Cf.UP,action:kw(Fw,t,!1)},{keyCode:Cf.DOWN,action:kw(Fw,t,!0)},{keyCode:Cf.RIGHT,action:kw(Tw,t,!0)},{keyCode:Cf.LEFT,action:kw(Tw,t,!1)},{keyCode:Cf.UP,action:kw(_w,t,!1)},{keyCode:Cf.DOWN,action:kw(_w,t,!0)},{keyCode:Cf.RIGHT,action:kw(iy,t,e,!0)},{keyCode:Cf.LEFT,action:kw(iy,t,e,!1)},{keyCode:Cf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(cy,t,e)},{keyCode:Cf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:kw(sy,t,e)},{keyCode:Cf.UP,action:kw(Sw,t,!1)},{keyCode:Cf.DOWN,action:kw(Sw,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))}(t,e),function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){Ow([{keyCode:Cf.BACKSPACE,action:kw(ky,t,!1)},{keyCode:Cf.BACKSPACE,action:kw(kb,t,!1)},{keyCode:Cf.DELETE,action:kw(kb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(bb,t,!1)},{keyCode:Cf.DELETE,action:kw(bb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(dy,t,e,!1)},{keyCode:Cf.DELETE,action:kw(dy,t,e,!0)},{keyCode:Cf.BACKSPACE,action:kw(Bg,t,!1)},{keyCode:Cf.DELETE,action:kw(Bg,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(Ob,t,!1)},{keyCode:Cf.DELETE,action:kw(Ob,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(vy,t,!1)},{keyCode:Cf.DELETE,action:kw(vy,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(cb,t,!1)},{keyCode:Cf.DELETE,action:kw(cb,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(ib,t,!1)},{keyCode:Cf.DELETE,action:kw(ib,t,!0)},{keyCode:Cf.BACKSPACE,action:kw(hy,t,!1)},{keyCode:Cf.DELETE,action:kw(hy,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.BACKSPACE,action:kw(Sb,t)},{keyCode:Cf.DELETE,action:kw(Sb,t)}],e)}(t,e)}))}(t,e),function(t){t.on("keydown",(function(e){e.keyCode===Cf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Cx(t,e)})))}(t,e)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.SPACEBAR,action:kw(Ex,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),function(t){!function(t){var e=la((function(){t.composing||eg(t)}),0);Sx.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&eg(t)}))}(t),function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ow([{keyCode:Cf.END,action:kw(bw,t,!0)},{keyCode:Cf.HOME,action:kw(bw,t,!1)},{keyCode:Cf.END,action:kw(Ew,t,!0)},{keyCode:Cf.HOME,action:kw(Ew,t,!1)}],e).each((function(t){e.preventDefault()}))}(t,e)}))}(t),e},Nx=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&_f(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!pe.range&&t.selection.isCollapsed()||lf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&lf(t)&&("IMG"===t.selection.getNode().nodeName?Tr.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Rx=function(t){return kn(t)&&Br(Te(t))},Mx=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},zx=Hn,Dx=Ln,Bx=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},Px=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},Ix=function(t){t.on((function(t){Px(t.ghost)})),t.clear()},Lx=function(t){var e,n=(e=ra(x.none()),{clear:function(){return e.set(x.none())},set:function(t){return e.set(x.some(t))},isSet:function(){return e.get().isSome()},on:function(t){return e.get().each(t)}}),r=Qu.DOM,o=document,i=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=G(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(zx,Dx)).getOr(null);if(a=e.getBody(),zx(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Bx(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}}(n,t),u=function(t,e){var n=Tr.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,function(t,e){return n=function(t){return t.inline?Mx(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Mx(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o}(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(n,t),a=function(t,e){return function(n){t.on((function(t){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!zx(e)}(e,3===(i=e.selection.getSel().getRangeAt(0).startContainer).nodeType?i.parentNode:i,t.element)){var r=((o=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),o);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Px(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var o,i})),Ix(t)}}(n,t),c=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Ix(t)}}(n,t);t.on("mousedown",i),t.on("mousemove",u),t.on("mouseup",a),r.bind(o,"mousemove",u),r.bind(o,"mouseup",c),t.on("remove",(function(){r.unbind(o,"mousemove",u),r.unbind(o,"mouseup",c)}))},Hx=Ln,Fx=Hn,Vx=function(t,e){return wf(t.getBody(),e)},jx=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=ds(t,i,o,(function(){return Nd(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Fx(t)||Vn(t))&&r.isChildOf(t,i)},l=function(t){t&&n.setRng(t)},f=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},g=function(t){return Kr(t)||Zr(t)||to(t)},h=function(t){return g(t.startContainer)||g(t.endContainer)},p=function(o,u){if(!o)return null;if(o.collapsed){if(!h(o)){var l=u?1:-1,f=Is(l,i,o),d=f.getNode(!u);if(hs(d))return m(l,d,!!u&&!f.isAtEnd(),!1);var g=f.getNode(u);if(hs(g))return m(l,g,!u&&!f.isAtEnd(),!1)}return null}var p=o.startContainer,v=o.startOffset,y=o.endOffset;if(3===p.nodeType&&0===v&&Fx(p.parentNode)&&(p=p.parentNode,v=r.nodeIndex(p),p=p.parentNode),1!==p.nodeType)return null;if(y===v+1&&p===o.endContainer){var w=p.childNodes[v];if(s(w))return function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var s=function(e,o,i){var u=t.$,c=wr(Te(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&pe.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(Vr).append(o).append(Vr),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),l=Te(o);return j(va(Te(t.getBody()),"*[data-mce-selected]"),(function(t){Ne(l,t)||Xn(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,b(),s}(w)}return null},v=function(){e&&e.removeAttribute(c),wr(Te(t.getBody()),"#"+a).each(ln),e=null},b=function(){u.hide()};return pe.ceFalse&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&hv(t,e.clientX,e.clientY)&&mb(t,n,!1).each(l)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Fx(o)&&(e.preventDefault(),t.focus()),Hx(o)&&r.isChildOf(o,n.getNode())&&v())})),t.on("blur NewBlock",v),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var c=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!(!a||e===c||!r.isChildOf(a,c)||!1!==Fx(Vx(t,a)))||a&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=Js(t);if(!t.firstChild)return!1;var n,r=cc.before(t.firstChild),o=e.next(r);return o&&!(km(n=o)||Om(n)||wm(n)||xm(n))}(a)};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Fx(r)?(e.preventDefault(),db(t,r).each(p)):s(n)&&db(t,n).each(p)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hv(t,e.clientX,e.clientY)){var u=Vx(t,o);if(u)Fx(u)?(e.preventDefault(),db(t,u).each(p)):(v(),Hx(u)&&e.shiftKey||xf(e.clientX,e.clientY,n.getRng())||(b(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))db(t,o).each(p);else if(!1===hs(o)){v(),b();var a=function(t,e,n){var r=$y(function(t){return W(nt(t.getElementsByTagName("*")),hs)}(t)),o=W(r,d(iw,n)),i=uw(o,e);if(i){var u=!An(i.node)&&!Vn(i.node);if((i=uw(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=W($y([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),aw(zy.Up,t,d(o,Pa),e.node,n),aw(zy.Down,t,d(o,Ia),e.node,n),r}(t,i,u),e))&&hs(i.node))return function(t,e){return{node:t.node,before:nw(t,e)<rw(t,e)}}(i,e)}return null}(i,e.clientX,e.clientY);if(a&&!c(o,a.node)){e.preventDefault();var f=m(1,a.node,a.before,!1);t.getBody().focus(),l(f)}}}})),t.on("keypress",(function(t){Cf.modifierPressed(t)||Fx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(e){e.range=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return mt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),mt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o}(e.range);var n=p(e.range,e.forward);n&&(e.range=n)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;h(n)||"mcepastebin"===o.id||b(),e=o,r.hasClass(e,"mce-offscreen-selection")||v()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!pe.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),function(t){Lx(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(zx(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.defaultPrevented){var n=e.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&xv(t,"Dropped file type is not supported"))}},n=function(n){Od(t,n.target)&&e(n)},r=function(){var r=Qu.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];j(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){j(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){Tr.setEditorTimeout(t,r,0)}))}(t)}(t),function(t){var e=la((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=gb(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Vn(n)){var r=wf(t.getBody(),n),o=Hn(r)?r:n;t.selection.getNode()!==o&&db(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(eo(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:b,destroy:function(){u.destroy(),e=null}}},Ux=Qu.DOM,Wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},qx=function(t){return ft(t,(function(t){return!1===N(t)}))},$x=function(t){var e=t.settings,n=t.editorUpload.blobCache;return qx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Wx(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},Gx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),function(t){var e=t.dom.getRoot();t.inline||lf(t)&&t.selection.getStart(!0)!==e||al(e).each((function(e){var n=e.getNode(),r=An(n)?al(n).getOr(e):e;pe.browser.isIE()?function(t,e){var n=Te(t.getBody()),r=(vd(t)?x.from(e):x.none()).map(bd).filter(pd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))}(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Tr.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Xx=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,Ux.setAttrib(o,"spellcheck","false")),t.quirks=function(t){var e,n,r,o=xe.each,i=Cf.BACKSPACE,u=Cf.DELETE,a=t.dom,c=t.selection,s=t.parser,l=pe.gecko,f=pe.ie,d=pe.webkit,m="data:text/mce-internal,",g=f?"Text":"URL",h=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},p=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",(function(t){if(!p(t)&&t.keyCode===i&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(pe.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))};return t.on("keydown",(function(e){var n,r;if(!p(e)&&e.keyCode===Cf.BACKSPACE){var o=(n=c.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),c.setRng(n))}}})),e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",(function(n){var r,o,c=n.keyCode;if(!p(n)&&(c===u||c===i)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!a.isEmpty(o))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),o.firstChild&&a.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}})),pe.windowsPhone||t.on("keyup focusin mouseup",(function(t){Cf.modifierPressed(t)||c.normalize()}),!0),d&&(t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Kr(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)})),t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))})),zc(t)&&t.on("init",(function(){h("DefaultParagraphSeparator",zc(t))})),t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))})),b(),s.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),pe.iOS?(t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()})),y(),t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),pe.ie>=11&&(y(),b()),pe.ie&&(v(),h("AutoUrlDetect",!1),t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&c.select(e.target),(n=t.selection.getContent()).length>0&&(r=m+escape(t.id)+","+escape(n),e.dataTransfer.setData(g,r)))}(e)})),t.on("drop",(function(e){if(!p(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(g))&&e.indexOf(m)>=0?(e=e.substr(m.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Tf(e.x,e.y,t.getDoc());c.setRng(r),o=n.html,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:!0}):t.execCommand("mceInsertContent",!1,o)}}var o}))),l&&(t.on("keydown",(function(e){if(!p(e)&&e.keyCode===i){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!p(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Tr.setEditorTimeout(t,(function(){n.focus()}))}})),n=function(){var e=a.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),o(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!c.isCollapsed()&&a.getParent(c.getStart(),a.isBlock)!==a.getParent(c.getEnd(),a.isBlock)},t.on("keypress",(function(e){var o;if(!p(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(e){var o;!p(e)&&r()&&(o=n(),Tr.setEditorTimeout(t,(function(){o()})))})),function(t){return t.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",(function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),$c(t)||h("enableObjectResizing",!1)})),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||o(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))})),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),pe.mac&&t.on("keydown",(function(e){!Cf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})),b()),{refreshContentEditable:function(){},isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}}(t),function(t){t.fire("PostRender")}(t);var i=function(t){return t.getParam("directionality",aa.isRtl()?"rtl":void 0)}(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",(function(t){xe.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),t.contentStyles.length>0){var u="";xe.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}!function(t,e){var n=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader}(t),r=function(){t.on("remove",(function(){return n.unloadAll(e)})),Gx(t)};n.loadAll(e,r,r)}(t,t.contentCSS),n.content_style&&function(t,e){var n=Te(t.getBody()),r=en(tn(n)),o=ke("style");Wn(o,"type","text/css"),an(o,Oe(e)),an(r,o),t.on("remove",(function(){ln(o)}))}(t,n.content_style)},Kx=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Ux.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Ux.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=function(t){var e,n,r,o,i,u=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||Ev("blobid"),r=t.name||n,o=t.blob;return{id:l(n),name:l(r),filename:l(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:l(o),base64:l(t.base64),blobUri:l(t.blobUri||URL.createObjectURL(o)),uri:l(t.uri)}},n=function(e){return G(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(O(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(T(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=W(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){j(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),a=(r={},o=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:i=function(t){return t in r},getResultUri:function(t){var e=r[t];return e?e.resultUri:null},isPending:function(t){return!!i(t)&&1===r[t].status},isUploaded:function(t){return!!i(t)&&2===r[t].status},markPending:function(t){r[t]=o(1,null)},markUploaded:function(t,e){r[t]=o(2,e)},removeFailed:function(t){delete r[t]},destroy:function(){r={}}}),c=[],s=function(t){var e=ra(null);return t.on("change AddUndo",(function(t){e.set(St({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;et(n).filter((function(t){return!ap(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:Z(n,n.length-2).getOrNull()})}))}}}(t),f=function(e){return function(n){return t.selection?e(n):[]}},d=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},m=function(t,e,n){var r='src="'+n+'"'+(n===pe.transparentSrc?' data-mce-placeholder="1"':"");return t=d(t,'src="'+e+'"',r),d(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},g=function(e,n){j(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=V(t.fragments,(function(t){return m(t,e,n)})):t.content=m(t.content,e,n)}))},h=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},p=function(n){return e||(e=Tv(a,{url:Lc(t),basePath:Hc(t),credentials:Fc(t),handler:Vc(t)})),w().then(f((function(r){var o=V(r,(function(t){return t.blobInfo}));return e.upload(o,h).then(f((function(e){var o=[],i=V(e,(function(e,n){var i=r[n].blobInfo,a=r[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(u.removeByUri(a.src),function(e,n){var r,o=t.convertURL(n,"src");g(e.src,n),t.$(e).attr({src:Pc(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(a,e.url)):e.error&&(e.error.options.remove&&(g(a.getAttribute("src"),pe.transparentSrc),o.push(a)),function(t,e){xv(t,aa.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:i}}));return i.length>0&&s.fireIfChanged(),o.length>0&&(gp(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){j(o,(function(e){t.dom.remove(e),u.removeByUri(e.src)}))}))),n&&n(i),i})))})))},b=function(e){if(Bc(t))return p(e)},y=function(e){return!1!==Y(c,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",v,"function")}(t)(e))},w=function(){return n||(n=Ap(a,u)),n.findAll(t.getBody(),y).then(f((function(e){return e=W(e,(function(e){return"string"!=typeof e||(xv(t,e),!1)})),j(e,(function(t){g(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=a.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=$(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){Bc(t)?b():w()})),t.on("RawSaveContent",(function(t){t.content=x(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=x(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){j(t,(function(t){var e=t.attr("src");if(!u.getByUri(e)){var n=a.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:u,addFilter:function(t){c.push(t)},uploadImages:p,uploadImagesAuto:b,scanForImages:w,destroy:function(){u.destroy(),a.destroy(),n=e=null}}}(t),t.schema=Go(n),t.dom=Qu(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:jc(t),referrerPolicy:Uc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Hp($x(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Jd("br",1)).shortEnded=!0)}})),e}(t),t.serializer=jp(function(t){var e=t.settings;return St(St({},$x(t)),qx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=Cp(t.dom,t.getWin(),t.serializer,t),t.annotator=vf(t),t.formatter=Bv(t),t.undoManager=Pv(t),t._nodeChangeDispatcher=new Nx(t),t._selectionOverrides=jx(t),function(t){var e=ra(x.none()),n=ra(!1),r=fa((function(e){t.fire("longpress",St(St({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){Ty(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(x.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),Ty(o).each((function(r){e.get().each((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.set(x.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",St(St({},o),{type:"tap"}))}))}),!0)}(t),function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){j(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){j(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",O(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)}(t),gp(t)||function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=uc.fromRangeStart(e),r=uc.fromRangeEnd(e);if(uc.isElementPosition(n)){var o=n.container();Rx(o)&&al(o).each((function(t){return e.setStart(t.container(),t.offset())}))}uc.isElementPosition(r)&&(o=n.container(),Rx(o)&&cl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))),t.selection.setRng(Pg(e))}(t)}))}(t);var u=function(t){return gp(t)?ra(null):Ax(t)}(t);(function(t,e){t.addCommand("delete",(function(){!function(t,e){ky(t)||kb(t,!1)||bb(t,!1)||dy(t,e,!1)||ib(t,!1)||Bg(t)||Ob(t,!1)||vy(t,!1)||cb(t)||hy(t,!1)||(Oy(t,"Delete"),Xv(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){kb(t,!0)||bb(t,!0)||dy(t,e,!0)||ib(t,!0)||Bg(t)||Ob(t,!0)||vy(t,!0)||cb(t)||hy(t,!0)||Oy(t,"ForwardDelete")}(t,e)}))})(t,u),function(t){zc(t)&&t.on("NodeChange",d(Ny,t))}(t),function(t){var e=t.dom,n=zc(t),r=function(t){return t.getParam("placeholder",Nc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(Hv(t)){var e=t.keyCode;return!Fv(t)&&(Cf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||H(Iv,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return Hv(t)&&!(Fv(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(wo(Te(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,Lv)!==c||u)&&(e.setAttrib(a,Lv,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Tr.setEditorTimeout(t,(function(){return o(e)}))}))}))}(t),function(t){t.fire("PreInit")}(t),function(t){var e=t;return dt(t.plugins,"rtc").fold((function(){return e.rtcInstance=mp(t),x.none()}),(function(n){return x.some(n.setup().then((function(n){return e.rtcInstance=function(t,e){var n=function(t){return T(t)?t:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:c,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{match:function(t,r,o){return e.matchFormat(t,n(r))},matchAll:r,matchNode:r,canApply:function(t){return e.canApplyFormat(t)},closest:function(t){return e.closestFormat(t)},apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))},formatChanged:function(t,n,r,o){return e.formatChanged(n,r,o)}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=tm({inner:!0});return dp(t,o),"tree"===r?o:i.serialize(o)}return mp(t).editor.getContent(n,r)},setContent:function(n,r){var o=fp(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o,i=(o=t,x.from(o.selection.getStart(!0)).map((function(t){return t.nodeName.toLowerCase()}))).fold((function(){return{}}),(function(t){return{context:t}})),u=fp(n)?n:t.parser.parse(n,St(St({},i),{insert:!0}));e.insertContent(u)},addVisual:function(t){}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=tm({});return dp(t,o),"tree"===n?o:i.serialize(o)}return mp(t).selection.getContent(n,r)}},raw:{getModel:function(){return x.some(e.getRawModel())}}}}(t,n),n.isRemote})))}))}(t).fold((function(){Xx(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),Xx(t,e)}))}))},Yx=Qu.DOM,Jx=function(t,e){var n=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),r=function(t,e,n,r){var o=ke("iframe");return qn(o,r),qn(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),ga(o,"tox-edit-area__iframe"),o}(t.id,n,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom;r.onload=function(){r.onload=null,t.fire("load")};var o=function(t,e){if(document.domain!==window.location.hostname&&pe.browser.isIE()){var n=Ev("mce");t[n]=function(){Kx(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Yx.setAttrib(e,"src",r),!0}return!1}(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return Rc(t,"body_id","tinymce")}(t),r=function(t){return Rc(t,"body_class","")}(t);return Mc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Mc(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'}(t),Yx.add(e.iframeContainer,r),o},Qx=Qu.DOM,Zx=function(t,e,n){var r=vv.get(n),o=vv.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=xe.trim(n),r&&-1===xe.inArray(e,n)){if(xe.each(vv.dependencies(n),(function(n){Zx(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=aa.translate(["Failed to initialize plugin: {0}",e]);Ov(r,n),xv(t,r)}(t,n,e)}}},tC=function(t){return t.replace(/^\-/,"")},eC=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},nC=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,O(Xc(t))?function(t){return t.theme.renderUI()}(t):z(Xc(t))?function(t){var e=t.getElement(),n=Xc(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):function(t){var e=t.getElement();return t.inline?eC(null):function(t){var e=Qx.create("div");return Qx.insertAfter(e,t),eC(e)}(e)}(t)},rC=function(t){t.fire("ScriptsLoaded"),function(t){var e=xe.trim(Ic(t)),n=t.ui.registry.getAll().icons,r=St(St({},cv.get("default").icons),cv.get(e).icons);it(r,(function(e,r){mt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=Xc(t);if(O(e)){t.settings.theme=tC(e);var n=bv.get(e);t.theme=new n(t,bv.urls[e]),t.theme.init&&t.theme.init(t,bv.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];xe.each(Qc(t).split(/[ ,]/),(function(n){Zx(t,e,tC(n))}))}(t);var e=nC(t);!function(t,e){var n={show:x.from(e.show).getOr(c),hide:x.from(e.hide).getOr(c),disable:x.from(e.disable).getOr(c),isDisabled:x.from(e.isDisabled).getOr(p),enable:function(){t.mode.isReadOnly()||x.from(e.enable).map(h)}};t.ui=St(St({},t.ui),n)}(t,x.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,function(t){t.contentCSS=t.contentCSS.concat(function(t){var e=function(t){var e=t.getParam("content_css");return O(e)?V(e.split(","),zt):_(e)?e:!1===e||t.inline?[]:["default"]}(t),n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return V(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))}(t))}(t),t.inline?Kx(t):function(t,e){var n=Jx(t,e);e.editorContainer&&(Yx.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Yx.isHidden(e.editorContainer)),t.getElement().style.display="none",Yx.setAttrib(t.id,"aria-hidden","true"),n||Kx(t)}(t,n)},oC=Qu.DOM,iC=function(t){return"-"===t.charAt(0)},uC=function(t,e,n){return x.from(e).filter((function(t){return t.length>0&&!cv.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:x.some(e)}}))},aC=function(t,e){var n=na.ScriptLoader;!function(t,e,n,r){var o=Xc(e);if(O(o)){if(!iC(o)&&!bv.urls.hasOwnProperty(o)){var i=function(t){return t.getParam("theme_url")}(e);i?bv.load(o,e.documentBaseURI.toAbsolute(i)):bv.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){bv.waitFor(o,r)}))}else r()}(n,t,e,(function(){(function(t,e){var n=Wc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===aa.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,c,void 0,(function(){!function(t,e,n){Cv(t,"LanguageLoadError",Sv("language",e,n))}(e,o,n)}))}})(n,t),function(t,e,n){var r=uC(e,"default",n),o=function(t){return x.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:x.none()}}))}(e).orThunk((function(){return uC(e,Ic(e),"")}));j(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,c,void 0,(function(){!function(t,e,n){Cv(t,"IconsLoadError",Sv("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))}(n,t,e),function(t,e){xe.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){vv.load(n,e,c,void 0,(function(){kv(t,e,n)})),t.settings.plugins+=" "+n})),xe.each(Qc(t).split(/[ ,]/),(function(n){if((n=xe.trim(n))&&!vv.urls[n])if(iC(n)){n=n.substr(1,n.length);var r=vv.dependencies(n);xe.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=vv.createUrl(r,n);vv.load(o.resource,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};vv.load(n,o,c,void 0,(function(){kv(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||rC(t)}),t,(function(){t.removed||rC(t)}))}))},cC={"font-size":"size","font-family":"face"},sC=function(t){return function(e,n){return x.from(n).map(Te).filter(Be).bind((function(n){return function(t,e,n){return Ld(Te(n),(function(e){return function(e){return Jn(e,t).orThunk((function(){return"font"===Me(e)?dt(cC,t).bind((function(t){return Gn(e,t)})):x.none()}))}(e)}),(function(t){return Ne(Te(e),t)}))}(t,e,n.dom).or(function(t,e){return x.from(Qu.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},lC=sC("font-size"),fC=s((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),sC("font-family")),dC=function(t){return al(t.getBody()).map((function(t){var e=t.container();return Mn(e)?e.parentNode:e}))},mC=function(t,e){return function(t){return x.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?x.none():x.from(t.selection.getStart(!0))}))}(t).orThunk(d(dC,t)).map(Te).filter(Be).map(e)},gC=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return xe.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return xe.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},hC=function(t){var e=t.split(/\s*,\s*/);return V(e,(function(t){return-1===t.indexOf(" ")||Rt(t,'"')||Rt(t,"'")?t:"'"+t+"'"})).join(",")},pC=xe.each,vC=xe.map,bC=xe.inArray,yC=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,xd(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus(),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(pC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;pC(t,(function(t,r){pC(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");pe.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),pC("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n=gC(t,e);t.formatter.toggle("fontname",{value:hC(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:gC(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.undoManager.transact((function(){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}))}(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){!function(t,e){var n=function(t){var e;return"string"!=typeof t?(e=xe.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}}(e);!function(t,e,n){hp(t).editor.insertContent(e,n)}(t,n.content,n.details)}(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Cx(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Sy(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Ln);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return sx(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=vC(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==bC(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return wy(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return mC(t,(function(e){return fC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return mC(t,(function(e){return lC(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return mC(t,(function(e){var n=Te(t.getBody());return Ld(e,(function(t){return Jn(t,"line-height")}),d(Ne,n)).getOrThunk((function(){var t=parseFloat(Kn(e,"line-height")),n=parseFloat(Kn(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),wC="data-mce-contenteditable",xC=function(t,e,n){var r,o;ha(t,e)&&!1===n?(o=e,ma(r=t)?r.dom.classList.remove(o):function(t,e){(function(t,e,n){var r=W(da(t,e),(function(t){return t!==n}));r.length>0?Wn(t,e,r.join(" ")):Xn(t,e)})(t,"class",e)}(r,o),function(t){0===(ma(t)?t.dom.classList:function(t){return da(t,"class")}(t)).length&&Xn(t,"class")}(r)):n&&ga(t,e)},CC=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},SC=function(t,e){t.dom.contentEditable=e?"true":"false"},kC=function(t,e){var n=Te(t.getBody());xC(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){x.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,SC(n,!1),j(va(n,'*[contenteditable="true"]'),(function(t){Wn(t,wC,"true"),SC(t,!1)}))):(t.readonly=!1,SC(n,!0),j(va(n,'*[data-mce-contenteditable="true"]'),(function(t){Xn(t,wC),SC(t,!0)})),CC(t,"StyleWithCSS",!1),CC(t,"enableInlineTableEditing",!1),CC(t,"enableObjectResizing",!1),function(t){return Nd(t)||function(t){return cd().filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&Od(t,e.dom);var n})).isSome()}(t)}(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},OC=function(t){return t.readonly},TC=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){OC(t)&&j(e,(function(t){t.attr(wC,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(wC,(function(e){OC(t)&&j(e,(function(t){t.attr("contenteditable",t.attr(wC))}))})),t.serializer.addTempAttr(wC)},_C=xe.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"," "),EC=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||p}return t.isNative=function(t){return!!_C[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=e||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=v},r.stopPropagation=function(){r.isPropagationStopped=v},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=v},r.isDefaultPrevented=p,r.isPropagationStopped=p,r.isImmediatePropagationStopped=p),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=p),e){var o={func:e};r&&xe.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=this.bindings[a]=[],this.toggleEvent(a,!0)),n?c.unshift(o):c.push(o)}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return it(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e)for(var a=u.length;a--;)u[a].func===e&&(u=u.slice(0,a).concat(u.slice(a+1)),this.bindings[i]=u);else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else it(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),AC=function(t){return t._eventDispatcher||(t._eventDispatcher=new EC({scope:t,toggleEvent:function(e,n){EC.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},NC={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=AC(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return AC(this).on(t,e,n)},off:function(t,e){return AC(this).off(t,e)},once:function(t,e){return AC(this).once(t,e)},hasEventListeners:function(t){return AC(this).has(t)}},RC=Qu.DOM,MC=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=Gc(t);return n?(t.eventRoot||(t.eventRoot=RC.select(n)[0]),t.eventRoot):t.getBody()},zC=function(t,e,n){!function(t){return!t.hidden&&!OC(t)}(t)?OC(t)&&function(t,e){if(function(t){return"click"===t.type}(e)&&!Cf.metaKeyPressed(e)){var n=Te(e.target);(function(t,e){return xr(e,"a",(function(e){return Ne(e,Te(t.getBody()))})).bind((function(t){return Gn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Rt(o=n,"#")?function(t,e){return t.substring(e)}(o,"#".length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o}))}}(t,n):t.fire(e,n)},DC=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=MC(t,e);if(Gc(t)){if(Gy||(Gy={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Gy&&(it(Gy,(function(e,n){t.dom.unbind(MC(t,n))})),Gy=null)}))),Gy[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||RC.isChildOf(r,u))&&zC(o[i],e,n)}},Gy[e]=n,RC.bind(r,e,n)}else n=function(n){zC(t,e,n)},RC.bind(r,e,n),t.delegates[e]=n}},BC=St(St({},NC),{bindPendingEventDelegates:function(){var t=this;xe.each(t._pendingNativeEvents,(function(e){DC(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(e?n.initialized?DC(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(MC(n,t),t,n.delegates[t]),delete n.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(it(t.delegates,(function(e,n){t.dom.unbind(MC(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),PC=["design","readonly"],IC=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&kC(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},LC=xe.each,HC=xe.explode,FC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},VC=xe.makeMap("alt,ctrl,shift,meta,access"),jC=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(LC(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return LC(HC(xe.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:xe.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.parseShortcut=function(t){var e,n={};LC(HC(t.toLowerCase(),"+"),(function(t){t in VC?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=FC[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in VC)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,pe.mac?n.ctrl=!0:n.shift=!0),n.meta&&(pe.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=xe.map(HC(t,">"),this.parseShortcut);return o[o.length-1]=xe.extend(o[o.length-1],{func:n,scope:r||this.editor}),xe.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),UC=xe.each,WC=xe.trim,qC="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),$C={ftp:21,http:80,https:443,mailto:25},GC=function(){function t(e,n){e=WC(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);UC(qC,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=$C[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(UC(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?J(i).join("/"):a.slice(0,n).join("/")+"/"+J(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),XC=Qu.DOM,KC=xe.extend,YC=xe.each,JC=xe.resolve,QC=pe.ie,ZC=function(){function t(t,e,n){var r,o,i,u,a,s,l,f,d,m=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,KC(this,BC),this.settings=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:nv(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"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",indent_after:"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",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return St(St({},i),r?Zp:{})}(o,e,n,Kp,t);return uv(Yp||Jp,Yp,i,r,o)}(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(na.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Qu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),sa.languageLoad=this.settings.language_load,sa.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new GC(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new jC(this),this.editorCommands=new yC(this),this.settings.cache_suffix&&(pe.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:(o={},i={},u={},a={},s={},l={},d={addButton:(f=function(t,e){return function(n,r){return t[n.toLowerCase()]=St(St({},r),{type:e})}})(r={},"button"),addGroupToolbarButton:f(r,"grouptoolbarbutton"),addToggleButton:f(r,"togglebutton"),addMenuButton:f(r,"menubutton"),addSplitButton:f(r,"splitbutton"),addMenuItem:f(o,"menuitem"),addNestedMenuItem:f(o,"nestedmenuitem"),addToggleMenuItem:f(o,"togglemenuitem"),addAutocompleter:f(i,"autocompleter"),addContextMenu:f(a,"contextmenu"),addContextToolbar:f(s,"contexttoolbar"),addContextForm:f(s,"contextform"),addSidebar:f(l,"sidebar"),addIcon:function(t,e){return u[t.toLowerCase()]=e},getAll:function(){return{buttons:r,menuItems:o,icons:u,popups:i,contextMenus:a,contextToolbars:s,sidebars:l}}},{addAutocompleter:d.addAutocompleter,addButton:d.addButton,addContextForm:d.addContextForm,addContextMenu:d.addContextMenu,addContextToolbar:d.addContextToolbar,addIcon:d.addIcon,addMenuButton:d.addMenuButton,addMenuItem:d.addMenuItem,addNestedMenuItem:d.addNestedMenuItem,addSidebar:d.addSidebar,addSplitButton:d.addSplitButton,addToggleButton:d.addToggleButton,addGroupToolbarButton:d.addGroupToolbarButton,addToggleMenuItem:d.addToggleMenuItem,getAll:d.getAll}),styleSheetLoader:void 0,show:c,hide:c,enable:c,disable:c,isDisabled:p};var g,h,v,b=(g=this,h=ra("design"),v=ra({design:{activate:c,deactivate:c,editorReadOnly:!1},readonly:{activate:c,deactivate:c,editorReadOnly:!0}}),function(t){t.serializer?TC(t):t.on("PreInit",(function(){TC(t)}))}(g),function(t){t.on("ShowCaret",(function(e){OC(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){OC(t)&&e.preventDefault()}))}(g),{isReadOnly:function(){return OC(g)},set:function(t){return function(t,e,n,r){if(r!==n.get()){if(!mt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?IC(t,n,e,r):t.on("init",(function(){return IC(t,n,e,r)}))}}(g,v.get(),h,t)},get:function(){return h.get()},register:function(t,e){v.set(function(t,e,n){var r;if(H(PC,e))throw new Error("Cannot override default mode "+e);return St(St({},t),((r={})[e]=St(St({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(v.get(),t,e))}});this.mode=b,this.setMode=b.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Wu.overrideDefaults((function(){return{context:m.inline?m.getBody():m.getDoc(),element:m.getBody()}}))}return t.prototype.render=function(){!function(t){var e=t.id;aa.setCode(Wc(t));var n=function(){oC.unbind(window,"ready",n),t.render()};if(xi.Event.domLoaded){if(t.getElement()&&pe.contentEditable){var r=Te(t.getElement()),o=function(t){return $(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){U(r.dom.attributes,(function(t){return Xn(r,t.name)})),qn(r,o)})),t.ui.styleSheetLoader=function(t,e){return Er.forElement(t,{contentCssCors:Jc(e),referrerPolicy:Uc(e)})}(r,t),function(t){return t.getParam("inline")}(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||oC.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Rn(t.getElement())&&(oC.insertAfter(oC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},oC.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=yv(t),t.notificationManager=pv(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=oC.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),aC(t,t.suffix)}}else oC.bind(window,"ready",n)}(this)},t.prototype.focus=function(t){!function(t,e){t.removed||(e?Rd(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===Nd(t)&&xd(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return Ad(o),Ed(t,r),void Rd(t);t.inline||(pe.opera||Ad(n),t.getWin().focus()),(pe.gecko||t.inline)&&(Ad(n),Ed(t,r)),Rd(t)}(t))}(this,t)},t.prototype.hasFocus=function(){return Nd(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?JC(r):0,i=JC(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return aa.translate(t)},t.prototype.getParam=function(t,e,n){return function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?j(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[xe.trim(n[0])]=xe.trim(n[1]):e[xe.trim(n[0])]=xe.trim(n[0])})):e=t,e}(i):"string"===r?av(O,t,e).getOr(n):"number"===r?av(D,t,e).getOr(n):"boolean"===r?av(A,t,e).getOr(n):"object"===r?av(T,t,e).getOr(n):"array"===r?av(_,t,e).getOr(n):"string[]"===r?av((o=O,function(t){return _(t)&&Y(t,o)}),t,e).getOr(n):"function"===r?av(z,t,e).getOr(n):i}(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!(!H(Qc(this).split(/[ ,]/),t)||e&&void 0===vv.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(XC.show(t.getContainer()),XC.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(QC&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(XC.hide(t.getContainer()),XC.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=Rn(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Rn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=XC.getParent(r.id,"form"))&&YC(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return Up(this,t,e)},t.prototype.getContent=function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return hp(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")}(this,t)},t.prototype.insertContent=function(t,e){e&&(t=KC({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?Up(this,this.startContent,{format:"raw"}):Up(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=XC.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=XC.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){!function(t,e){(function(t,e){pp(t).editor.addVisual(e)})(t,e)}(this,t)},t.prototype.remove=function(){!function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Wp.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Wp.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Wp.remove(t.getContainer()),qp(e),qp(n),t.destroy()}}(this)},t.prototype.destroy=function(t){!function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),qp(n),qp(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Wp.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())}(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),tS=Qu.DOM,eS=xe.explode,nS=xe.each,rS=xe.extend,oS=0,iS=!1,uS=[],aS=[],cS=function(t){var e=t.type;nS(dS.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},sS=function(t){t!==iS&&(t?Wu(window).on("resize scroll",cS):Wu(window).off("resize scroll",cS),iS=t)},lS=function(t){var e=aS;delete uS[t.id];for(var n=0;n<uS.length;n++)if(uS[n]===t){uS.splice(n,1);break}return aS=W(aS,(function(e){return t!==e})),dS.activeEditor===t&&(dS.activeEditor=aS.length>0?aS[0]:null),dS.focusedEditor===t&&(dS.focusedEditor=null),e.length!==aS.length},fS="CSS1Compat"!==document.compatMode,dS=St(St({},NC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Wu,majorVersion:"5",minorVersion:"6.2",releaseDate:"2020-12-08",editors:uS,i18n:aa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=GC.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c;if(""!==(c=u[a].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}!t&&document.currentScript&&(-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/")))}n.baseURL=new GC(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new GC(n.baseURL),n.suffix=r,(o=n).on("AddEditor",d(Td,o)),o.on("RemoveEditor",d(_d,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&it(r,(function(t,e){sa.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=xe.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"," "),o=function(t){var e=t.id;return e||(e=dt(t,"name").filter((function(t){return!tS.get(t)})).getOrThunk(tS.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):tS.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new ZC(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};tS.unbind(window,"ready",a),function(e){var r=t[e];r&&r.apply(n,Array.prototype.slice.call(arguments,2))}("onpageload"),e=Wu.unique(function(t){var e=[];if(pe.browser.isIE()&&pe.browser.version.major<11)return Ov("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(fS)return Ov("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return nS(t.types,(function(t){e=e.concat(tS.select(t.selector))})),e;if(t.selector)return tS.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&nS(eS(n),(function(t){var n=tS.get(t);n?e.push(n):nS(document.forms,(function(n){nS(n.elements,(function(n){n.name===t&&(t="mce_editor_"+oS++,tS.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":nS(tS.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?nS(t.types,(function(n){xe.each(e,(function(e){return!tS.is(e,n.selector)||(l(o(e),rS({},t,n),e),!1)}))})):(xe.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(lS(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=xe.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):nS(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):Ov("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,tS.bind(window,"ready",a),new Cr((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?aS.slice(0):O(t)?G(aS,(function(e){return e.id===t})).getOr(null):D(t)&&aS[t]?aS[t]:null},add:function(t){var e=this;return uS[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(uS[t.id]=t),uS.push(t),aS.push(t)),sS(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Xy||(Xy=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Xy))),t},createEditor:function(t,e){return this.add(new ZC(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!O(t))return n=t,E(r.get(n.id))?null:(lS(n)&&r.fire("RemoveEditor",{editor:n}),0===aS.length&&window.removeEventListener("beforeunload",Xy),n.remove(),sS(aS.length>0),n);nS(tS.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=aS.length-1;e>=0;e--)r.remove(aS[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new ZC(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",0,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){nS(aS,(function(t){t.save()}))},addI18n:function(t,e){aa.add(t,e)},translate:function(t){return aa.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new GC(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new GC(this.baseURL)}});dS.setup();var mS,gS,hS,pS,vS=Math.min,bS=Math.max,yS=Math.round,wS=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=yS(c/2)),"c"===s[1]&&(r+=yS(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=yS(u/2)),"c"===s[4]&&(r-=yS(i/2)),xS(r,o,i,u)},xS=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},CS={inflate:function(t,e,n){return xS(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:wS,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=wS(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=bS(t.x,e.x),r=bS(t.y,e.y),o=vS(t.x+t.w,e.x+e.w),i=vS(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:xS(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=bS(0,e.x-r),l=bS(0,e.y-o),f=bS(0,i-a),d=bS(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),xS(r,o,(i-=f)-r,(u-=d)-o)},create:xS,fromClientRect:function(t){return xS(t.left,t.top,t.width,t.height)}},SS=(mS={},gS={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==mS[t])return mS[t];var o=new Cr((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);gS[t]=u.resolve,na.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return mS[t]=o,o},add:function(t,e){void 0!==gS[t]&&(gS[t](e),delete gS[t]),mS[t]=Cr.resolve(e)}}),kS=xe.each,OS=xe.extend,TS=function(){};TS.extend=hS=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!pS&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};pS=!0;var o=new this;return pS=!1,t.Mixins&&(kS(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&kS(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&kS(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&kS(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=OS({},e.Defaults,t.Defaults)),it(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=hS,n};var _S,ES=Math.min,AS=Math.max,NS=Math.round,RS={serialize:function(t){var e=JSON.stringify(t);return O(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},MS={callbacks:{},count:0,send:function(t){var e=this,n=Qu.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},zS=St(St({},NC),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Tr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",zS.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&xe.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=zS.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Tr.setTimeout(r,10)}}),DS=xe.extend,BS=function(){function t(t){this.settings=DS({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=DS(this.settings,t);r.success=function(t,o){void 0===(t=RS.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=RS.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",zS.send(r)},t}();try{var PS="__storage_test__";(_S=window.localStorage).setItem(PS,PS),_S.removeItem(PS)}catch(t){_S=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var IS={geom:{Rect:CS},util:{Promise:Cr,Delay:Tr,Tools:xe,VK:Cf,URI:GC,Class:TS,EventDispatcher:EC,Observable:NC,I18n:aa,XHR:zS,JSON:RS,JSONRequest:BS,JSONP:MS,LocalStorage:_S,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=AS(0,ES(e,1)),i=AS(0,ES(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=NS(255*(n+s)),r=NS(255*(r+s)),o=NS(255*(o+s))}else n=r=o=NS(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=ES(t/=255,ES(e/=255,n/=255)),u=AS(t,AS(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:NS(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:NS(100*r),v:NS(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:xi,Sizzle:ou,DomQuery:Wu,TreeWalker:Ar,TextSeeker:Na,DOMUtils:Qu,ScriptLoader:na,RangeUtils:Vf,Serializer:jp,StyleSheetLoader:_r,ControlSelection:kf,BookmarkManager:yf,Selection:Cp,Event:xi.Event},html:{Styles:di,Entities:Io,Node:Jd,Schema:Go,SaxParser:um,DomParser:Hp,Writer:Zd,Serializer:tm},Env:pe,AddOnManager:sa,Annotator:vf,Formatter:Bv,UndoManager:Pv,EditorCommands:yC,WindowManager:yv,NotificationManager:pv,EditorObservable:BC,Shortcuts:jC,Editor:ZC,FocusManager:Cd,EditorManager:dS,DOM:Qu.DOM,ScriptLoader:na.ScriptLoader,PluginManager:vv,ThemeManager:bv,IconManager:cv,Resource:SS,trim:xe.trim,isArray:xe.isArray,is:xe.is,toArray:xe.toArray,makeMap:xe.makeMap,each:xe.each,map:xe.map,grep:xe.grep,inArray:xe.inArray,extend:xe.extend,create:xe.create,walk:xe.walk,createNS:xe.createNS,resolve:xe.resolve,explode:xe.explode,_addCacheSuffix:xe._addCacheSuffix,isOpera:pe.opera,isWebKit:pe.webkit,isIE:pe.ie,isGecko:pe.gecko,isMac:pe.mac},LS=xe.extend(dS,IS);!function(t){window.tinymce=t,window.tinyMCE=t}(LS),function(e){try{t.exports=e}catch(t){}}(LS)}()}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{"use strict";n(7575),n(6890),n(8860),n(5209),n(3356),n(2875),n(8619),n(2540),n(8190),n(1295),n(2170),n(2682),n(1236),n(6884),n(4400),n(8208),n(6586),n(5053),n(7259),n(4926),n(5031),n(397),n(1933),n(5187),n.g.current_selection_range=null,n.g.editor=null})()})();\ No newline at end of file