"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHtmlSanitizer = void 0;
var sanitize_html_1 = __importDefault(require("sanitize-html"));
var helpers_1 = require("./helpers");
var useHtmlSanitizer = function () {
    var _a = sanitize_html_1.default.defaults, allowedAttributes = _a.allowedAttributes, allowedTags = _a.allowedTags;
    var attributes = helpers_1.sanitizerOptions.attributes, tags = helpers_1.sanitizerOptions.tags;
    var options = {
        allowedTags: allowedTags.concat(tags),
        allowedAttributes: __assign(__assign({}, allowedAttributes), attributes),
        allowVulnerableTags: true
    };
    return function (html) { return (0, sanitize_html_1.default)(html, options); };
};
exports.useHtmlSanitizer = useHtmlSanitizer;
