var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import { DeesElement, customElement, html, css, property } from '@design.estate/dees-element';
let DeesDemoWrapper = (() => {
    let _classDecorators = [customElement('dees-demowrapper')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _runAfterRender_decorators;
    let _runAfterRender_initializers = [];
    let _runAfterRender_extraInitializers = [];
    var DeesDemoWrapper = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _runAfterRender_decorators = [property({ attribute: false })];
            __esDecorate(this, null, _runAfterRender_decorators, { kind: "accessor", name: "runAfterRender", static: false, private: false, access: { has: obj => "runAfterRender" in obj, get: obj => obj.runAfterRender, set: (obj, value) => { obj.runAfterRender = value; } }, metadata: _metadata }, _runAfterRender_initializers, _runAfterRender_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            DeesDemoWrapper = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        #runAfterRender_accessor_storage = __runInitializers(this, _runAfterRender_initializers, void 0);
        get runAfterRender() { return this.#runAfterRender_accessor_storage; }
        set runAfterRender(value) { this.#runAfterRender_accessor_storage = value; }
        static styles = [
            css `
      :host {
        display: contents;
      }
    `
        ];
        render() {
            return html `
      <slot></slot>
    `;
        }
        async firstUpdated() {
            await this.updateComplete;
            // Wait a bit for slotted content to render
            await new Promise(resolve => setTimeout(resolve, 50));
            // Check if there are slotted elements and runAfterRender is defined
            if (this.children.length > 0 && this.runAfterRender) {
                // Call the runAfterRender function with the wrapper element itself
                // Note: querySelector/querySelectorAll will work on slotted content
                // because slotted elements remain in the light DOM as children
                try {
                    await this.runAfterRender(this);
                }
                catch (error) {
                    console.error('Error in runAfterRender:', error);
                }
            }
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _runAfterRender_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return DeesDemoWrapper = _classThis;
})();
export { DeesDemoWrapper };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVtb3Rvb2xzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfZ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