YUI.add('widget-stdmod', function (Y, NAME) {

/**
 * Provides standard module support for Widgets through an extension.
 *
 * @module widget-stdmod
 */
    var L = Y.Lang,
        Node = Y.Node,
        UA = Y.UA,
        Widget = Y.Widget,

        EMPTY = "",
        HD = "hd",
        BD = "bd",
        FT = "ft",
        HEADER = "header",
        BODY = "body",
        FOOTER = "footer",
        FILL_HEIGHT = "fillHeight",
        STDMOD = "stdmod",

        NODE_SUFFIX = "Node",
        CONTENT_SUFFIX = "Content",

        FIRST_CHILD = "firstChild",
        CHILD_NODES = "childNodes",
        OWNER_DOCUMENT = "ownerDocument",

        CONTENT_BOX = "contentBox",

        HEIGHT = "height",
        OFFSET_HEIGHT = "offsetHeight",
        AUTO = "auto",

        HeaderChange = "headerContentChange",
        BodyChange = "bodyContentChange",
        FooterChange = "footerContentChange",
        FillHeightChange = "fillHeightChange",
        HeightChange = "heightChange",
        ContentUpdate = "contentUpdate",

        RENDERUI = "renderUI",
        BINDUI = "bindUI",
        SYNCUI = "syncUI",

        APPLY_PARSED_CONFIG = "_applyParsedConfig",

        UI = Y.Widget.UI_SRC;

    /**
     * Widget extension, which can be used to add Standard Module support to the
     * base Widget class, through the <a href="Base.html#method_build">Base.build</a>
     * method.
     * <p>
     * The extension adds header, body and footer sections to the Widget's content box and
     * provides the corresponding methods and attributes to modify the contents of these sections.
     * </p>
     * @class WidgetStdMod
     * @param {Object} The user configuration object
     */
    function StdMod(config) {}

    /**
     * Constant used to refer the the standard module header, in methods which expect a section specifier
     *
     * @property HEADER
     * @static
     * @type String
     */
    StdMod.HEADER = HEADER;

    /**
     * Constant used to refer the the standard module body, in methods which expect a section specifier
     *
     * @property BODY
     * @static
     * @type String
     */
    StdMod.BODY = BODY;

    /**
     * Constant used to refer the the standard module footer, in methods which expect a section specifier
     *
     * @property FOOTER
     * @static
     * @type String
     */
    StdMod.FOOTER = FOOTER;

    /**
     * Constant used to specify insertion position, when adding content to sections of the standard module in
     * methods which expect a "where" argument.
     * <p>
     * Inserts new content <em>before</em> the sections existing content.
     * </p>
     * @property AFTER
     * @static
     * @type String
     */
    StdMod.AFTER = "after";

    /**
     * Constant used to specify insertion position, when adding content to sections of the standard module in
     * methods which expect a "where" argument.
     * <p>
     * Inserts new content <em>before</em> the sections existing content.
     * </p>
     * @property BEFORE
     * @static
     * @type String
     */
    StdMod.BEFORE = "before";
    /**
     * Constant used to specify insertion position, when adding content to sections of the standard module in
     * methods which expect a "where" argument.
     * <p>
     * <em>Replaces</em> the sections existing content, with new content.
     * </p>
     * @property REPLACE
     * @static
     * @type String
     */
    StdMod.REPLACE = "replace";

    var STD_HEADER = StdMod.HEADER,
        STD_BODY = StdMod.BODY,
        STD_FOOTER = StdMod.FOOTER,

        HEADER_CONTENT = STD_HEADER + CONTENT_SUFFIX,
        FOOTER_CONTENT = STD_FOOTER + CONTENT_SUFFIX,
        BODY_CONTENT = STD_BODY + CONTENT_SUFFIX;

    /**
     * Static property used to define the default attribute
     * configuration introduced by WidgetStdMod.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    StdMod.ATTRS = {

        /**
         * @attribute headerContent
         * @type HTML
         * @default undefined
         * @description The content to be added to the header section. This will replace any existing content
         * in the header. If you want to append, or insert new content, use the <a href="#method_setStdModContent">setStdModContent</a> method.
         */
        headerContent: {
            value:null
        },

        /**
         * @attribute footerContent
         * @type HTML
         * @default undefined
         * @description The content to be added to the footer section. This will replace any existing content
         * in the footer. If you want to append, or insert new content, use the <a href="#method_setStdModContent">setStdModContent</a> method.
         */
        footerContent: {
            value:null
        },

        /**
         * @attribute bodyContent
         * @type HTML
         * @default undefined
         * @description The content to be added to the body section. This will replace any existing content
         * in the body. If you want to append, or insert new content, use the <a href="#method_setStdModContent">setStdModContent</a> method.
         */
        bodyContent: {
            value:null
        },

        /**
         * @attribute fillHeight
         * @type {String}
         * @default WidgetStdMod.BODY
         * @description The section (WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER) which should be resized to fill the height of the standard module, when a
         * height is set on the Widget. If a height is not set on the widget, then all sections are sized based on
         * their content.
         */
        fillHeight: {
            value: StdMod.BODY,
            validator: function(val) {
                 return this._validateFillHeight(val);
            }
        }
    };

    /**
     * The HTML parsing rules for the WidgetStdMod class.
     *
     * @property HTML_PARSER
     * @static
     * @type Object
     */
    StdMod.HTML_PARSER = {
        headerContent: function(contentBox) {
            return this._parseStdModHTML(STD_HEADER);
        },

        bodyContent: function(contentBox) {
            return this._parseStdModHTML(STD_BODY);
        },

        footerContent : function(contentBox) {
            return this._parseStdModHTML(STD_FOOTER);
        }
    };

    /**
     * Static hash of default class names used for the header,
     * body and footer sections of the standard module, keyed by
     * the section identifier (WidgetStdMod.STD_HEADER, WidgetStdMod.STD_BODY, WidgetStdMod.STD_FOOTER)
     *
     * @property SECTION_CLASS_NAMES
     * @static
     * @type Object
     */
    StdMod.SECTION_CLASS_NAMES = {
        header: Widget.getClassName(HD),
        body: Widget.getClassName(BD),
        footer: Widget.getClassName(FT)
    };

    /**
     * The template HTML strings for each of the standard module sections. Section entries are keyed by the section constants,
     * WidgetStdMod.HEADER, WidgetStdMod.BODY, WidgetStdMod.FOOTER, and contain the HTML to be added for each section.
     * e.g.
     * <pre>
     *    {
     *       header : '&lt;div class="yui-widget-hd"&gt;&lt;/div&gt;',
     *       body : '&lt;div class="yui-widget-bd"&gt;&lt;/div&gt;',
     *       footer : '&lt;div class="yui-widget-ft"&gt;&lt;/div&gt;'
     *    }
     * </pre>
     * @property TEMPLATES
     * @type Object
     * @static
     */
    StdMod.TEMPLATES = {
        header : '<div class="' + StdMod.SECTION_CLASS_NAMES[STD_HEADER] + '"></div>',
        body : '<div class="' + StdMod.SECTION_CLASS_NAMES[STD_BODY] + '"></div>',
        footer : '<div class="' + StdMod.SECTION_CLASS_NAMES[STD_FOOTER] + '"></div>'
    };

    StdMod.prototype = {

        initializer : function() {
            this._stdModNode = this.get(CONTENT_BOX);

            Y.before(this._renderUIStdMod, this, RENDERUI);
            Y.before(this._bindUIStdMod, this, BINDUI);
            Y.before(this._syncUIStdMod, this, SYNCUI);
        },

        /**
         * Synchronizes the UI to match the Widgets standard module state.
         * <p>
         * This method is invoked after syncUI is invoked for the Widget class
         * using YUI's aop infrastructure.
         * </p>
         * @method _syncUIStdMod
         * @protected
         */
        _syncUIStdMod : function() {
            var stdModParsed = this._stdModParsed;

            if (!stdModParsed || !stdModParsed[HEADER_CONTENT]) {
                this._uiSetStdMod(STD_HEADER, this.get(HEADER_CONTENT));
            }

            if (!stdModParsed || !stdModParsed[BODY_CONTENT]) {
                this._uiSetStdMod(STD_BODY, this.get(BODY_CONTENT));
            }

            if (!stdModParsed || !stdModParsed[FOOTER_CONTENT]) {
                this._uiSetStdMod(STD_FOOTER, this.get(FOOTER_CONTENT));
            }

            this._uiSetFillHeight(this.get(FILL_HEIGHT));
        },

        /**
         * Creates/Initializes the DOM for standard module support.
         * <p>
         * This method is invoked after renderUI is invoked for the Widget class
         * using YUI's aop infrastructure.
         * </p>
         * @method _renderUIStdMod
         * @protected
         */
        _renderUIStdMod : function() {
            this._stdModNode.addClass(Widget.getClassName(STDMOD));
            this._renderStdModSections();

            //This normally goes in bindUI but in order to allow setStdModContent() to work before renderUI
            //stage, these listeners should be set up at the earliest possible time.
            this.after(HeaderChange, this._afterHeaderChange);
            this.after(BodyChange, this._afterBodyChange);
            this.after(FooterChange, this._afterFooterChange);
        },

        _renderStdModSections : function() {
            if (L.isValue(this.get(HEADER_CONTENT))) { this._renderStdMod(STD_HEADER); }
            if (L.isValue(this.get(BODY_CONTENT))) { this._renderStdMod(STD_BODY); }
            if (L.isValue(this.get(FOOTER_CONTENT))) { this._renderStdMod(STD_FOOTER); }
        },

        /**
         * Binds event listeners responsible for updating the UI state in response to
         * Widget standard module related state changes.
         * <p>
         * This method is invoked after bindUI is invoked for the Widget class
         * using YUI's aop infrastructure.
         * </p>
         * @method _bindUIStdMod
         * @protected
         */
        _bindUIStdMod : function() {
            // this.after(HeaderChange, this._afterHeaderChange);
            // this.after(BodyChange, this._afterBodyChange);
            // this.after(FooterChange, this._afterFooterChange);

            this.after(FillHeightChange, this._afterFillHeightChange);
            this.after(HeightChange, this._fillHeight);
            this.after(ContentUpdate, this._fillHeight);
        },

        /**
         * Default attribute change listener for the headerContent attribute, responsible
         * for updating the UI, in response to attribute changes.
         *
         * @method _afterHeaderChange
         * @protected
         * @param {EventFacade} e The event facade for the attribute change
         */
        _afterHeaderChange : function(e) {
            if (e.src !== UI) {
                this._uiSetStdMod(STD_HEADER, e.newVal, e.stdModPosition);
            }
        },

        /**
         * Default attribute change listener for the bodyContent attribute, responsible
         * for updating the UI, in response to attribute changes.
         *
         * @method _afterBodyChange
         * @protected
         * @param {EventFacade} e The event facade for the attribute change
         */
        _afterBodyChange : function(e) {
            if (e.src !== UI) {
                this._uiSetStdMod(STD_BODY, e.newVal, e.stdModPosition);
            }
        },

        /**
         * Default attribute change listener for the footerContent attribute, responsible
         * for updating the UI, in response to attribute changes.
         *
         * @method _afterFooterChange
         * @protected
         * @param {EventFacade} e The event facade for the attribute change
         */
        _afterFooterChange : function(e) {
            if (e.src !== UI) {
                this._uiSetStdMod(STD_FOOTER, e.newVal, e.stdModPosition);
            }
        },

        /**
         * Default attribute change listener for the fillHeight attribute, responsible
         * for updating the UI, in response to attribute changes.
         *
         * @method _afterFillHeightChange
         * @protected
         * @param {EventFacade} e The event facade for the attribute change
         */
        _afterFillHeightChange: function (e) {
            this._uiSetFillHeight(e.newVal);
        },

        /**
         * Default validator for the fillHeight attribute. Verifies that the
         * value set is a valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER,
         * or a falsey value if fillHeight is to be disabled.
         *
         * @method _validateFillHeight
         * @protected
         * @param {String} val The section which should be setup to fill height, or false/null to disable fillHeight
         * @return true if valid, false if not
         */
        _validateFillHeight : function(val) {
            return !val || val == StdMod.BODY || val == StdMod.HEADER || val == StdMod.FOOTER;
        },

        /**
         * Updates the rendered UI, to resize the provided section so that the standard module fills out
         * the specified widget height. Note: This method does not check whether or not a height is set
         * on the Widget.
         *
         * @method _uiSetFillHeight
         * @protected
         * @param {String} fillSection A valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER
         */
        _uiSetFillHeight : function(fillSection) {
            var fillNode = this.getStdModNode(fillSection);
            var currNode = this._currFillNode;

            if (currNode && fillNode !== currNode){
                currNode.setStyle(HEIGHT, EMPTY);
            }

            if (fillNode) {
                this._currFillNode = fillNode;
            }

            this._fillHeight();
        },

        /**
         * Updates the rendered UI, to resize the current section specified by the fillHeight attribute, so
         * that the standard module fills out the Widget height. If a height has not been set on Widget,
         * the section is not resized (height is set to "auto").
         *
         * @method _fillHeight
         * @private
         */
        _fillHeight : function() {
            if (this.get(FILL_HEIGHT)) {
                var height = this.get(HEIGHT);
                if (height != EMPTY && height != AUTO) {
                    this.fillHeight(this.getStdModNode(this.get(FILL_HEIGHT)));
                }
            }
        },

        /**
         * Updates the rendered UI, adding the provided content (either an HTML string, or node reference),
         * to the specified section. The content is either added before, after or replaces existing content
         * in the section, based on the value of the <code>where</code> argument.
         *
         * @method _uiSetStdMod
         * @protected
         *
         * @param {String} section The section to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @param {String | Node} content The new content (either as an HTML string, or Node reference) to add to the section
         * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE.
         * If not provided, the content will replace existing content in the section.
         */
        _uiSetStdMod : function(section, content, where) {
            // Using isValue, so that "" is valid content
            if (L.isValue(content)) {
                var node = this.getStdModNode(section, true);

                this._addStdModContent(node, content, where);

                this.set(section + CONTENT_SUFFIX, this._getStdModContent(section), {src:UI});
            } else {
                this._eraseStdMod(section);
            }
            this.fire(ContentUpdate);
        },

        /**
         * Creates the DOM node for the given section, and inserts it into the correct location in the contentBox.
         *
         * @method _renderStdMod
         * @protected
         * @param {String} section The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @return {Node} A reference to the added section node
         */
        _renderStdMod : function(section) {

            var contentBox = this.get(CONTENT_BOX),
                sectionNode = this._findStdModSection(section);

            if (!sectionNode) {
                sectionNode = this._getStdModTemplate(section);
            }

            this._insertStdModSection(contentBox, section, sectionNode);

            this[section + NODE_SUFFIX] = sectionNode;
            return this[section + NODE_SUFFIX];
        },

        /**
         * Removes the DOM node for the given section.
         *
         * @method _eraseStdMod
         * @protected
         * @param {String} section The section to remove. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         */
        _eraseStdMod : function(section) {
            var sectionNode = this.getStdModNode(section);
            if (sectionNode) {
                sectionNode.remove(true);
                delete this[section + NODE_SUFFIX];
            }
        },

        /**
         * Helper method to insert the Node for the given section into the correct location in the contentBox.
         *
         * @method _insertStdModSection
         * @private
         * @param {Node} contentBox A reference to the Widgets content box.
         * @param {String} section The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @param {Node} sectionNode The Node for the section.
         */
        _insertStdModSection : function(contentBox, section, sectionNode) {
            var fc = contentBox.get(FIRST_CHILD);

            if (section === STD_FOOTER || !fc) {
                contentBox.appendChild(sectionNode);
            } else {
                if (section === STD_HEADER) {
                    contentBox.insertBefore(sectionNode, fc);
                } else {
                    var footer = this[STD_FOOTER + NODE_SUFFIX];
                    if (footer) {
                        contentBox.insertBefore(sectionNode, footer);
                    } else {
                        contentBox.appendChild(sectionNode);
                    }
                }
            }
        },

        /**
         * Gets a new Node reference for the given standard module section, by cloning
         * the stored template node.
         *
         * @method _getStdModTemplate
         * @protected
         * @param {String} section The section to create a new node for. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @return {Node} The new Node instance for the section
         */
        _getStdModTemplate : function(section) {
            return Node.create(StdMod.TEMPLATES[section], this._stdModNode.get(OWNER_DOCUMENT));
        },

        /**
         * Helper method to add content to a StdMod section node.
         * The content is added either before, after or replaces the existing node content
         * based on the value of the <code>where</code> argument.
         *
         * @method _addStdModContent
         * @private
         *
         * @param {Node} node The section Node to be updated.
         * @param {Node|NodeList|String} children The new content Node, NodeList or String to be added to section Node provided.
         * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE.
         * If not provided, the content will replace existing content in the Node.
         */
        _addStdModContent : function(node, children, where) {

            // StdMod where to Node where
            switch (where) {
                case StdMod.BEFORE:  // 0 is before fistChild
                    where = 0;
                    break;
                case StdMod.AFTER:   // undefined is appendChild
                    where = undefined;
                    break;
                default:            // replace is replace, not specified is replace
                    where = StdMod.REPLACE;
            }

            node.insert(children, where);
        },

        /**
         * Helper method to obtain the precise height of the node provided, including padding and border.
         * The height could be a sub-pixel value for certain browsers, such as Firefox 3.
         *
         * @method _getPreciseHeight
         * @private
         * @param {Node} node The node for which the precise height is required.
         * @return {Number} The height of the Node including borders and padding, possibly a float.
         */
        _getPreciseHeight : function(node) {
            var height = (node) ? node.get(OFFSET_HEIGHT) : 0,
                getBCR = "getBoundingClientRect";

            if (node && node.hasMethod(getBCR)) {
                var preciseRegion = node.invoke(getBCR);
                if (preciseRegion) {
                    height = preciseRegion.bottom - preciseRegion.top;
                }
            }

            return height;
        },

        /**
         * Helper method to to find the rendered node for the given section,
         * if it exists.
         *
         * @method _findStdModSection
         * @private
         * @param {String} section The section for which the render Node is to be found. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @return {Node} The rendered node for the given section, or null if not found.
         */
        _findStdModSection: function(section) {
            return this.get(CONTENT_BOX).one("> ." + StdMod.SECTION_CLASS_NAMES[section]);
        },

        /**
         * Utility method, used by WidgetStdMods HTML_PARSER implementation
         * to extract data for each section from markup.
         *
         * @method _parseStdModHTML
         * @private
         * @param {String} section
         * @return {String} Inner HTML string with the contents of the section
         */
        _parseStdModHTML : function(section) {

            var node = this._findStdModSection(section);

            if (node) {
                if (!this._stdModParsed) {
                    this._stdModParsed = {};
                    Y.before(this._applyStdModParsedConfig, this, APPLY_PARSED_CONFIG);
                }
                this._stdModParsed[section + CONTENT_SUFFIX] = 1;

                return node.get("innerHTML");
            }

            return null;
        },

        /**
         * This method is injected before the _applyParsedConfig step in
         * the application of HTML_PARSER, and sets up the state to
         * identify whether or not we should remove the current DOM content
         * or not, based on whether or not the current content attribute value
         * was extracted from the DOM, or provided by the user configuration
         *
         * @method _applyStdModParsedConfig
         * @private
         */
        _applyStdModParsedConfig : function(node, cfg, parsedCfg) {
            var parsed = this._stdModParsed;
            if (parsed) {
                parsed[HEADER_CONTENT] = !(HEADER_CONTENT in cfg) && (HEADER_CONTENT in parsed);
                parsed[BODY_CONTENT] = !(BODY_CONTENT in cfg) && (BODY_CONTENT in parsed);
                parsed[FOOTER_CONTENT] = !(FOOTER_CONTENT in cfg) && (FOOTER_CONTENT in parsed);
            }
        },

        /**
         * Retrieves the child nodes (content) of a standard module section
         *
         * @method _getStdModContent
         * @private
         * @param {String} section The standard module section whose child nodes are to be retrieved. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @return {Node} The child node collection of the standard module section.
         */
        _getStdModContent : function(section) {
            return (this[section + NODE_SUFFIX]) ? this[section + NODE_SUFFIX].get(CHILD_NODES) : null;
        },

        /**
         * Updates the body section of the standard module with the content provided (either an HTML string, or node reference).
         * <p>
         * This method can be used instead of the corresponding section content attribute if you'd like to retain the current content of the section,
         * and insert content before or after it, by specifying the <code>where</code> argument.
         * </p>
         * @method setStdModContent
         * @param {String} section The standard module section whose content is to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.
         * @param {String | Node} content The content to be added, either an HTML string or a Node reference.
         * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE.
         * If not provided, the content will replace existing content in the section.
         */
        setStdModContent : function(section, content, where) {
            //var node = this.getStdModNode(section) || this._renderStdMod(section);
            this.set(section + CONTENT_SUFFIX, content, {stdModPosition:where});
            //this._addStdModContent(node, content, where);
        },

        /**
        Returns the node reference for the specified `section`.

        **Note:** The DOM is not queried for the node reference. The reference
        stored by the widget instance is returned if it was set. Passing a
        truthy for `forceCreate` will create the section node if it does not
        already exist.

        @method getStdModNode
        @param {String} section The section whose node reference is required.
            Either `WidgetStdMod.HEADER`, `WidgetStdMod.BODY`, or
            `WidgetStdMod.FOOTER`.
        @param {Boolean} forceCreate Whether the section node should be created
            if it does not already exist.
        @return {Node} The node reference for the `section`, or null if not set.
        **/
        getStdModNode : function(section, forceCreate) {
            var node = this[section + NODE_SUFFIX] || null;

            if (!node && forceCreate) {
                node = this._renderStdMod(section);
            }

            return node;
        },

        /**
         * Sets the height on the provided header, body or footer element to
         * fill out the height of the Widget. It determines the height of the
         * widgets bounding box, based on it's configured height value, and
         * sets the height of the provided section to fill out any
         * space remaining after the other standard module section heights
         * have been accounted for.
         *
         * <p><strong>NOTE:</strong> This method is not designed to work if an explicit
         * height has not been set on the Widget, since for an "auto" height Widget,
         * the heights of the header/body/footer will drive the height of the Widget.</p>
         *
         * @method fillHeight
         * @param {Node} node The node which should be resized to fill out the height
         * of the Widget bounding box. Should be a standard module section node which belongs
         * to the widget.
         */
        fillHeight : function(node) {
            if (node) {
                var contentBox = this.get(CONTENT_BOX),
                    stdModNodes = [this.headerNode, this.bodyNode, this.footerNode],
                    stdModNode,
                    cbContentHeight,
                    filled = 0,
                    remaining = 0,

                    validNode = false;

                for (var i = 0, l = stdModNodes.length; i < l; i++) {
                    stdModNode = stdModNodes[i];
                    if (stdModNode) {
                        if (stdModNode !== node) {
                            filled += this._getPreciseHeight(stdModNode);
                        } else {
                            validNode = true;
                        }
                    }
                }

                if (validNode) {
                    if (UA.ie || UA.opera) {
                        // Need to set height to 0, to allow height to be reduced
                        node.set(OFFSET_HEIGHT, 0);
                    }

                    cbContentHeight = contentBox.get(OFFSET_HEIGHT) -
                            parseInt(contentBox.getComputedStyle("paddingTop"), 10) -
                            parseInt(contentBox.getComputedStyle("paddingBottom"), 10) -
                            parseInt(contentBox.getComputedStyle("borderBottomWidth"), 10) -
                            parseInt(contentBox.getComputedStyle("borderTopWidth"), 10);

                    if (L.isNumber(cbContentHeight)) {
                        remaining = cbContentHeight - filled;
                        if (remaining >= 0) {
                            node.set(OFFSET_HEIGHT, remaining);
                        }
                    }
                }
            }
        }
    };

    Y.WidgetStdMod = StdMod;


}, 'patched-v3.18.1', {"requires": ["base-build", "widget"]});

YUI.add('aui-aria', function (A, NAME) {

/**
 * The Aria Component.
 *
 * @module aui-aria
 */

var Lang = A.Lang,
    isBoolean = Lang.isBoolean,
    isFunction = Lang.isFunction,
    isObject = Lang.isObject,
    isString = Lang.isString,
    STR_REGEX = /([^a-z])/ig,

    _toAriaRole = A.cached(function(str) {
        return str.replace(STR_REGEX, function() {
            return '';
        }).toLowerCase();
    });

/**
 * A base class for Aria.
 *
 * @class A.Plugin.Aria
 * @extends Plugin.Base
 * @param {Object} config Object literal specifying widget configuration
 *     properties.
 * @constructor
 */
var Aria = A.Component.create({

    /**
     * Static property provides a string to identify the class.
     *
     * @property NAME
     * @type String
     * @static
     */
    NAME: 'aria',

    /**
     * Static property provides a string to identify the namespace.
     *
     * @property NS
     * @type String
     * @static
     */
    NS: 'aria',

    /**
     * Static property used to define the default attribute configuration for
     * the `A.Aria`.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    ATTRS: {

        /**
         * The ARIA attributes collection.
         *
         * @attribute attributes
         * @default {}
         * @type Object
         */
        attributes: {
            value: {},
            validator: isObject
        },

        /**
         * The ARIA attribute value format.
         *
         * @attribute attributeValueFormat
         * @type Function
         */
        attributeValueFormat: {
            value: function(val) {
                return val;
            },
            validator: isFunction
        },

        /**
         * Node container for the ARIA attribute.
         *
         * @attribute attributeNode
         * @writeOnce
         */
        attributeNode: {
            writeOnce: true,
            setter: A.one,
            valueFn: function() {
                return this.get('host').get('boundingBox');
            }
        },

        /**
         * The ARIA role name.
         *
         * @attribute roleName
         * @type String
         */
        roleName: {
            valueFn: function() {
                var instance = this;
                var host = instance.get('host');
                var roleName = _toAriaRole(host.constructor.NAME || '');

                return (instance.isValidRole(roleName) ? roleName : '');
            },
            validator: isString
        },

        /**
         * Node container for the ARIA role.
         *
         * @attribute roleNode
         * @writeOnce
         */
        roleNode: {
            writeOnce: true,
            setter: A.one,
            valueFn: function() {
                return this.get('host').get('boundingBox');
            }
        },

        /**
         * Checks if the attribute is valid with W3C rules.
         *
         * @attribute validateW3C
         * @default true
         * @type Boolean
         */
        validateW3C: {
            value: true,
            validator: isBoolean
        }
    },

    /**
     * Static property used to define which component it extends.
     *
     * @property EXTENDS
     * @type Object
     * @static
     */
    EXTENDS: A.Plugin.Base,

    prototype: {

        /**
         * Construction logic executed during Aria instantiation. Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function() {
            var instance = this;

            instance.publish('aria:processAttribute', {
                defaultFn: instance._defProcessFn,
                queuable: false,
                emitFacade: true,
                bubbles: true,
                prefix: 'aria'
            });

            instance._uiSetRoleName(
                instance.get('roleName')
            );

            instance.after('roleNameChange', instance._afterRoleNameChange);

            instance._bindHostAttributes();
        },

        /**
         * Checks if the ARIA attribute is valid.
         *
         * @method isValidAttribute
         * @param attrName
         * @return {Boolean}
         */
        isValidAttribute: function(attrName) {
            var instance = this;

            return (instance.get('validateW3C') ? A.Plugin.Aria.W3C_ATTRIBUTES[attrName] : true);
        },

        /**
         * Checks if the ARIA role is valid.
         *
         * @method isValidRole
         * @param roleName
         * @return {Boolean}
         */
        isValidRole: function(roleName) {
            var instance = this;

            return (instance.get('validateW3C') ? A.Plugin.Aria.W3C_ROLES[roleName] : true);
        },

        /**
         * Set a single ARIA attribute.
         *
         * @method setAttribute
         * @param attrName
         * @param attrValue
         * @param node
         * @return {Boolean}
         */
        setAttribute: function(attrName, attrValue, node) {
            var instance = this;

            if (instance.isValidAttribute(attrName)) {
                (node || instance.get('attributeNode')).set('aria-' + attrName, attrValue);

                return true;
            }

            return false;
        },

        /**
         * Set a list of ARIA attributes.
         *
         * @method setAttributes
         * @param attributes
         */
        setAttributes: function(attributes) {
            var instance = this;

            A.Array.each(attributes, function(attribute) {
                instance.setAttribute(attribute.name, attribute.value, attribute.node);
            });
        },

        /**
         * Set a single ARIA role.
         *
         * @method setRole
         * @param roleName
         * @param node
         * @return {Boolean}
         */
        setRole: function(roleName, node) {
            var instance = this;

            if (instance.isValidRole(roleName)) {
                (node || instance.get('roleNode')).set('role', roleName);

                return true;
            }

            return false;
        },

        /**
         * Set a list of ARIA roles.
         *
         * @method setRoles
         * @param roles
         */
        setRoles: function(roles) {
            var instance = this;

            A.Array.each(roles, function(role) {
                instance.setRole(role.name, role.node);
            });
        },

        /**
         * Fires after a host attribute change.
         *
         * @method _afterHostAttributeChange
         * @param event
         * @protected
         */
        _afterHostAttributeChange: function(event) {
            var instance = this;

            instance._handleProcessAttribute(event);
        },

        /**
         * Triggers after `roleName` attribute change.
         *
         * @method _afterRoleNameChange
         * @param event
         * @protected
         */
        _afterRoleNameChange: function(event) {
            var instance = this;

            instance._uiSetRoleName(event.newVal);
        },

        /**
         * Bind the list of host attributes.
         *
         * @method _bindHostAttributes
         * @protected
         */
        _bindHostAttributes: function() {
            var instance = this;
            var attributes = instance.get('attributes');

            A.each(attributes, function(aria, attrName) {
                var ariaAttr = instance._getAriaAttribute(aria, attrName);

                instance._handleProcessAttribute({
                    aria: ariaAttr
                });

                instance.afterHostEvent(attrName + 'Change', function(event) {
                    event.aria = ariaAttr;
                    instance._afterHostAttributeChange(event);
                });
            });
        },

        /**
         * Calls the `_setAttribute` method.
         *
         * @method _defProcessFn
         * @param event
         * @protected
         */
        _defProcessFn: function(event) {
            var instance = this;

            instance._setAttribute(event.aria);
        },

        /**
         * Get the ARIA attribute.
         *
         * @method _getAriaAttribute
         * @param aria
         * @param attrName
         * @protected
         * @return {Object}
         */
        _getAriaAttribute: function(aria, attrName) {
            var instance = this;
            var attributeValueFormat = instance.get('attributeValueFormat');
            var prepared = {};

            if (isString(aria)) {
                prepared = A.merge(prepared, {
                    ariaName: aria,
                    attrName: attrName,
                    format: attributeValueFormat,
                    node: null
                });
            }
            else if (isObject(aria)) {
                prepared = A.mix(aria, {
                    ariaName: '',
                    attrName: attrName,
                    format: attributeValueFormat,
                    node: null
                });
            }

            return prepared;
        },

        /**
         * Fires ARIA process attribute event handle.
         *
         * @method _handleProcessAttribute
         * @param event
         * @protected
         */
        _handleProcessAttribute: function(event) {
            var instance = this;

            instance.fire('aria:processAttribute', {
                aria: event.aria
            });
        },

        /**
         * Set the attribute in the DOM.
         *
         * @method _setAttribute
         * @param ariaAttr
         * @protected
         */
        _setAttribute: function(ariaAttr) {
            var instance = this;
            var host = instance.get('host');
            var attrValue = host.get(ariaAttr.attrName);
            var attrNode = ariaAttr.node;

            if (isFunction(attrNode)) {
                attrNode = attrNode.apply(instance, [ariaAttr]);
            }

            instance.setAttribute(
                ariaAttr.ariaName,
                ariaAttr.format.apply(instance, [attrValue, ariaAttr]),
                attrNode
            );
        },

        /**
         * Set the `roleName` attribute on the UI.
         *
         * @method _uiSetRoleName
         * @param val
         * @protected
         */
        _uiSetRoleName: function(val) {
            var instance = this;

            instance.setRole(val);
        }
    }
});

A.Plugin.Aria = Aria;
/**
 * Static property used to define [W3C's Roles Model](http://www.w3.org/TR/wai-
 * aria/roles).
 *
 * @property W3C_ROLES
 * @type Object
 * @static
 */
A.Plugin.Aria.W3C_ROLES = {
    'alert': 1,
    'alertdialog': 1,
    'application': 1,
    'article': 1,
    'banner': 1,
    'button': 1,
    'checkbox': 1,
    'columnheader': 1,
    'combobox': 1,
    'command': 1,
    'complementary': 1,
    'composite': 1,
    'contentinfo': 1,
    'definition': 1,
    'dialog': 1,
    'directory': 1,
    'document': 1,
    'form': 1,
    'grid': 1,
    'gridcell': 1,
    'group': 1,
    'heading': 1,
    'img': 1,
    'input': 1,
    'landmark': 1,
    'link': 1,
    'list': 1,
    'listbox': 1,
    'listitem': 1,
    'log': 1,
    'main': 1,
    'marquee': 1,
    'math': 1,
    'menu': 1,
    'menubar': 1,
    'menuitem': 1,
    'menuitemcheckbox': 1,
    'menuitemradio': 1,
    'navigation': 1,
    'note': 1,
    'option': 1,
    'presentation': 1,
    'progressbar': 1,
    'radio': 1,
    'radiogroup': 1,
    'range': 1,
    'region': 1,
    'roletype': 1,
    'row': 1,
    'rowheader': 1,
    'scrollbar': 1,
    'search': 1,
    'section': 1,
    'sectionhead': 1,
    'select': 1,
    'separator': 1,
    'slider': 1,
    'spinbutton': 1,
    'status': 1,
    'structure': 1,
    'tab': 1,
    'tablist': 1,
    'tabpanel': 1,
    'textbox': 1,
    'timer': 1,
    'toolbar': 1,
    'tooltip': 1,
    'tree': 1,
    'treegrid': 1,
    'treeitem': 1,
    'widget': 1,
    'window': 1
};
/**
 * Static property used to define [W3C's Supported States and
 * Properties](http://www.w3.org/TR/wai-aria/states_and_properties).
 *
 * @property W3C_ATTRIBUTES
 * @type Object
 * @static
 */
A.Plugin.Aria.W3C_ATTRIBUTES = {
    'activedescendant': 1,
    'atomic': 1,
    'autocomplete': 1,
    'busy': 1,
    'checked': 1,
    'controls': 1,
    'describedby': 1,
    'disabled': 1,
    'dropeffect': 1,
    'expanded': 1,
    'flowto': 1,
    'grabbed': 1,
    'haspopup': 1,
    'hidden': 1,
    'invalid': 1,
    'label': 1,
    'labelledby': 1,
    'level': 1,
    'live': 1,
    'multiline': 1,
    'multiselectable': 1,
    'orientation': 1,
    'owns': 1,
    'posinset': 1,
    'pressed': 1,
    'readonly': 1,
    'relevant': 1,
    'required': 1,
    'selected': 1,
    'setsize': 1,
    'sort': 1,
    'valuemax': 1,
    'valuemin': 1,
    'valuenow': 1,
    'valuetext': 1
};


}, '3.1.0-deprecated.76', {"requires": ["plugin", "aui-component"]});

YUI.add('aui-io-plugin-deprecated', function (A, NAME) {

/**
 * The IOPlugin Utility - When plugged to a Node or Widget loads the content
 * of a URI and set as its content, parsing the <code>script</code> tags if
 * present on the code.
 *
 * @module aui-io
 * @submodule aui-io-plugin
 */

var L = A.Lang,
    isBoolean = L.isBoolean,
    isString = L.isString,

    isNode = function(v) {
        return (v instanceof A.Node);
    },

    StdMod = A.WidgetStdMod,

    TYPE_NODE = 'Node',
    TYPE_WIDGET = 'Widget',

    EMPTY = '',
    FAILURE = 'failure',
    FAILURE_MESSAGE = 'failureMessage',
    HOST = 'host',
    ICON = 'icon',
    IO = 'io',
    IO_PLUGIN = 'IOPlugin',
    LOADING = 'loading',
    LOADING_MASK = 'loadingMask',
    NODE = 'node',
    OUTER = 'outer',
    PARSE_CONTENT = 'parseContent',
    QUEUE = 'queue',
    RENDERED = 'rendered',
    SECTION = 'section',
    SHOW_LOADING = 'showLoading',
    SUCCESS = 'success',
    TYPE = 'type',
    WHERE = 'where',

    getCN = A.getClassName,

    CSS_ICON_LOADING = getCN(ICON, LOADING);

/**
 * A base class for IOPlugin, providing:
 * <ul>
 *    <li>Loads the content of a URI as content of a Node or Widget</li>
 *    <li>Use <a href="ParseContent.html">ParseContent</a> to parse the JavaScript tags from the content and evaluate them</li>
 * </ul>
 *
 * Quick Example:<br/>
 *
 * <pre><code>A.one('#content').plug(A.Plugin.IO, { uri: 'assets/content.html', method: 'GET' });</code></pre>
 *
 * Check the list of <a href="A.Plugin.IO.html#configattributes">Configuration Attributes</a> available for
 * IOPlugin.
 *
 * @param config {Object} Object literal specifying widget configuration properties.
 *
 * @class A.Plugin.IO
 * @constructor
 * @extends IORequest
 */
var IOPlugin = A.Component.create({
    /**
     * Static property provides a string to identify the class.
     *
     * @property A.Plugin.IO.NAME
     * @type String
     * @static
     */
    NAME: IO_PLUGIN,

    /**
     * Static property provides a string to identify the namespace.
     *
     * @property A.Plugin.IO.NS
     * @type String
     * @static
     */
    NS: IO,

    /**
     * Static property used to define the default attribute
     * configuration for the A.Plugin.IO.
     *
     * @property A.Plugin.IO.ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * Plug IO in any object we want, the setContent will use the node to
         * set the content.
         *
         * @attribute node
         * @default null
         * @type Node | String
         */
        node: {
            value: null,
            getter: function(value) {
                var instance = this;

                if (!value) {
                    var host = instance.get(HOST);
                    var type = instance.get(TYPE);

                    if (type == TYPE_NODE) {
                        value = host;
                    }
                    else if (type == TYPE_WIDGET) {
                        var section = instance.get(SECTION);

                        // if there is no node for the SECTION, forces creation
                        if (!host.getStdModNode(section)) {
                            host.setStdModContent(section, EMPTY);
                        }

                        value = host.getStdModNode(section);
                    }
                }

                return A.one(value);
            },
            validator: isNode
        },

        /**
         * Message to be set on the content when the transaction fails.
         *
         * @attribute failureMessage
         * @default 'Failed to retrieve content'
         * @type String
         */
        failureMessage: {
            value: 'Failed to retrieve content',
            validator: isString
        },

        /**
         * Options passed to the <a href="LoadingMask.html">LoadingMask</a>.
         *
         * @attribute loadingMask
         * @default {}
         * @type Object
         */
        loadingMask: {
            value: {}
        },

        /**
         * If true the <a href="ParseContent.html">ParseContent</a> plugin
         * will be plugged to the <a href="A.Plugin.IO.html#config_node">node</a>.
         *
         * @attribute parseContent
         * @default true
         * @type boolean
         */
        parseContent: {
            value: true,
            validator: isBoolean
        },

        /**
         * Show the <a href="LoadingMask.html">LoadingMask</a> covering the <a
         * href="A.Plugin.IO.html#config_node">node</a> while loading.
         *
         * @attribute showLoading
         * @default true
         * @type boolean
         */
        showLoading: {
            value: true,
            validator: isBoolean
        },

        /**
         * Section where the content will be set in case you are plugging it
         * on a instace of <a href="WidgetStdMod.html">WidgetStdMod</a>.
         *
         * @attribute section
         * @default StdMod.BODY
         * @type String
         */
        section: {
            value: StdMod.BODY,
            validator: function(val) {
                return (!val || val == StdMod.BODY || val == StdMod.HEADER || val == StdMod.FOOTER);
            }
        },

        /**
         * Type of the <code>instance</code> we are pluggin the A.Plugin.IO.
         * Could be a Node, or a Widget.
         *
         * @attribute type
         * @default 'Node'
         * @readOnly
         * @type String
         */
        type: {
            readOnly: true,
            valueFn: function() {
                var instance = this;
                // NOTE: default type
                var type = TYPE_NODE;

                if (instance.get(HOST) instanceof A.Widget) {
                    type = TYPE_WIDGET;
                }

                return type;
            },
            validator: isString
        },

        /**
         * Where to insert the content, AFTER, BEFORE or REPLACE. If you're plugging a Node, there is a fourth option called OUTER that will not only replace the entire node itself. This is different from REPLACE, in that REPLACE will replace the *contents* of the node, OUTER will replace the entire Node itself.
         *
         * @attribute where
         * @default StdMod.REPLACE
         * @type String
         */
        where: {
            value: StdMod.REPLACE,
            validator: function(val) {
                return (!val || val == StdMod.AFTER || val == StdMod.BEFORE || val == StdMod.REPLACE || val ==
                    OUTER);
            }
        }
    },

    EXTENDS: A.IORequest,

    prototype: {
        /**
         * Bind the events on the A.Plugin.IO UI. Lifecycle.
         *
         * @method bindUI
         * @protected
         */
        bindUI: function() {
            var instance = this;

            instance.on('activeChange', instance._onActiveChange);

            instance.on(SUCCESS, instance._successHandler);
            instance.on(FAILURE, instance._failureHandler);

            if ((instance.get(TYPE) == TYPE_WIDGET) && instance.get(SHOW_LOADING)) {
                var host = instance.get(HOST);

                host.after('heightChange', instance._syncLoadingMaskUI, instance);
                host.after('widthChange', instance._syncLoadingMaskUI, instance);
            }
        },

        /**
         * Invoke the <code>start</code> method (autoLoad attribute).
         *
         * @method _autoStart
         * @protected
         */
        _autoStart: function() {
            var instance = this;

            instance.bindUI();

            IOPlugin.superclass._autoStart.apply(this, arguments);
        },

        /**
         * Bind the ParseContent plugin on the <code>instance</code>.
         *
         * @method _bindParseContent
         * @protected
         */
        _bindParseContent: function() {
            var instance = this;
            var node = instance.get(NODE);

            if (node && !node.ParseContent && instance.get(PARSE_CONTENT)) {
                node.plug(A.Plugin.ParseContent);
            }
        },

        /**
         * Invoke the <a href="OverlayMask.html#method_hide">OverlayMask hide</a> method.
         *
         * @method hideLoading
         */
        hideLoading: function() {
            var instance = this;

            var node = instance.get(NODE);

            if (node.loadingmask) {
                node.loadingmask.hide();
            }
        },

        /**
         * Set the content of the <a href="A.Plugin.IO.html#config_node">node</a>.
         *
         * @method setContent
         */
        setContent: function(content) {
            var instance = this;

            instance._bindParseContent();

            instance._getContentSetterByType().apply(instance, [content]);

            if (instance.overlayMaskBoundingBox) {
                instance.overlayMaskBoundingBox.remove();
            }
        },

        /**
         * Invoke the <a href="OverlayMask.html#method_show">OverlayMask show</a> method.
         *
         * @method showLoading
         */
        showLoading: function() {
            var instance = this;
            var node = instance.get(NODE);

            if (node.loadingmask) {
                if (instance.overlayMaskBoundingBox) {
                    node.append(instance.overlayMaskBoundingBox);
                }
            }
            else {
                node.plug(
                    A.LoadingMask,
                    instance.get(LOADING_MASK)
                );

                instance.overlayMaskBoundingBox = node.loadingmask.overlayMask.get('boundingBox');
            }

            node.loadingmask.show();
        },

        /**
         * Overload to the <a href="IORequest.html#method_start">IORequest
         * start</a> method. Check if the <code>host</code> is already rendered,
         * otherwise wait to after render phase and to show the LoadingMask.
         *
         * @method start
         */
        start: function() {
            var instance = this;
            var host = instance.get(HOST);

            if (!host.get(RENDERED)) {
                host.after('render', function() {
                    instance._setLoadingUI(true);
                });
            }

            IOPlugin.superclass.start.apply(instance, arguments);
        },

        /**
         * Get the appropriated <a
         * href="A.Plugin.IO.html#method_setContent">setContent</a> function
         * implementation for each <a href="A.Plugin.IO.html#config_type">type</a>.
         *
         * @method _getContentSetterByType
         * @protected
         * @return {function}
         */
        _getContentSetterByType: function() {
            var instance = this;

            var setters = {
                // NOTE: default setter, see 'type' attribute definition
                Node: function(content) {
                    var instance = this;
                    // when this.get(HOST) is a Node instance the NODE is the host
                    var node = instance.get(NODE);

                    if (content instanceof A.NodeList) {
                        content = content.toFrag();
                    }

                    if (content instanceof A.Node) {
                        content = content._node;
                    }

                    var where = instance.get(WHERE);

                    if (where == OUTER) {
                        node.replace(content);
                    }
                    else {
                        node.insert(content, where);
                    }
                },

                // Widget forces set the content on the SECTION node using setStdModContent method
                Widget: function(content) {
                    var instance = this;
                    var host = instance.get(HOST);

                    host.setStdModContent.apply(host, [
       instance.get(SECTION),
       content,
       instance.get(WHERE)
      ]);
                }
            };

            return setters[this.get(TYPE)];
        },

        /**
         * Whether the <code>show</code> is true show the LoadingMask.
         *
         * @method _setLoadingUI
         * @param {boolean} show
         * @protected
         */
        _setLoadingUI: function(show) {
            var instance = this;

            if (instance.get(SHOW_LOADING)) {
                if (show) {
                    instance.showLoading();
                }
                else {
                    instance.hideLoading();
                }
            }
        },

        /**
         * Sync the loading mask UI.
         *
         * @method _syncLoadingMaskUI
         * @protected
         */
        _syncLoadingMaskUI: function() {
            var instance = this;

            instance.get(NODE).loadingmask.refreshMask();
        },

        /**
         * Internal success callback for the IO transaction.
         *
         * @method _successHandler
         * @param {EventFavade} event
         * @param {String} id Id of the IO transaction.
         * @param {Object} obj XHR transaction Object.
         * @protected
         */
        _successHandler: function(event, id, xhr) {
            var instance = this;

            instance.setContent(
                this.get('responseData')
            );
        },

        /**
         * Internal failure callback for the IO transaction.
         *
         * @method _failureHandler
         * @param {EventFavade} event
         * @param {String} id Id of the IO transaction.
         * @param {Object} obj XHR transaction Object.
         * @protected
         */
        _failureHandler: function(event, id, xhr) {
            var instance = this;

            instance.setContent(
                instance.get(FAILURE_MESSAGE)
            );
        },

        /**
         * Fires after the value of the
         * <a href="A.Plugin.IO.html#config_active">active</a> attribute change.
         *
         * @method _onActiveChange
         * @param {EventFacade} event
         * @protected
         */
        _onActiveChange: function(event) {
            var instance = this;
            var host = instance.get(HOST);
            var widget = instance.get(TYPE) == TYPE_WIDGET;

            if (!widget || (widget && host && host.get(RENDERED))) {
                instance._setLoadingUI(event.newVal);
            }
        }
    }
});

A.Node.prototype.load = function(uri, config, callback) {
    var instance = this;

    var index = uri.indexOf(' ');
    var selector;

    if (index > 0) {
        selector = uri.slice(index, uri.length);

        uri = uri.slice(0, index);
    }

    if (L.isFunction(config)) {
        callback = config;
        config = null;
    }

    config = config || {};

    if (callback) {
        config.after = config.after || {};

        config.after.success = callback;
    }

    var where = config.where;

    config.uri = uri;
    config.where = where;

    if (selector) {
        config.selector = selector;
        config.where = where || 'replace';
    }

    instance.plug(A.Plugin.IO, config);

    return instance;
};

A.namespace('Plugin').IO = IOPlugin;


}, '3.1.0-deprecated.76', {
    "requires": [
        "aui-overlay-base-deprecated",
        "aui-parse-content",
        "aui-io-request",
        "aui-loading-mask-deprecated"
    ]
});

YUI.add('aui-io-request', function (A, NAME) {

/**
 * The IORequest Utility - Provides response data normalization for 'xml', 'json',
 * JavaScript and cache option.
 *
 * @module aui-io
 * @submodule aui-io-request
 */

var L = A.Lang,
    isBoolean = L.isBoolean,
    isFunction = L.isFunction,
    isString = L.isString,

    defaults = A.namespace('config.io'),

    getDefault = function(attr) {
        return function() {
            return defaults[attr];
        };
    },

    ACCEPTS = {
        all: '*/*',
        html: 'text/html',
        json: 'application/json, text/javascript',
        text: 'text/plain',
        xml: 'application/xml, text/xml'
    };

/**
 * A base class for IORequest, providing:
 *
 * - Response data normalization for XML, JSON, JavaScript
 * - Cache options
 *
 * Check the [live demo](http://alloyui.com/examples/io/).
 *
 * @class A.IORequest
 * @extends Plugin.Base
 * @param {Object} config Object literal specifying widget configuration
 *     properties.
 * @uses io
 * @constructor
 * @include http://alloyui.com/examples/io/basic.js
 */
var IORequest = A.Component.create({
    /**
     * Static property provides a string to identify the class.
     *
     * @property NAME
     * @type String
     * @static
     */
    NAME: 'IORequest',

    /**
     * Static property used to define the default attribute
     * configuration for the IORequest.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    ATTRS: {

        /**
         * If `true` invoke the [start](A.IORequest.html#method_start) method
         * automatically, initializing the IO transaction.
         *
         * @attribute autoLoad
         * @default true
         * @type Boolean
         */
        autoLoad: {
            value: true,
            validator: isBoolean
        },

        /**
         * If `false` the current timestamp will be appended to the
         * url, avoiding the url to be cached.
         *
         * @attribute cache
         * @default true
         * @type Boolean
         */
        cache: {
            value: true,
            validator: isBoolean
        },

        /**
         * The type of the request (i.e., could be xml, json, javascript, text).
         *
         * @attribute dataType
         * @default null
         * @type String
         */
        dataType: {
            setter: function(v) {
                return (v || '').toLowerCase();
            },
            value: null,
            validator: isString
        },

        /**
         * This is a normalized attribute for the response data. It's useful to
         * retrieve the correct type for the
         * [dataType](A.IORequest.html#attr_dataType) (i.e., in json requests
         * the `responseData`) is a JSONObject.
         *
         * @attribute responseData
         * @default null
         * @type String | JSONObject | XMLDocument
         */
        responseData: {
            setter: function(v) {
                return this._setResponseData(v);
            },
            value: null
        },

        /**
         * URI to be requested using AJAX.
         *
         * @attribute uri
         * @default null
         * @type String
         */
        uri: {
            setter: function(v) {
                return this._parseURL(v);
            },
            value: null,
            validator: isString
        },

        // User readOnly variables

        /**
         * Whether the transaction is active or not.
         *
         * @attribute active
         * @default false
         * @type Boolean
         */
        active: {
            value: false,
            validator: isBoolean
        },

        /**
         * Object containing all the [IO Configuration Attributes](A.io.html).
         * This Object is passed to the `A.io` internally.
         *
         * @attribute cfg
         * @default Object containing all the [IO Configuration
         *     Attributes](A.io.html).
         * @readOnly
         * @type String
         */
        cfg: {
            getter: function() {
                var instance = this;

                // keep the current cfg object always synchronized with the
                // mapped public attributes when the user call .start() it
                // always retrieve the last set values for each mapped attr
                return {
                    arguments: instance.get('arguments'),
                    context: instance.get('context'),
                    data: instance.getFormattedData(),
                    form: instance.get('form'),
                    headers: instance.get('headers'),
                    method: instance.get('method'),
                    on: {
                        complete: A.bind(instance.fire, instance, 'complete'),
                        end: A.bind(instance._end, instance),
                        failure: A.bind(instance.fire, instance, 'failure'),
                        start: A.bind(instance.fire, instance, 'start'),
                        success: A.bind(instance._success, instance)
                    },
                    sync: instance.get('sync'),
                    timeout: instance.get('timeout'),
                    xdr: instance.get('xdr')
                };
            },
            readOnly: true
        },

        /**
         * Stores the IO Object of the current transaction.
         *
         * @attribute transaction
         * @default null
         * @type Object
         */
        transaction: {
            value: null
        },

        // Configuration Object mapping
        // To take advantages of the Attribute listeners of A.Base
        // See: http://yuilibrary.com/yui/docs/io/

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute arguments
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Object
         */
        arguments: {
            valueFn: getDefault('arguments')
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute context
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Object
         */
        context: {
            valueFn: getDefault('context')
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute data
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Object
         */
        data: {
            valueFn: getDefault('data')
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute form
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Object
         */
        form: {
            valueFn: getDefault('form')
        },

        /**
         * Set the correct ACCEPT header based on the dataType.
         *
         * @attribute headers
         * @default Object
         * @type Object
         */
        headers: {
            getter: function(value) {
                var header = [];
                var instance = this;
                var dataType = instance.get('dataType');

                if (dataType) {
                    header.push(
                        ACCEPTS[dataType]
                    );
                }

                // always add *.* to the accept header
                header.push(
                    ACCEPTS.all
                );

                return A.merge(
                    value, {
                        Accept: header.join(', ')
                    }
                );
            },
            valueFn: getDefault('headers')
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute method
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type String
         */
        method: {
            setter: function(val) {
                return val.toLowerCase();
            },
            valueFn: getDefault('method')
        },

        /**
         * A selector to be used to query against the response of the
         * request. Only works if the response is XML or HTML.
         *
         * @attribute selector
         * @default null
         * @type String
         */
        selector: {
            value: null
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute sync
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Boolean
         */
        sync: {
            valueFn: getDefault('sync')
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute timeout
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Number
         */
        timeout: {
            valueFn: getDefault('timeout')
        },

        /**
         * See [IO
         * Configuration](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         *
         * @attribute xdr
         * @default Value mapped on YUI.AUI.defaults.io.
         * @type Object
         */
        xdr: {
            valueFn: getDefault('xdr')
        }
    },

    /**
     * Static property used to define which component it extends.
     *
     * @property EXTENDS
     * @type Object
     * @static
     */
    EXTENDS: A.Plugin.Base,

    prototype: {

        /**
         * Construction logic executed during IORequest instantiation.
         * Lifecycle.
         *
         * @method initializer
         * @param config
         * @protected
         */
        init: function() {
            var instance = this;

            IORequest.superclass.init.apply(this, arguments);

            instance._autoStart();
        },

        /**
         * Destructor lifecycle implementation for the `IORequest` class.
         * Purges events attached to the node (and all child nodes).
         *
         * @method destructor
         * @protected
         */
        destructor: function() {
            var instance = this;

            instance.stop();

            instance.set('transaction', null);
        },

        /**
         * Applies the `YUI.AUI.defaults.io.dataFormatter` if
         * defined and return the formatted data.
         *
         * @method getFormattedData
         * @return {String}
         */
        getFormattedData: function() {
            var instance = this;
            var value = instance.get('data');
            var dataFormatter = defaults.dataFormatter;

            if (isFunction(dataFormatter)) {
                value = dataFormatter.call(instance, value);
            }

            return value;
        },

        /**
         * Starts the IO transaction. Used to refresh the content also.
         *
         * @method start
         */
        start: function() {
            var instance = this;

            instance.destructor();

            instance.set('active', true);

            var ioObj = instance._yuiIOObj;

            if (!ioObj) {
                ioObj = new A.IO();

                instance._yuiIOObj = ioObj;
            }

            var transaction = ioObj.send(
                instance.get('uri'),
                instance.get('cfg')
            );

            instance.set('transaction', transaction);
        },

        /**
         * Stops the IO transaction.
         *
         * @method stop
         */
        stop: function() {
            var instance = this;
            var transaction = instance.get('transaction');

            if (transaction) {
                transaction.abort();
            }
        },

        /**
         * Invoke the `start` method (autoLoad attribute).
         *
         * @method _autoStart
         * @protected
         */
        _autoStart: function() {
            var instance = this;

            if (instance.get('autoLoad')) {
                instance.start();
            }
        },

        /**
         * Parse the [uri](A.IORequest.html#attr_uri) to add a
         * timestamp if [cache](A.IORequest.html#attr_cache) is
         * `true`. Also applies the `YUI.AUI.defaults.io.uriFormatter`.
         *
         * @method _parseURL
         * @param {String} url
         * @protected
         * @return {String}
         */
        _parseURL: function(url) {
            var instance = this;
            var cache = instance.get('cache');
            var method = instance.get('method');

            // reusing logic to add a timestamp on the url from jQuery 1.3.2
            if ((cache === false) && (method === 'get')) {
                var ts = +new Date();
                // try replacing _= if it is there
                var ret = url.replace(/(\?|&)_=.*?(&|$)/, '$1_=' + ts + '$2');
                // if nothing was replaced, add timestamp to the end
                url = ret + ((ret === url) ? (url.match(/\?/) ? '&' : '?') + '_=' + ts : '');
            }

            // formatting the URL with the default uriFormatter after the cache
            // timestamp was added
            var uriFormatter = defaults.uriFormatter;

            if (isFunction(uriFormatter)) {
                url = uriFormatter.apply(instance, [url]);
            }

            return url;
        },

        /**
         * Internal end callback for the IO transaction.
         *
         * @method _end
         * @param {Number} id ID of the IO transaction.
         * @param {Object} args Custom arguments, passed to the event handler.
         *     See [IO](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         * @protected
         */
        _end: function(id, args) {
            var instance = this;

            instance.set('active', false);
            instance.set('transaction', null);

            instance.fire('end', id, args);
        },

        /**
         * Internal success callback for the IO transaction.
         *
         * @method _success
         * @param {Number} id ID of the IO transaction.
         * @param {Object} obj IO transaction Object.
         * @param {Object} args Custom arguments, passed to the event handler.
         *     See [IO](http://yuilibrary.com/yui/docs/io/#the-configuration-object).
         * @protected
         */
        _success: function(id, obj, args) {
            var instance = this;

            // update the responseData attribute with the new data from xhr
            instance.set('responseData', obj);

            instance.fire('success', id, obj, args);
        },

        /**
         * Setter for [responseData](A.IORequest.html#attr_responseData).
         *
         * @method _setResponseData
         * @protected
         * @param {Object} xhr XHR Object.
         * @return {Object}
         */
        _setResponseData: function(xhr) {
            var data = null;
            var instance = this;

            if (xhr) {
                var dataType = instance.get('dataType');
                var contentType = xhr.getResponseHeader('content-type') || '';

                // if the dataType or the content-type is XML...
                if ((dataType === 'xml') ||
                    (!dataType && contentType.indexOf('xml') >= 0)) {

                    // use responseXML
                    data = xhr.responseXML;

                    // check if the XML was parsed correctly
                    if (data.documentElement.tagName === 'parsererror') {
                        throw 'Parser error: IO dataType is not correctly parsing';
                    }
                }
                else {
                    // otherwise use the responseText
                    data = xhr.responseText;
                }

                // empty string is not a valid 'json', convert it to null
                if (data === '') {
                    data = null;
                }

                // trying to parse to JSON if dataType is a valid json
                if (dataType === 'json') {
                    try {
                        data = A.JSON.parse(data);
                    }
                    catch (e) {
                        // throw 'Parser error: IO dataType is not correctly parsing';
                    }
                }
                else {
                    var selector = instance.get('selector');

                    if (data && selector) {
                        var tempRoot;

                        if (data.documentElement) {
                            tempRoot = A.one(data);
                        }
                        else {
                            tempRoot = A.Node.create(data);
                        }

                        data = tempRoot.all(selector);
                    }
                }
            }

            return data;
        }
    }
});

A.IORequest = IORequest;

/**
 * Alloy IO extension
 *
 * @class A.io
 * @static
 */

/**
 * Static method to invoke the [IORequest](A.IORequest.html).
 * Likewise [IO](A.io.html).
 *
 * @method A.io.request
 * @for A.io
 * @param {String} uri URI to be requested.
 * @param {Object} config Configuration Object for the [IO](A.io.html).
 * @return {IORequest}
 */
A.io.request = function(uri, config) {
    return new A.IORequest(
        A.merge(config, {
            uri: uri
        })
    );
};


}, '3.1.0-deprecated.76', {"requires": ["io-base", "json", "plugin", "querystring-stringify", "aui-component"]});

YUI.add('aui-loading-mask-deprecated', function (A, NAME) {

/**
 * The LoadingMask Utility
 *
 * @module aui-loading-mask
 */

var Lang = A.Lang,

    BOUNDING_BOX = 'boundingBox',
    CONTENT_BOX = 'contentBox',
    HIDE = 'hide',
    HOST = 'host',
    MESSAGE_EL = 'messageEl',
    NAME = 'loadingmask',
    POSITION = 'position',
    SHOW = 'show',
    STATIC = 'static',
    STRINGS = 'strings',
    TARGET = 'target',
    TOGGLE = 'toggle',

    getClassName = A.getClassName,

    CSS_LOADINGMASK = getClassName(NAME),
    CSS_MASKED = getClassName(NAME, 'masked'),
    CSS_MASKED_RELATIVE = getClassName(NAME, 'masked', 'relative'),
    CSS_MESSAGE_LOADING = getClassName(NAME, 'message'),
    CSS_MESSAGE_LOADING_CONTENT = getClassName(NAME, 'message', 'content'),

    TPL_MESSAGE_LOADING = '<div class="' + CSS_MESSAGE_LOADING + '"><div class="' + CSS_MESSAGE_LOADING_CONTENT +
        '">{0}</div></div>';

/**
 * <p><img src="assets/images/aui-loading-mask/main.png"/></p>
 *
 * A base class for LoadingMask, providing:
 * <ul>
 *    <li>Cross browser mask functionality to cover an element or the entire page</li>
 *    <li>Customizable mask (i.e., background, opacity)</li>
 *    <li>Display a centered "loading" message on the masked node</li>
 * </ul>
 *
 * Quick Example:<br/>
 *
 * <pre><code>node.plug(A.LoadingMask, { background: '#000' });</code></pre>
 *
 * Check the list of <a href="LoadingMask.html#configattributes">Configuration Attributes</a> available for
 * LoadingMask.
 *
 * @param config {Object} Object literal specifying widget configuration properties.
 *
 * @class LoadingMask
 * @constructor
 * @extends Plugin.Base
 */
var LoadingMask = A.Component.create({

    /**
     * Static property provides a string to identify the class.
     *
     * @property LoadingMask.NAME
     * @type String
     * @static
     */
    NAME: NAME,

    /**
     * Static property provides a string to identify the namespace.
     *
     * @property LoadingMask.NS
     * @type String
     * @static
     */
    NS: NAME,

    /**
     * Static property used to define the default attribute
     * configuration for the LoadingMask.
     *
     * @property LoadingMask.ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * Node element to display the message.
         *
         * @attribute messageEl
         * @default Generated HTML div element.
         * @type String
         */
        messageEl: {
            valueFn: function(val) {
                var instance = this;
                var strings = instance.get(STRINGS);

                return A.Node.create(
                    Lang.sub(TPL_MESSAGE_LOADING, [strings.loading])
                );
            }
        },

        /**
         * Strings used on the LoadingMask. See
         * <a href="Widget.html#method_strings">strings</a>.
         *
         * @attribute strings
         * @default { loading: 'Loading&hellip;' }
         * @type Object
         */
        strings: {
            value: {
                loading: 'Loading&hellip;'
            }
        },

        /**
         * Node where the mask will be positioned and re-dimensioned.
         *
         * @attribute target
         * @default null
         * @type Node | Widget
         */
        target: {
            setter: function() {
                var instance = this;
                var target = instance.get(HOST);

                if (target instanceof A.Widget) {
                    target = target.get(CONTENT_BOX);
                }

                return target;
            },
            value: null
        }
    },

    EXTENDS: A.Plugin.Base,

    prototype: {
        /**
         * Construction logic executed during LoadingMask instantiation. Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function(config) {
            var instance = this;

            instance.IGNORED_ATTRS = A.merge({
                    host: true
                },
                LoadingMask.ATTRS
            );

            instance.renderUI();
            instance.bindUI();

            instance._createDynamicAttrs(config);
        },

        /**
         * Create the DOM structure for the LoadingMask. Lifecycle.
         *
         * @method renderUI
         * @protected
         */
        renderUI: function() {
            var instance = this;
            var strings = instance.get(STRINGS);

            instance._renderOverlayMask();

            instance.overlayMask.get(BOUNDING_BOX).append(
                instance.get(MESSAGE_EL)
            );
        },

        /**
         * Bind the events on the LoadingMask UI. Lifecycle.
         *
         * @method bindUI
         * @protected
         */
        bindUI: function() {
            var instance = this;

            instance._bindOverlayMaskUI();
        },

        destructor: function() {
            var instance = this;

            instance.overlayMask.destroy();

            instance._visibleChangeHandle.detach();
        },

        /**
         * Bind events to the
         * <a href="LoadingMask.html#property_overlayMask">overlayMask</a>.
         *
         * @method _bindOverlayMaskUI
         * @protected
         */
        _bindOverlayMaskUI: function() {
            var instance = this;

            instance._visibleChangeHandle = instance.overlayMask.after('visibleChange', instance._afterVisibleChange, instance);
        },

        /**
         * Center the
         * <a href="LoadingMask.html#config_messageEl">messageEl</a> with the
         * <a href="LoadingMask.html#config_target">target</a> node.
         *
         * @method centerMessage
         */
        centerMessage: function() {
            var instance = this;

            instance.get(MESSAGE_EL).center(
                instance.overlayMask.get(BOUNDING_BOX)
            );
        },

        /**
         * Invoke the
         * <a href="LoadingMask.html#property_overlayMask">overlayMask</a>
         * <code>refreshMask</code> method.
         *
         * @method refreshMask
         */
        refreshMask: function() {
            var instance = this;

            instance.overlayMask.refreshMask();

            instance.centerMessage();
        },

        /**
         * Fires after the value of the
         * <a href="LoadingMask.html#config_visible">visible</a> attribute change.
         *
         * @method _afterVisibleChange
         * @param {EventFacade} event
         * @protected
         */
        _afterVisibleChange: function(event) {
            var instance = this;
            var target = instance.get(TARGET);
            var isStaticPositioned = (target.getStyle(POSITION) == STATIC);

            target.toggleClass(CSS_MASKED, (event.newVal));
            target.toggleClass(CSS_MASKED_RELATIVE, (event.newVal && isStaticPositioned));

            if (event.newVal) {
                instance.refreshMask();
            }
        },

        /**
         * Render
         * <a href="LoadingMask.html#property_overlayMask">overlayMask</a>
         * instance.
         *
         * @method _renderOverlayMask
         * @protected
         */
        _renderOverlayMask: function() {
            var instance = this;
            var target = instance.get(TARGET);

            /**
             * Stores the <a href="OverlayMask.html">OverlayMask</a> used
             * internally.
             *
             * @property overlayMask
             * @type OverlayMask
             * @protected
             */
            instance.overlayMask = new A.OverlayMask({
                target: target,
                cssClass: CSS_LOADINGMASK
            }).render(target);
        },

        /**
         * Create dynamic attributes listeners to invoke the setter on
         * <a href="LoadingMask.html#property_overlayMask">overlayMask</a> after
         * the attribute is set on the LoadingMask instance.
         *
         * @method _createDynamicAttrs
         * @param {Object} config Object literal specifying widget configuration properties.
         * @protected
         */
        _createDynamicAttrs: function(config) {
            var instance = this;

            A.each(config, function(value, key) {
                var ignoredAttr = instance.IGNORED_ATTRS[key];

                if (!ignoredAttr) {
                    instance.addAttr(key, {
                        setter: function(val) {
                            this.overlayMask.set(key, val);

                            return val;
                        },
                        value: value
                    });
                }
            });
        }
    }
});

A.each([HIDE, SHOW, TOGGLE], function(method) {
    /**
     * Invoke the
     * <a href="LoadingMask.html#property_overlayMask">overlayMask</a>
     * <code>hide</code> method.
     *
     * @method hide
     */

    /**
     * Invoke the
     * <a href="LoadingMask.html#property_overlayMask">overlayMask</a>
     * <code>show</code> method.
     *
     * @method show
     */

    /**
     * Invoke the
     * <a href="LoadingMask.html#property_overlayMask">overlayMask</a>
     * <code>toggle</code> method.
     *
     * @method toggle
     */
    LoadingMask.prototype[method] = function() {
        this.overlayMask[method]();
    };
});

A.LoadingMask = LoadingMask;


}, '3.1.0-deprecated.76', {"requires": ["plugin", "aui-overlay-mask-deprecated"], "skinnable": true});

YUI.add('aui-overlay-base-deprecated', function (A, NAME) {

/**
 * Provides a basic Overlay widget, with Standard Module content support. The Overlay widget
 * provides Page XY positioning support, alignment and centering support along with basic
 * stackable support (z-index and shimming).
 *
 * @module aui-overlay
 * @submodule aui-overlay-base
 */

/**
 * A basic Overlay Widget, which can be positioned based on Page XY co-ordinates and is stackable (z-index support).
 * It also provides alignment and centering support and uses a standard module format for it's content, with header,
 * body and footer section support.
 *
 * @class OverlayBase
 * @constructor
 * @extends Component
 * @uses WidgetStdMod
 * @uses WidgetPosition
 * @uses WidgetStack
 * @uses WidgetPositionAlign
 * @uses WidgetPositionConstrain
 * @param {Object} object The user configuration for the instance.
 */
A.OverlayBase = A.Component.create({
    NAME: 'overlay',
    ATTRS: {
        hideClass: {
            value: false
        }
    },
    AUGMENTS: [A.WidgetPosition, A.WidgetStack, A.WidgetPositionAlign, A.WidgetPositionConstrain, A.WidgetStdMod]
});


}, '3.1.0-deprecated.76', {
    "requires": [
        "widget-position",
        "widget-stack",
        "widget-position-align",
        "widget-position-constrain",
        "widget-stdmod",
        "aui-component"
    ]
});

YUI.add('aui-overlay-context-deprecated', function (A, NAME) {

/**
 * The OverlayContext Utility
 *
 * @module aui-overlay
 * @submodule aui-overlay-context
 */

var L = A.Lang,
    isString = L.isString,
    isNumber = L.isNumber,
    isObject = L.isObject,
    isBoolean = L.isBoolean,

    isNodeList = function(v) {
        return (v instanceof A.NodeList);
    },

    ALIGN = 'align',
    BL = 'bl',
    BOUNDING_BOX = 'boundingBox',
    CANCELLABLE_HIDE = 'cancellableHide',
    OVERLAY_CONTEXT = 'overlaycontext',
    CURRENT_NODE = 'currentNode',
    FOCUSED = 'focused',
    HIDE = 'hide',
    HIDE_DELAY = 'hideDelay',
    HIDE_ON = 'hideOn',
    HIDE_ON_DOCUMENT_CLICK = 'hideOnDocumentClick',
    MOUSEDOWN = 'mousedown',
    SHOW = 'show',
    SHOW_DELAY = 'showDelay',
    SHOW_ON = 'showOn',
    TL = 'tl',
    TRIGGER = 'trigger',
    USE_ARIA = 'useARIA',
    VISIBLE = 'visible';

/**
 * <p><img src="assets/images/aui-overlay-context/main.png"/></p>
 *
 * A base class for OverlayContext, providing:
 * <ul>
 *    <li>Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)</li>
 *    <li>Able to display an <a href="Overlay.html">Overlay</a> at a specified corner of an element <a href="OverlayContext.html#config_trigger">trigger</a></li>
 * </ul>
 *
 * Quick Example:<br/>
 *
 * <pre><code>var instance = new A.OverlayContext({
 *  boundingBox: '#OverlayBoundingBox',
 *  hideOn: 'mouseleave',
 *  showOn: 'mouseenter',
 *	trigger: '.menu-trigger'
 * }).render();
 * </code></pre>
 *
 * Check the list of <a href="OverlayContext.html#configattributes">Configuration Attributes</a> available for
 * OverlayContext.
 *
 * @class OverlayContext
 * @constructor
 * @extends OverlayBase
 * @param config {Object} Object literal specifying widget configuration properties.
 */
var OverlayContext = A.Component.create({
    /**
     * Static property provides a string to identify the class.
     *
     * @property OverlayContext.NAME
     * @type String
     * @static
     */
    NAME: OVERLAY_CONTEXT,

    /**
     * Static property used to define the default attribute
     * configuration for the OverlayContext.
     *
     * @property OverlayContext.ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * Inherited from <a href="Overlay.html#config_align">Overlay</a>.
         *
         * @attribute align
         * @default { node: null, points: [ TL, BL ] }
         * @type Object
         */
        align: {
            value: {
                node: null,
                points: [TL, BL]
            }
        },

        /**
         * Cancel auto hide delay if the user interact with the Overlay
         * (focus, click, mouseover)
         *
         * @attribute cancellableHide
         * @default true
         * @type boolean
         */
        cancellableHide: {
            value: true,
            validator: isBoolean
        },

        /**
         * OverlayContext allow multiple elements to be the
         * <a href="OverlayContext.html#config_trigger">trigger</a>, the
         * currentNode stores the current active one.
         *
         * @attribute currentNode
         * @default First item of the
         * <a href="OverlayContext.html#config_trigger">trigger</a> NodeList.
         * @type Node
         */
        currentNode: {
            valueFn: function() {
                // define default currentNode as the first item from trigger
                return this.get(TRIGGER).item(0);
            }
        },

        delay: {
            value: null,
            validator: isObject
        },

        /**
         * The event which is responsible to hide the OverlayContext.
         *
         * @attribute hideOn
         * @default mouseout
         * @type String
         */
        hideOn: {
            lazyAdd: false,
            value: 'mouseout',
            setter: function(v) {
                return this._setHideOn(v);
            }
        },

        /**
         * If true the instance is registered on the
         * <a href="OverlayContextManager.html">OverlayContextManager</a> static
         * class and will be hide when the user click on document.
         *
         * @attribute hideOnDocumentClick
         * @default true
         * @type boolean
         */
        hideOnDocumentClick: {
            lazyAdd: false,
            setter: function(v) {
                return this._setHideOnDocumentClick(v);
            },
            value: true,
            validator: isBoolean
        },

        /**
         * Number of milliseconds after the hide method is invoked to hide the
         * OverlayContext.
         *
         * @attribute hideDelay
         * @default 0
         * @type Number
         */
        hideDelay: {
            lazyAdd: false,
            setter: '_setHideDelay',
            value: 0,
            validator: isNumber
        },

        /**
         * The event which is responsible to show the OverlayContext.
         *
         * @attribute showOn
         * @default mouseover
         * @type String
         */
        showOn: {
            lazyAdd: false,
            value: 'mouseover',
            setter: function(v) {
                return this._setShowOn(v);
            }
        },

        /**
         * Number of milliseconds after the show method is invoked to show the
         * OverlayContext.
         *
         * @attribute showDelay
         * @default 0
         * @type Number
         */
        showDelay: {
            lazyAdd: false,
            setter: '_setShowDelay',
            value: 0,
            validator: isNumber
        },

        /**
         * Node, NodeList or Selector which will be used as trigger elements
         * to show or hide the OverlayContext.
         *
         * @attribute trigger
         * @default null
         * @type {Node | NodeList | String}
         */
        trigger: {
            lazyAdd: false,
            setter: function(v) {
                if (isNodeList(v)) {
                    return v;
                }
                else if (isString(v)) {
                    return A.all(v);
                }

                return new A.NodeList([v]);
            }
        },

        /**
         * True if Overlay should use ARIA plugin
         *
         * @attribute useARIA
         * @default true
         * @type Boolean
         */
        useARIA: {
            value: true
        },

        /**
         * If true the OverlayContext is visible by default after the render phase.
         * Inherited from <a href="Overlay.html">Overlay</a>.
         *
         * @attribute visible
         * @default false
         * @type boolean
         */
        visible: {
            value: false
        }
    },

    EXTENDS: A.OverlayBase,

    constructor: function(config) {
        var instance = this;

        instance._showCallback = null;
        instance._hideCallback = null;

        OverlayContext.superclass.constructor.apply(this, arguments);
    },

    prototype: {
        /**
         * Construction logic executed during OverlayContext instantiation. Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function() {
            var instance = this;

            var trigger = instance.get(TRIGGER);

            if (trigger && trigger.size()) {
                instance.set('align.node', trigger.item(0));
            }
        },

        /**
         * Bind the events on the OverlayContext UI. Lifecycle.
         *
         * @method bindUI
         * @protected
         */
        bindUI: function() {
            var instance = this;
            var boundingBox = instance.get(BOUNDING_BOX);

            boundingBox.on(MOUSEDOWN, instance._stopTriggerEventPropagation);

            instance.before('triggerChange', instance._beforeTriggerChange);
            instance.before('showOnChange', instance._beforeShowOnChange);
            instance.before('hideOnChange', instance._beforeHideOnChange);

            instance.after('triggerChange', instance._afterTriggerChange);
            instance.after('showOnChange', instance._afterShowOnChange);
            instance.after('hideOnChange', instance._afterHideOnChange);

            boundingBox.on('click', A.bind(instance._cancelAutoHide, instance));
            boundingBox.on('mouseenter', A.bind(instance._cancelAutoHide, instance));
            boundingBox.on('mouseleave', A.bind(instance._invokeHideTaskOnInteraction, instance));
            instance.after('focusedChange', A.bind(instance._invokeHideTaskOnInteraction, instance));

            instance.on('visibleChange', instance._onVisibleChangeOverlayContext);
        },

        /**
         * Hides the OverlayContext.
         *
         * @method hide
         */
        hide: function() {
            var instance = this;

            instance.clearIntervals();

            instance.fire('hide');

            OverlayContext.superclass.hide.apply(instance, arguments);
        },

        /**
         * Shows the OverlayContext.
         *
         * @method hide
         */
        show: function(event) {
            var instance = this;

            instance.clearIntervals();

            instance.updateCurrentNode(event);

            instance.fire('show');

            OverlayContext.superclass.show.apply(instance, arguments);

            instance.refreshAlign();
        },

        /**
         * Refreshes the rendered UI, based on Widget State
         *
         * @method syncUI
         * @protected
         *
         */
        syncUI: function() {
            var instance = this;

            if (instance.get(USE_ARIA)) {
                instance.plug(A.Plugin.Aria, {
                    attributes: {
                        trigger: {
                            ariaName: 'controls',
                            format: function(value) {
                                var id = instance.get(BOUNDING_BOX).generateID();

                                return id;
                            },
                            node: function() {
                                return instance.get(TRIGGER);
                            }
                        },
                        visible: {
                            ariaName: 'hidden',
                            format: function(value) {
                                return !value;
                            }
                        }
                    },
                    roleName: 'dialog'
                });
            }
        },

        /**
         * Toggles visibility of the OverlayContext.
         *
         * @method toggle
         * @param {EventFacade} event
         */
        toggle: function(event) {
            var instance = this;

            if (instance.get(VISIBLE)) {
                instance._hideTask(event);
            }
            else {
                instance._showTask(event);
            }
        },

        /**
         * Clear the intervals to show or hide the OverlayContext. See
         * <a href="OverlayContext.html#config_hideDelay">hideDelay</a> and
         * <a href="OverlayContext.html#config_showDelay">showDelay</a>.
         *
         * @method clearIntervals
         */
        clearIntervals: function() {
            this._hideTask.cancel();
            this._showTask.cancel();
        },

        /**
         * Refreshes the alignment of the OverlayContext with the
         * <a href="OverlayContext.html#config_currentNode">currentNode</a>. See
         * also <a href="OverlayContext.html#config_align">align</a>.
         *
         * @method refreshAlign
         */
        refreshAlign: function() {
            var instance = this;
            var align = instance.get(ALIGN);
            var currentNode = instance.get(CURRENT_NODE);

            if (currentNode) {
                instance._uiSetAlign(currentNode, align.points);
            }
        },

        /**
         * Update the
         * <a href="OverlayContext.html#config_currentNode">currentNode</a> with the
         * <a href="OverlayContext.html#config_align">align</a> node or the
         * event.currentTarget and in last case with the first item of the
         * <a href="OverlayContext.html#config_trigger">trigger</a>.
         *
         * @method updateCurrentNode
         * @param {EventFacade} event
         */
        updateCurrentNode: function(event) {
            var instance = this;
            var align = instance.get(ALIGN);
            var trigger = instance.get(TRIGGER);
            var currentTarget = null;

            if (event) {
                currentTarget = event.currentTarget;
            }

            var node = currentTarget || trigger.item(0) || align.node;

            if (node) {
                instance.set(CURRENT_NODE, node);
            }
        },

        /**
         * Handles the logic for the
         * <a href="OverlayContext.html#method_toggle">toggle</a>.
         *
         * @method _toggle
         * @param {EventFacade} event
         * @protected
         */
        _toggle: function(event) {
            var instance = this;

            if (instance.get('disabled')) {
                return;
            }

            var currentTarget = event.currentTarget;

            // check if the target is different and simulate a .hide() before toggle
            if (instance._lastTarget != currentTarget) {
                instance.hide();
            }

            instance.toggle(event);

            event.stopPropagation();

            instance._lastTarget = currentTarget;
        },

        /**
         * Fires after the <a href="OverlayContext.html#config_showOn">showOn</a>
         * attribute change.
         *
         * @method _afterShowOnChange
         * @param {EventFacade} event
         * @protected
         */
        _afterShowOnChange: function(event) {
            var instance = this;
            var wasToggle = event.prevVal == instance.get(HIDE_ON);

            if (wasToggle) {
                var trigger = instance.get(TRIGGER);

                // if wasToggle remove the toggle callback
                trigger.detach(event.prevVal, instance._hideCallback);
                // and re attach the hide event
                instance._setHideOn(instance.get(HIDE_ON));
            }
        },

        /**
         * Fires after the <a href="OverlayContext.html#config_hideOn">hideOn</a>
         * attribute change.
         *
         * @method _afterHideOnChange
         * @param {EventFacade} event
         * @protected
         */
        _afterHideOnChange: function(event) {
            var instance = this;
            var wasToggle = event.prevVal == instance.get(SHOW_ON);

            if (wasToggle) {
                var trigger = instance.get(TRIGGER);

                // if wasToggle remove the toggle callback
                trigger.detach(event.prevVal, instance._showCallback);
                // and re attach the show event
                instance._setShowOn(instance.get(SHOW_ON));
            }
        },

        /**
         * Fires after the <a href="OverlayContext.html#config_trigger">trigger</a>
         * attribute change.
         *
         * @method _afterTriggerChange
         * @param {EventFacade} event
         * @protected
         */
        _afterTriggerChange: function(event) {
            var instance = this;

            instance._setShowOn(instance.get(SHOW_ON));
            instance._setHideOn(instance.get(HIDE_ON));
        },

        /**
         * Fires before the <a href="OverlayContext.html#config_showOn">showOn</a>
         * attribute change.
         *
         * @method _beforeShowOnChange
         * @param {EventFacade} event
         * @protected
         */
        _beforeShowOnChange: function(event) {
            var instance = this;
            var trigger = instance.get(TRIGGER);

            // detach the old callback
            trigger.detach(event.prevVal, instance._showCallback);
        },

        /**
         * Fires before the <a href="OverlayContext.html#config_hideOn">hideOn</a>
         * attribute change.
         *
         * @method _beforeHideOnChange
         * @param {EventFacade} event
         * @protected
         */
        _beforeHideOnChange: function(event) {
            var instance = this;
            var trigger = instance.get(TRIGGER);

            // detach the old callback
            trigger.detach(event.prevVal, instance._hideCallback);
        },

        /**
         * Fires before the <a href="OverlayContext.html#config_trigger">trigger</a>
         * attribute change.
         *
         * @method _beforeTriggerChange
         * @param {EventFacade} event
         * @protected
         */
        _beforeTriggerChange: function(event) {
            var instance = this;
            var trigger = instance.get(TRIGGER);
            var showOn = instance.get(SHOW_ON);
            var hideOn = instance.get(HIDE_ON);

            trigger.detach(showOn, instance._showCallback);
            trigger.detach(hideOn, instance._hideCallback);
            trigger.detach(MOUSEDOWN, instance._stopTriggerEventPropagation);
        },

        /**
         * Cancel hide event if the user does some interaction with the
         * OverlayContext (focus, click or mouseover).
         *
         * @method _cancelAutoHide
         * @param {EventFacade} event
         * @protected
         */
        _cancelAutoHide: function(event) {
            var instance = this;

            if (instance.get(CANCELLABLE_HIDE)) {
                instance.clearIntervals();
            }

            event.stopPropagation();
        },

        /**
         * Invoke the hide event when the OverlayContext looses the focus.
         *
         * @method _invokeHideTaskOnInteraction
         * @param {EventFacade} event
         * @protected
         */
        _invokeHideTaskOnInteraction: function(event) {
            var instance = this;
            var cancellableHide = instance.get(CANCELLABLE_HIDE);
            var focused = instance.get(FOCUSED);

            if (!focused && !cancellableHide) {
                instance._hideTask();
            }
        },

        /**
         * Fires when the <a href="OverlayContext.html#config_visible">visible</a>
         * attribute changes.
         *
         * @method _onVisibleChangeOverlayContext
         * @param {EventFacade} event
         * @protected
         */
        _onVisibleChangeOverlayContext: function(event) {
            var instance = this;

            if (event.newVal && instance.get('disabled')) {
                event.preventDefault();
            }
        },

        /**
         * Helper method to invoke event.stopPropagation().
         *
         * @method _stopTriggerEventPropagation
         * @param {EventFacade} event
         * @protected
         */
        _stopTriggerEventPropagation: function(event) {
            event.stopPropagation();
        },

        /**
         * Setter for the
         * <a href="OverlayContext.html#config_hideDelay">hideDelay</a>
         * attribute.
         *
         * @method _setHideDelay
         * @param {number} val
         * @protected
         * @return {number}
         */
        _setHideDelay: function(val) {
            var instance = this;

            instance._hideTask = A.debounce(instance.hide, val, instance);

            return val;
        },

        /**
         * Setter for the <a href="OverlayContext.html#config_hideOn">hideOn</a>
         * attribute.
         *
         * @method _setHideOn
         * @param {String} eventType Event type
         * @protected
         * @return {String}
         */
        _setHideOn: function(eventType) {
            var instance = this;
            var trigger = instance.get(TRIGGER);
            var toggle = eventType == instance.get(SHOW_ON);

            if (toggle) {
                instance._hideCallback = A.bind(instance._toggle, instance);

                // only one attached event is enough for toggle
                trigger.detach(eventType, instance._showCallback);
            }
            else {
                var delay = instance.get(HIDE_DELAY);

                instance._hideCallback = function(event) {
                    instance._hideTask(event);

                    event.stopPropagation();
                };
            }

            trigger.on(eventType, instance._hideCallback);

            return eventType;
        },

        /**
         * Setter for the
         * <a href="OverlayContext.html#config_hideOnDocumentClick">hideOnDocumentClick</a>
         * attribute.
         *
         * @method _setHideOn
         * @param {boolean} value
         * @protected
         * @return {boolean}
         */
        _setHideOnDocumentClick: function(value) {
            var instance = this;

            if (value) {
                A.OverlayContextManager.register(instance);
            }
            else {
                A.OverlayContextManager.remove(instance);
            }

            return value;
        },

        /**
         * Setter for the
         * <a href="OverlayContext.html#config_showDelay">showDelay</a>
         * attribute.
         *
         * @method _setShowDelay
         * @param {number} val
         * @protected
         * @return {number}
         */
        _setShowDelay: function(val) {
            var instance = this;

            instance._showTask = A.debounce(instance.show, val, instance);

            return val;
        },

        /**
         * Setter for the <a href="OverlayContext.html#config_showOn">showOn</a>
         * attribute.
         *
         * @method _setShowOn
         * @param {String} eventType Event type
         * @protected
         * @return {String}
         */
        _setShowOn: function(eventType) {
            var instance = this;
            var trigger = instance.get(TRIGGER);
            var toggle = eventType == instance.get(HIDE_ON);

            if (toggle) {
                instance._showCallback = A.bind(instance._toggle, instance);

                // only one attached event is enough for toggle
                trigger.detach(eventType, instance._hideCallback);
            }
            else {
                var delay = instance.get(SHOW_DELAY);

                instance._showCallback = function(event) {
                    instance._showTask(event);

                    event.stopPropagation();
                };
            }

            if (eventType != MOUSEDOWN) {
                trigger.on(MOUSEDOWN, instance._stopTriggerEventPropagation);
            }
            else {
                trigger.detach(MOUSEDOWN, instance._stopTriggerEventPropagation);
            }

            trigger.on(eventType, instance._showCallback);

            return eventType;
        }
    }
});

A.OverlayContext = OverlayContext;

/**
 * A base class for OverlayContextManager:
 *
 * @param config {Object} Object literal specifying widget configuration properties.
 *
 * @class OverlayContextManager
 * @constructor
 * @extends OverlayManager
 * @static
 */
A.OverlayContextManager = new A.OverlayManager({});

A.on(MOUSEDOWN, function() {
    A.OverlayContextManager.hideAll();
}, A.getDoc());


}, '3.1.0-deprecated.76', {"requires": ["aui-overlay-manager-deprecated", "aui-delayed-task-deprecated", "aui-aria"]});

YUI.add('aui-overlay-manager-deprecated', function (A, NAME) {

/**
 * The OverlayManager Utility
 *
 * @module aui-overlay
 * @submodule aui-overlay-manager
 */

var Lang = A.Lang,
    isArray = Lang.isArray,
    isBoolean = Lang.isBoolean,
    isNumber = Lang.isNumber,
    isString = Lang.isString,

    BOUNDING_BOX = 'boundingBox',
    DEFAULT = 'default',
    HOST = 'host',
    OVERLAY_MANAGER = 'OverlayManager',
    GROUP = 'group',
    Z_INDEX = 'zIndex',
    Z_INDEX_BASE = 'zIndexBase';

/**
 * <p><img src="assets/images/aui-overlay-manager/main.png"/></p>
 *
 * A base class for OverlayManager, providing:
 * <ul>
 *    <li>Grouping overlays</li>
 *    <li>Show or hide the entire group of registered overlays</li>
 *    <li>Basic Overlay Stackability (zIndex support)</li>
 * </ul>
 *
 * Quick Example:<br/>
 *
 * <pre><code>var groupOverlayManager = new A.OverlayManager();
 * groupOverlayManager.register([overlay1, overlay2, overlay3]);
 * groupOverlayManager.hideAll();
 * </code></pre>
 *
 * Check the list of <a href="OverlayManager.html#configattributes">Configuration Attributes</a> available for
 * OverlayManager.
 *
 * @param config {Object} Object literal specifying widget configuration properties.
 *
 * @class OverlayManager
 * @constructor
 * @extends Base
 */
var OverlayManager = A.Component.create({
    /**
     * Static property provides a string to identify the class.
     *
     * @property OverlayManager.NAME
     * @type String
     * @static
     */
    NAME: OVERLAY_MANAGER.toLowerCase(),

    /**
     * Static property used to define the default attribute
     * configuration for the OverlayManager.
     *
     * @property OverlayManager.ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * The zIndex base to be used on the stacking for all overlays
         * registered on the OverlayManager.
         *
         * @attribute zIndexBase
         * @default 1000
         * @type Number
         */
        zIndexBase: {
            value: 1000,
            validator: isNumber,
            setter: Lang.toInt
        }
    },

    EXTENDS: A.Base,

    prototype: {
        /**
         * Construction logic executed during OverlayManager instantiation. Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function() {
            var instance = this;

            instance._overlays = [];
        },

        /**
         * Set the passed overlay zIndex to the highest value.
         *
         * @method bringToTop
         * @param {Overlay} overlay Instance of
         * <a href="Overlay.html">Overlay</a>.
         */
        bringToTop: function(overlay) {
            var instance = this;

            var overlays = instance._overlays.sort(instance.sortByZIndexDesc);

            var highest = overlays[0];

            if (highest !== overlay) {
                var overlayZ = overlay.get(Z_INDEX);
                var highestZ = highest.get(Z_INDEX);

                overlay.set(Z_INDEX, highestZ + 1);

                overlay.set('focused', true);
            }
        },

        /**
         * Destructor lifecycle implementation for the OverlayManager class.
         * Purges events attached to the node (and all child nodes).
         *
         * @method destructor
         * @protected
         */
        destructor: function() {
            var instance = this;

            instance._overlays = [];
        },

        /**
         * Register the passed <a href="Overlay.html">Overlay</a> to this
         * OverlayManager.
         *
         * @method register
         * @param {Overlay} overlay <a href="Overlay.html">Overlay</a> instance to be registered
         * @return {Array} Registered overlays
         */
        register: function(overlay) {
            var instance = this;

            var overlays = instance._overlays;

            if (isArray(overlay)) {
                A.Array.each(overlay, function(o) {
                    instance.register(o);
                });
            }
            else {
                var zIndexBase = instance.get(Z_INDEX_BASE);
                var registered = instance._registered(overlay);

                if (!registered && overlay &&
                    ((overlay instanceof A.Overlay) ||
                        (A.Component && overlay instanceof A.Component))
                ) {
                    var boundingBox = overlay.get(BOUNDING_BOX);

                    overlays.push(overlay);

                    var zIndex = overlay.get(Z_INDEX) || 0;
                    var newZIndex = overlays.length + zIndex + zIndexBase;

                    overlay.set(Z_INDEX, newZIndex);

                    overlay.on('focusedChange', instance._onFocusedChange, instance);
                    boundingBox.on('mousedown', instance._onMouseDown, instance);
                }
            }

            return overlays;
        },

        /**
         * Remove the passed <a href="Overlay.html">Overlay</a> from this
         * OverlayManager.
         *
         * @method remove
         * @param {Overlay} overlay <a href="Overlay.html">Overlay</a> instance to be removed
         * @return {null}
         */
        remove: function(overlay) {
            var instance = this;

            var overlays = instance._overlays;

            if (overlays.length) {
                return A.Array.removeItem(overlays, overlay);
            }

            return null;
        },

        /**
         * Loop through all registered <a href="Overlay.html">Overlay</a> and
         * execute a callback.
         *
         * @method each
         * @param {function} fn Callback to be executed on the
         * <a href="Array.html#method_each">Array.each</a>
         * @return {null}
         */
        each: function(fn) {
            var instance = this;

            var overlays = instance._overlays;

            A.Array.each(overlays, fn);
        },

        /**
         * Invoke the <a href="Overlay.html#method_show">show</a> method from
         * all registered Overlays.
         *
         * @method showAll
         */
        showAll: function() {
            this.each(
                function(overlay) {
                    overlay.show();
                }
            );
        },

        /**
         * Invoke the <a href="Overlay.html#method_hide">hide</a> method from
         * all registered Overlays.
         *
         * @method hideAll
         */
        hideAll: function() {
            this.each(
                function(overlay) {
                    overlay.hide();
                }
            );
        },

        /**
         * zIndex comparator. Used on Array.sort.
         *
         * @method sortByZIndexDesc
         * @param {Overlay} a Overlay
         * @param {Overlay} b Overlay
         * @return {Number}
         */
        sortByZIndexDesc: function(a, b) {
            if (!a || !b || !a.hasImpl(A.WidgetStack) || !b.hasImpl(A.WidgetStack)) {
                return 0;
            }
            else {
                var aZ = a.get(Z_INDEX);
                var bZ = b.get(Z_INDEX);

                if (aZ > bZ) {
                    return -1;
                }
                else if (aZ < bZ) {
                    return 1;
                }
                else {
                    return 0;
                }
            }
        },

        /**
         * Check if the overlay is registered.
         *
         * @method _registered
         * @param {Overlay} overlay Overlay
         * @protected
         * @return {boolean}
         */
        _registered: function(overlay) {
            var instance = this;

            return A.Array.indexOf(instance._overlays, overlay) != -1;
        },

        /**
         * Mousedown event handler, used to invoke
         * <a href="OverlayManager.html#method_bringToTop">bringToTop</a>.
         *
         * @method _onMouseDown
         * @param {EventFacade} event
         * @protected
         */
        _onMouseDown: function(event) {
            var instance = this;
            var overlay = A.Widget.getByNode(event.currentTarget || event.target);
            var registered = instance._registered(overlay);

            if (overlay && registered) {
                instance.bringToTop(overlay);
            }
        },

        /**
         * Fires when the <a href="Widget.html#config_focused">focused</a>
         * attribute change. Used to invoke
         * <a href="OverlayManager.html#method_bringToTop">bringToTop</a>.
         *
         * @method _onFocusedChange
         * @param {EventFacade} event
         * @protected
         */
        _onFocusedChange: function(event) {
            var instance = this;

            if (event.newVal) {
                var overlay = event.currentTarget || event.target;
                var registered = instance._registered(overlay);

                if (overlay && registered) {
                    instance.bringToTop(overlay);
                }
            }
        }
    }
});

A.OverlayManager = OverlayManager;


}, '3.1.0-deprecated.76', {"requires": ["overlay", "plugin", "aui-base-deprecated", "aui-overlay-base-deprecated"]});

YUI.add('aui-overlay-mask-deprecated', function (A, NAME) {

/**
 * The OverlayMask Utility
 *
 * @module aui-overlay
 * @submodule aui-overlay-mask
 */

var L = A.Lang,
    isArray = L.isArray,
    isString = L.isString,
    isNumber = L.isNumber,
    isValue = L.isValue,

    CONFIG = A.config,

    UA = A.UA,

    IE6 = (UA.ie <= 6),

    ABSOLUTE = 'absolute',
    ALIGN_POINTS = 'alignPoints',
    BACKGROUND = 'background',
    BOUNDING_BOX = 'boundingBox',
    CONTENT_BOX = 'contentBox',
    FIXED = 'fixed',
    HEIGHT = 'height',
    OFFSET_HEIGHT = 'offsetHeight',
    OFFSET_WIDTH = 'offsetWidth',
    OPACITY = 'opacity',
    OVERLAY_MASK = 'overlaymask',
    POSITION = 'position',
    TARGET = 'target',
    WIDTH = 'width';

/**
 * A base class for OverlayMask, providing:
 * <ul>
 *    <li>Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)</li>
 *    <li>Cross browser mask functionality to cover an element or the entire page</li>
 *    <li>Customizable mask (i.e., background, opacity)</li>
 * </ul>
 *
 * Quick Example:<br/>
 *
 * <pre><code>var instance = new A.OverlayMask().render();</code></pre>
 *
 * Check the list of <a href="OverlayMask.html#configattributes">Configuration Attributes</a> available for
 * OverlayMask.
 *
 * @param config {Object} Object literal specifying widget configuration properties.
 *
 * @class OverlayMask
 * @constructor
 * @extends OverlayBase
 */
var OverlayMask = A.Component.create({
    /**
     * Static property provides a string to identify the class.
     *
     * @property OverlayMask.NAME
     * @type String
     * @static
     */
    NAME: OVERLAY_MASK,

    /**
     * Static property used to define the default attribute
     * configuration for the OverlayMask.
     *
     * @property OverlayMask.ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * Points to align the <a href="Overlay.html">Overlay</a> used as
         * mask.
         *
         * @attribute alignPoints
         * @default [ 'tl', 'tl' ]
         * @type Array
         */
        alignPoints: {
            value: ['tl', 'tl'],
            validator: isArray
        },

        /**
         * Background color of the mask.
         *
         * @attribute background
         * @default null
         * @type String
         */
        background: {
            lazyAdd: false,
            value: null,
            validator: isString,
            setter: function(v) {
                if (v) {
                    this.get(CONTENT_BOX).setStyle(BACKGROUND, v);
                }

                return v;
            }
        },

        /**
         * Node where the mask will be positioned and re-dimensioned. The
         * default is the document, which means that if not specified the mask
         * takes the full screen.
         *
         * @attribute target
         * @default document
         * @type Node | String
         */
        target: {
            cloneDefaultValue: false,
            lazyAdd: false,
            value: CONFIG.doc,
            setter: function(v) {
                var instance = this;

                var target = A.one(v);

                var isDoc = instance._isDoc = target.compareTo(CONFIG.doc);
                var isWin = instance._isWin = target.compareTo(CONFIG.win);

                instance._fullPage = isDoc || isWin;

                return target;
            }
        },

        /**
         * CSS opacity of the mask.
         *
         * @attribute opacity
         * @default .5
         * @type Number
         */
        opacity: {
            value: 0.5,
            validator: isNumber,
            setter: function(v) {
                return this._setOpacity(v);
            }
        },

        /**
         * Use shim option.
         *
         * @attribute shim
         * @default True on IE.
         * @type boolean
         */
        shim: {
            value: A.UA.ie
        },

        /**
         * If true the Overlay is visible by default after the render phase.
         * Inherited from <a href="Overlay.html">Overlay</a>.
         *
         * @attribute visible
         * @default false
         * @type boolean
         */
        visible: {
            value: false
        },

        /**
         * zIndex of the OverlayMask.
         *
         * @attribute zIndex
         * @default 1000
         * @type Number
         */
        zIndex: {
            value: 1000
        }
    },

    EXTENDS: A.OverlayBase,

    prototype: {
        /**
         * Bind the events on the OverlayMask UI. Lifecycle.
         *
         * @method bindUI
         * @protected
         */
        bindUI: function() {
            var instance = this;

            OverlayMask.superclass.bindUI.apply(this, arguments);

            instance._eventHandles = [
                instance.after('targetChange', instance._afterTargetChange),
                instance.after('visibleChange', instance._afterVisibleChange),

                // window:resize YUI normalized event is not working, bug?
                A.on('windowresize', A.bind(instance.refreshMask, instance))
            ];
        },

        /**
         * Sync the OverlayMask UI. Lifecycle.
         *
         * @method syncUI
         * @protected
         */
        syncUI: function() {
            var instance = this;

            instance.refreshMask();
        },

        destructor: function() {
            var instance = this;

            (new A.EventHandle(instance._eventHandles)).detach();
        },

        /**
         * Get the size of the
         * <a href="OverlayMask.html#config_target">target</a>. Used to dimension
         * the mask node.
         *
         * @method getTargetSize
         * @return {Object} Object containing the { height: height, width: width }.
         */
        getTargetSize: function() {
            var instance = this;
            var target = instance.get(TARGET);

            var isDoc = instance._isDoc;
            var isWin = instance._isWin;

            var height = target.get(OFFSET_HEIGHT);
            var width = target.get(OFFSET_WIDTH);

            if (IE6) {
                // IE6 doesn't support height/width 100% on doc/win
                if (isWin) {
                    width = A.DOM.winWidth();
                    height = A.DOM.winHeight();
                }
                else if (isDoc) {
                    width = A.DOM.docWidth();
                    height = A.DOM.docHeight();
                }
            }
            // good browsers...
            else if (instance._fullPage) {
                height = '100%';
                width = '100%';
            }

            return {
                height: height,
                width: width
            };
        },

        /**
         * Repaint the OverlayMask UI, respecting the
         * <a href="OverlayMask.html#config_target">target</a> size and the
         * <a href="OverlayMask.html#config_alignPoints">alignPoints</a>.
         *
         * @method refreshMask
         */
        refreshMask: function() {
            var instance = this;
            var alignPoints = instance.get(ALIGN_POINTS);
            var target = instance.get(TARGET);
            var boundingBox = instance.get(BOUNDING_BOX);
            var targetSize = instance.getTargetSize();

            var fullPage = instance._fullPage;

            boundingBox.setStyles({
                position: (IE6 || !fullPage) ? ABSOLUTE : FIXED,
                left: 0,
                top: 0
            });

            var height = targetSize.height;
            var width = targetSize.width;

            if (isValue(height)) {
                instance.set(HEIGHT, height);
            }

            if (isValue(width)) {
                instance.set(WIDTH, width);
            }

            // if its not a full mask...
            if (!fullPage) {
                // if the target is not document|window align the overlay
                instance.align(target, alignPoints);
            }
        },

        /**
         * Setter for <a href="Paginator.html#config_opacity">opacity</a>.
         *
         * @method _setOpacity
         * @protected
         * @param {Number} v
         * @return {Number}
         */
        _setOpacity: function(v) {
            var instance = this;

            instance.get(CONTENT_BOX).setStyle(OPACITY, v);

            return v;
        },

        /**
         * Invoke the <code>OverlayMask.superclass._uiSetVisible</code>. Used to
         * reset the <code>opacity</code> to work around IE bugs when set opacity
         * of hidden elements.
         *
         * @method _uiSetVisible
         * @param {boolean} val
         * @protected
         */
        _uiSetVisible: function(val) {
            var instance = this;

            OverlayMask.superclass._uiSetVisible.apply(this, arguments);

            if (val) {
                instance._setOpacity(
                    instance.get(OPACITY)
                );
            }
        },

        /**
         * Fires after the value of the
         * <a href="Paginator.html#config_target">target</a> attribute change.
         *
         * @method _afterTargetChange
         * @param {EventFacade} event
         * @protected
         */
        _afterTargetChange: function(event) {
            var instance = this;

            instance.refreshMask();
        },

        /**
         * Fires after the value of the
         * <a href="Paginator.html#config_visible">visible</a> attribute change.
         *
         * @method _afterVisibleChange
         * @param {EventFacade} event
         * @protected
         */
        _afterVisibleChange: function(event) {
            var instance = this;

            instance._uiSetVisible(event.newVal);
        },

        /**
         * UI Setter for the
         * <a href="Paginator.html#config_xy">XY</a> attribute.
         *
         * @method _uiSetXY
         * @param {EventFacade} event
         * @protected
         */
        _uiSetXY: function() {
            var instance = this;

            if (!instance._fullPage || IE6) {
                OverlayMask.superclass._uiSetXY.apply(instance, arguments);
            }
        }
    }
});

A.OverlayMask = OverlayMask;


}, '3.1.0-deprecated.76', {"requires": ["event-resize", "aui-base-deprecated", "aui-overlay-base-deprecated"], "skinnable": true});

YUI.add('aui-parse-content', function (A, NAME) {

/**
 * The ParseContent Utility - Parse the content of a Node so that all of the
 * javascript contained in that Node will be executed according to the order
 * that it appears.
 *
 * @module aui-parse-content
 */

/*
 * NOTE: The inspiration of ParseContent cames from the "Caridy Patino" Node
 *       Dispatcher Plugin http://github.com/caridy/yui3-gallery/blob/master/src
 *       /gallery-dispatcher/
 */

var L = A.Lang,
    isString = L.isString,

    DOC = A.config.doc,
    PADDING_NODE = '<div>_</div>',

    SCRIPT_TYPES = {
        '': 1,
        'text/javascript': 1,
        'text/parsed': 1
    };

/**
 * A base class for ParseContent, providing:
 *
 * - After plug ParseContent on a A.Node instance the javascript chunks will be
 *   executed (remote and inline scripts)
 * - All the javascripts within a content will be executed according to the
 *   order of apparition
 *
 * **NOTE:** For performance reasons on DOM manipulation,
 * ParseContent only parses the content passed to the
 * [setContent](Node.html#method_setContent),
 * [prepend](Node.html#method_prepend) and
 * [append](Node.html#method_append) methods.
 *
 * Quick Example:
 *
 * ```
 * node.plug(A.Plugin.ParseContent);
 * ```
 *
 * @class A.ParseContent
 * @extends Plugin.Base
 * @param {Object} config Object literal specifying widget configuration
 *     properties.
 * @constructor
 */
var ParseContent = A.Component.create({
    /**
     * Static property provides a string to identify the class.
     *
     * @property NAME
     * @type String
     * @static
     */
    NAME: 'ParseContent',

    /**
     * Static property provides a string to identify the namespace.
     *
     * @property NS
     * @type String
     * @static
     */
    NS: 'ParseContent',

    /**
     * Static property used to define the default attribute
     * configuration for the ParseContent.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * A queue of elements to be parsed.
         *
         * @attribute queue
         * @default null
         */
        queue: {
            value: null
        },

        /**
         * When true, script nodes will not be removed from original content,
         * instead the script type attribute will be set to `text/plain`.
         *
         * @attribute preserveScriptNodes
         * @default false
         */
        preserveScriptNodes: {
            validator: L.isBoolean,
            value: false
        }
    },

    /**
     * Static property used to define which component it extends.
     *
     * @property EXTENDS
     * @type Object
     * @static
     */
    EXTENDS: A.Plugin.Base,

    prototype: {

        /**
         * Construction logic executed during ParseContent instantiation.
         * Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function() {
            var instance = this;

            ParseContent.superclass.initializer.apply(this, arguments);

            instance.set(
                'queue',
                new A.AsyncQueue()
            );

            instance._bindAOP();
        },

        /**
         * Global eval the <data>data</data> passed.
         *
         * @method globalEval
         * @param {String} data JavaScript String.
         */
        globalEval: function(data) {
            var doc = A.getDoc();
            var head = doc.one('head') || doc.get('documentElement');

            // NOTE: A.Node.create('<script></script>') doesn't work correctly
            // on Opera
            var newScript = DOC.createElement('script');

            newScript.type = 'text/javascript';

            if (data) {
                // NOTE: newScript.set(TEXT, data) breaks on IE, YUI BUG.
                newScript.text = L.trim(data);
            }

            //removes the script node immediately after executing it
            head.appendChild(newScript).remove();
        },

        /**
         * Extract the `script` tags from the string content and
         * evaluate the chunks.
         *
         * @method parseContent
         * @param {String} content HTML string
         * @return {String}
         */
        parseContent: function(content) {
            var instance = this;

            var output = instance._extractScripts(content);

            instance._dispatch(output);

            return output;
        },

        /**
         * Add inline script data to the queue.
         *
         * @method _addInlineScript
         * @param {String} data The script content which should be added to the
         *     queue
         * @protected
         */
        _addInlineScript: function(data) {
            var instance = this;

            instance.get('queue').add({
                args: data,
                context: instance,
                fn: instance.globalEval,
                timeout: 0
            });
        },

        /**
         * Bind listeners on the `insert` and `setContent` methods of the Node
         * instance where you are plugging the ParseContent. These listeners are
         * responsible for intercept the HTML passed and parse them.
         *
         * @method _bindAOP
         * @protected
         */
        _bindAOP: function() {
            var instance = this;

            var cleanFirstArg = function(content) {
                var args = Array.prototype.slice.call(arguments);
                var output = instance.parseContent(content);

                // replace the first argument with the clean fragment
                args.splice(0, 1, output.fragment);

                return new A.Do.AlterArgs(null, args);
            };

            this.doBefore('insert', cleanFirstArg);
            this.doBefore('replaceChild', cleanFirstArg);

            var cleanArgs = function(content) {
                var output = instance.parseContent(content);

                return new A.Do.AlterArgs(null, [output.fragment]);
            };

            this.doBefore('replace', cleanArgs);
            this.doBefore('setContent', cleanArgs);
        },

        /**
         * Create an HTML fragment with the String passed, extract all the
         * script tags and return an Object with a reference for the extracted
         * scripts and the fragment.
         *
         * @method clean
         * @param {String} content HTML content.
         * @protected
         * @return {Object}
         */
        _extractScripts: function(content) {
            var instance = this,
                fragment = A.Node.create('<div></div>'),
                output = {},
                preserveScriptNodes = instance.get('preserveScriptNodes');

            // For PADDING_NODE, instead of fixing all tags in the content to be
            // "XHTML"-style, we make the firstChild be a valid non-empty tag,
            // then we remove it later

            if (isString(content)) {
                content = PADDING_NODE + content;

                // create fragment from {String}
                A.DOM.addHTML(fragment, content, 'append');
            }
            else {
                fragment.append(PADDING_NODE);

                // create fragment from {Y.Node | HTMLElement}
                fragment.append(content);
            }

            output.js = fragment.all('script').filter(function(script) {
                var includeScript = SCRIPT_TYPES[script.getAttribute('type').toLowerCase()];
                if (preserveScriptNodes) {
                    script.setAttribute('type', 'text/parsed');
                }
                return includeScript;
            });

            if (!preserveScriptNodes) {
                output.js.each(
                    function(node) {
                        node.remove();
                    }
                );
            }

            // remove PADDING_NODE
            fragment.get('firstChild').remove();

            output.fragment = fragment.get('childNodes').toFrag();

            return output;
        },

        /**
         * Loop trough all extracted `script` tags and evaluate them.
         *
         * @method _dispatch
         * @param {Object} output Object containing the reference for the
         *     fragment and the extracted `script` tags.
         * @protected
         * @return {String}
         */
        _dispatch: function(output) {
            var instance = this;

            var queue = instance.get('queue');

            var scriptContent = [];

            output.js.each(function(node) {
                var src = node.get('src');

                if (src) {
                    if (scriptContent.length) {
                        instance._addInlineScript(scriptContent.join(';'));

                        scriptContent.length = 0;
                    }

                    queue.add({
                        autoContinue: false,
                        fn: function() {
                            A.Get.script(src, {
                                onEnd: function(o) {
                                    //removes the script node immediately after
                                    //executing it
                                    o.purge();
                                    queue.run();
                                }
                            });
                        },
                        timeout: 0
                    });
                }
                else {
                    var dom = node._node;

                    scriptContent.push(dom.text || dom.textContent || dom.innerHTML || '');
                }
            });

            if (scriptContent.length) {
                instance._addInlineScript(scriptContent.join(';'));
            }

            queue.run();
        }
    }
});

A.namespace('Plugin').ParseContent = ParseContent;


}, '3.1.0-deprecated.76', {"requires": ["async-queue", "plugin", "io-base", "aui-component", "aui-node-base"]});

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
AUI.add('liferay-session', function (A) {
  var Lang = A.Lang;
  var BUFFER_TIME = [];
  var CONFIG = A.config;
  var DOC = CONFIG.doc;
  var MAP_SESSION_STATE_EVENTS = {
    active: 'activated'
  };
  var SRC = {};
  var SRC_EVENT_OBJ = {
    src: SRC
  };
  var URL_BASE = themeDisplay.getPathMain() + '/portal/';
  var SessionBase = A.Component.create({
    ATTRS: {
      autoExtend: {
        value: false
      },
      redirectOnExpire: {
        value: true
      },
      redirectUrl: {
        value: ''
      },
      sessionLength: {
        getter: '_getLengthInMillis',
        value: 0
      },
      sessionState: {
        value: 'active'
      },
      timestamp: {
        getter: '_getTimestamp',
        setter: '_setTimestamp',
        value: 0
      },
      warningLength: {
        getter: '_getLengthInMillis',
        setter: '_setWarningLength',
        value: 0
      },
      warningTime: {
        getter: '_getWarningTime',
        value: 0
      }
    },
    EXTENDS: A.Base,
    NAME: 'liferaysession',
    prototype: {
      _afterSessionStateChange: function _afterSessionStateChange(event) {
        var instance = this;
        var details = event.details;
        var newVal = event.newVal;
        var src = null;

        if ('src' in event && details.length) {
          src = details[0];
        }

        instance.fire(MAP_SESSION_STATE_EVENTS[newVal] || newVal, src);
      },
      _defActivatedFn: function _defActivatedFn(event) {
        var instance = this;
        instance.set('timestamp');

        if (event.src === SRC) {
          Liferay.Util.fetch(URL_BASE + 'extend_session');
        }
      },
      _defExpiredFn: function _defExpiredFn(event) {
        var instance = this;
        A.clearInterval(instance._intervalId);
        instance.set('timestamp', 'expired');

        if (event.src === SRC) {
          instance._expireSession();
        }
      },
      _expireSession: function _expireSession() {
        var instance = this;
        Liferay.Util.fetch(URL_BASE + 'expire_session').then(function (response) {
          if (response.ok) {
            Liferay.fire('sessionExpired');

            if (instance.get('redirectOnExpire')) {
              location.href = instance.get('redirectUrl');
            }
          } else {
            A.setTimeout(function () {
              instance._expireSession();
            }, 1000);
          }
        });
      },
      _getLengthInMillis: function _getLengthInMillis(value) {
        return value * 1000;
      },
      _getTimestamp: function _getTimestamp() {
        var instance = this;
        return A.Cookie.get(instance._cookieKey, instance._cookieOptions) || instance._initTimestamp;
      },
      _getWarningTime: function _getWarningTime() {
        var instance = this;
        return instance.get('sessionLength') - instance.get('warningLength');
      },
      _initEvents: function _initEvents() {
        var instance = this;
        instance.publish('activated', {
          defaultFn: A.bind('_defActivatedFn', instance)
        });
        instance.publish('expired', {
          defaultFn: A.bind('_defExpiredFn', instance)
        });
        instance.publish('warned');
        instance._eventHandlers = [instance.on('sessionStateChange', instance._onSessionStateChange), instance.after('sessionStateChange', instance._afterSessionStateChange), A.on('io:complete', function (transactionId, response, args) {
          if (!args || args && args.sessionExtend || !Lang.isBoolean(args.sessionExtend)) {
            instance.resetInterval();
          }
        }), Liferay.once('screenLoad', function () {
          instance.destroy();
        })];
      },
      _onSessionStateChange: function _onSessionStateChange(event) {
        var instance = this;
        var newVal = event.newVal;
        var prevVal = event.prevVal;

        if (prevVal === 'expired' && prevVal !== newVal) {
          event.preventDefault();
        } else if (prevVal === 'active' && prevVal === newVal) {
          instance._afterSessionStateChange(event);
        }
      },
      _setTimestamp: function _setTimestamp(value) {
        var instance = this;
        value = String(value || Date.now());
        instance._initTimestamp = value;

        if (navigator.cookieEnabled) {
          A.Cookie.set(instance._cookieKey, value, instance._cookieOptions);
        }
      },
      _setWarningLength: function _setWarningLength(value) {
        var instance = this;
        return Math.min(instance.get('sessionLength'), value);
      },
      _startTimer: function _startTimer() {
        var instance = this;
        var sessionLength = instance.get('sessionLength');
        var warningTime = instance.get('warningTime');
        var registered = instance._registered;
        var interval = 1000;
        instance._intervalId = A.setInterval(function () {
          var sessionState = instance.get('sessionState');
          var timeOffset;
          var timestamp = instance.get('timestamp');
          var elapsed = sessionLength;

          if (Lang.toInt(timestamp)) {
            timeOffset = Math.floor((Date.now() - timestamp) / 1000) * 1000;
            elapsed = timeOffset;

            if (instance._initTimestamp !== timestamp) {
              instance.set('timestamp', timestamp);

              if (sessionState !== 'active') {
                instance.set('sessionState', 'active', SRC_EVENT_OBJ);
              }
            }
          } else {
            timestamp = 'expired';
          }

          var extend = instance.get('autoExtend');
          var expirationMoment = false;
          var warningMoment = false;
          var hasExpired = elapsed >= sessionLength;
          var hasWarned = elapsed >= warningTime;

          if (hasWarned) {
            if (timestamp === 'expired') {
              expirationMoment = true;
              extend = false;
              hasExpired = true;
            }

            if (hasExpired && sessionState !== 'expired') {
              if (extend) {
                expirationMoment = false;
                hasExpired = false;
                hasWarned = false;
                warningMoment = false;
                instance.extend();
              } else {
                instance.expire();
                expirationMoment = true;
              }
            } else if (hasWarned && !hasExpired && !extend && sessionState != 'warned') {
              instance.warn();
              warningMoment = true;
            }
          }

          for (var i in registered) {
            registered[i](elapsed, interval, hasWarned, hasExpired, warningMoment, expirationMoment);
          }
        }, interval);
      },
      _stopTimer: function _stopTimer() {
        var instance = this;
        A.clearInterval(instance._intervalId);
      },
      destructor: function destructor() {
        var instance = this;
        new A.EventHandle(instance._eventHandlers).detach();

        instance._stopTimer();
      },
      expire: function expire() {
        var instance = this;
        instance.set('sessionState', 'expired', SRC_EVENT_OBJ);
      },
      extend: function extend() {
        var instance = this;
        instance.set('sessionState', 'active', SRC_EVENT_OBJ);
      },
      initializer: function initializer() {
        var instance = this;
        instance._cookieKey = 'LFR_SESSION_STATE_' + themeDisplay.getUserId();
        instance._cookieOptions = {
          path: '/',
          secure: A.UA.secure
        };
        instance._registered = {};
        instance.set('timestamp');

        instance._initEvents();

        instance._startTimer();
      },
      registerInterval: function registerInterval(fn) {
        var instance = this;
        var fnId;
        var registered = instance._registered;

        if (Lang.isFunction(fn)) {
          fnId = A.stamp(fn);
          registered[fnId] = fn;
        }

        return fnId;
      },
      resetInterval: function resetInterval() {
        var instance = this;

        instance._stopTimer();

        instance._startTimer();
      },
      unregisterInterval: function unregisterInterval(fnId) {
        var instance = this;
        var registered = instance._registered;

        if (Object.prototype.hasOwnProperty.call(registered, fnId)) {
          delete registered[fnId];
        }

        return fnId;
      },
      warn: function warn() {
        var instance = this;
        instance.set('sessionState', 'warned', SRC_EVENT_OBJ);
      }
    }
  });
  SessionBase.SRC = SRC;
  var SessionDisplay = A.Component.create({
    ATTRS: {
      pageTitle: {
        value: DOC.title
      }
    },
    EXTENDS: A.Plugin.Base,
    NAME: 'liferaysessiondisplay',
    NS: 'display',
    prototype: {
      _afterDefActivatedFn: function _afterDefActivatedFn() {
        var instance = this;

        instance._uiSetActivated();
      },
      _afterDefExpiredFn: function _afterDefExpiredFn() {
        var instance = this;

        instance._host.unregisterInterval(instance._intervalId);

        instance._uiSetExpired();
      },
      _beforeHostWarned: function _beforeHostWarned() {
        var instance = this;
        var host = instance._host;
        var sessionLength = host.get('sessionLength');
        var timestamp = host.get('timestamp');
        var warningLength = host.get('warningLength');
        var elapsed = sessionLength;

        if (Lang.toInt(timestamp)) {
          elapsed = Math.floor((Date.now() - timestamp) / 1000) * 1000;
        }

        var remainingTime = sessionLength - elapsed;

        if (remainingTime > warningLength) {
          remainingTime = warningLength;
        }

        var bannerConfig = {
          remainingTime: remainingTime
        };

        instance._renderBanner(bannerConfig);

        instance._intervalId = host.registerInterval(function (elapsed, interval, hasWarned, hasExpired, warningMoment) {
          if (!hasWarned) {
            instance._uiSetActivated();
          } else if (!hasExpired) {
            if (warningMoment) {
              if (remainingTime <= 0) {
                remainingTime = warningLength;
              }

              var bannerConfig = {
                remainingTime: remainingTime
              };

              instance._renderBanner(bannerConfig);
            }

            elapsed = Math.floor((Date.now() - timestamp) / 1000) * 1000;
            remainingTime = sessionLength - elapsed;
          }

          remainingTime -= interval;
        });
      },
      _formatNumber: function _formatNumber(value) {
        return Lang.String.padNumber(Math.floor(value), 2);
      },
      _formatTime: function _formatTime(time) {
        var instance = this;
        time = Number(time);

        if (Lang.isNumber(time) && time > 0) {
          time /= 1000;
          BUFFER_TIME[0] = instance._formatNumber(time / 3600);
          time %= 3600;
          BUFFER_TIME[1] = instance._formatNumber(time / 60);
          time %= 60;
          BUFFER_TIME[2] = instance._formatNumber(time);
          time = BUFFER_TIME.join(':');
        } else {
          time = 0;
        }

        return time;
      },
      _onHostSessionStateChange: function _onHostSessionStateChange(event) {
        var instance = this;

        if (event.newVal === 'warned') {
          instance._beforeHostWarned(event);
        }
      },
      _renderBanner: function _renderBanner(config) {
        var instance = this;

        var remainingTimeFormatted = instance._formatTime(config.remainingTime);

        instance._updateRemainingTimeTitle(remainingTimeFormatted);

        Liferay.Util.openToast(Object.assign(config, {
          message: config.remainingTime >= 0 ? Lang.sub(instance._warningText, [remainingTimeFormatted]) : instance._expiredText,
          messageType: 'html',
          onClick: function onClick(eventPayload) {
            var event = eventPayload.event;
            var onClose = eventPayload.onClose;

            if (event.target.classList.contains('alert-link')) {
              event.preventDefault();

              instance._host.extend();

              onClose();
              instance._alertClosed = true;
            }
          },
          title: 'Warning',
          toastProps: {
            autoClose: config.remainingTime,
            role: 'alert'
          },
          type: 'warning'
        }));
      },
      _uiSetActivated: function _uiSetActivated() {
        var instance = this;
        DOC.title = instance.reset('pageTitle').get('pageTitle');

        instance._host.unregisterInterval(instance._intervalId);
      },
      _uiSetExpired: function _uiSetExpired() {
        var instance = this;
        var bannerConfig = {
          message: instance._expiredText,
          title: 'Danger',
          type: 'danger'
        };

        instance._renderBanner(bannerConfig);

        DOC.title = instance.get('pageTitle');
      },
      _updateRemainingTimeTitle: function _updateRemainingTimeTitle(remainingTime) {
        var instance = this;
        DOC.title = Lang.sub('Session\x20expires\x20in\x20\x7b0\x7d\x2e', [remainingTime]) + ' | ' + instance.get('pageTitle');
      },
      initializer: function initializer() {
        var instance = this;
        var host = instance.get('host');

        if (Liferay.Util.getTop() === CONFIG.win) {
          instance._host = host;
          instance._toggleText = {
            hide: 'Hide',
            show: 'Show'
          };
          instance._expiredText = 'Due\x20to\x20inactivity\x2c\x20your\x20session\x20has\x20expired\x2e\x20Please\x20save\x20any\x20data\x20you\x20may\x20have\x20entered\x20before\x20refreshing\x20the\x20page\x2e';
          instance._warningText = 'Due\x20to\x20inactivity\x2c\x20your\x20session\x20will\x20expire\x20in\x20\x7b0\x7d\x2e\x20To\x20extend\x20your\x20session\x20another\x20\x7b1\x7d\x20minute\x28s\x29\x2c\x20please\x20press\x20the\x20\x3cem\x3eExtend\x3c\x2fem\x3e\x20button\x2e\x20\x7b2\x7d';
          instance._warningText = Lang.sub(instance._warningText, ['<span class="countdown-timer">{0}</span>', host.get('sessionLength') / 60000, '<a class="alert-link" href="#">' + 'Extend' + '</a>']);
          host.on('sessionStateChange', instance._onHostSessionStateChange, instance);
          instance.afterHostMethod('_defActivatedFn', instance._afterDefActivatedFn);
          instance.afterHostMethod('_defExpiredFn', instance._afterDefExpiredFn);
        } else {
          host.unplug(instance);
        }
      }
    }
  });
  Liferay.SessionBase = SessionBase;
  Liferay.SessionDisplay = SessionDisplay;
}, '', {
  requires: ['aui-base', 'aui-component', 'aui-timer', 'cookie', 'plugin']
});
//# sourceMappingURL=session.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
// For details about this file see: LPS-2155
(function (A, Liferay) {
  var Util = Liferay.Util;
  var Lang = A.Lang;
  var AObject = A.Object;
  var htmlEscapedValues = [];
  var htmlUnescapedValues = [];
  var MAP_HTML_CHARS_ESCAPED = {
    '"': '&#034;',
    '&': '&amp;',
    "'": '&#039;',
    '/': '&#047;',
    '<': '&lt;',
    '>': '&gt;',
    '`': '&#096;'
  };
  var MAP_HTML_CHARS_UNESCAPED = {};
  AObject.each(MAP_HTML_CHARS_ESCAPED, function (item, index) {
    MAP_HTML_CHARS_UNESCAPED[item] = index;
    htmlEscapedValues.push(item);
    htmlUnescapedValues.push(index);
  });
  var REGEX_DASH = /-([a-z])/gi;
  var STR_RIGHT_SQUARE_BRACKET = ']';
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Util.actsAsAspect = function (object) {
    object["yield"] = null;
    object.rv = {};

    object.before = function (method, f) {
      var original = eval('this.' + method);

      this[method] = function () {
        f.apply(this, arguments);
        return original.apply(this, arguments);
      };
    };

    object.after = function (method, f) {
      var original = eval('this.' + method);

      this[method] = function () {
        this.rv[method] = original.apply(this, arguments);
        return f.apply(this, arguments);
      };
    };

    object.around = function (method, f) {
      var original = eval('this.' + method);

      this[method] = function () {
        this["yield"] = original;
        return f.apply(this, arguments);
      };
    };
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.addInputFocus = function () {
    A.use('aui-base', function (A) {
      var handleFocus = function handleFocus(event) {
        var target = event.target;
        var tagName = target.get('tagName');

        if (tagName) {
          tagName = tagName.toLowerCase();
        }

        var nodeType = target.get('type');

        if (tagName == 'input' && /text|password/.test(nodeType) || tagName == 'textarea') {
          var action = 'addClass';

          if (/blur|focusout/.test(event.type)) {
            action = 'removeClass';
          }

          target[action]('focus');
        }
      };

      A.on('focus', handleFocus, document);
      A.on('blur', handleFocus, document);
    });

    Util.addInputFocus = function () {};
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.addInputType = function (el) {
    Util.addInputType = Lang.emptyFn;

    if (Liferay.Browser.isIe() && Liferay.Browser.getMajorVersion() < 7) {
      Util.addInputType = function (el) {
        if (el) {
          el = A.one(el);
        } else {
          el = A.one(document.body);
        }

        var defaultType = 'text';
        el.all('input').each(function (item) {
          var type = item.get('type') || defaultType;
          item.addClass(type);
        });
      };
    }

    return Util.addInputType(el);
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.camelize = function (value, separator) {
    var regex = REGEX_DASH;

    if (separator) {
      regex = new RegExp(separator + '([a-z])', 'gi');
    }

    value = value.replace(regex, function (match0, match1) {
      return match1.toUpperCase();
    });
    return value;
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.clamp = function (value, min, max) {
    return Math.min(Math.max(value, min), max);
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.isEditorPresent = function (editorName) {
    return Liferay.EDITORS && Liferay.EDITORS[editorName];
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.randomMinMax = function (min, max) {
    return Math.round(Math.random() * (max - min)) + min;
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.selectAndCopy = function (el) {
    el.focus();
    el.select();

    if (document.all) {
      var textRange = el.createTextRange();
      textRange.execCommand('copy');
    }
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.setBox = function (oldBox, newBox) {
    for (var i = oldBox.length - 1; i > -1; i--) {
      oldBox.options[i] = null;
    }

    for (i = 0; i < newBox.length; i++) {
      oldBox.options[i] = new Option(newBox[i].value, i);
    }

    oldBox.options[0].selected = true;
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.startsWith = function (str, x) {
    return str.indexOf(x) === 0;
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.textareaTabs = function (event) {
    var el = event.currentTarget.getDOM();

    if (event.isKey('TAB')) {
      event.halt();
      var oldscroll = el.scrollTop;

      if (el.setSelectionRange) {
        var caretPos = el.selectionStart + 1;
        var elValue = el.value;
        el.value = elValue.substring(0, el.selectionStart) + '\t' + elValue.substring(el.selectionEnd, elValue.length);
        setTimeout(function () {
          el.focus();
          el.setSelectionRange(caretPos, caretPos);
        }, 0);
      } else {
        document.selection.createRange().text = '\t';
      }

      el.scrollTop = oldscroll;
      return false;
    }
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Util.uncamelize = function (value, separator) {
    separator = separator || ' ';
    value = value.replace(/([a-zA-Z][a-zA-Z])([A-Z])([a-z])/g, '$1' + separator + '$2$3');
    value = value.replace(/([a-z])([A-Z])/g, '$1' + separator + '$2');
    return value;
  };
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */


  Liferay.provide(Util, 'check', function (form, name, checked) {
    var checkbox = A.one(form[name]);

    if (checkbox) {
      checkbox.attr('checked', checked);
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'disableSelectBoxes', function (toggleBoxId, value, selectBoxId) {
    var selectBox = A.one('#' + selectBoxId);
    var toggleBox = A.one('#' + toggleBoxId);

    if (selectBox && toggleBox) {
      var dynamicValue = Lang.isFunction(value);

      var disabled = function disabled() {
        var currentValue = selectBox.val();
        var visible = value == currentValue;

        if (dynamicValue) {
          visible = value(currentValue, value);
        }

        toggleBox.attr('disabled', !visible);
      };

      disabled();
      selectBox.on('change', disabled);
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'disableTextareaTabs', function (textarea) {
    textarea = A.one(textarea);

    if (textarea && textarea.attr('textareatabs') != 'enabled') {
      textarea.attr('textareatabs', 'disabled');
      textarea.detach('keydown', Util.textareaTabs);
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'enableTextareaTabs', function (textarea) {
    textarea = A.one(textarea);

    if (textarea && textarea.attr('textareatabs') != 'enabled') {
      textarea.attr('textareatabs', 'disabled');
      textarea.on('keydown', Util.textareaTabs);
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'removeItem', function (box, value) {
    box = A.one(box);
    var selectedIndex = box.get('selectedIndex');

    if (!value) {
      box.all('option').item(selectedIndex).remove(true);
    } else {
      box.all('option[value=' + value + STR_RIGHT_SQUARE_BRACKET).item(selectedIndex).remove(true);
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'resizeTextarea', function (elString, usingRichEditor) {
    var el = A.one('#' + elString);

    if (!el) {
      el = A.one('textarea[name=' + elString + STR_RIGHT_SQUARE_BRACKET);
    }

    if (el) {
      var pageBody = A.getBody();
      var diff;

      var resize = function resize(event) {
        var pageBodyHeight = pageBody.get('winHeight');

        if (usingRichEditor) {
          try {
            if (el.get('nodeName').toLowerCase() != 'iframe') {
              el = window[elString];
            }
          } catch (e) {}
        }

        if (!diff) {
          var buttonRow = pageBody.one('.button-holder');
          var templateEditor = pageBody.one('.lfr-template-editor');

          if (buttonRow && templateEditor) {
            var region = templateEditor.getXY();
            diff = buttonRow.outerHeight(true) + region[1] + 25;
          } else {
            diff = 170;
          }
        }

        el = A.one(el);
        var styles = {
          width: '98%'
        };

        if (event) {
          styles.height = pageBodyHeight - diff;
        }

        if (usingRichEditor) {
          if (!el || !A.DOM.inDoc(el)) {
            A.on('available', function () {
              el = A.one(window[elString]);

              if (el) {
                el.setStyles(styles);
              }
            }, '#' + elString + '_cp');
            return;
          }
        }

        if (el) {
          el.setStyles(styles);
        }
      };

      resize();
      var dialog = Liferay.Util.getWindow();

      if (dialog) {
        var resizeEventHandle = dialog.iframe.after('resizeiframe:heightChange', resize);
        A.getWin().on('unload', resizeEventHandle.detach, resizeEventHandle);
      }
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'setSelectedValue', function (col, value) {
    var option = A.one(col).one('option[value=' + value + STR_RIGHT_SQUARE_BRACKET);

    if (option) {
      option.attr('selected', true);
    }
  }, ['aui-base']);
  /**
   * @deprecated As of Athanasius (7.3.x), with no direct replacement
   */

  Liferay.provide(Util, 'switchEditor', function (options) {
    var uri = options.uri;
    var windowName = Liferay.Util.getWindowName();
    var dialog = Liferay.Util.getWindow(windowName);

    if (dialog) {
      dialog.iframe.set('uri', uri);
    }
  }, ['aui-io']);
})(AUI(), Liferay);
//# sourceMappingURL=deprecated.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function () {
  var LiferayAUI = Liferay.AUI;
  var combine = LiferayAUI.getCombine();
  window.__CONFIG__ = {
    basePath: '',
    combine: combine,
    reportMismatchedAnonymousModules: 'warn',
    url: combine ? LiferayAUI.getComboPath() : Liferay.ThemeDisplay.getCDNBaseURL()
  };

  if (!combine) {
    __CONFIG__.defaultURLParams = {
      languageId: themeDisplay.getLanguageId()
    };
  }

  __CONFIG__.maps = Liferay.MAPS;
  __CONFIG__.modules = Liferay.MODULES;
  __CONFIG__.paths = Liferay.PATHS;
  __CONFIG__.resolvePath = Liferay.RESOLVE_PATH;
  __CONFIG__.namespace = 'Liferay';
  __CONFIG__.explainResolutions = Liferay.EXPLAIN_RESOLUTIONS;
  __CONFIG__.exposeGlobal = Liferay.EXPOSE_GLOBAL;
  __CONFIG__.logLevel = Liferay.LOG_LEVEL;
  __CONFIG__.waitTimeout = Liferay.WAIT_TIMEOUT;
})();
//# sourceMappingURL=config.js.map
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}return r(e,[{key:"build",value:function(e){var t=this,n=this._config,r=[],o=[],i=[],a=n.basePath;return a.length&&"/"!==a.charAt(a.length-1)&&(a+="/"),e.forEach((function(e){var l=n.getModule(e),u=t._getModulePath(l);n.combine?(r.push(u),o.push(l.name)):i.push({modules:[l.name],url:t._getURLWithParams(n.url+a+u)})})),r.length&&(i=i.concat(this._generateBufferURLs(o,r,{basePath:a,url:n.url,urlMaxLength:n.urlMaxLength})),r.length=0),i}},{key:"_generateBufferURLs",value:function(e,t,n){for(var r=n.basePath,o=[],i=n.urlMaxLength,a={modules:[e[0]],url:n.url+r+t[0]},l=1;l<t.length;l++){var u=e[l],s=t[l];a.url.length+r.length+s.length+1<i?(a.modules.push(u),a.url+="&"+r+s):(o.push(a),a={modules:[u],url:n.url+r+s})}return a.url=this._getURLWithParams(a.url),o.push(a),o}},{key:"_getModulePath",value:function(e){var t=this._config.paths,n=e.name;return Object.keys(t).forEach((function(e){n!==e&&0!==n.indexOf(e+"/")||(n=t[e]+n.substring(e.length))})),n.lastIndexOf(".js")!==n.length-3&&(n+=".js"),n}},{key:"_getURLWithParams",value:function(e){var t=this._config.defaultURLParams||{},n=Object.keys(t);if(!n.length)return e;var r=n.map((function(e){return e+"="+t[e]})).join("&");return e+(e.indexOf("?")>-1?"&":"?")+r}}]),e}();t.default=o},function(e,t,n){"use strict";var r,o=n(2),i=(r=o)&&r.__esModule?r:{default:r};var a=window.__CONFIG__||{},l="string"==typeof a.namespace?a.namespace:void 0,u=void 0===a.exposeGlobal||a.exposeGlobal,s=new i.default(a);if(l){var c=window[l]?window[l]:{};c.Loader=s,window[l]=c}else window.Loader=s;u&&(window.Loader=s,window.require=i.default.prototype.require.bind(s),window.define=i.default.prototype.define.bind(s),window.define.amd={})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(3)),i=c(n(4)),a=c(n(7)),l=c(n(8)),u=c(n(9)),s=c(n(0));function c(e){return e&&e.__esModule?e:{default:e}}function f(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=new i.default(t||window.__CONFIG__),this._log=new l.default(this._config),this._dependencyResolver=new a.default(this._config),this._urlBuilder=new s.default(this._config),this._scriptLoader=new u.default(n||window.document,this._config,this._log),this._requireCallId=0}return r(e,[{key:"version",value:function(){return o.default.version}},{key:"define",value:function(){for(var e=this._config,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=e.getModule(o);if(i&&i.defined)this._log.warn("Module '"+o+"' is being redefined. Only the first","definition will be used");else{var a=n[1],l=n[2];if(2==n.length&&(l=a,a=["require","exports","module"]),"function"!=typeof l){var u=l;l=function(){return u}}if(!(i=e.getModule(o)))throw new Error("Trying to define a module that was not registered: "+o+"\nThis usually means that someone is calling define() for a module that has not been previously required.");if(i.defined)throw new Error("Trying to define a module more than once: "+o+"\nThis usually means that someone is calling define() more than once for the same module, which can lead to unexpected results.");this._log.resolution("Defining",i.name),i.factory=l,i.dependencies=a,i.define.resolve(n)}}},{key:"require",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=this._scriptLoader,i=this._config,a=this._requireCallId++,l=void 0,u=void 0,s=void 0;if(1==n.length)l=n[0],u=void 0,s=void 0;else if(2==n.length){var c=n[n.length-1];"function"==typeof c?(l=n[0],u=c,s=void 0):null==c?(l=n[0],u=void 0,s=void 0):(l=n,u=void 0,s=void 0)}else{var d=n[n.length-1],h=!1;if("function"!=typeof d&&null!=d||(h=!0),h){var p=n[n.length-2],m=!1;"function"!=typeof p&&null!=p||(m=!0),m?(l=n.slice(0,n.length-2),u=p,s=d):(l=n.slice(0,n.length-1),u=d,s=void 0)}else l=n,u=void 0,s=void 0}if("string"==typeof l)l=[l];else if(1==l.length&&Array.isArray(l[0])){var v;l=(v=[]).concat.apply(v,f(l))}if(void 0===u&&(u=function(){}),void 0===s){var g=new Error("");s=function(t){var n="(n/a)";g.stack&&(n="\n"+(n=g.stack.split("\n").map((function(e){return"        "+e})).join("\n"))),e._log.error("\n","A require() call has failed but no failure handler was","provided.\n","Note that even if the call stack of this error trace","looks like coming from the Liferay AMD Loader, it is not","an error in the Loader what has caused it, but an error","caused by the require() call.\n","The reason why the Loader is in the stack trace is","because it is printing the error so that it doesn't get","lost.\n","However, we recommend providing a failure handler in all","require() calls to be able to recover from errors better","and to avoid the appearance of this message.\n","\n","Some information about the require() call follows:\n","  · Require call id:",a,"\n","  · Required modules:",l,"\n","  · Missing modules:",t.missingModules?t.missingModules:"(n/a)","\n","  · Stack trace of the require() call:",""+n,"\n",t)}}u=this._interceptHandler(u,"success",a),s=this._interceptHandler(s,"failure",a);var y=void 0,_=void 0,b=void 0,w=!1;this._dependencyResolver.resolve(l).then((function(t){if(e._log.resolution("Require call",a,"resolved modules",l,"to",t),e._throwOnLegacyProtocolResolutionErrors(t),e._logServerMessages(l,t),t.errors&&t.errors.length>1)throw Object.assign(new Error("The server generated some errors while resolving modules"),{resolutionErrors:t.errors});return i.addMappings(t.configMap),i.addPaths(t.pathMap),y=t.resolvedModules,(_=e._getUnregisteredModuleNames(y)).forEach((function(e){var n={map:t.moduleMap[e]},r=t.moduleFlags?t.moduleFlags[e]:{};(r=r||{}).esModule&&(n.esModule=!0),i.addModule(e,n)})),b=e._setRejectTimeout(l,t,(function(){w=!0,s.apply(void 0,arguments)})),e._log.resolution("Fetching",_,"from require call",a),o.loadModules(_)})).then((function(){if(!w)return e._waitForModuleDefinitions(y)})).then((function(){if(!w){clearTimeout(b),e._setModuleImplementations(a,y);var t=e._getModuleImplementations(l);u.apply(void 0,f(t))}})).catch((function(e){w||(b&&clearTimeout(b),s(e))}))}},{key:"_interceptHandler",value:function(e,t,n){var r=this;return function(){r._log.resolution("Invoking",t,"handler for","require call",n);try{e.apply(void 0,arguments)}catch(e){r._log.error("\n","A require() call",t,"handler has thrown an error.\n","Note that even if the call stack of this error trace","looks like coming from the Liferay AMD Loader, it is not","an error in the Loader what has caused it, but an error","in the handler's code.\n","The reason why the Loader is in the stack trace is","because it is printing the error on behalf of the handler","so that it doesn't get lost.\n","However, we recommend wrapping all handler code inside a","try/catch to be able to recover from errors better and to","avoid the appearance of this message.\n","\n",e)}}}},{key:"_getUnregisteredModuleNames",value:function(e){var t=this._config;return e.filter((function(e){return!t.getModule(e)}))}},{key:"_logServerMessages",value:function(e,t){t.errors&&t.errors.length>0&&this._log.error("Errors returned from server for require(",e,"):",t.errors),t.warnings&&t.warnings.length>0&&this._log.warn("Warnings returned from server for require(",e,"):",t.warnings)}},{key:"_setRejectTimeout",value:function(e,t,n){var r=this._config;if(0!==r.waitTimeout)return setTimeout((function(){var o=t.resolvedModules.filter((function(e){var t=r.getModule(e);return!t||!t.implemented})),i=Object.assign(new Error("Load timeout for modules: "+e),{missingModules:o,modules:e,resolution:t});n(i)}),r.waitTimeout)}},{key:"_throwOnLegacyProtocolResolutionErrors",value:function(e){var t=e.resolvedModules.filter((function(e){return 0===e.indexOf(":ERROR:")})).map((function(e){return e.substr(7)}));if(t.length>0)throw Object.assign(new Error("The following problems where detected while resolving modules:\n"+t.map((function(e){return"    · "+e})).join("\n")),{resolutionErrors:t})}},{key:"_waitForModuleDefinitions",value:function(e){var t=this._config;return Promise.all(t.getModules(e).map((function(e){return e.define})))}},{key:"_waitForModuleImplementations",value:function(e){var t=this._config;return Promise.all(t.getModules(e).map((function(e){return e.implement})))}},{key:"_setModuleImplementations",value:function(e,t){var n=this,r=this._config;r.getModules(t).forEach((function(t){if(!t.implemented){if(t.implement.rejected)throw t.implement.rejection;n._log.resolution("Implementing",t.name,"from require call",e);try{var o={get exports(){return t.implementation},set exports(e){t.implementation=e}},i=t.dependencies.map((function(e){if("exports"===e)return o.exports;if("module"===e)return o;if("require"===e)return n._createLocalRequire(t);var i=r.getDependency(t.name,e);if(!i)throw new Error("Unsatisfied dependency: "+e+" found in module "+t.name);if(!i.implementation&&!i.implemented)throw new Error('Module "'+i.name+'" has not been loaded yet for context: '+t.name);return i.implementation})),a=t.factory.apply(t,f(i));void 0!==a&&(t.implementation=a),t.implement.resolve(t.implementation)}catch(e){throw t.implement.fulfilled||t.implement.reject(e),e}}}))}},{key:"_createLocalRequire",value:function(e){var t=this,n=this._config,r=function(r){for(var o=arguments.length,i=Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(i.length>0)return t.require.apply(t,[r].concat(i));var l=n.getDependency(e.name,r);if(!(l&&"implementation"in l))throw new Error('Module "'+r+'" has not been loaded yet for context: '+e.name);return l.implementation};return r.toUrl=function(e){return t._urlBuilder.build([e])[0].url},r}},{key:"_getModuleImplementations",value:function(e){return this._config.getModules(e).map((function(e){return e.implementation}))}}]),e}();t.default=d,d.prototype.define.amd={}},function(e){e.exports=JSON.parse('{"name":"liferay-amd-loader","version":"4.3.0","description":"AMD Loader with support for combo URL and conditional loading","scripts":{"clean":"rm -rf build","build":"node bin/build-loader.js","ci":"yarn format:check && yarn lint && yarn build && yarn build-demo && yarn test","build-demo":"node bin/build-demo.js","demo":"node bin/run-demo.js","test":"jest --runInBand","format":"prettier --write \'{*,.*}.js\' \'bin/**/{*,.*}.js\' \'src/**/{*,.*}.js\'","format:check":"prettier --list-different \'{*,.*}.js\' \'bin/**/{*,.*}.js\' \'src/**/{*,.*}.js\'","lint":"eslint \'.*.js\' \'*.js\' \'bin/**/{*,.*}.js\' \'src/**/{*,.*}.js\'","lint:fix":"eslint --fix \'.*.js\' \'*.js\' \'bin/**/{*,.*}.js\' \'src/**/{*,.*}.js\'","prepublish":"publish-please guard","publish-please":"publish-please","prepublishOnly":"yarn build && yarn build-demo && yarn test","proxyPortal":"webpack-dev-server --config webpack.proxyPortal.js"},"repository":{"type":"git","url":"git+https://github.com/liferay/liferay-amd-loader.git"},"jest":{"collectCoverage":true,"coverageDirectory":"build/coverage","modulePathIgnorePatterns":["liferay-amd-loader/build/.*",".*/__tests__/__fixtures__/.*"],"testPathIgnorePatterns":[".eslintrc.js"],"testURL":"http://localhost/"},"author":{"name":"Iliyan Peychev"},"license":"LGPL-3.0","keywords":["Liferay","AMD","ES6","Loader"],"bugs":{"url":"https://github.com/liferay/liferay-amd-loader/issues"},"homepage":"https://github.com/liferay/liferay-amd-loader","files":[".babelrc",".eslintrc.js",".publishrc","LICENSE.md","package.json","README.md","webpack.config.js","src","bin","build","src"],"devDependencies":{"babel-loader":"^7.1.2","babel-preset-es2015":"^6.24.1","combohandler":"^0.4.0","eslint":"^6.5.1","eslint-config-liferay":"^13.0.0","fs-extra":"^5.0.0","globby":"^7.1.1","http-server":"^0.11.1","jest":"^22.2.1","prettier":"^1.16.4","publish-please":"^2.3.1","uglifyjs-webpack-plugin":"^1.2.0","webpack":"^4.29.6","webpack-cli":"^3.3.0","webpack-dev-server":"^3.2.1"}}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(5),u=(r=l)&&r.__esModule?r:{default:r};var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._modules={},this._maps={},this._paths={},this._config={maps:{},paths:{}},this._parse(t,"defaultURLParams",{}),this._parse(t,"explainResolutions",!1),this._parse(t,"showWarnings",!1),this._parse(t,"waitTimeout",7e3),this._parse(t,"basePath","/"),this._parse(t,"resolvePath","/o/js_resolve_modules"),this._parse(t,"combine",!1),this._parse(t,"url",""),this._parse(t,"urlMaxLength",2e3),this._parse(t,"logLevel","error")}return a(e,[{key:"addModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._modules[e])throw new Error("Module is already registered: "+e);var n=new u.default(e);return Object.entries(t).forEach((function(e){var t=i(e,2),r=t[0],o=t[1];n[r]=o})),this._modules[e]=n,n}},{key:"addMappings",value:function(e){Object.assign(this._maps,e)}},{key:"addPaths",value:function(e){Object.assign(this._paths,e)}},{key:"getModules",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return void 0===t?Object.values(this._modules):t.map((function(t){return e.getModule(t)}))}},{key:"getModule",value:function(e){var t=this._modules[e];if(!t){var n=this._mapModule(e);t=this._modules[n]}return t}},{key:"getDependency",value:function(e,t){var n=this.getModule(e),r=this._modules[t];if(!r){var o=this._mapModule(t,n.map);r=this._modules[o]}return r}},{key:"_parse",value:function(e,t,n){this._config[t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:n}},{key:"_mapModule",value:function(e,t){return t&&(e=this._mapMatches(e,t)),Object.keys(this._maps).length>0&&(e=this._mapMatches(e,this._maps)),e}},{key:"_mapMatches",value:function(e,t){var n=t[e];return n?"object"===(void 0===n?"undefined":o(n))?n.value:n:((n=this._mapExactMatch(e,t))||(n=this._mapPartialMatch(e,t)),n||(n=this._mapWildcardMatch(e,t)),n||e)}},{key:"_mapExactMatch",value:function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(r.value&&r.exactMatch&&e===n)return r.value}}},{key:"_mapPartialMatch",value:function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(!r.exactMatch&&(r.value&&(r=r.value),e===n||0===e.indexOf(n+"/")))return r+e.substring(n.length)}}},{key:"_mapWildcardMatch",value:function(e,t){if("function"==typeof t["*"])return t["*"](e)}},{key:"explainResolutions",get:function(){return this._config.explainResolutions}},{key:"showWarnings",get:function(){return this._config.showWarnings}},{key:"waitTimeout",get:function(){return this._config.waitTimeout}},{key:"basePath",get:function(){return this._config.basePath}},{key:"resolvePath",get:function(){return this._config.resolvePath}},{key:"combine",get:function(){return this._config.combine}},{key:"url",get:function(){return this._config.url}},{key:"urlMaxLength",get:function(){return this._config.urlMaxLength}},{key:"logLevel",get:function(){return this._config.logLevel}},{key:"defaultURLParams",get:function(){return this._config.defaultURLParams}},{key:"paths",get:function(){return this._paths}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),a=(r=i)&&r.__esModule?r:{default:r};var l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._dependencies=void 0,this._factory=void 0,this._implementation={},this._map=void 0,this._state={_define:a.default.new(),_fetch:a.default.new(),_implement:a.default.new()}}return o(e,[{key:"name",get:function(){return this._name},set:function(e){throw new Error("Name of module "+this.name+" is read-only")}},{key:"dependencies",get:function(){return this._dependencies},set:function(e){if(this._dependencies)throw new Error("Dependencies of module "+this.name+" already set");this._dependencies=e}},{key:"factory",get:function(){return this._factory},set:function(e){if(this._factory)throw new Error("Factory of module "+this.name+" already set");this._factory=e}},{key:"implementation",get:function(){return this._implementation},set:function(e){this._implementation=e}},{key:"map",get:function(){return this._map},set:function(e){if(this._map)throw new Error("Local module map of module "+this.name+" already set");this._map=e}},{key:"esModule",get:function(){return this._implementation.__esModule},set:function(e){Object.defineProperty(this._implementation,"__esModule",{configurable:!0,value:e,writable:!0})}},{key:"fetch",get:function(){return this._state._fetch}},{key:"fetched",get:function(){return this.fetch.resolved}},{key:"define",get:function(){return this._state._define}},{key:"defined",get:function(){return this.define.resolved}},{key:"implement",get:function(){return this._state._implement}},{key:"implemented",get:function(){return this.implement.resolved}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(){throw function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new Error("Don't construct ResolvablePromise objects directly: rely on ResolvablePromise.new() instead")};function o(e){if(e.fulfilled)throw new Error("Promise already fulfilled")}t.default=r,r.new=function(){var e={},t=new Promise((function(t,n){e._resolve=t,e._reject=n}));return Object.assign(t,e,{fulfilled:!1,rejected:!1,rejection:void 0,resolution:void 0,resolved:!1}),t.resolve=function(e){return function(e,t){o(e),e.fulfilled=!0,e.resolved=!0,e.resolution=t,e._resolve(t)}(t,e)},t.reject=function(e){return function(e,t){o(e),e.fulfilled=!0,e.rejected=!0,e.rejection=t,e._reject(t)}(t,e)},"undefined"!=typeof jest&&t.catch((function(){})),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t,this._cachedResolutions={}}return r(e,[{key:"resolve",value:function(e){var t=this;if(void 0===e||0==e.length)throw new Error("Argument 'modules' cannot be undefined or empty");var n=this._config;return new Promise((function(r,o){var i=t._cachedResolutions[e];if(i)r(i);else{var a="modules="+encodeURIComponent(e),l=n.resolvePath+"?"+a,u={};l.length>n.urlMaxLength&&(l=n.resolvePath,u={body:a,method:"POST"}),fetch(l,u).then((function(e){return e.text()})).then((function(n){var o=JSON.parse(n);t._cachedResolutions[e]=o,r(o)})).catch(o)}}))}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o={off:0,error:1,warn:2,info:3,debug:4},i="liferay-amd-loader |",a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}return r(e,[{key:"error",value:function(){var e;if(this._applies("error")){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[i].concat(n))}}},{key:"warn",value:function(){var e;if(this._applies("warn")){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).warn.apply(e,[i].concat(n))}}},{key:"info",value:function(){var e;if(this._applies("info")){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).info.apply(e,[i].concat(n))}}},{key:"debug",value:function(){var e;if(this._applies("debug")){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).debug.apply(e,[i].concat(n))}}},{key:"resolution",value:function(){var e;if(this._config.explainResolutions){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).log.apply(e,[i].concat(n))}}},{key:"_applies",value:function(e){var t=o[this._config.logLevel];return o[e]<=t}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};var l=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._document=t,this._config=n,this._log=r,this._urlBuilder=new a.default(n),this._injectedScripts={}}return o(e,[{key:"loadModules",value:function(e){var t=this,n=this._urlBuilder;if(0==e.length)return Promise.resolve();var r=n.build(e).map((function(e){return t._loadScript(e)}));return Promise.all(r)}},{key:"_loadScript",value:function(e){var t=this,n=this._config.getModules(e.modules),r=this._injectedScripts[e.url];return r||((r=this._document.createElement("script")).src=e.url,r.async=!1,r.onload=r.onreadystatechange=function(){t.readyState&&"complete"!==t.readyState&&"load"!==t.readyState||(r.onload=r.onreadystatechange=null,r.onerror=null,n.forEach((function(e){e.fetch.fulfilled?t._log.warn("Module '"+e.name+"' is being fetched from\n",r.src,"but was already fetched from\n",e.fetch.resolved?e.fetch.resolution.src:e.fetch.rejection.script.src):e.fetch.resolve(r)})))},r.onerror=function(){r.onload=r.onreadystatechange=null,r.onerror=null;var t=Object.assign(new Error("Unable to load script from URL "+e.url),{modules:e.modules,script:r,url:e.url});n.forEach((function(e){return e.fetch.reject(t)}))},this._injectedScripts[e.url]=r,this._document.head.appendChild(r)),Promise.all(n.map((function(e){return e.fetch})))}}]),e}();t.default=l}]);
//# sourceMappingURL=loader.js.map
!function(root, factory) {
    false && "function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
    define([], function() {
        return root.svg4everybody = factory();
    }) : "object" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory() : root.svg4everybody = factory();
}(this, function() {
    /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */
    function embed(parent, svg, target) {
        // if the target exists
        if (target) {
            // create a document fragment to hold the contents of the target
            var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute("viewBox") && target.getAttribute("viewBox");
            // conditionally set the viewBox on the svg
            viewBox && svg.setAttribute("viewBox", viewBox);
            // copy the contents of the clone into the fragment
            for (// clone the target
            var clone = target.cloneNode(!0); clone.childNodes.length; ) {
                fragment.appendChild(clone.firstChild);
            }
            // append the fragment into the svg
            parent.appendChild(fragment);
        }
    }
    function loadreadystatechange(xhr) {
        // listen to changes in the request
        xhr.onreadystatechange = function() {
            // if the request is ready
            if (4 === xhr.readyState) {
                // get the cached html document
                var cachedDocument = xhr._cachedDocument;
                // ensure the cached html document based on the xhr response
                cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(""), 
                cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item
                xhr._embeds.splice(0).map(function(item) {
                    // get the cached target
                    var target = xhr._cachedTarget[item.id];
                    // ensure the cached target
                    target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), 
                    // embed the target into the svg
                    embed(item.parent, item.svg, target);
                });
            }
        }, // test the ready state change immediately
        xhr.onreadystatechange();
    }
    function svg4everybody(rawopts) {
        function oninterval() {
            // while the index exists in the live <use> collection
            for (// get the cached <use> index
            var index = 0; index < uses.length; ) {
                // get the current <use>
                var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute("xlink:href") || use.getAttribute("href");
                if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)), 
                svg && src) {
                    if (polyfill) {
                        if (!opts.validate || opts.validate(src, svg, use)) {
                            // remove the <use> element
                            parent.removeChild(use);
                            // parse the src and get the url and id
                            var srcSplit = src.split("#"), url = srcSplit.shift(), id = srcSplit.join("#");
                            // if the link is external
                            if (url.length) {
                                // get the cached xhr request
                                var xhr = requests[url];
                                // ensure the xhr request exists
                                xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open("GET", url), xhr.send(), 
                                xhr._embeds = []), // add the svg and id as an item to the xhr embeds list
                                xhr._embeds.push({
                                    parent: parent,
                                    svg: svg,
                                    id: id
                                }), // prepare the xhr ready state change event
                                loadreadystatechange(xhr);
                            } else {
                                // embed the local id into the svg
                                embed(parent, svg, document.getElementById(id));
                            }
                        } else {
                            // increase the index when the previous value was not "valid"
                            ++index, ++numberOfSvgUseElementsToBypass;
                        }
                    }
                } else {
                    // increase the index when the previous value was not "valid"
                    ++index;
                }
            }
            // continue the interval
            (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);
        }
        var polyfill, opts = Object(rawopts), newerIEUA = /\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/, webkitUA = /\bAppleWebKit\/(\d+)\b/, olderEdgeUA = /\bEdge\/12\.(\d+)\b/, edgeUA = /\bEdge\/.(\d+)\b/, inIframe = window.top !== window.self;
        polyfill = "polyfill" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;
        // create xhr requests object
        var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName("use"), numberOfSvgUseElementsToBypass = 0;
        // conditionally start the interval if the polyfill is active
        polyfill && oninterval();
    }
    function getSVGAncestor(node) {
        for (var svg = node; "svg" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}
        return svg;
    }
    return svg4everybody;
});
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (Liferay) {
  var DOMTaskRunner = {
    _scheduledTasks: [],
    _taskStates: [],
    addTask: function addTask(task) {
      var instance = this;

      instance._scheduledTasks.push(task);
    },
    addTaskState: function addTaskState(state) {
      var instance = this;

      instance._taskStates.push(state);
    },
    reset: function reset() {
      var instance = this;
      instance._taskStates.length = 0;
      instance._scheduledTasks.length = 0;
    },
    runTasks: function runTasks(node) {
      var instance = this;
      var scheduledTasks = instance._scheduledTasks;
      var taskStates = instance._taskStates;
      var tasksLength = scheduledTasks.length;
      var taskStatesLength = taskStates.length;

      for (var i = 0; i < tasksLength; i++) {
        var task = scheduledTasks[i];
        var taskParams = task.params;

        for (var j = 0; j < taskStatesLength; j++) {
          var state = taskStates[j];

          if (task.condition(state, taskParams, node)) {
            task.action(state, taskParams, node);
          }
        }
      }
    }
  };
  Liferay.DOMTaskRunner = DOMTaskRunner;
})(Liferay);
//# sourceMappingURL=dom_task_runner.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (A, Liferay) {
  var CLICK_EVENTS = {};
  var Util = Liferay.Util;
  A.use('attribute', 'oop', function (A) {
    A.augment(Liferay, A.Attribute, true);
  });
  Liferay.provide(Liferay, 'delegateClick', function (id, fn) {
    var el = A.config.doc.getElementById(id);

    if (!el || el.id != id) {
      return;
    }

    var guid = A.one(el).addClass('lfr-delegate-click').guid();
    CLICK_EVENTS[guid] = fn;

    if (!Liferay._baseDelegateHandle) {
      Liferay._baseDelegateHandle = A.getBody().delegate('click', Liferay._baseDelegate, '.lfr-delegate-click');
    }
  }, ['aui-base']);

  Liferay._baseDelegate = function (event) {
    var id = event.currentTarget.attr('id');
    var fn = CLICK_EVENTS[id];

    if (fn) {
      fn.apply(this, arguments);
    }
  };

  Liferay._CLICK_EVENTS = CLICK_EVENTS;
  Liferay.provide(window, 'submitForm', function (form, action, singleSubmit, validate) {
    if (!Util._submitLocked) {
      if (form.jquery) {
        form = form[0];
      }

      Liferay.fire('submitForm', {
        action: action,
        form: A.one(form),
        singleSubmit: singleSubmit,
        validate: validate !== false
      });
    }
  }, ['aui-base', 'aui-form-validator', 'aui-url', 'liferay-form']);
  Liferay.publish('submitForm', {
    defaultFn: function defaultFn(event) {
      var form = event.form;
      var hasErrors = false;

      if (event.validate) {
        var liferayForm = Liferay.Form.get(form.attr('id'));

        if (liferayForm) {
          var validator = liferayForm.formValidator;

          if (A.instanceOf(validator, A.FormValidator)) {
            validator.validate();
            hasErrors = validator.hasErrors();

            if (hasErrors) {
              validator.focusInvalidField();
            }
          }
        }
      }

      if (!hasErrors) {
        var action = event.action || form.attr('action');
        var singleSubmit = event.singleSubmit;
        var inputs = form.all('button[type=submit], input[type=button], input[type=image], input[type=reset], input[type=submit]');
        Util.disableFormButtons(inputs, form);

        if (singleSubmit === false) {
          Util._submitLocked = A.later(1000, Util, Util.enableFormButtons, [inputs, form]);
        } else {
          Util._submitLocked = true;
        }

        var baseURL;
        var queryString;
        var searchParamsIndex = action.indexOf('?');

        if (searchParamsIndex === -1) {
          baseURL = action;
          queryString = '';
        } else {
          baseURL = action.slice(0, searchParamsIndex);
          queryString = action.slice(searchParamsIndex + 1);
        }

        var searchParams = new URLSearchParams(queryString);
        var authToken = searchParams.get('p_auth') || '';

        if (authToken.includes('#')) {
          authToken = authToken.substring(0, authToken.indexOf('#'));
        }

        form.append('<input name="p_auth" type="hidden" value="' + authToken + '" />');

        if (authToken) {
          searchParams["delete"]('p_auth');
          action = baseURL + '?' + searchParams.toString();
        }

        form.attr('action', action);
        Util.submitForm(form);
        form.attr('target', '');
        Util._submitLocked = null;
      }
    }
  });
  Liferay.after('closeWindow', function (event) {
    var id = event.id;
    var dialog = Util.getTop().Liferay.Util.Window.getById(id);

    if (dialog && dialog.iframe) {
      var dialogWindow = dialog.iframe.node.get('contentWindow').getDOM();
      var openingWindow = dialogWindow.Liferay.Util.getOpener();
      var redirect = event.redirect;

      if (redirect) {
        openingWindow.Liferay.Util.navigate(redirect);
      } else {
        var refresh = event.refresh;

        if (refresh && openingWindow) {
          var data;

          if (!event.portletAjaxable) {
            data = {
              portletAjaxable: false
            };
          }

          openingWindow.Liferay.Portlet.refresh('#p_p_id_' + refresh + '_', data);
        }
      }

      dialog.hide();
    }
  });
})(AUI(), Liferay);
//# sourceMappingURL=events.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (Liferay) {
  Liferay.lazyLoad = function () {
    var failureCallback;

    var isFunction = function isFunction(val) {
      return typeof val === 'function';
    };

    var modules;
    var successCallback;

    if (Array.isArray(arguments[0])) {
      modules = arguments[0];
      successCallback = isFunction(arguments[1]) ? arguments[1] : null;
      failureCallback = isFunction(arguments[2]) ? arguments[2] : null;
    } else {
      modules = [];

      for (var i = 0; i < arguments.length; ++i) {
        if (typeof arguments[i] === 'string') {
          modules[i] = arguments[i];
        } else if (isFunction(arguments[i])) {
          successCallback = arguments[i];
          failureCallback = isFunction(arguments[++i]) ? arguments[i] : null;
          break;
        }
      }
    }

    return function () {
      var args = [];

      for (var i = 0; i < arguments.length; ++i) {
        args.push(arguments[i]);
      }

      Liferay.Loader.require(modules, function () {
        for (var i = 0; i < arguments.length; ++i) {
          args.splice(i, 0, arguments[i]);
        }

        successCallback.apply(successCallback, args);
      }, failureCallback);
    };
  };
})(Liferay);
//# sourceMappingURL=lazy_load.js.map
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
Liferay = window.Liferay || {};

(function (Liferay) {
  var isFunction = function isFunction(val) {
    return typeof val === 'function';
  };

  var isNode = function isNode(node) {
    return node && (node._node || node.jquery || node.nodeType);
  };

  var REGEX_METHOD_GET = /^get$/i;
  var STR_MULTIPART = 'multipart/form-data';

  Liferay.namespace = function namespace(obj, path) {
    if (path === undefined) {
      path = obj;
      obj = this;
    }

    var parts = path.split('.');

    for (var part; parts.length && (part = parts.shift());) {
      if (obj[part] && obj[part] !== Object.prototype[part]) {
        obj = obj[part];
      } else {
        obj = obj[part] = {};
      }
    }

    return obj;
  };
  /**
   * OPTIONS
   *
   * Required
   * service {string|object}: Either the service name, or an object with the keys as the service to call, and the value as the service configuration object.
   *
   * Optional
   * data {object|node|string}: The data to send to the service. If the object passed is the ID of a form or a form element, the form fields will be serialized and used as the data.
   * successCallback {function}: A function to execute when the server returns a response. It receives a JSON object as it's first parameter.
   * exceptionCallback {function}: A function to execute when the response from the server contains a service exception. It receives a the exception message as it's first parameter.
   */


  var Service = function Service() {
    var args = Service.parseInvokeArgs(Array.prototype.slice.call(arguments, 0));
    return Service.invoke.apply(Service, args);
  };

  Service.URL_INVOKE = themeDisplay.getPathContext() + '/api/jsonws/invoke';

  Service.bind = function () {
    var args = Array.prototype.slice.call(arguments, 0);
    return function () {
      var newArgs = Array.prototype.slice.call(arguments, 0);
      return Service.apply(Service, args.concat(newArgs));
    };
  };

  Service.parseInvokeArgs = function (args) {
    var instance = this;
    var payload = args[0];
    var ioConfig = instance.parseIOConfig(args);

    if (typeof payload === 'string') {
      payload = instance.parseStringPayload(args);
      instance.parseIOFormConfig(ioConfig, args);
      var lastArg = args[args.length - 1];

      if (_typeof(lastArg) === 'object' && lastArg.method) {
        ioConfig.method = lastArg.method;
      }
    }

    return [payload, ioConfig];
  };

  Service.parseIOConfig = function (args) {
    var payload = args[0];
    var ioConfig = payload.io || {};
    delete payload.io;

    if (!ioConfig.success) {
      var callbacks = args.filter(isFunction);
      var callbackException = callbacks[1];
      var callbackSuccess = callbacks[0];

      if (!callbackException) {
        callbackException = callbackSuccess;
      }

      ioConfig.error = callbackException;

      ioConfig.complete = function (response) {
        if (response !== null && !Object.prototype.hasOwnProperty.call(response, 'exception')) {
          if (callbackSuccess) {
            callbackSuccess.call(this, response);
          }
        } else if (callbackException) {
          var exception = response ? response.exception : 'The server returned an empty response';
          callbackException.call(this, exception, response);
        }
      };
    }

    if (!Object.prototype.hasOwnProperty.call(ioConfig, 'cache') && REGEX_METHOD_GET.test(ioConfig.type)) {
      ioConfig.cache = false;
    }

    if (Liferay.PropsValues.NTLM_AUTH_ENABLED && Liferay.Browser.isIe()) {
      ioConfig.type = 'GET';
    }

    return ioConfig;
  };

  Service.parseIOFormConfig = function (ioConfig, args) {
    var form = args[1];

    if (isNode(form)) {
      if (form.enctype == STR_MULTIPART) {
        ioConfig.contentType = 'multipart/form-data';
      }

      ioConfig.formData = new FormData(form);
    }
  };

  Service.parseStringPayload = function (args) {
    var params = {};
    var payload = {};
    var config = args[1];

    if (!isFunction(config) && !isNode(config)) {
      params = config;
    }

    payload[args[0]] = params;
    return payload;
  };

  Service.invoke = function (payload, ioConfig) {
    var instance = this;
    var cmd = JSON.stringify(payload);
    var data = cmd;

    if (ioConfig.formData) {
      ioConfig.formData.append('cmd', cmd);
      data = ioConfig.formData;
    }

    return Liferay.Util.fetch(instance.URL_INVOKE, {
      body: data,
      headers: {
        contentType: ioConfig.contentType
      },
      method: 'POST'
    }).then(function (response) {
      return response.json();
    }).then(ioConfig.complete)["catch"](ioConfig.error);
  };

  function getHttpMethodFunction(httpMethodName) {
    return function () {
      var args = Array.prototype.slice.call(arguments, 0);
      var method = {
        method: httpMethodName
      };
      args.push(method);
      return Service.apply(Service, args);
    };
  }

  Service.get = getHttpMethodFunction('get');
  Service.del = getHttpMethodFunction('delete');
  Service.post = getHttpMethodFunction('post');
  Service.put = getHttpMethodFunction('put');
  Service.update = getHttpMethodFunction('update');
  Liferay.Service = Service;
  Liferay.Template = {
    PORTLET: '<div class="portlet"><div class="portlet-topper"><div class="portlet-title"></div></div><div class="portlet-content"></div><div class="forbidden-action"></div></div>'
  };
})(Liferay);
//# sourceMappingURL=liferay.js.map
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/o/frontend-js-web/liferay/",n(n.s=27)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.string=t.object=t.Disposable=t.async=t.array=void 0;var r=n(34);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=s(r),i=s(n(35)),a=s(n(36)),u=s(n(39)),c=s(n(40)),l=s(n(41));function s(e){return e&&e.__esModule?e:{default:e}}t.array=i.default,t.async=a.default,t.Disposable=u.default,t.object=c.default,t.string=l.default,t.default=o.default},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dom=void 0;var r=n(62);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r);t.default=o,t.dom=o},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new TypeError("basePortletURL parameter must be a string");if(!t||"object"!==i(t))throw new TypeError("parameters argument must be an object");var n=new Set(["doAsGroupId","doAsUserId","doAsUserLanguageId","p_auth","p_auth_secret","p_f_id","p_j_a_id","p_l_id","p_l_reset","p_p_auth","p_p_cacheability","p_p_i_id","p_p_id","p_p_isolated","p_p_lifecycle","p_p_mode","p_p_resource_id","p_p_state","p_p_state_rcv","p_p_static","p_p_url_type","p_p_width","p_t_lifecycle","p_v_l_s_g_id","refererGroupId","refererPlid","saveLastPath","scroll"]);0===e.indexOf(Liferay.ThemeDisplay.getPortalURL())||u(e)||(e=0!==e.indexOf("/")?"".concat(Liferay.ThemeDisplay.getPortalURL(),"/").concat(e):Liferay.ThemeDisplay.getPortalURL()+e);var r=new URL(e),a=new URLSearchParams(r.search),c=t.p_p_id||a.get("p_p_id");if(Object.entries(t).length&&!c)throw new TypeError("Portlet ID must not be null if parameters are provided");var l="";Object.entries(t).length&&(l=(0,o.default)(c));return Object.keys(t).forEach((function(e){var r;r=n.has(e)?e:"".concat(l).concat(e),a.set(r,t[e])})),r.search=a.toString(),r};var r,o=(r=n(17))&&r.__esModule?r:{default:r};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=/^[a-z][a-z0-9+.-]*:/i;function u(e){return a.test(e)}},function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Headers({"x-csrf-token":Liferay.authToken});new Headers(t.headers||{}).forEach((function(e,t){n.set(t,e)}));var o=r({},i,{},t);return o.headers=n,fetch(e,o)};var i={credentials:"include"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandler=t.EventHandle=t.EventEmitterProxy=t.EventEmitter=void 0;var r=u(n(53)),o=u(n(54)),i=u(n(20)),a=u(n(55));function u(e){return e&&e.__esModule?e:{default:e}}t.default=r.default,t.EventEmitter=r.default,t.EventEmitterProxy=o.default,t.EventHandle=i.default,t.EventHandler=a.default},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={PHONE:768,TABLET:980}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=(0,o.default)(e);return"string"==typeof t?document.querySelector(t):t.jquery?t[0]:t};var r,o=(r=n(21))&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0);var i="__metal_data__",a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"get",value:function(e,t,n){return e[i]||(e[i]={}),t?(!(0,o.isDef)(e[i][t])&&(0,o.isDef)(n)&&(e[i][t]=n),e[i][t]):e[i]}},{key:"has",value:function(e){return!!e[i]}},{key:"set",value:function(e,t,n){return e[i]||(e[i]={}),t&&(0,o.isDef)(n)?(e[i][t]=n,e[i][t]):e[i]}}]),e}();t.default=a},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){"string"==typeof e?e=document.querySelectorAll(e):e._node?e=[e._node]:e._nodes?e=e._nodes:e.nodeType===Node.ELEMENT_NODE&&(e=[e]);e.forEach((function(e){e.disabled=t,t?e.classList.add("disabled"):e.classList.remove("disabled")}))}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.abstractMethod=function(){throw Error("Unimplemented abstract method")},t.disableCompatibilityMode=function(){r=void 0},t.enableCompatibilityMode=a,t.getCompatibilityModeData=function(){void 0===r&&"undefined"!=typeof window&&window.__METAL_COMPATIBILITY__&&a(window.__METAL_COMPATIBILITY__);return r},t.getFunctionName=function(e){if(!e.name){var t=e.toString();e.name=t.substring(9,t.indexOf("("))}return e.name},t.getStaticProperty=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,o=n+"_MERGED";if(!t.hasOwnProperty(o)){var i=t.hasOwnProperty(n)?t[n]:null;t.__proto__&&!t.__proto__.isPrototypeOf(Function)&&(i=r(i,e(t.__proto__,n,r))),t[o]=i}return t[o]},t.getUid=function(e,t){if(e){var n=e[i];return t&&!e.hasOwnProperty(i)&&(n=null),n||(e[i]=o++)}return o++},t.identityFunction=function(e){return e},t.isBoolean=function(e){return"boolean"==typeof e},t.isDef=c,t.isDefAndNotNull=function(e){return c(e)&&!l(e)},t.isDocument=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&9===e.nodeType},t.isDocumentFragment=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&11===e.nodeType},t.isElement=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&1===e.nodeType},t.isFunction=function(e){return"function"==typeof e},t.isNull=l,t.isNumber=function(e){return"number"==typeof e},t.isWindow=function(e){return null!==e&&e===e.window},t.isObject=function(e){var t=void 0===e?"undefined":n(e);return"object"===t&&null!==e||"function"===t},t.isPromise=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&"function"==typeof e.then},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isServerSide=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{checkEnv:!0},n=void 0!==e&&!e.browser;n&&t.checkEnv&&(n=void 0!==e.env&&!0);return n},t.nullFunction=function(){};var r=void 0,o=1,i=t.UID_PROPERTY="core_"+(1e9*Math.random()>>>0);function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r=e}function u(e,t){return e||t}function c(e){return void 0!==e}function l(e){return null===e}}).call(this,n(12))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],s=!1,f=-1;function d(){s&&c&&(s=!1,c.length?l=c.concat(l):f=-1,l.length&&p())}function p(){if(!s){var e=u(d);s=!0;for(var t=l.length;t;){for(c=l,l=[];++f<t;)c&&c[f].run();f=-1,t=l.length}c=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new v(e,t)),1!==l.length||s||u(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=(0,((r=n(14))&&r.__esModule?r:{default:r}).default)((function(e){return e.split("").map((function(e){return e.charCodeAt()})).join("")}));t.default=o},function(e,t,n){(function(t){var n=/^\[object .+?Constructor\]$/,r="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();var a,u=Array.prototype,c=Function.prototype,l=Object.prototype,s=i["__core-js_shared__"],f=(a=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",d=c.toString,p=l.hasOwnProperty,v=l.toString,y=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),h=u.splice,m=S(i,"Map"),b=S(Object,"create");function g(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function O(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function j(e){return!(!T(e)||(t=e,f&&f in t))&&(function(e){var t=T(e)?v.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?y:n).test(function(e){if(null!=e){try{return d.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function E(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function S(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}function P(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(P.Cache||w),n}function T(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}g.prototype.clear=function(){this.__data__=b?b(null):{}},g.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},g.prototype.get=function(e){var t=this.__data__;if(b){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return p.call(t,e)?t[e]:void 0},g.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:p.call(t,e)},g.prototype.set=function(e,t){return this.__data__[e]=b&&void 0===t?"__lodash_hash_undefined__":t,this},_.prototype.clear=function(){this.__data__=[]},_.prototype.delete=function(e){var t=this.__data__,n=O(t,e);return!(n<0)&&(n==t.length-1?t.pop():h.call(t,n,1),!0)},_.prototype.get=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},_.prototype.has=function(e){return O(this.__data__,e)>-1},_.prototype.set=function(e,t){var n=this.__data__,r=O(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},w.prototype.clear=function(){this.__data__={hash:new g,map:new(m||_),string:new g}},w.prototype.delete=function(e){return E(this,e).delete(e)},w.prototype.get=function(e){return E(this,e).get(e)},w.prototype.has=function(e){return E(this,e).has(e)},w.prototype.set=function(e,t){return E(this,e).set(e,t),this},P.Cache=w,e.exports=P}).call(this,n(1))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FormData,a=arguments.length>2?arguments[2]:void 0;return Object.entries(t).forEach((function(t){var u=i(t,2),c=u[0],l=u[1],s=a?"".concat(a,"[").concat(c,"]"):c;Array.isArray(l)?l.forEach((function(t){e(o({},s,t),n)})):!(0,r.isObject)(l)||l instanceof File?n.append(s,l):e(l,n,s)})),n};var r=n(0);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(n,"$1")};var n=/^(?:p_p_id)?_(.*)_.*$/},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("portletId must be a string");return"_".concat(e,"_")}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortletConstants=void 0;var n={EDIT:"edit",HELP:"help",VIEW:"view",MAXIMIZED:"maximized",MINIMIZED:"minimized",NORMAL:"normal",FULL:"cacheLevelFull",PAGE:"cacheLevelPage",PORTLET:"cacheLevelPortlet"};t.PortletConstants=n;var r=n;t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.validateState=t.validatePortletId=t.validateParameters=t.validateForm=t.validateArguments=t.getUrl=t.getUpdatedPublicRenderParameters=t.generatePortletModeAndWindowStateString=t.generateActionUrl=t.encodeFormAsString=t.decodeUpdateString=void 0;var r=n(0);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t.decodeUpdateString=function(e,t){var n=e&&e.portlets?e.portlets:{};try{var r=JSON.parse(t);if(r.portlets)Object.keys(n).forEach((function(t){var o=r.portlets[t].state,i=n[t].state;if(!o||!i)throw new Error("Invalid update string.\nold state=".concat(i,"\nnew state=").concat(o));p(e,o,t)&&(n[t]=r.portlets[t])}))}catch(e){}return n};var a=function(e,t){for(var n=[],r=function(r){var o=t.elements[r],a=o.name,u=o.nodeName.toUpperCase(),c="INPUT"===u?o.type.toUpperCase():"",l=o.value;if(a&&!o.disabled&&"FILE"!==c)if("SELECT"===u&&o.multiple)i(o.options).forEach((function(t){if(t.checked){var r=t.value,o=encodeURIComponent(e+a)+"="+encodeURIComponent(r);n.push(o)}}));else if("CHECKBOX"!==c&&"RADIO"!==c||o.checked){var s=encodeURIComponent(e+a)+"="+encodeURIComponent(l);n.push(s)}},o=0;o<t.elements.length;o++)r(o);return n.join("&")};t.encodeFormAsString=a;var u=function(e,t){var n="";return Array.isArray(t)&&(0===t.length?n+="&"+encodeURIComponent(e)+"=":t.forEach((function(t){n+="&"+encodeURIComponent(e),n+=null===t?"=":"="+encodeURIComponent(t)}))),n};t.generateActionUrl=function(e,t,n){var r={credentials:"same-origin",method:"POST",url:t};if(n)if("multipart/form-data"===n.enctype){var o=new FormData(n);r.body=o}else{var i=a(e,n);"GET"===(n.method?n.method.toUpperCase():"GET")?(t.indexOf("?")>=0?t+="&".concat(i):t+="?".concat(i),r.url=t):(r.body=i,r.headers={"Content-Type":"application/x-www-form-urlencoded"})}return r};var c=function(e,t,n,r,o){var i="";if(e.portlets&&e.portlets[t]){var a=e.portlets[t];if(a&&a.state&&a.state.parameters){var c=a.state.parameters[n];void 0!==c&&(i+=u("p_r_p_"===r?o:"priv_r_p_"===r?t+"priv_r_p_"+n:t+n,c))}}return i},l=function(e,t){var n="";if(e.portlets){var r=e.portlets[t];if(r.state){var o=r.state;n+="&p_p_mode="+encodeURIComponent(o.portletMode),n+="&p_p_state="+encodeURIComponent(o.windowState)}}return n};t.generatePortletModeAndWindowStateString=l;t.getUpdatedPublicRenderParameters=function(e,t,n){var r={};if(e&&e.portlets){var o=e.portlets[t];if(o&&o.pubParms){var i=o.pubParms;Object.keys(i).forEach((function(o){if(!f(e,t,n,o)){var a=i[o];r[a]=n.parameters[o]}}))}}return r};t.getUrl=function(e,t,n,r,o,i){var a="cacheLevelPage",s="",f="";if(e&&e.portlets){"RENDER"===t&&void 0===n&&(n=null);var p=e.portlets[n];if(p&&("RESOURCE"===t?(f=decodeURIComponent(p.encodedResourceURL),o&&(a=o),f+="&p_p_cacheability="+encodeURIComponent(a),i&&(f+="&p_p_resource_id="+encodeURIComponent(i))):"RENDER"===t&&null!==n?f=decodeURIComponent(p.encodedRenderURL):"RENDER"===t?f=decodeURIComponent(e.encodedCurrentURL):"ACTION"===t?(f=decodeURIComponent(p.encodedActionURL),f+="&p_p_hub="+encodeURIComponent("0")):"PARTIAL_ACTION"===t&&(f=decodeURIComponent(p.encodedActionURL),f+="&p_p_hub="+encodeURIComponent("1")),"RESOURCE"!==t||"cacheLevelFull"!==a)){if(n&&(f+=l(e,n)),n&&(s="",p.state&&p.state.parameters)){var v=p.state.parameters;Object.keys(v).forEach((function(t){d(e,n,t)||(s+=c(e,n,t,"priv_r_p_"))})),f+=s}if(e.prpMap){s="";var y={};Object.keys(e.prpMap).forEach((function(t){Object.keys(e.prpMap[t]).forEach((function(n){var r=e.prpMap[t][n].split("|");Object.hasOwnProperty.call(y,t)||(y[t]=c(e,r[0],r[1],"p_r_p_",t),s+=y[t])}))})),f+=s}}}r&&(s="",Object.keys(r).forEach((function(e){s+=u(n+e,r[e])})),f+=s);return Promise.resolve(f)};var s=function(e,t){var n=!1;void 0===e&&void 0===t&&(n=!0),void 0!==e&&void 0!==t||(n=!1),e.length!==t.length&&(n=!1);for(var r=e.length-1;r>=0;r--)e[r]!==t[r]&&(n=!1);return n},f=function(e,t,n,r){var o=!1;if(e&&e.portlets){var i=e.portlets[t];if(n.parameters[r]&&i.state.parameters[r]){var a=n.parameters[r],u=i.state.parameters[r];o=s(a,u)}}return o},d=function(e,t,n){var r=!1;if(e&&e.portlets){var o=e.portlets[t];if(o&&o.pubParms)r=Object.keys(o.pubParms).includes(n)}return r},p=function(e,t,n){var r=!1;if(e&&e.portlets&&e.portlets[n]){var o=e.portlets[n].state;if(!t.portletMode||!t.windowState||!t.parameters)throw new Error("Error decoding state: ".concat(t));if(t.porletMode!==o.portletMode||t.windowState!==o.windowState)r=!0;else Object.keys(t.parameters).forEach((function(e){var n=t.parameters[e],i=o.parameters[e];s(n,i)||(r=!0)})),Object.keys(o.parameters).forEach((function(e){t.parameters[e]||(r=!0)}))}return r};t.validateArguments=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e.length<t)throw new TypeError("Too few arguments provided: Number of arguments: ".concat(e.length));if(e.length>n)throw new TypeError("Too many arguments provided: ".concat([].join.call(e,", ")));if(Array.isArray(r))for(var i=Math.min(e.length,r.length)-1;i>=0;i--){if(o(e[i])!==r[i])throw new TypeError("Parameter ".concat(i," is of type ").concat(o(e[i])," rather than the expected type ").concat(r[i]));if(null===e[i]||void 0===e[i])throw new TypeError("Argument is ".concat(o(e[i])))}};t.validateForm=function(e){if(!(e instanceof HTMLFormElement))throw new TypeError("Element must be an HTMLFormElement");var t=e.method?e.method.toUpperCase():void 0;if(t&&"GET"!==t&&"POST"!==t)throw new TypeError("Invalid form method ".concat(t,". Allowed methods are GET & POST"));var n=e.enctype;if(n&&"application/x-www-form-urlencoded"!==n&&"multipart/form-data"!==n)throw new TypeError("Invalid form enctype ".concat(n,". Allowed: 'application/x-www-form-urlencoded' & 'multipart/form-data'"));if(n&&"multipart/form-data"===n&&"POST"!==t)throw new TypeError("Invalid method with multipart/form-data. Must be POST");if(!n||"application/x-www-form-urlencoded"===n)for(var r=e.elements.length,o=0;o<r;o++)if("INPUT"===e.elements[o].nodeName.toUpperCase()&&"FILE"===e.elements[o].type.toUpperCase())throw new TypeError("Must use enctype = 'multipart/form-data' with input type FILE.")};var v=function(e){if(!(0,r.isDefAndNotNull)(e))throw new TypeError("The parameter object is: ".concat(o(e)));Object.keys(e).forEach((function(t){if(!Array.isArray(e[t]))throw new TypeError("".concat(t," parameter is not an array"));if(!e[t].length)throw new TypeError("".concat(t," parameter is an empty array"))}))};t.validateParameters=v;t.validatePortletId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.portlets&&Object.keys(e.portlets).includes(t)};t.validateState=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};v(e.parameters);var n=e.portletMode;if(!(0,r.isString)(n))throw new TypeError("Invalid parameters. portletMode is ".concat(o(n)));var i=t.allowedPM;if(!i.includes(n.toLowerCase()))throw new TypeError("Invalid portletMode=".concat(n," is not in ").concat(i));var a=e.windowState;if(!(0,r.isString)(a))throw new TypeError("Invalid parameters. windowState is ".concat(o(a)));var u=t.allowedWS;if(!u.includes(a.toLowerCase()))throw new TypeError("Invalid windowState=".concat(a," is not in ").concat(u))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(e,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.emitter_=e,o.event_=n,o.listener_=r,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"disposeInternal",value:function(){this.removeListener(),this.emitter_=null,this.listener_=null}},{key:"removeListener",value:function(){this.emitter_.isDisposed()||this.emitter_.removeListener(this.event_,this.listener_)}}]),t}(n(0).Disposable);t.default=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e._node||e._nodes)return e.nodeType?e:e._node||null;return e}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r){var i=!1;if(t=(0,o.default)(t)){r||((r={left:(r=t.getBoundingClientRect()).left+window.scrollX,top:r.top+window.scrollY}).bottom=r.top+t.offsetHeight,r.right=r.left+t.offsetWidth),n||(n=window),n=(0,o.default)(n);var a={};if(a.left=n.scrollX,a.right=a.left+n.innerWidth,a.top=n.scrollY,a.bottom=a.top+n.innerHeight,i=r.bottom<=a.bottom&&r.left>=a.left&&r.right<=a.right&&r.top>=a.top){var u=n.frameElement;if(u){var c=u.getBoundingClientRect(),l=(c={left:c.left+window.scrollX,top:c.top+window.scrollY}).left-a.left;r.left+=l,r.right+=l;var s=c.top-a.top;r.top+=s,r.bottom+=s,i=e(t,n.parent,r)}}}return i};var r,o=(r=n(7))&&r.__esModule?r:{default:r}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=null;if((0,r.isDef)(e)&&"FORM"===e.nodeName&&(0,r.isString)(t)){var o=e.dataset.fmNamespace||"";n=e.elements[o+t]||null}return n};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return i.capture_=o,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"removeListener",value:function(){this.emitter_.removeEventListener(this.event_,this.listener_,this.capture_)}}]),t}(n(5).EventHandle);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),i=n(0);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"checkAnimationEventName",value:function(){return void 0===e.animationEventName_&&(e.animationEventName_={animation:e.checkAnimationEventName_("animation"),transition:e.checkAnimationEventName_("transition")}),e.animationEventName_}},{key:"checkAnimationEventName_",value:function(t){var n=["Webkit","MS","O",""],r=i.string.replaceInterval(t,0,1,t.substring(0,1).toUpperCase()),o=[r+"End",r+"End",r+"End",t+"end"];e.animationElement_||(e.animationElement_=document.createElement("div"));for(var a=0;a<n.length;a++)if(void 0!==e.animationElement_.style[n[a]+r])return n[a].toLowerCase()+o[a];return t+"end"}},{key:"checkAttrOrderChange",value:function(){if(void 0===e.attrOrderChange_){var t=document.createElement("div");(0,o.append)(t,'<div data-component="" data-ref=""></div>'),e.attrOrderChange_='<div data-component="" data-ref=""></div>'!==t.innerHTML}return e.attrOrderChange_}}]),e}();a.animationElement_=void 0,a.animationEventName_=void 0,a.attrOrderChange_=void 0,t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(0,o.isDef)(e)||"FORM"!==e.nodeName||!(0,o.isObject)(t))return;Object.entries(t).forEach((function(t){var n,r,o=(r=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),a=o[0],u=o[1],c=(0,i.default)(e,a);c&&(c.value=u)}))};var r,o=n(0),i=(r=n(23))&&r.__esModule?r:{default:r}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"portlet",{enumerable:!0,get:function(){return v.default}});var o=Q(n(28)),i=Q(n(29)),a=Q(n(30)),u=Q(n(31)),c=Q(n(32)),l=Q(n(6)),s=n(33),f=n(42),d=n(43),p=n(44),v=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=G();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(45)),y=Q(n(52)),h=Q(n(56)),m=Q(n(57)),b=Q(n(58)),g=Q(n(4)),_=Q(n(59)),w=Q(n(23)),O=Q(n(15)),j=Q(n(60)),E=Q(n(26)),S=Q(n(68)),P=Q(n(69)),T=Q(n(70)),L=Q(n(21)),k=Q(n(7)),A=Q(n(16)),M=Q(n(17)),I=n(71),C=Q(n(22)),x=Q(n(72)),D=Q(n(73)),U=Q(n(74)),R=Q(n(75)),N=Q(n(76)),F=Q(n(77)),H=Q(n(78)),q=Q(n(3)),z=Q(n(79)),B=Q(n(80)),W=n(81),V=Q(n(13)),$=Q(n(10));function G(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return G=function(){return e},e}function Q(e){return e&&e.__esModule?e:{default:e}}Liferay=window.Liferay||{},Liferay.BREAKPOINTS=l.default,Liferay.component=s.component,Liferay.componentReady=s.componentReady,Liferay.destroyComponent=s.destroyComponent,Liferay.destroyComponents=s.destroyComponents,Liferay.destroyUnfulfilledPromises=s.destroyUnfulfilledPromises,Liferay.getComponentCache=s.getComponentCache,Liferay.initComponentCache=s.initComponentCache,Liferay.Address={getCountries:m.default,getRegions:b.default},Liferay.DynamicSelect=c.default,Liferay.Language={get:function(e){return e}},Liferay.LayoutExporter={all:f.hideLayoutPane,details:f.toggleLayoutDetails,icons:(0,f.getLayoutIcons)(),proposeLayout:f.proposeLayout,publishToLive:f.publishToLive,selected:f.showLayoutPane},Liferay.Portal={Tabs:{show:d.showTab},ToolTip:{show:p.showTooltip}},Liferay.Portlet=Liferay.Portlet||{},Liferay.Portlet.minimize=v.minimizePortlet,Liferay.Portlet.openModal=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(function(e){e.openPortletModal.apply(e,t)}))},Liferay.Portlet.openWindow=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(function(e){e.openPortletWindow.apply(e,t)}))},Liferay.SideNavigation=y.default,Liferay.Util=Liferay.Util||{},Liferay.Util.MAP_HTML_CHARS_ESCAPED=I.MAP_HTML_CHARS_ESCAPED,Liferay.Util.addParams=h.default,Liferay.Util.disableEsc=function(){document.all&&27===window.event.keyCode&&(window.event.returnValue=!1)},Liferay.Util.escape=o.default,Liferay.Util.escapeHTML=I.escapeHTML,Liferay.Util.fetch=g.default,Liferay.Util.focusFormField=_.default,Liferay.Util.formatStorage=S.default,Liferay.Util.formatXML=P.default,Liferay.Util.getCropRegion=T.default,Liferay.Util.getDOM=L.default,Liferay.Util.getElement=k.default,Liferay.Util.getFormElement=w.default,Liferay.Util.getPortletId=A.default,Liferay.Util.getPortletNamespace=M.default,Liferay.Util.groupBy=i.default,Liferay.Util.inBrowserView=C.default,Liferay.Util.isEqual=a.default,Liferay.Util.isPhone=x.default,Liferay.Util.isTablet=D.default,Liferay.Util.navigate=U.default,Liferay.Util.ns=N.default,Liferay.Util.objectToFormData=O.default,Liferay.Util.objectToURLSearchParams=F.default,Liferay.Util.normalizeFriendlyURL=R.default,Liferay.Util.PortletURL={createActionURL:H.default,createPortletURL:q.default,createRenderURL:z.default,createResourceURL:B.default},Liferay.Util.postForm=j.default,Liferay.Util.setFormValues=E.default,Liferay.Util.toCharCode=V.default,Liferay.Util.toggleDisabled=$.default,Liferay.Util.openModal=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(function(e){e.openModal.apply(e,t)}))},Liferay.Util.openToast=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Liferay.Loader.require("frontend-js-web/liferay/toast/commands/OpenToast.es",(function(e){e.openToast.apply(e,t)}))},Liferay.Util.Session={get:W.getSessionValue,set:W.setSessionValue},Liferay.Util.unescape=u.default,Liferay.Util.unescapeHTML=I.unescapeHTML},function(e,t,n){(function(t){var n=/[&<>"'`]/g,r=RegExp(n.source),o="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,a=o||i||Function("return this")();var u,c=(u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==u?void 0:u[e]}),l=Object.prototype.toString,s=a.Symbol,f=s?s.prototype:void 0,d=f?f.toString:void 0;function p(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return d?d.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}e.exports=function(e){var t;return(e=null==(t=e)?"":p(t))&&r.test(e)?e.replace(n,c):e}}).call(this,n(1))},function(e,t,n){(function(e,n){var r="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,l=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[r]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v["[object Function]"]=v[o]=v["[object Number]"]=v[i]=v["[object RegExp]"]=v[a]=v["[object String]"]=v["[object WeakMap]"]=!1;var y="object"==typeof e&&e&&e.Object===Object&&e,h="object"==typeof self&&self&&self.Object===Object&&self,m=y||h||Function("return this")(),b=t&&!t.nodeType&&t,g=b&&"object"==typeof n&&n&&!n.nodeType&&n,_=g&&g.exports===b&&y.process,w=function(){try{return _&&_.binding("util")}catch(e){}}(),O=w&&w.isTypedArray;function j(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function E(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function S(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function P(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function T(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var L,k,A,M=Array.prototype,I=Function.prototype,C=Object.prototype,x=m["__core-js_shared__"],D=(L=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",U=I.toString,R=C.hasOwnProperty,N=C.toString,F=RegExp("^"+U.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=m.Symbol,q=m.Uint8Array,z=C.propertyIsEnumerable,B=M.splice,W=(k=Object.keys,A=Object,function(e){return k(A(e))}),V=Pe(m,"DataView"),$=Pe(m,"Map"),G=Pe(m,"Promise"),Q=Pe(m,"Set"),X=Pe(m,"WeakMap"),Y=Pe(Object,"create"),K=xe(V),J=xe($),Z=xe(G),ee=xe(Q),te=xe(X),ne=H?H.prototype:void 0,re=ne?ne.valueOf:void 0,oe=ne?ne.toString:void 0;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ue(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ce(e){var t=-1,n=e?e.length:0;for(this.__data__=new ue;++t<n;)this.add(e[t])}function le(e){this.__data__=new ae(e)}function se(e,t){var n=qe(e)||He(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var i in e)!t&&!R.call(e,i)||o&&("length"==i||Le(i,r))||n.push(i);return n}function fe(e,t){for(var n=e.length;n--;)if(Fe(e[n][0],t))return n;return-1}function de(e,t,n,r){return ye(e,(function(e,o,i){t(r,e,n(e),i)})),r}ie.prototype.clear=function(){this.__data__=Y?Y(null):{}},ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ie.prototype.get=function(e){var t=this.__data__;if(Y){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return R.call(t,e)?t[e]:void 0},ie.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:R.call(t,e)},ie.prototype.set=function(e,t){return this.__data__[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this},ae.prototype.clear=function(){this.__data__=[]},ae.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0)&&(n==t.length-1?t.pop():B.call(t,n,1),!0)},ae.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},ae.prototype.has=function(e){return fe(this.__data__,e)>-1},ae.prototype.set=function(e,t){var n=this.__data__,r=fe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ue.prototype.clear=function(){this.__data__={hash:new ie,map:new($||ae),string:new ie}},ue.prototype.delete=function(e){return Se(this,e).delete(e)},ue.prototype.get=function(e){return Se(this,e).get(e)},ue.prototype.has=function(e){return Se(this,e).has(e)},ue.prototype.set=function(e,t){return Se(this,e).set(e,t),this},ce.prototype.add=ce.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ce.prototype.has=function(e){return this.__data__.has(e)},le.prototype.clear=function(){this.__data__=new ae},le.prototype.delete=function(e){return this.__data__.delete(e)},le.prototype.get=function(e){return this.__data__.get(e)},le.prototype.has=function(e){return this.__data__.has(e)},le.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ae){var r=n.__data__;if(!$||r.length<199)return r.push([e,t]),this;n=this.__data__=new ue(r)}return n.set(e,t),this};var pe,ve,ye=(pe=function(e,t){return e&&he(e,t,Xe)},function(e,t){if(null==e)return e;if(!ze(e))return pe(e,t);for(var n=e.length,r=ve?n:-1,o=Object(e);(ve?r--:++r<n)&&!1!==t(o[r],r,o););return e}),he=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),u=a.length;u--;){var c=a[e?u:++o];if(!1===n(i[c],c,i))break}return t}}();function me(e,t){for(var n=0,r=(t=ke(t,e)?[t]:je(t)).length;null!=e&&n<r;)e=e[Ce(t[n++])];return n&&n==r?e:void 0}function be(e,t){return null!=e&&t in Object(e)}function ge(e,t,n,u,c){return e===t||(null==e||null==t||!Ve(e)&&!$e(t)?e!=e&&t!=t:function(e,t,n,u,c,l){var s=qe(e),f=qe(t),d="[object Array]",p="[object Array]";s||(d=(d=Te(e))==r?i:d);f||(p=(p=Te(t))==r?i:p);var v=d==i&&!S(e),y=p==i&&!S(t),h=d==p;if(h&&!v)return l||(l=new le),s||Qe(e)?Ee(e,t,n,u,c,l):function(e,t,n,r,i,u,c){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new q(e),new q(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Fe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case o:var l=P;case a:var s=2&u;if(l||(l=T),e.size!=t.size&&!s)return!1;var f=c.get(e);if(f)return f==t;u|=1,c.set(e,t);var d=Ee(l(e),l(t),r,i,u,c);return c.delete(e),d;case"[object Symbol]":if(re)return re.call(e)==re.call(t)}return!1}(e,t,d,n,u,c,l);if(!(2&c)){var m=v&&R.call(e,"__wrapped__"),b=y&&R.call(t,"__wrapped__");if(m||b){var g=m?e.value():e,_=b?t.value():t;return l||(l=new le),n(g,_,u,c,l)}}if(!h)return!1;return l||(l=new le),function(e,t,n,r,o,i){var a=2&o,u=Xe(e),c=u.length,l=Xe(t).length;if(c!=l&&!a)return!1;var s=c;for(;s--;){var f=u[s];if(!(a?f in t:R.call(t,f)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var p=!0;i.set(e,t),i.set(t,e);var v=a;for(;++s<c;){f=u[s];var y=e[f],h=t[f];if(r)var m=a?r(h,y,f,t,e,i):r(y,h,f,e,t,i);if(!(void 0===m?y===h||n(y,h,r,o,i):m)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,g=t.constructor;b==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,u,c,l)}(e,t,ge,n,u,c))}function _e(e){return!(!Ve(e)||function(e){return!!D&&D in e}(e))&&(Be(e)||S(e)?F:d).test(xe(e))}function we(e){return"function"==typeof e?e:null==e?Ye:"object"==typeof e?qe(e)?function(e,t){if(ke(e)&&Ae(t))return Me(Ce(e),t);return function(n){var r=function(e,t,n){var r=null==e?void 0:me(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&function(e,t,n){t=ke(t,e)?[t]:je(t);var r,o=-1,i=t.length;for(;++o<i;){var a=Ce(t[o]);if(!(r=null!=e&&n(e,a)))break;e=e[a]}if(r)return r;return!!(i=e?e.length:0)&&We(i)&&Le(a,i)&&(qe(e)||He(e))}(e,t,be)}(n,e):ge(t,r,void 0,3)}}(e[0],e[1]):function(e){var t=function(e){var t=Xe(e),n=t.length;for(;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ae(o)]}return t}(e);if(1==t.length&&t[0][2])return Me(t[0][0],t[0][1]);return function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=n[o])[0],l=e[c],s=u[1];if(a&&u[2]){if(void 0===l&&!(c in e))return!1}else{var f=new le;if(r)var d=r(l,s,c,e,t,f);if(!(void 0===d?ge(s,l,r,3,f):d))return!1}}return!0}(n,e,t)}}(e):ke(t=e)?(n=Ce(t),function(e){return null==e?void 0:e[n]}):function(e){return function(t){return me(t,e)}}(t);var t,n}function Oe(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||C,t!==r)return W(e);var t,n,r,o=[];for(var i in Object(e))R.call(e,i)&&"constructor"!=i&&o.push(i);return o}function je(e){return qe(e)?e:Ie(e)}function Ee(e,t,n,r,o,i){var a=2&o,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=i.get(e);if(l&&i.get(t))return l==t;var s=-1,f=!0,d=1&o?new ce:void 0;for(i.set(e,t),i.set(t,e);++s<u;){var p=e[s],v=t[s];if(r)var y=a?r(v,p,s,t,e,i):r(p,v,s,e,t,i);if(void 0!==y){if(y)continue;f=!1;break}if(d){if(!E(t,(function(e,t){if(!d.has(t)&&(p===e||n(p,e,r,o,i)))return d.add(t)}))){f=!1;break}}else if(p!==v&&!n(p,v,r,o,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function Se(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Pe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _e(n)?n:void 0}var Te=function(e){return N.call(e)};function Le(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||p.test(e))&&e>-1&&e%1==0&&e<t}function ke(e,t){if(qe(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ge(e))||(c.test(e)||!u.test(e)||null!=t&&e in Object(t))}function Ae(e){return e==e&&!Ve(e)}function Me(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}(V&&"[object DataView]"!=Te(new V(new ArrayBuffer(1)))||$&&Te(new $)!=o||G&&"[object Promise]"!=Te(G.resolve())||Q&&Te(new Q)!=a||X&&"[object WeakMap]"!=Te(new X))&&(Te=function(e){var t=N.call(e),n=t==i?e.constructor:void 0,r=n?xe(n):void 0;if(r)switch(r){case K:return"[object DataView]";case J:return o;case Z:return"[object Promise]";case ee:return a;case te:return"[object WeakMap]"}return t});var Ie=Ne((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Ge(e))return oe?oe.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return l.test(e)&&n.push(""),e.replace(s,(function(e,t,r,o){n.push(r?o.replace(f,"$1"):t||e)})),n}));function Ce(e){if("string"==typeof e||Ge(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function xe(e){if(null!=e){try{return U.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var De,Ue,Re=(De=function(e,t,n){R.call(e,n)?e[n].push(t):e[n]=[t]},function(e,t){var n=qe(e)?j:de,r=Ue?Ue():{};return n(e,De,we(t),r)});function Ne(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(Ne.Cache||ue),n}function Fe(e,t){return e===t||e!=e&&t!=t}function He(e){return function(e){return $e(e)&&ze(e)}(e)&&R.call(e,"callee")&&(!z.call(e,"callee")||N.call(e)==r)}Ne.Cache=ue;var qe=Array.isArray;function ze(e){return null!=e&&We(e.length)&&!Be(e)}function Be(e){var t=Ve(e)?N.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function We(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $e(e){return!!e&&"object"==typeof e}function Ge(e){return"symbol"==typeof e||$e(e)&&"[object Symbol]"==N.call(e)}var Qe=O?function(e){return function(t){return e(t)}}(O):function(e){return $e(e)&&We(e.length)&&!!v[N.call(e)]};function Xe(e){return ze(e)?se(e):Oe(e)}function Ye(e){return e}n.exports=Re}).call(this,n(1),n(9)(e))},function(e,t,n){(function(e,n){var r="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[o]=l["[object Number]"]=l[i]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object WeakMap]"]=!1;var s="object"==typeof e&&e&&e.Object===Object&&e,f="object"==typeof self&&self&&self.Object===Object&&self,d=s||f||Function("return this")(),p=t&&!t.nodeType&&t,v=p&&"object"==typeof n&&n&&!n.nodeType&&n,y=v&&v.exports===p,h=y&&s.process,m=function(){try{return h&&h.binding&&h.binding("util")}catch(e){}}(),b=m&&m.isTypedArray;function g(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function _(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function w(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var O,j,E,S=Array.prototype,P=Function.prototype,T=Object.prototype,L=d["__core-js_shared__"],k=P.toString,A=T.hasOwnProperty,M=(O=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",I=T.toString,C=RegExp("^"+k.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=y?d.Buffer:void 0,D=d.Symbol,U=d.Uint8Array,R=T.propertyIsEnumerable,N=S.splice,F=D?D.toStringTag:void 0,H=Object.getOwnPropertySymbols,q=x?x.isBuffer:void 0,z=(j=Object.keys,E=Object,function(e){return j(E(e))}),B=me(d,"DataView"),W=me(d,"Map"),V=me(d,"Promise"),$=me(d,"Set"),G=me(d,"WeakMap"),Q=me(Object,"create"),X=we(B),Y=we(W),K=we(V),J=we($),Z=we(G),ee=D?D.prototype:void 0,te=ee?ee.valueOf:void 0;function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ie(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new oe;++t<n;)this.add(e[t])}function ae(e){var t=this.__data__=new re(e);this.size=t.size}function ue(e,t){var n=Ee(e),r=!n&&je(e),o=!n&&!r&&Se(e),i=!n&&!r&&!o&&Ae(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=u.length;for(var l in e)!t&&!A.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||_e(l,c))||u.push(l);return u}function ce(e,t){for(var n=e.length;n--;)if(Oe(e[n][0],t))return n;return-1}function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=A.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=I.call(e);r&&(t?e[F]=n:delete e[F]);return o}(e):function(e){return I.call(e)}(e)}function se(e){return ke(e)&&le(e)==r}function fe(e,t,n,u,c){return e===t||(null==e||null==t||!ke(e)&&!ke(t)?e!=e&&t!=t:function(e,t,n,u,c,l){var s=Ee(e),f=Ee(t),d=s?"[object Array]":ge(e),p=f?"[object Array]":ge(t),v=(d=d==r?i:d)==i,y=(p=p==r?i:p)==i,h=d==p;if(h&&Se(e)){if(!Se(t))return!1;s=!0,v=!1}if(h&&!v)return l||(l=new ae),s||Ae(e)?ve(e,t,n,u,c,l):function(e,t,n,r,i,u,c){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!u(new U(e),new U(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Oe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case o:var l=_;case a:var s=1&r;if(l||(l=w),e.size!=t.size&&!s)return!1;var f=c.get(e);if(f)return f==t;r|=2,c.set(e,t);var d=ve(l(e),l(t),r,i,u,c);return c.delete(e),d;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,d,n,u,c,l);if(!(1&n)){var m=v&&A.call(e,"__wrapped__"),b=y&&A.call(t,"__wrapped__");if(m||b){var g=m?e.value():e,O=b?t.value():t;return l||(l=new ae),c(g,O,n,u,l)}}if(!h)return!1;return l||(l=new ae),function(e,t,n,r,o,i){var a=1&n,u=ye(e),c=u.length,l=ye(t).length;if(c!=l&&!a)return!1;var s=c;for(;s--;){var f=u[s];if(!(a?f in t:A.call(t,f)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var p=!0;i.set(e,t),i.set(t,e);var v=a;for(;++s<c;){f=u[s];var y=e[f],h=t[f];if(r)var m=a?r(h,y,f,t,e,i):r(y,h,f,e,t,i);if(!(void 0===m?y===h||o(y,h,n,r,i):m)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,g=t.constructor;b==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,u,c,l)}(e,t,n,u,fe,c))}function de(e){return!(!Le(e)||function(e){return!!M&&M in e}(e))&&(Pe(e)?C:u).test(we(e))}function pe(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||T,t!==r)return z(e);var t,n,r,o=[];for(var i in Object(e))A.call(e,i)&&"constructor"!=i&&o.push(i);return o}function ve(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=i.get(e);if(l&&i.get(t))return l==t;var s=-1,f=!0,d=2&n?new ie:void 0;for(i.set(e,t),i.set(t,e);++s<u;){var p=e[s],v=t[s];if(r)var y=a?r(v,p,s,t,e,i):r(p,v,s,e,t,i);if(void 0!==y){if(y)continue;f=!1;break}if(d){if(!g(t,(function(e,t){if(a=t,!d.has(a)&&(p===e||o(p,e,n,r,i)))return d.push(t);var a}))){f=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function ye(e){return function(e,t,n){var r=t(e);return Ee(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Me,be)}function he(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return de(n)?n:void 0}ne.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return A.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:A.call(t,e)},ne.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?"__lodash_hash_undefined__":t,this},re.prototype.clear=function(){this.__data__=[],this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=ce(t,e);return!(n<0)&&(n==t.length-1?t.pop():N.call(t,n,1),--this.size,!0)},re.prototype.get=function(e){var t=this.__data__,n=ce(t,e);return n<0?void 0:t[n][1]},re.prototype.has=function(e){return ce(this.__data__,e)>-1},re.prototype.set=function(e,t){var n=this.__data__,r=ce(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},oe.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(W||re),string:new ne}},oe.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return he(this,e).get(e)},oe.prototype.has=function(e){return he(this,e).has(e)},oe.prototype.set=function(e,t){var n=he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ie.prototype.add=ie.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ie.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.clear=function(){this.__data__=new re,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!W||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oe(r)}return n.set(e,t),this.size=n.size,this};var be=H?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(H(e),(function(t){return R.call(e,t)})))}:function(){return[]},ge=le;function _e(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||c.test(e))&&e>-1&&e%1==0&&e<t}function we(e){if(null!=e){try{return k.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oe(e,t){return e===t||e!=e&&t!=t}(B&&"[object DataView]"!=ge(new B(new ArrayBuffer(1)))||W&&ge(new W)!=o||V&&"[object Promise]"!=ge(V.resolve())||$&&ge(new $)!=a||G&&"[object WeakMap]"!=ge(new G))&&(ge=function(e){var t=le(e),n=t==i?e.constructor:void 0,r=n?we(n):"";if(r)switch(r){case X:return"[object DataView]";case Y:return o;case K:return"[object Promise]";case J:return a;case Z:return"[object WeakMap]"}return t});var je=se(function(){return arguments}())?se:function(e){return ke(e)&&A.call(e,"callee")&&!R.call(e,"callee")},Ee=Array.isArray;var Se=q||function(){return!1};function Pe(e){if(!Le(e))return!1;var t=le(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Te(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Le(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ke(e){return null!=e&&"object"==typeof e}var Ae=b?function(e){return function(t){return e(t)}}(b):function(e){return ke(e)&&Te(e.length)&&!!l[le(e)]};function Me(e){return null!=(t=e)&&Te(t.length)&&!Pe(t)?ue(e):pe(e);var t}n.exports=function(e,t){return fe(e,t)}}).call(this,n(1),n(9)(e))},function(e,t,n){(function(t){var n=/&(?:amp|lt|gt|quot|#39|#96);/g,r=RegExp(n.source),o="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,a=o||i||Function("return this")();var u,c=(u={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},function(e){return null==u?void 0:u[e]}),l=Object.prototype.toString,s=a.Symbol,f=s?s.prototype:void 0,d=f?f.toString:void 0;function p(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return d?d.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}e.exports=function(e){var t;return(e=null==(t=e)?"":p(t))&&r.test(e)?e.replace(n,c):e}}).call(this,n(1))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(10))&&r.__esModule?r:{default:r};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=e.indexOf('">'),r=e.substring(n);n=t.indexOf('">');var o=t.substring(n);return r<o?-1:r>o?1:0}function u(e){return function(e){return!!Array.isArray(e)||!(!e||"object"!==i(e)||"number"!=typeof e.length||e.tagName||e.scrollTo||e.document)}(e)?Array.from(e):[e]}function c(e,t,n){var r=e[t],i=document.getElementById(r.select);if(i){var c=u(r.selectVal),l=[];for(!1!==r.selectNullable&&l.push('<option selected value="0"></option>'),n.forEach((function(e){var t=e[r.selectId],n=e[r.selectDesc],o="";c.indexOf(t)>-1&&(o='selected="selected"'),l.push("<option ".concat(o,' value="').concat(t,'">').concat(n,"</option>"))})),r.selectSort&&l.sort(a);i.lastChild;)i.removeChild(i.lastChild);i.innerHTML=l.join(""),r.selectDisableOnEmpty&&(0,o.default)(i,!n.length)}}function l(e){e.forEach((function(t,n){var r,o=t.select,i=document.getElementById(o),a=t.selectData;i&&(i.setAttribute("data-componentType","dynamic_select"),n>0&&(r=e[n-1].selectVal),a((function(t){c(e,n,t)}),r),i.getAttribute("name")||i.setAttribute("name",o),i.addEventListener("change",(function(){!function(e,t){if(t+1<e.length){var n=document.getElementById(e[t].select);(0,e[t+1].selectData)((function(n){c(e,t+1,n)}),n&&n.value)}}(e,n)})))}))}t.default=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(t)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.initComponentCache=t.getComponentCache=t.destroyUnfulfilledPromises=t.destroyComponents=t.destroyComponent=t.componentReady=t.component=void 0;var r=n(0),o={},i={},a={},u={},c={},l=["p_p_id","p_p_lifecycle"],s=["ddmStructureKey","fileEntryTypeId","folderId","navigation","status"],f=function(e){var t,n;e?t={promise:Promise.resolve(e),resolve:function(){}}:t={promise:new Promise((function(e){n=e})),resolve:n};return t},d=function(e,t,n){var r=e.data;Object.keys(r).forEach((function(e){var t=n.querySelector("#".concat(e));t&&(t.innerHTML=r[e].html)}))},p=function(e){var t=new URL(window.location.href),n=new URL(e.path,window.location.href);if(l.every((function(e){return n.searchParams.get(e)===t.searchParams.get(e)}))){var i=Object.keys(a);i=i.filter((function(e){var i=a[e],u=o[e],c=s.every((function(e){var r=!1;if(u){var o="_".concat(u.portletId,"_").concat(e);r=n.searchParams.get(o)===t.searchParams.get(o)}return r}));return!!(0,r.isFunction)(i.isCacheable)&&i.isCacheable(n)&&c&&u&&u.cacheState&&i.element&&i.getState})),u=i.reduce((function(e,t){var n=a[t],r=o[t],i=n.getState(),u=r.cacheState.reduce((function(e,t){return e[t]=i[t],e}),{});return e[t]={html:n.element.innerHTML,state:u},e}),[]),Liferay.DOMTaskRunner.addTask({action:d,condition:function(e){return"liferay.component"===e.owner}}),Liferay.DOMTaskRunner.addTaskState({data:u,owner:"liferay.component"})}else u={}},v=function(e,t,n){var u;if(1===arguments.length){var l=a[e];l&&(0,r.isFunction)(l)&&(c[e]=l,l=l(),a[e]=l),u=l}else if(a[e]&&null!==t&&(delete o[e],delete i[e],console.warn('Component with id "'+e+'" is being registered twice. This can lead to unexpected behaviour in the "Liferay.component" and "Liferay.componentReady" APIs, as well as in the "*:registered" events.')),u=a[e]=t,null===t)delete o[e],delete i[e];else{o[e]=n,Liferay.fire(e+":registered");var s=i[e];s?s.resolve(t):i[e]=f(t)}return u};t.component=v;t.componentReady=function e(){var t,n;if(1===arguments.length)t=arguments[0];else{t=[];for(var r=0;r<arguments.length;r++)t[r]=arguments[r]}if(Array.isArray(t))n=Promise.all(t.map((function(t){return e(t)})));else{var o=i[t];o||(i[t]=o=f()),n=o.promise}return n};var y=function(e){var t=a[e];if(t){var n=t.destroy||t.dispose;n&&n.call(t),delete o[e],delete i[e],delete c[e],delete a[e]}};t.destroyComponent=y;t.destroyComponents=function(e){var t=Object.keys(a);e&&(t=t.filter((function(t){return e(a[t],o[t]||{})}))),t.forEach(y)};t.destroyUnfulfilledPromises=function(){i={}};t.getComponentCache=function(e){var t=u[e];return t?t.state:{}};t.initComponentCache=function(){Liferay.on("startNavigate",p)};var h=v;t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.core=void 0;var r=n(11);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r);t.default=o,t.core=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"equal",value:function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}},{key:"firstDefinedValue",value:function(e){for(var t=0;t<e.length;t++)if(void 0!==e[t])return e[t]}},{key:"flatten",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0;r<t.length;r++)Array.isArray(t[r])?e.flatten(t[r],n):n.push(t[r]);return n}},{key:"remove",value:function(t,n){var r,o=t.indexOf(n);return(r=o>=0)&&e.removeAt(t,o),r}},{key:"removeAt",value:function(e,t){return 1===Array.prototype.splice.call(e,t,1).length}},{key:"slice",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=[],o=t;o<n;o++)r.push(e[o]);return r}}]),e}();t.default=o},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),o={throwException:function(e){o.nextTick((function(){throw e}))},run:function(e,t){o.run.workQueueScheduled_||(o.nextTick(o.run.processWorkQueue),o.run.workQueueScheduled_=!0),o.run.workQueue_.push(new o.run.WorkItem_(e,t))}};o.run.workQueueScheduled_=!1,o.run.workQueue_=[],o.run.processWorkQueue=function(){for(;o.run.workQueue_.length;){var e=o.run.workQueue_;o.run.workQueue_=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.fn.call(n.scope)}catch(e){o.throwException(e)}}}o.run.workQueueScheduled_=!1},o.run.WorkItem_=function(e,t){this.fn=e,this.scope=t},o.nextTick=function(t,n){var i=t;n&&(i=t.bind(n)),i=o.nextTick.wrapCallback_(i),o.nextTick.setImmediate_||("function"==typeof e&&(0,r.isServerSide)({checkEnv:!1})?o.nextTick.setImmediate_=e:o.nextTick.setImmediate_=o.nextTick.getSetImmediateEmulator_()),o.nextTick.setImmediate_(i)},o.nextTick.setImmediate_=null,o.nextTick.getSetImmediateEmulator_=function(){var e=void 0;if("function"==typeof MessageChannel&&(e=MessageChannel),void 0===e&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&(e=function(){var e=document.createElement("iframe");e.style.display="none",e.src="",e.title="",document.documentElement.appendChild(e);var t=e.contentWindow,n=t.document;n.open(),n.write(""),n.close();var r="callImmediate"+Math.random(),o=t.location.protocol+"//"+t.location.host,i=function(e){e.origin!==o&&e.data!==r||this.port1.onmessage()}.bind(this);t.addEventListener("message",i,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(r,o)}}}),void 0!==e){var t=new e,n={},r=n;return t.port1.onmessage=function(){var e=(n=n.next).cb;n.cb=null,e()},function(e){r.next={cb:e},r=r.next,t.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("script")?function(e){var t=document.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,t.parentNode.removeChild(t),t=null,e(),e=null},document.documentElement.appendChild(t)}:function(e){setTimeout(e,0)}},o.nextTick.wrapCallback_=function(e){return e},t.default=o}).call(this,n(37).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(38),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,u,c=1,l={},s=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){v(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){v(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(v,0,e)}:(a="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&v(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return l[c]=o,r(c),c++},d.clearImmediate=p}function p(e){delete l[e]}function v(e){if(s)setTimeout(v,0,e);else{var t=l[e];if(t){s=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),s=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),n(12))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.disposed_=!1}return r(e,[{key:"dispose",value:function(){this.disposed_||(this.disposeInternal(),this.disposed_=!0)}},{key:"disposeInternal",value:function(){}},{key:"isDisposed",value:function(){return this.disposed_}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"mixin",value:function(e){for(var t=void 0,n=void 0,r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];for(var a=0;a<o.length;a++)for(t in n=o[a])e[t]=n[t];return e}},{key:"getObjectByName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=e.split(".");return n.reduce((function(e,t){return e[t]}),t)}},{key:"map",value:function(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++)n[r[o]]=t(r[o],e[r[o]]);return n}},{key:"shallowEqual",value:function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(e[n[o]]!==t[n[o]])return!1;return!0}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"caseInsensitiveCompare",value:function(e,t){var n=String(e).toLowerCase(),r=String(t).toLowerCase();return n<r?-1:n===r?0:1}},{key:"collapseBreakingSpaces",value:function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")}},{key:"escapeRegex",value:function(e){return String(e).replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")}},{key:"getRandomString",value:function(){var e=2147483648;return Math.floor(Math.random()*e).toString(36)+Math.abs(Math.floor(Math.random()*e)^Date.now()).toString(36)}},{key:"hashCode",value:function(e){for(var t=0,n=0,r=e.length;n<r;n++)t=31*t+e.charCodeAt(n),t%=4294967296;return t}},{key:"replaceInterval",value:function(e,t,n,r){return e.substring(0,t)+r+e.substring(n)}}]),e}();t.default=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hideLayoutPane=function(e){var t=(e=e||{}).obj,n=e.pane;t&&t.checked&&(n=document.querySelector(n))&&n.classList.add("hide")},t.getLayoutIcons=function(){return{minus:themeDisplay.getPathThemeImages()+"/arrows/01_minus.png",plus:themeDisplay.getPathThemeImages()+"/arrows/01_plus.png"}},t.proposeLayout=function(e){var t=(e=e||{}).namespace,n=e.reviewers,r='<div><form action="'+e.url+'" method="post">';if(n.length>0){r+='<textarea name="'+t+'description" style="height: 100px; width: 284px;"></textarea><br /><br />'+'Reviewer'+' <select name="'+t+'reviewUserId">';for(var o=0;o<n.length;o++)r+='<option value="'+n[o].userId+'">'+n[o].fullName+"</option>";r+='</select><br /><br /><input type="submit" value="'+'Proceed'+'" />'}else r+='No\x20reviewers\x20were\x20found\x2e'+"<br />"+'Please\x20contact\x20the\x20administrator\x20to\x20assign\x20reviewers\x2e'+"<br /><br />";r+="</form></div>",Liferay.Util.openWindow({dialog:{destroyOnHide:!0},title:r})},t.publishToLive=function(e){e=e||{},Liferay.Util.openWindow({dialog:{constrain:!0,modal:!0,on:{visibleChange:function(e){e.newVal||this.destroy()}}},title:e.title,uri:e.url})},t.showLayoutPane=function(e){var t=(e=e||{}).obj,n=e.pane;t&&t.checked&&(n=document.querySelector(n))&&n.classList.remove("hide")},t.toggleLayoutDetails=function(e){e=e||{};var t=document.querySelector(e.detail),n=document.querySelector(e.toggle);if(t&&n){var r=themeDisplay.getPathThemeImages()+"/arrows/01_plus.png";t.classList.contains("hide")?(t.classList.remove("hide"),r=themeDisplay.getPathThemeImages()+"/arrows/01_minus.png"):t.classList.add("hide"),n.setAttribute("src",r)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.showTab=function(e,t,n,r){var a=e+(0,o.default)(n),u=document.getElementById(a+"TabsId"),c=document.getElementById(a+"TabsSection");if(u&&c){var l={id:n,names:t,namespace:e,selectedTab:u,selectedTabSection:c};r&&"function"==typeof r&&r.call(this,e,t,n,l);try{Liferay.on("showTab",i),Liferay.fire("showTab",l)}finally{Liferay.detach("showTab",i)}}},t.applyTabSelectionDOMChanges=i;var r,o=(r=n(13))&&r.__esModule?r:{default:r};function i(e){var t=e.id,n=e.names,r=e.namespace,i=e.selectedTab,a=e.selectedTabSection,u=i.querySelector("a");if(i&&u){var c=i.parentElement.querySelector(".active");c&&c.classList.remove("active"),u.classList.add("active")}a&&a.classList.remove("hide");var l,s=document.getElementById(r+"dropdownTitle");s&&u&&(s.innerHTML=u.textContent),n.splice(n.indexOf(t),1);for(var f=0;f<n.length;f++)(l=document.getElementById(r+(0,o.default)(n[f])+"TabsSection"))&&l.classList.add("hide")}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.showTooltip=function(e,t){e.setAttribute("title",t),e.classList.add("lfr-portal-tooltip")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.minimizePortlet=function(e,t,n){n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({doAsUserId:themeDisplay.getDoAsUserIdEncoded(),plid:themeDisplay.getPlid()},n);var u=document.querySelector(e);if(u){var s=u.querySelector(".portlet-content-container");if(s){var f=s.classList.contains("hide");if(f?(s.classList.remove("hide"),u.classList.remove("portlet-minimized")):(s.classList.add("hide"),u.classList.add("portlet-minimized")),t){var d=f?'Minimize':'Restore';t.setAttribute("alt",d),t.setAttribute("title",d);var p=t.querySelector(".taglib-text-icon");p&&(p.innerHTML=d);var v=t.querySelector("i");v&&(v.classList.remove("icon-minus","icon-resize-vertical"),f?(v.classList.add("icon-minus"),v.classList.remove("icon-resize-vertical")):(v.classList.add("icon-resize-vertical"),v.classList.remove("icon-minus")))}var y=(0,i.default)(u.id),h=(0,o.default)({cmd:"minimize",doAsUserId:n.doAsUserId,p_auth:Liferay.authToken,p_l_id:n.plid,p_p_id:y,p_p_restore:f,p_v_l_s_g_id:themeDisplay.getSiteGroupId()});(0,r.default)(themeDisplay.getPathMain()+"/portal/update_layout",{body:h,method:"POST"}).then((function(e){if(e.ok&&f){var t={doAsUserId:n.doAsUserId,p_l_id:n.plid,p_p_boundary:!1,p_p_id:y,p_p_isolated:!0};(0,r.default)((0,a.default)(themeDisplay.getPathMain()+"/portal/render_portlet",t)).then((function(e){return e.text()})).then((function(e){var t=document.createRange();t.selectNode(u),u.innerHTML="";var n=t.createContextualFragment(e);u.appendChild(n)})).catch((function(e){0}))}})).catch((function(e){0}))}}},t.default=void 0;var r=u(n(4)),o=u(n(15)),i=u(n(16)),a=u(n(3));function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s={register:u(n(46)).default};t.default=s},function(e,t,n){(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.register=void 0;var r,o=(r=n(47))&&r.__esModule?r:{default:r},i=n(19);var a=function(t){(0,i.validateArguments)(arguments,1,1,["string"]);var n=e.portlet.data.pageRenderState;return new Promise((function(e,r){(0,i.validatePortletId)(n,t)?e(new o.default(t)):r(new Error("Invalid portlet ID"))}))};t.register=a;var u=a;t.default=u}).call(this,n(1))},function(e,t,n){(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortletInit=void 0;var r=n(0),o=l(n(48)),i=l(n(4)),a=l(n(51)),u=l(n(18)),c=n(19);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var h,m=window.history&&window.history.pushState,b=!1,g={},_=[],w=function(){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._portletId=n,this.constants=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},u.default),h||(h=e.portlet.data.pageRenderState,this._updateHistory(!0)),this.portletModes=h.portlets[this._portletId].allowedPM.slice(0),this.windowStates=h.portlets[this._portletId].allowedWS.slice(0)}var n,l,w;return n=t,(l=[{key:"_executeAction",value:function(e,t){var n=this;return new Promise((function(r,o){(0,c.getUrl)(h,"ACTION",n._portletId,e).then((function(e){var a=(0,c.generateActionUrl)(n._portletId,e,t);(0,i.default)(a.url,a).then((function(e){return e.text()})).then((function(e){var t=n._updatePageStateFromString(e,n._portletId);r(t)})).catch((function(e){o(e)}))}))}))}},{key:"_hasListener",value:function(e){return Object.keys(g).map((function(e){return g[e].id})).includes(e)}},{key:"_reportError",value:function(e,t){Object.keys(g).map((function(n){var r=g[n];return r.id===e&&"portlet.onError"===r.type&&setTimeout((function(){r.handler("portlet.onError",t)})),!1}))}},{key:"_setPageState",value:function(e,t){var n=this;if(!(0,r.isString)(t))throw new TypeError("Invalid update string: ".concat(t));this._updatePageState(t,e).then((function(e){n._updatePortletStates(e)}),(function(t){b=!1,n._reportError(e,t)}))}},{key:"_setState",value:function(e){var t=this,n=(0,c.getUpdatedPublicRenderParameters)(h,this._portletId,e),r=[];Object.keys(n).forEach((function(e){var o=n[e],i=h.prpMap[e];Object.keys(i).forEach((function(e){if(e!==t._portletId){var n=i[e].split("|"),a=n[0],u=n[1];void 0===o?delete h.portlets[a].state.parameters[u]:h.portlets[a].state.parameters[u]=d(o),r.push(a)}}))}));var o=this._portletId;return h.portlets[o].state=e,r.push(o),r.forEach((function(e){h.portlets[e].renderData.content=null})),this._updateHistory(),Promise.resolve(r)}},{key:"_setupAction",value:function(e,t){var n=this;if(this.isInProgress())throw{message:"Operation is already in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};return b=!0,this._executeAction(e,t).then((function(e){return n._updatePortletStates(e).then((function(e){return b=!1,e}))}),(function(e){b=!1,n._reportError(n._portletId,e)}))}},{key:"_updateHistory",value:function(e){m&&(0,c.getUrl)(h,"RENDER",null,{}).then((function(t){var n=JSON.stringify(h);if(e)history.replaceState(n,"");else try{history.pushState(n,"",t)}catch(e){}}))}},{key:"_updatePageState",value:function(e){var t=this;return new Promise((function(n,r){try{n(t._updatePageStateFromString(e,t._portletId))}catch(e){r(new Error("Partial Action decode status: ".concat(e.message)))}}))}},{key:"_updatePageStateFromString",value:function(e,t){var n=(0,c.decodeUpdateString)(h,e),r=[],o=!1;return Object.entries(n).forEach((function(e){var t=f(e,2),n=t[0],i=t[1];h.portlets[n]=i,r.push(n),o=!0})),o&&t&&this._updateHistory(),r}},{key:"_updatePortletStates",value:function(e){var t=this;return new Promise((function(n){0===e.length?b=!1:e.forEach((function(e){t._updateStateForPortlet(e)})),n(e)}))}},{key:"_updateState",value:function(e){var t=this;if(b)throw{message:"Operation in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};b=!0,this._setState(e).then((function(e){t._updatePortletStates(e)})).catch((function(e){b=!1,t._reportError(t._portletId,e)}))}},{key:"_updateStateForPortlet",value:function(e){var t=_.map((function(e){return e.handle}));Object.entries(g).forEach((function(n){var r=f(n,2),o=r[0],i=r[1];"portlet.onStateChange"===i.type&&(i.id!==e||t.includes(o)||_.push(i))})),_.length>0&&setTimeout((function(){for(b=!0;_.length>0;){var e=_.shift(),t=e.handler,n=e.id;if(h.portlets[n]){var r=h.portlets[n].renderData,o=new a.default(h.portlets[n].state);r&&r.content?t("portlet.onStateChange",o,r):t("portlet.onStateChange",o)}}b=!1}))}},{key:"action",value:function(){for(var e=null,t=0,n=null,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return i.forEach((function(o){if(o instanceof HTMLFormElement){if(null!==n)throw new TypeError("Too many [object HTMLFormElement] arguments: ".concat(o,", ").concat(n));n=o}else if((0,r.isObject)(o)){if((0,c.validateParameters)(o),null!==e)throw new TypeError("Too many parameters arguments");e=o}else if(void 0!==o){var i=Object.prototype.toString.call(o);throw new TypeError("Invalid argument type. Argument ".concat(t+1," is of type ").concat(i))}t++})),n&&(0,c.validateForm)(n),this._setupAction(e,n).then((function(e){Promise.resolve(e)})).catch((function(e){Promise.reject(e)}))}},{key:"addEventListener",value:function(e,t){if(arguments.length>2)throw new TypeError("Too many arguments passed to addEventListener");if(!(0,r.isString)(e)||!(0,r.isFunction)(t))throw new TypeError("Invalid arguments passed to addEventListener");var n=this._portletId;if(e.startsWith("portlet.")&&"portlet.onStateChange"!==e&&"portlet.onError"!==e)throw new TypeError("The system event type is invalid: ".concat(e));var i=(0,o.default)(),a={handle:i,handler:t,id:n,type:e};return g[i]=a,"portlet.onStateChange"===e&&this._updateStateForPortlet(this._portletId),i}},{key:"createResourceUrl",value:function(e,t,n){if(arguments.length>3)throw new TypeError("Too many arguments. 3 arguments are allowed.");if(e){if(!(0,r.isObject)(e))throw new TypeError("Invalid argument type. Resource parameters must be a parameters object.");(0,c.validateParameters)(e)}var o=null;if(t){if(!(0,r.isString)(t))throw new TypeError("Invalid argument type. Cacheability argument must be a string.");if("cacheLevelPage"!==t&&"cacheLevelPortlet"!==t&&"cacheLevelFull"!==t)throw new TypeError("Invalid cacheability argument: ".concat(t));o=t}if(o||(o="cacheLevelPage"),n&&!(0,r.isString)(n))throw new TypeError("Invalid argument type. Resource ID argument must be a string.");return(0,c.getUrl)(h,"RESOURCE",this._portletId,e,o,n)}},{key:"dispatchClientEvent",value:function(e,t){if((0,c.validateArguments)(arguments,2,2,["string"]),e.match(new RegExp("^portlet[.].*")))throw new TypeError("The event type is invalid: "+e);return Object.keys(g).reduce((function(n,r){var o=g[r];return e.match(o.type)&&(o.handler(e,t),n++),n}),0)}},{key:"isInProgress",value:function(){return b}},{key:"newParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return Object.keys(e).forEach((function(n){Array.isArray(e[n])&&(t[n]=d(e[n]))})),t}},{key:"newState",value:function(e){return new a.default(e)}},{key:"removeEventListener",value:function(e){if(arguments.length>1)throw new TypeError("Too many arguments passed to removeEventListener");if(!(0,r.isDefAndNotNull)(e))throw new TypeError("The event handle provided is ".concat(s(e)));var t=!1;if((0,r.isObject)(g[e])&&g[e].id===this._portletId){delete g[e];for(var n=_.length,o=0;o<n;o++){var i=_[o];i&&i.handle===e&&_.splice(o,1)}t=!0}if(!t)throw new TypeError("The event listener handle doesn't match any listeners.")}},{key:"setRenderState",value:function(e){if((0,c.validateArguments)(arguments,1,1,["object"]),h.portlets&&h.portlets[this._portletId]){var t=h.portlets[this._portletId];(0,c.validateState)(e,t),this._updateState(e)}}},{key:"startPartialAction",value:function(e){var t=this,n=null;if(arguments.length>1)throw new TypeError("Too many arguments. 1 arguments are allowed");if(void 0!==e){if(!(0,r.isObject)(e))throw new TypeError("Invalid argument type. Argument is of type ".concat(s(e)));(0,c.validateParameters)(e),n=e}if(!0===b)throw{message:"Operation in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};b=!0;var o={setPageState:function(e){t._setPageState(t._portletId,e)},url:""};return(0,c.getUrl)(h,"PARTIAL_ACTION",this._portletId,n).then((function(e){return o.url=e,o}))}}])&&y(n.prototype,l),w&&y(n,w),t}();t.PortletInit=w;var O=w;t.default=O}).call(this,n(1))},function(e,t,n){var r,o,i=n(49),a=n(50),u=0,c=0;e.exports=function(e,t,n){var l=t&&n||0,s=t||[],f=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==d){var p=i();null==f&&(f=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=o=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,h=v-u+(y-c)/1e4;if(h<0&&void 0===e.clockseq&&(d=d+1&16383),(h<0||v>u)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=v,c=y,o=d;var m=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;s[l++]=m>>>24&255,s[l++]=m>>>16&255,s[l++]=m>>>8&255,s[l++]=255&m;var b=v/4294967296*1e4&268435455;s[l++]=b>>>8&255,s[l++]=255&b,s[l++]=b>>>24&15|16,s[l++]=b>>>16&255,s[l++]=d>>>8|128,s[l++]=255&d;for(var g=0;g<6;++g)s[l+g]=f[g];return t||a(s)}},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RenderState=void 0;var r,o=n(0),i=(r=n(18))&&r.__esModule?r:{default:r};function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(0,o.isObject)(t)?this.from(t):(this.parameters={},this.portletMode=i.default.VIEW,this.windowState=i.default.NORMAL)}var t,n,r;return t=e,(n=[{key:"clone",value:function(){return new e(this)}},{key:"from",value:function(e){var t=this;this.parameters={},Object.keys(e.parameters).forEach((function(n){Array.isArray(e.parameters[n])&&(t.parameters[n]=e.parameters[n].slice(0))})),this.setPortletMode(e.portletMode),this.setWindowState(e.windowState)}},{key:"getPortletMode",value:function(){return this.portletMode}},{key:"getValue",value:function(e,t){if(!(0,o.isString)(e))throw new TypeError("Parameter name must be a string");var n=this.parameters[e];return Array.isArray(n)&&(n=n[0]),void 0===n&&void 0!==t&&(n=t),n}},{key:"getValues",value:function(e,t){if(!(0,o.isString)(e))throw new TypeError("Parameter name must be a string");var n=this.parameters[e];return n||t}},{key:"getWindowState",value:function(){return this.windowState}},{key:"remove",value:function(e){if(!(0,o.isString)(e))throw new TypeError("Parameter name must be a string");void 0!==this.parameters[e]&&delete this.parameters[e]}},{key:"setPortletMode",value:function(e){if(!(0,o.isString)(e))throw new TypeError("Portlet Mode must be a string");e!==i.default.EDIT&&e!==i.default.HELP&&e!==i.default.VIEW||(this.portletMode=e)}},{key:"setValue",value:function(e,t){if(!(0,o.isString)(e))throw new TypeError("Parameter name must be a string");if(!(0,o.isString)(t)&&null!==t&&!Array.isArray(t))throw new TypeError("Parameter value must be a string, an array or null");Array.isArray(t)||(t=[t]),this.parameters[e]=t}},{key:"setValues",value:function(e,t){this.setValue(e,t)}},{key:"setWindowState",value:function(e){if(!(0,o.isString)(e))throw new TypeError("Window State must be a string");e!==i.default.MAXIMIZED&&e!==i.default.MINIMIZED&&e!==i.default.NORMAL||(this.windowState=e)}}])&&a(t.prototype,n),r&&a(t,r),e}();t.RenderState=u;var c=u;t.default=c},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(5))&&r.__esModule?r:{default:r};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var l=new WeakMap;function s(e){if(e&&e.jquery){if(e.length>1)throw new Error("getElement(): Expected at most one element, got ".concat(e.length));e=e.get(0)}return!e||e instanceof HTMLElement||(e=e.element),e}function f(e){return e=s(e),l.get(e)}var d=[/^aria-/,/^data-/,/^type$/];function p(e,t){y(e,u({},t,!0))}function v(e,t){y(e,u({},t,!1))}function y(e,t){(e=s(e))&&Object.entries(t).forEach((function(t){var n=a(t,2),r=n[0],o=n[1];r.split(/\s+/).forEach((function(t){o?e.classList.add(t):e.classList.remove(t)}))}))}function h(e,t){return e=s(e),t.split(/\s+/).every((function(t){return e.classList.contains(t)}))}function m(e,t){(e=s(e))&&Object.entries(t).forEach((function(t){var n=a(t,2),r=n[0],o=n[1];e.style[r]=o}))}function b(e){return"number"==typeof e?e+"px":"string"==typeof e&&e.match(/^\s*\d+\s*$/)?e.trim()+"px":e}function g(e){return e.getBoundingClientRect().left+(e.ownerDocument.defaultView.pageOffsetX||0)}var _={};function w(e,t,n){if(e){_[t]||(_[t]={},document.body.addEventListener(t,(function(e){return function(e,t){Object.keys(_[e]).forEach((function(n){for(var r=!1,o=t.target;o&&!(r=o.matches&&o.matches(n));)o=o.parentNode;r&&_[e][n].emit("click",t)}))}(t,e)})));var r=_[t],i="string"==typeof e?e:function(e){if((e=s(e)).id)return"#".concat(e.id);for(var t=e.parentNode;t&&!t.id;)t=t.parentNode;var n=Array.from(e.attributes).map((function(e){var t=e.name,n=e.value;return d.some((function(e){return e.test(t)}))?"[".concat(t,"=").concat(JSON.stringify(n),"]"):null})).filter(Boolean).sort();return[t?"#".concat(t.id," "):"",e.tagName.toLowerCase()].concat(c(n)).join("")}(e);r[i]||(r[i]=new o.default);var a=r[i].on(t,(function(e){e.defaultPrevented||n(e)}));return{dispose:function(){a.dispose()}}}return null}function O(e){return parseInt(e,10)||0}function j(e,t){e=s(e),this.init(e,t)}j.TRANSITION_DURATION=500,j.prototype={_bindUI:function(){this._subscribeClickTrigger(),this._subscribeClickSidenavClose()},_emit:function(e){this._emitter.emit(e,this)},_getSidenavWidth:function(){var e=this.options.widthOriginal,t=e,n=window.innerWidth;return n<e+40&&(t=n-40),t},_getSimpleSidenavType:function(){var e=this.options,t=this._isDesktop(),n=e.type,r=e.typeMobile;return t&&"fixed-push"===n?"desktop-fixed-push":t||"fixed-push"!==r?"fixed":"mobile-fixed-push"},_isDesktop:function(){return window.innerWidth>=this.options.breakpoint},_isSidenavRight:function(){var e=this.options;return h(document.querySelector(e.container),"sidenav-right")},_isSimpleSidenavClosed:function(){var e=this.options,t=e.openClass;return!h(document.querySelector(e.container),t)},_loadUrl:function(e,t){var n=this,r=e.querySelector(".sidebar-body");if(!n._fetchPromise&&r){for(;r.firstChild;)r.removeChild(r.firstChild);var o=document.createElement("div");p(o,"sidenav-loading"),o.innerHTML=n.options.loadingIndicatorTPL,r.appendChild(o),n._fetchPromise=Liferay.Util.fetch(t),n._fetchPromise.then((function(e){if(!e.ok)throw new Error("Failed to fetch ".concat(t));return e.text()})).then((function(e){var t=document.createRange();t.selectNode(r);var i=t.createContextualFragment(e);r.removeChild(o),r.appendChild(i),n.setHeight()})).catch((function(e){console.error(e)}))}},_renderNav:function(){var e=this.options,t=document.querySelector(e.container),n=t.querySelector(e.navigation).querySelector(".sidenav-menu"),r=h(t,"closed"),o=this._isSidenavRight(),i=this._getSidenavWidth();r?(m(n,{width:b(i)}),o&&m(n,u({},e.rtl?"left":"right",b(i)))):(this.showSidenav(),this.setHeight())},_renderUI:function(){var e=this.options,t=document.querySelector(e.container),n=this.toggler,r=this.mobile,o=r?e.typeMobile:e.type;this.useDataAttribute||(r&&(y(t,{closed:!0,open:!1}),y(n,{active:!1,open:!1})),"right"===e.position&&p(t,"sidenav-right"),"relative"!==o&&p(t,"sidenav-fixed"),this._renderNav()),m(t,{display:""})},_subscribeClickSidenavClose:function(){var e=this,t=e.options.container;if(!e._sidenavCloseSubscription){var n="".concat(t," .sidenav-close");e._sidenavCloseSubscription=w(n,"click",(function(t){t.preventDefault(),e.toggle()}))}},_subscribeClickTrigger:function(){var e=this;if(!e._togglerSubscription){var t=e.toggler;e._togglerSubscription=w(t,"click",(function(t){e.toggle(),t.preventDefault()}))}},_subscribeSidenavTransitionEnd:function(e,t){setTimeout((function(){v(e,"sidenav-transition"),t()}),j.TRANSITION_DURATION)},clearHeight:function(){var e=this.options,t=document.querySelector(e.container);t&&[t.querySelector(e.content),t.querySelector(e.navigation),t.querySelector(".sidenav-menu")].forEach((function(e){m(e,{height:"","min-height":""})}))},destroy:function(){this._sidenavCloseSubscription&&(this._sidenavCloseSubscription.dispose(),this._sidenavCloseSubscription=null),this._togglerSubscription&&(this._togglerSubscription.dispose(),this._togglerSubscription=null),l.delete(this.toggler)},hide:function(){this.useDataAttribute?this.hideSimpleSidenav():this.toggleNavigation(!1)},hideSidenav:function(){var e=this.options,t=document.querySelector(e.container);if(t){var n,r=t.querySelector(e.content),o=t.querySelector(e.navigation),i=o.querySelector(".sidenav-menu"),a=this._isSidenavRight(),c=e.rtl?"right":"left";a&&(c=e.rtl?"left":"right"),m(r,(u(n={},"padding-"+c,""),u(n,c,""),n)),m(o,{width:""}),a&&m(i,u({},c,b(this._getSidenavWidth())))}},hideSimpleSidenav:function(){var e=this,t=e.options;if(!e._isSimpleSidenavClosed()){var n,r,o=document.querySelector(t.content),i=document.querySelector(t.container),a=t.closedClass,c=t.openClass,l=e.toggler,s=l.dataset.target||l.getAttribute("href");if(e._emit("closedStart.lexicon.sidenav"),e._subscribeSidenavTransitionEnd(o,(function(){v(i,"sidenav-transition"),v(l,"sidenav-transition"),e._emit("closed.lexicon.sidenav")})),h(o,c))y(o,(u(r={},a,!0),u(r,c,!1),u(r,"sidenav-transition",!0),r));p(i,"sidenav-transition"),p(l,"sidenav-transition"),y(i,(u(n={},a,!0),u(n,c,!1),n));var f=document.querySelectorAll('[data-target="'.concat(s,'"], [href="').concat(s,'"]'));Array.from(f).forEach((function(e){y(e,u({active:!1},c,!1)),y(e,u({active:!1},c,!1))}))}},init:function(e,t){var n="liferay-sidenav"===e.dataset.toggle;(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},E,{},t)).breakpoint=O(t.breakpoint),t.container=t.container||e.dataset.target||e.getAttribute("href"),t.gutter=O(t.gutter),t.rtl="rtl"===document.dir,t.width=O(t.width),t.widthOriginal=t.width,n&&(t.closedClass=e.dataset.closedClass||"closed",t.content=e.dataset.content,t.loadingIndicatorTPL=e.dataset.loadingIndicatorTpl||t.loadingIndicatorTPL,t.openClass=e.dataset.openClass||"open",t.type=e.dataset.type,t.typeMobile=e.dataset.typeMobile,t.url=e.dataset.url,t.width=""),this.toggler=e,this.options=t,this.useDataAttribute=n,this._emitter=new o.default,this._bindUI(),this._renderUI()},on:function(e,t){return this._emitter.on(e,t)},setHeight:function(){var e=this.options,t=document.querySelector(e.container),n=this.mobile?e.typeMobile:e.type;if("fixed"!==n&&"fixed-push"!==n){var r=t.querySelector(e.content),o=t.querySelector(e.navigation),i=t.querySelector(".sidenav-menu"),a=r.getBoundingClientRect().height,u=o.getBoundingClientRect().height,c=b(Math.max(a,u));m(r,{"min-height":c}),m(o,{height:"100%","min-height":c}),m(i,{height:"100%","min-height":c})}},show:function(){this.useDataAttribute?this.showSimpleSidenav():this.toggleNavigation(!0)},showSidenav:function(){var e=this.mobile,t=this.options,n=document.querySelector(t.container),r=n.querySelector(t.content),o=n.querySelector(t.navigation),i=o.querySelector(".sidenav-menu"),a=this._isSidenavRight(),c=this._getSidenavWidth(),l=c+t.gutter,s=t.url;s&&this._loadUrl(i,s),m(o,{width:b(c)}),m(i,{width:b(c)});var f=t.rtl?"right":"left";a&&(f=t.rtl?"left":"right");var d=e?f:"padding-"+f;if("fixed"!==(e?t.typeMobile:t.type)){var p=h(n,"open")?g(o)-t.gutter:g(o)-l,v=g(r),y=O(getComputedStyle(r).width),_="";t.rtl&&a||!t.rtl&&"left"===t.position?(p=g(o)+l)>v&&(_=p-v):(t.rtl&&"left"===t.position||!t.rtl&&a)&&p<v+y&&(_=v+y-p)>=l&&(_=l),m(r,u({},d,b(_)))}},showSimpleSidenav:function(){var e=this,t=e.options;if(e._isSimpleSidenavClosed()){var n,r,o,i=document.querySelector(t.content),a=document.querySelector(t.container),c=t.closedClass,l=t.openClass,s=e.toggler,f=s.dataset.url;f&&e._loadUrl(a,f),e._emit("openStart.lexicon.sidenav"),e._subscribeSidenavTransitionEnd(i,(function(){v(a,"sidenav-transition"),v(s,"sidenav-transition"),e._emit("open.lexicon.sidenav")})),y(i,(u(n={},c,!1),u(n,l,!0),u(n,"sidenav-transition",!0),n)),y(a,(u(r={},c,!1),u(r,l,!0),u(r,"sidenav-transition",!0),r)),y(s,(u(o={active:!0},l,!0),u(o,"sidenav-transition",!0),o))}},toggle:function(){this.useDataAttribute?this.toggleSimpleSidenav():this.toggleNavigation()},toggleNavigation:function(e){var t=this,n=t.options,r=document.querySelector(n.container),o=r.querySelector(".sidenav-menu"),i=t.toggler,a=n.width,c="boolean"==typeof e?e:h(r,"closed"),l=t._isSidenavRight();if(c?t._emit("openStart.lexicon.sidenav"):t._emit("closedStart.lexicon.sidenav"),t._subscribeSidenavTransitionEnd(r,(function(){var e=r.querySelector(".sidenav-menu");h(r,"closed")?(t.clearHeight(),y(i,{open:!1,"sidenav-transition":!1}),t._emit("closed.lexicon.sidenav")):(y(i,{open:!0,"sidenav-transition":!1}),t._emit("open.lexicon.sidenav")),t.mobile&&e.focus()})),c){t.setHeight(),m(o,{width:b(a)});var s=n.rtl?"left":"right";l&&m(o,u({},s,""))}p(r,"sidenav-transition"),p(i,"sidenav-transition"),c?t.showSidenav():t.hideSidenav(),y(r,{closed:!c,open:c}),y(i,{active:c,open:c})},toggleSimpleSidenav:function(){this._isSimpleSidenavClosed()?this.showSimpleSidenav():this.hideSimpleSidenav()},visible:function(){var e;if(this.useDataAttribute)e=this._isSimpleSidenavClosed();else{var t=document.querySelector(this.options.container);e=h(t,"sidenav-transition")?!h(t,"closed"):h(t,"closed")}return!e}},j.destroy=function(e){var t=f(e);t&&t.destroy()},j.hide=function(e){var t=f(e);t&&t.hide()},j.initialize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=s(e);var n=l.get(e);return n||(n=new j(e,t),l.set(e,n)),n},j.instance=f;var E={breakpoint:768,content:".sidenav-content",gutter:"0px",loadingIndicatorTPL:'<div class="loading-animation loading-animation-md"></div>',navigation:".sidenav-menu-slider",position:"left",type:"relative",typeMobile:"relative",url:null,width:"225px"};function S(){var e=document.querySelectorAll('[data-toggle="liferay-sidenav"]');Array.from(e).forEach(j.initialize)}"loading"!==document.readyState?S():document.addEventListener("DOMContentLoaded",(function(){S()}));var P=j;t.default=P},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=n(20),u=(r=a)&&r.__esModule?r:{default:r};var c=[0],l=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.events_=null,e.listenerHandlers_=null,e.shouldUseFacade_=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"addHandler_",value:function(e,t){return e?(Array.isArray(e)||(e=[e]),e.push(t)):e=t,e}},{key:"addListener",value:function(e,t,n){this.validateListener_(t);for(var r=this.toEventsArray_(e),o=0;o<r.length;o++)this.addSingleListener_(r[o],t,n);return new u.default(this,e,t)}},{key:"addSingleListener_",value:function(e,t,n,r){this.runListenerHandlers_(e),(n||r)&&(t={default:n,fn:t,origin:r}),this.events_=this.events_||{},this.events_[e]=this.addHandler_(this.events_[e],t)}},{key:"buildFacade_",value:function(e){if(this.getShouldUseFacade()){var t={preventDefault:function(){t.preventedDefault=!0},target:this,type:e};return t}}},{key:"disposeInternal",value:function(){this.events_=null}},{key:"emit",value:function(e){var t=this.getRawListeners_(e);if(0===t.length)return!1;var n=i.array.slice(arguments,1);return this.runListeners_(t,n,this.buildFacade_(e)),!0}},{key:"getRawListeners_",value:function(e){return s(this.events_&&this.events_[e]).concat(s(this.events_&&this.events_["*"]))}},{key:"getShouldUseFacade",value:function(){return this.shouldUseFacade_}},{key:"listeners",value:function(e){return this.getRawListeners_(e).map((function(e){return e.fn?e.fn:e}))}},{key:"many",value:function(e,t,n){for(var r=this.toEventsArray_(e),o=0;o<r.length;o++)this.many_(r[o],t,n);return new u.default(this,e,n)}},{key:"many_",value:function(e,t,n){var r=this;t<=0||r.addSingleListener_(e,(function o(){0==--t&&r.removeListener(e,o),n.apply(r,arguments)}),!1,n)}},{key:"matchesListener_",value:function(e,t){return(e.fn||e)===t||e.origin&&e.origin===t}},{key:"off",value:function(e,t){if(this.validateListener_(t),!this.events_)return this;for(var n=this.toEventsArray_(e),r=0;r<n.length;r++)this.events_[n[r]]=this.removeMatchingListenerObjs_(s(this.events_[n[r]]),t);return this}},{key:"on",value:function(){return this.addListener.apply(this,arguments)}},{key:"onListener",value:function(e){this.listenerHandlers_=this.addHandler_(this.listenerHandlers_,e)}},{key:"once",value:function(e,t){return this.many(e,1,t)}},{key:"removeAllListeners",value:function(e){if(this.events_)if(e)for(var t=this.toEventsArray_(e),n=0;n<t.length;n++)this.events_[t[n]]=null;else this.events_=null;return this}},{key:"removeMatchingListenerObjs_",value:function(e,t){for(var n=[],r=0;r<e.length;r++)this.matchesListener_(e[r],t)||n.push(e[r]);return n.length>0?n:null}},{key:"removeListener",value:function(){return this.off.apply(this,arguments)}},{key:"runListenerHandlers_",value:function(e){var t=this.listenerHandlers_;if(t){t=s(t);for(var n=0;n<t.length;n++)t[n](e)}}},{key:"runListeners_",value:function(e,t,n){n&&t.push(n);for(var r=[],o=0;o<e.length;o++){var i=e[o].fn||e[o];e[o].default?r.push(i):i.apply(this,t)}if(!n||!n.preventedDefault)for(var a=0;a<r.length;a++)r[a].apply(this,t)}},{key:"setShouldUseFacade",value:function(e){return this.shouldUseFacade_=e,this}},{key:"toEventsArray_",value:function(e){return(0,i.isString)(e)&&(c[0]=e,e=c),e}},{key:"validateListener_",value:function(e){if(!(0,i.isFunction)(e))throw new TypeError("Listener must be a function")}}]),t}(i.Disposable);function s(e){return e=e||[],Array.isArray(e)?e:[e]}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.blacklist_=r,i.originEmitter_=e,i.pendingEvents_=null,i.proxiedEvents_=null,i.targetEmitter_=n,i.whitelist_=o,i.startProxy_(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"addListener_",value:function(e,t){return this.originEmitter_.on(e,t)}},{key:"disposeInternal",value:function(){this.removeListeners_(),this.proxiedEvents_=null,this.originEmitter_=null,this.targetEmitter_=null}},{key:"emitOnTarget_",value:function(){var e;(e=this.targetEmitter_).emit.apply(e,arguments)}},{key:"proxyEvent",value:function(e){this.shouldProxyEvent_(e)&&this.tryToAddListener_(e)}},{key:"removeListeners_",value:function(){if(this.proxiedEvents_){for(var e=Object.keys(this.proxiedEvents_),t=0;t<e.length;t++)this.proxiedEvents_[e[t]].removeListener();this.proxiedEvents_=null}this.pendingEvents_=null}},{key:"setOriginEmitter",value:function(e){var t=this,n=this.originEmitter_&&this.proxiedEvents_?Object.keys(this.proxiedEvents_):this.pendingEvents_;this.originEmitter_=e,n&&(this.removeListeners_(),n.forEach((function(e){return t.proxyEvent(e)})))}},{key:"shouldProxyEvent_",value:function(e){return!(this.whitelist_&&!this.whitelist_[e])&&((!this.blacklist_||!this.blacklist_[e])&&(!this.proxiedEvents_||!this.proxiedEvents_[e]))}},{key:"startProxy_",value:function(){this.targetEmitter_.onListener(this.proxyEvent.bind(this))}},{key:"tryToAddListener_",value:function(e){this.originEmitter_?(this.proxiedEvents_=this.proxiedEvents_||{},this.proxiedEvents_[e]=this.addListener_(e,this.emitOnTarget_.bind(this,e))):(this.pendingEvents_=this.pendingEvents_||[],this.pendingEvents_.push(e))}}]),t}(n(0).Disposable);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.eventHandles_=[],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<arguments.length;r++)this.eventHandles_.push(t[r])}},{key:"disposeInternal",value:function(){this.eventHandles_=null}},{key:"removeAllListeners",value:function(){for(var e=0;e<this.eventHandles_.length;e++)this.eventHandles_[e].removeListener();this.eventHandles_=[]}}]),t}(n(0).Disposable);t.default=o},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e||"object"!==n(e)&&"string"!=typeof e)throw new TypeError("Parameter params must be an object or string");if("string"!=typeof t)throw new TypeError("Parameter baseUrl must be a string");var r=t.startsWith("/")?new URL(t,location.href):new URL(t);if("object"===n(e))Object.entries(e).forEach((function(e){var t,n,o=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),i=o[0],a=o[1];r.searchParams.append(i,a)}));else{new URLSearchParams(e.trim()).forEach((function(e,t){e?r.searchParams.append(t,e):r.searchParams.append(t,"")}))}return r.toString()}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("function"!=typeof e)throw new TypeError("Parameter callback must be a function");Liferay.Service("/country/get-countries",{active:!0},e)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("function"!=typeof e)throw new TypeError("Parameter callback must be a function");if("string"!=typeof t)throw new TypeError("Parameter selectKey must be a string");Liferay.Service("/region/get-regions",{active:!0,countryId:parseInt(t,10)},e)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e=(0,r.default)(e),(0,o.default)(e)){var t=function(e){var t=[];for(;e.parentElement;)e.parentElement.getAttribute("disabled")&&t.push(e.parentElement),e=e.parentElement;return t}(e),n=!e.getAttribute("disabled")&&e.offsetWidth>0&&e.offsetHeight>0&&!t.length,i=e.closest("form");if(!i||n)e.focus();else if(i){var a=i.getAttribute("data-fm-namespace")+"formReady";Liferay.on(a,(function t(n){i.getAttribute("name")===n.formName&&(e.focus(),Liferay.detach(a,t))}))}}};var r=i(n(7)),o=i(n(22));function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((e=o.default.toElement(e))&&"FORM"===e.nodeName)if(e.setAttribute("method","post"),(0,r.isObject)(t)){var n=t.data,a=t.url;if(!(0,r.isObject)(n))return;(0,i.default)(e,n),(0,r.isDef)(a)?(0,r.isString)(a)&&submitForm(e,a):submitForm(e)}else submitForm(e)};var r=n(0),o=a(n(61)),i=a(n(26));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalEvalStyles=t.globalEval=t.features=t.DomEventHandle=t.DomEventEmitterProxy=t.domData=void 0;var r=n(2);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=f(r),i=f(n(8)),a=f(n(64)),u=f(n(24)),c=f(n(25)),l=f(n(65)),s=f(n(66));function f(e){return e&&e.__esModule?e:{default:e}}n(67),t.domData=i.default,t.DomEventEmitterProxy=a.default,t.DomEventHandle=u.default,t.features=c.default,t.globalEval=l.default,t.globalEvalStyles=s.default,t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customEvents=void 0,t.addClasses=function(e,t){if(!(0,r.isObject)(e)||!(0,r.isString)(t))return;e.length||(e=[e]);for(var n=0;n<e.length;n++)"classList"in e[n]?d(e[n],t):p(e[n],t)},t.closest=y,t.append=h,t.buildFragment=m,t.contains=b,t.delegate=g,t.isNodeListLike=w,t.enterDocument=function(e){e&&h(document.body,e)},t.exitDocument=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},t.hasClass=function(e,t){return"classList"in e?function(e,t){return-1===t.indexOf(" ")&&e.classList.contains(t)}(e,t):function(e,t){return(" "+e.className+" ").indexOf(" "+t+" ")>=0&&1===t.split(" ").length}(e,t)},t.isEmpty=function(e){return 0===e.childNodes.length},t.match=j,t.next=function(e,t){do{if((e=e.nextSibling)&&j(e,t))return e}while(e);return null},t.on=E,t.once=function(e,t,n){var r=E(e,t,(function(){return r.removeListener(),n.apply(this,arguments)}));return r},t.parent=S,t.prepend=function(e,t){(0,r.isString)(t)&&(t=m(t));if(!w(t)&&!(0,r.isDefAndNotNull)(e.firstChild))return h(e,t);if(w(t))for(var n=Array.prototype.slice.call(t),o=n.length-1;o>=0;o--)e.insertBefore(n[o],e.firstChild);else e.insertBefore(t,e.firstChild);return t},t.registerCustomEvent=function(e,t){s[e]=t},t.removeChildren=function(e){var t=void 0;for(;t=e.firstChild;)e.removeChild(t)},t.removeClasses=function(e,t){if(!(0,r.isObject)(e)||!(0,r.isString)(t))return;e.length||(e=[e]);for(var n=0;n<e.length;n++)"classList"in e[n]?P(e[n],t):T(e[n],t)},t.replace=function(e,t){e&&t&&e!==t&&e.parentNode&&e.parentNode.replaceChild(t,e)},t.supportsEvent=function(e,t){if(s[t])return!0;(0,r.isString)(e)&&(c[e]||(c[e]=document.createElement(e)),e=c[e]);var n=e.tagName;l[n]&&l[n].hasOwnProperty(t)||(l[n]=l[n]||{},l[n][t]="on"+t in e);return l[n][t]},t.toElement=function(e){return(0,r.isElement)(e)||(0,r.isDocument)(e)||(0,r.isDocumentFragment)(e)?e:(0,r.isString)(e)?document.querySelector(e):null},t.toggleClasses=function(e,t){if(!(0,r.isObject)(e)||!(0,r.isString)(t))return;"classList"in e?function(e,t){t.split(" ").forEach((function(t){e.classList.toggle(t)}))}(e,t):function(e,t){var n=" "+e.className+" ";t=t.split(" ");for(var r=0;r<t.length;r++){var o=" "+t[r]+" ",i=n.indexOf(o);if(-1===i)n=""+n+t[r]+" ";else{var a=n.substring(0,i),u=n.substring(i+o.length);n=a+" "+u}}e.className=n.trim()}(e,t)},t.triggerEvent=function(e,t,n){if(_(e,t,n)){var o=document.createEvent("HTMLEvents");o.initEvent(t,!0,!0),r.object.mixin(o,n),e.dispatchEvent(o)}};var r=n(0),o=u(n(8)),i=u(n(63)),a=u(n(24));function u(e){return e&&e.__esModule?e:{default:e}}var c={},l={},s=t.customEvents={},f={blur:!0,error:!0,focus:!0,invalid:!0,load:!0,scroll:!0};function d(e,t){t.split(" ").forEach((function(t){t&&e.classList.add(t)}))}function p(e,t){var n=" "+e.className+" ",r="";t=t.split(" ");for(var o=0;o<t.length;o++){var i=t[o];-1===n.indexOf(" "+i+" ")&&(r+=" "+i)}r&&(e.className=e.className+r)}function v(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function y(e,t){for(;e&&!j(e,t);)e=e.parentNode;return e}function h(e,t){if((0,r.isString)(t)&&(t=m(t)),w(t))for(var n=Array.prototype.slice.call(t),o=0;o<n.length;o++)e.appendChild(n[o]);else e.appendChild(t);return t}function m(e){var t=document.createElement("div");t.innerHTML="<br>"+e,t.removeChild(t.firstChild);for(var n=document.createDocumentFragment();t.firstChild;)n.appendChild(t.firstChild);return n}function b(e,t){return(0,r.isDocument)(e)?e.documentElement.contains(t):e.contains(t)}function g(e,t,n,a,u){var c=s[t];return c&&c.delegate&&(t=c.originalEvent,a=c.handler.bind(c,a)),u&&((a=a.bind()).defaultListener_=!0),function(e,t){var n=o.default.get(e,"delegating",{});n[t]||(n[t]={handle:E(e,t,O,!!f[t]),selectors:{}})}(e,t),(0,r.isString)(n)?function(e,t,n,r){v(o.default.get(e,"delegating",{})[t].selectors,n,r)}(e,t,n,a):function(e,t,n){v(o.default.get(e,"listeners",{}),t,n)}(n,t,a),new i.default((0,r.isString)(n)?e:n,t,a,(0,r.isString)(n)?n:null)}function _(e,t,n){if(n&&"click"===t&&2===n.button)return!1;return!("click"===t&&["BUTTON","INPUT","SELECT","TEXTAREA","FIELDSET"].indexOf(e.tagName)>-1)||!(e.disabled||S(e,"fieldset[disabled]"))}function w(e){return(0,r.isDefAndNotNull)(e)&&"number"==typeof e.length&&"function"==typeof e.item}function O(e){!function(e){e.stopPropagation=k,e.stopImmediatePropagation=L}(e);var t=!0,n=e.currentTarget,r=[];return t&=function(e,t,n){var r=!0,o=t.target,i=e.parentNode;for(;o&&o!==i&&!t.stopped;)_(o,t.type,t)&&(t.delegateTarget=o,r&=A(o,t,n),r&=I(e,o,t,n)),o=o.parentNode;return r}(n,e,r),t&=function(e,t){for(var n=!0,r=0;r<e.length&&!t.defaultPrevented;r++)t.delegateTarget=e[r].element,n&=e[r].fn(t);return n}(r,e),e.delegateTarget=null,e.__metal_last_container__=n,t}function j(e,t){if(!e||1!==e.nodeType)return!1;var n=Element.prototype,r=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;return r?r.call(e,t):function(e,t){var n=e.parentNode;if(n)for(var r=n.querySelectorAll(t),o=0;o<r.length;++o)if(r[o]===e)return!0;return!1}(e,t)}function E(e,t,n,o){if((0,r.isString)(e))return g(document,t,e,n);var i=s[t];return i&&i.event&&(t=i.originalEvent,n=i.handler.bind(i,n)),e.addEventListener(t,n,o),new a.default(e,t,n,o)}function S(e,t){return y(e.parentNode,t)}function P(e,t){t.split(" ").forEach((function(t){t&&e.classList.remove(t)}))}function T(e,t){var n=" "+e.className+" ";t=t.split(" ");for(var r=0;r<t.length;r++)n=n.replace(" "+t[r]+" "," ");e.className=n.trim()}function L(){this.stopped=!0,this.stoppedImmediate=!0,Event.prototype.stopImmediatePropagation.call(this)}function k(){this.stopped=!0,Event.prototype.stopPropagation.call(this)}function A(e,t,n){var i=t.__metal_last_container__;return!(!(0,r.isDef)(i)||!b(i,e))||M(o.default.get(e,"listeners",{})[t.type],t,e,n)}function M(e,t,n,r){var o=!0;e=e||[];for(var i=0;i<e.length&&!t.stoppedImmediate;i++)e[i].defaultListener_?r.push({element:n,fn:e[i]}):o&=e[i](t);return o}function I(e,t,n,r){for(var i=!0,a=o.default.get(e,"delegating",{})[n.type].selectors,u=Object.keys(a),c=0;c<u.length&&!n.stoppedImmediate;c++){if(j(t,u[c]))i&=M(a[u[c]],n,t,r)}return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=n(8),u=(r=a)&&r.__esModule?r:{default:r};var c=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return i.selector_=o,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"removeListener",value:function(){var e=u.default.get(this.emitter_,"delegating",{}),t=u.default.get(this.emitter_,"listeners",{}),n=this.selector_,r=(0,i.isString)(n)?e[this.event_].selectors:t,o=(0,i.isString)(n)?n:this.event_;i.array.remove(r[o]||[],this.listener_),r[o]&&0===r[o].length&&delete r[o]}}]),t}(n(5).EventHandle);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=n(2);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var c=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"addListener_",value:function(e,n){if(this.originEmitter_.addEventListener){if(this.isDelegateEvent_(e)){var r=e.indexOf(":",9),a=e.substring(9,r),u=e.substring(r+1);return(0,i.delegate)(this.originEmitter_,a,u,n)}return(0,i.on)(this.originEmitter_,e,n)}return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addListener_",this).call(this,e,n)}},{key:"isDelegateEvent_",value:function(e){return"delegate:"===e.substr(0,9)}},{key:"isSupportedDomEvent_",value:function(e){return!this.originEmitter_||!this.originEmitter_.addEventListener||(this.isDelegateEvent_(e)&&-1!==e.indexOf(":",9)||(0,i.supportsEvent)(this.originEmitter_,e))}},{key:"shouldProxyEvent_",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldProxyEvent_",this).call(this,e)&&this.isSupportedDomEvent_(e)}}]),t}(n(5).EventEmitterProxy);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(2);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"run",value:function(e,t){var n=document.createElement("script");return n.text=e,t?t(n):document.head.appendChild(n),(0,i.exitDocument)(n),n}},{key:"runFile",value:function(e,t,n){var r=document.createElement("script");r.src=e;var o=function(){(0,i.exitDocument)(r),t&&t()};return(0,i.once)(r,"load",o),(0,i.once)(r,"error",o),n?n(r):document.head.appendChild(r),r}},{key:"runScript",value:function(t,n,r){var a=function(){n&&n()};if(!t.type||"text/javascript"===t.type)return(0,i.exitDocument)(t),t.src?e.runFile(t.src,n,r):(o.async.nextTick(a),e.run(t.text,r));o.async.nextTick(a)}},{key:"runScriptsInElement",value:function(t,n,r){var i=t.querySelectorAll("script");i.length?e.runScriptsInOrder(i,0,n,r):n&&o.async.nextTick(n)}},{key:"runScriptsInOrder",value:function(t,n,r,i){e.runScript(t.item(n),(function(){n<t.length-1?e.runScriptsInOrder(t,n+1,r,i):r&&o.async.nextTick(r)}),i)}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(2);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"run",value:function(e,t){var n=document.createElement("style");return n.innerHTML=e,t?t(n):document.head.appendChild(n),n}},{key:"runFile",value:function(t,n,r){var o=document.createElement("link");return o.rel="stylesheet",o.href=t,e.runStyle(o,n,r),o}},{key:"runStyle",value:function(e,t,n){var r=function(){t&&t()};if(!e.rel||"stylesheet"===e.rel||"canonical"===e.rel||"alternate"===e.rel)return"STYLE"===e.tagName||"canonical"===e.rel||"alternate"===e.rel?o.async.nextTick(r):((0,i.once)(e,"load",r),(0,i.once)(e,"error",r)),n?n(e):document.head.appendChild(e),e;o.async.nextTick(r)}},{key:"runStylesInElement",value:function(t,n,r){var i=t.querySelectorAll("style,link");if(0===i.length&&n)o.async.nextTick(n);else for(var a=0,u=function(){n&&++a===i.length&&o.async.nextTick(n)},c=0;c<i.length;c++)e.runStyle(i[c],u,r)}}]),e}();t.default=a},function(e,t,n){"use strict";var r,o=n(0),i=n(2),a=n(25),u=(r=a)&&r.__esModule?r:{default:r};(0,o.isServerSide)()||function(){var e={mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"};Object.keys(e).forEach((function(t){(0,i.registerCustomEvent)(t,{delegate:!0,handler:function(e,n){var r=n.relatedTarget,o=n.delegateTarget;if(!r||r!==o&&!(0,i.contains)(o,r))return n.customType=t,e(n)},originalEvent:e[t]})}));var t={animation:"animationend",transition:"transitionend"};Object.keys(t).forEach((function(e){var n=t[e];(0,i.registerCustomEvent)(n,{event:!0,delegate:!0,handler:function(e,t){return t.customType=n,e(t)},originalEvent:u.default.checkAnimationEventName()[e]})}))}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i({},u,{},t),o=n.addSpaceBeforeSuffix,a=n.decimalSeparator,c=n.denominator,l=n.suffixGB,s=n.suffixKB,f=n.suffixMB;if(!(0,r.isNumber)(e))throw new TypeError("Parameter size must be a number");var d=0,p=s;(e/=c)>=c&&(p=f,e/=c,d=1);e>=c&&(p=l,e/=c,d=1);var v=e.toFixed(d);"."!==a&&(v=v.replace(/\./,a));return v+(o?" ":"")+p};var r=n(0);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u={addSpaceBeforeSuffix:!1,decimalSeparator:".",denominator:1024,suffixGB:"GB",suffixKB:"KB",suffixMB:"MB"}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i({},j,{},t),o=n.newLine,a=n.tagIndent;if(!(0,r.isString)(e))throw new TypeError("Parameter content must be a string");var S=[];e=(e=(e=(e=(e=(e=e.trim()).replace(u,(function(e){return S.push(e),"<~::~CDATA~::~>"}))).replace(w,"><")).replace(g,"~::~<")).replace(m,"~::~$1$2")).replace(O,(function(){return S.shift()}));var P=0,T=!1,L=e.split("~::~"),k=0,A="";return L.forEach((function(e,t){u.test(e)?A+=E(k,o,a)+e:l.test(e)?(A+=E(k,o,a)+e,P++,T=!0,(c.test(e)||f.test(e))&&(P--,T=0!==P)):c.test(e)?(A+=e,P--,T=0!==P):d.exec(L[t-1])&&p.exec(e)&&v.exec(L[t-1])==y.exec(e)[0].replace("/","")?(A+=e,T||--k):!h.test(e)||b.test(e)||_.test(e)?h.test(e)&&b.test(e)?A+=T?e:E(k,o,a)+e:b.test(e)?A+=T?e:E(--k,o,a)+e:_.test(e)?A+=T?e:E(k,o,a)+e:(s.test(e),A+=E(k,o,a)+e):A+=T?e:E(k++,o,a)+e,new RegExp("^"+o).test(A)&&(A=A.slice(o.length))})),A};var r=n(0);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=/<!\[CDATA\[[\0-\uFFFF]*?\]\]>/g,c=/-->|\]>/,l=/<!/,s=/<\?/,f=/!DOCTYPE/,d=/^<\w/,p=/^<\/\w/,v=/^<[\w:\-.,]+/,y=/^<\/[\w:\-.,]+/,h=/<\w/,m=/\s*(xmlns)(:|=)/g,b=/<\//,g=/</g,_=/\/>/,w=/>\s+</g,O=new RegExp("<~::~CDATA~::~>","g"),j={newLine:"\r\n",tagIndent:"\t"};function E(e,t,n){return t+new Array(e+1).join(n)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(0,r.isObject)(e)||(0,r.isObject)(e)&&"IMG"!==e.tagName)throw new TypeError("Parameter imagePreview must be an image");if(!(0,r.isObject)(t))throw new TypeError("Parameter region must be an object");var n=e.naturalWidth/e.offsetWidth,o=e.naturalHeight/e.offsetHeight,i=t.height?t.height*o:e.naturalHeight,a=t.width?t.width*n:e.naturalWidth,u=t.x?Math.max(t.x*n,0):0,c=t.y?Math.max(t.y*o,0):0;return{height:i,width:a,x:u,y:c}};var r=n(0)},function(e,t){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(t,"__esModule",{value:!0}),t.escapeHTML=function(e){return e.replace(a,(function(e){return r[e]}))},t.unescapeHTML=function(e){return e.replace(u,(function(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}))},t.MAP_HTML_CHARS_ESCAPED=void 0;var r={'"':"&#034;","&":"&amp;","'":"&#039;","/":"&#047;","<":"&lt;",">":"&gt;","`":"&#096;"};t.MAP_HTML_CHARS_ESCAPED=r;var o={};Object.entries(r).forEach((function(e){var t=n(e,2),r=t[0],i=t[1];o[i]=r}));var i=Object.keys(r),a=new RegExp("[".concat(i.join(""),"]"),"g"),u=/&([^;]+);/g},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.innerWidth<o.default.PHONE};var r,o=(r=n(6))&&r.__esModule?r:{default:r}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.innerWidth<o.default.TABLET};var r,o=(r=n(6))&&r.__esModule?r:{default:r}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){Liferay.SPA&&Liferay.SPA.app&&Liferay.SPA.app.canNavigate(e)?(Liferay.SPA.app.navigate(e),t&&Object.keys(t).forEach((function(e){Liferay.once(e,t[e])}))):window.location.href=e}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("parameter text must be a string");return e.replace(/[^a-z0-9_-]/gi,"-").replace(/^-+/,"").replace(/--+/,"-").toLowerCase()}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n;if("object"!==i(t))n=u(e,t);else{n={},Object.keys(t).forEach((function(r){var o=r;r=u(e,r),n[r]=t[o]}))}return n};var r,o=(r=n(14))&&r.__esModule?r:{default:r};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a,u=(a=function(e,t){return void 0!==t&&0!==t.lastIndexOf(e,0)&&(t="".concat(e).concat(t)),t},(0,o.default)(a,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?Array.prototype.join.call(t,"_"):String(t[0])})))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(0,r.isObject)(e))throw new TypeError("Parameter obj must be an object");var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e,2),r=n[0],o=n[1];if(Array.isArray(o))for(var i=0;i<o.length;i++)t.append(r,o[i]);else t.append(r,o)})),t};var r=n(0)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(e,a({},t,{p_p_lifecycle:"1"}))};var r,o=(r=n(3))&&r.__esModule?r:{default:r};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(e,a({},t,{p_p_lifecycle:"0"}))};var r,o=(r=n(3))&&r.__esModule?r:{default:r};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(e,a({},t,{p_p_lifecycle:"2"}))};var r,o=(r=n(3))&&r.__esModule?r:{default:r};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getSessionValue=function(e){var t=a("get");return t.append("key",e),(0,o.default)(u(),{body:t,method:"POST"}).then((function(e){return e.text()})).then((function(e){if(e.startsWith("serialize://")){var t=e.substring("serialize://".length);e=JSON.parse(t)}return e}))},t.setSessionValue=function(e,t){var n=a("set");t&&"object"===i(t)&&(t="serialize://"+JSON.stringify(t));return n.append(e,t),(0,o.default)(u(),{body:n,method:"POST"})};var r,o=(r=n(4))&&r.__esModule?r:{default:r};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){var t=Liferay.ThemeDisplay.getDoAsUserIdEncoded(),n=new FormData;return n.append("cmd",e),n.append("p_auth",Liferay.authToken),t&&n.append("doAsUserId",t),n}function u(){return"".concat(Liferay.ThemeDisplay.getPortalURL()).concat(Liferay.ThemeDisplay.getPathMain(),"/portal/session_click")}}]));
//# sourceMappingURL=global.bundle.js.map
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (A, Liferay) {
  var Lang = A.Lang;
  var Util = Liferay.Util;
  var STR_HEAD = 'head';
  var TPL_NOT_AJAXABLE = '<div class="alert alert-info">{0}</div>';

  var Portlet = _objectSpread({}, Liferay.Portlet, {
    _defCloseFn: function _defCloseFn(event) {
      event.portlet.remove(true);

      if (!event.nestedPortlet) {
        var formData = Liferay.Util.objectToFormData({
          cmd: 'delete',
          doAsUserId: event.doAsUserId,
          p_auth: Liferay.authToken,
          p_l_id: event.plid,
          p_p_id: event.portletId,
          p_v_l_s_g_id: themeDisplay.getSiteGroupId()
        });
        Liferay.Util.fetch(themeDisplay.getPathMain() + '/portal/update_layout', {
          body: formData,
          method: 'POST'
        }).then(function (response) {
          if (response.ok) {
            Liferay.fire('updatedLayout');
          }
        });
      }
    },
    _loadMarkupHeadElements: function _loadMarkupHeadElements(response) {
      var markupHeadElements = response.markupHeadElements;

      if (markupHeadElements && markupHeadElements.length) {
        var head = A.one(STR_HEAD);
        head.append(markupHeadElements);
        var container = A.Node.create('<div />');
        container.plug(A.Plugin.ParseContent);
        container.setContent(markupHeadElements);
      }
    },
    _loadPortletFiles: function _loadPortletFiles(response, loadHTML) {
      var footerCssPaths = response.footerCssPaths || [];
      var headerCssPaths = response.headerCssPaths || [];
      var javascriptPaths = response.headerJavaScriptPaths || [];
      javascriptPaths = javascriptPaths.concat(response.footerJavaScriptPaths || []);
      var body = A.getBody();
      var head = A.one(STR_HEAD);

      if (headerCssPaths.length) {
        A.Get.css(headerCssPaths, {
          insertBefore: head.get('firstChild').getDOM()
        });
      }

      var lastChild = body.get('lastChild').getDOM();

      if (footerCssPaths.length) {
        A.Get.css(footerCssPaths, {
          insertBefore: lastChild
        });
      }

      var responseHTML = response.portletHTML;

      if (javascriptPaths.length) {
        A.Get.script(javascriptPaths, {
          onEnd: function onEnd() {
            loadHTML(responseHTML);
          }
        });
      } else {
        loadHTML(responseHTML);
      }
    },
    _mergeOptions: function _mergeOptions(portlet, options) {
      options = options || {};
      options.doAsUserId = options.doAsUserId || themeDisplay.getDoAsUserIdEncoded();
      options.plid = options.plid || themeDisplay.getPlid();
      options.portlet = portlet;
      options.portletId = portlet.portletId;
      return options;
    },
    _staticPortlets: {},
    destroyComponents: function destroyComponents(portletId) {
      Liferay.destroyComponents(function (_component, componentConfig) {
        return portletId === componentConfig.portletId;
      });
    },
    isStatic: function isStatic(portletId) {
      var instance = this;
      var id = Util.getPortletId(portletId.id || portletId);
      return id in instance._staticPortlets;
    },
    list: [],
    readyCounter: 0,
    refreshLayout: function refreshLayout(_portletBoundary) {},
    register: function register(portletId) {
      var instance = this;

      if (instance.list.indexOf(portletId) < 0) {
        instance.list.push(portletId);
      }
    }
  });

  Liferay.provide(Portlet, 'add', function (options) {
    var instance = this;
    Liferay.fire('initLayout');
    var doAsUserId = options.doAsUserId || themeDisplay.getDoAsUserIdEncoded();
    var plid = options.plid || themeDisplay.getPlid();
    var portletData = options.portletData;
    var portletId = options.portletId;
    var portletItemId = options.portletItemId;
    var placeHolder = options.placeHolder;

    if (!placeHolder) {
      placeHolder = A.Node.create('<div class="loading-animation" />');
    } else {
      placeHolder = A.one(placeHolder);
    }

    var beforePortletLoaded = options.beforePortletLoaded;
    var onCompleteFn = options.onComplete;

    var onComplete = function onComplete(portlet, portletId) {
      if (onCompleteFn) {
        onCompleteFn(portlet, portletId);
      }

      instance.list.push(portlet.portletId);

      if (portlet) {
        portlet.attr('data-qa-id', 'app-loaded');
      }

      Liferay.fire('addPortlet', {
        portlet: portlet
      });
    };

    var container = null;

    if (Liferay.Layout && Liferay.Layout.INITIALIZED) {
      container = Liferay.Layout.getActiveDropContainer();
    }

    if (!container) {
      return;
    }

    var currentColumnId = Util.getColumnId(container.attr('id'));
    var portletPosition = 0;

    if (options.placeHolder) {
      var column = placeHolder.get('parentNode');

      if (!column) {
        return;
      }

      placeHolder.addClass('portlet-boundary');
      var columnPortlets = column.all('.portlet-boundary');
      var nestedPortlets = column.all('.portlet-nested-portlets');
      portletPosition = columnPortlets.indexOf(placeHolder);
      var nestedPortletOffset = 0;
      nestedPortlets.some(function (nestedPortlet) {
        var nestedPortletIndex = columnPortlets.indexOf(nestedPortlet);

        if (nestedPortletIndex !== -1 && nestedPortletIndex < portletPosition) {
          nestedPortletOffset += nestedPortlet.all('.portlet-boundary').size();
        } else if (nestedPortletIndex >= portletPosition) {
          return true;
        }
      });
      portletPosition -= nestedPortletOffset;
      currentColumnId = Util.getColumnId(column.attr('id'));
    }

    var url = themeDisplay.getPathMain() + '/portal/update_layout';
    var data = {
      cmd: 'add',
      dataType: 'JSON',
      doAsUserId: doAsUserId,
      p_auth: Liferay.authToken,
      p_l_id: plid,
      p_p_col_id: currentColumnId,
      p_p_col_pos: portletPosition,
      p_p_i_id: portletItemId,
      p_p_id: portletId,
      p_p_isolated: true,
      p_v_l_s_g_id: themeDisplay.getSiteGroupId(),
      portletData: portletData
    };
    var firstPortlet = container.one('.portlet-boundary');
    var hasStaticPortlet = firstPortlet && firstPortlet.isStatic;

    if (!options.placeHolder && !options.plid) {
      if (!hasStaticPortlet) {
        container.prepend(placeHolder);
      } else {
        firstPortlet.placeAfter(placeHolder);
      }
    }

    data.currentURL = Liferay.currentURL;
    instance.addHTML({
      beforePortletLoaded: beforePortletLoaded,
      data: data,
      onComplete: onComplete,
      placeHolder: placeHolder,
      url: url
    });
  }, ['aui-base']);
  Liferay.provide(Portlet, 'addHTML', function (options) {
    var instance = this;
    var portletBoundary = null;
    var beforePortletLoaded = options.beforePortletLoaded;
    var data = options.data;
    var dataType = 'HTML';
    var onComplete = options.onComplete;
    var placeHolder = options.placeHolder;
    var url = options.url;

    if (data && Lang.isString(data.dataType)) {
      dataType = data.dataType;
    }

    dataType = dataType.toUpperCase();

    var addPortletReturn = function addPortletReturn(html) {
      var container = placeHolder.get('parentNode');
      var portletBound = A.Node.create('<div></div>');
      portletBound.plug(A.Plugin.ParseContent);
      portletBound.setContent(html);
      portletBound = portletBound.one('> *');
      var portletId;

      if (portletBound) {
        var id = portletBound.attr('id');
        portletId = Util.getPortletId(id);
        portletBound.portletId = portletId;
        placeHolder.hide();
        placeHolder.placeAfter(portletBound);
        placeHolder.remove();
        instance.refreshLayout(portletBound);

        if (window.location.hash) {
          window.location.href = window.location.hash;
        }

        portletBoundary = portletBound;
        var Layout = Liferay.Layout;

        if (Layout && Layout.INITIALIZED) {
          Layout.updateCurrentPortletInfo(portletBoundary);

          if (container) {
            Layout.syncEmptyColumnClassUI(container);
          }

          Layout.syncDraggableClassUI();
          Layout.updatePortletDropZones(portletBoundary);
        }

        if (onComplete) {
          onComplete(portletBoundary, portletId);
        }
      } else {
        placeHolder.remove();
      }

      return portletId;
    };

    if (beforePortletLoaded) {
      beforePortletLoaded(placeHolder);
    }

    Liferay.Util.fetch(url, {
      body: Liferay.Util.objectToURLSearchParams(data),
      method: 'POST'
    }).then(function (response) {
      if (dataType === 'JSON') {
        return response.json();
      } else {
        return response.text();
      }
    }).then(function (response) {
      if (dataType === 'HTML') {
        addPortletReturn(response);
      } else if (response.refresh) {
        addPortletReturn(response.portletHTML);
      } else {
        Portlet._loadMarkupHeadElements(response);

        Portlet._loadPortletFiles(response, addPortletReturn);
      }

      if (!data || !data.preventNotification) {
        Liferay.fire('updatedLayout');
      }
    })["catch"](function (error) {
      var message = typeof error === 'string' ? error : 'There\x20was\x20an\x20unexpected\x20error\x2e\x20Please\x20refresh\x20the\x20current\x20page\x2e';
      Liferay.Util.openToast({
        message: message,
        title: 'Error',
        type: 'danger'
      });
    });
  }, ['aui-parse-content']);
  Liferay.provide(Portlet, 'close', function (portlet, skipConfirm, options) {
    var instance = this;
    portlet = A.one(portlet);

    if (portlet && (skipConfirm || confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20this\x20component\x3f'))) {
      var portletId = portlet.portletId;
      var portletIndex = instance.list.indexOf(portletId);

      if (portletIndex >= 0) {
        instance.list.splice(portletIndex, 1);
      }

      options = Portlet._mergeOptions(portlet, options);
      Portlet.destroyComponents(portletId);
      Liferay.fire('destroyPortlet', options);
      Liferay.fire('closePortlet', options);
    } else {
      A.config.win.focus();
    }
  }, []);
  Liferay.provide(Portlet, 'destroy', function (portlet, options) {
    portlet = A.one(portlet);

    if (portlet) {
      var portletId = portlet.portletId || Util.getPortletId(portlet.attr('id'));
      Portlet.destroyComponents(portletId);
      Liferay.fire('destroyPortlet', Portlet._mergeOptions(portlet, options));
    }
  }, ['aui-node-base']);
  Liferay.provide(Portlet, 'onLoad', function (options) {
    var instance = this;
    var canEditTitle = options.canEditTitle;
    var columnPos = options.columnPos;
    var isStatic = options.isStatic == 'no' ? null : options.isStatic;
    var namespacedId = options.namespacedId;
    var portletId = options.portletId;
    var refreshURL = options.refreshURL;
    var refreshURLData = options.refreshURLData;

    if (isStatic) {
      instance.registerStatic(portletId);
    }

    var portlet = A.one('#' + namespacedId);

    if (portlet && !portlet.portletProcessed) {
      portlet.portletProcessed = true;
      portlet.portletId = portletId;
      portlet.columnPos = columnPos;
      portlet.isStatic = isStatic;
      portlet.refreshURL = refreshURL;
      portlet.refreshURLData = refreshURLData; // Functions to run on portlet load

      if (canEditTitle) {
        // https://github.com/yui/yui3/issues/1808
        var events = 'focus';

        if (!A.UA.touchEnabled) {
          events = ['focus', 'mousemove'];
        }

        var handle = portlet.on(events, function () {
          Util.portletTitleEdit({
            doAsUserId: themeDisplay.getDoAsUserIdEncoded(),
            obj: portlet,
            plid: themeDisplay.getPlid(),
            portletId: portletId
          });
          handle.detach();
        });
      }
    }

    Liferay.fire('portletReady', {
      portlet: portlet,
      portletId: portletId
    });
    instance.readyCounter++;

    if (instance.readyCounter === instance.list.length) {
      Liferay.fire('allPortletsReady', {
        portletId: portletId
      });
    }
  }, ['aui-base', 'aui-timer', 'event-move']);
  Liferay.provide(Portlet, 'refresh', function (portlet, data) {
    var instance = this;
    portlet = A.one(portlet);

    if (portlet) {
      data = data || portlet.refreshURLData || {};

      if (!Object.prototype.hasOwnProperty.call(data, 'portletAjaxable')) {
        data.portletAjaxable = true;
      }

      var id = portlet.attr('portlet');
      var url = portlet.refreshURL;
      var placeHolder = A.Node.create('<div class="loading-animation" id="p_p_id' + id + '" />');

      if (data.portletAjaxable && url) {
        portlet.placeBefore(placeHolder);
        portlet.remove(true);
        Portlet.destroyComponents(portlet.portletId);
        var params = {};
        var urlPieces = url.split('?');

        if (urlPieces.length > 1) {
          params = A.QueryString.parse(urlPieces[1]);
          delete params.dataType;
          url = urlPieces[0];
        }

        instance.addHTML({
          data: A.mix(params, data, true),
          onComplete: function onComplete(portlet, portletId) {
            portlet.refreshURL = url;

            if (portlet) {
              portlet.attr('data-qa-id', 'app-refreshed');
            }

            Liferay.fire(portlet.portletId + ':portletRefreshed', {
              portlet: portlet,
              portletId: portletId
            });
          },
          placeHolder: placeHolder,
          url: url
        });
      } else if (!portlet.getData('pendingRefresh')) {
        portlet.setData('pendingRefresh', true);
        var nonAjaxableContentMessage = Lang.sub(TPL_NOT_AJAXABLE, ['This\x20change\x20will\x20only\x20be\x20shown\x20after\x20you\x20refresh\x20the\x20current\x20page\x2e']);
        var portletBody = portlet.one('.portlet-body');
        portletBody.placeBefore(nonAjaxableContentMessage);
        portletBody.hide();
      }
    }
  }, ['aui-base', 'querystring-parse']);
  Liferay.provide(Portlet, 'registerStatic', function (portletId) {
    var instance = this;
    var Node = A.Node;

    if (Node && portletId instanceof Node) {
      portletId = portletId.attr('id');
    } else if (portletId.id) {
      portletId = portletId.id;
    }

    var id = Util.getPortletId(portletId);
    instance._staticPortlets[id] = true;
  }, ['aui-base']);
  Liferay.publish('closePortlet', {
    defaultFn: Portlet._defCloseFn
  });
  Liferay.publish('allPortletsReady', {
    fireOnce: true
  }); // Backwards compatability

  Portlet.ready = function (fn) {
    Liferay.on('portletReady', function (event) {
      fn(event.portletId, event.portlet);
    });
  };

  Liferay.Portlet = Portlet;
})(AUI(), Liferay);
//# sourceMappingURL=portlet.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
Liferay.Workflow = {
  ACTION_PUBLISH: 1,
  ACTION_SAVE_DRAFT: 2,
  STATUS_ANY: -1,
  STATUS_APPROVED: 0,
  STATUS_DENIED: 4,
  STATUS_DRAFT: 2,
  STATUS_EXPIRED: 3,
  STATUS_PENDING: 1
};
//# sourceMappingURL=workflow.js.map
