@aegisjsproject/parsers
Version:
A collection of secure & minimal parsers for HTML, CSS, SVG, MathML, XML, and JSON
10 lines (9 loc) • 22.9 kB
JavaScript
/**
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
*/
const e="http://www.w3.org/1999/xhtml",t="http://www.w3.org/1999/xlink",r=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter((e=>e.startsWith("on"))));function n(t,r=e){if("string"==typeof t)return Object.freeze({name:t,namespace:r});if("object"==typeof t&&"string"==typeof t.name){const{name:e,namespace:n=r,attributes:a}=t;return Object.freeze({name:e,namespace:"string"==typeof n&&0!==n.length?n:r,attributes:a})}throw new TypeError("Invalid config entry for `elements`.")}function a({elements:t,allowElements:r},i=e){if(Array.isArray(r))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),a({elements:r},i);if(Array.isArray(t))return t.map((e=>n(e,i)));throw new TypeError("`elements` expected to be an array.")}function i(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:a,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:a,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function o({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),o({attributes:t},r);if(Array.isArray(e))return e.map((e=>i(e,r)));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),o({attributes:Object.entries(e).map((([e,t])=>({name:e,elements:t})))},r);throw new TypeError("`attributes` expected to be an array.")}function s({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function c({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(o({attributes:e,allowAttributes:t},r),(({namespace:e})=>e??"")))}function l({elements:t,allowElements:r},n=e){return Object.freeze(Object.groupBy(a({elements:t,allowElements:r},n),(({namespace:e})=>e)))}function m(t,{elementNS:r=e,attributeNS:n}={}){if("object"!=typeof t||null===t)throw new TypeError("Sanitizer config must be an object.");return t.get instanceof Function?m(t.get()):Object.freeze({elements:l(t,r),attributes:c(t,n),comments:s(t),dataAttributes:void 0===t.dataAttributes||t.dataAttributes})}const u=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map((e=>i(e)))),p=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","template","dir","strike","selectmenu","center"].map((t=>n(t,e)))),d=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","height","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","invoketarget","invokeaction","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","width","wrap"].map((e=>i(e))).concat(u)),f=Object.freeze({comments:true,elements:p,attributes:d,dataAttributes:true});
/**
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
* @see https://wicg.github.io/sanitizer-api/#default-configuration-dictionary
*/var b=Object.freeze({__proto__:null,attributes:d,comments:true,dataAttributes:true,elements:p,sanitizer:f});const h=Object.freeze(["a","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","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","filter","foreignObject","g","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tspan","view","missing-glyph","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","hkern","vkern","glyph","glyphRef","tref","cursor","use"].map((e=>n(e,"http://www.w3.org/2000/svg")))),g=Object.freeze(["accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","class","clip","clipPathUnits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","crossorigin","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","end","exponent","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","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","height","href","hreflang","horiz-adv-x","horiz-origin-x","id","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lang","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","max","media","method","min","mode","name","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","ping","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","referrerPolicy","refX","refY","rel","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","surfaceScale","systemLanguage","tabindex","tableValues","target","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","type","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","version","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","visibility","width","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","autoReverse","accelerate","xmlns",{name:"actuate",namespace:t},{name:"arcrole",namespaec:t},{name:"href",namespace:t},{name:"role",namespace:t},{name:"show",namespace:t},{name:"title",namespace:t},{name:"type",namespace:t},{name:"space",namespace:"http://www.w3.org/XML/1998/namespace"}].map((e=>i(e))).concat(u)),y=Object.freeze({elements:h,attributes:g,comments:true,dataAttributes:true});var w=Object.freeze({__proto__:null,attributes:g,comments:true,dataAttributes:true,elements:h,sanitizer:y});const v=Object.freeze(["math","maction","annotation","annotation-xml","menclose","merror","mfenced","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","semantics","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"].map((e=>n(e,"http://www.w3.org/1998/Math/MathML")))),T=Object.freeze(["accent","accentunder","actiontype","align","background","close","color","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","fence","fontfamily","fontsize","fontstyle","fontweight","frame","framespacing","height","href","id","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","superscriptshift","symmetric","voffset","width","xmlns"].map((e=>i(e))).concat(u)),L=Object.freeze({elements:v,attributes:T,comments:true,dataAttributes:true});var S=Object.freeze({__proto__:null,attributes:T,comments:true,dataAttributes:true,elements:v,sanitizer:L});const k=Object.freeze([...p,...h]),A=Object.freeze(Array.from(new Set([...d,...g]))),E=Object.freeze({elements:k,attributes:A,comments:false,dataAttributes:true});var z=Object.freeze({__proto__:null,attributes:A,comments:false,dataAttributes:true,elements:k,sanitizer:E});const O=Object.freeze([...p,...h,...v]),j=Object.freeze(Array.from(new Set([...d,...g,...T]))),U=Object.freeze({elements:O,attributes:j,comments:true,dataAttributes:true});var x=Object.freeze({__proto__:null,attributes:j,comments:true,dataAttributes:true,elements:O,sanitizer:U});const M=new Set(["href","src","action","xlink:href"]),R=new Set(["javascript:","data:","file:","ftp:"]),N=function(e,{createHTML:t,createScript:r,createScriptURL:n}){return"trustedTypes"in globalThis?trustedTypes.createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}):Object.freeze({[Symbol.for("policy-name")]:e.toString(),createHTML(r,...n){if(t instanceof Function){const e=t(r.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createHTML method.`)},createScript(t,...n){if(r instanceof Function){const e=r(t.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScript method.`)},createScriptURL(t,...r){if(n instanceof Function){const e=n(t.toString(),...r).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScriptURL method.`)}})}("aegis-sanitizer#html",{createHTML:e=>e});function C(e,t,{elements:r=f.elements,attributes:n=f.attributes,comments:a=f.comments,dataAttributes:i=f.dataAttributes,sanitizer:o,...s}=f,{allowInsecure:c=!1}={}){const l=document.createElement("template");l.setHTMLUnsafe(N.createHTML(t)),F(l.content,{elements:r,attributes:n,comments:a,dataAttributes:i,sanitizer:o,...s},c),e.replaceChildren(l.content)}function F(e,t=f,r=!1){if(e instanceof Node){return B(e,m(t),r)}throw new TypeError("Not a node.")}const H="trustedTypes"in globalThis?e=>null!==trustedTypes.getAttributeType(e.ownerElement.tagName,e.localName,e.ownerElement.namespaceURI,e.namespaceURI):e=>r.has(e.localName);function D(e,t,r=!1){const n=e.namespaceURI||"";return(!("dataAttributes"in t)||t.dataAttributes)&&e.name.startsWith("data-")||n in t.attributes&&t.attributes[n].some((t=>t.name===e.localName))&&!(r||H(e))&&!(r||function(e){if(M.has(e.name)){if(URL.canParse(e.value)){const{protocol:t}=new URL(e.value);return R.has(t)}return!1}return!1}(e))}function B(e,t,r=!1){switch(e.nodeType){case Node.ELEMENT_NODE:!function(e,t,r){if(function(e,t){return e.namespaceURI in t.elements&&t.elements[e.namespaceURI].some((t=>t.name===e.localName))}(e,t)){if(e.hasAttributes()){const n=e.attributes;for(let e=n.length-1;-1!==e;e--)_(n[e],t,r)}if("TEMPLATE"===e.tagName)P(e.content,t,r);else if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)B(n[e],t,r)}}else e.remove()}(e,t,r);break;case Node.DOCUMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:P(e,t,r);break;case Node.COMMENT_NODE:!function(e,t){t.comments||e.remove()}(e,t);break;case Node.ATTRIBUTE_NODE:_(e,t,r);break;case Node.TEXT_NODE:case Node.DOCUMENT_TYPE_NODE:break;default:e.ownerElement instanceof Element&&e.ownerElement.removeChild(e)}}function _(e,t,r=!1){!D(e,t,r)&&e.ownerElement instanceof Element&&e.ownerElement.removeAttributeNode(e)}function P(e,t,r=!1){if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)B(n[e],t,r)}}Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}),URL.canParse instanceof Function||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch{return!1}}),URL.parse instanceof Function||(URL.parse=function(e,t){try{return new URL(e,t)}catch{return null}}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){const r={};for(const n of e){const e=t(n);e in r?r[e].push(n):r[e]=[n]}return r}),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:a,sanitizer:i,...o}={}){C(this,e,"object"==typeof i&&null!==i?i.getConfiguration instanceof Function?i.getConfiguration():i:{elements:t,attributes:r,comments:n,dataAttributes:a,...o})},DocumentFragment.prototype.setHTML=function(...e){Element.prototype.setHTML.apply(this,e)},HTMLTemplateElement.prototype.setHTML=function(e,t){this.content.setHTML(e,t)}),Document.parseHTML instanceof Function||(Document.parseHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:a,sanitizer:i,...o}={}){return"object"==typeof i&&null!==i?Document.parseHTML(e,i.getConfiguration instanceof Function?i.getConfiguration():i):function(e,{elements:t=f.elements,attributes:r=f.attributes,comments:n=f.comments,dataAttributes:a=f.dataAttributes,sanitizer:i,...o}=f,{allowInsecure:s=!1}={}){const c=(new DOMParser).parseFromString(N.createHTML(e),"text/html");return F(c,{elements:t,attributes:r,comments:n,dataAttributes:a,sanitizer:i,...o},s),c}(e,{elements:t,attributes:r,comments:n,dataAttributes:a,...o})});const I=e=>{switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"object":return null===e?"":e instanceof CSSStyleSheet?[...e.cssRules].map((e=>e.cssText)).join("\n\n"):e instanceof CSSRule?e.cssText:e instanceof HTMLLinkElement?I(e.sheet):e instanceof ArrayBuffer&&Uint8Array.prototype.toBase64 instanceof Function?new Uint8Array(e).toBase64():ArrayBuffer.isView(e)&&e.toBase64 instanceof Function?e.toBase64():e instanceof Blob?URL.createObjectURL(e):e.toString();default:return e.toString()}};function q(e,{media:t,disabled:r,baseURL:n}={}){const a=new CSSStyleSheet({media:t instanceof MediaQueryList?t.media:t,disabled:r,baseURL:n});return a.replace(e).catch(reportError),a}const W=({media:e,disabled:t,baseURL:r,sync:n=!1}={})=>n?(n,...a)=>function(e,{media:t,disabled:r,baseURL:n}={}){const a=new CSSStyleSheet({media:t instanceof MediaQueryList?t.media:t,disabled:r,baseURL:n});return a.replaceSync(e),a}(String.raw(n,...a.map(I)).trim(),{media:e,disabled:t,baseURL:r}):(n,...a)=>q(String.raw(n,...a.map(I)).trim(),{media:e,disabled:t,baseURL:r}),G=W();function X(e,{crossOrigin:t="anonymous",referrerPolicy:r="no-referrer"}={}){const n=document.createElement("link"),a=new File(Array.from(e.cssRules,(e=>e.cssText)),"sheet.css",{type:e.type});return n.rel="stylesheet",n.crossOrigin=t,n.referrerPolicy=r,n.disabled=e.disabled,0!==e.media.length&&(n.media=e.media.mediaText),n.href=URL.createObjectURL(a),n}function V(e,...t){if(!(e instanceof HTMLDocument||e instanceof ShadowRoot))throw new TypeError("Node must be a `HTMLDocument` or `ShadowRoot`.");e.adoptedStyleSheets=t}function Y(e,...t){if(!(e instanceof Document||e instanceof ShadowRoot))throw new TypeError("Node must be a `HTMLDocument` or `ShadowRoot`.");e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]}const $=e=>Array.from(e[Symbol.iterator](),(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.textContent)).join("");function Q(e){switch(typeof e){case"string":return e;case"function":throw new TypeError("Functions are not supported.");case"undefined":return"";case"object":return null===e?"":e instanceof DocumentFragment||e instanceof Document?$(e.childNodes):e instanceof NodeList||e instanceof HTMLCollection?$(e):e instanceof Element?e.outerHTML:e instanceof Date?e.toISOString():Array.isArray(e)?e.map(Q).join(""):e instanceof ArrayBuffer&&Uint8Array.prototype.toBase64 instanceof Function?new Uint8Array(e).toBase64():ArrayBuffer.isView(e)&&e.toBase64 instanceof Function?e.toBase64():e instanceof Blob?URL.createObjectURL(e):e.toString();default:return e.toString()}}function J(e=E,{mapper:t=Q}={}){return(r,...n)=>{const a=document.createDocumentFragment(),i=document.createElement("div");return i.setHTML(String.raw(r,...n.map(t)).trim(),e),a.append(...i.childNodes),a}}const Z=J(E,{mapper:Q}),K=(...e)=>Z.apply(null,e).firstElementChild;function ee(e,...t){return Document.parseHTML(String.raw(e,...t.map(Q)),E)}const te=(...e)=>JSON.parse(String.raw.apply(null,e).trim());function re(...e){return Document.parseHTML(String.raw.apply(null,e).trim(),{sanitizer:{elements:["html","head","body",...v],attributes:T}}).body.firstElementChild}function ne(...e){return Document.parseHTML(String.raw.apply(null,e).trim(),{sanitizer:{elements:["html","head","body",...h],attributes:g}}).body.firstElementChild}function ae(e="aegis-parsers#html",{elements:t=E.elements,attributes:r=E.attributes,comments:n=E.comments}=E){const a=e=>{const a=document.createElement("div");return a.setHTML(e,{sanitizer:{elements:t,attributes:r,comments:n}}),a.innerHTML};return"trustedTypes"in globalThis?globalThis.trustedTypes.createPolicy(e,{createHTML:a}):Object.freeze({createHTML:a})}function ie(e){switch(typeof e){case"string":return e;case"function":throw new TypeError("Functions are not supported.");case"undefined":return"";case"object":return null===e?"":e instanceof Date?e.toISOString():Array.isArray(e)?e.map(ie).join(","):e instanceof ArrayBuffer&&Uint8Array.prototype.toBase64 instanceof Function?new Uint8Array(e).toBase64():ArrayBuffer.isView(e)&&e.toBase64 instanceof Function?e.toBase64():e instanceof Blob?URL.createObjectURL(e):e.toString();default:return e.toString()}}function oe(e){return encodeURIComponent(ie(e).trim()).replaceAll("..%2F","%2E%2E%2F").replaceAll(".%2F","%2E%2E%2F")}const se=function(e=globalThis?.document?.baseURI){return function(t,r,...n){return r instanceof Blob&&2===t.length&&""===t[0]&&""===t[1]?new URL(URL.createObjectURL(r)):URL.canParse(r)?URL.parse(String.raw(t,"",...n.map(oe)),r):t[0].startsWith("/")||t[0].startsWith("./")||t[0].startsWith("../")?URL.parse(String.raw(t,oe(r),...n.map(oe)),e):URL.parse(String.raw(t,oe(r),...n.map(oe)))}}(),ce=(...e)=>(new DOMParser).parseFromString(String.raw.apply(null,e).trim(),"application/xml");export{Y as addStyleSheets,z as baseConfig,x as completeConfig,W as createCSSParser,J as createHTMLParser,ae as createPolicy,q as createStyleSheet,G as css,ee as doc,K as el,Z as html,b as htmlConfig,te as json,re as math,S as mathMLConfig,V as setStyleSheets,X as styleSheetToLink,ne as svg,w as svgConfig,se as url,ce as xml};
//# sourceMappingURL=bundle.min.js.map