"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __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__, {
    withTailwindStyles: ()=>withTailwindStyles
});
const external_lit_namespaceObject = require("lit");
const tailwind_global_tw_css_namespaceObject = require("../utils/tailwind.global.tw.css");
var tailwind_global_tw_css_default = /*#__PURE__*/ __webpack_require__.n(tailwind_global_tw_css_namespaceObject);
const tailwindPropertiesSheet = "u" > typeof window ? (()=>{
    const propCss = tailwind_global_tw_css_default();
    const fullCss = Array.isArray(propCss) ? propCss.join('') : propCss;
    const match = fullCss.match(/@layer\s+properties\s*{[^{}]*@supports[^{}]*{([^}]*)}|@layer\s+properties\s*{([^}]*)}/);
    const cssString = (match?.[1] || match?.[2] || '').trim();
    if (!cssString) return null;
    const wrappedCss = `@layer properties { ${cssString} }`;
    const sheet = new CSSStyleSheet();
    sheet.replaceSync(wrappedCss);
    return sheet;
})() : null;
function injectTailwindProperties(element) {
    if ("u" < typeof window || !tailwindPropertiesSheet) return;
    const parent = element.getRootNode();
    const isParentDocumentOrShadowRoot = parent instanceof Document || parent instanceof ShadowRoot;
    if (isParentDocumentOrShadowRoot) {
        if (!parent.adoptedStyleSheets.includes(tailwindPropertiesSheet)) parent.adoptedStyleSheets?.push(tailwindPropertiesSheet);
    } else element.adoptedStyleSheets?.push(tailwindPropertiesSheet);
}
const withTailwindStyles = (Base)=>class extends Base {
        connectedCallback() {
            super.connectedCallback();
            injectTailwindProperties(this);
        }
        static get styles() {
            const baseStyles = [
                (0, external_lit_namespaceObject.unsafeCSS)(tailwind_global_tw_css_default())
            ];
            const customStyles = Base.styles;
            if (Array.isArray(customStyles)) return [
                ...baseStyles,
                ...customStyles
            ];
            if (customStyles) return [
                ...baseStyles,
                customStyles
            ];
            return baseStyles;
        }
    };
exports.withTailwindStyles = __webpack_exports__.withTailwindStyles;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "withTailwindStyles"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
