import { getDefaultExportFromCjs } from '../../../../../../../../_virtual/_commonjsHelpers.mjs';
import '../../../../../../../../_virtual/mixin.mjs';
import { m as mixin } from '../../utils/mixin.mjs';

'use strict';

const Mixin = mixin;

class LocationInfoOpenElementStackMixin extends Mixin {
    constructor(stack, opts) {
        super(stack);

        this.onItemPop = opts.onItemPop;
    }

    _getOverriddenMethods(mxn, orig) {
        return {
            pop() {
                mxn.onItemPop(this.current);
                orig.pop.call(this);
            },

            popAllUpToHtmlElement() {
                for (let i = this.stackTop; i > 0; i--) {
                    mxn.onItemPop(this.items[i]);
                }

                orig.popAllUpToHtmlElement.call(this);
            },

            remove(element) {
                mxn.onItemPop(this.current);
                orig.remove.call(this, element);
            }
        };
    }
}

var openElementStackMixin = LocationInfoOpenElementStackMixin;

var openElementStackMixin_default = /*@__PURE__*/getDefaultExportFromCjs(openElementStackMixin);

export { openElementStackMixin_default as default, openElementStackMixin as o };
//# sourceMappingURL=open-element-stack-mixin.mjs.map
