@everymatrix/nuts-inbox-widget 1.72.2 → 1.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40559,6 +40559,1574 @@ const dateFnsLocales = /*#__PURE__*/Object.freeze({
40559
40559
  zhTW: locale$1
40560
40560
  });
40561
40561
 
40562
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
40563
+
40564
+ var purify = {exports: {}};
40565
+
40566
+ /*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
40567
+
40568
+ (function (module, exports) {
40569
+ (function (global, factory) {
40570
+ module.exports = factory() ;
40571
+ })(commonjsGlobal, (function () {
40572
+ const {
40573
+ entries,
40574
+ setPrototypeOf,
40575
+ isFrozen,
40576
+ getPrototypeOf,
40577
+ getOwnPropertyDescriptor
40578
+ } = Object;
40579
+ let {
40580
+ freeze,
40581
+ seal,
40582
+ create
40583
+ } = Object; // eslint-disable-line import/no-mutable-exports
40584
+ let {
40585
+ apply,
40586
+ construct
40587
+ } = typeof Reflect !== 'undefined' && Reflect;
40588
+ if (!freeze) {
40589
+ freeze = function freeze(x) {
40590
+ return x;
40591
+ };
40592
+ }
40593
+ if (!seal) {
40594
+ seal = function seal(x) {
40595
+ return x;
40596
+ };
40597
+ }
40598
+ if (!apply) {
40599
+ apply = function apply(fun, thisValue, args) {
40600
+ return fun.apply(thisValue, args);
40601
+ };
40602
+ }
40603
+ if (!construct) {
40604
+ construct = function construct(Func, args) {
40605
+ return new Func(...args);
40606
+ };
40607
+ }
40608
+ const arrayForEach = unapply(Array.prototype.forEach);
40609
+ const arrayPop = unapply(Array.prototype.pop);
40610
+ const arrayPush = unapply(Array.prototype.push);
40611
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
40612
+ const stringToString = unapply(String.prototype.toString);
40613
+ const stringMatch = unapply(String.prototype.match);
40614
+ const stringReplace = unapply(String.prototype.replace);
40615
+ const stringIndexOf = unapply(String.prototype.indexOf);
40616
+ const stringTrim = unapply(String.prototype.trim);
40617
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
40618
+ const regExpTest = unapply(RegExp.prototype.test);
40619
+ const typeErrorCreate = unconstruct(TypeError);
40620
+
40621
+ /**
40622
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
40623
+ *
40624
+ * @param {Function} func - The function to be wrapped and called.
40625
+ * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.
40626
+ */
40627
+ function unapply(func) {
40628
+ return function (thisArg) {
40629
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
40630
+ args[_key - 1] = arguments[_key];
40631
+ }
40632
+ return apply(func, thisArg, args);
40633
+ };
40634
+ }
40635
+
40636
+ /**
40637
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
40638
+ *
40639
+ * @param {Function} func - The constructor function to be wrapped and called.
40640
+ * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.
40641
+ */
40642
+ function unconstruct(func) {
40643
+ return function () {
40644
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
40645
+ args[_key2] = arguments[_key2];
40646
+ }
40647
+ return construct(func, args);
40648
+ };
40649
+ }
40650
+
40651
+ /**
40652
+ * Add properties to a lookup table
40653
+ *
40654
+ * @param {Object} set - The set to which elements will be added.
40655
+ * @param {Array} array - The array containing elements to be added to the set.
40656
+ * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.
40657
+ * @returns {Object} The modified set with added elements.
40658
+ */
40659
+ function addToSet(set, array) {
40660
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
40661
+ if (setPrototypeOf) {
40662
+ // Make 'in' and truthy checks like Boolean(set.constructor)
40663
+ // independent of any properties defined on Object.prototype.
40664
+ // Prevent prototype setters from intercepting set as a this value.
40665
+ setPrototypeOf(set, null);
40666
+ }
40667
+ let l = array.length;
40668
+ while (l--) {
40669
+ let element = array[l];
40670
+ if (typeof element === 'string') {
40671
+ const lcElement = transformCaseFunc(element);
40672
+ if (lcElement !== element) {
40673
+ // Config presets (e.g. tags.js, attrs.js) are immutable.
40674
+ if (!isFrozen(array)) {
40675
+ array[l] = lcElement;
40676
+ }
40677
+ element = lcElement;
40678
+ }
40679
+ }
40680
+ set[element] = true;
40681
+ }
40682
+ return set;
40683
+ }
40684
+
40685
+ /**
40686
+ * Clean up an array to harden against CSPP
40687
+ *
40688
+ * @param {Array} array - The array to be cleaned.
40689
+ * @returns {Array} The cleaned version of the array
40690
+ */
40691
+ function cleanArray(array) {
40692
+ for (let index = 0; index < array.length; index++) {
40693
+ const isPropertyExist = objectHasOwnProperty(array, index);
40694
+ if (!isPropertyExist) {
40695
+ array[index] = null;
40696
+ }
40697
+ }
40698
+ return array;
40699
+ }
40700
+
40701
+ /**
40702
+ * Shallow clone an object
40703
+ *
40704
+ * @param {Object} object - The object to be cloned.
40705
+ * @returns {Object} A new object that copies the original.
40706
+ */
40707
+ function clone(object) {
40708
+ const newObject = create(null);
40709
+ for (const [property, value] of entries(object)) {
40710
+ const isPropertyExist = objectHasOwnProperty(object, property);
40711
+ if (isPropertyExist) {
40712
+ if (Array.isArray(value)) {
40713
+ newObject[property] = cleanArray(value);
40714
+ } else if (value && typeof value === 'object' && value.constructor === Object) {
40715
+ newObject[property] = clone(value);
40716
+ } else {
40717
+ newObject[property] = value;
40718
+ }
40719
+ }
40720
+ }
40721
+ return newObject;
40722
+ }
40723
+
40724
+ /**
40725
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
40726
+ *
40727
+ * @param {Object} object - The object to look up the getter function in its prototype chain.
40728
+ * @param {String} prop - The property name for which to find the getter function.
40729
+ * @returns {Function} The getter function found in the prototype chain or a fallback function.
40730
+ */
40731
+ function lookupGetter(object, prop) {
40732
+ while (object !== null) {
40733
+ const desc = getOwnPropertyDescriptor(object, prop);
40734
+ if (desc) {
40735
+ if (desc.get) {
40736
+ return unapply(desc.get);
40737
+ }
40738
+ if (typeof desc.value === 'function') {
40739
+ return unapply(desc.value);
40740
+ }
40741
+ }
40742
+ object = getPrototypeOf(object);
40743
+ }
40744
+ function fallbackValue() {
40745
+ return null;
40746
+ }
40747
+ return fallbackValue;
40748
+ }
40749
+
40750
+ const html$1 = freeze(['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']);
40751
+
40752
+ // SVG
40753
+ const svg$1 = freeze(['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']);
40754
+ const svgFilters = freeze(['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']);
40755
+
40756
+ // List of SVG elements that are disallowed by default.
40757
+ // We still need to know them so that we can do namespace
40758
+ // checks properly in case one wants to add them to
40759
+ // allow-list.
40760
+ const svgDisallowed = freeze(['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']);
40761
+ const mathMl$1 = freeze(['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']);
40762
+
40763
+ // Similarly to SVG, we want to know all MathML elements,
40764
+ // even those that we disallow by default.
40765
+ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
40766
+ const text = freeze(['#text']);
40767
+
40768
+ const html = freeze(['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']);
40769
+ const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
40770
+ const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
40771
+ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
40772
+
40773
+ // eslint-disable-next-line unicorn/better-regex
40774
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
40775
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
40776
+ const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
40777
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
40778
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
40779
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
40780
+ );
40781
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
40782
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
40783
+ );
40784
+ const DOCTYPE_NAME = seal(/^html$/i);
40785
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
40786
+
40787
+ var EXPRESSIONS = /*#__PURE__*/Object.freeze({
40788
+ __proto__: null,
40789
+ MUSTACHE_EXPR: MUSTACHE_EXPR,
40790
+ ERB_EXPR: ERB_EXPR,
40791
+ TMPLIT_EXPR: TMPLIT_EXPR,
40792
+ DATA_ATTR: DATA_ATTR,
40793
+ ARIA_ATTR: ARIA_ATTR,
40794
+ IS_ALLOWED_URI: IS_ALLOWED_URI,
40795
+ IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
40796
+ ATTR_WHITESPACE: ATTR_WHITESPACE,
40797
+ DOCTYPE_NAME: DOCTYPE_NAME,
40798
+ CUSTOM_ELEMENT: CUSTOM_ELEMENT
40799
+ });
40800
+
40801
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
40802
+ const NODE_TYPE = {
40803
+ element: 1,
40804
+ attribute: 2,
40805
+ text: 3,
40806
+ cdataSection: 4,
40807
+ entityReference: 5,
40808
+ // Deprecated
40809
+ entityNode: 6,
40810
+ // Deprecated
40811
+ progressingInstruction: 7,
40812
+ comment: 8,
40813
+ document: 9,
40814
+ documentType: 10,
40815
+ documentFragment: 11,
40816
+ notation: 12 // Deprecated
40817
+ };
40818
+ const getGlobal = function getGlobal() {
40819
+ return typeof window === 'undefined' ? null : window;
40820
+ };
40821
+
40822
+ /**
40823
+ * Creates a no-op policy for internal use only.
40824
+ * Don't export this function outside this module!
40825
+ * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.
40826
+ * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
40827
+ * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types
40828
+ * are not supported or creating the policy failed).
40829
+ */
40830
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
40831
+ if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
40832
+ return null;
40833
+ }
40834
+
40835
+ // Allow the callers to control the unique policy name
40836
+ // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
40837
+ // Policy creation with duplicate names throws in Trusted Types.
40838
+ let suffix = null;
40839
+ const ATTR_NAME = 'data-tt-policy-suffix';
40840
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
40841
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
40842
+ }
40843
+ const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
40844
+ try {
40845
+ return trustedTypes.createPolicy(policyName, {
40846
+ createHTML(html) {
40847
+ return html;
40848
+ },
40849
+ createScriptURL(scriptUrl) {
40850
+ return scriptUrl;
40851
+ }
40852
+ });
40853
+ } catch (_) {
40854
+ // Policy creation failed (most likely another DOMPurify script has
40855
+ // already run). Skip creating the policy, as this will only cause errors
40856
+ // if TT are enforced.
40857
+ console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
40858
+ return null;
40859
+ }
40860
+ };
40861
+ function createDOMPurify() {
40862
+ let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
40863
+ const DOMPurify = root => createDOMPurify(root);
40864
+
40865
+ /**
40866
+ * Version label, exposed for easier checks
40867
+ * if DOMPurify is up to date or not
40868
+ */
40869
+ DOMPurify.version = '3.1.6';
40870
+
40871
+ /**
40872
+ * Array of elements that DOMPurify removed during sanitation.
40873
+ * Empty if nothing was removed.
40874
+ */
40875
+ DOMPurify.removed = [];
40876
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
40877
+ // Not running in a browser, provide a factory function
40878
+ // so that you can pass your own Window
40879
+ DOMPurify.isSupported = false;
40880
+ return DOMPurify;
40881
+ }
40882
+ let {
40883
+ document
40884
+ } = window;
40885
+ const originalDocument = document;
40886
+ const currentScript = originalDocument.currentScript;
40887
+ const {
40888
+ DocumentFragment,
40889
+ HTMLTemplateElement,
40890
+ Node,
40891
+ Element,
40892
+ NodeFilter,
40893
+ NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
40894
+ HTMLFormElement,
40895
+ DOMParser,
40896
+ trustedTypes
40897
+ } = window;
40898
+ const ElementPrototype = Element.prototype;
40899
+ const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
40900
+ const remove = lookupGetter(ElementPrototype, 'remove');
40901
+ const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
40902
+ const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
40903
+ const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
40904
+
40905
+ // As per issue #47, the web-components registry is inherited by a
40906
+ // new document created via createHTMLDocument. As per the spec
40907
+ // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
40908
+ // a new empty registry is used when creating a template contents owner
40909
+ // document, so we use that as our parent document to ensure nothing
40910
+ // is inherited.
40911
+ if (typeof HTMLTemplateElement === 'function') {
40912
+ const template = document.createElement('template');
40913
+ if (template.content && template.content.ownerDocument) {
40914
+ document = template.content.ownerDocument;
40915
+ }
40916
+ }
40917
+ let trustedTypesPolicy;
40918
+ let emptyHTML = '';
40919
+ const {
40920
+ implementation,
40921
+ createNodeIterator,
40922
+ createDocumentFragment,
40923
+ getElementsByTagName
40924
+ } = document;
40925
+ const {
40926
+ importNode
40927
+ } = originalDocument;
40928
+ let hooks = {};
40929
+
40930
+ /**
40931
+ * Expose whether this browser supports running the full DOMPurify.
40932
+ */
40933
+ DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
40934
+ const {
40935
+ MUSTACHE_EXPR,
40936
+ ERB_EXPR,
40937
+ TMPLIT_EXPR,
40938
+ DATA_ATTR,
40939
+ ARIA_ATTR,
40940
+ IS_SCRIPT_OR_DATA,
40941
+ ATTR_WHITESPACE,
40942
+ CUSTOM_ELEMENT
40943
+ } = EXPRESSIONS;
40944
+ let {
40945
+ IS_ALLOWED_URI: IS_ALLOWED_URI$1
40946
+ } = EXPRESSIONS;
40947
+
40948
+ /**
40949
+ * We consider the elements and attributes below to be safe. Ideally
40950
+ * don't add any new ones but feel free to remove unwanted ones.
40951
+ */
40952
+
40953
+ /* allowed element names */
40954
+ let ALLOWED_TAGS = null;
40955
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
40956
+
40957
+ /* Allowed attribute names */
40958
+ let ALLOWED_ATTR = null;
40959
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
40960
+
40961
+ /*
40962
+ * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.
40963
+ * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
40964
+ * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
40965
+ * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
40966
+ */
40967
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
40968
+ tagNameCheck: {
40969
+ writable: true,
40970
+ configurable: false,
40971
+ enumerable: true,
40972
+ value: null
40973
+ },
40974
+ attributeNameCheck: {
40975
+ writable: true,
40976
+ configurable: false,
40977
+ enumerable: true,
40978
+ value: null
40979
+ },
40980
+ allowCustomizedBuiltInElements: {
40981
+ writable: true,
40982
+ configurable: false,
40983
+ enumerable: true,
40984
+ value: false
40985
+ }
40986
+ }));
40987
+
40988
+ /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
40989
+ let FORBID_TAGS = null;
40990
+
40991
+ /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
40992
+ let FORBID_ATTR = null;
40993
+
40994
+ /* Decide if ARIA attributes are okay */
40995
+ let ALLOW_ARIA_ATTR = true;
40996
+
40997
+ /* Decide if custom data attributes are okay */
40998
+ let ALLOW_DATA_ATTR = true;
40999
+
41000
+ /* Decide if unknown protocols are okay */
41001
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
41002
+
41003
+ /* Decide if self-closing tags in attributes are allowed.
41004
+ * Usually removed due to a mXSS issue in jQuery 3.0 */
41005
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
41006
+
41007
+ /* Output should be safe for common template engines.
41008
+ * This means, DOMPurify removes data attributes, mustaches and ERB
41009
+ */
41010
+ let SAFE_FOR_TEMPLATES = false;
41011
+
41012
+ /* Output should be safe even for XML used within HTML and alike.
41013
+ * This means, DOMPurify removes comments when containing risky content.
41014
+ */
41015
+ let SAFE_FOR_XML = true;
41016
+
41017
+ /* Decide if document with <html>... should be returned */
41018
+ let WHOLE_DOCUMENT = false;
41019
+
41020
+ /* Track whether config is already set on this instance of DOMPurify. */
41021
+ let SET_CONFIG = false;
41022
+
41023
+ /* Decide if all elements (e.g. style, script) must be children of
41024
+ * document.body. By default, browsers might move them to document.head */
41025
+ let FORCE_BODY = false;
41026
+
41027
+ /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
41028
+ * string (or a TrustedHTML object if Trusted Types are supported).
41029
+ * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
41030
+ */
41031
+ let RETURN_DOM = false;
41032
+
41033
+ /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
41034
+ * string (or a TrustedHTML object if Trusted Types are supported) */
41035
+ let RETURN_DOM_FRAGMENT = false;
41036
+
41037
+ /* Try to return a Trusted Type object instead of a string, return a string in
41038
+ * case Trusted Types are not supported */
41039
+ let RETURN_TRUSTED_TYPE = false;
41040
+
41041
+ /* Output should be free from DOM clobbering attacks?
41042
+ * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
41043
+ */
41044
+ let SANITIZE_DOM = true;
41045
+
41046
+ /* Achieve full DOM Clobbering protection by isolating the namespace of named
41047
+ * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
41048
+ *
41049
+ * HTML/DOM spec rules that enable DOM Clobbering:
41050
+ * - Named Access on Window (§7.3.3)
41051
+ * - DOM Tree Accessors (§3.1.5)
41052
+ * - Form Element Parent-Child Relations (§4.10.3)
41053
+ * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
41054
+ * - HTMLCollection (§4.2.10.2)
41055
+ *
41056
+ * Namespace isolation is implemented by prefixing `id` and `name` attributes
41057
+ * with a constant string, i.e., `user-content-`
41058
+ */
41059
+ let SANITIZE_NAMED_PROPS = false;
41060
+ const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
41061
+
41062
+ /* Keep element content when removing element? */
41063
+ let KEEP_CONTENT = true;
41064
+
41065
+ /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
41066
+ * of importing it into a new Document and returning a sanitized copy */
41067
+ let IN_PLACE = false;
41068
+
41069
+ /* Allow usage of profiles like html, svg and mathMl */
41070
+ let USE_PROFILES = {};
41071
+
41072
+ /* Tags to ignore content of when KEEP_CONTENT is true */
41073
+ let FORBID_CONTENTS = null;
41074
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ['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']);
41075
+
41076
+ /* Tags that are safe for data: URIs */
41077
+ let DATA_URI_TAGS = null;
41078
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
41079
+
41080
+ /* Attributes safe for values like "javascript:" */
41081
+ let URI_SAFE_ATTRIBUTES = null;
41082
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
41083
+ const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
41084
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
41085
+ const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
41086
+ /* Document namespace */
41087
+ let NAMESPACE = HTML_NAMESPACE;
41088
+ let IS_EMPTY_INPUT = false;
41089
+
41090
+ /* Allowed XHTML+XML namespaces */
41091
+ let ALLOWED_NAMESPACES = null;
41092
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
41093
+
41094
+ /* Parsing of strict XHTML documents */
41095
+ let PARSER_MEDIA_TYPE = null;
41096
+ const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
41097
+ const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
41098
+ let transformCaseFunc = null;
41099
+
41100
+ /* Keep a reference to config to pass to hooks */
41101
+ let CONFIG = null;
41102
+
41103
+ /* Ideally, do not touch anything below this line */
41104
+ /* ______________________________________________ */
41105
+
41106
+ const formElement = document.createElement('form');
41107
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
41108
+ return testValue instanceof RegExp || testValue instanceof Function;
41109
+ };
41110
+
41111
+ /**
41112
+ * _parseConfig
41113
+ *
41114
+ * @param {Object} cfg optional config literal
41115
+ */
41116
+ // eslint-disable-next-line complexity
41117
+ const _parseConfig = function _parseConfig() {
41118
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
41119
+ if (CONFIG && CONFIG === cfg) {
41120
+ return;
41121
+ }
41122
+
41123
+ /* Shield configuration object from tampering */
41124
+ if (!cfg || typeof cfg !== 'object') {
41125
+ cfg = {};
41126
+ }
41127
+
41128
+ /* Shield configuration object from prototype pollution */
41129
+ cfg = clone(cfg);
41130
+ PARSER_MEDIA_TYPE =
41131
+ // eslint-disable-next-line unicorn/prefer-includes
41132
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
41133
+
41134
+ // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
41135
+ transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
41136
+
41137
+ /* Set configuration parameters */
41138
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
41139
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
41140
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
41141
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),
41142
+ // eslint-disable-line indent
41143
+ cfg.ADD_URI_SAFE_ATTR,
41144
+ // eslint-disable-line indent
41145
+ transformCaseFunc // eslint-disable-line indent
41146
+ ) // eslint-disable-line indent
41147
+ : DEFAULT_URI_SAFE_ATTRIBUTES;
41148
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),
41149
+ // eslint-disable-line indent
41150
+ cfg.ADD_DATA_URI_TAGS,
41151
+ // eslint-disable-line indent
41152
+ transformCaseFunc // eslint-disable-line indent
41153
+ ) // eslint-disable-line indent
41154
+ : DEFAULT_DATA_URI_TAGS;
41155
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
41156
+ FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
41157
+ FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
41158
+ USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
41159
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
41160
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
41161
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
41162
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
41163
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
41164
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
41165
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
41166
+ RETURN_DOM = cfg.RETURN_DOM || false; // Default false
41167
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
41168
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
41169
+ FORCE_BODY = cfg.FORCE_BODY || false; // Default false
41170
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
41171
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
41172
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
41173
+ IN_PLACE = cfg.IN_PLACE || false; // Default false
41174
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
41175
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
41176
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
41177
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
41178
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
41179
+ }
41180
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
41181
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
41182
+ }
41183
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
41184
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
41185
+ }
41186
+ if (SAFE_FOR_TEMPLATES) {
41187
+ ALLOW_DATA_ATTR = false;
41188
+ }
41189
+ if (RETURN_DOM_FRAGMENT) {
41190
+ RETURN_DOM = true;
41191
+ }
41192
+
41193
+ /* Parse profile info */
41194
+ if (USE_PROFILES) {
41195
+ ALLOWED_TAGS = addToSet({}, text);
41196
+ ALLOWED_ATTR = [];
41197
+ if (USE_PROFILES.html === true) {
41198
+ addToSet(ALLOWED_TAGS, html$1);
41199
+ addToSet(ALLOWED_ATTR, html);
41200
+ }
41201
+ if (USE_PROFILES.svg === true) {
41202
+ addToSet(ALLOWED_TAGS, svg$1);
41203
+ addToSet(ALLOWED_ATTR, svg);
41204
+ addToSet(ALLOWED_ATTR, xml);
41205
+ }
41206
+ if (USE_PROFILES.svgFilters === true) {
41207
+ addToSet(ALLOWED_TAGS, svgFilters);
41208
+ addToSet(ALLOWED_ATTR, svg);
41209
+ addToSet(ALLOWED_ATTR, xml);
41210
+ }
41211
+ if (USE_PROFILES.mathMl === true) {
41212
+ addToSet(ALLOWED_TAGS, mathMl$1);
41213
+ addToSet(ALLOWED_ATTR, mathMl);
41214
+ addToSet(ALLOWED_ATTR, xml);
41215
+ }
41216
+ }
41217
+
41218
+ /* Merge configuration parameters */
41219
+ if (cfg.ADD_TAGS) {
41220
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
41221
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
41222
+ }
41223
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
41224
+ }
41225
+ if (cfg.ADD_ATTR) {
41226
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
41227
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
41228
+ }
41229
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
41230
+ }
41231
+ if (cfg.ADD_URI_SAFE_ATTR) {
41232
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
41233
+ }
41234
+ if (cfg.FORBID_CONTENTS) {
41235
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
41236
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
41237
+ }
41238
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
41239
+ }
41240
+
41241
+ /* Add #text in case KEEP_CONTENT is set to true */
41242
+ if (KEEP_CONTENT) {
41243
+ ALLOWED_TAGS['#text'] = true;
41244
+ }
41245
+
41246
+ /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
41247
+ if (WHOLE_DOCUMENT) {
41248
+ addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
41249
+ }
41250
+
41251
+ /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
41252
+ if (ALLOWED_TAGS.table) {
41253
+ addToSet(ALLOWED_TAGS, ['tbody']);
41254
+ delete FORBID_TAGS.tbody;
41255
+ }
41256
+ if (cfg.TRUSTED_TYPES_POLICY) {
41257
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
41258
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
41259
+ }
41260
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
41261
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
41262
+ }
41263
+
41264
+ // Overwrite existing TrustedTypes policy.
41265
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
41266
+
41267
+ // Sign local variables required by `sanitize`.
41268
+ emptyHTML = trustedTypesPolicy.createHTML('');
41269
+ } else {
41270
+ // Uninitialized policy, attempt to initialize the internal dompurify policy.
41271
+ if (trustedTypesPolicy === undefined) {
41272
+ trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
41273
+ }
41274
+
41275
+ // If creating the internal policy succeeded sign internal variables.
41276
+ if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
41277
+ emptyHTML = trustedTypesPolicy.createHTML('');
41278
+ }
41279
+ }
41280
+
41281
+ // Prevent further manipulation of configuration.
41282
+ // Not available in IE8, Safari 5, etc.
41283
+ if (freeze) {
41284
+ freeze(cfg);
41285
+ }
41286
+ CONFIG = cfg;
41287
+ };
41288
+ const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
41289
+ const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
41290
+
41291
+ // Certain elements are allowed in both SVG and HTML
41292
+ // namespace. We need to specify them explicitly
41293
+ // so that they don't get erroneously deleted from
41294
+ // HTML namespace.
41295
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
41296
+
41297
+ /* Keep track of all possible SVG and MathML tags
41298
+ * so that we can perform the namespace checks
41299
+ * correctly. */
41300
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
41301
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
41302
+
41303
+ /**
41304
+ * @param {Element} element a DOM element whose namespace is being checked
41305
+ * @returns {boolean} Return false if the element has a
41306
+ * namespace that a spec-compliant parser would never
41307
+ * return. Return true otherwise.
41308
+ */
41309
+ const _checkValidNamespace = function _checkValidNamespace(element) {
41310
+ let parent = getParentNode(element);
41311
+
41312
+ // In JSDOM, if we're inside shadow DOM, then parentNode
41313
+ // can be null. We just simulate parent in this case.
41314
+ if (!parent || !parent.tagName) {
41315
+ parent = {
41316
+ namespaceURI: NAMESPACE,
41317
+ tagName: 'template'
41318
+ };
41319
+ }
41320
+ const tagName = stringToLowerCase(element.tagName);
41321
+ const parentTagName = stringToLowerCase(parent.tagName);
41322
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
41323
+ return false;
41324
+ }
41325
+ if (element.namespaceURI === SVG_NAMESPACE) {
41326
+ // The only way to switch from HTML namespace to SVG
41327
+ // is via <svg>. If it happens via any other tag, then
41328
+ // it should be killed.
41329
+ if (parent.namespaceURI === HTML_NAMESPACE) {
41330
+ return tagName === 'svg';
41331
+ }
41332
+
41333
+ // The only way to switch from MathML to SVG is via`
41334
+ // svg if parent is either <annotation-xml> or MathML
41335
+ // text integration points.
41336
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
41337
+ return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
41338
+ }
41339
+
41340
+ // We only allow elements that are defined in SVG
41341
+ // spec. All others are disallowed in SVG namespace.
41342
+ return Boolean(ALL_SVG_TAGS[tagName]);
41343
+ }
41344
+ if (element.namespaceURI === MATHML_NAMESPACE) {
41345
+ // The only way to switch from HTML namespace to MathML
41346
+ // is via <math>. If it happens via any other tag, then
41347
+ // it should be killed.
41348
+ if (parent.namespaceURI === HTML_NAMESPACE) {
41349
+ return tagName === 'math';
41350
+ }
41351
+
41352
+ // The only way to switch from SVG to MathML is via
41353
+ // <math> and HTML integration points
41354
+ if (parent.namespaceURI === SVG_NAMESPACE) {
41355
+ return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
41356
+ }
41357
+
41358
+ // We only allow elements that are defined in MathML
41359
+ // spec. All others are disallowed in MathML namespace.
41360
+ return Boolean(ALL_MATHML_TAGS[tagName]);
41361
+ }
41362
+ if (element.namespaceURI === HTML_NAMESPACE) {
41363
+ // The only way to switch from SVG to HTML is via
41364
+ // HTML integration points, and from MathML to HTML
41365
+ // is via MathML text integration points
41366
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
41367
+ return false;
41368
+ }
41369
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
41370
+ return false;
41371
+ }
41372
+
41373
+ // We disallow tags that are specific for MathML
41374
+ // or SVG and should never appear in HTML namespace
41375
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
41376
+ }
41377
+
41378
+ // For XHTML and XML documents that support custom namespaces
41379
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
41380
+ return true;
41381
+ }
41382
+
41383
+ // The code should never reach this place (this means
41384
+ // that the element somehow got namespace that is not
41385
+ // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
41386
+ // Return false just in case.
41387
+ return false;
41388
+ };
41389
+
41390
+ /**
41391
+ * _forceRemove
41392
+ *
41393
+ * @param {Node} node a DOM node
41394
+ */
41395
+ const _forceRemove = function _forceRemove(node) {
41396
+ arrayPush(DOMPurify.removed, {
41397
+ element: node
41398
+ });
41399
+ try {
41400
+ // eslint-disable-next-line unicorn/prefer-dom-node-remove
41401
+ getParentNode(node).removeChild(node);
41402
+ } catch (_) {
41403
+ remove(node);
41404
+ }
41405
+ };
41406
+
41407
+ /**
41408
+ * _removeAttribute
41409
+ *
41410
+ * @param {String} name an Attribute name
41411
+ * @param {Node} node a DOM node
41412
+ */
41413
+ const _removeAttribute = function _removeAttribute(name, node) {
41414
+ try {
41415
+ arrayPush(DOMPurify.removed, {
41416
+ attribute: node.getAttributeNode(name),
41417
+ from: node
41418
+ });
41419
+ } catch (_) {
41420
+ arrayPush(DOMPurify.removed, {
41421
+ attribute: null,
41422
+ from: node
41423
+ });
41424
+ }
41425
+ node.removeAttribute(name);
41426
+
41427
+ // We void attribute values for unremovable "is"" attributes
41428
+ if (name === 'is' && !ALLOWED_ATTR[name]) {
41429
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
41430
+ try {
41431
+ _forceRemove(node);
41432
+ } catch (_) {}
41433
+ } else {
41434
+ try {
41435
+ node.setAttribute(name, '');
41436
+ } catch (_) {}
41437
+ }
41438
+ }
41439
+ };
41440
+
41441
+ /**
41442
+ * _initDocument
41443
+ *
41444
+ * @param {String} dirty a string of dirty markup
41445
+ * @return {Document} a DOM, filled with the dirty markup
41446
+ */
41447
+ const _initDocument = function _initDocument(dirty) {
41448
+ /* Create a HTML document */
41449
+ let doc = null;
41450
+ let leadingWhitespace = null;
41451
+ if (FORCE_BODY) {
41452
+ dirty = '<remove></remove>' + dirty;
41453
+ } else {
41454
+ /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
41455
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
41456
+ leadingWhitespace = matches && matches[0];
41457
+ }
41458
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
41459
+ // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
41460
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
41461
+ }
41462
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
41463
+ /*
41464
+ * Use the DOMParser API by default, fallback later if needs be
41465
+ * DOMParser not work for svg when has multiple root element.
41466
+ */
41467
+ if (NAMESPACE === HTML_NAMESPACE) {
41468
+ try {
41469
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
41470
+ } catch (_) {}
41471
+ }
41472
+
41473
+ /* Use createHTMLDocument in case DOMParser is not available */
41474
+ if (!doc || !doc.documentElement) {
41475
+ doc = implementation.createDocument(NAMESPACE, 'template', null);
41476
+ try {
41477
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
41478
+ } catch (_) {
41479
+ // Syntax error if dirtyPayload is invalid xml
41480
+ }
41481
+ }
41482
+ const body = doc.body || doc.documentElement;
41483
+ if (dirty && leadingWhitespace) {
41484
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
41485
+ }
41486
+
41487
+ /* Work on whole document or just its body */
41488
+ if (NAMESPACE === HTML_NAMESPACE) {
41489
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
41490
+ }
41491
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
41492
+ };
41493
+
41494
+ /**
41495
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
41496
+ *
41497
+ * @param {Node} root The root element or node to start traversing on.
41498
+ * @return {NodeIterator} The created NodeIterator
41499
+ */
41500
+ const _createNodeIterator = function _createNodeIterator(root) {
41501
+ return createNodeIterator.call(root.ownerDocument || root, root,
41502
+ // eslint-disable-next-line no-bitwise
41503
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
41504
+ };
41505
+
41506
+ /**
41507
+ * _isClobbered
41508
+ *
41509
+ * @param {Node} elm element to check for clobbering attacks
41510
+ * @return {Boolean} true if clobbered, false if safe
41511
+ */
41512
+ const _isClobbered = function _isClobbered(elm) {
41513
+ return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');
41514
+ };
41515
+
41516
+ /**
41517
+ * Checks whether the given object is a DOM node.
41518
+ *
41519
+ * @param {Node} object object to check whether it's a DOM node
41520
+ * @return {Boolean} true is object is a DOM node
41521
+ */
41522
+ const _isNode = function _isNode(object) {
41523
+ return typeof Node === 'function' && object instanceof Node;
41524
+ };
41525
+
41526
+ /**
41527
+ * _executeHook
41528
+ * Execute user configurable hooks
41529
+ *
41530
+ * @param {String} entryPoint Name of the hook's entry point
41531
+ * @param {Node} currentNode node to work on with the hook
41532
+ * @param {Object} data additional hook parameters
41533
+ */
41534
+ const _executeHook = function _executeHook(entryPoint, currentNode, data) {
41535
+ if (!hooks[entryPoint]) {
41536
+ return;
41537
+ }
41538
+ arrayForEach(hooks[entryPoint], hook => {
41539
+ hook.call(DOMPurify, currentNode, data, CONFIG);
41540
+ });
41541
+ };
41542
+
41543
+ /**
41544
+ * _sanitizeElements
41545
+ *
41546
+ * @protect nodeName
41547
+ * @protect textContent
41548
+ * @protect removeChild
41549
+ *
41550
+ * @param {Node} currentNode to check for permission to exist
41551
+ * @return {Boolean} true if node was killed, false if left alive
41552
+ */
41553
+ const _sanitizeElements = function _sanitizeElements(currentNode) {
41554
+ let content = null;
41555
+
41556
+ /* Execute a hook if present */
41557
+ _executeHook('beforeSanitizeElements', currentNode, null);
41558
+
41559
+ /* Check if element is clobbered or can clobber */
41560
+ if (_isClobbered(currentNode)) {
41561
+ _forceRemove(currentNode);
41562
+ return true;
41563
+ }
41564
+
41565
+ /* Now let's check the element's type and name */
41566
+ const tagName = transformCaseFunc(currentNode.nodeName);
41567
+
41568
+ /* Execute a hook if present */
41569
+ _executeHook('uponSanitizeElement', currentNode, {
41570
+ tagName,
41571
+ allowedTags: ALLOWED_TAGS
41572
+ });
41573
+
41574
+ /* Detect mXSS attempts abusing namespace confusion */
41575
+ if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
41576
+ _forceRemove(currentNode);
41577
+ return true;
41578
+ }
41579
+
41580
+ /* Remove any occurrence of processing instructions */
41581
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
41582
+ _forceRemove(currentNode);
41583
+ return true;
41584
+ }
41585
+
41586
+ /* Remove any kind of possibly harmful comments */
41587
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
41588
+ _forceRemove(currentNode);
41589
+ return true;
41590
+ }
41591
+
41592
+ /* Remove element if anything forbids its presence */
41593
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
41594
+ /* Check if we have a custom element to handle */
41595
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
41596
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
41597
+ return false;
41598
+ }
41599
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
41600
+ return false;
41601
+ }
41602
+ }
41603
+
41604
+ /* Keep content except for bad-listed elements */
41605
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
41606
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
41607
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
41608
+ if (childNodes && parentNode) {
41609
+ const childCount = childNodes.length;
41610
+ for (let i = childCount - 1; i >= 0; --i) {
41611
+ const childClone = cloneNode(childNodes[i], true);
41612
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
41613
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
41614
+ }
41615
+ }
41616
+ }
41617
+ _forceRemove(currentNode);
41618
+ return true;
41619
+ }
41620
+
41621
+ /* Check whether element has a valid namespace */
41622
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
41623
+ _forceRemove(currentNode);
41624
+ return true;
41625
+ }
41626
+
41627
+ /* Make sure that older browsers don't get fallback-tag mXSS */
41628
+ if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
41629
+ _forceRemove(currentNode);
41630
+ return true;
41631
+ }
41632
+
41633
+ /* Sanitize element content to be template-safe */
41634
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
41635
+ /* Get the element's text content */
41636
+ content = currentNode.textContent;
41637
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
41638
+ content = stringReplace(content, expr, ' ');
41639
+ });
41640
+ if (currentNode.textContent !== content) {
41641
+ arrayPush(DOMPurify.removed, {
41642
+ element: currentNode.cloneNode()
41643
+ });
41644
+ currentNode.textContent = content;
41645
+ }
41646
+ }
41647
+
41648
+ /* Execute a hook if present */
41649
+ _executeHook('afterSanitizeElements', currentNode, null);
41650
+ return false;
41651
+ };
41652
+
41653
+ /**
41654
+ * _isValidAttribute
41655
+ *
41656
+ * @param {string} lcTag Lowercase tag name of containing element.
41657
+ * @param {string} lcName Lowercase attribute name.
41658
+ * @param {string} value Attribute value.
41659
+ * @return {Boolean} Returns true if `value` is valid, otherwise false.
41660
+ */
41661
+ // eslint-disable-next-line complexity
41662
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
41663
+ /* Make sure attribute cannot clobber */
41664
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
41665
+ return false;
41666
+ }
41667
+
41668
+ /* Allow valid data-* attributes: At least one character after "-"
41669
+ (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
41670
+ XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
41671
+ We don't need to check the value; it's always URI safe. */
41672
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
41673
+ if (
41674
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
41675
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
41676
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
41677
+ _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
41678
+ // Alternative, second condition checks if it's an `is`-attribute, AND
41679
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
41680
+ lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
41681
+ return false;
41682
+ }
41683
+ /* Check value is safe. First, is attr inert? If so, is safe */
41684
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
41685
+ return false;
41686
+ } else ;
41687
+ return true;
41688
+ };
41689
+
41690
+ /**
41691
+ * _isBasicCustomElement
41692
+ * checks if at least one dash is included in tagName, and it's not the first char
41693
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
41694
+ *
41695
+ * @param {string} tagName name of the tag of the node to sanitize
41696
+ * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
41697
+ */
41698
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
41699
+ return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
41700
+ };
41701
+
41702
+ /**
41703
+ * _sanitizeAttributes
41704
+ *
41705
+ * @protect attributes
41706
+ * @protect nodeName
41707
+ * @protect removeAttribute
41708
+ * @protect setAttribute
41709
+ *
41710
+ * @param {Node} currentNode to sanitize
41711
+ */
41712
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
41713
+ /* Execute a hook if present */
41714
+ _executeHook('beforeSanitizeAttributes', currentNode, null);
41715
+ const {
41716
+ attributes
41717
+ } = currentNode;
41718
+
41719
+ /* Check if we have attributes; if not we might have a text node */
41720
+ if (!attributes) {
41721
+ return;
41722
+ }
41723
+ const hookEvent = {
41724
+ attrName: '',
41725
+ attrValue: '',
41726
+ keepAttr: true,
41727
+ allowedAttributes: ALLOWED_ATTR
41728
+ };
41729
+ let l = attributes.length;
41730
+
41731
+ /* Go backwards over all attributes; safely remove bad ones */
41732
+ while (l--) {
41733
+ const attr = attributes[l];
41734
+ const {
41735
+ name,
41736
+ namespaceURI,
41737
+ value: attrValue
41738
+ } = attr;
41739
+ const lcName = transformCaseFunc(name);
41740
+ let value = name === 'value' ? attrValue : stringTrim(attrValue);
41741
+
41742
+ /* Execute a hook if present */
41743
+ hookEvent.attrName = lcName;
41744
+ hookEvent.attrValue = value;
41745
+ hookEvent.keepAttr = true;
41746
+ hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
41747
+ _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
41748
+ value = hookEvent.attrValue;
41749
+
41750
+ /* Work around a security issue with comments inside attributes */
41751
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
41752
+ _removeAttribute(name, currentNode);
41753
+ continue;
41754
+ }
41755
+
41756
+ /* Did the hooks approve of the attribute? */
41757
+ if (hookEvent.forceKeepAttr) {
41758
+ continue;
41759
+ }
41760
+
41761
+ /* Remove attribute */
41762
+ _removeAttribute(name, currentNode);
41763
+
41764
+ /* Did the hooks approve of the attribute? */
41765
+ if (!hookEvent.keepAttr) {
41766
+ continue;
41767
+ }
41768
+
41769
+ /* Work around a security issue in jQuery 3.0 */
41770
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
41771
+ _removeAttribute(name, currentNode);
41772
+ continue;
41773
+ }
41774
+
41775
+ /* Sanitize attribute content to be template-safe */
41776
+ if (SAFE_FOR_TEMPLATES) {
41777
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
41778
+ value = stringReplace(value, expr, ' ');
41779
+ });
41780
+ }
41781
+
41782
+ /* Is `value` valid for this attribute? */
41783
+ const lcTag = transformCaseFunc(currentNode.nodeName);
41784
+ if (!_isValidAttribute(lcTag, lcName, value)) {
41785
+ continue;
41786
+ }
41787
+
41788
+ /* Full DOM Clobbering protection via namespace isolation,
41789
+ * Prefix id and name attributes with `user-content-`
41790
+ */
41791
+ if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
41792
+ // Remove the attribute with this value
41793
+ _removeAttribute(name, currentNode);
41794
+
41795
+ // Prefix the value and later re-create the attribute with the sanitized value
41796
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
41797
+ }
41798
+
41799
+ /* Handle attributes that require Trusted Types */
41800
+ if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
41801
+ if (namespaceURI) ; else {
41802
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
41803
+ case 'TrustedHTML':
41804
+ {
41805
+ value = trustedTypesPolicy.createHTML(value);
41806
+ break;
41807
+ }
41808
+ case 'TrustedScriptURL':
41809
+ {
41810
+ value = trustedTypesPolicy.createScriptURL(value);
41811
+ break;
41812
+ }
41813
+ }
41814
+ }
41815
+ }
41816
+
41817
+ /* Handle invalid data-* attribute set by try-catching it */
41818
+ try {
41819
+ if (namespaceURI) {
41820
+ currentNode.setAttributeNS(namespaceURI, name, value);
41821
+ } else {
41822
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
41823
+ currentNode.setAttribute(name, value);
41824
+ }
41825
+ if (_isClobbered(currentNode)) {
41826
+ _forceRemove(currentNode);
41827
+ } else {
41828
+ arrayPop(DOMPurify.removed);
41829
+ }
41830
+ } catch (_) {}
41831
+ }
41832
+
41833
+ /* Execute a hook if present */
41834
+ _executeHook('afterSanitizeAttributes', currentNode, null);
41835
+ };
41836
+
41837
+ /**
41838
+ * _sanitizeShadowDOM
41839
+ *
41840
+ * @param {DocumentFragment} fragment to iterate over recursively
41841
+ */
41842
+ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
41843
+ let shadowNode = null;
41844
+ const shadowIterator = _createNodeIterator(fragment);
41845
+
41846
+ /* Execute a hook if present */
41847
+ _executeHook('beforeSanitizeShadowDOM', fragment, null);
41848
+ while (shadowNode = shadowIterator.nextNode()) {
41849
+ /* Execute a hook if present */
41850
+ _executeHook('uponSanitizeShadowNode', shadowNode, null);
41851
+
41852
+ /* Sanitize tags and elements */
41853
+ if (_sanitizeElements(shadowNode)) {
41854
+ continue;
41855
+ }
41856
+
41857
+ /* Deep shadow DOM detected */
41858
+ if (shadowNode.content instanceof DocumentFragment) {
41859
+ _sanitizeShadowDOM(shadowNode.content);
41860
+ }
41861
+
41862
+ /* Check attributes, sanitize if necessary */
41863
+ _sanitizeAttributes(shadowNode);
41864
+ }
41865
+
41866
+ /* Execute a hook if present */
41867
+ _executeHook('afterSanitizeShadowDOM', fragment, null);
41868
+ };
41869
+
41870
+ /**
41871
+ * Sanitize
41872
+ * Public method providing core sanitation functionality
41873
+ *
41874
+ * @param {String|Node} dirty string or DOM node
41875
+ * @param {Object} cfg object
41876
+ */
41877
+ // eslint-disable-next-line complexity
41878
+ DOMPurify.sanitize = function (dirty) {
41879
+ let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
41880
+ let body = null;
41881
+ let importedNode = null;
41882
+ let currentNode = null;
41883
+ let returnNode = null;
41884
+ /* Make sure we have a string to sanitize.
41885
+ DO NOT return early, as this will return the wrong type if
41886
+ the user has requested a DOM object rather than a string */
41887
+ IS_EMPTY_INPUT = !dirty;
41888
+ if (IS_EMPTY_INPUT) {
41889
+ dirty = '<!-->';
41890
+ }
41891
+
41892
+ /* Stringify, in case dirty is an object */
41893
+ if (typeof dirty !== 'string' && !_isNode(dirty)) {
41894
+ if (typeof dirty.toString === 'function') {
41895
+ dirty = dirty.toString();
41896
+ if (typeof dirty !== 'string') {
41897
+ throw typeErrorCreate('dirty is not a string, aborting');
41898
+ }
41899
+ } else {
41900
+ throw typeErrorCreate('toString is not a function');
41901
+ }
41902
+ }
41903
+
41904
+ /* Return dirty HTML if DOMPurify cannot run */
41905
+ if (!DOMPurify.isSupported) {
41906
+ return dirty;
41907
+ }
41908
+
41909
+ /* Assign config vars */
41910
+ if (!SET_CONFIG) {
41911
+ _parseConfig(cfg);
41912
+ }
41913
+
41914
+ /* Clean up removed elements */
41915
+ DOMPurify.removed = [];
41916
+
41917
+ /* Check if dirty is correctly typed for IN_PLACE */
41918
+ if (typeof dirty === 'string') {
41919
+ IN_PLACE = false;
41920
+ }
41921
+ if (IN_PLACE) {
41922
+ /* Do some early pre-sanitization to avoid unsafe root nodes */
41923
+ if (dirty.nodeName) {
41924
+ const tagName = transformCaseFunc(dirty.nodeName);
41925
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
41926
+ throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
41927
+ }
41928
+ }
41929
+ } else if (dirty instanceof Node) {
41930
+ /* If dirty is a DOM element, append to an empty document to avoid
41931
+ elements being stripped by the parser */
41932
+ body = _initDocument('<!---->');
41933
+ importedNode = body.ownerDocument.importNode(dirty, true);
41934
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
41935
+ /* Node is already a body, use as is */
41936
+ body = importedNode;
41937
+ } else if (importedNode.nodeName === 'HTML') {
41938
+ body = importedNode;
41939
+ } else {
41940
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
41941
+ body.appendChild(importedNode);
41942
+ }
41943
+ } else {
41944
+ /* Exit directly if we have nothing to do */
41945
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
41946
+ // eslint-disable-next-line unicorn/prefer-includes
41947
+ dirty.indexOf('<') === -1) {
41948
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
41949
+ }
41950
+
41951
+ /* Initialize the document to work on */
41952
+ body = _initDocument(dirty);
41953
+
41954
+ /* Check we have a DOM node from the data */
41955
+ if (!body) {
41956
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
41957
+ }
41958
+ }
41959
+
41960
+ /* Remove first element node (ours) if FORCE_BODY is set */
41961
+ if (body && FORCE_BODY) {
41962
+ _forceRemove(body.firstChild);
41963
+ }
41964
+
41965
+ /* Get node iterator */
41966
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
41967
+
41968
+ /* Now start iterating over the created document */
41969
+ while (currentNode = nodeIterator.nextNode()) {
41970
+ /* Sanitize tags and elements */
41971
+ if (_sanitizeElements(currentNode)) {
41972
+ continue;
41973
+ }
41974
+
41975
+ /* Shadow DOM detected, sanitize it */
41976
+ if (currentNode.content instanceof DocumentFragment) {
41977
+ _sanitizeShadowDOM(currentNode.content);
41978
+ }
41979
+
41980
+ /* Check attributes, sanitize if necessary */
41981
+ _sanitizeAttributes(currentNode);
41982
+ }
41983
+
41984
+ /* If we sanitized `dirty` in-place, return it. */
41985
+ if (IN_PLACE) {
41986
+ return dirty;
41987
+ }
41988
+
41989
+ /* Return sanitized string or DOM */
41990
+ if (RETURN_DOM) {
41991
+ if (RETURN_DOM_FRAGMENT) {
41992
+ returnNode = createDocumentFragment.call(body.ownerDocument);
41993
+ while (body.firstChild) {
41994
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
41995
+ returnNode.appendChild(body.firstChild);
41996
+ }
41997
+ } else {
41998
+ returnNode = body;
41999
+ }
42000
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
42001
+ /*
42002
+ AdoptNode() is not used because internal state is not reset
42003
+ (e.g. the past names map of a HTMLFormElement), this is safe
42004
+ in theory but we would rather not risk another attack vector.
42005
+ The state that is cloned by importNode() is explicitly defined
42006
+ by the specs.
42007
+ */
42008
+ returnNode = importNode.call(originalDocument, returnNode, true);
42009
+ }
42010
+ return returnNode;
42011
+ }
42012
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
42013
+
42014
+ /* Serialize doctype if allowed */
42015
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
42016
+ serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
42017
+ }
42018
+
42019
+ /* Sanitize final string template-safe */
42020
+ if (SAFE_FOR_TEMPLATES) {
42021
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
42022
+ serializedHTML = stringReplace(serializedHTML, expr, ' ');
42023
+ });
42024
+ }
42025
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
42026
+ };
42027
+
42028
+ /**
42029
+ * Public method to set the configuration once
42030
+ * setConfig
42031
+ *
42032
+ * @param {Object} cfg configuration object
42033
+ */
42034
+ DOMPurify.setConfig = function () {
42035
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
42036
+ _parseConfig(cfg);
42037
+ SET_CONFIG = true;
42038
+ };
42039
+
42040
+ /**
42041
+ * Public method to remove the configuration
42042
+ * clearConfig
42043
+ *
42044
+ */
42045
+ DOMPurify.clearConfig = function () {
42046
+ CONFIG = null;
42047
+ SET_CONFIG = false;
42048
+ };
42049
+
42050
+ /**
42051
+ * Public method to check if an attribute value is valid.
42052
+ * Uses last set config, if any. Otherwise, uses config defaults.
42053
+ * isValidAttribute
42054
+ *
42055
+ * @param {String} tag Tag name of containing element.
42056
+ * @param {String} attr Attribute name.
42057
+ * @param {String} value Attribute value.
42058
+ * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
42059
+ */
42060
+ DOMPurify.isValidAttribute = function (tag, attr, value) {
42061
+ /* Initialize shared config vars if necessary. */
42062
+ if (!CONFIG) {
42063
+ _parseConfig({});
42064
+ }
42065
+ const lcTag = transformCaseFunc(tag);
42066
+ const lcName = transformCaseFunc(attr);
42067
+ return _isValidAttribute(lcTag, lcName, value);
42068
+ };
42069
+
42070
+ /**
42071
+ * AddHook
42072
+ * Public method to add DOMPurify hooks
42073
+ *
42074
+ * @param {String} entryPoint entry point for the hook to add
42075
+ * @param {Function} hookFunction function to execute
42076
+ */
42077
+ DOMPurify.addHook = function (entryPoint, hookFunction) {
42078
+ if (typeof hookFunction !== 'function') {
42079
+ return;
42080
+ }
42081
+ hooks[entryPoint] = hooks[entryPoint] || [];
42082
+ arrayPush(hooks[entryPoint], hookFunction);
42083
+ };
42084
+
42085
+ /**
42086
+ * RemoveHook
42087
+ * Public method to remove a DOMPurify hook at a given entryPoint
42088
+ * (pops it from the stack of hooks if more are present)
42089
+ *
42090
+ * @param {String} entryPoint entry point for the hook to remove
42091
+ * @return {Function} removed(popped) hook
42092
+ */
42093
+ DOMPurify.removeHook = function (entryPoint) {
42094
+ if (hooks[entryPoint]) {
42095
+ return arrayPop(hooks[entryPoint]);
42096
+ }
42097
+ };
42098
+
42099
+ /**
42100
+ * RemoveHooks
42101
+ * Public method to remove all DOMPurify hooks at a given entryPoint
42102
+ *
42103
+ * @param {String} entryPoint entry point for the hooks to remove
42104
+ */
42105
+ DOMPurify.removeHooks = function (entryPoint) {
42106
+ if (hooks[entryPoint]) {
42107
+ hooks[entryPoint] = [];
42108
+ }
42109
+ };
42110
+
42111
+ /**
42112
+ * RemoveAllHooks
42113
+ * Public method to remove all DOMPurify hooks
42114
+ */
42115
+ DOMPurify.removeAllHooks = function () {
42116
+ hooks = {};
42117
+ };
42118
+ return DOMPurify;
42119
+ }
42120
+ var purify = createDOMPurify();
42121
+
42122
+ return purify;
42123
+
42124
+ }));
42125
+
42126
+ }(purify));
42127
+
42128
+ const DOMPurify = purify.exports;
42129
+
40562
42130
  // This icon file is generated automatically.
40563
42131
  var CheckCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
40564
42132
  const CheckCircleFilled$1 = CheckCircleFilled;
@@ -40846,10 +42414,15 @@ const NutsNotification = class {
40846
42414
  }
40847
42415
  render() {
40848
42416
  var _a, _b;
40849
- return (index.h("div", { key: '66a913d1f50593857820429c9bef53b8cbeedaa3', class: "Wrapper" }, index.h("div", { key: 'b1aac51872ee099e666c38ac69bac6415be551e5', class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: this.assignRefToStylingContainer, onClick: this.notificationActionHandler }, this.badge ? (index.h("div", { class: "AvatarContainer" }, index.h("div", { class: "Avatar" }, ((_a = systemIcons[this.badge]) === null || _a === void 0 ? void 0 : _a.icon) ? (index.h("div", { innerHTML: systemIcons[this.badge].icon })) : (index.h("img", { class: "AvatarImage", src: this.badge }))))) : (''), index.h("div", { key: '7f7eda2236d90fe1fa8cf992106944e975a1ccb1', class: "ContentContainer" }, index.h("p", { key: '3069b2d25cf00544ba78ae15313085d3be9d4e94' }, this.displayedContent), index.h("p", { key: 'ac3a2862d67d0f93df722d3d459de8ada63014d7', class: "Date" }, formatDistanceToNow(new Date(this.date), {
42417
+ const sanitizedNotificationBody = DOMPurify.sanitize(this.displayedContent, {
42418
+ ALLOW_UNKNOWN_PROTOCOLS: true,
42419
+ ADD_ATTR: ["target"],
42420
+ ALLOWED_TAGS: ['b', 'u', 'i', 'br']
42421
+ });
42422
+ return (index.h("div", { key: '02f77b55becbf6b5064cda7906890ba4cb070741', class: "Wrapper" }, index.h("div", { key: '2b4e60415d62b519123c83a2c26a164a76d8f23c', class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: this.assignRefToStylingContainer, onClick: this.notificationActionHandler }, this.badge ? (index.h("div", { class: "AvatarContainer" }, index.h("div", { class: "Avatar" }, ((_a = systemIcons[this.badge]) === null || _a === void 0 ? void 0 : _a.icon) ? (index.h("div", { innerHTML: systemIcons[this.badge].icon })) : (index.h("img", { class: "AvatarImage", src: this.badge }))))) : (''), index.h("div", { key: '9b14e7e81253c82b31daefcff850900dc54f9b10', class: "ContentContainer" }, index.h("div", { key: 'eb83954f1331596fa851d54e93b9ce2c7421d339', innerHTML: sanitizedNotificationBody }), index.h("p", { key: 'ef1b3a410e527d834c15d575112ecf30a2c3a76b', class: "Date" }, formatDistanceToNow(new Date(this.date), {
40850
42423
  addSuffix: true,
40851
42424
  locale: dateFnsLocale(this.language),
40852
- }))), index.h("div", { key: '872eccd47c10471e57e6e8993db46c5040166e7d', class: "RightActionsContainer" }, index.h("div", { key: '1b74b93ca8a0f4bb8aa57093bcc382619835bfc1', class: "Settings", onClick: this.toggleSettingsModal }, index.h("svg", { key: 'b527fd4a46eb215b316c3ca547008ae822da3565', width: "24", height: "24", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '0c0d5add8794eef893193883a743854a57bcdf61', d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), ((_b = this.content) === null || _b === void 0 ? void 0 : _b.length) > MAX_NOTIFICATION_TEXT_LENGTH && (index.h("div", { key: 'e33a4e8cf50ea591e22d1dd40d9438a3406c71e7', class: "AccordionArrow", innerHTML: systemIcons.arrowDown.icon, ref: this.assignRefToDropdownArrow })))), this.showSettingsModal ? (index.h("div", { class: "SettingsDropdown" }, index.h("button", { onClick: this.toggleNotificationRead }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), translate$1(this.messageRead ? 'markAsUnread' : 'markAsRead', this.language)), index.h("button", { onClick: this.deleteNotification }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), translate$1('removeMessage', this.language)))) : ('')));
42425
+ }))), index.h("div", { key: 'a01d8e1fe13be2cf7abcb9cd661a69c7de61b87d', class: "RightActionsContainer" }, index.h("div", { key: 'bdf92ba2d2e66d704b82eee1543a651708bfe2d4', class: "Settings", onClick: this.toggleSettingsModal }, index.h("svg", { key: '2c85b402bb38c3b59b7f91ca30fae88e62941a95', width: "24", height: "24", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '4aec7a96ac98ccab1c42328c06cc1718f2859af9', d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), ((_b = this.content) === null || _b === void 0 ? void 0 : _b.length) > MAX_NOTIFICATION_TEXT_LENGTH && (index.h("div", { key: 'f06f2fec7bae9d69848c165dd9ef527c0ab24329', class: "AccordionArrow", innerHTML: systemIcons.arrowDown.icon, ref: this.assignRefToDropdownArrow })))), this.showSettingsModal ? (index.h("div", { class: "SettingsDropdown" }, index.h("button", { onClick: this.toggleNotificationRead }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), translate$1(this.messageRead ? 'markAsUnread' : 'markAsRead', this.language)), index.h("button", { onClick: this.deleteNotification }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), translate$1('removeMessage', this.language)))) : ('')));
40853
42426
  }
40854
42427
  static get watchers() { return {
40855
42428
  "clientStyling": ["handleStylingChange"],