svgr-react-icons
Version:
A dynamic SVG icon package for React with size and fill customization
872 lines (871 loc) • 39 kB
JavaScript
import qt, { useState as Zt, useRef as Jt, useEffect as Kt } from "react";
var rt = { exports: {} }, de = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ot;
function Qt() {
if (Ot) return de;
Ot = 1;
var i = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
function c(l, f, d) {
var S = null;
if (d !== void 0 && (S = "" + d), f.key !== void 0 && (S = "" + f.key), "key" in f) {
d = {};
for (var I in f)
I !== "key" && (d[I] = f[I]);
} else d = f;
return f = d.ref, {
$$typeof: i,
type: l,
key: S,
ref: f !== void 0 ? f : null,
props: d
};
}
return de.Fragment = r, de.jsx = c, de.jsxs = c, de;
}
var Te = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var yt;
function en() {
return yt || (yt = 1, process.env.NODE_ENV !== "production" && function() {
function i(t) {
if (t == null) return null;
if (typeof t == "function")
return t.$$typeof === Ge ? null : t.displayName || t.name || null;
if (typeof t == "string") return t;
switch (t) {
case se:
return "Fragment";
case Fe:
return "Profiler";
case Ue:
return "StrictMode";
case $:
return "Suspense";
case le:
return "SuspenseList";
case We:
return "Activity";
}
if (typeof t == "object")
switch (typeof t.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), t.$$typeof) {
case B:
return "Portal";
case J:
return (t.displayName || "Context") + ".Provider";
case ze:
return (t._context.displayName || "Context") + ".Consumer";
case R:
var a = t.render;
return t = t.displayName, t || (t = a.displayName || a.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
case He:
return a = t.displayName || null, a !== null ? a : i(t.type) || "Memo";
case Se:
a = t._payload, t = t._init;
try {
return i(t(a));
} catch {
}
}
return null;
}
function r(t) {
return "" + t;
}
function c(t) {
try {
r(t);
var a = !1;
} catch {
a = !0;
}
if (a) {
a = console;
var T = a.error, m = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
return T.call(
a,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
m
), r(t);
}
}
function l(t) {
if (t === se) return "<>";
if (typeof t == "object" && t !== null && t.$$typeof === Se)
return "<...>";
try {
var a = i(t);
return a ? "<" + a + ">" : "<...>";
} catch {
return "<...>";
}
}
function f() {
var t = _.A;
return t === null ? null : t.getOwner();
}
function d() {
return Error("react-stack-top-frame");
}
function S(t) {
if (K.call(t, "key")) {
var a = Object.getOwnPropertyDescriptor(t, "key").get;
if (a && a.isReactWarning) return !1;
}
return t.key !== void 0;
}
function I(t, a) {
function T() {
Re || (Re = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
a
));
}
T.isReactWarning = !0, Object.defineProperty(t, "key", {
get: T,
configurable: !0
});
}
function j() {
var t = i(this.type);
return be[t] || (be[t] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), t = this.props.ref, t !== void 0 ? t : null;
}
function P(t, a, T, m, M, p, F, V) {
return T = p.ref, t = {
$$typeof: v,
type: t,
key: a,
props: p,
_owner: M
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(t, "ref", {
enumerable: !1,
get: j
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(t, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.defineProperty(t, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: F
}), Object.defineProperty(t, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: V
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
}
function Z(t, a, T, m, M, p, F, V) {
var g = a.children;
if (g !== void 0)
if (m)
if (ce(g)) {
for (m = 0; m < g.length; m++)
Y(g[m]);
Object.freeze && Object.freeze(g);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else Y(g);
if (K.call(a, "key")) {
g = i(t);
var k = Object.keys(a).filter(function(Ne) {
return Ne !== "key";
});
m = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", ye[g + m] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
m,
g,
k,
g
), ye[g + m] = !0);
}
if (g = null, T !== void 0 && (c(T), g = "" + T), S(a) && (c(a.key), g = "" + a.key), "key" in a) {
T = {};
for (var Q in a)
Q !== "key" && (T[Q] = a[Q]);
} else T = a;
return g && I(
T,
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
), P(
t,
g,
p,
M,
f(),
T,
F,
V
);
}
function Y(t) {
typeof t == "object" && t !== null && t.$$typeof === v && t._store && (t._store.validated = 1);
}
var b = qt, v = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), se = Symbol.for("react.fragment"), Ue = Symbol.for("react.strict_mode"), Fe = Symbol.for("react.profiler"), ze = Symbol.for("react.consumer"), J = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), le = Symbol.for("react.suspense_list"), He = Symbol.for("react.memo"), Se = Symbol.for("react.lazy"), We = Symbol.for("react.activity"), Ge = Symbol.for("react.client.reference"), _ = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, K = Object.prototype.hasOwnProperty, ce = Array.isArray, X = console.createTask ? console.createTask : function() {
return null;
};
b = {
react_stack_bottom_frame: function(t) {
return t();
}
};
var Re, be = {}, Oe = b.react_stack_bottom_frame.bind(
b,
d
)(), ue = X(l(d)), ye = {};
Te.Fragment = se, Te.jsx = function(t, a, T, m, M) {
var p = 1e4 > _.recentlyCreatedOwnerStacks++;
return Z(
t,
a,
T,
!1,
m,
M,
p ? Error("react-stack-top-frame") : Oe,
p ? X(l(t)) : ue
);
}, Te.jsxs = function(t, a, T, m, M) {
var p = 1e4 > _.recentlyCreatedOwnerStacks++;
return Z(
t,
a,
T,
!0,
m,
M,
p ? Error("react-stack-top-frame") : Oe,
p ? X(l(t)) : ue
);
};
}()), Te;
}
process.env.NODE_ENV === "production" ? rt.exports = Qt() : rt.exports = en();
var Nt = rt.exports;
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
const {
entries: kt,
setPrototypeOf: Lt,
isFrozen: tn,
getPrototypeOf: nn,
getOwnPropertyDescriptor: rn
} = Object;
let {
freeze: L,
seal: D,
create: Ut
} = Object, {
apply: ot,
construct: at
} = typeof Reflect < "u" && Reflect;
L || (L = function(r) {
return r;
});
D || (D = function(r) {
return r;
});
ot || (ot = function(r, c, l) {
return r.apply(c, l);
});
at || (at = function(r, c) {
return new r(...c);
});
const xe = w(Array.prototype.forEach), on = w(Array.prototype.lastIndexOf), wt = w(Array.prototype.pop), Ee = w(Array.prototype.push), an = w(Array.prototype.splice), ke = w(String.prototype.toLowerCase), Ke = w(String.prototype.toString), Ct = w(String.prototype.match), _e = w(String.prototype.replace), sn = w(String.prototype.indexOf), ln = w(String.prototype.trim), x = w(Object.prototype.hasOwnProperty), N = w(RegExp.prototype.test), ge = cn(TypeError);
function w(i) {
return function(r) {
r instanceof RegExp && (r.lastIndex = 0);
for (var c = arguments.length, l = new Array(c > 1 ? c - 1 : 0), f = 1; f < c; f++)
l[f - 1] = arguments[f];
return ot(i, r, l);
};
}
function cn(i) {
return function() {
for (var r = arguments.length, c = new Array(r), l = 0; l < r; l++)
c[l] = arguments[l];
return at(i, c);
};
}
function u(i, r) {
let c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ke;
Lt && Lt(i, null);
let l = r.length;
for (; l--; ) {
let f = r[l];
if (typeof f == "string") {
const d = c(f);
d !== f && (tn(r) || (r[l] = d), f = d);
}
i[f] = !0;
}
return i;
}
function un(i) {
for (let r = 0; r < i.length; r++)
x(i, r) || (i[r] = null);
return i;
}
function G(i) {
const r = Ut(null);
for (const [c, l] of kt(i))
x(i, c) && (Array.isArray(l) ? r[c] = un(l) : l && typeof l == "object" && l.constructor === Object ? r[c] = G(l) : r[c] = l);
return r;
}
function he(i, r) {
for (; i !== null; ) {
const l = rn(i, r);
if (l) {
if (l.get)
return w(l.get);
if (typeof l.value == "function")
return w(l.value);
}
i = nn(i);
}
function c() {
return null;
}
return c;
}
const It = L(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Qe = L(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), et = L(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), fn = L(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), tt = L(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), mn = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Dt = L(["#text"]), vt = L(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), nt = L(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Mt = L(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Pe = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pn = D(/\{\{[\w\W]*|[\w\W]*\}\}/gm), dn = D(/<%[\w\W]*|[\w\W]*%>/gm), Tn = D(/\$\{[\w\W]*/gm), En = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = D(/^aria-[\-\w]+$/), Ft = D(
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
// eslint-disable-line no-useless-escape
), gn = D(/^(?:\w+script|data):/i), hn = D(
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
// eslint-disable-line no-control-regex
), zt = D(/^html$/i), An = D(/^[a-z][.\w]*(-[.\w]+)+$/i);
var xt = /* @__PURE__ */ Object.freeze({
__proto__: null,
ARIA_ATTR: _n,
ATTR_WHITESPACE: hn,
CUSTOM_ELEMENT: An,
DATA_ATTR: En,
DOCTYPE_NAME: zt,
ERB_EXPR: dn,
IS_ALLOWED_URI: Ft,
IS_SCRIPT_OR_DATA: gn,
MUSTACHE_EXPR: pn,
TMPLIT_EXPR: Tn
});
const Ae = {
element: 1,
text: 3,
// Deprecated
progressingInstruction: 7,
comment: 8,
document: 9
}, Sn = function() {
return typeof window > "u" ? null : window;
}, Rn = function(r, c) {
if (typeof r != "object" || typeof r.createPolicy != "function")
return null;
let l = null;
const f = "data-tt-policy-suffix";
c && c.hasAttribute(f) && (l = c.getAttribute(f));
const d = "dompurify" + (l ? "#" + l : "");
try {
return r.createPolicy(d, {
createHTML(S) {
return S;
},
createScriptURL(S) {
return S;
}
});
} catch {
return console.warn("TrustedTypes policy " + d + " could not be created."), null;
}
}, Pt = function() {
return {
afterSanitizeAttributes: [],
afterSanitizeElements: [],
afterSanitizeShadowDOM: [],
beforeSanitizeAttributes: [],
beforeSanitizeElements: [],
beforeSanitizeShadowDOM: [],
uponSanitizeAttribute: [],
uponSanitizeElement: [],
uponSanitizeShadowNode: []
};
};
function Ht() {
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Sn();
const r = (s) => Ht(s);
if (r.version = "3.2.6", r.removed = [], !i || !i.document || i.document.nodeType !== Ae.document || !i.Element)
return r.isSupported = !1, r;
let {
document: c
} = i;
const l = c, f = l.currentScript, {
DocumentFragment: d,
HTMLTemplateElement: S,
Node: I,
Element: j,
NodeFilter: P,
NamedNodeMap: Z = i.NamedNodeMap || i.MozNamedAttrMap,
HTMLFormElement: Y,
DOMParser: b,
trustedTypes: v
} = i, B = j.prototype, se = he(B, "cloneNode"), Ue = he(B, "remove"), Fe = he(B, "nextSibling"), ze = he(B, "childNodes"), J = he(B, "parentNode");
if (typeof S == "function") {
const s = c.createElement("template");
s.content && s.content.ownerDocument && (c = s.content.ownerDocument);
}
let R, $ = "";
const {
implementation: le,
createNodeIterator: He,
createDocumentFragment: Se,
getElementsByTagName: We
} = c, {
importNode: Ge
} = l;
let _ = Pt();
r.isSupported = typeof kt == "function" && typeof J == "function" && le && le.createHTMLDocument !== void 0;
const {
MUSTACHE_EXPR: K,
ERB_EXPR: ce,
TMPLIT_EXPR: X,
DATA_ATTR: Re,
ARIA_ATTR: be,
IS_SCRIPT_OR_DATA: Oe,
ATTR_WHITESPACE: ue,
CUSTOM_ELEMENT: ye
} = xt;
let {
IS_ALLOWED_URI: t
} = xt, a = null;
const T = u({}, [...It, ...Qe, ...et, ...tt, ...Dt]);
let m = null;
const M = u({}, [...vt, ...nt, ...Mt, ...Pe]);
let p = Object.seal(Ut(null, {
tagNameCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
},
attributeNameCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
},
allowCustomizedBuiltInElements: {
writable: !0,
configurable: !1,
enumerable: !0,
value: !1
}
})), F = null, V = null, g = !0, k = !0, Q = !1, Ne = !0, ee = !1, Le = !0, q = !1, je = !1, Ye = !1, te = !1, we = !1, Ce = !1, it = !0, st = !1;
const Wt = "user-content-";
let Be = !0, fe = !1, ne = {}, re = null;
const lt = u({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
let ct = null;
const ut = u({}, ["audio", "video", "img", "source", "image", "track"]);
let $e = null;
const ft = u({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ie = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", z = "http://www.w3.org/1999/xhtml";
let oe = z, Xe = !1, Ve = null;
const Gt = u({}, [Ie, De, z], Ke);
let ve = u({}, ["mi", "mo", "mn", "ms", "mtext"]), Me = u({}, ["annotation-xml"]);
const jt = u({}, ["title", "style", "font", "a", "script"]);
let me = null;
const Yt = ["application/xhtml+xml", "text/html"], Bt = "text/html";
let A = null, ae = null;
const $t = c.createElement("form"), mt = function(e) {
return e instanceof RegExp || e instanceof Function;
}, qe = function() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (!(ae && ae === e)) {
if ((!e || typeof e != "object") && (e = {}), e = G(e), me = // eslint-disable-next-line unicorn/prefer-includes
Yt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Bt : e.PARSER_MEDIA_TYPE, A = me === "application/xhtml+xml" ? Ke : ke, a = x(e, "ALLOWED_TAGS") ? u({}, e.ALLOWED_TAGS, A) : T, m = x(e, "ALLOWED_ATTR") ? u({}, e.ALLOWED_ATTR, A) : M, Ve = x(e, "ALLOWED_NAMESPACES") ? u({}, e.ALLOWED_NAMESPACES, Ke) : Gt, $e = x(e, "ADD_URI_SAFE_ATTR") ? u(G(ft), e.ADD_URI_SAFE_ATTR, A) : ft, ct = x(e, "ADD_DATA_URI_TAGS") ? u(G(ut), e.ADD_DATA_URI_TAGS, A) : ut, re = x(e, "FORBID_CONTENTS") ? u({}, e.FORBID_CONTENTS, A) : lt, F = x(e, "FORBID_TAGS") ? u({}, e.FORBID_TAGS, A) : G({}), V = x(e, "FORBID_ATTR") ? u({}, e.FORBID_ATTR, A) : G({}), ne = x(e, "USE_PROFILES") ? e.USE_PROFILES : !1, g = e.ALLOW_ARIA_ATTR !== !1, k = e.ALLOW_DATA_ATTR !== !1, Q = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ee = e.SAFE_FOR_TEMPLATES || !1, Le = e.SAFE_FOR_XML !== !1, q = e.WHOLE_DOCUMENT || !1, te = e.RETURN_DOM || !1, we = e.RETURN_DOM_FRAGMENT || !1, Ce = e.RETURN_TRUSTED_TYPE || !1, Ye = e.FORCE_BODY || !1, it = e.SANITIZE_DOM !== !1, st = e.SANITIZE_NAMED_PROPS || !1, Be = e.KEEP_CONTENT !== !1, fe = e.IN_PLACE || !1, t = e.ALLOWED_URI_REGEXP || Ft, oe = e.NAMESPACE || z, ve = e.MATHML_TEXT_INTEGRATION_POINTS || ve, Me = e.HTML_INTEGRATION_POINTS || Me, p = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && mt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (p.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && mt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (p.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (p.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ee && (k = !1), we && (te = !0), ne && (a = u({}, Dt), m = [], ne.html === !0 && (u(a, It), u(m, vt)), ne.svg === !0 && (u(a, Qe), u(m, nt), u(m, Pe)), ne.svgFilters === !0 && (u(a, et), u(m, nt), u(m, Pe)), ne.mathMl === !0 && (u(a, tt), u(m, Mt), u(m, Pe))), e.ADD_TAGS && (a === T && (a = G(a)), u(a, e.ADD_TAGS, A)), e.ADD_ATTR && (m === M && (m = G(m)), u(m, e.ADD_ATTR, A)), e.ADD_URI_SAFE_ATTR && u($e, e.ADD_URI_SAFE_ATTR, A), e.FORBID_CONTENTS && (re === lt && (re = G(re)), u(re, e.FORBID_CONTENTS, A)), Be && (a["#text"] = !0), q && u(a, ["html", "head", "body"]), a.table && (u(a, ["tbody"]), delete F.tbody), e.TRUSTED_TYPES_POLICY) {
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
R = e.TRUSTED_TYPES_POLICY, $ = R.createHTML("");
} else
R === void 0 && (R = Rn(v, f)), R !== null && typeof $ == "string" && ($ = R.createHTML(""));
L && L(e), ae = e;
}
}, pt = u({}, [...Qe, ...et, ...fn]), dt = u({}, [...tt, ...mn]), Xt = function(e) {
let n = J(e);
(!n || !n.tagName) && (n = {
namespaceURI: oe,
tagName: "template"
});
const o = ke(e.tagName), E = ke(n.tagName);
return Ve[e.namespaceURI] ? e.namespaceURI === De ? n.namespaceURI === z ? o === "svg" : n.namespaceURI === Ie ? o === "svg" && (E === "annotation-xml" || ve[E]) : !!pt[o] : e.namespaceURI === Ie ? n.namespaceURI === z ? o === "math" : n.namespaceURI === De ? o === "math" && Me[E] : !!dt[o] : e.namespaceURI === z ? n.namespaceURI === De && !Me[E] || n.namespaceURI === Ie && !ve[E] ? !1 : !dt[o] && (jt[o] || !pt[o]) : !!(me === "application/xhtml+xml" && Ve[e.namespaceURI]) : !1;
}, U = function(e) {
Ee(r.removed, {
element: e
});
try {
J(e).removeChild(e);
} catch {
Ue(e);
}
}, ie = function(e, n) {
try {
Ee(r.removed, {
attribute: n.getAttributeNode(e),
from: n
});
} catch {
Ee(r.removed, {
attribute: null,
from: n
});
}
if (n.removeAttribute(e), e === "is")
if (te || we)
try {
U(n);
} catch {
}
else
try {
n.setAttribute(e, "");
} catch {
}
}, Tt = function(e) {
let n = null, o = null;
if (Ye)
e = "<remove></remove>" + e;
else {
const h = Ct(e, /^[\r\n\t ]+/);
o = h && h[0];
}
me === "application/xhtml+xml" && oe === z && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
const E = R ? R.createHTML(e) : e;
if (oe === z)
try {
n = new b().parseFromString(E, me);
} catch {
}
if (!n || !n.documentElement) {
n = le.createDocument(oe, "template", null);
try {
n.documentElement.innerHTML = Xe ? $ : E;
} catch {
}
}
const O = n.body || n.documentElement;
return e && o && O.insertBefore(c.createTextNode(o), O.childNodes[0] || null), oe === z ? We.call(n, q ? "html" : "body")[0] : q ? n.documentElement : O;
}, Et = function(e) {
return He.call(
e.ownerDocument || e,
e,
// eslint-disable-next-line no-bitwise
P.SHOW_ELEMENT | P.SHOW_COMMENT | P.SHOW_TEXT | P.SHOW_PROCESSING_INSTRUCTION | P.SHOW_CDATA_SECTION,
null
);
}, Ze = function(e) {
return e instanceof Y && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Z) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
}, _t = function(e) {
return typeof I == "function" && e instanceof I;
};
function H(s, e, n) {
xe(s, (o) => {
o.call(r, e, n, ae);
});
}
const gt = function(e) {
let n = null;
if (H(_.beforeSanitizeElements, e, null), Ze(e))
return U(e), !0;
const o = A(e.nodeName);
if (H(_.uponSanitizeElement, e, {
tagName: o,
allowedTags: a
}), Le && e.hasChildNodes() && !_t(e.firstElementChild) && N(/<[/\w!]/g, e.innerHTML) && N(/<[/\w!]/g, e.textContent) || e.nodeType === Ae.progressingInstruction || Le && e.nodeType === Ae.comment && N(/<[/\w]/g, e.data))
return U(e), !0;
if (!a[o] || F[o]) {
if (!F[o] && At(o) && (p.tagNameCheck instanceof RegExp && N(p.tagNameCheck, o) || p.tagNameCheck instanceof Function && p.tagNameCheck(o)))
return !1;
if (Be && !re[o]) {
const E = J(e) || e.parentNode, O = ze(e) || e.childNodes;
if (O && E) {
const h = O.length;
for (let C = h - 1; C >= 0; --C) {
const W = se(O[C], !0);
W.__removalCount = (e.__removalCount || 0) + 1, E.insertBefore(W, Fe(e));
}
}
}
return U(e), !0;
}
return e instanceof j && !Xt(e) || (o === "noscript" || o === "noembed" || o === "noframes") && N(/<\/no(script|embed|frames)/i, e.innerHTML) ? (U(e), !0) : (ee && e.nodeType === Ae.text && (n = e.textContent, xe([K, ce, X], (E) => {
n = _e(n, E, " ");
}), e.textContent !== n && (Ee(r.removed, {
element: e.cloneNode()
}), e.textContent = n)), H(_.afterSanitizeElements, e, null), !1);
}, ht = function(e, n, o) {
if (it && (n === "id" || n === "name") && (o in c || o in $t))
return !1;
if (!(k && !V[n] && N(Re, n))) {
if (!(g && N(be, n))) {
if (!m[n] || V[n]) {
if (
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
!(At(e) && (p.tagNameCheck instanceof RegExp && N(p.tagNameCheck, e) || p.tagNameCheck instanceof Function && p.tagNameCheck(e)) && (p.attributeNameCheck instanceof RegExp && N(p.attributeNameCheck, n) || p.attributeNameCheck instanceof Function && p.attributeNameCheck(n)) || // Alternative, second condition checks if it's an `is`-attribute, AND
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
n === "is" && p.allowCustomizedBuiltInElements && (p.tagNameCheck instanceof RegExp && N(p.tagNameCheck, o) || p.tagNameCheck instanceof Function && p.tagNameCheck(o)))
) return !1;
} else if (!$e[n]) {
if (!N(t, _e(o, ue, ""))) {
if (!((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && sn(o, "data:") === 0 && ct[e])) {
if (!(Q && !N(Oe, _e(o, ue, "")))) {
if (o)
return !1;
}
}
}
}
}
}
return !0;
}, At = function(e) {
return e !== "annotation-xml" && Ct(e, ye);
}, St = function(e) {
H(_.beforeSanitizeAttributes, e, null);
const {
attributes: n
} = e;
if (!n || Ze(e))
return;
const o = {
attrName: "",
attrValue: "",
keepAttr: !0,
allowedAttributes: m,
forceKeepAttr: void 0
};
let E = n.length;
for (; E--; ) {
const O = n[E], {
name: h,
namespaceURI: C,
value: W
} = O, pe = A(h), Je = W;
let y = h === "value" ? Je : ln(Je);
if (o.attrName = pe, o.attrValue = y, o.keepAttr = !0, o.forceKeepAttr = void 0, H(_.uponSanitizeAttribute, e, o), y = o.attrValue, st && (pe === "id" || pe === "name") && (ie(h, e), y = Wt + y), Le && N(/((--!?|])>)|<\/(style|title)/i, y)) {
ie(h, e);
continue;
}
if (o.forceKeepAttr)
continue;
if (!o.keepAttr) {
ie(h, e);
continue;
}
if (!Ne && N(/\/>/i, y)) {
ie(h, e);
continue;
}
ee && xe([K, ce, X], (bt) => {
y = _e(y, bt, " ");
});
const Rt = A(e.nodeName);
if (!ht(Rt, pe, y)) {
ie(h, e);
continue;
}
if (R && typeof v == "object" && typeof v.getAttributeType == "function" && !C)
switch (v.getAttributeType(Rt, pe)) {
case "TrustedHTML": {
y = R.createHTML(y);
break;
}
case "TrustedScriptURL": {
y = R.createScriptURL(y);
break;
}
}
if (y !== Je)
try {
C ? e.setAttributeNS(C, h, y) : e.setAttribute(h, y), Ze(e) ? U(e) : wt(r.removed);
} catch {
ie(h, e);
}
}
H(_.afterSanitizeAttributes, e, null);
}, Vt = function s(e) {
let n = null;
const o = Et(e);
for (H(_.beforeSanitizeShadowDOM, e, null); n = o.nextNode(); )
H(_.uponSanitizeShadowNode, n, null), gt(n), St(n), n.content instanceof d && s(n.content);
H(_.afterSanitizeShadowDOM, e, null);
};
return r.sanitize = function(s) {
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = null, o = null, E = null, O = null;
if (Xe = !s, Xe && (s = "<!-->"), typeof s != "string" && !_t(s))
if (typeof s.toString == "function") {
if (s = s.toString(), typeof s != "string")
throw ge("dirty is not a string, aborting");
} else
throw ge("toString is not a function");
if (!r.isSupported)
return s;
if (je || qe(e), r.removed = [], typeof s == "string" && (fe = !1), fe) {
if (s.nodeName) {
const W = A(s.nodeName);
if (!a[W] || F[W])
throw ge("root node is forbidden and cannot be sanitized in-place");
}
} else if (s instanceof I)
n = Tt("<!---->"), o = n.ownerDocument.importNode(s, !0), o.nodeType === Ae.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? n = o : n.appendChild(o);
else {
if (!te && !ee && !q && // eslint-disable-next-line unicorn/prefer-includes
s.indexOf("<") === -1)
return R && Ce ? R.createHTML(s) : s;
if (n = Tt(s), !n)
return te ? null : Ce ? $ : "";
}
n && Ye && U(n.firstChild);
const h = Et(fe ? s : n);
for (; E = h.nextNode(); )
gt(E), St(E), E.content instanceof d && Vt(E.content);
if (fe)
return s;
if (te) {
if (we)
for (O = Se.call(n.ownerDocument); n.firstChild; )
O.appendChild(n.firstChild);
else
O = n;
return (m.shadowroot || m.shadowrootmode) && (O = Ge.call(l, O, !0)), O;
}
let C = q ? n.outerHTML : n.innerHTML;
return q && a["!doctype"] && n.ownerDocument && n.ownerDocument.doctype && n.ownerDocument.doctype.name && N(zt, n.ownerDocument.doctype.name) && (C = "<!DOCTYPE " + n.ownerDocument.doctype.name + `>
` + C), ee && xe([K, ce, X], (W) => {
C = _e(C, W, " ");
}), R && Ce ? R.createHTML(C) : C;
}, r.setConfig = function() {
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
qe(s), je = !0;
}, r.clearConfig = function() {
ae = null, je = !1;
}, r.isValidAttribute = function(s, e, n) {
ae || qe({});
const o = A(s), E = A(e);
return ht(o, E, n);
}, r.addHook = function(s, e) {
typeof e == "function" && Ee(_[s], e);
}, r.removeHook = function(s, e) {
if (e !== void 0) {
const n = on(_[s], e);
return n === -1 ? void 0 : an(_[s], n, 1)[0];
}
return wt(_[s]);
}, r.removeHooks = function(s) {
_[s] = [];
}, r.removeAllHooks = function() {
_ = Pt();
}, r;
}
var bn = Ht();
const yn = ({
src: i,
size: r,
fill: c = "currentColor",
className: l,
style: f,
isUrl: d = !1,
alt: S,
...I
}) => {
const [j, P] = Zt(null), Z = Jt(null);
Kt(() => {
d && typeof i == "string" && fetch(i).then((b) => {
if (!b.ok)
throw new Error(`Fetch failed: ${b.statusText}`);
return b.text();
}).then((b) => {
let v = bn.sanitize(b);
c && c !== "currentColor" && (v = v.replace(
/fill="[^"]*"/g,
`fill="${c}"`
)), P(v);
}).catch((b) => {
console.error("Error fetching SVG:", b), P(null);
});
}, [i, d, c]);
const Y = {
...f,
width: r ? `${r}px` : void 0,
height: r ? `${r}px` : void 0,
fill: c
};
if (d && j)
return Nt.jsx("svg", {
ref: Z,
className: l,
style: Y,
dangerouslySetInnerHTML: { __html: j },
role: S ? "img" : void 0,
"aria-label": S,
...I
});
if (typeof i == "function") {
const b = i;
return Nt.jsx(b, {
className: l,
style: Y,
role: S ? "img" : void 0,
"aria-label": S,
...I
});
}
return null;
};
function Nn(i, r = {}) {
const c = i.startsWith("/") ? i : `/${i}`, l = typeof window < "u" ? window.location.origin : "http://localhost:3000";
let f;
try {
f = new URL(c, l);
} catch (d) {
throw console.error("Invalid URL in generateSvgUrl:", { baseUrl: i, origin: l, error: d }), new Error(`Failed to construct URL from ${i}`);
}
return r.size && f.searchParams.set("size", r.size.toString()), r.fill && f.searchParams.set("fill", encodeURIComponent(r.fill)), f.toString();
}
export {
yn as Icon,
Nn as generateSvgUrl
};