"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractCssFromStyleNode = extractCssFromStyleNode; exports.isAmpBoilerplate = isAmpBoilerplate; exports.isComment = isComment; exports.isConditionalComment = isConditionalComment; exports.isEventHandler = isEventHandler; exports.isStyleNode = isStyleNode; exports.optionalImport = optionalImport; function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function __transformExtension(filepath, extMapping) { if (!filepath.startsWith('./') && !filepath.startsWith('../')) { // Package import return filepath; } const idx = filepath.lastIndexOf('.'); if (idx === -1 || filepath.includes('/', idx)) { // No extension const newExt = extMapping['']; if (newExt) { return filepath + newExt; } return filepath; } for (let [origExt, newExt] of Object.entries(extMapping).sort((a, b) => b[0].length - a[0].length)) { if (filepath.endsWith(origExt)) { return filepath.slice(0, -origExt.length) + newExt; } } return filepath; } const ampBoilerplateAttributes = ['amp-boilerplate', 'amp4ads-boilerplate', 'amp4email-boilerplate']; function isAmpBoilerplate(node) { if (!node.attrs) { return false; } for (const attr of ampBoilerplateAttributes) { if (attr in node.attrs) { return true; } } return false; } function isComment(content) { if (typeof content === 'string') { return content.trim().startsWith('