"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    renderLinkWithItemAnalytics: ()=>renderLinkWithItemAnalytics
});
const external_lit_namespaceObject = require("lit");
const if_defined_js_namespaceObject = require("lit/directives/if-defined.js");
const ref_js_namespaceObject = require("lit/directives/ref.js");
const xss_utils_cjs_namespaceObject = require("../../../utils/xss-utils.cjs");
const external_bind_analytics_to_link_cjs_namespaceObject = require("./bind-analytics-to-link.cjs");
const renderLinkWithItemAnalytics = ({ props })=>(children)=>{
        const { href, className, part, title, ariaLabel, stopPropagation = true, ref: refCallback, attributes, tabIndex, target = '_self', rel, onMouseOver, onMouseLeave, onFocus, onBlur, onSelect, onBeginDelayedSelect, onCancelPendingSelect, onInitializeLink } = props;
        return (0, external_lit_namespaceObject.html)`
      <a
        class=${(0, if_defined_js_namespaceObject.ifDefined)(className)}
        part=${(0, if_defined_js_namespaceObject.ifDefined)(part)}
        href=${(0, xss_utils_cjs_namespaceObject.filterProtocol)(href)}
        target=${target}
        title=${(0, if_defined_js_namespaceObject.ifDefined)(title)}
        aria-label=${(0, if_defined_js_namespaceObject.ifDefined)(ariaLabel)}
        rel=${(0, if_defined_js_namespaceObject.ifDefined)(rel)}
        ${(0, ref_js_namespaceObject.ref)((el)=>{
            if (!el) return;
            const cleanup = (0, external_bind_analytics_to_link_cjs_namespaceObject.bindAnalyticsToLink)(el, {
                onSelect,
                onBeginDelayedSelect,
                onCancelPendingSelect,
                stopPropagation
            });
            if (onInitializeLink) onInitializeLink(cleanup);
            if (attributes?.length) [
                ...attributes
            ].forEach(({ nodeName, nodeValue })=>{
                el.setAttribute(nodeName, nodeValue);
            });
        })}
        ${refCallback ? (0, ref_js_namespaceObject.ref)(refCallback) : external_lit_namespaceObject.nothing}
        tabindex=${(0, if_defined_js_namespaceObject.ifDefined)(tabIndex)}
        @mouseover=${onMouseOver}
        @mouseleave=${onMouseLeave}
        @focus=${onFocus}
        @blur=${onBlur}
      >
        ${children}
      </a>
    `;
    };
exports.renderLinkWithItemAnalytics = __webpack_exports__.renderLinkWithItemAnalytics;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderLinkWithItemAnalytics"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
