{"version":3,"sources":["jsdelivr-header.js","/npm/@rowanmanning/feed-parser@2.1.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,SAAE,UAAa,QAAQ,oBACvB,SAAE,UAAa,QAAQ,uBACvB,iBAAE,kBAAqB,QAAQ,8BAC/B,QAAE,SAAY,QAAQ,kBAKtB,8BAAgC,CACrC,KAAM,SACN,IAAK,QACL,IAAK,SAaN,SAAS,UAAU,GAClB,MAAM,EAAM,SAAS,WAAW,GAGhC,IAAK,MAAO,EAAa,KAAa,OAAO,QAAQ,+BACpD,GAAI,EAAI,mBAAmB,GAC1B,OAAO,IAAI,EAAS,GAKtB,MAAM,IAAI,gBACX,CAEA,QAAQ,UAAY","file":"/npm/@rowanmanning/feed-parser@2.1.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@rowanmanning/feed-parser@2.1.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nconst { AtomFeed } = require('./lib/feed/atom');\nconst { Document } = require('./lib/xml/document');\nconst { InvalidFeedError } = require('./lib/errors/invalid-feed');\nconst { RssFeed } = require('./lib/feed/rss');\n\n/**\n * @type {{[key: string]: typeof import('./lib/feed/base').Feed}}}\n */\nconst DATA_PROVIDER_BY_ROOT_ELEMENT = {\n\tfeed: AtomFeed,\n\trdf: RssFeed,\n\trss: RssFeed\n};\n\n/**\n * Create a Feed from an XML string.\n *\n * @param {string} xmlString\n *     A string of XML.\n * @returns {import('./lib/feed/base').Feed}\n *     Returns a feed representation of the XML string.\n * @throws {InvalidFeedError}\n *     Throws an invalid feed error if an unrecoverable issue is found with the feed.\n */\nfunction parseFeed(xmlString) {\n\tconst xml = Document.fromString(xmlString);\n\n\t// Decide on a data provider based on whether a root element is present\n\tfor (const [rootElement, Provider] of Object.entries(DATA_PROVIDER_BY_ROOT_ELEMENT)) {\n\t\tif (xml.hasElementWithName(rootElement)) {\n\t\t\treturn new Provider(xml);\n\t\t}\n\t}\n\n\t// No root feed element was found\n\tthrow new InvalidFeedError();\n}\n\nexports.parseFeed = parseFeed;\n"]}