{"version":3,"sources":["webpack:///./node_modules/dom-serializer/index.js"],"names":["ElementType","entities","unencodedElements","__proto__","style","script","xmp","iframe","noembed","noframes","plaintext","noscript","singleTag","area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","render","module","exports","dom","opts","Array","isArray","cheerio","output","i","length","elem","type","children","isTag","renderTag","Directive","renderDirective","Comment","renderComment","CDATA","renderCdata","renderText","name","decodeEntities","xmlMode","tag","attribs","formatAttrs","attributes","value","key","encodeXML","quote","indexOf","data","parent"],"mappings":"+EAGA,IAAIA,EAAc,EAAQ,KACtBC,EAAW,EAAQ,KAEnBC,EAAoB,CACtBC,UAAW,KACXC,OAAO,EACPC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,UAAU,GAsCZ,IAAIC,EAAY,CACdT,UAAW,KACXU,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,OAAO,EACPC,IAAI,EACJC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,KAAK,GAIHC,EAASC,EAAOC,QAAU,SAASC,EAAKC,GACrCC,MAAMC,QAAQH,IAASA,EAAII,UAASJ,EAAM,CAACA,IAChDC,EAAOA,GAAQ,GAIf,IAFA,IAAII,EAAS,GAELC,EAAI,EAAGA,EAAIN,EAAIO,OAAQD,IAAI,CACjC,IAAIE,EAAOR,EAAIM,GAEG,SAAdE,EAAKC,KACPJ,GAAUR,EAAOW,EAAKE,SAAUT,GACzBpC,EAAY8C,MAAMH,GACzBH,GAAUO,UAAUJ,EAAMP,GACnBO,EAAKC,OAAS5C,EAAYgD,UACjCR,GAAUS,gBAAgBN,GACnBA,EAAKC,OAAS5C,EAAYkD,QACjCV,GAAUW,cAAcR,GACjBA,EAAKC,O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AAGsB,KAAO,MAG/C,SAAShB,cAAcR,GACrB,MAAO,UAASA,EAAKwB,KAAO","file":"npm.dom-serializer-cafcf742b67960000867.js","sourcesContent":["/*\n Module dependencies\n*/\nvar ElementType = require('domelementtype');\nvar entities = require('entities');\n\nvar unencodedElements = {\n __proto__: null,\n style: true,\n script: true,\n xmp: true,\n iframe: true,\n noembed: true,\n noframes: true,\n plaintext: true,\n noscript: true\n};\n\n/*\n Format attributes\n*/\nfunction formatAttrs(attributes, opts) {\n if (!attributes) return;\n\n var output = '',\n value;\n\n // Loop through the attributes\n for (var key in attributes) {\n value = attributes[key];\n if (opts.decodeEntities) {\n value = entities.encodeXML(value);\n }\n if (output) {\n output += ' ';\n }\n\n output += key;\n if ((value !== null && value !== '') || opts.xmlMode) {\n var quote = '\"';\n if (value.indexOf('\"') > -1) {\n quote = '\\'';\n }\n output += '=' + quote + (opts.decodeEntities ? entities.encodeXML(value) : value) + quote;\n }\n }\n\n return output;\n}\n\n/*\n Self-enclosing tags (stolen from node-htmlparser)\n*/\nvar singleTag = {\n __proto__: null,\n area: true,\n base: true,\n basefont: true,\n br: true,\n col: true,\n command: true,\n embed: true,\n frame: true,\n hr: true,\n img: true,\n input: true,\n isindex: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true,\n};\n\n\nvar render = module.exports = function(dom, opts) {\n if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];\n opts = opts || {};\n\n var output = '';\n\n for(var i = 0; i < dom.length; i++){\n var elem = dom[i];\n\n if (elem.type === 'root')\n output += render(elem.children, opts);\n else if (ElementType.isTag(elem))\n output += renderTag(elem, opts);\n else if (elem.type === ElementType.Directive)\n output += renderDirective(elem);\n else if (elem.type === ElementType.Comment)\n output += renderComment(elem);\n else if (elem.type === ElementType.CDATA)\n output += renderCdata(elem);\n else\n output += renderText(elem, opts);\n }\n\n return output;\n};\n\nfunction renderTag(elem, opts) {\n // Handle SVG\n if (elem.name === \"svg\") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};\n\n var tag = '<' + elem.name,\n attribs = formatAttrs(elem.attribs, opts);\n\n if (attribs) {\n tag += ' ' + attribs;\n }\n\n if (\n opts.xmlMode\n && (!elem.children || elem.children.length === 0)\n ) {\n tag += '/>';\n } else {\n tag += '>';\n if (elem.children) {\n tag += render(elem.children, opts);\n }\n\n if (!singleTag[elem.name] || opts.xmlMode) {\n tag += '';\n }\n }\n\n return tag;\n}\n\nfunction renderDirective(elem) {\n return '<' + elem.data + '>';\n}\n\nfunction renderText(elem, opts) {\n var data = elem.data || '';\n\n // if entities weren't decoded, no need to encode them back\n if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) {\n data = entities.encodeXML(data);\n }\n\n return data;\n}\n\nfunction renderCdata(elem) {\n return '';\n}\n\nfunction renderComment(elem) {\n return '';\n}\n"],"sourceRoot":""}