@anoki/fse-ui
Version:
FSE UI components library
53 lines (52 loc) • 2.05 kB
JavaScript
import { __exports as o } from "./index.es820.js";
var p;
function s() {
return p ? o : (p = 1, (function(e) {
Object.defineProperty(e, "__esModule", { value: !0 }), e.escapeText = e.escapeAttribute = e.escapeUTF8 = e.escape = e.encodeXML = e.getCodePoint = e.xmlReplacer = void 0, e.xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
var l = /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[39, "'"],
[60, "<"],
[62, ">"]
]);
e.getCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
String.prototype.codePointAt != null ? function(a, n) {
return a.codePointAt(n);
} : (
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
function(a, n) {
return (a.charCodeAt(n) & 64512) === 55296 ? (a.charCodeAt(n) - 55296) * 1024 + a.charCodeAt(n + 1) - 56320 + 65536 : a.charCodeAt(n);
}
);
function g(a) {
for (var n = "", r = 0, u; (u = e.xmlReplacer.exec(a)) !== null; ) {
var t = u.index, c = a.charCodeAt(t), i = l.get(c);
i !== void 0 ? (n += a.substring(r, t) + i, r = t + 1) : (n += "".concat(a.substring(r, t), "&#x").concat((0, e.getCodePoint)(a, t).toString(16), ";"), r = e.xmlReplacer.lastIndex += +((c & 64512) === 55296));
}
return n + a.substr(r);
}
e.encodeXML = g, e.escape = g;
function d(a, n) {
return function(u) {
for (var t, c = 0, i = ""; t = a.exec(u); )
c !== t.index && (i += u.substring(c, t.index)), i += n.get(t[0].charCodeAt(0)), c = t.index + 1;
return i + u.substring(c);
};
}
e.escapeUTF8 = d(/[&<>'"]/g, l), e.escapeAttribute = d(/["&\u00A0]/g, /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[160, " "]
])), e.escapeText = d(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
[38, "&"],
[60, "<"],
[62, ">"],
[160, " "]
]));
})(o), o);
}
export {
s as __require
};
//# sourceMappingURL=index.es812.js.map