UNPKG

@senx/discovery-widgets

Version:

Discovery Widgets Elements

3 lines 23.9 kB
import{m as commonjsGlobal}from"./PluginManager-b0eb5537.js";var purify$2={exports:{}}; /*! @license DOMPurify 2.5.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.7/LICENSE */(function(e,t){(function(t,r){e.exports=r()})(commonjsGlobal,(function(){function e(t){"@babel/helpers - typeof";return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,r){t=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return t(e,r)}function r(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return true}catch(e){return false}}function n(e,a,i){if(r()){n=Reflect.construct}else{n=function e(r,n,a){var i=[null];i.push.apply(i,n);var o=Function.bind.apply(r,i);var l=new o;if(a)t(l,a.prototype);return l}}return n.apply(null,arguments)}function a(e){return i(e)||o(e)||l(e)||u()}function i(e){if(Array.isArray(e))return f(e)}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(e,t){if(!e)return;if(typeof e==="string")return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}function f(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s=Object.hasOwnProperty,c=Object.setPrototypeOf,m=Object.isFrozen,p=Object.getPrototypeOf,v=Object.getOwnPropertyDescriptor;var d=Object.freeze,h=Object.seal,g=Object.create;var y=typeof Reflect!=="undefined"&&Reflect,b=y.apply,w=y.construct;if(!b){b=function e(t,r,n){return t.apply(r,n)}}if(!d){d=function e(t){return t}}if(!h){h=function e(t){return t}}if(!w){w=function e(t,r){return n(t,a(r))}}var x=D(Array.prototype.forEach);var k=D(Array.prototype.pop);var S=D(Array.prototype.push);var A=D(String.prototype.toLowerCase);var j=D(String.prototype.toString);var O=D(String.prototype.match);var z=D(String.prototype.replace);var R=D(String.prototype.indexOf);var T=D(String.prototype.trim);var F=D(RegExp.prototype.test);var E=L(TypeError);function D(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++){n[a-1]=arguments[a]}return b(e,t,n)}}function L(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}return w(e,r)}}function M(e,t,r){var n;r=(n=r)!==null&&n!==void 0?n:A;if(c){c(e,null)}var a=t.length;while(a--){var i=t[a];if(typeof i==="string"){var o=r(i);if(o!==i){if(!m(t)){t[a]=o}i=o}}e[i]=true}return e}function B(e){var t=g(null);var r;for(r in e){if(b(s,e,[r])===true){t[r]=e[r]}}return t}function N(e,t){while(e!==null){var r=v(e,t);if(r){if(r.get){return D(r.get)}if(typeof r.value==="function"){return D(r.value)}}e=p(e)}function n(e){console.warn("fallback value for",e);return null}return n}var _=d(["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"]);var I=d(["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"]);var $=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]);var C=d(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]);var q=d(["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"]);var W=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]);var G=d(["#text"]);var U=d(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]);var P=d(["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"]);var H=d(["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"]);var Y=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);var V=h(/\{\{[\w\W]*|[\w\W]*\}\}/gm);var J=h(/<%[\w\W]*|[\w\W]*%>/gm);var K=h(/\${[\w\W]*}/gm);var Q=h(/^data-[\-\w.\u00B7-\uFFFF]/);var X=h(/^aria-[\-\w]+$/);var Z=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);var ee=h(/^(?:\w+script|data):/i);var te=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);var re=h(/^html$/i);var ne=h(/^[a-z][.\w]*(-[.\w]+)+$/i);var ae=function e(){return typeof window==="undefined"?null:window};var ie=function t(r,n){if(e(r)!=="object"||typeof r.createPolicy!=="function"){return null}var a=null;var i="data-tt-policy-suffix";if(n.currentScript&&n.currentScript.hasAttribute(i)){a=n.currentScript.getAttribute(i)}var o="dompurify"+(a?"#"+a:"");try{return r.createPolicy(o,{createHTML:function e(t){return t},createScriptURL:function e(t){return t}})}catch(e){console.warn("TrustedTypes policy "+o+" could not be created.");return null}};function oe(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:ae();var r=function e(t){return oe(t)};r.version="2.5.7";r.removed=[];if(!t||!t.document||t.document.nodeType!==9){r.isSupported=false;return r}var n=t.document;var i=t.document;var o=t.DocumentFragment,l=t.HTMLTemplateElement,f=t.Node,u=t.Element,s=t.NodeFilter,c=t.NamedNodeMap,m=c===void 0?t.NamedNodeMap||t.MozNamedAttrMap:c,p=t.HTMLFormElement,v=t.DOMParser,h=t.trustedTypes;var g=u.prototype;var y=N(g,"cloneNode");var b=N(g,"nextSibling");var w=N(g,"childNodes");var D=N(g,"parentNode");if(typeof l==="function"){var L=i.createElement("template");if(L.content&&L.content.ownerDocument){i=L.content.ownerDocument}}var le=ie(h,n);var fe=le?le.createHTML(""):"";var ue=i,se=ue.implementation,ce=ue.createNodeIterator,me=ue.createDocumentFragment,pe=ue.getElementsByTagName;var ve=n.importNode;var de={};try{de=B(i).documentMode?i.documentMode:{}}catch(e){}var he={};r.isSupported=typeof D==="function"&&se&&se.createHTMLDocument!==undefined&&de!==9;var ge=V,ye=J,be=K,we=Q,xe=X,ke=ee,Se=te,Ae=ne;var je=Z;var Oe=null;var ze=M({},[].concat(a(_),a(I),a($),a(q),a(G)));var Re=null;var Te=M({},[].concat(a(U),a(P),a(H),a(Y)));var Fe=Object.seal(Object.create(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}}));var Ee=null;var De=null;var Le=true;var Me=true;var Be=false;var Ne=true;var _e=false;var Ie=true;var $e=false;var Ce=false;var qe=false;var We=false;var Ge=false;var Ue=false;var Pe=true;var He=false;var Ye="user-content-";var Ve=true;var Je=false;var Ke={};var Qe=null;var Xe=M({},["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"]);var Ze=null;var et=M({},["audio","video","img","source","image","track"]);var tt=null;var rt=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]);var nt="http://www.w3.org/1998/Math/MathML";var at="http://www.w3.org/2000/svg";var it="http://www.w3.org/1999/xhtml";var ot=it;var lt=false;var ft=null;var ut=M({},[nt,at,it],j);var st;var ct=["application/xhtml+xml","text/html"];var mt="text/html";var pt;var vt=null;var dt=i.createElement("form");var ht=function e(t){return t instanceof RegExp||t instanceof Function};var gt=function t(r){if(vt&&vt===r){return}if(!r||e(r)!=="object"){r={}}r=B(r);st=ct.indexOf(r.PARSER_MEDIA_TYPE)===-1?st=mt:st=r.PARSER_MEDIA_TYPE;pt=st==="application/xhtml+xml"?j:A;Oe="ALLOWED_TAGS"in r?M({},r.ALLOWED_TAGS,pt):ze;Re="ALLOWED_ATTR"in r?M({},r.ALLOWED_ATTR,pt):Te;ft="ALLOWED_NAMESPACES"in r?M({},r.ALLOWED_NAMESPACES,j):ut;tt="ADD_URI_SAFE_ATTR"in r?M(B(rt),r.ADD_URI_SAFE_ATTR,pt):rt;Ze="ADD_DATA_URI_TAGS"in r?M(B(et),r.ADD_DATA_URI_TAGS,pt):et;Qe="FORBID_CONTENTS"in r?M({},r.FORBID_CONTENTS,pt):Xe;Ee="FORBID_TAGS"in r?M({},r.FORBID_TAGS,pt):{};De="FORBID_ATTR"in r?M({},r.FORBID_ATTR,pt):{};Ke="USE_PROFILES"in r?r.USE_PROFILES:false;Le=r.ALLOW_ARIA_ATTR!==false;Me=r.ALLOW_DATA_ATTR!==false;Be=r.ALLOW_UNKNOWN_PROTOCOLS||false;Ne=r.ALLOW_SELF_CLOSE_IN_ATTR!==false;_e=r.SAFE_FOR_TEMPLATES||false;Ie=r.SAFE_FOR_XML!==false;$e=r.WHOLE_DOCUMENT||false;We=r.RETURN_DOM||false;Ge=r.RETURN_DOM_FRAGMENT||false;Ue=r.RETURN_TRUSTED_TYPE||false;qe=r.FORCE_BODY||false;Pe=r.SANITIZE_DOM!==false;He=r.SANITIZE_NAMED_PROPS||false;Ve=r.KEEP_CONTENT!==false;Je=r.IN_PLACE||false;je=r.ALLOWED_URI_REGEXP||je;ot=r.NAMESPACE||it;Fe=r.CUSTOM_ELEMENT_HANDLING||{};if(r.CUSTOM_ELEMENT_HANDLING&&ht(r.CUSTOM_ELEMENT_HANDLING.tagNameCheck)){Fe.tagNameCheck=r.CUSTOM_ELEMENT_HANDLING.tagNameCheck}if(r.CUSTOM_ELEMENT_HANDLING&&ht(r.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)){Fe.attributeNameCheck=r.CUSTOM_ELEMENT_HANDLING.attributeNameCheck}if(r.CUSTOM_ELEMENT_HANDLING&&typeof r.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==="boolean"){Fe.allowCustomizedBuiltInElements=r.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements}if(_e){Me=false}if(Ge){We=true}if(Ke){Oe=M({},a(G));Re=[];if(Ke.html===true){M(Oe,_);M(Re,U)}if(Ke.svg===true){M(Oe,I);M(Re,P);M(Re,Y)}if(Ke.svgFilters===true){M(Oe,$);M(Re,P);M(Re,Y)}if(Ke.mathMl===true){M(Oe,q);M(Re,H);M(Re,Y)}}if(r.ADD_TAGS){if(Oe===ze){Oe=B(Oe)}M(Oe,r.ADD_TAGS,pt)}if(r.ADD_ATTR){if(Re===Te){Re=B(Re)}M(Re,r.ADD_ATTR,pt)}if(r.ADD_URI_SAFE_ATTR){M(tt,r.ADD_URI_SAFE_ATTR,pt)}if(r.FORBID_CONTENTS){if(Qe===Xe){Qe=B(Qe)}M(Qe,r.FORBID_CONTENTS,pt)}if(Ve){Oe["#text"]=true}if($e){M(Oe,["html","head","body"])}if(Oe.table){M(Oe,["tbody"]);delete Ee.tbody}if(d){d(r)}vt=r};var yt=M({},["mi","mo","mn","ms","mtext"]);var bt=M({},["annotation-xml"]);var wt=M({},["title","style","font","a","script"]);var xt=M({},I);M(xt,$);M(xt,C);var kt=M({},q);M(kt,W);var St=function e(t){var r=D(t);if(!r||!r.tagName){r={namespaceURI:ot,tagName:"template"}}var n=A(t.tagName);var a=A(r.tagName);if(!ft[t.namespaceURI]){return false}if(t.namespaceURI===at){if(r.namespaceURI===it){return n==="svg"}if(r.namespaceURI===nt){return n==="svg"&&(a==="annotation-xml"||yt[a])}return Boolean(xt[n])}if(t.namespaceURI===nt){if(r.namespaceURI===it){return n==="math"}if(r.namespaceURI===at){return n==="math"&&bt[a]}return Boolean(kt[n])}if(t.namespaceURI===it){if(r.namespaceURI===at&&!bt[a]){return false}if(r.namespaceURI===nt&&!yt[a]){return false}return!kt[n]&&(wt[n]||!xt[n])}if(st==="application/xhtml+xml"&&ft[t.namespaceURI]){return true}return false};var At=function e(t){S(r.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=fe}catch(e){t.remove()}}};var jt=function e(t,n){try{S(r.removed,{attribute:n.getAttributeNode(t),from:n})}catch(e){S(r.removed,{attribute:null,from:n})}n.removeAttribute(t);if(t==="is"&&!Re[t]){if(We||Ge){try{At(n)}catch(e){}}else{try{n.setAttribute(t,"")}catch(e){}}}};var Ot=function e(t){var r;var n;if(qe){t="<remove></remove>"+t}else{var a=O(t,/^[\r\n\t ]+/);n=a&&a[0]}if(st==="application/xhtml+xml"&&ot===it){t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>"}var o=le?le.createHTML(t):t;if(ot===it){try{r=(new v).parseFromString(o,st)}catch(e){}}if(!r||!r.documentElement){r=se.createDocument(ot,"template",null);try{r.documentElement.innerHTML=lt?fe:o}catch(e){}}var l=r.body||r.documentElement;if(t&&n){l.insertBefore(i.createTextNode(n),l.childNodes[0]||null)}if(ot===it){return pe.call(r,$e?"html":"body")[0]}return $e?r.documentElement:l};var zt=function e(t){return ce.call(t.ownerDocument||t,t,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null,false)};var Rt=function e(t){return t instanceof p&&(typeof t.nodeName!=="string"||typeof t.textContent!=="string"||typeof t.removeChild!=="function"||!(t.attributes instanceof m)||typeof t.removeAttribute!=="function"||typeof t.setAttribute!=="function"||typeof t.namespaceURI!=="string"||typeof t.insertBefore!=="function"||typeof t.hasChildNodes!=="function")};var Tt=function t(r){return e(f)==="object"?r instanceof f:r&&e(r)==="object"&&typeof r.nodeType==="number"&&typeof r.nodeName==="string"};var Ft=function e(t,n,a){if(!he[t]){return}x(he[t],(function(e){e.call(r,n,a,vt)}))};var Et=function e(t){var n;Ft("beforeSanitizeElements",t,null);if(Rt(t)){At(t);return true}if(F(/[\u0080-\uFFFF]/,t.nodeName)){At(t);return true}var a=pt(t.nodeName);Ft("uponSanitizeElement",t,{tagName:a,allowedTags:Oe});if(t.hasChildNodes()&&!Tt(t.firstElementChild)&&(!Tt(t.content)||!Tt(t.content.firstElementChild))&&F(/<[/\w]/g,t.innerHTML)&&F(/<[/\w]/g,t.textContent)){At(t);return true}if(a==="select"&&F(/<template/i,t.innerHTML)){At(t);return true}if(t.nodeType===7){At(t);return true}if(Ie&&t.nodeType===8&&F(/<[/\w]/g,t.data)){At(t);return true}if(!Oe[a]||Ee[a]){if(!Ee[a]&&Lt(a)){if(Fe.tagNameCheck instanceof RegExp&&F(Fe.tagNameCheck,a))return false;if(Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(a))return false}if(Ve&&!Qe[a]){var i=D(t)||t.parentNode;var o=w(t)||t.childNodes;if(o&&i){var l=o.length;for(var f=l-1;f>=0;--f){var s=y(o[f],true);s.__removalCount=(t.__removalCount||0)+1;i.insertBefore(s,b(t))}}}At(t);return true}if(t instanceof u&&!St(t)){At(t);return true}if((a==="noscript"||a==="noembed"||a==="noframes")&&F(/<\/no(script|embed|frames)/i,t.innerHTML)){At(t);return true}if(_e&&t.nodeType===3){n=t.textContent;n=z(n,ge," ");n=z(n,ye," ");n=z(n,be," ");if(t.textContent!==n){S(r.removed,{element:t.cloneNode()});t.textContent=n}}Ft("afterSanitizeElements",t,null);return false};var Dt=function e(t,r,n){if(Pe&&(r==="id"||r==="name")&&(n in i||n in dt)){return false}if(Me&&!De[r]&&F(we,r));else if(Le&&F(xe,r));else if(!Re[r]||De[r]){if(Lt(t)&&(Fe.tagNameCheck instanceof RegExp&&F(Fe.tagNameCheck,t)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(t))&&(Fe.attributeNameCheck instanceof RegExp&&F(Fe.attributeNameCheck,r)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(r))||r==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&F(Fe.tagNameCheck,n)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(n)));else{return false}}else if(tt[r]);else if(F(je,z(n,Se,"")));else if((r==="src"||r==="xlink:href"||r==="href")&&t!=="script"&&R(n,"data:")===0&&Ze[t]);else if(Be&&!F(ke,z(n,Se,"")));else if(n){return false}else;return true};var Lt=function e(t){return t!=="annotation-xml"&&O(t,Ae)};var Mt=function t(n){var a;var i;var o;var l;Ft("beforeSanitizeAttributes",n,null);var f=n.attributes;if(!f){return}var u={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:Re};l=f.length;while(l--){a=f[l];var s=a,c=s.name,m=s.namespaceURI;i=c==="value"?a.value:T(a.value);o=pt(c);u.attrName=o;u.attrValue=i;u.keepAttr=true;u.forceKeepAttr=undefined;Ft("uponSanitizeAttribute",n,u);i=u.attrValue;if(u.forceKeepAttr){continue}jt(c,n);if(!u.keepAttr){continue}if(!Ne&&F(/\/>/i,i)){jt(c,n);continue}if(_e){i=z(i,ge," ");i=z(i,ye," ");i=z(i,be," ")}var p=pt(n.nodeName);if(!Dt(p,o,i)){continue}if(He&&(o==="id"||o==="name")){jt(c,n);i=Ye+i}if(Ie&&F(/((--!?|])>)|<\/(style|title)/i,i)){jt(c,n);continue}if(le&&e(h)==="object"&&typeof h.getAttributeType==="function"){if(m);else{switch(h.getAttributeType(p,o)){case"TrustedHTML":{i=le.createHTML(i);break}case"TrustedScriptURL":{i=le.createScriptURL(i);break}}}}try{if(m){n.setAttributeNS(m,c,i)}else{n.setAttribute(c,i)}if(Rt(n)){At(n)}else{k(r.removed)}}catch(e){}}Ft("afterSanitizeAttributes",n,null)};var Bt=function e(t){var r;var n=zt(t);Ft("beforeSanitizeShadowDOM",t,null);while(r=n.nextNode()){Ft("uponSanitizeShadowNode",r,null);if(Et(r)){continue}if(r.content instanceof o){e(r.content)}Mt(r)}Ft("afterSanitizeShadowDOM",t,null)};r.sanitize=function(a){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var l;var u;var s;var c;var m;lt=!a;if(lt){a="\x3c!--\x3e"}if(typeof a!=="string"&&!Tt(a)){if(typeof a.toString==="function"){a=a.toString();if(typeof a!=="string"){throw E("dirty is not a string, aborting")}}else{throw E("toString is not a function")}}if(!r.isSupported){if(e(t.toStaticHTML)==="object"||typeof t.toStaticHTML==="function"){if(typeof a==="string"){return t.toStaticHTML(a)}if(Tt(a)){return t.toStaticHTML(a.outerHTML)}}return a}if(!Ce){gt(i)}r.removed=[];if(typeof a==="string"){Je=false}if(Je){if(a.nodeName){var p=pt(a.nodeName);if(!Oe[p]||Ee[p]){throw E("root node is forbidden and cannot be sanitized in-place")}}}else if(a instanceof f){l=Ot("\x3c!----\x3e");u=l.ownerDocument.importNode(a,true);if(u.nodeType===1&&u.nodeName==="BODY"){l=u}else if(u.nodeName==="HTML"){l=u}else{l.appendChild(u)}}else{if(!We&&!_e&&!$e&&a.indexOf("<")===-1){return le&&Ue?le.createHTML(a):a}l=Ot(a);if(!l){return We?null:Ue?fe:""}}if(l&&qe){At(l.firstChild)}var v=zt(Je?a:l);while(s=v.nextNode()){if(s.nodeType===3&&s===c){continue}if(Et(s)){continue}if(s.content instanceof o){Bt(s.content)}Mt(s);c=s}c=null;if(Je){return a}if(We){if(Ge){m=me.call(l.ownerDocument);while(l.firstChild){m.appendChild(l.firstChild)}}else{m=l}if(Re.shadowroot||Re.shadowrootmod){m=ve.call(n,m,true)}return m}var d=$e?l.outerHTML:l.innerHTML;if($e&&Oe["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&F(re,l.ownerDocument.doctype.name)){d="<!DOCTYPE "+l.ownerDocument.doctype.name+">\n"+d}if(_e){d=z(d,ge," ");d=z(d,ye," ");d=z(d,be," ")}return le&&Ue?le.createHTML(d):d};r.setConfig=function(e){gt(e);Ce=true};r.clearConfig=function(){vt=null;Ce=false};r.isValidAttribute=function(e,t,r){if(!vt){gt({})}var n=pt(e);var a=pt(t);return Dt(n,a,r)};r.addHook=function(e,t){if(typeof t!=="function"){return}he[e]=he[e]||[];S(he[e],t)};r.removeHook=function(e){if(he[e]){return k(he[e])}};r.removeHooks=function(e){if(he[e]){he[e]=[]}};r.removeAllHooks=function(){he={}};return r}var le=oe();return le}))})(purify$2);var purify=purify$2.exports;var purify$1=Object.freeze(Object.assign(Object.create(null),purify$2.exports,{default:purify}));export{purify$1 as p}; //# sourceMappingURL=purify-350afe4c.js.map