!function(){"use strict";vare=tinymce.util.Tools.resolve("tinymce.PluginManager");constt=e=>t=>(e=>{constt=typeofe;returnnull===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=o=e,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void0===s?void0:s.name)===a.name)?"string":t;varr,o,a,s})(t)===e,r=t("string"),o=t("object"),a=t("array"),s=e=>!(e=>null==e)(e);classi{constructor(e,t){this.tag=e,this.value=t}staticsome(e){returnnewi(!0,e)}staticnone(){returni.singletonNone}fold(e,t){returnthis.tag?t(this.value):e()}isSome(){returnthis.tag}isNone(){return!this.tag}map(e){returnthis.tag?i.some(e(this.value)):i.none()}bind(e){returnthis.tag?e(this.value):i.none()}exists(e){returnthis.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:i.none()}getOr(e){returnthis.tag?this.value:e}or(e){returnthis.tag?this:e}getOrThunk(e){returnthis.tag?this.value:e()}orThunk(e){returnthis.tag?this:e()}getOrDie(e){if(this.tag)returnthis.value;thrownewError(null!=e?e:"Called getOrDie on None")}staticfrom(e){returns(e)?i.some(e):i.none()}getOrNull(){returnthis.tag?this.value:null}getOrUndefined(){returnthis.value}each(e){this.tag&&e(this.value)}toArray(){returnthis.tag?[this.value]:[]}toString(){returnthis.tag?`some(${this.value})`:"none()"}}i.singletonNone=newi(!1);constn=Array.prototype.push,c=(e,t)=>{for(letr=0,o=e.length;r<o;r++)t(e[r],r)},l=e=>{constt=[];for(letr=0,o=e.length;r<o;++r){if(!a(e[r]))thrownewError("Arr.flatten item "+r+" was not an array, input: "+e);n.apply(t,e[r])}returnt},m=Object.keys,u=Object.hasOwnProperty,d=(e,t)=>h(e,t)?i.from(e[t]):i.none(),h=(e,t)=>u.call(e,t),p=e=>t=>t.options.get(e),g=p("audio_template_callback"),b=p("video_template_callback"),w=p("iframe_template_callback"),v=p("media_live_embeds"),y=p("media_filter_html"),f=p("media_url_resolver"),x=p("media_alt_source"),_=p("media_poster"),j=p("media_dimensions");vark=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),A=tinymce.util.Tools.resolve("tinymce.html.DomParser");constS=O.DOM,$=e=>e.replace(/px$/,""),C=e=>{constt=e.attr("style"),r=t?S.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:d(r,"max-width").map($).getOr(""),height:d(r,"max-height").map($).getOr("")}},D=(e,t)=>{letr={};for(leto=A({validate:!1,forced_root_block:!1},t).parse(e);o;o=o.walk())if(1===o.type){conste=o.name;if(o.attr("data-ephox-embed-iri")){r=C(o);break}r.source||"param"!==e||(r.source=o.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=k.extend(o.attributes.map,r)),"script"===e&&(r={type:"script",source:o.attr("src")}),"source"===e&&(r.source?r.altsource||(r.altsource=o.attr("src")):r.source=o.attr("src")),"img"!==e||r.poster||(r.poster=o.attr("src"))}returnr.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},T=e=>{vart;constr=null!==(t=e.toLowerCase().split(".").pop())&&void0!==t?t:"";returnd({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},r).getOr("")};varz=tinymce.util.Tools.resolve("tinymce.html.Node"),F=tinymce.util.Tools.resolve("tinymce.html.Serializer");constM=(e,t={})=>A({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),N=O.DOM,R=e=>/^[0-9.]+$/.test(e)?e+"px":e,E=(e,t)=>{constr=t.attr("style"),o=r?N.parseStyle(r):{};s(e.width)&&(o["max-width"]=R(e.width)),s(e.height)&&(o["max-height"]=R(e.height)),t.attr("style",N.serializeStyle(o))},U=["source","altsource"],P=(e,t,r,o)=>{leta=0,s=0;consti=M(o);i.addNodeFilter("source",(e=>a=e.length));constn=i.parse(e);for(lete=n;e;e=e.walk())if(1===e.type){consto=e.name;if(e.attr("data-ephox-embed-iri")){E(t,e);break}switch(o){case"video":case"object":case"embed":case"img":case"iframe":void0!==t.height&&void0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(o){case"