{"version":3,"sources":["jsdelivr-header.js","/npm/@hint/hint-no-protocol-relative-urls@3.1.7/dist/src/hint.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,MAAM,cAAgB,QAAQ,qBACxB,eAAiB,QAAQ,sBACzB,cAAgB,QAAQ,qBACxB,gBAAkB,QAAQ,uBAC1B,OAAS,QAAQ,UACjB,cAAgB,QAAQ,iBACxB,OAAQ,EAAI,cAAc,OAAO,YACvC,MAAM,2BACF,WAAA,CAAY,GACR,MAAM,EAAW,EAAG,UAAS,eACzB,GAAI,MAAM,QAAS,CACf,MAAM,EAAO,EAAQ,UACrB,MAAM,oBAAmB,EAAI,eAAe,WAAW,EAAM,MACjE,CACA,MAAM,EAAM,EAAQ,aAAa,OAC3B,EAAO,EAAQ,aAAa,QAC5B,GAAO,GAAO,GAAQ,IAAI,OAC1B,EAAM,EAAQ,aAAa,QAAU,GAC3C,GAAI,EAAI,WAAW,OAAiB,iBAAR,EAAwB,CAChD,MAAM,+BACN,MAAM,GAAU,EAAI,cAAc,YAAY,wBAAyB,EAAQ,UACzE,EAAY,EAAM,MAAQ,OAI1B,EAAQ,CACV,CACI,SALkB,EAAQ,qBAAqB,GAM/C,KAJgB,GAAG,MADV,EAAI,QAAQ,KAAM,iBAQ7B,GAAW,EAAI,gBAAgB,SAAS,GAC1C,cAAc,SAAS,KACvB,cAAc,SAAS,QAC3B,EAAQ,OAAO,EAAU,EAAS,CAC9B,YACA,QAAS,EACT,UACA,QACA,YAER,GAEJ,EAAQ,GAAG,aAAc,GACzB,EAAQ,GAAG,eAAgB,GAC3B,EAAQ,GAAG,gBAAiB,GAC5B,EAAQ,GAAG,kBAAmB,EAClC,EAEJ,QAAQ,QAAU,2BAClB,2BAA2B,KAAO,OAAO","file":"/npm/@hint/hint-no-protocol-relative-urls@3.1.7/dist/src/hint.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/@hint/hint-no-protocol-relative-urls@3.1.7/dist/src/hint.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\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_debug_1 = require(\"@hint/utils-debug\");\nconst utils_string_1 = require(\"@hint/utils-string\");\nconst utils_types_1 = require(\"@hint/utils-types\");\nconst utils_network_1 = require(\"@hint/utils-network\");\nconst meta_1 = require(\"./meta\");\nconst i18n_import_1 = require(\"./i18n.import\");\nconst debug = (0, utils_debug_1.debug)(__filename);\nclass NoProtocolRelativeUrlsHint {\n    constructor(context) {\n        const validate = ({ element, resource }) => {\n            if (debug.enabled) {\n                const html = element.outerHTML;\n                debug(`Analyzing link\\n${(0, utils_string_1.cutString)(html, 50)}`);\n            }\n            const src = element.getAttribute('src');\n            const href = element.getAttribute('href');\n            const url = (src || href || '').trim();\n            const rel = element.getAttribute('rel') || '';\n            if (url.startsWith('//') && rel !== 'dns-prefetch') {\n                debug('Protocol relative URL found');\n                const message = (0, i18n_import_1.getMessage)('noProtocolRelativeUrl', context.language);\n                const attribute = src ? 'src' : 'href';\n                const attributeLocation = element.getAttributeLocation(attribute);\n                const fixedUrl = url.replace('//', 'https://');\n                const replacementText = `${attribute}=\"${fixedUrl}\"`;\n                const fixes = [\n                    {\n                        location: attributeLocation,\n                        text: replacementText\n                    }\n                ];\n                const severity = (0, utils_network_1.isHTTPS)(resource) ?\n                    utils_types_1.Severity.hint :\n                    utils_types_1.Severity.warning;\n                context.report(resource, message, {\n                    attribute,\n                    content: url,\n                    element,\n                    fixes,\n                    severity\n                });\n            }\n        };\n        context.on('element::a', validate);\n        context.on('element::img', validate);\n        context.on('element::link', validate);\n        context.on('element::script', validate);\n    }\n}\nexports.default = NoProtocolRelativeUrlsHint;\nNoProtocolRelativeUrlsHint.meta = meta_1.default;\n"]}