{"ast":null,"code":"import { decodeXML, decodeHTML, DecodingMode } from \"./decode.js\";\nimport { encodeHTML, encodeNonAsciiHTML } from \"./encode.js\";\nimport { encodeXML, escapeUTF8, escapeAttribute, escapeText } from \"./escape.js\";\n/** The level of entities to support. */\nexport var EntityLevel;\n(function (EntityLevel) {\n /** Support only XML entities. */\n EntityLevel[EntityLevel[\"XML\"] = 0] = \"XML\";\n /** Support HTML entities, which are a superset of XML entities. */\n EntityLevel[EntityLevel[\"HTML\"] = 1] = \"HTML\";\n})(EntityLevel || (EntityLevel = {}));\nexport var EncodingMode;\n(function (EncodingMode) {\n /**\n * The output is UTF-8 encoded. Only characters that need escaping within\n * XML will be escaped.\n */\n EncodingMode[EncodingMode[\"UTF8\"] = 0] = \"UTF8\";\n /**\n * The output consists only of ASCII characters. Characters that need\n * escaping within HTML, and characters that aren't ASCII characters will\n * be escaped.\n */\n EncodingMode[EncodingMode[\"ASCII\"] = 1] = \"ASCII\";\n /**\n * Encode all characters that have an equivalent entity, as well as all\n * characters that are not ASCII characters.\n */\n EncodingMode[EncodingMode[\"Extensive\"] = 2] = \"Extensive\";\n /**\n * Encode all characters that have to be escaped in HTML attributes,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Attribute\"] = 3] = \"Attribute\";\n /**\n * Encode all characters that have to be escaped in HTML text,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Text\"] = 4] = \"Text\";\n})(EncodingMode || (EncodingMode = {}));\n/**\n * Decodes a string with entities.\n *\n * @param data String to decode.\n * @param options Decoding options.\n */\nexport function decode(data, options = EntityLevel.XML) {\n const level = typeof options === \"number\" ? options : options.level;\n if (level === EntityLevel.HTML) {\n const mode = typeof options === \"object\" ? options.mode : undefined;\n return decodeHTML(data, mode);\n }\n return decodeXML(data);\n}\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param data String to decode.\n * @param options Decoding options.\n * @deprecated Use `decode` with the `mode` set to `Strict`.\n */\nexport function decodeStrict(data, options = EntityLevel.XML) {\n var _a;\n const opts = typeof options === \"number\" ? {\n level: options\n } : options;\n (_a = opts.mode) !== null && _a !== void 0 ? _a : opts.mode = DecodingMode.Strict;\n return decode(data, opts);\n}\n/**\n * Encodes a string with entities.\n *\n * @param data String to encode.\n * @param options Encoding options.\n */\nexport function encode(data, options = EntityLevel.XML) {\n const opts = typeof options === \"number\" ? {\n level: options\n } : options;\n // Mode `UTF8` just escapes XML entities\n if (opts.mode === EncodingMode.UTF8) return escapeUTF8(data);\n if (opts.mode === EncodingMode.Attribute) return escapeAttribute(data);\n if (opts.mode === EncodingMode.Text) return escapeText(data);\n if (opts.level === EntityLevel.HTML) {\n if (opts.mode === EncodingMode.ASCII) {\n return encodeNonAsciiHTML(data);\n }\n return encodeHTML(data);\n }\n // ASCII and Extensive are equivalent\n return encodeXML(data);\n}\nexport { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText } from \"./escape.js\";\nexport { encodeHTML, encodeNonAsciiHTML,\n// Legacy aliases (deprecated)\nencodeHTML as encodeHTML4, encodeHTML as encodeHTML5 } from \"./encode.js\";\nexport { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute,\n// Legacy aliases (deprecated)\ndecodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict } from \"./decode.js\";","map":{"version":3,"names":["decodeXML","decodeHTML","DecodingMode","encodeHTML","encodeNonAsciiHTML","encodeXML","escapeUTF8","escapeAttribute","escapeText","EntityLevel","EncodingMode","decode","data","options","XML","level","HTML","mode","undefined","decodeStrict","_a","opts","Strict","encode","UTF8","Attribute","Text","ASCII","escape","encodeHTML4","encodeHTML5","EntityDecoder","decodeHTMLStrict","decodeHTMLAttribute","decodeHTML4","decodeHTML5","decodeHTML4Strict","decodeHTML5Strict","decodeXMLStrict"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/entities/lib/esm/index.js"],"sourcesContent":["import { decodeXML, decodeHTML, DecodingMode } from \"./decode.js\";\nimport { encodeHTML, encodeNonAsciiHTML } from \"./encode.js\";\nimport { encodeXML, escapeUTF8, escapeAttribute, escapeText, } from \"./escape.js\";\n/** The level of entities to support. */\nexport var EntityLevel;\n(function (EntityLevel) {\n /** Support only XML entities. */\n EntityLevel[EntityLevel[\"XML\"] = 0] = \"XML\";\n /** Support HTML entities, which are a superset of XML entities. */\n EntityLevel[EntityLevel[\"HTML\"] = 1] = \"HTML\";\n})(EntityLevel || (EntityLevel = {}));\nexport var EncodingMode;\n(function (EncodingMode) {\n /**\n * The output is UTF-8 encoded. Only characters that need escaping within\n * XML will be escaped.\n */\n EncodingMode[EncodingMode[\"UTF8\"] = 0] = \"UTF8\";\n /**\n * The output consists only of ASCII characters. Characters that need\n * escaping within HTML, and characters that aren't ASCII characters will\n * be escaped.\n */\n EncodingMode[EncodingMode[\"ASCII\"] = 1] = \"ASCII\";\n /**\n * Encode all characters that have an equivalent entity, as well as all\n * characters that are not ASCII characters.\n */\n EncodingMode[EncodingMode[\"Extensive\"] = 2] = \"Extensive\";\n /**\n * Encode all characters that have to be escaped in HTML attributes,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Attribute\"] = 3] = \"Attribute\";\n /**\n * Encode all characters that have to be escaped in HTML text,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Text\"] = 4] = \"Text\";\n})(EncodingMode || (EncodingMode = {}));\n/**\n * Decodes a string with entities.\n *\n * @param data String to decode.\n * @param options Decoding options.\n */\nexport function decode(data, options = EntityLevel.XML) {\n const level = typeof options === \"number\" ? options : options.level;\n if (level === EntityLevel.HTML) {\n const mode = typeof options === \"object\" ? options.mode : undefined;\n return decodeHTML(data, mode);\n }\n return decodeXML(data);\n}\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param data String to decode.\n * @param options Decoding options.\n * @deprecated Use `decode` with the `mode` set to `Strict`.\n */\nexport function decodeStrict(data, options = EntityLevel.XML) {\n var _a;\n const opts = typeof options === \"number\" ? { level: options } : options;\n (_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = DecodingMode.Strict);\n return decode(data, opts);\n}\n/**\n * Encodes a string with entities.\n *\n * @param data String to encode.\n * @param options Encoding options.\n */\nexport function encode(data, options = EntityLevel.XML) {\n const opts = typeof options === \"number\" ? { level: options } : options;\n // Mode `UTF8` just escapes XML entities\n if (opts.mode === EncodingMode.UTF8)\n return escapeUTF8(data);\n if (opts.mode === EncodingMode.Attribute)\n return escapeAttribute(data);\n if (opts.mode === EncodingMode.Text)\n return escapeText(data);\n if (opts.level === EntityLevel.HTML) {\n if (opts.mode === EncodingMode.ASCII) {\n return encodeNonAsciiHTML(data);\n }\n return encodeHTML(data);\n }\n // ASCII and Extensive are equivalent\n return encodeXML(data);\n}\nexport { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from \"./escape.js\";\nexport { encodeHTML, encodeNonAsciiHTML, \n// Legacy aliases (deprecated)\nencodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from \"./encode.js\";\nexport { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, \n// Legacy aliases (deprecated)\ndecodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from \"./decode.js\";\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,UAAU,EAAEC,YAAY,QAAQ,aAAa;AACjE,SAASC,UAAU,EAAEC,kBAAkB,QAAQ,aAAa;AAC5D,SAASC,SAAS,EAAEC,UAAU,EAAEC,eAAe,EAAEC,UAAU,QAAS,aAAa;AACjF;AACA,O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