/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/svg-slim@2.0.5/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("svg-vdom"),require("css"),require("ramda")):"function"==typeof define&&define.amd?define(["svg-vdom","css","ramda"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).svgSlimming=t(e.svgVdom,e.css,e.ramda)}(this,(function(e,t,a){"use strict";const l=(e,t)=>{const a={params:{...e.params},browsers:{...e.browsers},option:{}};return t&&(a.option=e.rules[t][1]),a},n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r=e=>e&&"object"==typeof e,i=255,s=100,o=16,u=360,c=2*Math.PI,m="LlHhVv",p={angelDigit:2,sizeDigit:2,trifuncDigit:3,opacityDigit:3,thinning:0,straighten:0,mergePoint:0,rmAttrEqDefault:!0,ignoreKnownCSS:!1},f={"apply-style":[!0],"collapse-g":[!0],"collapse-textwrap":[!0],"combine-path":[!0,{disregardFill:!1,disregardOpacity:!1}],"combine-transform":[!0],"compute-path":[!0],"rm-attribute":[!0,{keepAria:!1,keepEvent:!1}],"rm-comments":[!0],"rm-doctype":[!0],"rm-hidden":[!0],"rm-important":[!0],"rm-illegal-style":[!0],"rm-irregular-nesting":[!0,{ignore:[]}],"rm-irregular-tag":[!0,{ignore:[]}],"rm-px":[!0],"rm-unnecessary":[!0,{tags:["desc","discard","foreignObject","video","audio","iframe","canvas","metadata","script","title","unknown","image"]}],"rm-version":[!0],"rm-viewbox":[!0],"rm-xml-decl":[!0],"rm-xmlns":[!0],"shorten-animate":[!0,{remove:!1}],"shorten-class":[!0],"shorten-color":[!0,{rrggbbaa:!1}],"shorten-decimal-digits":[!0],"shorten-defs":[!0],"shorten-filter":[!0],"shorten-id":[!0],"shorten-shape":[!0],"shorten-style-attr":[!0],"shorten-style-tag":[!0],"style-to-class":[!0]},y=require("browserslist"),d=e=>{const t=y(e),a={};return t.forEach((e=>{const t=/\s\d/.exec(e);if(t){const l=e.slice(0,t.index),r=parseFloat(e.slice(t.index));n(a,l)?r<a[l]&&(a[l]=r):a[l]=r}})),a},g=(e,t)=>{if(Array.isArray(e)){if(Array.isArray(t))return t.filter((e=>"string"==typeof e))}else if(typeof e==typeof t){if("number"!=typeof t)return t;if(t>=0&&t!==1/0)return Math.floor(t)}return e},h=(e,t)=>{for(const[a,l]of Object.entries(e))if(n(t,a)){const e=t[a];if("boolean"==typeof l)e[0]=l;else if(Array.isArray(l)&&"boolean"==typeof l[0]&&(e[0]=l[0],e[0]&&e[1])){const t=e[1],a=l[1];if(r(a))for(const[e,l]of Object.entries(a))n(t,e)&&(t[e]=g(t[e],l))}}},v=["animate","animateMotion","animateTransform","discard","set"],b=["animate","animateTransform","set"],x=["linearGradient","radialGradient"],w=["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"],$=["feFuncR","feFuncG","feFuncB","feFuncA"],k=["feDistantLight","fePointLight","feSpotLight"],A=["solidcolor","linearGradient","radialGradient","meshgradient","pattern","hatch"],V=["circle","ellipse","line","path","polygon","polyline","rect"],T=["defs","g","svg","symbol","use"],E=["tspan","textPath"],N=["text"].concat(E),S=["audio","canvas","circle","ellipse","foreignObject","iframe","image","line","mesh","path","polygon","polyline","rect","text","textPath","tspan","video"],C=["desc","discard","foreignObject","video","audio","iframe","canvas","metadata","script","style","title","unknown","image"],M=["circle","ellipse","rect","image","foreignObject","svg"],z=["onabort","onafterprint","onbeforeprint","onbegin","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragexit","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onend","onended","onerror","onerror","onfocus","onfocusin","onfocusout","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onoffline","ononline","onpagehide","onpageshow","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onrepeat","onreset","onresize","onresize","onscroll","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunload","onunload","onvolumechange","onwaiting"],q=["aria-activedescendant","aria-atomic","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","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-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","role"],P=["from","to","by","values"],B=["gradientTransform","patternTransform","transform"],L=["id","class","mask","style"],F=["id","tabindex","lang","xml:space","class","style","transform"],j=["xlink:href","xlink:title"],O=["begin","dur","end","min","max","restart","repeatCount","repeatDur","fill"],R=["x","y","width","height"],I=R.concat(["cx","cy","r","rx","ry"]),D=["font-size","letter-spacing","word-spacing"],U=["target","link","visited","hover","active","focus"],Y=["first-letter","first-line","selection"],G=["script"].concat(["desc","metadata","title"]),Z=["clipPath","marker","mask","style"].concat(v,G,A),X=["a","audio","canvas","clipPath","cursor","filter","foreignObject","iframe","image","marker","mask","style","switch","text","video","view"].concat(v,G,A,V,T),H=["animate","animateTransform","set","stop","style"].concat(G),_=["animate","set"].concat(G),Q=["requiredExtensions","systemLanguage"].concat(F),W=["pathLength"].concat(Q),K=Q.concat(["additive","accumulate"],O,["calcMode","values","keyTimes","keySplines","from","to","by"]),J=["result"].concat(F,R),ee=["type","tableValues","slope","intercept","amplitude","exponent","offset"].concat(F),te={a:{containTextNode:!0,legalChildElements:{transparent:!0,noself:!0,childElements:[]},ownAttributes:["href","target","download","rel","hreflang","type"].concat(Q,j)},animate:{legalChildElements:{childElements:G},ownAttributes:["attributeName"].concat(K),onlyAttr:["fill"]},animateMotion:{legalChildElements:{childElements:["mpath"].concat(G)},ownAttributes:["path","keyPoints","rotate","origin"].concat(K),onlyAttr:["fill"]},animateTransform:{legalChildElements:{childElements:G},ownAttributes:["attributeName","type"].concat(K),onlyAttr:["fill"]},audio:{legalChildElements:{childElements:[]},ownAttributes:[]},canvas:{legalChildElements:{childElements:[]},ownAttributes:[]},circle:{legalChildElements:{childElements:Z},ownAttributes:["cx","cy","r"].concat(W)},clipPath:{legalChildElements:{childElements:["text","use"].concat(G,v,V)},ownAttributes:["externalResourcesRequired","transform","clipPathUnits"].concat(Q)},defs:{legalChildElements:{childElements:X},ownAttributes:F},desc:{containTextNode:!0,legalChildElements:{any:!0,childElements:[]},ownAttributes:F},discard:{legalChildElements:{childElements:G},ownAttributes:["begin","href"].concat(Q)},ellipse:{legalChildElements:{childElements:Z},ownAttributes:["cx","cy","rx","ry"].concat(W)},feBlend:{legalChildElements:{childElements:_},ownAttributes:["in","in2","mode"].concat(J)},feColorMatrix:{legalChildElements:{childElements:_},ownAttributes:["in","type","values"].concat(J)},feComponentTransfer:{legalChildElements:{childElements:$.concat(G)},ownAttributes:["in"].concat(J)},feComposite:{legalChildElements:{childElements:_},ownAttributes:["in","in2","operator","k1","k2","k3","k4"].concat(J)},feConvolveMatrix:{legalChildElements:{childElements:_},ownAttributes:["in","order","kernelMatrix","divisor","bias","targetX","targetY","edgeMode","kernelUnitLength","preserveAlpha"].concat(J)},feDiffuseLighting:{legalChildElements:{childElements:G.concat(k)},ownAttributes:["in","surfaceScale","diffuseConstant","kernelUnitLength"].concat(J)},feDisplacementMap:{legalChildElements:{childElements:_},ownAttributes:["in","in2","scale","xChannelSelector","yChannelSelector"].concat(J)},feDistantLight:{legalChildElements:{childElements:_},ownAttributes:["azimuth","elevation"].concat(F)},feFlood:{legalChildElements:{childElements:_},ownAttributes:J},feFuncA:{legalChildElements:{childElements:_},ownAttributes:ee},feFuncB:{legalChildElements:{childElements:_},ownAttributes:ee},feFuncG:{legalChildElements:{childElements:_},ownAttributes:ee},feFuncR:{legalChildElements:{childElements:_},ownAttributes:ee},feGaussianBlur:{legalChildElements:{childElements:_},ownAttributes:["in","stdDeviation","edgeMode"].concat(J)},feImage:{legalChildElements:{childElements:["animate","animateTransform","set"].concat(G)},ownAttributes:["externalResourcesRequired","preserveAspectRatio","xlink:href","href","crossorigin"].concat(J)},feMerge:{legalChildElements:{childElements:["feMergeNode"].concat(G)},ownAttributes:J},feMergeNode:{legalChildElements:{childElements:_},ownAttributes:["in"].concat(F)},feMorphology:{legalChildElements:{childElements:_},ownAttributes:["in","operator","radius"].concat(J)},feOffset:{legalChildElements:{childElements:_},ownAttributes:["in","dx","dy"].concat(J)},fePointLight:{legalChildElements:{childElements:_},ownAttributes:["x","y","z"].concat(F)},feSpecularLighting:{legalChildElements:{childElements:G.concat(k)},ownAttributes:["in","surfaceScale","specularConstant","specularExponent","kernelUnitLength"].concat(J)},feSpotLight:{legalChildElements:{childElements:_},ownAttributes:["x","y","z"].concat(F)},feTile:{legalChildElements:{childElements:_},ownAttributes:["in"].concat(J)},feTurbulence:{legalChildElements:{childElements:_},ownAttributes:["baseFrequency","numOctaves","seed","stitchTiles","type"].concat(J)},filter:{legalChildElements:{childElements:_.concat(w)},ownAttributes:["externalResourcesRequired","filterUnits","primitiveUnits"].concat(F,R)},foreignObject:{legalChildElements:{any:!0,childElements:[]},ownAttributes:R.concat(Q)},g:{legalChildElements:{childElements:X},ownAttributes:Q},iframe:{legalChildElements:{childElements:[]},ownAttributes:[]},image:{legalChildElements:{childElements:["clipPath","mask","style"].concat(v,G)},ownAttributes:["preserveAspectRatio","href","crossorigin"].concat(Q,j,R)},line:{legalChildElements:{childElements:Z},ownAttributes:["x1","y1","x2","y2"].concat(W)},linearGradient:{legalChildElements:{childElements:H},ownAttributes:["x1","y1","x2","y2","gradientUnits","gradientTransform","spreadMethod","href"].concat(F,j)},marker:{legalChildElements:{childElements:X},ownAttributes:["viewBox","preserveAspectRatio","refX","refY","markerUnits","markerWidth","markerHeight","orient"].concat(F)},mask:{legalChildElements:{childElements:["a","clipPath","cursor","filter","foreignObject","image","marker","mask","pattern","style","switch","view","text"].concat(v,G,V,T,x)},ownAttributes:["maskUnits","maskContentUnits"].concat(R,Q)},metadata:{containTextNode:!0,legalChildElements:{any:!0,childElements:[]},ownAttributes:F},mpath:{legalChildElements:{childElements:G},ownAttributes:["href"].concat(F)},path:{legalChildElements:{childElements:Z},ownAttributes:["d"].concat(W)},pattern:{legalChildElements:{childElements:X},ownAttributes:["viewBox","preserveAspectRatio","patternUnits","patternContentUnits","patternTransform","href"].concat(F,j,R)},polygon:{legalChildElements:{childElements:Z},ownAttributes:["points"].concat(W)},polyline:{legalChildElements:{childElements:Z},ownAttributes:["points"].concat(W)},radialGradient:{legalChildElements:{childElements:H},ownAttributes:["cx","cy","r","fx","fy","fr","gradientUnits","gradientTransform","spreadMethod","href"].concat(F,j)},rect:{legalChildElements:{childElements:Z},ownAttributes:["rx","ry"].concat(R,W)},script:{containTextNode:!0,legalChildElements:{childElements:[]},ownAttributes:["type","href","crossorigin"].concat(F,j)},set:{legalChildElements:{childElements:G},ownAttributes:["to","attributeName"].concat(Q,O),onlyAttr:["fill"]},stop:{legalChildElements:{childElements:["animate","script","set","style"]},ownAttributes:["path","offset"].concat(F)},style:{containTextNode:!0,legalChildElements:{childElements:[]},ownAttributes:["type","media","title"].concat(F)},svg:{legalChildElements:{childElements:X},ownAttributes:["viewBox","preserveAspectRatio","zoomAndPan","transform"].concat(Q,R),onlyAttr:["width","height"]},switch:{legalChildElements:{childElements:["a","audio","canvas","foreignObject","g","iframe","image","svg","switch","text","use","video"].concat(v,V)},ownAttributes:Q},symbol:{legalChildElements:{childElements:X},ownAttributes:["preserveAspectRatio","viewBox","refX","refY"].concat(F,R)},text:{containTextNode:!0,legalChildElements:{childElements:["a","clipPath","marker","mask","style"].concat(v,G,A,E)},ownAttributes:["lengthAdjust","x","y","dx","dy","rotate","textLength"].concat(Q)},textPath:{containTextNode:!0,legalChildElements:{childElements:["a","animate","clipPath","marker","mask","set","style","tspan"].concat(G,A)},ownAttributes:["lengthAdjust","textLength","path","href","startOffset","method","spacing","side"].concat(Q,j)},title:{containTextNode:!0,legalChildElements:{any:!0,childElements:["a","animate","set","style","tspan"].concat(G,A)},ownAttributes:F},tspan:{containTextNode:!0,legalChildElements:{childElements:["tspan"]},ownAttributes:["lengthAdjust","x","y","dx","dy","rotate","textLength"].concat(Q)},unknown:{legalChildElements:{any:!0,childElements:[]},ownAttributes:Q},use:{legalChildElements:{childElements:["clipPath","mask","style"].concat(v,G)},ownAttributes:["href"].concat(R,Q,j)},video:{legalChildElements:{childElements:[]},ownAttributes:[]},view:{legalChildElements:{childElements:["style"].concat(v,G)},ownAttributes:["viewBox","preserveAspectRatio","zoomAndPan"].concat(F)}},ae={isUndef:!0,legalChildElements:{},ownAttributes:[]},le=new Proxy(te,{get:(e,t)=>t in e?e[t]:ae}),ne=e=>e.replace(/\s+/g," "),re=(t,a=!1)=>{let l;for(let n=t.childNodes.length;n--;){const r=t.childNodes[n];if(r.nodeType!==e.NodeType.Text&&r.nodeType!==e.NodeType.CDATA)r.remove();else{let t=ne(r.textContent.trim());r.nodeType===e.NodeType.Text&&(r.nodeType=e.NodeType.CDATA),l?(a&&";"!==t.slice(-1)&&(t+=";"),l.textContent=`${t}${l.textContent}`.trim(),r.remove()):l=r}}},ie="userSpaceOnUse|objectBoundingBox",se="SourceGraphic|SourceAlpha|BackgroundImage|BackgroundAlpha|FillPaint|StrokePaint",oe="R|G|B|A",ue="nonzero|evenodd",ce="currentColor|transparent",me="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",pe="ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText",fe="auto|sRGB|linearRGB",ye="auto|optimizeSpeed|optimizeQuality";let de=!0;try{de=/\u{20BB7}/u.test("𠮷")}catch{de=!1}const ge=de?"u":"",he="(?:\\s*,\\s*|\\s*)",ve="\\s*;\\s*",be="\\s*\\(\\s*",xe="\\s*\\)",we=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+(de?"\\u{10000}-\\u{EFFFF}":""),$e=`[${we}][${`${we}\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040`}]*`,ke="A-Za-z_\\u0080-\\uFFFF"+(de?"\\u{10000}-\\u{EFFFF}":""),Ae=`${ke}\\-0-9`,Ve=`[${ke}][${Ae}]*`,Te=new RegExp(`^${$e}$`,ge),Ee=new RegExp(`^${Ve}$`,ge),Ne=new RegExp(`^${Ve}(?:\\s+${Ve})*$`,ge),Se="(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?",Ce=`[+-]?${Se}`,Me=new RegExp(`^\\+?${Se}$`),ze=`${Ce}(?:${he}${Ce})*`,qe=new RegExp(`^${Ce}$`),Pe=new RegExp(Ce,"g"),Be=new RegExp(`^${Ce}(?:\\s*${Ce})?$`),Le=new RegExp(`^${ze}$`),Fe=new RegExp(`^${Ce}(?:${ve}${Ce})*(?:${ve})?$`),je=/^[+-]?(?:\d+|(?:\d*\.)?\d+[eE][+-]?\d+)$/,Oe=new RegExp(`^${Ce}(?:px)?$`),Re=new RegExp(`^${Ce}(?:px)?(?:${he}${Ce}(?:px)?)*$`),Ie="deg|grad|rad|turn",De=new RegExp(`^${Ce}(?:${Ie})?$`),Ue=`${Ce}${he}${Ce}${he}${Ce}${he}${Ce}`,Ye=new RegExp(`^${Ue}(?:${ve}${Ue})*(?:${ve})?$`),Ge=new RegExp(`^${Ce}%$`),Ze=`${Ce}(?:em|ex|ch|rem|vx|vw|vmin|vmax|cm|mm|Q|in|pt|pc|px)?`,Xe=`(?:${Ze}|${Ce}%)`,He=`${Ze}${he}${Ze}`,_e=new RegExp(`^${Ze}$`),Qe=new RegExp(`^${He}$`),We=new RegExp(`^${He}(?:${ve}${He})*$`),Ke=new RegExp(`^${Xe}$`),Je=new RegExp(`^${Xe}(?:${he}${Xe})*$`),et=new RegExp(`^${Ue}$`),tt="(?:\\d+(?:\\.\\d+)?(?:h|min|s|ms)?|(?:\\d+:)?[0-5]\\d:[0-5]\\d(?:\\.\\d+)?)",at=`(?:\\s*[+-]\\s*)?${tt}`,lt=`(?:${at}|${`${$e}\\.(?:begin|end)(?:${at})?`}|${`(?:${$e}\\.)?(?:${z.join("|")})(?:${at})?`}|${`(?:${$e}\\.)?repeat\\(\\d+\\)(?:${at})?`}|${`accessKey\\(.\\)(?:${at})?`}|wallclock\\(\\d+\\)|indefinite)`,nt=new RegExp(`^${tt}$`),rt=new RegExp(`^${lt}(\\s*;\\s*${lt})*$`,ge),it=new RegExp(`^(?:\\s*(?:${`translate${be}${Ce}(?:${he}?${Ce})?${xe}`}|${`scale${be}${Ce}(?:${he}?${Ce})?${xe}`}|${`rotate${be}${Ce}(?:${he}?${Ce}${he}?${Ce})?${xe}`}|${`skewX${be}${Ce}${xe}`}|${`skewY${be}${Ce}${xe}`}|${`matrix${be}${Ce}(?:${he}?${Ce}){5}${xe}`})\\s*)*$`),st=/^(?:[^:/?#]+:)?(?:\/\/[^/?#]*)?(?:[^?#]*)(?:\?[^#]*)?(?:#.*)?$/,ot=/^[a-zA-Z]{2,}(?:-[a-zA-Z0-9%]+)*$/,ut="0-9a-fA-F",ct=`\\\\(?:[^${ut}\\r\\n]|[${ut}]{1,6}\\s?)`,mt=new RegExp(`^${`(?:--|-?(?:[${ke}]|${ct}))(?:[${Ae}]|${ct})*`}$`,ge),pt=`[mM]\\s*${ze}`,ft=new RegExp(`^${pt}(?:${he}${`(?:${pt}|[zZ]|${`[lLhHvVcCsSqQtTaA]\\s*${ze}`})`})*$`),yt=/^url\((["']?)#(.+)\1\)$/,dt="url\\([^\\)]+\\)",gt=new RegExp(`^${dt}$`),ht=/^#(.+)$/,vt=/^(?:image|audio|video|application|text|multipart|message)\/[^/]+$/,bt=`(?:${Ze}|auto)`,xt=new RegExp(`^rect\\(\\s*${bt}${he}${bt}${he}${bt}${he}${bt}\\s*\\)$`),wt=`rgba?${be}(?:${Ce}(%?)${he}${Ce}\\1${he}${Ce}\\1(?:${he}${Ce}%?)?)${xe}`,$t=`hsla?${be}${Ce}${he}${Ce}%${he}${Ce}%(?:${he}${Ce}%?)?${xe}`,kt="#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})",At=new RegExp(`^(?:${wt}|${$t}|${kt})$`),Vt=new RegExp(`^(?:${wt}|${$t}|${kt}|${ce}|${pe}|${me})(?:${`icc-color${be}${$e}(?:${he}${Ce})+${xe}`})?$`,ge),Tt=new RegExp(`^(?:${dt}\\s*(?:${Ce}\\s*${Ce})?${he})*(?:auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|grab|grabbing|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out)$`),Et=new RegExp(`(?:(?:${`(?:${`blur${be}(?:${Ze})?${xe}`}|${`(?:brightness|contrast|grayscale|invert|opacity|saturate|sepia)${be}(?:${Ce}%?)?${xe}`}|${`drop-shadow${be}(?:(?:${wt}|${$t}|${kt}|${ce}|${pe}|${me})?${he}(?:${Ze}|${Ce}%){2,3})?${xe}`}|${`hue-rotate${be}(?:${Ie}|[+-]?(?:0+\\.)?0+(?:[eE][+-]?\\d+)?)?${xe}`})`}|${dt})${he})+`),Nt=new RegExp(`^${Xe}(?:${he}${Xe})+$`),St=V.concat(N),Ct=["pattern","marker"].concat(["svg","symbol","foreignObject","video","audio","canvas","image","iframe"]),Mt=["use"].concat(["a","clipPath","defs","g","marker","mask","pattern","svg","switch","symbol","unknown"],S),zt=["animate"].concat(Mt,x),qt=[{type:"reg",value:At},{type:"enum",value:pe},{type:"enum",value:me},{type:"enum",value:ce}],Pt=qt.concat([{type:"string",value:"none"},{type:"enum",value:"context-fill|context-stroke"},{type:"reg",value:gt}]),Bt=[{type:"reg",value:Ge},{type:"reg",value:qe}],Lt=[{type:"string",value:"none"},{type:"reg",value:gt}],Ft={accumulate:{name:"accumulate",legalValues:[{type:"string",value:"none"},{type:"string",value:"sum"}],initValue:"none",applyTo:[]},additive:{name:"additive",legalValues:[{type:"string",value:"replace"},{type:"string",value:"sum"}],initValue:"replace",applyTo:[]},amplitude:{name:"amplitude",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},attributeName:{name:"attributeName",legalValues:[{type:"attr"}],initValue:"",applyTo:[]},azimuth:{name:"azimuth",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},baseFrequency:{name:"baseFrequency",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Be}],initValue:"0",applyTo:[]},begin:{name:"begin",legalValues:[{type:"reg",value:rt}],initValue:"0s",applyTo:[]},bias:{name:"bias",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},by:{name:"by",legalValues:[{type:"reg",value:Qe,tag:["animateMotion"]}],initValue:"",applyTo:[]},calcMode:{name:"calcMode",legalValues:[{type:"enum",value:"discrete|linear|paced|spline"}],initValue:"",applyTo:[]},class:{name:"class",animatable:!0,legalValues:[{type:"reg",value:Ne}],initValue:"",applyTo:[]},clipPathUnits:{name:"clipPathUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"userSpaceOnUse",applyTo:[]},crossorigin:{name:"crossorigin",animatable:!0,legalValues:[{type:"enum",value:"anonymous|use-credentials"}],initValue:"",applyTo:[]},cx:{name:"cx",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:[{val:"50%",tag:["radialGradient"]},{val:"0",tag:["circle","ellipse"]}],applyTo:["circle","ellipse"]},cy:{name:"cy",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:[{val:"50%",tag:["radialGradient"]},{val:"0",tag:["circle","ellipse"]}],applyTo:["circle","ellipse"]},d:{name:"d",animatable:!0,legalValues:[{type:"reg",value:ft}],initValue:"",applyTo:[]},diffuseConstant:{name:"diffuseConstant",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},divisor:{name:"divisor",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"",applyTo:[]},download:{name:"download",animatable:!0,legalValues:[{type:"reg",value:Te}],initValue:"",applyTo:[]},dur:{name:"dur",legalValues:[{type:"reg",value:nt},{type:"enum",value:"media|indefinite"}],initValue:"",applyTo:[]},dx:{name:"dx",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe,tag:["feOffset","feDropShadow"]},{type:"reg",value:Je,tag:["text","tspan"]}],initValue:[{val:"2",tag:["feOffset","feDropShadow"]},{val:"",tag:["tspan","text"]}],applyTo:[]},dy:{name:"dy",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe,tag:["feOffset","feDropShadow"]},{type:"reg",value:Je,tag:["text","tspan"]}],initValue:[{val:"2",tag:["feOffset","feDropShadow"]},{val:"",tag:["tspan","text"]}],applyTo:[]},edgeMode:{name:"edgeMode",animatable:!0,legalValues:[{type:"enum",value:"duplicate|wrap|none"}],initValue:[{val:"duplicate",tag:["feConvolveMatrix"]},{val:"none",tag:["feGaussianBlur"]}],applyTo:[]},elevation:{name:"elevation",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},end:{name:"end",legalValues:[{type:"reg",value:rt}],initValue:"",applyTo:[]},exponent:{name:"exponent",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},filterUnits:{name:"filterUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"objectBoundingBox",applyTo:[]},fr:{name:"fr",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"0%",applyTo:[]},from:{name:"from",legalValues:[{type:"reg",value:Qe,tag:["animateMotion"]}],initValue:"",applyTo:[]},fx:{name:"fx",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"",applyTo:[]},fy:{name:"fy",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"",applyTo:[]},gradientTransform:{name:"gradientTransform",animatable:!0,legalValues:[{type:"reg",value:it}],initValue:"",applyTo:[]},gradientUnits:{name:"gradientUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"objectBoundingBox",applyTo:[]},height:{name:"height",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:[{val:"100%",tag:w.concat(["svg"])},{val:"120%",tag:["filter","mask"]},{val:"0",tag:["pattern","rect","foreignObject"]},{val:"auto",tag:["svg","image","rect","foreignObject"]}],applyTo:w.concat(["filter","mask","pattern","svg","image","rect","foreignObject"])},href:{name:"href",animatable:!0,maybeIRI:!0,legalValues:[{type:"reg",value:st}],initValue:"",applyTo:[]},hreflang:{name:"hreflang",animatable:!0,legalValues:[{type:"reg",value:ot}],initValue:"",applyTo:[]},id:{name:"id",legalValues:[{type:"reg",value:Te}],initValue:"",applyTo:[]},in:{name:"in",animatable:!0,legalValues:[{type:"enum",value:se},{type:"reg",value:mt}],initValue:"",applyTo:[]},in2:{name:"in2",animatable:!0,legalValues:[{type:"enum",value:se},{type:"reg",value:mt}],initValue:"",applyTo:[]},intercept:{name:"intercept",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},isolation:{name:"isolation",legalValues:[{type:"enum",value:"auto|isolate"}],initValue:"auto",applyTo:[]},k1:{name:"k1",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},k2:{name:"k2",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},k3:{name:"k3",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},k4:{name:"k4",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},kernelMatrix:{name:"kernelMatrix",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Le}],initValue:"",applyTo:[]},kernelUnitLength:{name:"kernelUnitLength",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Be}],initValue:"2 2",applyTo:[]},keyPoints:{name:"keyPoints",maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Fe}],initValue:"",applyTo:[]},keySplines:{name:"keySplines",maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Ye}],initValue:"",applyTo:[]},keyTimes:{name:"keyTimes",maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Fe}],initValue:"",applyTo:[]},lang:{name:"lang",legalValues:[{type:"reg",value:ot}],initValue:"",applyTo:[]},lengthAdjust:{name:"lengthAdjust",animatable:!0,legalValues:[{type:"enum",value:"spacing|spacingAndGlyphs"}],initValue:"spacing",applyTo:[]},limitingConeAngle:{name:"limitingConeAngle",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"",applyTo:[]},markerHeight:{name:"markerHeight",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"3",applyTo:[]},markerUnits:{name:"markerUnits",animatable:!0,legalValues:[{type:"enum",value:"strokeWidth|userSpaceOnUse"}],initValue:"strokeWidth",applyTo:[]},markerWidth:{name:"markerWidth",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"3",applyTo:[]},maskContentUnits:{name:"maskContentUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"userSpaceOnUse",applyTo:[]},maskUnits:{name:"maskUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"objectBoundingBox",applyTo:[]},max:{name:"max",legalValues:[{type:"reg",value:nt},{type:"string",value:"media"}],initValue:"",applyTo:[]},media:{name:"media",legalValues:[],initValue:[{val:"all",tag:["css"]}],applyTo:[]},method:{name:"method",animatable:!0,legalValues:[{type:"enum",value:"align|stretch"}],initValue:"align",applyTo:[]},min:{name:"min",legalValues:[{type:"reg",value:nt},{type:"string",value:"media"}],initValue:"0",applyTo:[]},mode:{name:"mode",animatable:!0,legalValues:[{type:"enum",value:"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity"}],initValue:"normal",applyTo:[]},numOctaves:{name:"numOctaves",animatable:!0,legalValues:[{type:"reg",value:je}],initValue:"1",applyTo:[]},offset:{name:"offset",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe},{type:"reg",value:Ge,tag:["stop"]}],initValue:"0",applyTo:[]},operator:{name:"operator",animatable:!0,legalValues:[{type:"enum",value:"over|in|out|atop|xor|lighter|arithmetic",tag:["feComposite"]},{type:"enum",value:"erode|dilate",tag:["feMorphology"]}],initValue:[{val:"over",tag:["feComposite"]},{val:"erode",tag:["feMorphology"]}],applyTo:[]},order:{name:"order",animatable:!0,legalValues:[{type:"reg",value:Be}],initValue:"3",applyTo:[]},orient:{name:"orient",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe},{type:"reg",value:De},{type:"enum",value:"auto|auto-start-reverse"}],initValue:"0",applyTo:[]},path:{name:"path",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:ft}],initValue:"",applyTo:[]},pathLength:{name:"pathLength",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"",applyTo:[]},patternContentUnits:{name:"patternContentUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"userSpaceOnUse",applyTo:[]},patternTransform:{name:"patternTransform",animatable:!0,legalValues:[{type:"reg",value:it}],initValue:"",applyTo:[]},patternUnits:{name:"patternUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"objectBoundingBox",applyTo:[]},ping:{name:"ping",legalValues:[],initValue:"",applyTo:[]},playbackorder:{name:"playbackorder",legalValues:[{type:"string",value:"forwardonly"},{type:"string",value:"all"}],initValue:"all",applyTo:[]},points:{name:"points",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Le}],initValue:"",applyTo:[]},pointsAtX:{name:"pointsAtX",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},pointsAtY:{name:"pointsAtY",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},pointsAtZ:{name:"pointsAtZ",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},preserveAlpha:{name:"preserveAlpha",animatable:!0,legalValues:[{type:"string",value:"false"},{type:"string",value:"true"}],initValue:"false",applyTo:[]},preserveAspectRatio:{name:"preserveAspectRatio",animatable:!0,legalValues:[{type:"reg",value:/^(?:none|xMinYMin|xMidYMin|xMaxYMin|xMinYMid|xMidYMid|xMaxYMid|xMinYMax|xMidYMax|xMaxYMax)(?:\s+(?:meet|slice))?$/}],initValue:[{val:"xMidYMid",tag:["canvas","feImage","image","marker","pattern","svg","symbol","view"]},{val:"xMidYMid meet",tag:["canvas","feImage","image","marker","pattern","svg","symbol","view"]}],applyTo:[]},primitiveUnits:{name:"primitiveUnits",animatable:!0,legalValues:[{type:"enum",value:ie}],initValue:"userSpaceOnUse.",applyTo:[]},r:{name:"r",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:[{val:"50%",tag:["radialGradient"]},{val:"0",tag:["circle"]}],applyTo:["circle"]},radius:{name:"radius",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Be}],initValue:"0",applyTo:[]},refX:{name:"refX",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"enum",value:"left|center|right"}],initValue:[{val:"0",tag:["marker"]}],applyTo:[]},refY:{name:"refY",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"enum",value:"top|center|bottom"}],initValue:[{val:"0",tag:["marker"]}],applyTo:[]},referrerpolicy:{name:"referrerpolicy",legalValues:[{type:"enum",value:"no-referrer|no-referrer-when-downgrade|same-origin|origin|strict-origin|origin-when-cross-origin|strict-origin-when-cross-origin|unsafe-url"}],initValue:"",applyTo:[]},rel:{name:"rel",animatable:!0,legalValues:[],initValue:"",applyTo:[]},repeatCount:{name:"repeatCount",legalValues:[{type:"reg",value:qe},{type:"string",value:"indefinite"}],initValue:"",applyTo:[]},repeatDur:{name:"repeatDur",legalValues:[{type:"reg",value:nt},{type:"string",value:"indefinite"}],initValue:"",applyTo:[]},requiredExtensions:{name:"requiredExtensions",legalValues:[],initValue:"",applyTo:[]},restart:{name:"restart",legalValues:[{type:"enum",value:"always|whenNotActive|never"}],initValue:"always",applyTo:[]},result:{name:"result",animatable:!0,legalValues:[{type:"reg",value:Ee}],initValue:"",applyTo:[]},rotate:{name:"rotate",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Le,tag:["text","tspan"]},{type:"reg",value:qe,tag:["animateMotion"]},{type:"string",value:"auto",tag:["animateMotion"]},{type:"string",value:"auto-reverse",tag:["animateMotion"]}],initValue:"0",applyTo:[]},rx:{name:"rx",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:"auto",applyTo:["ellipse","rect"]},ry:{name:"ry",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:"auto",applyTo:["ellipse","rect"]},scale:{name:"scale",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},seed:{name:"seed",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},side:{name:"side",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"string",value:"left"},{type:"string",value:"right"}],initValue:"left",applyTo:[]},slope:{name:"slope",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},spacing:{name:"spacing",animatable:!0,legalValues:[{type:"string",value:"auto"},{type:"string",value:"exact"}],initValue:"exact",applyTo:[]},specularConstant:{name:"specularConstant",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},specularExponent:{name:"specularExponent",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},spreadMethod:{name:"spreadMethod",animatable:!0,legalValues:[{type:"enum",value:"pad|reflect|repeat"}],initValue:"pad",applyTo:[]},startOffset:{name:"startOffset",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"0",applyTo:[]},stdDeviation:{name:"stdDeviation",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Be}],initValue:[{val:"2",tag:["feDropShadow"]},{val:"0",tag:["feGaussianBlur"]}],applyTo:[]},stitchTiles:{name:"stitchTiles",animatable:!0,legalValues:[{type:"string",value:"stitch"},{type:"string",value:"noStitch"}],initValue:"noStitch",applyTo:[]},style:{name:"style",legalValues:[],initValue:"",applyTo:[]},surfaceScale:{name:"surfaceScale",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"1",applyTo:[]},systemLanguage:{name:"systemLanguage",legalValues:[],initValue:"",applyTo:[]},tabindex:{name:"tabindex",legalValues:[{type:"reg",value:je}],initValue:"",applyTo:[]},tableValues:{name:"tableValues",animatable:!0,legalValues:[{type:"reg",value:Le}],initValue:"",applyTo:[]},target:{name:"target",animatable:!0,legalValues:[{type:"reg",value:Te},{type:"enum",value:"_self|_parent|_top|_blank"}],initValue:"_self",applyTo:[]},targetX:{name:"targetX",animatable:!0,legalValues:[{type:"reg",value:je}],initValue:"",applyTo:[]},targetY:{name:"targetY",animatable:!0,legalValues:[{type:"reg",value:je}],initValue:"",applyTo:[]},textLength:{name:"textLength",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"",applyTo:[]},timelinebegin:{name:"timelinebegin",legalValues:[{type:"string",value:"loadend"},{type:"string",value:"loadbegin"}],initValue:"loadend",applyTo:[]},title:{name:"title",legalValues:[],initValue:"",applyTo:[]},to:{name:"to",legalValues:[{type:"reg",value:Qe,tag:["animateMotion"]}],initValue:"",applyTo:[]},transform:{name:"transform",animatable:!0,legalValues:[{type:"reg",value:it}],initValue:"",applyTo:Mt},type:{name:"type",animatable:!0,legalValues:[{type:"enum",value:"translate|scale|rotate|skewX|skewY",tag:["animateTransform"]},{type:"enum",value:"matrix|saturate|hueRotate|luminanceToAlpha",tag:["feColorMatrix"]},{type:"enum",value:"identity|table|discrete|linear|gamma",tag:["feFuncA","feFuncB","feFuncG","feFuncR"]},{type:"enum",value:"fractalNoise|turbulence",tag:["feTurbulence"]},{type:"reg",value:vt,tag:["script"]},{type:"reg",value:vt,tag:["style"]}],initValue:[{val:"translate",tag:["animateTransform"]},{val:"matrix",tag:["feColorMatrix"]},{val:"identity",tag:["feFuncA","feFuncB","feFuncG","feFuncR"]},{val:"turbulence",tag:["feTurbulence"]},{val:"application/ecmascript",tag:["script"]},{val:"text/css",tag:["style"]}],applyTo:[]},values:{name:"values",animatable:!0,maybeAccurateNumber:!0,legalValues:[{type:"reg",value:Le,tag:["feColorMatrix"]},{type:"reg",value:We,tag:["animateMotion"]}],initValue:"",applyTo:[]},viewBox:{name:"viewBox",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:et}],initValue:"",applyTo:[]},width:{name:"width",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:[{val:"100%",tag:w.concat(["svg"])},{val:"120%",tag:["filter","mask"]},{val:"0",tag:["pattern","rect","foreignObject"]},{val:"auto",tag:["svg","image","rect","foreignObject"]}],applyTo:w.concat(["filter","mask","pattern","svg","image","rect","foreignObject"])},x:{name:"x",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke,tag:w.concat(["filter","mask","pattern","svg","rect","image","foreignObject","use"])},{type:"reg",value:qe,tag:["fePointLight","feSpotLight"]},{type:"reg",value:Je,tag:["text","tspan"]},{type:"string",value:"auto"}],initValue:[{val:"0%",tag:w},{val:"0",tag:["fePointLight","feSpotLight","pattern","svg","rect","image","foreignObject","text"]},{val:"-10%",tag:["filter","mask"]},{val:"",tag:["tspan"]}],applyTo:w.concat(["fePointLight","feSpotLight","filter","mask","pattern","svg","rect","image","foreignObject","text"])},x1:{name:"x1",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:[{val:"0",tag:["line"]},{val:"0%",tag:["linearGradient"]}],applyTo:[]},x2:{name:"x2",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:[{val:"0",tag:["line"]},{val:"100%",tag:["linearGradient"]}],applyTo:[]},xChannelSelector:{name:"xChannelSelector",animatable:!0,legalValues:[{type:"enum",value:oe}],initValue:"A",applyTo:[]},"xlink:href":{name:"xlink:href",animatable:!0,maybeIRI:!0,legalValues:[{type:"reg",value:st}],initValue:"",applyTo:[]},"xlink:title":{name:"xlink:title",legalValues:[],initValue:"",applyTo:[]},"xml:space":{name:"xml:space",legalValues:[{type:"string",value:"default"},{type:"string",value:"preserve"}],initValue:"default",applyTo:[]},xmlns:{name:"xmlns",legalValues:[{type:"reg",value:st}],initValue:"",applyTo:[]},"xmlns:xlink":{name:"xmlns:xlink",legalValues:[{type:"reg",value:st}],initValue:"",applyTo:[]},y:{name:"y",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke,tag:w.concat(["filter","mask","pattern","svg","rect","image","foreignObject","use"])},{type:"reg",value:Je,tag:["text","tspan"]},{type:"reg",value:qe,tag:["fePointLight","feSpotLight"]},{type:"string",value:"auto"}],initValue:[{val:"0%",tag:w},{val:"0",tag:["fePointLight","feSpotLight","pattern","svg","rect","image","foreignObject","text"]},{val:"-10%",tag:["filter","mask"]},{val:"",tag:["tspan"]}],applyTo:w.concat(["fePointLight","feSpotLight","filter","mask","pattern","svg","rect","image","foreignObject","text"])},y1:{name:"y1",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:[{val:"0",tag:["line"]},{val:"0%",tag:["linearGradient"]}],applyTo:[]},y2:{name:"y2",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"string",value:"auto"}],initValue:[{val:"0",tag:["line"]},{val:"0%",tag:["linearGradient"]}],applyTo:[]},yChannelSelector:{name:"yChannelSelector",animatable:!0,legalValues:[{type:"enum",value:oe}],initValue:"A",applyTo:[]},z:{name:"z",animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:qe}],initValue:"0",applyTo:[]},zoomAndPan:{name:"zoomAndPan",animatable:!0,legalValues:[{type:"string",value:"disable"},{type:"string",value:"magnify"}],initValue:"disable",applyTo:[]},"alignment-baseline":{name:"alignment-baseline",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical"}],initValue:"baseline",applyTo:["tspan","textPath"]},"baseline-shift":{name:"baseline-shift",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"enum",value:"baseline|sub|super"},{type:"reg",value:Ke}],initValue:"0",applyTo:["tspan","textPath"]},clip:{name:"clip",couldBeStyle:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"string",value:"auto"},{type:"reg",value:xt}],initValue:"auto",applyTo:Ct},"clip-path":{name:"clip-path",couldBeStyle:!0,animatable:!0,maybeFuncIRI:!0,legalValues:[{type:"string",value:"none"},{type:"reg",value:gt},{type:"reg",value:/^(?:inset|circle|ellipse|polygon)\([^()]+\)$/},{type:"enum",value:"border-box|padding-box|content-box|margin-box|fill-box|stroke-box|view-box"}],initValue:"none",applyTo:Mt},"clip-rule":{name:"clip-rule",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:ue}],initValue:"nonzero",applyTo:["use"].concat(S)},color:{name:"color",couldBeStyle:!0,inherited:!0,animatable:!0,maybeColor:!0,legalValues:qt,initValue:"",applyTo:["feFlood","feDiffuseLighting","feSpecularLighting","stop"].concat(St)},"color-interpolation":{name:"color-interpolation",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:fe}],initValue:"sRGB",applyTo:zt},"color-interpolation-filters":{name:"color-interpolation-filters",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:fe}],initValue:"auto",applyTo:["feSpotLight"].concat(w)},"color-rendering":{name:"color-rendering",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:ye}],initValue:"auto",applyTo:zt},cursor:{name:"cursor",couldBeStyle:!0,inherited:!0,animatable:!0,maybeFuncIRI:!0,legalValues:[{type:"reg",value:Tt}],initValue:"auto",applyTo:Mt},direction:{name:"direction",couldBeStyle:!0,inherited:!0,legalValues:[{type:"enum",value:"ltr|rtl"}],initValue:"ltr",applyTo:N},display:{name:"display",couldBeStyle:!0,animatable:!0,legalValues:[{type:"enum",value:"inline|block|list-item|run-in|compact|marker|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none"}],initValue:"inline",applyTo:["svg","g","switch","a","foreignObject","use"].concat(S)},"dominant-baseline":{name:"dominant-baseline",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge"}],initValue:"auto",applyTo:N},fill:{name:"fill",couldBeStyle:!0,inherited:!0,animatable:!0,maybeColor:!0,maybeFuncIRI:!0,legalValues:Pt.concat([{type:"enum",value:"freeze|remove",tag:["animate","animateMotion","animateTransform","set"]}]),initValue:[{val:"black",tag:Mt},{val:"remove",tag:["animate","animateMotion","animateTransform","set"]}],applyTo:["animate","animateMotion","animateTransform","set"].concat(St)},"fill-opacity":{name:"fill-opacity",couldBeStyle:!0,inherited:!0,animatable:!0,maybeAlpha:!0,legalValues:Bt,initValue:"1",applyTo:St},"fill-rule":{name:"fill-rule",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:ue}],initValue:"nonzero",applyTo:["path","polygon","polyline"].concat(N)},filter:{name:"filter",couldBeStyle:!0,animatable:!0,maybeFuncIRI:!0,legalValues:[{type:"string",value:"none"},{type:"reg",value:Et}],initValue:"none",applyTo:Mt},"flood-color":{name:"flood-color",couldBeStyle:!0,animatable:!0,maybeColor:!0,legalValues:qt,initValue:"black",applyTo:["feFlood"]},"flood-opacity":{name:"flood-opacity",couldBeStyle:!0,maybeAlpha:!0,legalValues:Bt,initValue:"1",applyTo:["feFlood"]},"font-family":{name:"font-family",couldBeStyle:!0,inherited:!0,legalValues:[],initValue:"",applyTo:N},"font-size":{name:"font-size",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke},{type:"enum",value:"xx-small|x-small|small|medium|large|x-large|xx-large"},{type:"enum",value:"larger|smaller"}],initValue:"medium",applyTo:N},"font-size-adjust":{name:"font-size-adjust",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"string",value:"none"},{type:"reg",value:qe}],initValue:"none",applyTo:N},"font-stretch":{name:"font-stretch",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded"}],initValue:"normal",applyTo:N},"font-style":{name:"font-style",couldBeStyle:!0,inherited:!0,legalValues:[{type:"enum",value:"normal|italic|oblique"}],initValue:"normal",applyTo:N},"font-variant":{name:"font-variant",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"string",value:"normal"},{type:"string",value:"none"},{type:"mix",value:{type:"|",unit:["common-ligatures|no-common-ligatures","discretionary-ligatures|no-discretionary-ligatures","historical-ligatures|no-historical-ligatures","contextual|no-contextual","small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","lining-nums|oldstyle-nums","proportional-nums|tabular-nums","diagonal-fractions|stacked-fractions","ordinal","slashed-zero","jis78|jis83|jis90|jis04|simplified|traditional","full-width|proportional-width","ruby","sub|super"]}}],initValue:"normal",applyTo:N},"font-weight":{name:"font-weight",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900"}],initValue:"normal",applyTo:N},"image-rendering":{name:"image-rendering",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:ye}],initValue:"auto",applyTo:["image"]},"letter-spacing":{name:"letter-spacing",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"string",value:"normal"},{type:"reg",value:_e}],initValue:"normal",applyTo:N},"lighting-color":{name:"lighting-color",couldBeStyle:!0,animatable:!0,maybeColor:!0,legalValues:qt,initValue:"white",applyTo:["feDiffuseLighting","feSpecularLighting"]},"line-height":{name:"line-height",couldBeStyle:!0,inherited:!0,animatable:!0,maybeColor:!0,maybeSizeNumber:!0,legalValues:[{type:"string",value:"normal"},{type:"reg",value:Ke}],initValue:"normal",applyTo:["text"]},marker:{name:"marker",couldBeStyle:!0,inherited:!0,animatable:!0,maybeFuncIRI:!0,legalValues:Lt,initValue:"none",applyTo:V},"marker-end":{name:"marker-end",couldBeStyle:!0,inherited:!0,animatable:!0,maybeFuncIRI:!0,legalValues:Lt,initValue:"none",applyTo:V},"marker-mid":{name:"marker-mid",couldBeStyle:!0,inherited:!0,animatable:!0,maybeFuncIRI:!0,legalValues:Lt,initValue:"none",applyTo:V},"marker-start":{name:"marker-start",couldBeStyle:!0,inherited:!0,animatable:!0,maybeFuncIRI:!0,legalValues:Lt,initValue:"none",applyTo:V},mask:{name:"mask",couldBeStyle:!0,animatable:!0,maybeFuncIRI:!0,legalValues:[],initValue:"none",applyTo:Mt},opacity:{name:"opacity",couldBeStyle:!0,animatable:!0,maybeAlpha:!0,legalValues:Bt,initValue:"1",applyTo:["svg","g","symbol","marker","a","switch","use","unknown"].concat(S)},overflow:{name:"overflow",couldBeStyle:!0,animatable:!0,legalValues:[{type:"enum",value:"visible|hidden|scroll|auto"}],initValue:"visible",applyTo:Ct},"paint-order":{name:"paint-order",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"string",value:"normal"},{type:"mix",value:{type:"|",unit:["fill","stroke","markers"]}}],initValue:"normal",applyTo:St},"pointer-events":{name:"pointer-events",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"bounding-box|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|none"}],initValue:"visiblePainted",applyTo:Mt},"shape-rendering":{name:"shape-rendering",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"auto|optimizeSpeed|crispEdges|geometricPrecision"}],initValue:"auto",applyTo:V},"stop-color":{name:"stop-color",couldBeStyle:!0,animatable:!0,maybeColor:!0,legalValues:[{type:"string",value:"currentColor"},{type:"reg",value:Vt}],initValue:"black",applyTo:["stop"]},"stop-opacity":{name:"stop-opacity",couldBeStyle:!0,animatable:!0,maybeAlpha:!0,legalValues:Bt,initValue:"1",applyTo:["stop"]},stroke:{name:"stroke",couldBeStyle:!0,inherited:!0,animatable:!0,maybeColor:!0,maybeFuncIRI:!0,legalValues:Pt,initValue:"none",applyTo:St},"stroke-dasharray":{name:"stroke-dasharray",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"string",value:"none"},{type:"reg",value:Nt}],initValue:"none",applyTo:St},"stroke-dashoffset":{name:"stroke-dashoffset",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"0",applyTo:St},"stroke-linecap":{name:"stroke-linecap",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"butt|round|square"}],initValue:"butt",applyTo:St},"stroke-linejoin":{name:"stroke-linejoin",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"miter|miter-clip|round|bevel|arcs"}],initValue:"miter",applyTo:St},"stroke-miterlimit":{name:"stroke-miterlimit",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Me}],initValue:"4",applyTo:St},"stroke-opacity":{name:"stroke-opacity",couldBeStyle:!0,inherited:!0,animatable:!0,maybeAlpha:!0,legalValues:Bt,initValue:"1",applyTo:St},"stroke-width":{name:"stroke-width",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"reg",value:Ke}],initValue:"1",applyTo:St},"text-anchor":{name:"text-anchor",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"start|middle|end"}],initValue:"start",applyTo:N},"text-decoration":{name:"text-decoration",couldBeStyle:!0,animatable:!0,legalValues:[{type:"string",value:"none"},{type:"mix",value:{type:"|",unit:["underline","overline","line-through","blink "]}}],initValue:"",applyTo:N},"text-rendering":{name:"text-rendering",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"auto|optimizeSpeed|optimizeLegibility|geometricPrecision"}],initValue:"auto",applyTo:["text"]},"unicode-bidi":{name:"unicode-bidi",couldBeStyle:!0,legalValues:[{type:"enum",value:"normal|embed|isolate|bidi-override|isolate-override|plaintext"}],initValue:"normal",applyTo:N},"vector-effect":{name:"vector-effect",couldBeStyle:!0,animatable:!0,legalValues:[{type:"string",value:"none"},{type:"reg",value:/^(?:non-scaling-stroke|non-scaling-size|non-rotation|fixed-position)+(?:viewport|screen)?$/}],initValue:"none",applyTo:["use"].concat(S)},visibility:{name:"visibility",couldBeStyle:!0,inherited:!0,animatable:!0,legalValues:[{type:"enum",value:"visible|hidden|collapse"}],initValue:"visible",applyTo:["use","a"].concat(S)},"word-spacing":{name:"word-spacing",couldBeStyle:!0,inherited:!0,animatable:!0,maybeSizeNumber:!0,legalValues:[{type:"string",value:"normal"},{type:"reg",value:_e}],initValue:"normal",applyTo:N},"writing-mode":{name:"writing-mode",couldBeStyle:!0,inherited:!0,legalValues:[{type:"enum",value:"horizontal-tb|vertical-rl|vertical-lr"},{type:"enum",value:"lr|lr-tb|rl|rl-tb|tb|tb-rl"}],initValue:[{val:"lr-tb",tag:["text"]},{val:"horizontal-tb",tag:["text"]}],applyTo:["text"]}},jt={name:"",isUndef:!0,legalValues:[],initValue:"",applyTo:[]},Ot=new Proxy(Ft,{get:(e,t)=>n(e,t)?e[t]:jt}),Rt=(e,t,a,l,n,i)=>{if(!n.has(a))if(n.add(a),i||!e(a)){if(l.push(a),Array.isArray(a))for(let r=0;r<a.length;){const s=a[r];Rt(e,t,s,l,n,i),s===a[r]&&r++}else for(const s in a){const o=a[s];r(o)&&Rt(e,t,o,l,n,i)}l.pop(),i&&e(a)&&t(a,l)}else t(a,l)},It=(e,t,a,l=!1)=>{Rt(e,t,a,[],new Set,l)},Dt=require("known-css-properties").all,Ut=e=>Dt.includes(e),Yt=/\s*!important$/,Gt=e=>new RegExp(`^(?:${e})$`),Zt=(e,t)=>Gt(e).test(t),Xt=(e,t)=>e.test(t.trim()),Ht=Gt("([^(]+)\\((.+)\\)"),_t=(e,t)=>"enum"===e.type?Zt(e.value,t):"reg"===e.type?Xt(e.value,t):e.value===t,Qt=(e,t)=>{switch(e.type){case"reg":if(Xt(e.value,t))return!0;break;case"enum":if(Zt(e.value,t))return!0;break;case"mix":if(((e,t)=>{if("&"===e.type){const a=t.split(/\s+/);for(let t=0;t<a.length;t++){const l=e.unit[t];if(!Gt(l).test(a[t]))return!1}return!0}{let l=t;for(let t=e.unit.length;t--;){const n=(a=e.unit[t],new RegExp(`(?:^|\\s)(?:${a})(?:\\s|$)`));l=l.replace(n," ")}return!l.trim()}var a})(e.value,t))return!0;break;case"func":if(((e,t)=>{const a=Ht.exec(t);if(!a)return!1;if(a[1]!==e.name)return!1;const l=a[2].split(",").map((e=>e.trim()));if(l.length>e.args.length)return!1;for(let t=0;t<l.length;t++){const a=e.args[t];if(Array.isArray(a.def)){if(!a.def.some((e=>_t(e,l[t]))))return!1}else if(!_t(a.def,l[t]))return!1}if(l.length<e.args.length)return!!e.args[l.length].optional;return!0})(e.value,t))return!0;break;default:if(e.value===t)return!0}return!1},Wt=(e,t,a="")=>{if(e.legalValues.length){let l=!0;for(const n of e.legalValues){if(!n.tag||!a||n.tag.includes(a)){if(l=!1,"attr"===n.type){if(!Ot[t.value].isUndef&&t.fullname!==t.value)return!0}else if(Qt(n,t.value))return!0;if(e.couldBeStyle&&Zt("initial|inherit|unset|revert",t.value))return!0}}return l}return!e.isUndef},Kt=(e,t)=>{const a=t.indexOf(e);-1!==a&&t.splice(a,1)},{decode:Jt}=require("he"),ea=/([^:;]+):((?:[^;'"]*?(?:(?:'[^']*?'|"[^"]*?"|\/\*.*?\*\/))*[^;'"]*?)*)(?=;|$)/gim,ta=e=>{const t=[],a=Jt(e,{isAttributeValue:!0});ea.lastIndex=0;let l=ea.exec(a);for(;null!==l;){const e=l[1].replace(/^(?:\s*\/\*.+?\*\/\s*)*/g,"").trim().replace(/\s/g,"");let n=l[2].replace(/^(?:\s*\/\*.+?\*\/\s*)*|(?:\s*\/\*.+?\*\/\s*)*$/g,"").trim().replace(/\s+/," "),r=!1;Yt.test(n)&&(n=n.replace(Yt,""),r=!0),e&&n&&t.push({fullname:e,name:e,value:n,important:r}),l=ea.exec(a)}return t},aa=e=>e.map((e=>`${e.name}:${e.value}${e.important?"!important":""}`)).join(";"),la=(e,t)=>e.length<=t.length?e:t,na=e=>e.replace(/^(-?)0\./,"$1."),ra=e=>e.toLowerCase().includes("e"),ia=e=>e.includes("."),sa=(e,t,a)=>{const l=Math.max(e,0);if(0===l)return Math.round(t);const n=a.indexOf(".");if(a.length-(n+1)<=l)return t;const r=a.slice(0,n+l+1);return+a[n+l+1]>4?/\.9+$/.test(r)?t<0?Math.floor(t):Math.ceil(t):+r.replace(/([0-8])9*$/,((e,t)=>""+(+t+1))):+r},oa=a.curry(((e,t)=>{if(!isFinite(t))return t;const a=t.toString();if(ra(a)){const l=a.indexOf("e");if("-"===a[l+1]){const n=+a.slice(l+2);if(e<n-1)return 0;if(e===n-1)return+`${+a[0]>4?1:0}e-${n-1}`;if(ia(a)){if(e>=l-(a.indexOf(".")+1)+n)return t;const r=a.slice(0,l);return+`${sa(e-n,+r,r)}e-${n}`}return t}return t}return ia(a)?sa(e,t,a):t})),ua=(e,t)=>{const a=na(((e,t)=>`${oa(Math.max(e-2,0),t*s)}%`)(e,t)),l=na(`${oa(e,t)}`);return la(l,a)},ca=(e,t)=>Math.max(Math.min(e,Math.round(t)),0),ma=(e,t,a)=>e?((e,t)=>Math.round(Math.max(Math.min(s,t),0)*e/s))(t,+a):ca(t,+a),pa=(e,t)=>Math.max(Math.min(1,e?+t/s:+t),0),fa={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ya=new RegExp(`^rgba?\\((${Ce})(%?),(${Ce})\\2,(${Ce})\\2(?:,(${Ce})(%?))?\\)$`,"gi"),da=new RegExp(`^hsla?\\((${Ce})((?:${Ie})?),(${Ce})%,(${Ce})%(?:,(${Ce})(%?))?\\)$`,"gi"),ga=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ha={255:100,252:99,250:98,247:97,245:96,242:95,240:94,237:93,235:92,232:91,230:90,227:89,224:88,222:87,219:86,217:85,214:84,212:83,209:82,207:81,204:80,201:79,199:78,196:77,194:76,191:75,189:74,186:73,184:72,181:71,179:70,176:69,173:68,171:67,168:66,166:65,163:64,161:63,158:62,156:61,153:60,150:59,148:58,145:57,143:56,140:55,138:54,135:53,133:52,130:51,128:50,125:49,122:48,120:47,117:46,115:45,112:44,110:43,107:42,105:41,102:40,99:39,97:38,94:37,92:36,89:35,87:34,84:33,82:32,79:31,77:30,74:29,71:28,69:27,66:26,64:25,61:24,59:23,56:22,54:21,51:20,48:19,46:18,43:17,41:16,38:15,36:14,33:13,31:12,28:11,26:10,23:9,20:8,18:7,15:6,13:5,10:4,8:3,5:2,3:1,0:0},va=(e,t=3)=>{let l=e.trim();n(fa,l)?l=fa[l]:/^(?:rgb|hsl)a?\s*\(/.test(l)&&(l=l.replace(/\s*([,()])\s*/g,"$1"));const r={r:0,g:0,b:0,a:1,origin:l,valid:!0},m=l.match(ga);if(m){const e=m[1];switch(e.length){case 3:r.r=parseInt(`0x${e[0]}${e[0]}`,o),r.g=parseInt(`0x${e[1]}${e[1]}`,o),r.b=parseInt(`0x${e[2]}${e[2]}`,o);break;case 4:{r.r=parseInt(`0x${e[0]}${e[0]}`,o),r.g=parseInt(`0x${e[1]}${e[1]}`,o),r.b=parseInt(`0x${e[2]}${e[2]}`,o);const t=parseInt(`0x${e[3]}${e[3]}`,o);r.a=a.has(`${t}`,ha)?ha[`${t}`]/s:t/i;break}case 8:{r.r=parseInt(`0x${e[0]}${e[1]}`,o),r.g=parseInt(`0x${e[2]}${e[3]}`,o),r.b=parseInt(`0x${e[4]}${e[5]}`,o);const t=parseInt(`0x${e[6]}${e[7]}`,o);r.a=a.has(`${t}`,ha)?ha[`${t}`]/s:t/i;break}default:r.r=parseInt(`0x${e[0]}${e[1]}`,o),r.g=parseInt(`0x${e[2]}${e[3]}`,o),r.b=parseInt(`0x${e[4]}${e[5]}`,o)}return r}ya.lastIndex=0;const p=ya.exec(l);if(p)return r.r=ma(p[2],i,p[1]),r.g=ma(p[2],i,p[3]),r.b=ma(p[2],i,p[4]),p[5]&&(r.a=pa(p[6],p[5])),r;da.lastIndex=0;const f=da.exec(l);if(f){let e;switch(f[2].toLowerCase()){case"grad":e=+f[1]*u/400;break;case"rad":e=+f[1]*u/c;break;case"turn":e=+f[1]*u;break;default:e=+f[1]}return[r.r,r.g,r.b]=((e,t,a)=>{let l,n,r,s=e%u/60;const o=2*t*(a<.5?a:1-a),c=o*(1-Math.abs(s%2-1));return l=n=r=a-o/2,s=~~s,l+=[o,c,0,0,c,o][s],n+=[c,o,o,c,0,0][s],r+=[0,0,c,o,o,c][s],[ca(i,l*i),ca(i,n*i),ca(i,r*i)]})(e,+f[3]/s,+f[4]/s),f[5]&&(r.a=pa(f[6],f[5]),r.origin=`hsl(${ca(u,e)},${ca(s,+f[3])}%,${ca(s,+f[4])}%,${ua(t,r.a)})`),r}return"transparent"===l?(r.a=0,r):(r.valid=!1,r)},ba=Gt(`(${Ce})(%?)`),xa=e=>{const t=ba.exec(e);return t?pa(t[2],t[1]):e},wa=e=>{const t=[];if(Le.test(e)){Pe.lastIndex=0;let a=Pe.exec(e);for(;a;)t.push(+a[0]),a=Pe.exec(e)}return t},$a=(e,t,l)=>{if(t===l)return!0;if(e.maybeColor){const e=va(t),n=va(l);if(!e.valid||!n.valid)return!1;if(e.origin="",n.origin="",a.equals(e,n))return!0}if(e.maybeSizeNumber||e.maybeAccurateNumber){const e=wa(l);if(e.length>0&&a.equals(wa(t),e))return!0;if(/^0[a-z]*$/i.test(t)&&/^0[a-z]*$/i.test(l))return!0}return!(!e.maybeAlpha||xa(t)!==xa(l))},ka=(e,t,a)=>{if("string"==typeof e.initValue)return $a(e,t,e.initValue);{const l=e.initValue;for(let n=0,r=l.length;n<r;n++)if(l[n].tag.includes(a)&&$a(e,t,l[n].val))return!0}return!1},Aa=e=>{const t={id:0,class:0,tag:0};return e.forEach((e=>{t.id+=e.id.length,t.class+=e.class.length+e.pseudo.length+e.attr.length,t.tag+=e.type?1:0})),t},Va=(e,t)=>e.id!==t.id?e.id>t.id:e.class!==t.class?e.class>t.class:e.tag===t.tag||e.tag>t.tag,Ta=t=>{t.querySelectorAll(e.NodeType.Tag).forEach((e=>{e.styles&&delete e.styles}));const a=[];t.stylesheet&&t.stylesheet.stylesheet.rules.forEach((l=>{if("rule"===l.type&&l.declarations&&l.selectors){const r=[];l.declarations.forEach((e=>{e.property&&e.value&&r.push({name:e.property,fullname:e.property,value:e.value.replace(Yt,""),important:Yt.test(e.value)})}));for(let i=l.selectors.length;i--;){const s=e.parseSelector(l.selectors[i])[0],o=Aa(s),u=t.querySelectorAll(s);u.length&&a.push({styles:r,selector:s,selectorPriority:o,statusPseudo:(n=s,n.some((t=>t.pseudo.some((t=>!!Y.includes(t.func)||(!(!t.isClass||!U.includes(t.func))||!("not"!==t.func||!t.value||!e.parseSelector(t.value).some((e=>e.some((e=>e.pseudo.some((e=>Y.includes(e.func)||e.isClass&&U.includes(e.func)))))))))))))),nodes:u})}}var n})),((t,a)=>{t.querySelectorAll(e.NodeType.Tag).forEach((e=>{let l,r={};e.styles?r=e.styles:e.styles=r,e.attributes.forEach((a=>{if("style"===a.fullname)ta(a.value).forEach((e=>{r[e.name]={value:e.value,from:"inline",important:e.important,overrideList:[]}}));else if("href"===a.name)l=t.querySelector(e.getAttribute(a.fullname));else if(Ot[a.fullname].couldBeStyle){const e=r[a.fullname];e&&"inherit"!==e.from||(r[a.fullname]={value:a.value,from:"attr",overrideList:[]})}})),a.forEach((t=>{if(t.nodes.includes(e)){if(t.statusPseudo)return void t.styles.forEach((e=>{r[e.name]?r[e.name].statusPseudo=!0:r[e.name]={statusPseudo:!0,from:"inherit",value:"",overrideList:[]}}));t.styles.forEach((e=>{const a=r[e.name];if(!a||"attr"===a.from||"inherit"===a.from||"styletag"===a.from&&(a.selectorPriority&&Va(t.selectorPriority,a.selectorPriority)&&a.important===e.important||!a.important&&e.important)||"inline"===a.from&&!a.important&&e.important){const l=[];let n;a&&(l.push(...a.overrideList),n=a.statusPseudo,"styletag"===a.from&&(a.selectorPriority&&Va(t.selectorPriority,a.selectorPriority)&&a.important===e.important||!a.important&&e.important)?l.push({from:"styletag",selector:a.selector,selectorPriority:a.selectorPriority,important:a.important,value:a.value}):"inline"===a.from&&!a.important&&e.important&&l.push({from:"inline",value:a.value})),r[e.name]={value:e.value,from:"styletag",selector:t.selector,selectorPriority:t.selectorPriority,important:e.important,overrideList:l,statusPseudo:n}}else a&&"inline"===a.from&&(a.override=!0),a.overrideList.push({from:"styletag",selector:t.selector,important:e.important,selectorPriority:t.selectorPriority,value:e.value})}))}}));const i=e.parentNode;if(i&&i.styles&&Object.keys(i.styles).forEach((e=>{!n(r,e)&&Ot[e].inherited&&(r[e]={value:i.styles[e].value,from:"inherit",overrideList:[]})})),l){let e={};l.styles?e=l.styles:l.styles=e,Object.keys(r).forEach((t=>{n(e,t)||(e[t]={value:r[t].value,from:"inherit",overrideList:[]})}))}}))})(t,a)},Ea=async t=>new Promise((a=>{if(t.stylesheet){Ta(t);const a=t.stylesheet.stylesheet;for(let l=a.rules.length;l--;){const n=a.rules[l];if("rule"===n.type){const r=n.declarations,i=t.querySelectorAll(e.parseSelector(n.selectors.join(",")));if(1===i.length){const e=i[0],t=e.styles,n=ta(e.getAttribute("style")||"");for(let e=0;e<r.length;e++){const a=r[e],l=a.property,i=Yt.test(a.value),s=a.value.replace(Yt,""),o=t[l];o&&"styletag"===o.from&&$a(Ot[l],o.value,s)&&n.push({fullname:l,name:l,value:s,important:i})}e.setAttribute("style",aa(n)),a.rules.splice(l,1)}}}}a()})),Na=(e,t)=>e.querySelector(t),Sa=(e,t)=>{for(const a of t.children)e(a)&&Sa(e,a)},Ca=(e,t,a,l,n,r)=>{var i;if(!t)return!1;if(n){if(ta(null!==(i=t.getAttribute("style"))&&void 0!==i?i:"").some((t=>t.fullname===e.name&&(!r||t.important))))return!1}if(e.applyTo.includes(t.nodeName))return!0;if(l.has(t))return!1;l.add(t);let s=!1;return t.hasAttribute("href")?s=Ca(e,Na(a,t.getAttribute("href")),a,l,n,!1):t.hasAttribute("xlink:href")&&(s=Ca(e,Na(a,t.getAttribute("xlink:href")),a,l,n,!1)),!!s||(Sa((t=>{if(s)return!1;if(l.has(t))return!1;l.add(t);for(let a=t.attributes.length;a--;){const l=t.attributes[a];if("style"===l.fullname){if(ta(l.value).some((t=>t.fullname===e.name)))return!1}else if(l.fullname===e.name)return!1}if(e.applyTo.includes(t.nodeName))return s=!0,!1;if(t.hasAttribute("href")){if(Ca(e,Na(a,t.getAttribute("href")),a,l,n,!1))return s=!0,!1}else if(t.hasAttribute("xlink:href")&&Ca(e,Na(a,t.getAttribute("xlink:href")),a,l,n,!1))return s=!0,!1;return!0}),t),s)},Ma=(e,t,a,l=!1,n=!1)=>Ca(e,t,a,new Set,l,n),za=e=>ne(e.trim()).replace(/\s*([@='"#.*+>~[\](){}:,;])\s*/g,"$1").replace(/;$/,""),qa=a.pipe(aa,za),Pa=(e,t)=>{const a={};e.attributes.forEach((e=>{a[e.fullname]=e})),t.attributes.forEach((t=>{n(a,t.fullname)?B.includes(t.fullname)&&(a[t.fullname].value=`${t.value} ${a[t.fullname].value}`):(e.setAttribute(t.name,t.value,t.namespace),a[t.fullname]=t)}))},Ba=(e,t)=>{var a;Ta(e);const l=t.getAttribute("style");if(l){const n=ta(l),r=new Map;for(let a=n.length;a--;){const l=n[a],i=Ot[l.fullname];if(i.applyTo.includes("g"))return;const s=t.children.filter((t=>{var a,n;return Ma(i,t,e)&&"inherit"===(null===(n=null===(a=t.styles)||void 0===a?void 0:a[l.fullname])||void 0===n?void 0:n.from)}));if(0!==s.length){if(1!==s.length)return;r.set(s[0],l)}}for(const[e,t]of r){const l=ta(null!==(a=e.getAttribute("style"))&&void 0!==a?a:"");t.important=!1,l.push(t),e.setAttribute("style",qa(l))}t.removeAttribute("style")}},La=e=>e.attributes.filter((e=>L.includes(e.fullname))).length,Fa=e=>Object.keys(e).sort().join("|"),ja=(e,t,a)=>{let l=a;e.hasAttribute(t)&&(l=e.getAttribute(t));const r=e.styles;return n(r,t)&&(l=r[t].value),l},Oa=(e,t,a,l)=>{if(e.children.length||t.children.length)return!1;if("none"!==ja(e,"marker-start","none")||"none"!==ja(e,"marker-mid","none")||"none"!==ja(e,"marker-end","none"))return!1;if(!Ra(e,t))return!1;const r=e.styles,i=t.styles;if(!Ia(r,i))return!1;const s=!n(r,"opacity")||1===xa(r.opacity.value),o=1===va(n(r,"stroke")?r.stroke.value:"").a&&(!n(r,"stroke-opacity")||1===xa(r["stroke-opacity"].value)),u=1===va(n(r,"fill")?r.fill.value:"").a&&(!n(r,"fill-opacity")||1===xa(r["fill-opacity"].value)),c=n(r,"fill")&&"none"===r.fill.value||a,m=!n(r,"fill-rule")||"evenodd"!==r["fill-rule"].value,p=!n(r,"stroke")||"none"===r.stroke.value;return(l||s&&u&&o)&&(c||p)&&m},Ra=(e,t)=>{const a={},l={};let r=!0;return e.attributes.forEach((({value:e,fullname:t})=>{"d"!==t&&"style"!==t&&(a[t]=e)})),t.attributes.forEach((({value:e,fullname:t})=>{if("d"!==t&&"style"!==t){l[t]=e;const i=Ot[t];n(a,t)&&$a(i,e,a[t])||(r=!1)}})),r&&Fa(a)===Fa(l)},Ia=(e,t)=>{let a=!0;return Object.keys(e).forEach((l=>{const r=Ot[l];n(t,l)&&$a(r,e[l].value,t[l].value)||(a=!1)})),a&&Fa(e)===Fa(t)},Da=e=>{if(!isFinite(e))return 0;const t=e.toString();if(ra(t)){const e=t.indexOf("e");if("-"===t[e+1]){const a=+t.slice(e+2);return ia(t)?e-(t.indexOf(".")+1)+a:a}return 0}return ia(t)?t.length-(t.indexOf(".")+1):0},Ua=a.curry(((e,t)=>{const a=Da(e)+Da(t);return oa(a,e*t)})),Ya=a.curry(((e,t)=>{const a=Math.max(Da(e),Da(t));return oa(a,e+t)}));class Ga{constructor(e=1,t=0,a=0,l=1,n=0,r=0){this.a=e,this.b=t,this.c=a,this.d=l,this.e=n,this.f=r}translate(e,t){return this.multiply(new Ga(1,0,0,1,e,t))}rotate(e){const t=e*Math.PI/180;return this.multiply(new Ga(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0))}scale(e,t=null){return this.multiply(new Ga(e,0,0,null===t?e:t,0,0))}skewX(e){const t=e*Math.PI/180;return this.multiply(new Ga(1,0,Math.tan(t),1,0,0))}skewY(e){const t=e*Math.PI/180;return this.multiply(new Ga(1,Math.tan(t),0,1,0,0))}multiply(e){const t=this.a*e.a+this.c*e.b,a=this.b*e.a+this.d*e.b,l=this.a*e.c+this.c*e.d,n=this.b*e.c+this.d*e.d,r=this.a*e.e+this.c*e.f+this.e,i=this.b*e.e+this.d*e.f+this.f;return this.a=t,this.b=a,this.c=l,this.d=n,this.e=r,this.f=i,this}}const Za=(e,t=3,a=2,l=2)=>{const n={type:e.type,val:[]};switch(e.type){case"translate":e.val.forEach(((e,t)=>{n.val[t]=oa(a,e)})),0===n.val[1]&&(n.val.length=1),0===n.val[0]&&(n.val[0]=0,1===n.val.length&&(n.noEffect=!0));break;case"scale":e.val.forEach(((e,a)=>{n.val[a]=oa(t,e)})),n.val[0]===n.val[1]&&(n.val.length=1),1===n.val[0]&&1===n.val.length&&(n.noEffect=!0);break;case"rotate":n.val[0]=oa(l,e.val[0]),0===n.val[0]&&(n.val[0]=0,n.noEffect=!0),3===e.val.length&&(n.val[1]=oa(a,e.val[1]),n.val[2]=oa(a,e.val[2]),0===n.val[1]&&0===n.val[2]&&(n.val.length=1));break;case"skewX":case"skewY":n.val[0]=oa(l,e.val[0]),0===n.val[0]&&(n.val[0]=0,n.noEffect=!0);break;default:{const r=((e,t,a)=>{const l=e.val.map(((e,l)=>oa(l<4?t:a,e))).join(","),n=oa(t),r=oa(a);if(/^1,0,0,1/.test(l))return{type:"translate",val:0===r(e.val[5])?[e.val[4]]:[e.val[4],e.val[5]]};if(/^[^,]+,0,0,[^,]+,0,0/.test(l))return{type:"scale",val:n(e.val[0])===n(e.val[3])?[e.val[0]]:[e.val[0],e.val[3]]};if(/^1,0,[^,]+,1,0,0/.test(l)){let t=(180*Math.atan(e.val[2])/Math.PI+u)%u;return t>350&&(t-=u),{type:"skewX",val:[t]}}if(/^1,[^,]+,0,1,0,0/.test(l)){let t=(180*Math.atan(e.val[1])/Math.PI+u)%u;return t>350&&(t-=u),{type:"skewY",val:[t]}}if(n(e.val[0])===n(e.val[3])&&n(e.val[1])===-n(e.val[2])&&1===n(Math.pow(e.val[0],2)+Math.pow(e.val[1],2))){let t;t=e.val[0]>=0?Math.asin(e.val[1]):e.val[1]>=0?Math.acos(e.val[0]):-Math.acos(e.val[0]);let a=(180*t/Math.PI+u)%u;a>350&&(a-=u);const l=(e.val[4]*(1-e.val[0])-e.val[1]*e.val[5])/(2-2*e.val[0]);return{type:"rotate",val:[a,l,(l*e.val[1]+e.val[5])/(1-e.val[3])]}}return e})(e,t,a);if("matrix"===r.type){r.val.forEach(((e,l)=>{n.val[l]=oa(l<4?t:a,e)}));break}return Za(r,t,a,l)}}return n},Xa=(e,t=3,a=2,l=2)=>{let n=new Ga;for(const t of e)switch(t.type){case"translate":n=n.translate(t.val[0],t.val[1]);break;case"rotate":3===t.val.length?(n=n.translate(t.val[1],t.val[2]),n=n.rotate(t.val[0]),n=n.translate(-t.val[1],-t.val[2])):n=n.rotate(t.val[0]);break;case"scale":n=n.scale(t.val[0],...t.val.slice(1));break;case"skewX":n=n.skewX(t.val[0]);break;case"skewY":n=n.skewY(t.val[0]);break;default:n=n.multiply(new Ga(...t.val))}return Za({type:"matrix",val:[n.a,n.b,n.c,n.d,n.e,n.f]},t,a,l)},Ha=(e,t,a=3,l=2,n=2)=>{let r={type:e.type,val:[]};switch(e.type){case"translate":1===e.val.length&&(e.val[1]=0),1===t.val.length&&(t.val[1]=0),r.val=[e.val[0]+t.val[0],e.val[1]+t.val[1]];break;case"scale":1===e.val.length&&(e.val[1]=e.val[0]),1===t.val.length&&(t.val[1]=t.val[0]),r.val=[e.val[0]*t.val[0],e.val[1]*t.val[1]];break;case"rotate":1===e.val.length&&1===t.val.length?r.val[0]=e.val[0]+t.val[0]:e.val[1]===t.val[1]&&e.val[2]===t.val[2]?r.val=[e.val[0]+t.val[0],e.val[1],e.val[2]]:r=Xa([e,t],a,l,n);break;case"skewX":case"skewY":r=Xa([e,t],a,l,n);break;default:return Xa([e,t],a,l,n)}return Za(r,a,l,n)},_a=`(translate|scale|rotate|skewX|skewY|matrix)\\s*\\(\\s*(${Ce}(?:${he}${Ce})*)\\s*\\)`,Qa=new RegExp(_a,"gm"),Wa=new RegExp(`^${_a}(?:${he}${_a})*$`,"m"),Ka=e=>{const t=[];if(Wa.test(e.trim())){Qa.lastIndex=0;let a=Qa.exec(e);for(;null!==a;){const l=wa(a[2]);if("translate"===a[1]||"scale"===a[1]){if(l.length>2)return[]}else if("matrix"===a[1]){if(6!==l.length)return[]}else if("rotate"===a[1]){if(1!==l.length&&3!==l.length)return[]}else if(1!==l.length)return[];t.push({type:a[1],val:l}),a=Qa.exec(e)}}return t},Ja=a.pipe((e=>{const t=e.toString();let a=t,l=0;for(;"0"===a.slice(-1);)a=a.slice(0,-1),l++;return a=`${a}e${l}`,la(a,t)}),na),el=e=>e.trim().replace(/\s*,\s*|\s+/g,",").replace(/,(?=[+-]\.?\d+)/g,"").replace(/([.eE]\d+),(?=\.\d+)/g,"$1"),tl=e=>el(e.map(Ja).join(",")),al=(e,t=3,a=2,l=2)=>{let n="";return e.forEach((e=>{const r=Za(e,t,a,l);r.noEffect||(n+=`${r.type}(${tl(r.val)})`)})),n},ll=a.curry(((e,t)=>{const a=Math.max(Da(e),Da(t));return oa(a,e-t)})),nl=e=>el(e.map(Ja).join(",")).length,rl=(e,t,a,l)=>{const n=nl([t]),r=nl([e]);return n===r?"H"===a[a.length-1].type?a.push({type:"H",from:l.slice(),val:[e]}):a.push({type:"h",from:l.slice(),val:[t]}):n<r?a.push({type:"h",from:l.slice(),val:[t]}):a.push({type:"H",from:l.slice(),val:[e]}),[e,l[1]]},il=(e,t,a,l)=>{const n=nl([t]),r=nl([e]);return n===r?"V"===a[a.length-1].type?a.push({type:"V",from:l.slice(),val:[e]}):a.push({type:"v",from:l.slice(),val:[t]}):n<r?a.push({type:"v",from:l.slice(),val:[t]}):a.push({type:"V",from:l.slice(),val:[e]}),[l[0],e]},sl=(e,t,a,l)=>{if(0===t[1])return rl(e[0],t[0],a,l);if(0===t[0])return il(e[1],t[1],a,l);const n=nl(t),r=nl(e);return n===r?"L"===a[a.length-1].type?a.push({type:"L",from:l.slice(),val:e.slice()}):a.push({type:"l",from:l.slice(),val:t.slice()}):n<r?a.push({type:"l",from:l.slice(),val:t.slice()}):a.push({type:"L",from:l.slice(),val:e.slice()}),e.slice()},ol=(e,t,a,l)=>{if(e[5]===l[0]&&e[6]===l[1]||0===e[0]||0===e[1])return sl([e[5],e[6]],[t[5],t[6]],a,l);e[0]<0&&(e[0]=Math.abs(e[0])),e[1]<0&&(e[1]=Math.abs(e[1]));const n=a.length,r=nl(t),i=nl(e);return r===i?"A"===a[n-1].type?a.push({type:"A",from:l.slice(),val:e}):a.push({type:"a",from:l.slice(),val:t}):r<i?a.push({type:"a",from:l.slice(),val:t}):a.push({type:"A",from:l.slice(),val:e}),[e[5],e[6]]},ul=(e,t,a,l)=>{const n=nl(t),r=nl(e);return n===r?"S"===a[a.length-1].type?a.push({type:"S",from:l.slice(),val:e.slice()}):a.push({type:"s",from:l.slice(),val:t.slice()}):n<r?a.push({type:"s",from:l.slice(),val:t.slice()}):a.push({type:"S",from:l.slice(),val:e.slice()}),[e[2],e[3]]},cl=a.curry(((e,t)=>Ya(t,ll(t,e)))),ml=(e,t,a,l,n,r)=>cl(e,a)===n&&cl(t,l)===r,pl=(e,t,a,l)=>{if(((e,t,a,l)=>{const n=e[e.length-1];switch(n.type){case"C":return ml(n.val[2],n.val[3],l[0],l[1],t,a);case"c":return ml(Ya(n.val[2],n.from[0]),Ya(n.val[3],n.from[1]),l[0],l[1],t,a);case"S":return ml(n.val[0],n.val[1],l[0],l[1],t,a);case"s":return ml(Ya(n.val[0],n.from[0]),Ya(n.val[1],n.from[1]),l[0],l[1],t,a);default:return t===l[0]&&a===l[1]}})(a,e[0],e[1],l))return ul(e.slice(2),t.slice(2),a,l);{const n=nl(t),r=nl(e);return n===r?"C"===a[a.length-1].type?a.push({type:"C",from:l.slice(),val:e.slice()}):a.push({type:"c",from:l.slice(),val:t.slice()}):n<r?a.push({type:"c",from:l.slice(),val:t.slice()}):a.push({type:"C",from:l.slice(),val:e.slice()}),[e[4],e[5]]}},fl=(e,t,l,n)=>(a.lt(nl(e),nl(t))?l.push({type:"M",from:n.slice(),val:e.slice()}):l.push({type:"m",from:n.slice(),val:t.slice()}),e.slice()),yl=(e,t,a,l)=>{const n=l.slice(),r=a[a.length-1];switch(r.type){case"T":case"t":n.push(cl(r.from[2],n[0]),cl(r.from[3],n[1]));break;case"Q":n.push(cl(r.val[0],n[0]),cl(r.val[1],n[1]));break;case"q":n.push(cl(Ya(r.val[0],r.from[0]),n[0]),cl(Ya(r.val[1],r.from[1]),n[1]));break;default:n.push(n[0],n[1])}const i=nl(t),s=nl(e);return i===s?"T"===a[a.length-1].type?a.push({type:"T",from:n,val:e.slice()}):a.push({type:"t",from:n,val:t.slice()}):i<s?a.push({type:"t",from:n,val:t.slice()}):a.push({type:"T",from:n,val:e.slice()}),e.slice()},dl=(e,t,l,n)=>{if(((e,t,l,n)=>{const r=e[e.length-1];switch(r.type){case"Q":return ml(r.val[0],r.val[1],n[0],n[1],t,l);case"q":return ml(Ya(r.val[0],r.from[0]),Ya(r.val[1],r.from[1]),n[0],n[1],t,l);case"T":case"t":return ml(r.from[2],r.from[3],n[0],n[1],t,l);default:return a.equals([t,l],n)}})(l,e[0],e[1],n))return yl(e.slice(2),t.slice(2),l,n);{const a=nl(t),r=nl(e);return a===r?"Q"===l[l.length-1].type?l.push({type:"Q",from:n.slice(),val:e.slice()}):l.push({type:"q",from:n.slice(),val:t.slice()}):a<r?l.push({type:"q",from:n.slice(),val:t.slice()}):l.push({type:"Q",from:n.slice(),val:e.slice()}),[e[2],e[3]]}},gl=(e,t)=>{if("z"===e[e.length-1].type.toLowerCase())return t;const a="m"===e[0].type?[Ya(e[0].val[0],e[0].from[0]),Ya(e[0].val[1],e[0].from[1])]:[e[0].val[0],e[0].val[1]];return e.push({type:"z",from:t.slice(),val:[]}),a},hl=(e,t)=>e.map(((e,a)=>Ya(e,t[a%2]))),vl=(e,t)=>e.map(((e,a)=>ll(e,t[a%2]))),bl=e=>{if(e.type===e.type.toLowerCase())return e.val[0];const t="h"===e.type.toLowerCase();return ll(e.val[0],e.from[t?0:1])},xl=e=>e.type===e.type.toLowerCase()?e.val.slice():vl(e.val,e.from),wl=e=>e.type===e.type.toUpperCase()?e.val.slice():hl(e.val,e.from),$l=e=>{const t=[];let a=[0,0];for(const l of e){const e=[];for(const t of l)switch(t.type){case"M":for(let l=0,n=t.val.length;l<n;l+=2){a=(0===l?fl:sl)([t.val[l],t.val[l+1]],vl([t.val[l],t.val[l+1]],a),e,a)}break;case"m":for(let l=0,n=t.val.length;l<n;l+=2){a=(0===l?fl:sl)(hl([t.val[l],t.val[l+1]],a),[t.val[l],t.val[l+1]],e,a)}break;case"H":for(let l=0,n=t.val.length;l<n;l++)a=rl(t.val[l],ll(t.val[l],a[0]),e,a);break;case"h":for(let l=0,n=t.val.length;l<n;l++)a=rl(Ya(t.val[l],a[0]),t.val[l],e,a);break;case"V":for(let l=0,n=t.val.length;l<n;l++)a=il(t.val[l],ll(t.val[l],a[1]),e,a);break;case"v":for(let l=0,n=t.val.length;l<n;l++)a=il(Ya(t.val[l],a[1]),t.val[l],e,a);break;case"L":for(let l=0,n=t.val.length;l<n;l+=2)a=sl([t.val[l],t.val[l+1]],vl([t.val[l],t.val[l+1]],a),e,a);break;case"l":for(let l=0,n=t.val.length;l<n;l+=2)a=sl(hl([t.val[l],t.val[l+1]],a),[t.val[l],t.val[l+1]],e,a);break;case"C":for(let l=0,n=t.val.length;l<n;l+=6){const n=t.val.slice(l,l+6);a=pl(n,vl(n,a),e,a)}break;case"c":for(let l=0,n=t.val.length;l<n;l+=6){const n=t.val.slice(l,l+6);a=pl(hl(n,a),n,e,a)}break;case"S":for(let l=0,n=t.val.length;l<n;l+=4){const n=t.val.slice(l,l+4);a=ul(n,vl(n,a),e,a)}break;case"s":for(let l=0,n=t.val.length;l<n;l+=4){const n=t.val.slice(l,l+4);a=ul(hl(n,a),n,e,a)}break;case"Q":for(let l=0,n=t.val.length;l<n;l+=4){const n=t.val.slice(l,l+4);a=dl(n,vl(n,a),e,a)}break;case"q":for(let l=0,n=t.val.length;l<n;l+=4){const n=t.val.slice(l,l+4);a=dl(hl(n,a),n,e,a)}break;case"T":for(let l=0,n=t.val.length;l<n;l+=2){const n=t.val.slice(l,l+2);a=yl(n,vl(n,a),e,a)}break;case"t":for(let l=0,n=t.val.length;l<n;l+=2){const n=t.val.slice(l,l+2);a=yl(hl(n,a),n,e,a)}break;case"A":for(let l=0,n=t.val.length;l<n;l+=7){const n=t.val.slice(l,l+7);a=ol(n,n.slice(0,5).concat(vl(n.slice(5),a)),e,a)}break;case"a":for(let l=0,n=t.val.length;l<n;l+=7){const n=t.val.slice(l,l+7);a=ol(n.slice(0,5).concat(hl(n.slice(5),a)),n,e,a)}break;default:a=gl(e,a)}e.length&&t.push(e)}return t},kl=e=>{const t=[];Pe.lastIndex=0;let a=Pe.exec(e),l=0;for(;a;){if(l%7==3||l%7==4){if(("0"===a[0][0]||"1"===a[0][0])&&(t.push(+a[0][0]),a[0]=a[0].slice(1),a[0].length)){l++;continue}}else t.push(+a[0]);l++,a=Pe.exec(e)}return t},Al=new RegExp(`([mzlhvcsqta])\\s*((?:${ze})?)(.*?)(?=[mzlhvcsqta]|$)`,"gim"),Vl=e=>{const t=[];let a=[];Al.lastIndex=0;let l=Al.exec(e);e:for(;null!==l;){const n=l[1].toLowerCase();if(!a.length&&"m"!==n)return t;let r=[];switch(l[2]&&(r="a"===n?kl(l[2]):wa(l[2])),n){case"m":if(a.length&&(t.push(a),a=[]),r.length%2!=0){r.length>2&&a.push({type:l[1],val:r.slice(0,r.length-1)});break e}break;case"l":case"t":if(r.length%2!=0){r.length>2&&a.push({type:l[1],val:r.slice(0,r.length-1)});break e}break;case"z":if(r.length){a.push({type:l[1],val:[]});break e}break;case"s":case"q":if(r.length%4!=0){r.length>4&&a.push({type:l[1],val:r.slice(0,r.length-r.length%4)});break e}break;case"c":if(r.length%6!=0){r.length>6&&a.push({type:l[1],val:r.slice(0,r.length-r.length%6)});break e}break;case"a":{const e=[];if(r.every(((t,a)=>(a%7!=3&&a%7!=4||0===t||1===t)&&(e.push(t),!0))),e.length%7!=0){e.length>7&&a.push({type:l[1],val:e.slice(0,e.length-e.length%7)});break e}break}}if("z"!==n&&!r.length)break e;if(a.push({type:l[1],val:r}),l[3]&&!/^\s*,?\s*$/.test(l[3]))break;l=Al.exec(e)}return t.push(a),t},Tl=(e,t,a)=>"a"===e.type.toLowerCase()?e.val.map(((e,l)=>{switch(l%7){case 0:case 1:case 5:case 6:return oa(t,e);case 2:return oa(a,e);default:return e}})):e.val.map((e=>oa(t,e))),El=e=>el(e.reduce(((t,a,l)=>l%7==3||l%7==4||l===e.length-1?`${t}${Ja(a)}`:`${t}${Ja(a)},`),"")),Nl=(e,t=2,a=2)=>{let l="",n="";for(const r of e)for(const e of r){const r="a"===e.type||"A"===e.type?El:tl;e.type===n&&"m"!==n.toLowerCase()||"l"===e.type&&"m"===n||"L"===e.type&&"M"===n?l=el(`${l},${r(Tl(e,t,a))}`):(n=e.type,l+=`${e.type}${r(Tl(e,t,a))}`)}return l},Sl=e=>Object.values(e.styles).some((t=>{if("styletag"===t.from){const a=t.selector;if(a[a.length-1].type===e.nodeName)return!0}return!1})),Cl=e=>{const t=[];return e.children.forEach((e=>{if(b.includes(e.nodeName)){const a=e.getAttribute("attributeName");if(a&&("animateTransform"!==e.nodeName||"tranform"===a||"patternTransform"===a)){const l=[],n=e.getAttribute("from"),r=e.getAttribute("to"),i=e.getAttribute("by"),s=e.getAttribute("values"),o=[];n&&(l.push(n),o.push("from")),r&&(l.push(r),o.push("to")),i&&(l.push(i),o.push("by")),s&&(l.push(...s.split(";").map((e=>e.trim())).filter((e=>!!e))),o.push("values")),t.push({node:e,attributeName:a,keys:o,values:l})}}})),t},Ml=(e,t,a=()=>!0)=>e.some((e=>e.attributeName===t&&e.values.some(a))),zl=(e,t)=>{let a=ta(e.getAttribute("style")||"");for(const l of t)e.removeAttribute(l),a=a.filter((e=>e.fullname!==l));a.length?e.setAttribute("style",aa(a)):e.removeAttribute("style")},ql=90,Pl=oa(3),Bl=(e,t,a)=>Ja(e(parseFloat(t),a)),Ll=(e,t,a)=>(t.forEach(((l,n)=>{t[n]=e(l,a)})),el(t.map(Ja).join(","))),Fl=(e,t)=>{for(let a=0;a<t.length;a+=2)[t[a],t[a+1]]=e(t[a],t[a+1]);return el(t.map(Ja).join(","))},jl=(e,t,a)=>{if("0"===a)zl(e,[t]);else{if(I.includes(t)&&e.hasAttribute("style")){const l=ta(e.getAttribute("style"));if(l.some((e=>e.fullname===t&&(e.value=a,!0))))return void e.setAttribute("style",aa(l))}e.setAttribute(t,a)}},Ol=(e,t,a,l,n)=>{if(Ml(a,"cx")||Ml(a,"cy"))return!1;const r=ja(e,"cx","0"),i=ja(e,"cy","0"),s=ja(e,"r","0");if(!Oe.test(r)||!Oe.test(i))return!1;if("translate"!==t.type&&n)return!1;switch(t.type){case"translate":{const a=t.val[0],l=t.val[1]||0;return jl(e,"cx",Bl(Ya,r,a)),jl(e,"cy",Bl(Ya,i,l)),e.removeAttribute("transform"),!0}case"rotate":{let a=new Ga;3===t.val.length?(a=a.translate(t.val[1],t.val[2]),a=a.rotate(t.val[0]),a=a.translate(-t.val[1],-t.val[2])):a=a.rotate(t.val[0]);const l=parseFloat(r),n=parseFloat(i);return jl(e,"cx",`${Pl(a.a*l+a.c*n+a.e)}`),jl(e,"cy",`${Pl(a.b*l+a.d*n+a.f)}`),e.removeAttribute("transform"),!0}case"scale":{if(l||!Oe.test(s)||Ml(a,"r"))return!1;const n=t.val[0],o=2===t.val.length?t.val[1]:t.val[0];if(n===o)jl(e,"cx",Bl(Ua,r,n)),jl(e,"cy",Bl(Ua,i,o)),jl(e,"r",Bl(Ua,s,n));else{if(Sl(e))return!1;e.nodeName="ellipse",jl(e,"cx",Bl(Ua,r,n)),jl(e,"cy",Bl(Ua,i,o)),jl(e,"rx",Bl(Ua,s,n)),jl(e,"ry",Bl(Ua,s,o)),zl(e,["r"])}return e.removeAttribute("transform"),!0}case"matrix":if(0===t.val[1]&&0===t.val[2]){if(l||!Oe.test(s)||Ml(a,"r"))return!1;const n=t.val[0],o=t.val[3];if(n===o)jl(e,"cx",Bl(Ya,Bl(Ua,r,n),t.val[4])),jl(e,"cy",Bl(Ya,Bl(Ua,i,o),t.val[5])),jl(e,"r",Bl(Ua,s,n));else{if(Sl(e))return!1;e.nodeName="ellipse",jl(e,"cx",Bl(Ya,Bl(Ua,r,n),t.val[4])),jl(e,"cy",Bl(Ya,Bl(Ua,i,o),t.val[5])),jl(e,"rx",Bl(Ua,s,n)),jl(e,"ry",Bl(Ua,s,o)),zl(e,["r"])}return e.removeAttribute("transform"),!0}return!1;default:return!1}},Rl=(e,t,a)=>{const l=Cl(e),n=("none"!==ja(e,"stroke","none")||Ml(l,"stroke",(e=>"none"!==e)))&&("0"!==ja(e,"stroke-width","1")||Ml(l,"stroke-width",(e=>"0"!==e))),r="none"!==ja(e,"marker-start","none")||"none"!==ja(e,"marker-mid","none")||"none"!==ja(e,"marker-end","none")||Ml(l,"marker-start",(e=>"none"!==e))||Ml(l,"marker-mid",(e=>"none"!==e))||Ml(l,"marker-end",(e=>"none"!==e));switch(e.nodeName){case"text":case"tspan":return((e,t,a)=>{const l="tspan"===e.nodeName?"d":"";if("translate"!==t.type||Ml(a,`${l}x`)||Ml(a,`${l}y`))return!1;if("text"===e.nodeName&&e.querySelectorAll("tspan[x],tspan[y]").length)return!1;const n=e.getAttribute(`${l}x`)||"0",r=e.getAttribute(`${l}y`)||"0";if(Re.test(n)&&Re.test(r)){const a=wa(n);if(jl(e,`${l}x`,Ll(Ya,a,t.val[0])),t.val[1]){const a=wa(r);jl(e,`${l}y`,Ll(Ya,a,t.val[1]))}return e.removeAttribute("transform"),!0}return!1})(e,t,l);case"rect":return((e,t,a,l,n)=>{const r=ja(e,"x","0"),i=ja(e,"y","0"),s=ja(e,"width","0"),o=ja(e,"height","0");let u=ja(e,"rx","auto"),c=ja(e,"ry","auto");if("auto"===u?u=c:"auto"===c&&(c=u),"auto"===u&&(u="0",c="0"),!Oe.test(r)||!Oe.test(i)||Ml(a,"x")||Ml(a,"y"))return!1;if("translate"!==t.type){if(n)return!1;if("rotate"!==t.type&&l)return!1;if(Ml(a,"width")||Ml(a,"height")||Ml(a,"rx")||Ml(a,"ry"))return!1;if(!(Oe.test(s)&&Oe.test(o)&&Oe.test(u)&&Oe.test(c)))return!1}switch(t.type){case"translate":return jl(e,"x",Bl(Ya,r,t.val[0])),jl(e,"y",Bl(Ya,i,t.val[1]||0)),e.removeAttribute("transform"),!0;case"rotate":if(t.val[0]%ql==0){let a=new Ga;3===t.val.length?(a=a.translate(t.val[1],t.val[2]),a=a.rotate(t.val[0]),a=a.translate(-t.val[1],-t.val[2])):a=a.rotate(t.val[0]);let l=parseFloat(r),n=parseFloat(i),m=Ya(l,parseFloat(s)),p=Ya(n,parseFloat(o));return[l,n]=[a.a*l+a.c*n+a.e,a.b*l+a.d*n+a.f],[m,p]=[a.a*m+a.c*p+a.e,a.b*m+a.d*p+a.f],jl(e,"x",`${Pl(Math.min(l,m))}`),jl(e,"y",`${Pl(Math.min(n,p))}`),Math.abs(t.val[0]%180)===ql&&(jl(e,"width",o),jl(e,"height",s),jl(e,"rx",c),u===c?zl(e,["ry"]):jl(e,"ry",u)),e.removeAttribute("transform"),!0}return!1;case"scale":{const a=t.val[0],l=2===t.val.length?t.val[1]:t.val[0];return jl(e,"x",Bl(Ua,r,a)),jl(e,"y",Bl(Ua,i,l)),jl(e,"width",Bl(Ua,s,a)),jl(e,"height",Bl(Ua,o,l)),u=Bl(Ua,u,a),c=Bl(Ua,c,l),jl(e,"rx",u),u===c?zl(e,["ry"]):jl(e,"ry",c),e.removeAttribute("transform"),!0}case"matrix":if(0===t.val[1]&&0===t.val[2]){const a=t.val[0],l=t.val[3];return jl(e,"x",Bl(Ya,Bl(Ua,r,a),t.val[4])),jl(e,"y",Bl(Ya,Bl(Ua,i,l),t.val[5])),jl(e,"width",Bl(Ua,s,a)),jl(e,"height",Bl(Ua,o,l)),u=Bl(Ua,u,a),c=Bl(Ua,c,l),jl(e,"rx",u),u===c?zl(e,["ry"]):jl(e,"ry",c),e.removeAttribute("transform"),!0}return!1;default:return!1}})(e,t,l,n,r);case"line":return((e,t,a,l)=>{if(Ml(a,"x1")||Ml(a,"y1")||Ml(a,"x2")||Ml(a,"y2"))return!1;const n=e.getAttribute("x1")||"0",r=e.getAttribute("y1")||"0",i=e.getAttribute("x2")||"0",s=e.getAttribute("y2")||"0";if(!(Oe.test(n)&&Oe.test(r)&&Oe.test(i)&&Oe.test(s)))return!1;switch(t.type){case"translate":{const a=t.val[0],l=t.val[1]||0;return jl(e,"x1",Bl(Ya,n,a)),jl(e,"y1",Bl(Ya,r,l)),jl(e,"x2",Bl(Ya,i,a)),jl(e,"y2",Bl(Ya,s,l)),e.removeAttribute("transform"),!0}case"rotate":{if(l)return!1;let a=new Ga;3===t.val.length?(a=a.translate(t.val[1],t.val[2]),a=a.rotate(t.val[0]),a=a.translate(-t.val[1],-t.val[2])):a=a.rotate(t.val[0]);const o=parseFloat(n),u=parseFloat(r),c=parseFloat(i),m=parseFloat(s);return jl(e,"x1",`${Pl(a.a*o+a.c*u+a.e)}`),jl(e,"y1",`${Pl(a.b*o+a.d*u+a.f)}`),jl(e,"x2",`${Pl(a.a*c+a.c*m+a.e)}`),jl(e,"y2",`${Pl(a.b*c+a.d*m+a.f)}`),e.removeAttribute("transform"),!0}default:return!1}})(e,t,l,r);case"circle":return Ol(e,t,l,n,r);case"ellipse":return((e,t,a,l,n)=>{const r=ja(e,"cx","0"),i=ja(e,"cy","0");let s=ja(e,"rx","auto"),o=ja(e,"ry","auto");if("auto"===s?s=o:"auto"===o&&(o=s),"auto"===s&&(s="0",o="0"),!Oe.test(r)||!Oe.test(i)||Ml(a,"cx")||Ml(a,"cy"))return!1;if("translate"!==t.type&&n)return!1;if(s===o&&!Ml(a,"rx")&&!Ml(a,"ry")&&!Sl(e))return e.nodeName="circle",zl(e,["rx","ry"]),jl(e,"r",s),Ol(e,t,a,l,n);switch(t.type){case"translate":{const a=t.val[0],l=t.val[1]||0;return jl(e,"cx",Bl(Ya,r,a)),jl(e,"cy",Bl(Ya,i,l)),e.removeAttribute("transform"),!0}case"rotate":{if(t.val[0]%ql!=0)return!1;let l=new Ga;3===t.val.length?(l=l.translate(t.val[1],t.val[2]),l=l.rotate(t.val[0]),l=l.translate(-t.val[1],-t.val[2])):l=l.rotate(t.val[0]);const n=parseFloat(r),u=parseFloat(i);if(Math.abs(t.val[0]%180)===ql){if(s.includes("%")||o.includes("%")||Ml(a,"rx")||Ml(a,"ry"))return!1;jl(e,"rx",o),jl(e,"ry",s)}return jl(e,"cx",`${Pl(l.a*n+l.c*u+l.e)}`),jl(e,"cy",`${Pl(l.b*n+l.d*u+l.f)}`),e.removeAttribute("transform"),!0}case"scale":{if(l||!Oe.test(s)||!Oe.test(o)||Ml(a,"rx")||Ml(a,"ry"))return!1;const n=t.val[0],u=2===t.val.length?t.val[1]:t.val[0];return s=Bl(Ua,s,n),o=Bl(Ua,o,u),jl(e,"cx",Bl(Ua,r,n)),jl(e,"cy",Bl(Ua,i,u)),s!==o||Sl(e)?(jl(e,"rx",s),jl(e,"ry",o)):(e.nodeName="circle",zl(e,["rx","ry"]),jl(e,"r",s)),e.removeAttribute("transform"),!0}case"matrix":if(0===t.val[1]&&0===t.val[2]){if(l||!Oe.test(s)||!Oe.test(o)||Ml(a,"rx")||Ml(a,"ry"))return!1;const n=t.val[0],u=t.val[3];return s=Bl(Ua,s,n),o=Bl(Ua,o,u),jl(e,"cx",Bl(Ya,Bl(Ua,r,n),t.val[4])),jl(e,"cy",Bl(Ya,Bl(Ua,i,u),t.val[5])),s!==o||Sl(e)?(jl(e,"rx",s),jl(e,"ry",o)):(e.nodeName="circle",zl(e,["rx","ry"]),jl(e,"r",s)),e.removeAttribute("transform"),!0}return!1;default:return!1}})(e,t,l,n,r);case"polyline":case"polygon":return((e,t,a,l,n,r)=>{if(Ml(a,"points"))return!1;let i=e.getAttribute("points")||"";const s=wa(i);if(s.length%2==1&&(s.pop(),i=el(s.map(Ja).join(",")),e.setAttribute("points",i)),"translate"===t.type){const a=t.val[0],l=t.val[1]||0,n=Fl(((e,t)=>[Ya(e,a),Ya(t,l)]),s);return n.length<i.length+r.length&&(e.setAttribute("points",n),e.removeAttribute("transform"),!0)}if(n||"rotate"!==t.type&&l)return!1;let o=new Ga;switch(t.type){case"rotate":3===t.val.length?(o=o.translate(t.val[1],t.val[2]),o=o.rotate(t.val[0]),o=o.translate(-t.val[1],-t.val[2])):o=o.rotate(t.val[0]);break;case"scale":case"skewX":case"skewY":o=o[t.type](...t.val);break;default:o=new Ga(...t.val)}const u=Fl(((e,t)=>[Pl(o.a*e+o.c*t+o.e),Pl(o.b*e+o.d*t+o.f)]),s);return u.length<i.length+r.length&&(e.setAttribute("points",u),e.removeAttribute("transform"),!0)})(e,t,l,n,r,a);case"path":return((e,t,a,l,n,r)=>{if(Ml(a,"d"))return!1;const i=e.getAttribute("d")||"",s=$l(Vl(i));if("translate"===t.type){const a=t.val[0],l=t.val[1]||0;s.forEach(((e,t)=>{e.forEach((e=>{switch(e.type){case"m":0===t&&(e.val[0]=Ya(e.val[0],a),e.val[1]=Ya(e.val[1],l));break;case"M":case"L":case"C":case"S":case"Q":case"T":for(let t=0;t<e.val.length;t+=2)e.val[t]=Ya(e.val[t],a),e.val[t+1]=Ya(e.val[t+1],l);break;case"H":for(let t=0;t<e.val.length;t++)e.val[t]=Ya(e.val[t],a);break;case"V":for(let t=0;t<e.val.length;t++)e.val[t]=Ya(e.val[t],l);break;case"A":for(let t=0;t<e.val.length;t+=7)e.val[t+5]=Ya(e.val[t+5],a),e.val[t+6]=Ya(e.val[t+6],l)}}))}));const n=Nl($l(s));return n.length<i.length+r.length&&(e.setAttribute("d",n),e.removeAttribute("transform"),!0)}if(n)return!1;if("rotate"!==t.type&&(l||"scale"!==t.type&&i.toLowerCase().includes("a")))return!1;if("scale"===t.type){const a=t.val[0],l=2===t.val.length?t.val[1]:t.val[0];s.forEach((e=>{e.forEach((e=>{switch(e.type.toLowerCase()){case"m":case"l":case"c":case"s":case"q":case"t":for(let t=0;t<e.val.length;t+=2)e.val[t]=Ua(e.val[t],a),e.val[t+1]=Ua(e.val[t+1],l);break;case"h":for(let t=0;t<e.val.length;t++)e.val[t]=Ua(e.val[t],a);break;case"v":for(let t=0;t<e.val.length;t++)e.val[t]=Ua(e.val[t],l);break;case"a":for(let t=0;t<e.val.length;t+=7)e.val[t+0]=Ua(e.val[t+0],a),e.val[t+1]=Ua(e.val[t+1],l),e.val[t+5]=Ua(e.val[t+5],a),e.val[t+6]=Ua(e.val[t+6],l)}}))}));const n=Nl($l(s));return n.length<i.length+r.length&&(e.setAttribute("d",n),e.removeAttribute("transform"),!0)}let o=new Ga;switch(t.type){case"rotate":3===t.val.length?(o=o.translate(t.val[1],t.val[2]),o=o.rotate(t.val[0]),o=o.translate(-t.val[1],-t.val[2])):o=o.rotate(t.val[0]);break;case"skewX":case"skewY":o=o[t.type](t.val[0]);break;default:o=new Ga(...t.val)}s.forEach(((e,t)=>{e.forEach((e=>{switch(e.type){case"M":case"L":case"C":case"S":case"Q":case"T":for(let t=0;t<e.val.length;t+=2)[e.val[t],e.val[t+1]]=[Pl(o.a*e.val[t]+o.c*e.val[t+1]+o.e),Pl(o.b*e.val[t]+o.d*e.val[t+1]+o.f)];break;case"m":case"l":case"c":case"s":case"q":case"t":for(let t=0;t<e.val.length;t+=2)[e.val[t],e.val[t+1]]=[Pl(o.a*e.val[t]+o.c*e.val[t+1]),Pl(o.b*e.val[t]+o.d*e.val[t+1])];"m"===e.type&&0===t&&(e.val[0]=Pl(e.val[0]+o.e),e.val[1]=Pl(e.val[1]+o.f));break;case"H":{e.type="L";const t=e.val.slice(),a=e.from[1];for(let l=0;l<t.length;l++)e.val[2*l]=Pl(o.a*t[l]+o.c*a+o.e),e.val[2*l+1]=Pl(o.b*t[l]+o.d*a+o.f);break}case"h":{e.type="l";const t=e.val.slice(),a=0;for(let l=0;l<t.length;l++)e.val[2*l]=Pl(o.a*t[l]+o.c*a),e.val[2*l+1]=Pl(o.b*t[l]+o.d*a);break}case"V":{e.type="L";const t=e.val.slice(),a=e.from[0];for(let l=0;l<t.length;l++)e.val[2*l]=Pl(o.a*a+o.c*t[l]+o.e),e.val[2*l+1]=Pl(o.b*a+o.d*t[l]+o.f);break}case"v":{e.type="l";const t=e.val.slice(),a=0;for(let l=0;l<t.length;l++)e.val[2*l]=Pl(o.a*a+o.c*t[l]),e.val[2*l+1]=Pl(o.b*a+o.d*t[l]);break}}}))}));const u=Nl($l(s));return u.length<i.length+r.length&&(e.setAttribute("d",u),e.removeAttribute("transform"),!0)})(e,t,l,n,r,a);default:return!1}},Il=1e6;class Dl{constructor(e=0,t=0){this.x=e,this.y=t}get _modulo(){return Math.sqrt(this.x*this.x+this.y*this.y)}get modulo(){return Dl.Rounding(Math.sqrt(this.x*this.x+this.y*this.y))}set modulo(e){this.normalize(),this.x*=e,this.y*=e}rotate(e){const t=this.x,a=this.y;return this.x=t*Math.cos(e)-a*Math.sin(e),this.y=t*Math.sin(e)+a*Math.cos(e),this}valueOf(){return this.modulo}toString(){return`[${this.x},${this.y}]`}normalize(){const e=this._modulo;if(0===e)throw new Error("零向量无法标准化！");return this.x/=e,this.y/=e,this}zero(){return this.x=0,this.y=0,this}add(e){return this.x+=e.x,this.y+=e.y,this}substract(e){return this.x-=e.x,this.y-=e.y,this}multiplied(e){return"number"==typeof e?(this.x*=e,this.y*=e,this):this.x*e.x+this.y*e.y}radian(e){return Dl.radian(this,e)}angel(e){return Dl.angel(this,e)}get isZero(){return 0===this.x&&0===this.y}get isNormalize(){return 1===this.modulo}static add(e,t){return new Dl(e.x+t.x,e.y+t.y)}static substract(e,t){return new Dl(e.x-t.x,e.y-t.y)}static multiplied(e,t){return"number"==typeof t?new Dl(e.x*t,e.y*t):e.x*t.x+e.y*t.y}static radian(e,t){return e.isZero||t.isZero?NaN:Math.acos(Dl.multiplied(e,t)/e._modulo/t._modulo)}static angel(e,t){return e.isZero||t.isZero?NaN:Dl.Rounding(180*Dl.radian(e,t)/Math.PI)}static projected(e,t){return e.isZero||t.isZero?new Dl(0,0):Dl.multiplied(t,Dl.multiplied(e,t)/Math.pow(t._modulo,2))}static plumb(e,t){return e.isZero?new Dl(0,0):t.isZero?new Dl(e.x,e.y):Dl.substract(e,Dl.projected(e,t))}static Rounding(e){return Math.round(e*Il)/Il}static distance(e,t){return Dl.substract(e,t).modulo}}const Ul=(e,t,a,l)=>{let n=0,r=0;const i=new Dl(ll(l[a],l[t]),ll(l[a+1],l[t+1]));for(let e=t+2;e<a;e+=2){const s=new Dl(ll(l[e],l[t]),ll(l[e+1],l[t+1])),o=new Dl(ll(l[e],l[a]),ll(l[e+1],l[a+1]));let u=0;if(!s.isZero&&!o.isZero){const t=Dl.projected(s,i),a=Dl.projected(o,i);u=t.modulo>i.modulo?t.modulo:a.modulo>i.modulo?a.modulo:Dl.plumb(s,i).modulo,u>n&&(n=u,r=e)}}n<=e?l.splice(t+2,a-t-2):(r<a-2&&Ul(e,r,a,l),r>t+2&&Ul(e,t,r,l))},Yl=(e,t)=>{const a=t.slice();return Ul(e,0,a.length-2,a),a},Gl=(e,t,a)=>{const l=bl(t);if(e[a-1].type.toLowerCase()===t.type.toLowerCase()){const n=e[a-1];bl(n)*l>=0&&(n.val[0]=(e=>{if(e.type===e.type.toUpperCase())return e.val[0];const t="h"===e.type.toLowerCase();return Ya(e.val[0],e.from[t?0:1])})(t),n.type=n.type.toUpperCase(),e.splice(a,1))}},Zl=(e,t,a,l)=>{const n=oa(l);if("l"===e[a-1].type.toLowerCase()){const l=e[a-1],r=xl(t),i=xl(l);n(Math.atan2(i[0],i[1]))===n(Math.atan2(r[0],r[1]))&&(l.val=[Ya(l.val[0],r[0]),Ya(l.val[1],r[1])],l.type="l",e.splice(a,1))}},Xl=(e,t)=>{const a=e.val[2],l=e.val[0],n=e.val[1],r=e.val[3]===e.val[4],i=wl({type:e.type,val:e.val.slice(5),from:e.from}),s=new Dl(e.from[0],e.from[1]),o=new Dl(i[0],i[1]);a&&(s.rotate(-a*Math.PI*2/u),o.rotate(-a*Math.PI*2/u)),l!==n&&(s.y*=l/n,o.y*=l/n);const c=new Dl(o.x-s.x,o.y-s.y);let m=l;m<c.modulo/2&&(m=c.modulo/2),c.modulo=Math.sqrt(m*m-Math.pow(c.modulo/2,2));const p=r?-Math.PI/2:Math.PI/2;return c.rotate(p),c.x+=(s.x+o.x)/2,c.y+=(s.y+o.y)/2,l!==n&&(c.y*=n/l),a&&c.rotate(a*Math.PI*2/u),[oa(t,c.x),oa(t,c.y)]},Hl=(e,t,l,n)=>{const r=e[l-1];if("a"===r.type.toLowerCase()){const i=e=>a.eqProps(`${e}`,r.val,t.val);if(a.all(i,[0,1,2,4])){const a=Xl(t,n),i=Xl(r,n);if(a[0]===i[0]&&a[1]===i[1]){const n=new Dl(r.from[0]-a[0],r.from[1]-a[1]),i=wl({type:r.type,val:r.val.slice(5),from:r.from}),s=new Dl(i[0]-a[0],i[1]-a[1]),o=wl({type:t.type,val:t.val.slice(5),from:t.from}),u=new Dl(o[0]-a[0],o[1]-a[1]);let c=Dl.radian(n,s);1===r.val[3]&&(c=2*Math.PI-c);let m=Dl.radian(s,u);if(1===t.val[3]&&(m=2*Math.PI-m),c+m>=2*Math.PI)return;c+m>Math.PI&&0===r.val[3]&&(r.val[3]=1),r.type="A",r.val[5]=o[0],r.val[6]=o[1],e.splice(l,1)}}}},_l=(e,t)=>{const a={type:e.type,from:e.from.slice(),val:e.val.slice()};if("s"===e.type.toLowerCase()){let[l,n]=e.from;"C"===t.type?(l=cl(t.val[2],e.from[0]),n=cl(t.val[3],e.from[1])):"c"===t.type&&(l=cl(Ya(t.val[2],t.from[0]),e.from[0]),n=cl(Ya(t.val[3],t.from[1]),e.from[1])),"S"===e.type?(a.type="C",a.val.unshift(l,n)):(a.type="c",a.val.unshift(ll(l,e.from[0]),ll(n,e.from[1])))}else if("t"===e.type.toLowerCase()){let[l,n]=e.from;"Q"===t.type?(l=cl(t.val[0],e.from[0]),n=cl(t.val[1],e.from[1])):"q"===t.type&&(l=cl(Ya(t.val[0],t.from[0]),e.from[0]),n=cl(Ya(t.val[1],t.from[1]),e.from[1])),"T"===e.type?(a.type="Q",a.val.unshift(l,n)):(a.type="q",a.val.unshift(ll(l,e.from[0]),ll(n,e.from[1])))}return a},Ql=require("svg-path-contours"),Wl=require("triangulate-contours"),Kl=(e,t)=>t>1||t<e.length-1,Jl=(e,t,a)=>{!a||Kl(e,t)?e.splice(t,1):e[t].type="z"},en=(e,t,a,l)=>{const n=t[a-1],r=_l(e,n),i=xl(r);let s=!0;0!==i[1]&&0!==i[0]&&(s=Math.atan2(i[1],i[0])===Math.atan2(i[3],i[2]));const o=(i[0]>=0==i[2]>=0||i[0]<=0==i[2]<=0)&&(i[1]>=0==i[3]>=0||i[1]<=0==i[3]<=0)&&Math.abs(i[2])>=Math.abs(i[0])&&Math.abs(i[3])>=Math.abs(i[1]);if(s&&o){if(i.every((e=>0===e)))return void(!l||Kl(t,a)?t.splice(a,1):e.type="z");"qt".includes(n.type.toLowerCase())||a!==t.length-1&&"t"===t[a+1].type.toLowerCase()||(e.type="q"===r.type?"l":"L",e.val=r.val.slice(2))}},tn=(e,t,a,l)=>{const n=t[a-1],r=_l(e,n),i=xl(r);let s=!0,o=NaN;for(let e=0;e<6;e+=2)if(0!==i[e]||0!==i[e+1])if(isNaN(o))o=Math.atan2(i[e+1],i[e]);else if(o!==Math.atan2(i[e+1],i[e])){s=!1;break}const u=(i[0]>=0==i[2]>=0||i[0]<=0==i[2]<=0)&&(i[1]>=0==i[3]>=0||i[1]<=0==i[3]<=0)&&(i[2]>=0==i[4]>=0||i[2]<=0==i[4]<=0)&&(i[3]>=0==i[5]>=0||i[3]<=0==i[5]<=0)&&Math.abs(i[2])>=Math.abs(i[0])&&Math.abs(i[3])>=Math.abs(i[1])&&Math.abs(i[4])>=Math.abs(i[2])&&Math.abs(i[5])>=Math.abs(i[3]);if(s&&u){if(i.every((e=>0===e)))return void(!l||Kl(t,a)?t.splice(a,1):e.type="z");"cs".includes(n.type.toLowerCase())||a!==t.length-1&&"s"===t[a+1].type.toLowerCase()||(e.type="c"===r.type?"l":"L",e.val=r.val.slice(4))}},an=e=>{switch(e.type){case"l":e.val[0]=Ya(e.val[0],e.from[0]),e.val[1]=Ya(e.val[1],e.from[1]);break;case"H":e.val.push(e.from[1]);break;case"h":e.val[0]=Ya(e.val[0],e.from[0]),e.val.push(e.from[1]);break;case"V":e.val.unshift(e.from[0]);break;case"v":e.val.unshift(e.from[0]),e.val[1]=Ya(e.val[1],e.from[1])}return e.type="L",e},ln=(e,t)=>{e.val=e.val.concat(an(t).val)},nn=(e,t)=>{const a=[],l=[t[0],t[1]];for(let n=2;n<t.length;n+=2){const r=t[n]-l[0],i=t[n+1]-l[1];r*r+i*i<e*e?(l[0]=Ya(t[n],l[0])/2,l[1]=Ya(t[n+1],l[1])/2):(a.push(l[0],l[1]),l[0]=t[n],l[1]=t[n+1])}return a.push(...l),a},rn=(e,t,a,l,{thinning:n,sizeDigit:r,angelDigit:i,straighten:s,mergePoint:o})=>{let u=$l(Vl(e));return t||(s&&(u=$l(u.map((e=>((e,t)=>{e:for(let a=t.length;a--;){const l=t[a];if("a"===l.type.toLowerCase()){let[t,a]=[l.val[5],l.val[6]];"A"===l.type&&(t=ll(t,l.from[0]),a=ll(a,l.from[1]));const n=new Dl(t,a);2*l.val[0]<e&&2*l.val[1]<e&&n.modulo<e&&(l.type="l",l.val=[t,a])}else if("c"===l.type.toLowerCase()||"s"===l.type.toLowerCase()||"q"===l.type.toLowerCase()&&(a===t.length-1||"t"!==t[a+1].type.toLowerCase())){const n=_l(l,t[a-1]);if(n.type.toLowerCase()===n.type){for(let t=0;t<n.val.length;t+=2)if(new Dl(n.val[t],n.val[t+1]).modulo>=e)continue e;l.type="l",l.val=l.val.slice(l.val.length-2)}else{for(let t=0;t<n.val.length;t+=2)if(new Dl(ll(n.val[t],n.from[0]),ll(n.val[t+1],n.from[1])).modulo>=e)continue e;l.type="L",l.val=l.val.slice(l.val.length-2)}}}return t})(s,e))))),n&&(u=$l(u.map((e=>((e,t)=>{const a=[];let l=0;for(const n of t)if(m.includes(n.type)){const e=a[l-1];"L"===e.type?ln(e,n):(a.push(an(n)),l++)}else{const t=a[l-1];l>0&&"L"===t.type&&(t.val=Yl(e,t.from.concat(t.val)).slice(2)),a.push(n),l++}if("L"===a[l-1].type){const t=a[l-1];t.val=Yl(e,t.from.concat(t.val)).slice(2)}return a})(n,e))))),o&&(u=$l(u.map((e=>((e,t)=>{const a=[];let l=0;for(const n of t)if(m.includes(n.type)){const e=a[l-1];"L"===e.type?ln(e,n):(a.push(an(n)),l++)}else{const t=a[l-1];l>0&&"L"===t.type&&(t.val=nn(e,t.from.concat(t.val))),a.push(n),l++}if("L"===a[l-1].type){const t=a[l-1];t.val=nn(e,t.from.concat(t.val))}return a})(o,e))))),u=$l(((e,t,a,l,n)=>{const r=[];e.forEach((e=>{for(let t=e.length;t--;){const l=e[t];switch(l.type){case"m":l.type="M",l.val[0]+=e[0].from[0],l.val[1]+=e[0].from[1];break;case"z":a||"m"!==e[t-1].type.toLowerCase()||e.splice(t,1);break;case"h":case"v":0===l.val[0]&&Jl(e,t,a);break;case"t":case"T":case"q":case"Q":en(l,e,t,a);break;case"s":case"S":case"c":case"C":tn(l,e,t,a)}}}));for(let a=e.length;a--;){const l=e[a];if(!t)try{if(!Wl(Ql(l.map((e=>[e.type,...e.val])))).cells.length)continue}catch{}for(let e=l.length;e--;){const t=l[e];switch(t.type.toLowerCase()){case"h":case"v":Gl(l,t,e);break;case"l":Zl(l,t,e,n);break;case"a":Hl(l,t,e,n)}}l.length>1&&r.unshift(l)}return r})(u,a,l,0,i))),u.length?Nl(u,r,i):""},sn=async(e,{params:t})=>new Promise((a=>{Ta(e);e.querySelectorAll("path,animateMotion,textPath").forEach((e=>{const a="path"===e.nodeName?"d":"path",l=e.getAttribute(a),n=Cl(e),r="none"!==ja(e,"marker-start","none")||"none"!==ja(e,"marker-mid","none")||"none"!==ja(e,"marker-end","none"),i="none"!==ja(e,"stroke","none")&&"0"!==ja(e,"stroke-width","1"),s="butt"!==ja(e,"stroke-linecap","butt");let o=!0,u=!0;if(l){const n=rn(l,r,i,s,t);n?(o=!1,e.setAttribute(a,n)):e.removeAttribute(a)}if("animateMotion"!==e.nodeName&&Ml(n,a)){const l=((e,t)=>e.filter((e=>e.attributeName===t)))(n,a);l.forEach((e=>{const a=e.values.map((e=>rn(e,r,i,s,t)));e.keys.forEach(((t,l)=>{if("values"===t){const n=a.slice(l).filter((e=>!!e)).join(";");n?e.node.setAttribute(t,n):e.node.removeAttribute(t)}else a[l]?e.node.setAttribute(t,a[l]):e.node.removeAttribute(t)}))})),"path"===e.nodeName&&Ml(Cl(e),a)&&(u=!1)}o&&u&&"path"===e.nodeName&&e.remove()})),a()})),on=async(t,{option:{keepEvent:a,keepAria:l},params:{rmAttrEqDefault:r}})=>new Promise((i=>{t.querySelectorAll(e.NodeType.Tag).forEach((e=>{const i=le[e.nodeName];e.hasAttribute("href")&&e.hasAttribute("xlink:href")&&e.removeAttribute("xlink:href");for(let s=e.attributes.length;s--;){const o=e.attributes[s],u=Ot[o.fullname],c=o.value;if(u.isUndef){let t=!0;if((a&&z.includes(o.fullname)||l&&q.includes(o.fullname))&&(t=!1),t){e.removeAttribute(o.fullname);continue}}else if(!c||!u.couldBeStyle&&!o.fullname.includes("xmlns")&&!i.ownAttributes.includes(o.fullname)||!Wt(u,o,e.nodeName)){e.removeAttribute(o.fullname);continue}if(r)if(Ta(t),!u.couldBeStyle||i.onlyAttr&&i.onlyAttr.includes(o.fullname)){if(ka(u,o.value,e.nodeName)){e.removeAttribute(o.fullname);continue}}else{const t=e.parentNode.styles;if((!u.inherited||!t||!n(t,o.fullname))&&ka(u,o.value,e.nodeName)){e.removeAttribute(o.fullname);continue}}"use"===e.nodeName&&("width"!==o.fullname&&"height"!==o.fullname||+c<0&&e.removeAttribute(o.fullname))}})),i()})),un=a.propEq("nodeType",e.NodeType.Tag),cn=(e,t,l,n,r,i)=>{const s=ja(e,t,"");if(!s)return l;if("auto"===s)return n;const o=r?a.gte:a.gt;return!(!o(parseFloat(s),0)&&!Ml(i,t,(()=>o(parseFloat(s),0))))},mn={pattern:{attrs:["width","height"],allowEmpty:!1,allowAuto:!1,allowZero:!1},mask:{attrs:["width","height"],allowEmpty:!0,allowAuto:!0,allowZero:!1},marker:{attrs:["markerWidth","markerHeight"],allowEmpty:!0,allowAuto:!0,allowZero:!1},image:{attrs:["width","height"],allowEmpty:!0,allowAuto:!0,allowZero:!1}},pn=(e,t)=>e.onlyAttr&&e.onlyAttr.includes(t),fn=(e,t,a)=>!(!M.includes(e)||!I.includes(t))&&!(a.ie||a.firefox||a.and_ff||a.chrome&&a.chrome<81||a.and_chr&&a.and_chr<81||a.edge&&a.edge<81||a.android&&a.android<81),yn=(e,t)=>{const a=t.indexOf(e);-1!==a&&t.splice(a,1)},dn=(e,t)=>D.includes(e)&&qe.test(t)&&0!=+t,gn=async(t,{params:{rmAttrEqDefault:l,ignoreKnownCSS:r},browsers:i})=>new Promise((s=>{if(t.stylesheet){const e=t.stylesheet.stylesheet;It(a.propEq("type","declaration"),((e,t)=>{const a=Ot[e.property];(!a.couldBeStyle&&(!Ut(e.property)||r)||dn(e.property,e.value)||l&&"string"==typeof a.initValue&&$a(a,e.value,a.initValue))&&yn(e,t[t.length-1])}),e.rules,!0)}Ta(t);t.querySelectorAll(e.NodeType.Tag).forEach((e=>{((e,t,l,r,i)=>{Ta(t);const s={},o=le[e.nodeName],u=e.styles;for(let c=e.attributes.length;c--;){const m=e.attributes[c],p=Ot[m.fullname];if("style"===m.fullname){const c=ta(m.value),p=new Set;for(let m=c.length;m--;){const f=c[m],y=Ot[f.fullname];if(p.has(f.fullname))c.splice(m,1);else if(y.couldBeStyle)if(Wt(y,f))if(dn(f.fullname,f.value))c.splice(m,1);else if(Ma(y,e,t)){if(l){const t=e.parentNode.styles,a=e.styles;if((!y.inherited||!t||!n(t,f.fullname))&&(!a||!a[f.fullname]||!a[f.fullname].override)&&ka(y,f.value,e.nodeName)){c.splice(m,1);continue}}p.add(f.fullname),!(u&&u[f.fullname]&&u[f.fullname].override||!y.couldBeStyle&&!fn(e.nodeName,f.fullname,i)||pn(o,f.fullname))&&a.has(f.fullname,s)&&e.removeAttribute(f.fullname),s[f.fullname]={value:f.value,fromStyle:!0}}else c.splice(m,1);else c.splice(m,1);else!Ut(f.fullname)||r?c.splice(m,1):p.add(f.fullname)}c.length?e.setAttribute("style",qa(c)):e.removeAttribute("style")}else if(p.couldBeStyle||fn(e.nodeName,m.fullname,i)){if(pn(o,m.fullname))continue;n(s,m.fullname)||!Ma(p,e,t)?e.removeAttribute(m.fullname):s[m.fullname]={value:m.value}}}})(e,t,l,r,i)})),s()})),hn=new RegExp(`(?<=^|\\(|\\s|,|{|;|:)(${Ce})px(?=$|\\)|\\s|,|;|})`,"gi"),vn=(e,t)=>{if(e.hasAttribute("path"))return!0;return e.querySelectorAll("mpath").some((e=>{const a=e.getAttribute("href")||e.getAttribute("xlink:href");if(!a)return!1;const l=t.querySelector(a);return!!l&&V.includes(l.nodeName)}))},bn="abcdefghijklmnopqrstuvwxyz",xn=`${bn}${bn.toUpperCase()}_`,wn=`${xn}0123456789-`,$n=xn.length,kn=wn.length,An=xn.split("");let Vn=$n,Tn=0;const En=e=>{for(;e>=Vn;)An.push(...wn.split("").map((e=>An[Tn]+e))),Vn+=kn,Tn++;return An[e]},Nn=/\.([^,*#>+~:{\s[.]+)/gi,Sn=a.curry(((e,t)=>t.length>=e?t:Sn(e,`0${t}`))),Cn=a.pipe((e=>parseInt(`${e}`,10).toString(16)),a.toLower,Sn(2)),Mn={100:255,99:252,98:250,97:247,96:245,95:242,94:240,93:237,92:235,91:232,90:230,89:227,88:224,87:222,86:219,85:217,84:214,83:212,82:209,81:207,80:204,79:201,78:199,77:196,76:194,75:191,74:189,73:186,72:184,71:181,70:179,69:176,68:173,67:171,66:168,65:166,64:163,63:161,62:158,61:156,60:153,59:150,58:148,57:145,56:143,55:140,54:138,53:135,52:133,51:130,50:128,49:125,48:122,47:120,46:117,45:115,44:112,43:110,42:107,41:105,40:102,39:99,38:97,37:94,36:92,35:89,34:87,33:84,32:82,31:79,30:77,29:74,28:71,27:69,26:66,25:64,24:61,23:59,22:56,21:54,20:51,19:48,18:46,17:43,16:41,15:38,14:36,13:33,12:31,11:28,10:26,9:23,8:20,7:18,6:15,5:13,4:10,3:8,2:5,1:3,0:0},zn={"#f0ffff":"azure","#f5f5dc":"beige","#ffe4c4":"bisque","#a52a2a":"brown","#ff7f50":"coral","#ffd700":"gold","#808080":"gray","#008000":"green","#4b0082":"indigo","#fffff0":"ivory","#f0e68c":"khaki","#faf0e6":"linen","#800000":"maroon","#000080":"navy","#808000":"olive","#ffa500":"orange","#da70d6":"orchid","#cd853f":"peru","#ffc0cb":"pink","#dda0dd":"plum","#800080":"purple","#f00":"red","#fa8072":"salmon","#a0522d":"sienna","#c0c0c0":"silver","#fffafa":"snow","#d2b48c":"tan","#008080":"teal","#ff6347":"tomato","#ee82ee":"violet","#f5deb3":"wheat"},qn=new RegExp(`(?:${Object.keys(zn).join("|")})(?=[^0-9a-f]|$)`,"gi"),Pn=(e,t,l)=>{const n=va(t,l);let r=n.origin;if(n.valid){if(n.a<1)if(e)r=`#${Cn(n.r)}${Cn(n.g)}${Cn(n.b)}${a.has(""+n.a*s,Mn)?Cn(Mn[""+n.a*s]):Cn(Math.round(n.a*i))}`;else if(0===n.r&&0===n.g&&0===n.b&&0===n.a)r="transparent";else{const e=(e=>{const t=e.r/i,a=e.g/i,l=e.b/i,n=Math.max(t,a,l),r=Math.min(t,a,l),o=n-r,c=(n+r)/2,m=0===o?0:c<.5?o/(2*c):o/(2-2*c);return{h:ca(u,((0===o?0:n===t?(a-l)/o:n===a?(l-t)/o+2:(t-a)/o+4)+u)%6*60),s:ca(s,m*s),l:ca(s,c*s)}})(n),t=ua(l,n.a),a=`rgb(${n.r},${n.g},${n.b},${t})`,o=`hsl(${e.h},${e.s}%,${e.l}%,${t})`;r=la(a,o)}else r=`#${Cn(n.r)}${Cn(n.g)}${Cn(n.b)}`;r=r.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3(?=[^0-9a-f]|$)/gi,"#$1$2$3"),r=r.replace(qn,(e=>`${zn[e]}`)),e&&(r=r.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f])\4(?=[^0-9a-f]|$)/gi,"#$1$2$3$4"),r=r.replace(/^transparent$/i,"#0000"))}return r.length>n.origin.length?n.origin:r},Bn=a.curry(((e,t)=>el(t.replace(Pe,(t=>`${Ja(oa(e,parseFloat(t)))}`))))),Ln=(e,t,a=!1)=>{let l=!1;if(!a){const a=e.getAttribute("id");a&&t[a]&&(l=!0,t[a].tag=e)}if(!l){for(let a=e.childNodes.length;a--;){const l=e.childNodes[a];un(l)?Ln(l,t):l.remove()}e.childNodes.length?a||e.parentNode.replaceChild(e.childNodes,e):e.remove()}},Fn=["tableValues","slope","intercept","amplitude","exponent","offset"],jn={identity:[],table:["tableValues"],discrete:["tableValues"],linear:["slope","intercept"],gamma:["amplitude","exponent","offset"]},On=(e,t)=>{n(jn,e)&&jn[e].forEach((e=>{const a=t.indexOf(e);-1!==a&&t.splice(a,1)}))},Rn=/#([^,*#>+~:{\s[.]+)/gi,In=a.pipe(aa,za),Dn=new RegExp(`^(${Ce})`),Un=a.complement(a.equals("none")),Yn=(e,t,l,n)=>{let r="";if(l.hasAttribute("points")){let i=wa(l.getAttribute("points"));const s=Cl(l),o="none"!==ja(l,"marker-start","none")||"none"!==ja(l,"marker-mid","none")||"none"!==ja(l,"marker-end","none")||Ml(s,"marker-start",Un)||Ml(s,"marker-mid",Un)||Ml(s,"marker-end",Un),u=("none"!==ja(l,"stroke","none")||Ml(s,"stroke",Un))&&("0"!==ja(l,"stroke-width","1")||Ml(s,"stroke-width",a.complement(a.equals("0")))),c="butt"!==ja(l,"stroke-linecap","butt")||Ml(s,"stroke-linecap",a.complement(a.equals("butt")));if(i.length%2==1&&i.pop(),e&&(i=Yl(e,i)),t&&(i=nn(t,i)),Sl(l))return void l.setAttribute("points",el(`${i.map(Ja).join(",")}`));(i.length>2||o||u&&c&&n)&&(r=el(`M${i.map(Ja).join(",")}`),n&&(r+="z"))}r?(l.nodeName="path",l.removeAttribute("points"),l.setAttribute("d",r)):l.nodeName="remove"},Gn=e=>{let t=ja(e,"rx","auto"),a=ja(e,"ry","auto");"auto"===t&&(t=a),"auto"===a&&(a=t);const l=Dn.exec(t),n=Dn.exec(a);!l||!n||+l[1]<=0||+n[1]<=0?e.nodeName="remove":t!==a||Sl(e)||((e,t)=>{e.nodeName="circle",e.setAttribute("r",t.replace(Pe,(e=>Ja(+e)))),zl(e,["rx","ry"])})(e,t)},Zn=(e,t,a)=>{let l=t;return D.includes(e)&&qe.test(l)&&0!=+l&&(l+="px"),`${e}:${l}${a?"!important":""}`},Xn=[[!0,async l=>new Promise((n=>{let r;l.querySelectorAll("style").forEach((e=>{const t=e.getAttribute("type");t&&"text/css"!==t?e.remove():r?(r.appendChild(e.childNodes),e.remove()):r=e}));const i=[];if(r){re(r);const n=r.childNodes;if(1===n.length&&n[0].textContent){n[0].textContent.includes("<")||(n[0].nodeType=e.NodeType.Text);try{const e=t.parse(n[0].textContent);if(e.stylesheet){l.stylesheet=e,l.styletag=r;const t=l.querySelector("svg");t.insertBefore(r,t.childNodes[0]),It(a.has("type"),((e,t)=>{switch(e.type){case"rule":case"keyframe":case"font-face":case"page":{const a=e;if(!a.declarations)return void Kt(a,t[t.length-1]);const l=new Set;for(let e=a.declarations.length;e--;){const t=a.declarations[e];t.property&&t.value&&!l.has(t.property)?l.add(t.property):a.declarations.splice(e,1)}a.declarations.length?i.push([a,t[t.length-1]]):Kt(a,t[t.length-1]);break}case"keyframes":{const a=e;a.keyframes&&a.keyframes.length||Kt(e,t[t.length-1]);break}case"media":case"host":case"supports":case"document":{const a=e;a.rules&&a.rules.length||Kt(e,t[t.length-1]);break}case"comment":Kt(e,t[t.length-1])}}),e.stylesheet.rules,!0)}else r.remove()}catch{r.remove()}}else r.remove()}if(i.length)for(const[e,t]of i)e.declarations.forEach((e=>{const t=Ot[e.property];Wt(t,{fullname:e.property,value:e.value,name:""})||Ut(e.property)||(e.value="")})),e.declarations=e.declarations.filter((e=>!!e.value)),e.declarations.length||Kt(e,t);n()}))],[!0,async t=>new Promise((a=>{let l;if(t.querySelectorAll("script").forEach((e=>{const t=e.getAttribute("type");!t||/^(?:application|text)\/(?:javascript|ecmascript)$/.test(t)?l?(l.appendChild(e.childNodes),e.remove()):l=e:e.remove()})),l){re(l,!0);const a=l.childNodes;if(1===a.length&&a[0].textContent){const n=a[0].textContent;n.includes("<")||(a[0].nodeType=e.NodeType.Text),";"===n.slice(-1)&&(a[0].textContent=a[0].textContent.slice(0,-1)),t.querySelector("svg").appendChild(l)}else l.remove()}a()}))],[!0,async t=>new Promise((a=>{t.querySelectorAll((t=>t.nodeType===e.NodeType.Text||t.nodeType===e.NodeType.CDATA)).forEach((e=>{const t=e.parentNode&&e.parentNode.nodeName;t&&!le[t].containTextNode?e.remove():e.textContent=ne(e.textContent)})),a()}))],[!1,async t=>new Promise((a=>{t.querySelectorAll(e.NodeType.XMLDecl).forEach((e=>{e.remove()})),a()})),"rm-xml-decl"],[!1,async e=>new Promise((t=>{e.querySelectorAll("svg").forEach((e=>{e.removeAttribute("version")})),t()})),"rm-version"],[!1,async t=>new Promise((a=>{t.querySelectorAll(e.NodeType.DocType).forEach((e=>{e.remove()})),a()})),"rm-doctype"],[!1,async t=>new Promise((a=>{t.querySelectorAll(e.NodeType.Comments).forEach((e=>{e.remove()})),a()})),"rm-comments"],[!1,async(e,{option:{ignore:t}})=>new Promise((l=>{e.querySelectorAll(a.both(un,(e=>a.not(a.any(a.equals(a.prop("nodeName",e)),t))))).forEach((e=>{le[e.nodeName].isUndef&&e.remove()})),l()})),"rm-irregular-tag"],[!1,async(e,{option:{ignore:t}})=>new Promise((l=>{const n=e.querySelectorAll(a.both(un,(e=>a.not(a.any(a.equals(a.prop("nodeName",e)),t)))));for(let e=n.length;e--;){const t=n[e],a=t.parentNode;if(!a)continue;let l=le[a.nodeName];if(!l.isUndef)if(l.legalChildElements.noself&&t.nodeName===a.nodeName)t.remove();else{if(l.legalChildElements.transparent){const e=a.parentNode.closest((e=>"switch"!==e.nodeName));if(!e||!un(e))continue;if(l=le[e.nodeName],l.isUndef)continue}l.legalChildElements.any||l.legalChildElements.childElements&&!l.legalChildElements.childElements.includes(t.nodeName)&&t.remove()}}l()})),"rm-irregular-nesting"],[!1,async(e,{option:t})=>new Promise((a=>{const{tags:l}=t;l.length&&e.querySelectorAll((e=>l.includes(e.nodeName)&&C.includes(e.nodeName))).forEach((e=>{e.remove()})),a()})),"rm-unnecessary"],[!1,async e=>new Promise((t=>{e.querySelectorAll("[viewBox]").forEach((e=>{const t=["0","0","0","0"],l=wa(e.getAttribute("viewBox"));4!==l.length||l[2]<0||l[3]<0?e.removeAttribute("viewBox"):(e.attributes.forEach((a=>{if("marker"===e.nodeName)"markerWidth"===a.fullname?t[2]=a.value.replace(/px$/,""):"markerHeight"===a.fullname&&(t[3]=a.value.replace(/px$/,""));else switch(a.fullname){case"x":t[0]=a.value.replace(/px$/,"");break;case"y":t[1]=a.value.replace(/px$/,"");break;case"width":t[2]=a.value.replace(/px$/,"");break;case"height":t[3]=a.value.replace(/px$/,"")}})),a.equals(t,l.map((e=>`${e}`)))&&e.removeAttribute("viewBox"))})),t()})),"rm-viewbox"],[!1,async(e,{option:{remove:t}})=>new Promise((a=>{e.querySelectorAll(v.join(",")).forEach((a=>{if(t)return void a.remove();const l=a.hasAttribute("href")?a.getAttribute("href"):a.getAttribute("xlink:href");if(l){const t=e.querySelector(l);t&&t.appendChild(a)}if(a.removeAttribute("href"),a.removeAttribute("xlink:href"),b.includes(a.nodeName)){const e=a.getAttribute("attributeName")||"",t=Ot[e];if(!e||!t.animatable)return void a.remove();const l=a.parentNode.nodeName;if(!t.applyTo.includes(l)&&!le[l].ownAttributes.includes(e))return void a.remove();if("animateTransform"===a.nodeName&&"transform"!==e&&"patternTransform"!==e)return void a.remove();for(const e of a.attributes)if(P.includes(e.fullname)){if("values"!==e.fullname&&!Wt(t,e)){a.removeAttribute(e.fullname);continue}e.value.split(";").every((e=>!Wt(t,{name:"values",fullname:"values",namespace:"",value:e.trim()})))&&a.removeAttribute(e.fullname)}if("set"===a.nodeName&&!a.hasAttribute("to"))return void a.remove();if(!P.some((e=>a.hasAttribute(e))))return void a.remove()}"animateMotion"!==a.nodeName||vn(a,e)||a.remove()})),a()})),"shorten-animate"],[!1,async e=>new Promise((t=>{e.querySelectorAll(["filter"].concat(w,$).join(",")).forEach((e=>{if(w.includes(e.nodeName)||"filter"===e.nodeName){const t=e.getAttribute("width"),a=e.getAttribute("height");if(t&&parseFloat(t)<=0||a&&parseFloat(a)<=0)return void e.remove()}if("filter"===e.nodeName){let t=!1;if(e.childNodes.forEach((e=>{w.includes(e.nodeName)&&(t=!0)})),!t)return void e.remove()}if("feComponentTransfer"===e.nodeName){const t=new Set;for(let a=e.childNodes.length;a--;){const l=e.childNodes[a];t.has(l.nodeName)?l.remove():$.includes(l.nodeName)&&t.add(l.nodeName)}}if($.includes(e.nodeName)){const t=e.getAttribute("type")||"",a=Cl(e).filter((e=>"type"===e.attributeName));if(!t&&!a.length)return void e.remove();const l=Fn.slice();On(t,l),a.forEach((e=>{e.values.forEach((e=>{On(e,l)}))})),l.forEach((t=>{e.removeAttribute(t)}))}})),t()})),"shorten-filter"],[!1,Ea,"apply-style"],[!1,async t=>new Promise((a=>{t.querySelectorAll("tspan").forEach((t=>{t.attributes.every((({value:e})=>!e))?t.parentNode.replaceChild(t.childNodes,t):1===t.querySelectorAll(">tspan").length&&0===t.childNodes.filter((t=>(t.nodeType===e.NodeType.Text||t.nodeType===e.NodeType.CDATA)&&t.textContent)).length&&((e,t)=>{var a;const l=ta(null!==(a=e.getAttribute("style"))&&void 0!==a?a:"");for(let a=t.attributes.length;a--;){const n=t.attributes[a];if("style"===n.fullname){const t=ta(n.value);for(let a=t.length;a--;){const n=t[a];!Ot[n.fullname].isUndef&&e.hasAttribute(n.fullname)||l.some((({fullname:e})=>e===n.fullname))||l.unshift({...n})}e.setAttribute("style",qa(l))}else{const t=Ot[n.fullname];e.hasAttribute(n.fullname)||t.isUndef||e.setAttribute(n.fullname,n.value)}}const n=t.childNodes.indexOf(e);e.appendChild(t.childNodes.slice(n+1)),e.insertBefore(t.childNodes.slice(0,n),e.childNodes[0]),t.parentNode.replaceChild(e,t)})(t.querySelector(">tspan"),t)})),a()})),"collapse-textwrap"],[!1,gn,"rm-illegal-style"],[!1,async t=>new Promise((l=>{if(t.querySelectorAll(e.NodeType.Tag).forEach((e=>{e.attributes.forEach((e=>{if("style"===e.fullname){const t=ta(e.value);t.forEach((e=>{(Ot[e.fullname].maybeSizeNumber||Ot[e.fullname].maybeAccurateNumber)&&(hn.lastIndex=0,D.includes(e.fullname)||(e.value=e.value.replace(hn,"$1")),e.value=e.value.replace(/(?<=^|\D)0[a-z]+?(?=$|\)|\s|,|;|})/gi,"0"))})),e.value=aa(t)}else(Ot[e.fullname].maybeSizeNumber||Ot[e.fullname].maybeAccurateNumber)&&(hn.lastIndex=0,e.value=e.value.replace(hn,"$1").replace(/(?<=^|\D)0[a-z]+?(?=$|\)|\s|,|;|})/gi,"0"))}))})),t.stylesheet){const e=t.stylesheet.stylesheet;It(a.both(a.has("property"),a.has("value")),(e=>{D.includes(e.property)||(e.value=e.value.replace(hn,"$1")),e.value=e.value.replace(/(?<=^|\D)0[a-z]+?(?=$|\)|\s|,|;|})/gi,"0")}),e.rules)}l()})),"rm-px"],[!1,on,"rm-attribute"],[!1,async t=>new Promise((a=>{let l;if(t.querySelectorAll("defs").forEach((e=>{if(l)l.appendChild(e.childNodes.filter(un)),e.remove();else{l=e;for(let t=e.childNodes.length;t--;){const a=e.childNodes[t];un(a)||a.remove()}}})),l){const a={};t.querySelectorAll(un).forEach((e=>{e.attributes.forEach((t=>{if(Ot[t.fullname].maybeFuncIRI){const l=yt.exec(t.value);l&&(a[l[2]]||(a[l[2]]={iri:[]}),a[l[2]].iri.push([e,t.fullname]))}else if(Ot[t.fullname].maybeIRI){const l=ht.exec(t.value);l&&(a[l[1]]||(a[l[1]]={iri:[]}),a[l[1]].iri.push([e,t.fullname]))}}))})),Ln(l,a,!0),Ta(t),Object.values(a).forEach((a=>{if(a.tag){for(let t=a.iri.length;t--;){const[l]=a.iri[t];l.closest(e.NodeType.Document)||a.iri.splice(t,1)}a.iri.length||a.tag.remove(),1===a.iri.length&&((e,t)=>{const[a,l]=e.iri[0];if("href"===l||"xlink:href"===l)switch(a.nodeName){case"use":{if(a.hasAttribute("x")||a.hasAttribute("y"))return;if(["svg","symbol"].includes(e.tag.nodeName)&&(a.hasAttribute("width")||a.hasAttribute("height")))return;const t={},l={};for(const[e,n]of Object.entries(a.styles)){if("styletag"===n.from)return;"attr"===n.from&&(l[e]=n.value),"inline"===n.from&&(t[e]=n.value)}const n=e.tag;a.parentNode.replaceChild(n,a);const r=n.hasAttribute("style")?ta(n.getAttribute("style")):[];for(const[e,t]of Object.entries(l))n.hasAttribute(e)||r.some((t=>t.fullname===e))||n.setAttribute(e,t);for(const[e,a]of Object.entries(t))n.hasAttribute(e)||r.some((t=>t.fullname===e))||r.push({name:e,fullname:e,value:a});return void(r.length&&n.setAttribute("style",aa(r)))}case"mpath":{const l=e.tag,n=a.parentNode;if(!V.includes(l.nodeName))return a.remove(),l.remove(),void(vn(n,t)||n.remove());if("path"===l.nodeName){const e=l.getAttribute("d");e&&(n.setAttribute("path",e),a.remove(),l.remove())}}}})(a,t)}})),l.childNodes.length||l.remove()}a()})),"shorten-defs"],[!1,async t=>new Promise((l=>{let r=0;const i={},s=(e,t,a)=>{if(n(i,a))return i[a][1].push([e,t]),i[a][0];const l=En(r++);return i[a]=[l,[[e,t]]],l};let o;t.stylesheet&&(o=t.stylesheet.stylesheet,It(a.has("selectors"),(e=>{const a=e.selectors;a&&a.forEach(((e,l)=>{a[l]=e.replace(Rn,((e,a)=>`#${s(t.styletag,null,a)}`))}))}),o.rules));const u=t.querySelectorAll(e.NodeType.Tag);u.forEach((e=>{e.attributes.forEach((t=>{if(Ot[t.fullname].maybeFuncIRI){const a=yt.exec(t.value);a&&(t.value=`url(#${s(e,t.fullname,a[2])})`)}else if(Ot[t.fullname].maybeIRI){const a=ht.exec(t.value);a&&(t.value=`#${s(e,t.fullname,a[1])}`)}else if("style"===t.fullname){const a=ta(t.value);a.forEach((t=>{if(Ot[t.fullname].maybeFuncIRI){const a=yt.exec(t.value);a&&(t.value=`url(#${s(e,`style|${t.fullname}`,a[2])})`)}})),t.value=In(a)}}))})),u.forEach((e=>{const t=e.getAttribute("id");if(null!==t)if(n(i,t)){const a=i[t][0];delete i[t],e.setAttribute("id",a)}else e.removeAttribute("id")}),t),Object.values(i).forEach((e=>{for(const[t,l]of e[1])if("string"==typeof l)if(l.startsWith("style|")){const e=ta(t.getAttribute("style")).filter((e=>e.fullname!==l.slice(6)));e.length?t.setAttribute("style",In(e)):t.removeAttribute("style")}else t.removeAttribute(l);else{const t=new RegExp(`#${e[0]}(?=[,\\*#>+~:{\\s\\[\\.]|$)`);It(a.has("selectors"),((e,a)=>{const l=e.selectors;if(l){for(let e=l.length;e--;)t.test(l[e])&&l.splice(e,1);if(!l.length){const t=a[a.length-1];t.splice(t.indexOf(e),1)}}}),o.rules)}})),l()})),"shorten-id"],[!1,async(e,{params:{thinning:t,mergePoint:l}})=>new Promise((n=>{Ta(e);e.querySelectorAll(V.join(",")).forEach((e=>{const n=e.cloneNode();switch(n.styles=e.styles,e.nodeName){case"rect":(e=>{let t=ja(e,"width","0"),a=ja(e,"height","0");const l=Dn.exec(t),n=Dn.exec(a);if(!l||!n||+l[1]<=0||+n[1]<=0)return void(e.nodeName="remove");const r=ja(e,"rx","auto"),i=ja(e,"ry","auto");r!==i&&"auto"!==i||zl(e,["ry"]),"auto"===r&&zl(e,["rx"]);const s=Dn.exec(r),o=Dn.exec(i);if(s&&+s[1]>0&&(!o||0!=+o[1]))return;if(o&&+o[1]>0&&(!s||0!=+s[1]))return;let u=ja(e,"x","0"),c=ja(e,"y","0");if(!(Oe.test(t)&&Oe.test(a)&&Oe.test(u)&&Oe.test(c)))return;if(Sl(e))return;zl(e,["x","y","width","height","rx","ry"]),t=Ja(+l[1]),a=Ja(+n[1]),u=Ja(+u.replace("px","")),c=Ja(+c.replace("px","")),e.nodeName="path";const m=el(`M${u},${c}h${t}v${a}h-${t}z`),p=el(`M${u},${c}v${a}h${t}v-${a}z`);e.setAttribute("d",la(m,p))})(n);break;case"line":(e=>{const t=ja(e,"stroke-width","1"),l=Dn.exec(t),n=Cl(e),r="none"!==ja(e,"marker-start","none")||"none"!==ja(e,"marker-mid","none")||"none"!==ja(e,"marker-end","none")||Ml(n,"marker-start",Un)||Ml(n,"marker-mid",Un)||Ml(n,"marker-end",Un),i=("none"!==ja(e,"stroke","none")||Ml(n,"stroke",Un))&&("0"!==t||Ml(n,"stroke-width",a.complement(a.equals("0"))));if(!r&&(!i||!l||+l[1]<=0))return void(e.nodeName="remove");const s={x1:"0",y1:"0",x2:"0",y2:"0"};Object.keys(s).forEach((t=>{const a=e.getAttribute(t);a&&Dn.test(a)&&(s[t]=a)}));const o="butt"!==ja(e,"stroke-linecap","butt")||Ml(n,"stroke-linecap",a.complement(a.equals("butt")));s.x1!==s.x2||s.y1!==s.y2||r||i&&o?Sl(e)||Oe.test(s.x1)&&Oe.test(s.y1)&&Oe.test(s.x2)&&Oe.test(s.y2)&&(e.nodeName="path",zl(e,["x1","y1","x2","y2"]),e.setAttribute("d",el(`M${+s.x1},${+s.y1},${+s.x2},${+s.y2}`))):e.nodeName="remove"})(n);break;case"polyline":Yn(t,l,n,!1);break;case"polygon":Yn(t,l,n,!0);break;case"ellipse":Gn(n);break;case"circle":(e=>{const t=ja(e,"r",""),a=Dn.exec(t);(!a||+a[1]<=0)&&(e.nodeName="remove")})(n);break;default:n.nodeName=e.getAttribute("d")?"notneed":"remove"}"remove"===n.nodeName?e.remove():n.toString().length<=e.toString().length&&Object.assign(e,n)}),e),n()})),"shorten-shape"],[!1,async(e,{option:{disregardFill:t,disregardOpacity:a}})=>new Promise((l=>{Ta(e);const n=e.querySelectorAll("path");for(let e=n.length-1;e>0;e--){const l=n[e],r=n[e-1],i=l.parentNode;if(r.parentNode===i){const e=i.children,n=e.indexOf(l);if(e.indexOf(r)!==n-1)break;if(Oa(l,r,t,a)){const e=r.getAttribute("d")||"",t=l.getAttribute("d")||"";r.setAttribute("d",`${e}${t.replace(/^m/,"M")}`),l.remove()}}}l()})),"combine-path"],[!1,sn,"compute-path"],[!1,async t=>new Promise((l=>{Ta(t);t.querySelectorAll(e.NodeType.Tag).forEach((l=>{if(!l.childNodes.length&&le[l.nodeName].containTextNode)return void l.remove();if("textPath"===l.nodeName&&!l.hasAttribute("path")){const e=l.getAttribute("href")||l.getAttribute("xlink:href");if(!e)return void l.remove();const a=t.querySelector(e);if(!a)return void l.remove();if(!V.includes(a.nodeName))return void l.remove()}const r=l.styles,i=Cl(l),s=a.complement(a.equals("none"));if(!n(r,"display")||"none"!==r.display.value||["script","style","mpath"].concat(w,v).includes(l.nodeName)||Ml(i,"display",s)){if(V.includes(l.nodeName)){const e=n(r,"fill")&&"none"===r.fill.value&&!Ml(i,"fill",s),t=!(n(r,"stroke")&&"none"!==r.stroke.value||Ml(i,"stroke",s));if(e&&t&&!l.closest((e=>un(e)&&e.hasAttribute("id"))))return void l.remove()}if(n(mn,l.nodeName)){const e=mn[l.nodeName];for(let t=e.attrs.length;t--;)if(!cn(l,e.attrs[t],e.allowEmpty,e.allowAuto,e.allowZero,i))return void l.remove()}"use"===l.nodeName&&((t,a)=>{if(t.hasAttribute("href")||t.hasAttribute("xlink:href")){const l=t.getAttribute("href")||t.getAttribute("xlink:href");if(ht.test(l)){const n=l.slice(1);if(t.closest((t=>t.nodeType===e.NodeType.Tag&&t.getAttribute("id")===n)))return void t.remove();a.querySelector((t=>t.nodeType===e.NodeType.Tag&&t.getAttribute("id")===n))||t.remove()}else t.remove()}else t.remove()})(l,t)}else l.remove()})),l()})),"rm-hidden"],[!1,async e=>new Promise((t=>{const a=e.querySelectorAll("g");for(let t=a.length;t--;){const l=a[t],n=l.children;if(n.length){if(Ba(e,l),!La(l))if(1===n.length){const e=n[0];Pa(e,l),l.parentNode.replaceChild(e,l)}else l.attributes.length||l.parentNode.replaceChild(n,l)}else l.remove()}t()})),"collapse-g"],[!1,async(t,{params:{ignoreKnownCSS:a}})=>new Promise((l=>{if(t.stylesheet){const l=t.stylesheet.stylesheet,r={},i={};for(let s=0,o=l.rules.length;s<o;s++){const u=l.rules[s];if("rule"===u.type){const c=u.selectors,m=u.declarations,p=new Set;for(let l=c.length;l--;){const n=t.querySelectorAll(e.parseSelector(c[l]));if(n.length){let e=!1;for(let l=m.length;l--;){const r=m[l],i=r.property,s=Yt.test(r.value);(Ot[i].isUndef&&Ut(i)&&!a||n.some((e=>Ma(Ot[i],e,t,!0,s))))&&(e=!0,p.add(i))}e||c.splice(l,1)}else c.splice(l,1)}for(let e=m.length;e--;)p.has(m[e].property)||m.splice(e,1);if(!c.length){l.rules.splice(s,1),s--,o--;continue}c.sort(((e,t)=>e<t?-1:1)),u.selectors=c.map((e=>ne(e.trim())));const f=u.selectors.join(",");if(n(r,f)){const e=r[f].declarations.concat(u.declarations),t=new Set;for(let a=e.length;a--;){const l=e[a].property;t.has(l)?e.splice(a,1):t.add(l)}r[f].declarations=e,l.rules.splice(s,1),s--,o--;continue}r[f]=u,u.declarations.sort(((e,t)=>e.property<t.property?-1:1));const y=u.declarations.map((e=>`${e.property}:${e.value}`)).join(";");if(n(i,y)){const e=i[y].selectors.concat(u.selectors),t=new Set;for(let a=e.length;a--;)t.has(e[a])?e.splice(a,1):t.add(e[a]);i[y].selectors=e,l.rules.splice(s,1),s--,o--;continue}i[y]=u}}}l()})),"shorten-style-tag"],[!1,Ea,"apply-style"],[!1,async t=>new Promise((a=>{Ta(t),t.stylesheet&&t.stylesheet.stylesheet.rules.forEach((a=>{if("rule"===a.type&&a.declarations&&a.selectors){const l=new Map;if(a.declarations.forEach((e=>{e.property&&e.value&&Yt.test(e.value)&&l.set(e.property,e)})),l.size){for(let n=a.selectors.length;n--;){const r=e.parseSelector(a.selectors[n])[0],i=Aa(r),s=t.querySelectorAll(r);s.length&&s.forEach((e=>{const t=e.styles;for(const[e,a]of l)"styletag"===t[e].from&&$a(Ot[e],t[e].value,a.value.replace(Yt,""))&&t[e].overrideList.some((t=>"inline"===t.from||(t.important||Va(t.selectorPriority,i))&&!$a(Ot[e],t.value,a.value)))&&l.delete(e)}))}for(const e of l.values())e.value=e.value.replace(Yt,"")}}})),Ta(t);t.querySelectorAll(e.NodeType.Tag).forEach((e=>{if(e.hasAttribute("style")){const t=e.styles,a=ta(e.getAttribute("style"));a.forEach((e=>{e.important&&t[e.fullname].overrideList.every((t=>!t.important||$a(Ot[e.fullname],t.value,e.value)))&&(e.important=!1)})),e.setAttribute("style",qa(a))}})),a()})),"rm-important"],[!1,async(t,{params:{trifuncDigit:a,sizeDigit:l,angelDigit:n}})=>new Promise((r=>{Ta(t);t.querySelectorAll(e.NodeType.Tag).forEach((e=>{for(let t=e.attributes.length;t--;){const r=e.attributes[t];if(B.includes(r.name)){const t=[];if(Ka(r.value.trim()).forEach((e=>{const r=t[t.length-1];if(t.length&&r.type===e.type){const i=Ha(r,e,a,l,n);i.noEffect?t.pop():t[t.length-1]=i}else t.push(e)})),t.length){const i=Xa(t,a,l,n),s=al(t,a,l,n),o=al([i],a,l,n),u=la(s,o);if(i.noEffect)return void e.removeAttribute(r.fullname);if("transform"===r.fullname&&Rl(e,i,` ${r.fullname}="${u}"`))return;r.value=u}else e.removeAttribute(r.fullname)}}})),r()})),"combine-transform"],[!1,async(t,{params:{sizeDigit:l,angelDigit:n,opacityDigit:r}})=>new Promise((i=>{const s=Bn(l),o=Bn(n),u=(e,t)=>{const a=Ot[e];if(a.maybeAlpha){const e=xa(t);if("number"==typeof e)return ua(r,e)}else{if(a.maybeSizeNumber)return s(t);if(a.maybeAccurateNumber)return o(t)}return t};if(t.stylesheet){const e=t.stylesheet.stylesheet;It(a.both(a.has("property"),a.has("value")),(e=>{e.value=u(e.property,e.value)}),e.rules)}t.querySelectorAll(e.NodeType.Tag).forEach((e=>{const t=e.getAttribute("attributeName");e.attributes.forEach((a=>{if(Pe.lastIndex=0,P.includes(a.fullname)&&b.includes(e.nodeName))t&&(a.value=u(t,a.value));else if("style"===a.fullname){const e=ta(a.value);e.forEach((e=>{Pe.lastIndex=0,e.value=u(e.fullname,e.value)})),a.value=aa(e)}else a.value=u(a.fullname,a.value)}))})),i()})),"shorten-decimal-digits"],[!1,async(t,{option:{rrggbbaa:l},params:{opacityDigit:n}})=>new Promise((r=>{const i=Math.min(n,3);if(t.querySelectorAll(e.NodeType.Tag).forEach((e=>{e.attributes.forEach((e=>{if(Ot[e.fullname].maybeColor)e.value=Pn(l,e.value,i);else if("style"===e.fullname){const t=ta(e.value);t.forEach((e=>{Ot[e.fullname].maybeColor&&(e.value=Pn(l,e.value,i))})),e.value=aa(t)}}))})),t.stylesheet){const e=t.stylesheet.stylesheet;It(a.both(a.has("property"),a.has("value")),(e=>{Ot[e.property].maybeColor&&(e.value=Pn(l,e.value,i))}),e.rules)}r()})),"shorten-color"],[!1,async a=>new Promise((l=>{Ta(a);let n=0;const r=a.querySelectorAll(e.NodeType.Tag),i={};for(const e of r){const t=[],a=e.styles;if(Object.keys(a).sort().forEach((e=>{"inline"!==a[e].from||a[e].override||t.push(Zn(e,a[e].value,a[e].important))})),t.length>=3){const a=t.join(";");i[a]?i[a].tags.push(e):(i[a]={className:`c${(+new Date+n).toString(36)}`,tags:[e],keys:t},n++)}}const s=Object.entries(i).filter((([,e])=>e.tags.length*e.keys.length>=10));if(s.length){let l="";if(a.stylesheet)l=t.stringify(a.stylesheet);else{const t=new e.TagNode({nodeName:"style",nodeType:e.NodeType.Tag}),l=new e.TextNode({nodeName:"#text",nodeType:e.NodeType.CDATA,textContent:""});t.appendChild(l);const n=a.querySelector("svg");n.insertBefore(t,n.childNodes[0]),a.styletag=t}for(const[e,t]of s)l+=`.${t.className}{${e}}`,t.tags.forEach((e=>{const a=e.getAttribute("style"),l=ta(a);for(let e=l.length;e--;)t.keys.includes(Zn(l[e].fullname,l[e].value,l[e].important))&&l.splice(e,1);l.length?e.setAttribute("style",aa(l)):e.removeAttribute("style"),e.hasAttribute("class")?e.setAttribute("class",`${e.getAttribute("class")} ${t.className}`):e.setAttribute("class",t.className)}));try{a.stylesheet=t.parse(l)}catch{console.log(`${l} convert failed!`)}}l()})),"style-to-class"],[!1,async t=>new Promise((l=>{const r=t.stylesheet;if(r){let l=0;const i={},s=e=>{if(n(i,e))return i[e][0];const t=En(l++);return i[e]=[t,!1],t},o=r.stylesheet;It(a.has("selectors"),(e=>{const t=e.selectors;t&&t.forEach(((e,a)=>{t[a]=e.replace(Nn,((e,t)=>`.${s(t)}`))}))}),o.rules),t.querySelectorAll(e.NodeType.Tag).forEach((e=>{const t=e.getAttribute("class");if(null!==t){const a=ne(t.trim()).split(/\s+/);for(let e=a.length;e--;)if(n(i,a[e])){const t=i[a[e]][0];i[a[e]][1]=!0,a[e]=t}else a.splice(e,1);a.length?e.setAttribute("class",a.join(" ")):e.removeAttribute("class")}})),Object.values(i).forEach((e=>{if(e[1])return;const t=new RegExp(`\\.${e[0]}(?=[,\\*#>+~:{\\s\\[\\.]|$)`);It(a.has("selectors"),((e,a)=>{const l=e.selectors;if(l){for(let e=l.length;e--;)t.test(l[e])&&l.splice(e,1);if(!l.length){const t=a[a.length-1];t.splice(t.indexOf(e),1)}}}),o.rules)}))}else t.querySelectorAll(e.NodeType.Tag).forEach((e=>{e.removeAttribute("class")}));l()})),"shorten-class"],[!0,async t=>new Promise((a=>{const l=t.querySelectorAll((t=>t.nodeType===e.NodeType.Text||t.nodeType===e.NodeType.CDATA));for(let e=l.length;e--;){const t=l[e],a=t.parentNode,n=a.childNodes.indexOf(t);if(n>0){const e=a.childNodes[n-1];e.nodeType===t.nodeType&&(e.textContent=ne(`${e.textContent}${t.textContent}`),t.remove())}}a()}))],[!1,async e=>new Promise((t=>{const a=(e,t)=>{const l={};if(Object.assign(l,t[t.length-1]),e.namespace){if(!n(l,e.namespace))return void e.remove();l[e.namespace].count++}for(let t=e.attributes.length;t--;){const a=e.attributes[t];"xmlns"===a.namespace?l[a.name]={target:e,count:0}:a.namespace&&(n(l,a.namespace)?l[a.namespace].count++:"xml:space"!==a.fullname&&e.removeAttribute(a.fullname))}t.push(l),e.children.forEach((e=>{a(e,t)})),Object.keys(l).forEach((t=>{0===l[t].count&&l[t].target===e&&e.removeAttribute(`xmlns:${t}`)})),t.pop()};e.children.forEach((e=>{a(e,[{}])})),t()})),"rm-xmlns"],[!1,async(t,{browsers:a})=>new Promise((l=>{t.querySelectorAll(e.NodeType.Tag).forEach((e=>{const l=((e,t,a)=>{Ta(t);const l={},r=le[e.nodeName],i=e.styles;for(let t=e.attributes.length;t--;){const s=e.attributes[t],o=Ot[s.fullname];if("style"===s.fullname){const t=ta(s.value);for(let n=t.length;n--;){const s=t[n],o=Ot[s.fullname],u=i&&i[s.fullname]&&i[s.fullname].override||!o.couldBeStyle&&!fn(e.nodeName,s.fullname,a)||pn(r,s.fullname);l[s.fullname]={value:s.value,fromStyle:!0,onlyCss:u}}}else if(o.couldBeStyle||fn(e.nodeName,s.fullname,a)){if(pn(r,s.fullname))continue;n(l,s.fullname)||(l[s.fullname]={value:s.value})}}return l})(e,t,a),r=(e=>{let t=8;return Object.entries(e).forEach((([e,a])=>{D.includes(e)&&qe.test(a.value)&&0!=+a.value||(t-=2)})),t})(l);Object.values(l).some((e=>e.onlyCss))||r<0?(Object.entries(l).forEach((([t,a])=>{a.onlyCss||e.removeAttribute(t)})),e.setAttribute("style",qa(Object.keys(l).reverse().map((e=>{let t=l[e].value;return D.includes(e)&&qe.test(t)&&0!=+t&&(t+="px"),{name:e,fullname:e,value:t}}))))):(e.removeAttribute("style"),Object.keys(l).reverse().forEach((t=>{let a=l[t].value;D.includes(t)&&!qe.test(a)&&(a=a.replace(/(?<=\d)px$/,"")),e.setAttribute(t,a)})))})),l()})),"shorten-style-attr"],[!1,gn,"rm-illegal-style"],[!1,on,"rm-attribute"],[!1,sn,"compute-path"]],{stringify:Hn}=require("css");return async(t,a=null)=>new Promise(((i,s)=>{const o=(e=>{const t={rules:{},params:{...p},browsers:d()};for(const[e,[a,l]]of Object.entries(f))if(t.rules[e]=[a],l){const a={};for(const[e,t]of Object.entries(l))a[e]=Array.isArray(t)?t.slice():t;t.rules[e].push(a)}if(r(e)){const a=e;h(a,t.rules),n(a,"rules")&&r(a.rules)&&h(a.rules,t.rules);const l=a.params;n(a,"params")&&r(l)&&Object.keys(p).forEach((e=>{if(n(l,e)){const a=l[e];t.params[e]=g(p[e],a)}})),n(a,"browsers")&&("string"==typeof a.browsers||Array.isArray(a.browsers))&&(t.browsers=d(a.browsers))}return t})(a);e.parse(t).then((async e=>{for(const t of Xn){const a=l(o,t[2]);(t[0]||o.rules[t[2]][0])&&await t[1](e,a)}i((e=>{if(!e)return"";if(e.stylesheet){const t=Hn(e.stylesheet,{compress:!0}).replace(/;}/g,"}"),a=e.styletag;t?a.childNodes[0].textContent=t:a.remove()}return e.toString()})(e))}),s)}))}));
//# sourceMappingURL=/sm/380d3e669bf5dec08ffb37c05d7ad2dfd284c2bc6ffbc9e6154bb99a2ad2d0c6.map