dsql-admin/dsql-app/public/tinymce-public/tinymce.min.js

385 lines
446 KiB
JavaScript
Raw Permalink Normal View History

2024-12-15 11:27:16 +00:00
/**
* TinyMCE version 7.6.0 (2024-12-11)
*/
!function(){"use strict";var e=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},n=t((function(e,t){return e===t})),o=function(e){return t((function(t,n){if(t.length!==n.length)return!1;for(var o=t.length,r=0;r<o;r++)if(!e.eq(t[r],n[r]))return!1;return!0}))},r=function(e){return t((function(r,s){var a=Object.keys(r),i=Object.keys(s);if(!function(e,n){return function(e,n){return t((function(t,o){return e.eq(n(t),n(o))}))}(o(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,n)}))}(n).eq(a,i))return!1;for(var l=a.length,d=0;d<l;d++){var c=a[d];if(!e.eq(r[c],s[c]))return!1}return!0}))},s=t((function(t,n){if(t===n)return!0;var a=e(t);return a===e(n)&&(function(e){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(a)?t===n:"array"===a?o(s).eq(t,n):"object"===a&&r(s).eq(t,n))}));const a=Object.getPrototypeOf,i=(e,t,n)=>{var o;return!!n(e,t.prototype)||(null===(o=e.constructor)||void 0===o?void 0:o.name)===t.name},l=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&i(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,d=e=>t=>typeof t===e,c=e=>t=>e===t,u=(e,t)=>f(e)&&i(e,t,((e,t)=>a(e)===t)),m=l("string"),f=l("object"),g=e=>u(e,Object),p=l("array"),h=c(null),b=d("boolean"),v=c(void 0),y=e=>null==e,C=e=>!y(e),w=d("function"),E=d("number"),x=(e,t)=>{if(p(e)){for(let n=0,o=e.length;n<o;++n)if(!t(e[n]))return!1;return!0}return!1},_=()=>{},k=(e,t)=>(...n)=>e(t.apply(null,n)),S=(e,t)=>n=>e(t(n)),N=e=>()=>e,R=e=>e,A=(e,t)=>e===t;function T(e,...t){return(...n)=>{const o=t.concat(n);return e.apply(null,o)}}const O=e=>t=>!e(t),B=e=>()=>{throw new Error(e)},P=e=>e(),D=e=>{e()},L=N(!1),M=N(!0);class I{constructor(e,t){this.tag=e,this.value=t}static some(e){return new I(!0,e)}static none(){return I.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?I.some(e(this.value)):I.none()}bind(e){return this.tag?e(this.value):I.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:I.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return C(e)?I.some(e):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const F=Array.prototype.slice,U=Array.prototype.indexOf,z=Array.prototype.push,j=(e,t)=>U.call(e,t),H=(e,t)=>j(e,t)>-1,$=(e,t)=>{for(let n=0,o=e.length;n<o;n++)if(t(e[n],n))return!0;return!1},V=(e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o},q=(e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)},W=(e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n],n)},K=(e,t)=>{const n=[],o=[];for(let r=0,s=e.length;r<s;r++){const s=e[r];(t(s,r)?n:o).push(s)}return{pass:n,fail:o}},Y=(e,t)=>{const n=[];for(let o=0,r=e.length;o<r;o++){const r=e[o];t(r,o)&&n.push(r)}return n},G=(e,t,n)=>(W(e,((e,o)=>{n=t(n,e,o)})),n),X=(e,t,n)=>(q(e,((e,o)=>{n=t(n,e,o)})),n),Z=(e,t,n)=>{for(let o=0,r=e.length;o<r;o++){const r=e[o];if(t(r,o))return I.some(r);if(n(r,o))break}return I.none()},Q=(e,t)=>Z(e,t,L),J=(e,t)=>{for(let n=0,o=e.length;n<o;n++)if(t(e[n],n))return I.some(n);return I.none()},ee=e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!p(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);z.apply(t,e[n])}return t},te=(e,t)=>ee(V(e,t)),ne=(e,t)=>{for(
yy||(yy=function(e){return e}),Cy||(Cy=function(e){return e}),Ey||(Ey=function(e,t,n){return e.apply(t,n)}),xy||(xy=function(e,t){return new e(...t)});const _y=Iy(Array.prototype.forEach),ky=Iy(Array.prototype.pop),Sy=Iy(Array.prototype.push),Ny=Iy(String.prototype.toLowerCase),Ry=Iy(String.prototype.toString),Ay=Iy(String.prototype.match),Ty=Iy(String.prototype.replace),Oy=Iy(String.prototype.indexOf),By=Iy(String.prototype.trim),Py=Iy(Object.prototype.hasOwnProperty),Dy=Iy(RegExp.prototype.test),Ly=(My=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xy(My,t)});
/**
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
*
* @param {Function} func - The constructor function to be wrapped and called.
* @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.
*/
var My;
/**
* Add properties to a lookup table
*
* @param {Object} set - The set to which elements will be added.
* @param {Array} array - The array containing elements to be added to the set.
* @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.
* @returns {Object} The modified set with added elements.
*/
/**
* Creates a new function that calls the given function with a specified thisArg and arguments.
*
* @param {Function} func - The function to be wrapped and called.
* @returns {Function} A new function that calls the given function with a specified thisArg and arguments.
*/
function Iy(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return Ey(e,t,o)}}function Fy(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ny;py&&
// Make 'in' and truthy checks like Boolean(set.constructor)
// independent of any properties defined on Object.prototype.
// Prevent prototype setters from intercepting set as a this value.
py(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"==typeof r){const e=n(r);e!==r&&(
// Config presets (e.g. tags.js, attrs.js) are immutable.
hy(t)||(t[o]=e),r=e)}e[r]=!0}return e}
/**
* Clean up an array to harden against CSPP
*
* @param {Array} array - The array to be cleaned.
* @returns {Array} The cleaned version of the array
*/function Uy(e){for(let t=0;t<e.length;t++)Py(e,t)||(e[t]=null);return e}
/**
* Shallow clone an object
*
* @param {Object} object - The object to be cloned.
* @returns {Object} A new object that copies the original.
*/function zy(e){const t=wy(null);for(const[n,o]of gy(e))Py(e,n)&&(Array.isArray(o)?t[n]=Uy(o):o&&"object"==typeof o&&o.constructor===Object?t[n]=zy(o):t[n]=o);return t}
/**
* This method automatically checks if the prop is function or getter and behaves accordingly.
*
* @param {Object} object - The object to look up the getter function in its prototype chain.
* @param {String} prop - The property name for which to find the getter function.
* @returns {Function} The getter function found in the prototype chain or a fallback function.
*/function jy(e,t){for(;null!==e;){const n=vy(e,t);if(n){if(n.get)return Iy(n.get);if("function"==typeof n.value)return Iy(n.value)}e=by(e)}return function(){return null}}const Hy=yy(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$y=yy(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Vy=yy(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qy=yy(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wy=yy(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ky=yy(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Yy=yy(["#text"]),Gy=yy(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Xy=yy(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direct
// SVG
var dC=Object.freeze({__proto__:null,MUSTACHE_EXPR:Jy,ERB_EXPR:eC,TMPLIT_EXPR:tC,DATA_ATTR:nC,ARIA_ATTR:oC,IS_ALLOWED_URI:rC,IS_SCRIPT_OR_DATA:sC,ATTR_WHITESPACE:aC,DOCTYPE_NAME:iC,CUSTOM_ELEMENT:lC});
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
const cC=function(){return"undefined"==typeof window?null:window};var uC=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cC();const n=t=>e(t)
/**
* Version label, exposed for easier checks
* if DOMPurify is up to date or not
*/;if(n.version="3.1.7",
/**
* Array of elements that DOMPurify removed during sanitation.
* Empty if nothing was removed.
*/
n.removed=[],!t||!t.document||9!==t.document.nodeType)
// Not running in a browser, provide a factory function
// so that you can pass your own Window
return n.isSupported=!1,n;let{document:o}=t;const r=o,s=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:i,Node:l,Element:d,NodeFilter:c,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:m,DOMParser:f,trustedTypes:g}=t,p=d.prototype,h=jy(p,"cloneNode"),b=jy(p,"remove"),v=jy(p,"nextSibling"),y=jy(p,"childNodes"),C=jy(p,"parentNode");
// As per issue #47, the web-components registry is inherited by a
// new document created via createHTMLDocument. As per the spec
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
// a new empty registry is used when creating a template contents owner
// document, so we use that as our parent document to ensure nothing
// is inherited.
if("function"==typeof i){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let w,E="";const{implementation:x,createNodeIterator:_,createDocumentFragment:k,getElementsByTagName:S}=o,{importNode:N}=r;let R={};
/**
* Expose whether this browser supports running the full DOMPurify.
*/n.isSupported="function"==typeof gy&&"function"==typeof C&&x&&void 0!==x.createHTMLDocument;const{MUSTACHE_EXPR:A,ERB_EXPR:T,TMPLIT_EXPR:O,DATA_ATTR:B,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:M}=dC;let{IS_ALLOWED_URI:I}=dC,F=null;
/**
* We consider the elements and attributes below to be safe. Ideally
* don't add any new ones but feel free to remove unwanted ones.
*/
/* allowed element names */const U=Fy({},[...Hy,...$y,...Vy,...Wy,...Yy]);
/* Allowed attribute names */let z=null;const j=Fy({},[...Gy,...Xy,...Zy,...Qy]);
/*
* Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
*/let H=Object.seal(wy(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,V=null,q=!0,W=!0,K=!1,Y=!0,G=!1,X=!0,Z=!1,Q=!1,J=!1,ee=!1,te=!1,ne=!1,oe=!0,re=!1,se=!0,ae=!1,ie={},le=null;
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */const de=Fy({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);
/* Tags that are safe for data: URIs */let ce=null;const ue=Fy({},["audio","video","img","source","image","track"]);
/* Attributes safe for values like "javascript:" */let me=null;const fe=Fy({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";
/* Document namespace */
let be=he,ve=!1,ye=null;const Ce=Fy({},[ge,pe,he],Ry);
/* Parsing of strict XHTML documents */let we=null;const Ee=["application/xhtml+xml","text/html"];let xe=null,_e=null;
/* Keep a reference to config to pass to hooks */
/* Ideally, do not touch anything below this line */
/* ______________________________________________ */
const ke=o.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Ne=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!_e||_e!==e){if(
/* Shield configuration object from tampering */
e&&"object"==typeof e||(e={})
/* Shield configuration object from prototype pollution */,e=zy(e),we=
// eslint-disable-next-line unicorn/prefer-includes
-1===Ee.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
xe="application/xhtml+xml"===we?Ry:Ny,
/* Set configuration parameters */
F=Py(e,"ALLOWED_TAGS")?Fy({},e.ALLOWED_TAGS,xe):U,z=Py(e,"ALLOWED_ATTR")?Fy({},e.ALLOWED_ATTR,xe):j,ye=Py(e,"ALLOWED_NAMESPACES")?Fy({},e.ALLOWED_NAMESPACES,Ry):Ce,me=Py(e,"ADD_URI_SAFE_ATTR")?Fy(zy(fe),
// eslint-disable-line indent
e.ADD_URI_SAFE_ATTR,
// eslint-disable-line indent
xe):fe,ce=Py(e,"ADD_DATA_URI_TAGS")?Fy(zy(ue),
// eslint-disable-line indent
e.ADD_DATA_URI_TAGS,
// eslint-disable-line indent
xe):ue,le=Py(e,"FORBID_CONTENTS")?Fy({},e.FORBID_CONTENTS,xe):de,$=Py(e,"FORBID_TAGS")?Fy({},e.FORBID_TAGS,xe):{},V=Py(e,"FORBID_ATTR")?Fy({},e.FORBID_ATTR,xe):{},ie=!!Py(e,"USE_PROFILES")&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,// Default true
W=!1!==e.ALLOW_DATA_ATTR,// Default true
K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,// Default false
Y=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,// Default true
G=e.SAFE_FOR_TEMPLATES||!1,// Default false
X=!1!==e.SAFE_FOR_XML,// Default true
Z=e.WHOLE_DOCUMENT||!1,// Default false
ee=e.RETURN_DOM||!1,// Default false
te=e.RETURN_DOM_FRAGMENT||!1,// Default false
ne=e.RETURN_TRUSTED_TYPE||!1,// Default false
J=e.FORCE_BODY||!1,// Default false
oe=!1!==e.SANITIZE_DOM,// Default true
re=e.SANITIZE_NAMED_PROPS||!1,// Default false
se=!1!==e.KEEP_CONTENT,// Default true
ae=e.IN_PLACE||!1,// Default false
I=e.ALLOWED_URI_REGEXP||rC,be=e.NAMESPACE||he,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(W=!1),te&&(ee=!0)
/* Parse profile info */,ie&&(F=Fy({},Yy),z=[],!0===ie.html&&(Fy(F,Hy),Fy(z,Gy)),!0===ie.svg&&(Fy(F,$y),Fy(z,Xy),Fy(z,Qy)),!0===ie.svgFilters&&(Fy(F,Vy),Fy(z,Xy),Fy(z,Qy)),!0===ie.mathMl&&(Fy(F,Wy),Fy(z,Zy),Fy(z,Qy)))
/* Merge configuration parameters */,e.ADD_TAGS&&(F===U&&(F=zy(F)),Fy(F,e.ADD_TAGS,xe)),e.ADD_ATTR&&(z===j&&(z=zy(z)),Fy(z,e.ADD_ATTR,xe)),e.ADD_URI_SAFE_ATTR&&Fy(me,e.ADD_URI_SAFE_ATTR,xe),e.FORBID_CONTENTS&&(le===de&&(le=zy(le)),Fy(le,e.FORBID_CONTENTS,xe))
/* Add #text in case KEEP_CONTENT is set to true */,se&&(F["#text"]=!0)
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */,Z&&Fy(F,["html","head","body"])
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */,F.table&&(Fy(F,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Ly('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Ly('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
// Overwrite existing TrustedTypes policy.
w=e.TRUSTED_TYPES_POLICY,
// Sign local variables required by `sanitize`.
E=w.createHTML("")}else
// Uninitialized policy, attempt to initialize the internal dompurify policy.
void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;
// Allow the callers to control the unique policy name
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
// Policy creation with duplicate names throws in Trusted Types.
let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){
// Policy creation failed (most likely another DOMPurify script has
// already run). Skip creating the policy, as this will only cause errors
// if TT are enforced.
return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(g,s)),
// If creating the internal policy succeeded sign internal variables.
null!==w&&"string"==typeof E&&(E=w.createHTML(""));
// Prevent further manipulation of configuration.
// Not available in IE8, Safari 5, etc.
yy&&yy(e),_e=e}},Re=Fy({},["mi","mo","mn","ms","mtext"]),Ae=Fy({},["annotation-xml"]),Te=Fy({},["title","style","font","a","script"]),Oe=Fy({},[...$y,...Vy,...qy]),Be=Fy({},[...Wy,...Ky]),Pe=function(e){Sy(n.removed,{element:e});try{
// eslint-disable-next-line unicorn/prefer-dom-node-remove
C(e).removeChild(e)}catch(t){b(e)}},De=function(e,t){try{Sy(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Sy(n.removed,{attribute:null,from:t})}
// We void attribute values for unremovable "is"" attributes
if(t.removeAttribute(e),"is"===e&&!z[e])if(ee||te)try{Pe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){
/* Create a HTML document */
let t=null,n=null;if(J)e="<remove></remove>"+e;else{
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
const t=Ay(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===we&&be===he&&(
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=w?w.createHTML(e):e;
/*
* Use the DOMParser API by default, fallback later if needs be
* DOMParser not work for svg when has multiple root element.
*/if(be===he)try{t=(new f).parseFromString(r,we)}catch(e){}
/* Use createHTMLDocument in case DOMParser is not available */if(!t||!t.documentElement){t=x.createDocument(be,"template",null);try{t.documentElement.innerHTML=ve?E:r}catch(e){
// Syntax error if dirtyPayload is invalid xml
}}const s=t.body||t.documentElement;
/* Work on whole document or just its body */
return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),be===he?S.call(t,Z?"html":"body")[0]:Z?t.documentElement:s},Me=function(e){return _.call(e.ownerDocument||e,e,
// eslint-disable-next-line no-bitwise
c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ie=function(e){return e instanceof m&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Fe=function(e){return"function"==typeof l&&e instanceof l},Ue=function(e,t,o){R[e]&&_y(R[e],(e=>{e.call(n,t,o,_e)}))},ze=function(e){let t=null;
/* Execute a hook if present */
/* Check if element is clobbered or can clobber */
if(Ue("beforeSanitizeElements",e,null),Ie(e))return Pe(e),!0;
/* Now let's check the element's type and name */const o=xe(e.nodeName);
/* Execute a hook if present */
/* Detect mXSS attempts abusing namespace confusion */
if(Ue("uponSanitizeElement",e,{tagName:o,allowedTags:F}),e.hasChildNodes()&&!Fe(e.firstElementChild)&&Dy(/<[/\w]/g,e.innerHTML)&&Dy(/<[/\w]/g,e.textContent))return Pe(e),!0;
/* Remove any occurrence of processing instructions */if(7===e.nodeType)return Pe(e),!0;
/* Remove any kind of possibly harmful comments */if(X&&8===e.nodeType&&Dy(/<[/\w]/g,e.data))return Pe(e),!0;
/* Remove element if anything forbids its presence */if(!F[o]||$[o]){
/* Check if we have a custom element to handle */
if(!$[o]&&He(o)){if(H.tagNameCheck instanceof RegExp&&Dy(H.tagNameCheck,o))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(o))return!1}
/* Keep content except for bad-listed elements */if(se&&!le[o]){const t=C(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t)for(let o=n.length-1;o>=0;--o){const r=h(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,v(e))}}return Pe(e),!0}
/* Check whether element has a valid namespace */return e instanceof d&&!function(e){let t=C(e);
// In JSDOM, if we're inside shadow DOM, then parentNode
// can be null. We just simulate parent in this case.
t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Ny(e.tagName),o=Ny(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===pe?
// The only way to switch from HTML namespace to SVG
// is via <svg>. If it happens via any other tag, then
// it should be killed.
t.namespaceURI===he?"svg"===n:
// The only way to switch from MathML to SVG is via`
// svg if parent is either <annotation-xml> or MathML
// text integration points.
t.namespaceURI===ge?"svg"===n&&("annotation-xml"===o||Re[o]):Boolean(Oe[n]):e.namespaceURI===ge?
// The only way to switch from HTML namespace to MathML
// is via <math>. If it happens via any other tag, then
// it should be killed.
t.namespaceURI===he?"math"===n:
// The only way to switch from SVG to MathML is via
// <math> and HTML integration points
t.namespaceURI===pe?"math"===n&&Ae[o]:Boolean(Be[n]):e.namespaceURI===he?
// The only way to switch from SVG to HTML is via
// HTML integration points, and from MathML to HTML
// is via MathML text integration points
!(t.namespaceURI===pe&&!Ae[o])&&!(t.namespaceURI===ge&&!Re[o])&&!Be[n]&&(Te[n]||!Oe[n]):!("application/xhtml+xml"!==we||!ye[e.namespaceURI]))}(e)?(Pe(e),!0):
/* Make sure that older browsers don't get fallback-tag mXSS */
"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!Dy(/<\/no(script|embed|frames)/i,e.innerHTML)?(
/* Sanitize element content to be template-safe */
G&&3===e.nodeType&&(
/* Get the element's text content */
t=e.textContent,_y([A,T,O],(e=>{t=Ty(t,e," ")})),e.textContent!==t&&(Sy(n.removed,{element:e.cloneNode()}),e.textContent=t))
/* Execute a hook if present */,Ue("afterSanitizeElements",e,null),!1):(Pe(e),!0)},je=function(e,t,n){
/* Make sure attribute cannot clobber */
if(oe&&("id"===t||"name"===t)&&(n in o||n in ke))return!1;
/* Allow valid data-* attributes: At least one character after "-"
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
We don't need to check the value; it's always URI safe. */if(W&&!V[t]&&Dy(B,t));else if(q&&Dy(P,t));else if(!z[t]||V[t]){if(
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
!(He(e)&&(H.tagNameCheck instanceof RegExp&&Dy(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&Dy(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||
// Alternative, second condition checks if it's an `is`-attribute, AND
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Dy(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1;
/* Check value is safe. First, is attr inert? If so, is safe */}else if(me[t]);else if(Dy(I,Ty(n,L,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Oy(n,"data:")||!ce[e])if(K&&!Dy(D,Ty(n,L,"")));else if(n)return!1;return!0},He=function(e){return"annotation-xml"!==e&&Ay(e,M)},$e=function(e){
/* Execute a hook if present */
Ue("beforeSanitizeAttributes",e,null);const{attributes:t}=e;
/* Check if we have attributes; if not we might have a text node */if(!t)return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z};let r=t.length;
/* Go backwards over all attributes; safely remove bad ones */for(;r--;){const s=t[r],{name:a,namespaceURI:i,value:l}=s,d=xe(a);let c="value"===a?l:By(l);const u=c;
/* Execute a hook if present */
/* Did the hooks approve of the attribute? */
if(o.attrName=d,o.attrValue=c,o.keepAttr=!0,o.forceKeepAttr=void 0,// Allows developers to see this is a property they can set
Ue("uponSanitizeAttribute",e,o),c=o.attrValue,o.forceKeepAttr)continue;
/* Remove attribute */
/* Did the hooks approve of the attribute? */if(!o.keepAttr){De(a,e);continue}
/* Work around a security issue in jQuery 3.0 */if(!Y&&Dy(/\/>/i,c)){De(a,e);continue}
/* Sanitize attribute content to be template-safe */G&&_y([A,T,O],(e=>{c=Ty(c,e," ")}))
/* Is `value` valid for this attribute? */;const m=xe(e.nodeName);if(je(m,d,c))
/* Work around a security issue with comments inside attributes */
if(
/* Full DOM Clobbering protection via namespace isolation,
* Prefix id and name attributes with `user-content-`
*/
!re||"id"!==d&&"name"!==d||(
// Remove the attribute with this value
De(a,e),
// Prefix the value and later re-create the attribute with the sanitized value
c="user-content-"+c),X&&Dy(/((--!?|])>)|<\/(style|title)/i,c))De(a,e);else{
/* Handle attributes that require Trusted Types */
if(w&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(i);else switch(g.getAttributeType(m,d)){case"TrustedHTML":c=w.createHTML(c);break;case"TrustedScriptURL":c=w.createScriptURL(c)}
/* Handle invalid data-* attribute set by try-catching it */if(c!==u)try{i?e.setAttributeNS(i,a,c):
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
e.setAttribute(a,c),Ie(e)?Pe(e):ky(n.removed)}catch(e){}}else De(a,e)}
/* Execute a hook if present */Ue("afterSanitizeAttributes",e,null)},Ve=function e(t){let n=null;const o=Me(t);
/* Execute a hook if present */for(Ue("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)
/* Execute a hook if present */
Ue("uponSanitizeShadowNode",n,null),
/* Sanitize tags and elements */
ze(n)||(
/* Deep shadow DOM detected */
n.content instanceof a&&e(n.content)
/* Check attributes, sanitize if necessary */,$e(n));
/* Execute a hook if present */Ue("afterSanitizeShadowDOM",t,null)};
/**
* Sanitize
* Public method providing core sanitation functionality
*
* @param {String|Node} dirty string or DOM node
* @param {Object} cfg object
*/
// eslint-disable-next-line complexity
return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,s=null,i=null,d=null;
/* Stringify, in case dirty is an object */
if(
/* Make sure we have a string to sanitize.
DO NOT return early, as this will return the wrong type if
the user has requested a DOM object rather than a string */
ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Fe(e)){if("function"!=typeof e.toString)throw Ly("toString is not a function");if("string"!=typeof(e=e.toString()))throw Ly("dirty is not a string, aborting")}
/* Return dirty HTML if DOMPurify cannot run */if(!n.isSupported)return e;
/* Assign config vars */if(Q||Ne(t)
/* Clean up removed elements */,n.removed=[],
/* Check if dirty is correctly typed for IN_PLACE */
"string"==typeof e&&(ae=!1),ae){
/* Do some early pre-sanitization to avoid unsafe root nodes */
if(e.nodeName){const t=xe(e.nodeName);if(!F[t]||$[t])throw Ly("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)
/* If dirty is a DOM element, append to an empty document to avoid
elements being stripped by the parser */
o=Le("\x3c!----\x3e"),s=o.ownerDocument.importNode(e,!0),1===s.nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?
/* Node is already a body, use as is */
o=s:
// eslint-disable-next-line unicorn/prefer-dom-node-append
o.appendChild(s);else{
/* Exit directly if we have nothing to do */
if(!ee&&!G&&!Z&&
// eslint-disable-next-line unicorn/prefer-includes
-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;
/* Initialize the document to work on */
/* Check we have a DOM node from the data */
if(o=Le(e),!o)return ee?null:ne?E:""}
/* Remove first element node (ours) if FORCE_BODY is set */o&&J&&Pe(o.firstChild)
/* Get node iterator */;const c=Me(ae?e:o);
/* Now start iterating over the created document */for(;i=c.nextNode();)
/* Sanitize tags and elements */
ze(i)||(
/* Shadow DOM detected, sanitize it */
i.content instanceof a&&Ve(i.content)
/* Check attributes, sanitize if necessary */,$e(i));
/* If we sanitized `dirty` in-place, return it. */if(ae)return e;
/* Return sanitized string or DOM */if(ee){if(te)for(d=k.call(o.ownerDocument);o.firstChild;)
// eslint-disable-next-line unicorn/prefer-dom-node-append
d.appendChild(o.firstChild);else d=o;return(z.shadowroot||z.shadowrootmode)&&(
/*
AdoptNode() is not used because internal state is not reset
(e.g. the past names map of a HTMLFormElement), this is safe
in theory but we would rather not risk another attack vector.
The state that is cloned by importNode() is explicitly defined
by the specs.
*/
d=N.call(r,d,!0)),d}let u=Z?o.outerHTML:o.innerHTML;
/* Serialize doctype if allowed */return Z&&F["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Dy(iC,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u)
/* Sanitize final string template-safe */,G&&_y([A,T,O],(e=>{u=Ty(u,e," ")})),w&&ne?w.createHTML(u):u},
/**
* Public method to set the configuration once
* setConfig
*
* @param {Object} cfg configuration object
*/
n.setConfig=function(){Ne(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},
/**
* Public method to remove the configuration
* clearConfig
*
*/
n.clearConfig=function(){_e=null,Q=!1},
/**
* Public method to check if an attribute value is valid.
* Uses last set config, if any. Otherwise, uses config defaults.
* isValidAttribute
*
* @param {String} tag Tag name of containing element.
* @param {String} attr Attribute name.
* @param {String} value Attribute value.
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
*/
n.isValidAttribute=function(e,t,n){
/* Initialize shared config vars if necessary. */
_e||Ne({});const o=xe(e),r=xe(t);return je(o,r,n)},
/**
* AddHook
* Public method to add DOMPurify hooks
*
* @param {String} entryPoint entry point for the hook to add
* @param {Function} hookFunction function to execute
*/
n.addHook=function(e,t){"function"==typeof t&&(R[e]=R[e]||[],Sy(R[e],t))},
/**
* RemoveHook
* Public method to remove a DOMPurify hook at a given entryPoint
* (pops it from the stack of hooks if more are present)
*
* @param {String} entryPoint entry point for the hook to remove
* @return {Function} removed(popped) hook
*/
n.removeHook=function(e){if(R[e])return ky(R[e])},
/**
* RemoveHooks
* Public method to remove all DOMPurify hooks at a given entryPoint
*
* @param {String} entryPoint entry point for the hooks to remove
*/
n.removeHooks=function(e){R[e]&&(R[e]=[])},
/**
* RemoveAllHooks
* Public method to remove all DOMPurify hooks
*/
n.removeAllHooks=function(){R={}},n}();const mC=Dt.each,fC=Dt.trim,gC=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],pC={ftp:21,http:80,https:443,mailto:25},hC=["img","video"],bC=(e,t,n)=>{const o=(e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}})(t).replace(/\s/g,"");return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(o)||!e.allow_html_data_urls&&(/^data:image\//i.test(o)?((e,t)=>C(e)?!e:!C(t)||!H(hC,t))(e.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(o):/^data:/i.test(o)))};class vC{static parseDataUri(e){let t;const n=decodeURIComponent(e).split(","),o=/data:([^;]+)/.exec(n[0]);return o&&(t=o[1]),{type:t,data:n[1]}}static isDomSafe(e,t,n={}){if(n.allow_script_urls)return!0;{const o=Cs.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!bC(n,o,t)}}static getDocumentBaseUrl(e){var t;let n;return n=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?null!==(t=e.href)&&void 0!==t?t:"":e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),n}constructor(e,t={}){this.path="",this.directory="",e=fC(e),this.settings=t;const n=t.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(o.source=e);const r=0===e.indexOf("//");if(0!==e.indexOf("/")||r||(e=(n&&n.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){const t=n?n.path:new vC(document.location.href).directory;if(""===(null==n?void 0:n.protocol))e="//mce_host"+o.toAbsPath(t,e);else{const r=/([^#?]*)([#?]?.*)/.exec(e);r&&(e=(n&&n.protocol||"http")+"://mce_host"+o.toAbsPath(t,r[1])+r[2])}}e=e.replace(/@@/g,"(mce_at)");const s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);s&&mC(gC,((e,t)=>{let n=s[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n})),n&&(o.protocol||(o.protocol=n.protocol),o.userInfo||(o.userInfo=n.userInfo),o.port||"mce_host"!==o.host||(o.port=n.port),o.host&&"mce_host"!==o.host||(o.host=n.host),o.source=""),r&&(o.protocol="")}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);t&&(this.path=t[0],this.directory=t[1],this.file=t[2]),this.source="",this.getURI()}toRelative(e){if("./"===e)return e;const t=new vC(e,{base_uri:this});if("mce_host"!==t.host&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&""!==t.protocol)return t.getURI();const n=this.getURI(),o=t.getURI();if(n===o||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===o)return n;let r=this.toRelPath(this.path,t.path);return t.query&&(r+="?"+t.query),t.anchor&&(r+="#"+t.anchor),r}toAbsolute(e,t){const n=new vC(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;const t=this.protocol?pC[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let n,o,r=0,s="";const a=e.substring(0,e.lastIndexOf("/")).split("/"),i=t.split("/");if(a.length>=i.length)for(n=0,o=a.length;n<o;n++)if(n>=i.length||a[n]!==i[n]){r=n+1;break}if(a.length<i.length)for(n=0,o=i.length;n<o;n++)if(n>=a.length||a[n]!==i[n]){r=n+1;break}if(1===r)return t;for(n=0,o=a.length-(r-1);n<o;n++)s+="../";for(n=r-1,o=i.length;n<o;n++)s+=n!==r-1?"/"+i[n]:i[n];return s}toAbsPath(e,t){let n=0;const o=/\/$/.test(t)?"/":"",r=e.split("/"),s=t.split("/"),a=[];mC(r,(e=>{e&&a.push(e)}));const i=[];for(let e=s.length-1;e>=0;e--)0!==s[e].length&&"."!==s[e]&&(".."!==s[e]?n>0?n--:i.push(s[e]):n++);const l=a.length-n;let d;return d=l<=0?oe(i).join("/"):a.slice(0,l).join("/")+"/"+oe(i).join("/"),0!==d.indexOf("/")&&(d="/"+d),o&&d.lastIndexOf("/")!==d.length-1&&(d+=o),d}getURI(e=!1){let t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),th