{"version":3,"sources":["Tab.min__d67acfe80778de2e04cc.js","./src/ui/ResponsiveComponents/ResponsiveComponentsUtils.ts","./src/ui/Tab/Tab.ts","./src/ui/ResponsiveComponents/ResponsiveTabs.ts"],"names":["webpackJsonpCoveo__temporary","129","module","exports","__webpack_require__","Object","defineProperty","value","shouldDrawFacetSlider","root","facetSliderElement","ResponsiveDropdownContent","isTargetInsideOpenedDropdown","this","isSmallFacetActivated","isSmallTabsActivated","hasClass","smallTabsClassName","smallFacetClassName","isSmallRecommendationActivated","smallRecommendationClassName","activateSmallTabs","addClass","deactivateSmallTabs","removeClass","activateSmallFacet","deactivateSmallFacet","activateSmallRecommendation","deactivateSmallRecommendation","ResponsiveComponentsUtils","201","__extends","extendStatics","setPrototypeOf","__proto__","Array","d","b","p","hasOwnProperty","__","constructor","prototype","create","element","options","bindings","Tab","ID","ComponentOptions","initComponentOptions","bind","onRootElement","QueryEvents","buildingQuery","args","handleBuildingQuery","InitializationEvents","afterInitialization","handleAfterInitialization","onQueryState","MODEL_EVENTS","CHANGE_ONE","QUERY_STATE_ATTRIBUTES","T","handleQueryStateChanged","AccessibleButton","withElement","withSelectAction","select","withTitle","caption","withOwner","build","render","ResponsiveTabs","init","_this","disabled","state","t","id","sort","QueryStateModel","defaultAttributes","layout","queryStateModel","setMultiple","usageAnalytics","logSearchEvent","analyticsActionCauseList","interfaceChange","interfaceChangeTo","queryController","executeQuery","isElementIncludedInTab","Assert","exists","includedTabs","splitListOfTabs","getAttribute","excludedTabs","check","length","indexOf","icon","Utils","isNonEmptyString","iconSpan","$$","el","insertBefore","firstChild","captionP","document","createElement","text","appendChild","data","isSelected","queryBuilder","tab","expression","constant","constantExpression","add","advancedExpression","enableDuplicateFiltering","pipeline","maximumAge","setEndpoint","endpoint","showAndHideAppropriateElements","set","LAYOUT","get","attributesEnum","showElements","hideElements","each","findAll","toggleAllComponentsUnder","push","one","querySuccess","elem","map","split","trim","enable","togglePossibleComponent","possibleComponent","possibleCmp","Component","undefined","disable","style","display","doExport","exportGlobally","buildStringOption","required","section","buildLocalizedStringOption","buildQueryExpressionOption","buildCustomOption","SearchEndpoint","endpoints","buildBooleanOption","defaultValue","buildNumberOption","enableResponsiveMode","dropdownHeaderLabel","Initialization","registerAutoCreateComponent","674","675","coveoRoot","ignoreNextDocumentClick","getDropdownHeaderLabel","searchInterface","SearchInterface","dropdownContent","buildDropdownContent","dropdownHeader","buildDropdownHeader","bindDropdownContentEvents","bindDropdownHeaderEvents","tabSection","find","manageTabSwapping","bindNukeEvents","initialTabOrder","tabsInTabSection","component","logger","Logger","info","ResponsiveComponentsManager","register","handleResizeEvent","needSmallMode","changeToSmallMode","changeToLargeMode","shouldAddTabsToDropdown","addTabsToDropdown","shouldRemoveTabsFromDropdown","removeTabsFromDropdown","isDropdownOpen","positionPopup","shouldAutoModeResolveToSmall","responsiveComponents","getResponsiveMode","mediumWidth","getMediumScreenWidth","ResponsiveComponents","width","isLargeFormatOverflowing","isOverflowing","emptyDropdown","cleanUpDropdown","clientWidth","currentTab","TAB_IN_DROPDOWN_HEADER_CSS_CLASS","facetDropdownHeader","i","tabIsSelected","addToDropdownIfNeeded","isDropdownEmpty","current","dropdownTabs","tabsInTabDropdown","shift","removeFromDropdownIfNeeded","fromDropdownToTabSection","unselectedTabs","filter","pop","forEach","append","virtualTabSection","cloneNode","removeChild","position","visibility","detach","scrollWidth","className","content","SVGIcons","icons","arrowDown","SVGDom","addClassToSVGInContainer","toggle","event","closeDropdown","openDropdown","type","withLabel","SMALL_INTERFACE_CLASS_NAME","contentList","dropdownClickListener","documentClickListener","on","ACTIVE_DROPDOWN_CSS_CLASS","documentElement","off","canAddTabToDropdown","TAB_IN_DROPDOWN_CSS_CLASS","list","listElement","prepend","canRemoveTabFromDropdown","parentElement","tabIsInDropdown","computeCssClassNameForType","tabElement","fadeOutFadeIn","lastTabInSection","propertyName","opacity","replaceWith","window","getComputedStyle","EventsUtils","removePrefixedEvent","swapOnSelect","addPrefixedEvent","KeyboardUtils","keypressAction","KEYBOARD","ENTER","e","relatedTarget","nuke","insertAfter","modifiers","preventOverflow","boundariesElement","lastTabInTabSection","last","computeCssClassName","l","DROPDOWN_HEADER_LABEL_DEFAULT_VALUE","tabsInSection","children","childElement","isHtmlElement","child","childHasTabCssClassName","enumerable","configurable","676"],"mappings":"AAAAA,8BAA8B,KAExBC,IACA,SAAUC,EAAQC,EAASC,GAEjC,YAEAC,QAAOC,eAAeH,EAAS,cAAgBI,OAAO,GCNtD,aAEA,2BA4CA,MAvCS,GAAAC,sBAAP,SAA6BC,EAAWC,GACtC,MAAO,GAAAC,0BAA0BC,6BAA6BF,KAAwBG,KAAKC,sBAAsBL,IAG5G,EAAAM,qBAAP,SAA4BN,GAC1B,MAAOA,GAAKO,SAASH,KAAKI,qBAGrB,EAAAH,sBAAP,SAA6BL,GAC3B,MAAOA,GAAKO,SAASH,KAAKK,sBAGrB,EAAAC,+BAAP,SAAsCV,GACpC,MAAOA,GAAKO,SAASH,KAAKO,+BAGrB,EAAAC,kBAAP,SAAyBZ,GACvBA,EAAKa,SAAST,KAAKI,qBAGd,EAAAM,oBAAP,SAA2Bd,GACzBA,EAAKe,YAAYX,KAAKI,qBAGjB,EAAAQ,mBAAP,SAA0BhB,GACxBA,EAAKa,SAAST,KAAKK,sBAGd,EAAAQ,qBAAP,SAA4BjB,GAC1BA,EAAKe,YAAYX,KAAKK,sBAGjB,EAAAS,4BAAP,SAAmClB,GACjCA,EAAKa,SAAST,KAAKO,+BAGd,EAAAQ,8BAAP,SAAqCnB,GACnCA,EAAKe,YAAYX,KAAKO,+BAzCT,EAAAH,mBAA6B,mBAC7B,EAAAC,oBAA8B,qBAC9B,EAAAE,6BAAuC,6BAyCxD,IA5Ca,GAAAS,6BDiDPC,IACA,SAAU5B,EAAQC,EAASC,GAEjC,YAEA,IAAI2B,GAAalB,MAAQA,KAAKkB,WAAc,WACxC,GAAIC,GAAgB3B,OAAO4B,iBACpBC,uBAA2BC,QAAS,SAAUC,EAAGC,GAAKD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oK,UAAUY,KAAK,uBAAuBjD,QAAQ,IAAM,EAAAa,UAAUqJ,oBAAoB,EAAA/P,MAAO,SAAAsO,GACpG,GAAM5J,GAAW,EAAAgC,UAAUlB,IAAI8I,EAAY,EAAAtO,MACtC6H,GAAuBnD,GAAOA,EAAI5E,QAAQ+H,sBAC7CA,EAAsBnD,EAAI5E,QAAQ+H,uBAIjCA,IACHA,EAAsB,EAAAmI,EAAEpO,EAAeqO,sCAGlCpI,GAGD,YAAAsD,cAAR,SAAsBzG,GACpB,MAAO,GAAAZ,GAAGY,GAAoBzG,SAAS,mBAGjC,YAAAmQ,gBAAR,SAAwB1J,GACtB,MAAO,GAAAZ,GAAGY,GAAoBzG,SAAS2D,EAAekM,4BAGxD,sBAAY,gCHkYNtI,IGlYN,sBACQ0K,IAUN,OATA,GAAAtK,KAAK9H,KAAK+K,WAAWsH,WAAY,SAAAC,GAC/B,GAAI,EAAAzM,MAAM0M,cAAcD,GAAe,CACrC,GAAME,GAAQ,EAAAxM,GAAGsM,GACXG,EAA0BD,EAAMrS,SAAS,EAAAyI,UAAU2H,2BAA2B,EAAKpO,MACpF,EAAKmO,gBAAgBkC,IAAUC,GAClCL,EAAcnK,KAAKuK,EAAMvM,OAIxBmM,GHqYHM,YAAY,EACZC,cAAc,IGnYpB,sBAAY,iCHsYNjL,IGtYN,WACE,MAAK1H,MAAKyK,gBAGHzK,KAAKyK,gBAAgB1C,QAAQ,IAAIjE,EAAekM,+BHwYnD0C,YAAY,EACZC,cAAc,IG1zBL,EAAAR,oCAAsC,OACtC,EAAAnC,0BAA4B,qBAC5B,EAAA9C,iCAAsCpJ,EAAekM,0BAAyB,UAC9E,EAAAJ,0BAA4B,+BAgb7C,IApba,GAAA9L,kBHw0BP8O,IACA,SAAUvT,EAAQC","file":"Tab.min__d67acfe80778de2e04cc.js","sourcesContent":["webpackJsonpCoveo__temporary([29],{\n\n/***/ 129:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ResponsiveDropdownContent_1 = __webpack_require__(93);\nvar ResponsiveComponentsUtils = /** @class */ (function () {\n    function ResponsiveComponentsUtils() {\n    }\n    ResponsiveComponentsUtils.shouldDrawFacetSlider = function (root, facetSliderElement) {\n        return ResponsiveDropdownContent_1.ResponsiveDropdownContent.isTargetInsideOpenedDropdown(facetSliderElement) || !this.isSmallFacetActivated(root);\n    };\n    ResponsiveComponentsUtils.isSmallTabsActivated = function (root) {\n        return root.hasClass(this.smallTabsClassName);\n    };\n    ResponsiveComponentsUtils.isSmallFacetActivated = function (root) {\n        return root.hasClass(this.smallFacetClassName);\n    };\n    ResponsiveComponentsUtils.isSmallRecommendationActivated = function (root) {\n        return root.hasClass(this.smallRecommendationClassName);\n    };\n    ResponsiveComponentsUtils.activateSmallTabs = function (root) {\n        root.addClass(this.smallTabsClassName);\n    };\n    ResponsiveComponentsUtils.deactivateSmallTabs = function (root) {\n        root.removeClass(this.smallTabsClassName);\n    };\n    ResponsiveComponentsUtils.activateSmallFacet = function (root) {\n        root.addClass(this.smallFacetClassName);\n    };\n    ResponsiveComponentsUtils.deactivateSmallFacet = function (root) {\n        root.removeClass(this.smallFacetClassName);\n    };\n    ResponsiveComponentsUtils.activateSmallRecommendation = function (root) {\n        root.addClass(this.smallRecommendationClassName);\n    };\n    ResponsiveComponentsUtils.deactivateSmallRecommendation = function (root) {\n        root.removeClass(this.smallRecommendationClassName);\n    };\n    ResponsiveComponentsUtils.smallTabsClassName = 'coveo-small-tabs';\n    ResponsiveComponentsUtils.smallFacetClassName = 'coveo-small-facets';\n    ResponsiveComponentsUtils.smallRecommendationClassName = 'coveo-small-recommendation';\n    return ResponsiveComponentsUtils;\n}());\nexports.ResponsiveComponentsUtils = ResponsiveComponentsUtils;\n\n\n/***/ }),\n\n/***/ 201:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = Object.setPrototypeOf ||\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(674);\nvar underscore_1 = __webpack_require__(0);\nvar InitializationEvents_1 = __webpack_require__(17);\nvar QueryEvents_1 = __webpack_require__(11);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Assert_1 = __webpack_require__(5);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar SearchEndpoint_1 = __webpack_require__(53);\nvar AccessibleButton_1 = __webpack_require__(15);\nvar Dom_1 = __webpack_require__(1);\nvar Utils_1 = __webpack_require__(4);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar ResponsiveTabs_1 = __webpack_require__(675);\n/**\n * The Tab component renders a widget that allows the end user to select a specific search interface.\n *\n * This component attaches itself to a `div` element. It is in charge of adding an advanced expression to the outgoing\n * query in order to refine the results.\n *\n * The Tab component can also hide and show different parts of the UI. For each individual component in the UI, you can\n * specify whether you wish to include or exclude that component when the user selects a certain Tab (see [Using Components\n * Only on Specific Tabs](https://docs.coveo.com/en/508/javascript-search-framework/using-components-only-on-specific-tabs)).\n *\n * **Setting a New Endpoint for a Tab:**\n *\n * A Tab can use a custom endpoint when performing a query. Of course, you need to make sure that the endpoint exists in\n * the array of Coveo.SearchEndpoint.endpoints (see {@link SearchEndpoint.endpoints}).\n *\n * ```\n * Coveo.SearchEndpoint.endpoints[\"specialEndpoint\"] = new Coveo.SearchEndpoint({\n *     restUri : 'https://somewhere.com/rest/search'\n * })\n *\n * [ ... ]\n *\n * <div class='CoveoTab' data-endpoint='specialEndpoint'></div>\n *\n * ```\n */\nvar Tab = /** @class */ (function (_super) {\n    __extends(Tab, _super);\n    /**\n     * Creates a new Tab. Binds on buildingQuery event as well as an event on click of the element.\n     * @param element The HTMLElement on which to instantiate the component. Normally a `div`.\n     * @param options The options for the Tab component.\n     * @param bindings The bindings that the component requires to function normally. If not set, these will be\n     * automatically resolved (with a slower execution time).\n     */\n    function Tab(element, options, bindings) {\n        var _this = _super.call(this, element, Tab.ID, bindings) || this;\n        _this.element = element;\n        _this.options = options;\n        _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Tab, options);\n        _this.bind.onRootElement(QueryEvents_1.QueryEvents.buildingQuery, function (args) { return _this.handleBuildingQuery(args); });\n        _this.bind.onRootElement(InitializationEvents_1.InitializationEvents.afterInitialization, function () { return _this.handleAfterInitialization(); });\n        _this.bind.onQueryState(Model_1.MODEL_EVENTS.CHANGE_ONE, QueryStateModel_1.QUERY_STATE_ATTRIBUTES.T, function (args) {\n            return _this.handleQueryStateChanged(args);\n        });\n        new AccessibleButton_1.AccessibleButton()\n            .withElement(element)\n            .withSelectAction(function () { return _this.select(); })\n            .withTitle(_this.options.caption)\n            .withOwner(_this.bind)\n            .build();\n        _this.render();\n        ResponsiveTabs_1.ResponsiveTabs.init(_this.root, _this, _this.options);\n        return _this;\n    }\n    /**\n     * Selects the current Tab.\n     *\n     * Also logs the `interfaceChange` event in the usage analytics with the new current {@link Tab.options.id} as metada\n     * and triggers a new query.\n     */\n    Tab.prototype.select = function () {\n        if (!this.disabled) {\n            var state = {\n                t: this.options.id,\n                sort: this.options.sort || QueryStateModel_1.QueryStateModel.defaultAttributes.sort\n            };\n            if (this.options.layout) {\n                state.layout = this.options.layout;\n            }\n            this.queryStateModel.setMultiple(state);\n            this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.interfaceChange, {\n                interfaceChangeTo: this.options.id\n            });\n            this.queryController.executeQuery();\n        }\n    };\n    /**\n     * Indicates whether the HTMLElement argument is included in the Tab. *Included* elements are shown when the Tab is\n     * selected, whereas *excluded* elements are not.\n     * @param element The HTMLElement to verify.\n     * @returns {boolean} `true` if the HTMLElement is included in the Tab; `false` if it is excluded.\n     */\n    Tab.prototype.isElementIncludedInTab = function (element) {\n        Assert_1.Assert.exists(element);\n        var includedTabs = this.splitListOfTabs(element.getAttribute('data-tab'));\n        var excludedTabs = this.splitListOfTabs(element.getAttribute('data-tab-not'));\n        Assert_1.Assert.check(!(includedTabs.length != 0 && excludedTabs.length != 0), 'You cannot both explicitly include and exclude an element from tabs.');\n        return ((includedTabs.length != 0 && underscore_1.indexOf(includedTabs, this.options.id) != -1) ||\n            (excludedTabs.length != 0 && underscore_1.indexOf(excludedTabs, this.options.id) == -1) ||\n            (includedTabs.length == 0 && excludedTabs.length == 0));\n    };\n    Tab.prototype.render = function () {\n        var icon = this.options.icon;\n        if (Utils_1.Utils.isNonEmptyString(icon)) {\n            var iconSpan = Dom_1.$$('span').el;\n            Dom_1.$$(iconSpan).addClass(['coveo-icon', icon]);\n            this.element.insertBefore(iconSpan, this.element.firstChild);\n        }\n        var caption = this.options.caption;\n        if (Utils_1.Utils.isNonEmptyString(caption)) {\n            var captionP = document.createElement('p');\n            Dom_1.$$(captionP).text(caption);\n            this.element.appendChild(captionP);\n        }\n    };\n    Tab.prototype.handleBuildingQuery = function (data) {\n        Assert_1.Assert.exists(data);\n        if (!this.disabled && this.isSelected()) {\n            data.queryBuilder.tab = this.options.id;\n            if (Utils_1.Utils.isNonEmptyString(this.options.expression)) {\n                if (this.options.constant) {\n                    data.queryBuilder.constantExpression.add(this.options.expression);\n                }\n                else {\n                    data.queryBuilder.advancedExpression.add(this.options.expression);\n                }\n            }\n            if (this.options.enableDuplicateFiltering) {\n                data.queryBuilder.enableDuplicateFiltering = true;\n            }\n            if (this.options.pipeline != null) {\n                data.queryBuilder.pipeline = this.options.pipeline;\n            }\n            if (this.options.maximumAge != null) {\n                data.queryBuilder.maximumAge = this.options.maximumAge;\n            }\n        }\n    };\n    Tab.prototype.handleQueryStateChanged = function (data) {\n        Assert_1.Assert.exists(data);\n        if (!this.disabled && this.isSelected()) {\n            Dom_1.$$(this.element).addClass('coveo-selected');\n            this.queryController.setEndpoint(this.options.endpoint);\n            this.showAndHideAppropriateElements();\n        }\n        else {\n            Dom_1.$$(this.element).removeClass('coveo-selected');\n        }\n    };\n    Tab.prototype.handleAfterInitialization = function () {\n        if (this.isSelected() && this.options.layout) {\n            this.queryStateModel.set(QueryStateModel_1.QUERY_STATE_ATTRIBUTES.LAYOUT, this.options.layout);\n        }\n    };\n    Tab.prototype.isSelected = function () {\n        var activeTab = this.queryStateModel.get(QueryStateModel_1.QueryStateModel.attributesEnum.t);\n        return activeTab == this.options.id;\n    };\n    Tab.prototype.showAndHideAppropriateElements = function () {\n        var _this = this;\n        var showElements = [];\n        var hideElements = [];\n        underscore_1.each(Dom_1.$$(this.root).findAll('[data-tab],[data-tab-not]'), function (element) {\n            if (_this.isElementIncludedInTab(element)) {\n                _this.toggleAllComponentsUnder(element, true);\n                showElements.push(element);\n            }\n            else {\n                _this.toggleAllComponentsUnder(element, false);\n                hideElements.push(element);\n            }\n        });\n        Dom_1.$$(this.root).one(QueryEvents_1.QueryEvents.querySuccess, function () {\n            underscore_1.each(showElements, function (elem) { return Dom_1.$$(elem).removeClass('coveo-tab-disabled'); });\n            underscore_1.each(hideElements, function (elem) { return Dom_1.$$(elem).addClass('coveo-tab-disabled'); });\n        });\n    };\n    Tab.prototype.splitListOfTabs = function (value) {\n        if (Utils_1.Utils.exists(value)) {\n            return underscore_1.map(value.split(','), function (tab) { return Utils_1.Utils.trim(tab); });\n        }\n        else {\n            return [];\n        }\n    };\n    Tab.prototype.toggleAllComponentsUnder = function (element, enable) {\n        Assert_1.Assert.exists(element);\n        var togglePossibleComponent = function (possibleComponent) {\n            var possibleCmp = Component_1.Component.get(possibleComponent, undefined, true);\n            if (possibleCmp) {\n                if (enable) {\n                    possibleCmp.enable();\n                }\n                else {\n                    possibleCmp.disable();\n                }\n            }\n        };\n        togglePossibleComponent(element);\n        underscore_1.each(Dom_1.$$(element).findAll('*'), function (el) {\n            togglePossibleComponent(el);\n        });\n    };\n    Tab.prototype.enable = function () {\n        _super.prototype.enable.call(this);\n        this.element.style.display = '';\n    };\n    Tab.prototype.disable = function () {\n        _super.prototype.disable.call(this);\n        this.element.style.display = 'none';\n    };\n    Tab.ID = 'Tab';\n    Tab.doExport = function () {\n        GlobalExports_1.exportGlobally({\n            Tab: Tab\n        });\n    };\n    /**\n     * The options for a Tab\n     * @componentOptions\n     */\n    Tab.options = {\n        /**\n         * Specifies a unique ID for the Tab.\n         *\n         * Specifying a value for this option is necessary for this component to work.\n         */\n        id: ComponentOptions_1.ComponentOptions.buildStringOption({ required: true, section: 'Common Options' }),\n        /**\n         * Specifies the caption of the Tab.\n         *\n         * Specifying a value for this option is necessary for this component to work.\n         */\n        caption: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({ required: true, section: 'Common Options' }),\n        /**\n         * Specifies an icon to use for the Tab.\n         *\n         * @deprecated This options is mostly kept for legacy reasons. If possible, you should avoid using it.\n         */\n        icon: ComponentOptions_1.ComponentOptions.buildStringOption(),\n        /**\n         * Specifies an advanced expression or filter that the Tab should add to any outgoing query.\n         *\n         * **Example:**\n         *\n         * `@objecttype==Message`\n         *\n         * Default value is `undefined` and the Tab applies no additional expression or filter to the query.\n         */\n        expression: ComponentOptions_1.ComponentOptions.buildQueryExpressionOption({ section: 'Common Options' }),\n        /**\n         * Specifies the {@link SearchEndpoint} to point to when performing queries from within the Tab.\n         *\n         * By default, the Tab uses the \"default\" endpoint.\n         */\n        endpoint: ComponentOptions_1.ComponentOptions.buildCustomOption(function (endpoint) { return (endpoint != null ? SearchEndpoint_1.SearchEndpoint.endpoints[endpoint] : null); }),\n        /**\n         * Specifies the default sort criteria to use when selecting the Tab. A {@link Sort} component with the same\n         * parameter needs to be present in the search interface in order for this option to function properly.\n         *\n         * **Examples:**\n         *\n         * - `data-sort='relevancy'`\n         * - `data-sort='date descending'`\n         *\n         * Default value is `undefined` and the normal {@link Sort} component behavior applies.\n         */\n        sort: ComponentOptions_1.ComponentOptions.buildStringOption(),\n        /**\n         * Specifies the default layout to display when the user selects the Tab (see {@link ResultList.options.layout} and\n         * {@link ResultLayout}).\n         *\n         * See the {@link ValidLayout} type for the list of possible values.\n         *\n         * If not specified, it will default to 'list'.\n         *\n         * See also [Result Layouts](https://docs.coveo.com/en/360/).\n         *\n         * Default value is `undefined` and the component selects the first available layout.\n         */\n        layout: ComponentOptions_1.ComponentOptions.buildStringOption(),\n        /**\n         * Specifies whether to include the {@link Tab.options.expression} in the constant part of the query.\n         *\n         * The index specially optimizes the constant part of the query to execute faster. However, you must be careful not\n         * to include dynamic query expressions, otherwise the cache will lose its efficiency.\n         *\n         * Default value is `true`.\n         */\n        constant: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true, section: 'Filtering' }),\n        /**\n         * Whether to filter out duplicates, so that items resembling one another only appear once in the query results.\n         *\n         * **Notes:**\n         * - Two items must be at least 85% similar to one another to be considered duplicates.\n         * - When a pair of duplicates is found, only the higher-ranked item of the two is kept in the result set.\n         * - Enabling this feature can make the total result count less precise, as only the requested page of query results is submitted to duplicate filtering.\n         * - The default value for this option can be modified through the {@link SearchInterface} component.\n         */\n        enableDuplicateFiltering: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false }),\n        /**\n         * Specifies the name of the query pipeline to use for the queries when the Tab is selected.\n         *\n         * You can specify a value for this option if your index is in a Coveo Cloud organization in which pipelines have\n         * been created (see [Adding and Managing Query Pipelines](https://docs.coveo.com/en/1791/)).\n         *\n         * Default value is `undefined`, which means that pipeline selection conditions defined in the Coveo Cloud\n         * organization apply.\n         */\n        pipeline: ComponentOptions_1.ComponentOptions.buildStringOption(),\n        /**\n         * Specifies the maximum age (in milliseconds) that cached query results can have to still be usable as results\n         * instead of performing a new query on the index from within the Tab. The cache is located in the Coveo Search API\n         * (which resides between the index and the search interface).\n         *\n         * If cached results that are older than the age you specify in this option are available, a new query will be\n         * performed on the index anyhow.\n         *\n         * On high-volume public web sites, specifying a higher value for this option can greatly improve query response\n         * time at the cost of result freshness.\n         *\n         * **Note:**\n         *\n         * > It is also possible to set a maximum cache age for the entire {@link SearchInterface} rather than for a single\n         * > Tab (see {@link SearchInterface.options.maximumAge}).\n         *\n         * Default value is `undefined` and the Coveo Search API determines the maximum cache age. This is typically\n         * equivalent to 30 minutes (see [maximumAge](https://docs.coveo.com/en/1461/#RestQueryParameters-maximumAge)).\n         */\n        maximumAge: ComponentOptions_1.ComponentOptions.buildNumberOption(),\n        /**\n         * Specifies whether to enable responsive mode for tabs. Responsive mode makes overflowing tabs disappear, instead\n         * making them available using a dropdown button. Responsive tabs are enabled either when tabs overflow or when the\n         * width of the search interface becomes too small.\n         *\n         * Disabling responsive mode for one Tab also disables it for all tabs. Therefore, you only need to set this option\n         * to `false` on one Tab to disable responsive mode.\n         *\n         * Default value is `true`.\n         *\n         * @availablesince [October 2016 Release (v1.1550.5)](https://docs.coveo.com/en/309/#october-2016-release-v115505)\n         */\n        enableResponsiveMode: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true, section: 'ResponsiveOptions' }),\n        /**\n         * Specifies the label of the button that allows to show the hidden tabs when in responsive mode.\n         *\n         * If more than one Tab in the search interface specifies a value for this option, then the framework uses the first\n         * occurrence of the option.\n         *\n         * The default value is `\"More\"`.\n         */\n        dropdownHeaderLabel: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({ section: 'ResponsiveOptions' })\n    };\n    return Tab;\n}(Component_1.Component));\nexports.Tab = Tab;\nInitialization_1.Initialization.registerAutoCreateComponent(Tab);\n\n\n/***/ }),\n\n/***/ 674:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 675:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(676);\nvar underscore_1 = __webpack_require__(0);\nvar InitializationEvents_1 = __webpack_require__(17);\nvar Logger_1 = __webpack_require__(9);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar EventsUtils_1 = __webpack_require__(136);\nvar SVGDom_1 = __webpack_require__(16);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Utils_1 = __webpack_require__(4);\nvar Component_1 = __webpack_require__(7);\nvar SearchInterface_1 = __webpack_require__(19);\nvar Tab_1 = __webpack_require__(201);\nvar ResponsiveComponents_1 = __webpack_require__(54);\nvar ResponsiveComponentsManager_1 = __webpack_require__(61);\nvar ResponsiveComponentsUtils_1 = __webpack_require__(129);\nvar AccessibleButton_1 = __webpack_require__(15);\nvar popper_js_1 = __webpack_require__(97);\nvar KeyboardUtils_1 = __webpack_require__(25);\nvar ResponsiveTabs = /** @class */ (function () {\n    function ResponsiveTabs(coveoRoot, ID) {\n        this.coveoRoot = coveoRoot;\n        this.ID = ID;\n        this.ignoreNextDocumentClick = false;\n        this.dropdownHeaderLabel = this.getDropdownHeaderLabel();\n        this.searchInterface = Component_1.Component.get(this.coveoRoot.el, SearchInterface_1.SearchInterface, false);\n        this.dropdownContent = this.buildDropdownContent();\n        this.dropdownHeader = this.buildDropdownHeader();\n        this.bindDropdownContentEvents();\n        this.bindDropdownHeaderEvents();\n        this.tabSection = Dom_1.$$(this.coveoRoot.find('.coveo-tab-section'));\n        this.manageTabSwapping();\n        this.bindNukeEvents();\n        this.initialTabOrder = this.tabsInTabSection.slice();\n    }\n    ResponsiveTabs.init = function (root, component, options) {\n        this.logger = new Logger_1.Logger('ResponsiveTabs');\n        if (!Dom_1.$$(root).find('.coveo-tab-section')) {\n            this.logger.info('No element with class coveo-tab-section. Responsive tabs cannot be enabled.');\n            return;\n        }\n        ResponsiveComponentsManager_1.ResponsiveComponentsManager.register(ResponsiveTabs, Dom_1.$$(root), Tab_1.Tab.ID, component, options);\n    };\n    ResponsiveTabs.prototype.handleResizeEvent = function () {\n        if (this.needSmallMode() && !ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)) {\n            this.changeToSmallMode();\n        }\n        else if (!this.needSmallMode() && ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)) {\n            this.changeToLargeMode();\n        }\n        if (this.shouldAddTabsToDropdown()) {\n            this.addTabsToDropdown();\n        }\n        else if (this.shouldRemoveTabsFromDropdown()) {\n            this.removeTabsFromDropdown();\n        }\n        if (this.isDropdownOpen()) {\n            this.positionPopup();\n        }\n    };\n    ResponsiveTabs.prototype.needSmallMode = function () {\n        // Ignore everything if the responsiveMode is not auto.\n        if (!this.searchInterface) {\n            return this.shouldAutoModeResolveToSmall();\n        }\n        switch (this.searchInterface.responsiveComponents.getResponsiveMode()) {\n            case 'small':\n            case 'medium':\n                return true;\n            case 'auto':\n            default:\n                return this.shouldAutoModeResolveToSmall();\n        }\n    };\n    ResponsiveTabs.prototype.shouldAutoModeResolveToSmall = function () {\n        var mediumWidth = this.searchInterface\n            ? this.searchInterface.responsiveComponents.getMediumScreenWidth()\n            : new ResponsiveComponents_1.ResponsiveComponents().getMediumScreenWidth();\n        if (this.coveoRoot.width() <= mediumWidth) {\n            return true;\n        }\n        else if (!ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)) {\n            return this.isOverflowing(this.tabSection.el);\n        }\n        else {\n            return this.isLargeFormatOverflowing();\n        }\n    };\n    ResponsiveTabs.prototype.changeToSmallMode = function () {\n        ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.activateSmallTabs(this.coveoRoot);\n    };\n    ResponsiveTabs.prototype.changeToLargeMode = function () {\n        this.emptyDropdown();\n        this.cleanUpDropdown();\n        ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.deactivateSmallTabs(this.coveoRoot);\n    };\n    ResponsiveTabs.prototype.shouldAddTabsToDropdown = function () {\n        return ((this.isOverflowing(this.tabSection.el) || this.tabSection.el.clientWidth === 0) &&\n            ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot));\n    };\n    ResponsiveTabs.prototype.addTabsToDropdown = function () {\n        var currentTab;\n        if (!this.tabSection.find(\".\" + ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS)) {\n            var facetDropdownHeader = this.tabSection.find('.coveo-facet-dropdown-header');\n            if (facetDropdownHeader) {\n                this.dropdownHeader.insertBefore(facetDropdownHeader);\n            }\n            else {\n                this.tabSection.el.appendChild(this.dropdownHeader.el);\n            }\n        }\n        for (var i = this.initialTabOrder.length - 1; i >= 0; i--) {\n            currentTab = this.initialTabOrder[i];\n            if (this.tabIsSelected(currentTab) && i > 0) {\n                currentTab = this.initialTabOrder[--i];\n            }\n            this.addToDropdownIfNeeded(currentTab);\n            if (!this.isOverflowing(this.tabSection.el)) {\n                break;\n            }\n        }\n    };\n    ResponsiveTabs.prototype.shouldRemoveTabsFromDropdown = function () {\n        return (!this.isOverflowing(this.tabSection.el) &&\n            this.tabSection.el.clientWidth !== 0 &&\n            ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot) &&\n            !this.isDropdownEmpty());\n    };\n    ResponsiveTabs.prototype.removeTabsFromDropdown = function () {\n        var _this = this;\n        var dropdownTabs = this.tabsInTabDropdown;\n        var current;\n        while (!this.isOverflowing(this.tabSection.el) && !this.isDropdownEmpty()) {\n            current = dropdownTabs.shift();\n            this.removeFromDropdownIfNeeded(current);\n            this.fromDropdownToTabSection(Dom_1.$$(current));\n        }\n        if (this.isOverflowing(this.tabSection.el)) {\n            var unselectedTabs = underscore_1.filter(this.tabsInTabSection, function (tab) { return !_this.tabIsSelected(tab); });\n            this.addToDropdownIfNeeded(unselectedTabs.pop());\n        }\n        if (this.isDropdownEmpty()) {\n            this.cleanUpDropdown();\n        }\n    };\n    ResponsiveTabs.prototype.emptyDropdown = function () {\n        var _this = this;\n        if (!this.isDropdownEmpty()) {\n            var dropdownTabs = this.tabsInTabDropdown;\n            while (!this.isDropdownEmpty()) {\n                var current = dropdownTabs.shift();\n                this.removeFromDropdownIfNeeded(current);\n            }\n            this.initialTabOrder.forEach(function (tab) { return _this.tabSection.append(tab); });\n        }\n    };\n    ResponsiveTabs.prototype.isLargeFormatOverflowing = function () {\n        var virtualTabSection = Dom_1.$$(this.tabSection.el.cloneNode(true));\n        var dropdownHeader = virtualTabSection.find(\".\" + ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS);\n        if (dropdownHeader) {\n            virtualTabSection.el.removeChild(dropdownHeader);\n        }\n        virtualTabSection.el.style.position = 'absolute';\n        virtualTabSection.el.style.visibility = 'hidden';\n        if (!this.isDropdownEmpty()) {\n            underscore_1.each(this.dropdownContent.findAll('.CoveoTab'), function (tab) {\n                virtualTabSection.el.appendChild(tab.cloneNode(true));\n            });\n        }\n        virtualTabSection.insertBefore(this.tabSection.el);\n        ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.deactivateSmallTabs(this.coveoRoot);\n        var isOverflowing = this.isOverflowing(this.tabSection.el) || this.isOverflowing(virtualTabSection.el);\n        ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.activateSmallTabs(this.coveoRoot);\n        virtualTabSection.detach();\n        return isOverflowing;\n    };\n    ResponsiveTabs.prototype.isOverflowing = function (el) {\n        return el.clientWidth < el.scrollWidth;\n    };\n    ResponsiveTabs.prototype.buildDropdownHeader = function () {\n        var dropdownHeader = Dom_1.$$('a', { className: \"coveo-dropdown-header \" + ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS });\n        var content = Dom_1.$$('p');\n        content.text(this.dropdownHeaderLabel);\n        var icon = Dom_1.$$('span', { className: 'coveo-more-tabs' }, SVGIcons_1.SVGIcons.icons.arrowDown);\n        SVGDom_1.SVGDom.addClassToSVGInContainer(icon.el, 'coveo-more-tabs-svg');\n        content.el.appendChild(icon.el);\n        dropdownHeader.el.appendChild(content.el);\n        return dropdownHeader;\n    };\n    ResponsiveTabs.prototype.bindDropdownHeaderEvents = function () {\n        var _this = this;\n        var toggle = function (event) {\n            if (_this.isDropdownOpen()) {\n                _this.closeDropdown();\n            }\n            else {\n                _this.openDropdown();\n            }\n            if (event.type === 'click') {\n                _this.ignoreNextDocumentClick = true;\n            }\n        };\n        new AccessibleButton_1.AccessibleButton()\n            .withElement(this.dropdownHeader)\n            .withSelectAction(toggle)\n            .withLabel(this.getDropdownHeaderLabel())\n            .build();\n    };\n    ResponsiveTabs.prototype.buildDropdownContent = function () {\n        var dropdownContent = Dom_1.$$('div', {\n            className: 'coveo-tab-list-container ' + SearchInterface_1.SearchInterface.SMALL_INTERFACE_CLASS_NAME\n        });\n        var contentList = Dom_1.$$('ol', { className: 'coveo-tab-list' });\n        dropdownContent.el.appendChild(contentList.el);\n        return dropdownContent;\n    };\n    ResponsiveTabs.prototype.bindDropdownContentEvents = function () {\n        var _this = this;\n        this.dropdownClickListener = function () {\n            if (_this.isDropdownOpen()) {\n                _this.ignoreNextDocumentClick = true;\n            }\n        };\n        this.documentClickListener = function (event) {\n            if (!_this.ignoreNextDocumentClick) {\n                _this.closeDropdown();\n            }\n            _this.ignoreNextDocumentClick = false;\n        };\n        Dom_1.$$(this.dropdownHeader).on('click', this.dropdownClickListener);\n        Dom_1.$$(this.dropdownContent).on('click', this.dropdownClickListener);\n    };\n    ResponsiveTabs.prototype.isDropdownOpen = function () {\n        return this.dropdownHeader.hasClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n    };\n    ResponsiveTabs.prototype.closeDropdown = function () {\n        Dom_1.$$(document.documentElement).off('click', this.documentClickListener);\n        this.dropdownContent.detach();\n        this.dropdownHeader.removeClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n    };\n    ResponsiveTabs.prototype.openDropdown = function () {\n        Dom_1.$$(document.documentElement).on('click', this.documentClickListener);\n        this.positionPopup();\n        this.dropdownHeader.addClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n    };\n    ResponsiveTabs.prototype.addToDropdownIfNeeded = function (tab) {\n        if (!this.canAddTabToDropdown(tab)) {\n            return;\n        }\n        Dom_1.$$(tab).addClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n        var list = Dom_1.$$(this.dropdownContent.find('ol'));\n        var listElement = Dom_1.$$('li', null, tab);\n        list.prepend(listElement.el);\n    };\n    ResponsiveTabs.prototype.removeFromDropdownIfNeeded = function (tab) {\n        if (!this.canRemoveTabFromDropdown(tab)) {\n            return;\n        }\n        Dom_1.$$(tab).removeClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n        Dom_1.$$(tab.parentElement).detach();\n    };\n    ResponsiveTabs.prototype.canAddTabToDropdown = function (tab) {\n        return tab && !this.tabIsInDropdown(tab) && this.dropdownHeader;\n    };\n    ResponsiveTabs.prototype.canRemoveTabFromDropdown = function (tab) {\n        return tab && this.tabIsInDropdown(tab) && this.dropdownContent;\n    };\n    ResponsiveTabs.prototype.cleanUpDropdown = function () {\n        this.dropdownHeader.removeClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n        this.dropdownHeader.detach();\n        this.dropdownContent.detach();\n    };\n    ResponsiveTabs.prototype.isDropdownEmpty = function () {\n        if (this.dropdownContent) {\n            var tabs = this.dropdownContent.findAll('.CoveoTab');\n            return tabs.length == 0;\n        }\n        return false;\n    };\n    ResponsiveTabs.prototype.manageTabSwapping = function () {\n        var _this = this;\n        underscore_1.each(this.coveoRoot.findAll('.' + Component_1.Component.computeCssClassNameForType(this.ID)), function (tabElement) {\n            var tab = Dom_1.$$(tabElement);\n            var fadeOutFadeIn = function (event) {\n                var lastTabInSection = _this.tabsInTabSection.pop();\n                if (event.propertyName == 'opacity') {\n                    if (tab.el.style.opacity == '0') {\n                        Dom_1.$$(lastTabInSection).addClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n                        tab.replaceWith(lastTabInSection);\n                        tab.removeClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n                        _this.fromDropdownToTabSection(tab);\n                        // Because of the DOM manipulation, sometimes the animation will not trigger. Accessing the computed styles makes sure\n                        // the animation will happen.\n                        window.getComputedStyle(tab.el).opacity;\n                        window.getComputedStyle(lastTabInSection).opacity;\n                        tab.el.style.opacity = lastTabInSection.style.opacity = '1';\n                    }\n                    else if (tab.el.style.opacity == '1') {\n                        _this.closeDropdown();\n                        EventsUtils_1.EventsUtils.removePrefixedEvent(tab.el, 'TransitionEnd', fadeOutFadeIn);\n                        _this.handleResizeEvent();\n                    }\n                }\n            };\n            var swapOnSelect = function () {\n                if (_this.tabIsInDropdown(tab)) {\n                    var lastTabInSection = _this.tabsInTabSection.pop();\n                    if (lastTabInSection) {\n                        EventsUtils_1.EventsUtils.addPrefixedEvent(tab.el, 'TransitionEnd', fadeOutFadeIn);\n                        tab.el.style.opacity = lastTabInSection.style.opacity = '0';\n                    }\n                }\n            };\n            tab.on('click', function () { return swapOnSelect(); });\n            tab.on('keyup', KeyboardUtils_1.KeyboardUtils.keypressAction(KeyboardUtils_1.KEYBOARD.ENTER, swapOnSelect));\n            tab.on('blur', function (e) {\n                if (e.relatedTarget && !_this.tabIsInDropdown(e.relatedTarget)) {\n                    _this.closeDropdown();\n                }\n            });\n        });\n    };\n    ResponsiveTabs.prototype.bindNukeEvents = function () {\n        var _this = this;\n        Dom_1.$$(this.coveoRoot).on(InitializationEvents_1.InitializationEvents.nuke, function () {\n            Dom_1.$$(document.documentElement).off('click', _this.documentClickListener);\n        });\n    };\n    ResponsiveTabs.prototype.positionPopup = function () {\n        this.dropdownContent.insertAfter(this.dropdownHeader.el);\n        new popper_js_1.default(this.dropdownHeader.el, this.dropdownContent.el, {\n            modifiers: {\n                preventOverflow: {\n                    boundariesElement: this.coveoRoot.el\n                }\n            }\n        });\n    };\n    ResponsiveTabs.prototype.fromDropdownToTabSection = function (tab) {\n        var lastTabInTabSection = underscore_1.last(this.tabsInTabSection);\n        if (!lastTabInTabSection) {\n            this.tabSection.prepend(tab.el);\n            return;\n        }\n        var comesAfterInitialTabOrder = this.initialTabOrder.indexOf(tab.el) > this.initialTabOrder.indexOf(lastTabInTabSection);\n        if (comesAfterInitialTabOrder) {\n            tab.insertAfter(lastTabInTabSection);\n        }\n        else {\n            tab.insertBefore(lastTabInTabSection);\n        }\n    };\n    ResponsiveTabs.prototype.getDropdownHeaderLabel = function () {\n        var dropdownHeaderLabel;\n        underscore_1.each(Dom_1.$$(this.coveoRoot.find('.coveo-tab-section')).findAll('.' + Component_1.Component.computeCssClassName(Tab_1.Tab)), function (tabElement) {\n            var tab = Component_1.Component.get(tabElement, Tab_1.Tab);\n            if (!dropdownHeaderLabel && tab && tab.options.dropdownHeaderLabel) {\n                dropdownHeaderLabel = tab.options.dropdownHeaderLabel;\n            }\n        });\n        if (!dropdownHeaderLabel) {\n            dropdownHeaderLabel = Strings_1.l(ResponsiveTabs.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE);\n        }\n        return dropdownHeaderLabel;\n    };\n    ResponsiveTabs.prototype.tabIsSelected = function (tab) {\n        return Dom_1.$$(tab).hasClass('coveo-selected');\n    };\n    ResponsiveTabs.prototype.tabIsInDropdown = function (tab) {\n        return Dom_1.$$(tab).hasClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n    };\n    Object.defineProperty(ResponsiveTabs.prototype, \"tabsInTabSection\", {\n        get: function () {\n            var _this = this;\n            var tabsInSection = [];\n            underscore_1.each(this.tabSection.children(), function (childElement) {\n                if (Utils_1.Utils.isHtmlElement(childElement)) {\n                    var child = Dom_1.$$(childElement);\n                    var childHasTabCssClassName = child.hasClass(Component_1.Component.computeCssClassNameForType(_this.ID));\n                    if (!_this.tabIsInDropdown(child) && childHasTabCssClassName) {\n                        tabsInSection.push(child.el);\n                    }\n                }\n            });\n            return tabsInSection;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(ResponsiveTabs.prototype, \"tabsInTabDropdown\", {\n        get: function () {\n            if (!this.dropdownContent) {\n                return [];\n            }\n            return this.dropdownContent.findAll(\".\" + ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    ResponsiveTabs.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE = 'More';\n    ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS = 'coveo-tab-dropdown';\n    ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS = ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS + \"-header\";\n    ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS = 'coveo-dropdown-header-active';\n    return ResponsiveTabs;\n}());\nexports.ResponsiveTabs = ResponsiveTabs;\n\n\n/***/ }),\n\n/***/ 676:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// Tab.min__d67acfe80778de2e04cc.js","import { Dom } from '../../utils/Dom';\nimport { ResponsiveDropdownContent } from './ResponsiveDropdown/ResponsiveDropdownContent';\n\nexport class ResponsiveComponentsUtils {\n  private static smallTabsClassName: string = 'coveo-small-tabs';\n  private static smallFacetClassName: string = 'coveo-small-facets';\n  private static smallRecommendationClassName: string = 'coveo-small-recommendation';\n\n  static shouldDrawFacetSlider(root: Dom, facetSliderElement: Dom): boolean {\n    return ResponsiveDropdownContent.isTargetInsideOpenedDropdown(facetSliderElement) || !this.isSmallFacetActivated(root);\n  }\n\n  static isSmallTabsActivated(root: Dom): boolean {\n    return root.hasClass(this.smallTabsClassName);\n  }\n\n  static isSmallFacetActivated(root: Dom): boolean {\n    return root.hasClass(this.smallFacetClassName);\n  }\n\n  static isSmallRecommendationActivated(root: Dom): boolean {\n    return root.hasClass(this.smallRecommendationClassName);\n  }\n\n  static activateSmallTabs(root: Dom): void {\n    root.addClass(this.smallTabsClassName);\n  }\n\n  static deactivateSmallTabs(root: Dom): void {\n    root.removeClass(this.smallTabsClassName);\n  }\n\n  static activateSmallFacet(root: Dom): void {\n    root.addClass(this.smallFacetClassName);\n  }\n\n  static deactivateSmallFacet(root: Dom): void {\n    root.removeClass(this.smallFacetClassName);\n  }\n\n  static activateSmallRecommendation(root: Dom): void {\n    root.addClass(this.smallRecommendationClassName);\n  }\n\n  static deactivateSmallRecommendation(root: Dom): void {\n    root.removeClass(this.smallRecommendationClassName);\n  }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/ResponsiveComponents/ResponsiveComponentsUtils.ts","import 'styling/_Tab';\nimport { each, indexOf, map } from 'underscore';\nimport { InitializationEvents } from '../../events/InitializationEvents';\nimport { IBuildingQueryEventArgs, QueryEvents } from '../../events/QueryEvents';\nimport { exportGlobally } from '../../GlobalExports';\nimport { Assert } from '../../misc/Assert';\nimport { IAttributeChangedEventArg, MODEL_EVENTS } from '../../models/Model';\nimport { QueryStateModel, QUERY_STATE_ATTRIBUTES } from '../../models/QueryStateModel';\nimport { SearchEndpoint } from '../../rest/SearchEndpoint';\nimport { AccessibleButton } from '../../utils/AccessibleButton';\nimport { $$ } from '../../utils/Dom';\nimport { Utils } from '../../utils/Utils';\nimport { analyticsActionCauseList, IAnalyticsInterfaceChange } from '../Analytics/AnalyticsActionListMeta';\nimport { Component } from '../Base/Component';\nimport { IComponentBindings } from '../Base/ComponentBindings';\nimport { ComponentOptions } from '../Base/ComponentOptions';\nimport { IQueryExpression } from '../Base/IComponentOptions';\nimport { Initialization } from '../Base/Initialization';\nimport { ResponsiveTabs } from '../ResponsiveComponents/ResponsiveTabs';\nimport { ValidLayout } from '../ResultLayoutSelector/ValidLayout';\n\nexport interface ITabOptions {\n  expression?: IQueryExpression;\n  constant?: boolean;\n  id?: string;\n  icon?: string;\n  caption?: string;\n  sort?: string;\n  layout?: string;\n  endpoint?: SearchEndpoint;\n  enableDuplicateFiltering?: boolean;\n  pipeline?: string;\n  maximumAge?: number;\n  enableResponsiveMode?: boolean;\n  dropdownHeaderLabel?: string;\n}\n\n/**\n * The Tab component renders a widget that allows the end user to select a specific search interface.\n *\n * This component attaches itself to a `div` element. It is in charge of adding an advanced expression to the outgoing\n * query in order to refine the results.\n *\n * The Tab component can also hide and show different parts of the UI. For each individual component in the UI, you can\n * specify whether you wish to include or exclude that component when the user selects a certain Tab (see [Using Components\n * Only on Specific Tabs](https://docs.coveo.com/en/508/javascript-search-framework/using-components-only-on-specific-tabs)).\n *\n * **Setting a New Endpoint for a Tab:**\n *\n * A Tab can use a custom endpoint when performing a query. Of course, you need to make sure that the endpoint exists in\n * the array of Coveo.SearchEndpoint.endpoints (see {@link SearchEndpoint.endpoints}).\n *\n * ```\n * Coveo.SearchEndpoint.endpoints[\"specialEndpoint\"] = new Coveo.SearchEndpoint({\n *     restUri : 'https://somewhere.com/rest/search'\n * })\n *\n * [ ... ]\n *\n * <div class='CoveoTab' data-endpoint='specialEndpoint'></div>\n *\n * ```\n */\nexport class Tab extends Component {\n  static ID = 'Tab';\n\n  static doExport = () => {\n    exportGlobally({\n      Tab: Tab\n    });\n  };\n\n  /**\n   * The options for a Tab\n   * @componentOptions\n   */\n  static options: ITabOptions = {\n    /**\n     * Specifies a unique ID for the Tab.\n     *\n     * Specifying a value for this option is necessary for this component to work.\n     */\n    id: ComponentOptions.buildStringOption({ required: true, section: 'Common Options' }),\n\n    /**\n     * Specifies the caption of the Tab.\n     *\n     * Specifying a value for this option is necessary for this component to work.\n     */\n    caption: ComponentOptions.buildLocalizedStringOption({ required: true, section: 'Common Options' }),\n\n    /**\n     * Specifies an icon to use for the Tab.\n     *\n     * @deprecated This options is mostly kept for legacy reasons. If possible, you should avoid using it.\n     */\n    icon: ComponentOptions.buildStringOption(),\n\n    /**\n     * Specifies an advanced expression or filter that the Tab should add to any outgoing query.\n     *\n     * **Example:**\n     *\n     * `@objecttype==Message`\n     *\n     * Default value is `undefined` and the Tab applies no additional expression or filter to the query.\n     */\n    expression: ComponentOptions.buildQueryExpressionOption({ section: 'Common Options' }),\n\n    /**\n     * Specifies the {@link SearchEndpoint} to point to when performing queries from within the Tab.\n     *\n     * By default, the Tab uses the \"default\" endpoint.\n     */\n    endpoint: ComponentOptions.buildCustomOption(endpoint => (endpoint != null ? SearchEndpoint.endpoints[endpoint] : null)),\n\n    /**\n     * Specifies the default sort criteria to use when selecting the Tab. A {@link Sort} component with the same\n     * parameter needs to be present in the search interface in order for this option to function properly.\n     *\n     * **Examples:**\n     *\n     * - `data-sort='relevancy'`\n     * - `data-sort='date descending'`\n     *\n     * Default value is `undefined` and the normal {@link Sort} component behavior applies.\n     */\n    sort: ComponentOptions.buildStringOption(),\n\n    /**\n     * Specifies the default layout to display when the user selects the Tab (see {@link ResultList.options.layout} and\n     * {@link ResultLayout}).\n     *\n     * See the {@link ValidLayout} type for the list of possible values.\n     *\n     * If not specified, it will default to 'list'.\n     *\n     * See also [Result Layouts](https://docs.coveo.com/en/360/).\n     *\n     * Default value is `undefined` and the component selects the first available layout.\n     */\n    layout: ComponentOptions.buildStringOption<ValidLayout>(),\n\n    /**\n     * Specifies whether to include the {@link Tab.options.expression} in the constant part of the query.\n     *\n     * The index specially optimizes the constant part of the query to execute faster. However, you must be careful not\n     * to include dynamic query expressions, otherwise the cache will lose its efficiency.\n     *\n     * Default value is `true`.\n     */\n    constant: ComponentOptions.buildBooleanOption({ defaultValue: true, section: 'Filtering' }),\n\n    /**\n     * Whether to filter out duplicates, so that items resembling one another only appear once in the query results.\n     *\n     * **Notes:**\n     * - Two items must be at least 85% similar to one another to be considered duplicates.\n     * - When a pair of duplicates is found, only the higher-ranked item of the two is kept in the result set.\n     * - Enabling this feature can make the total result count less precise, as only the requested page of query results is submitted to duplicate filtering.\n     * - The default value for this option can be modified through the {@link SearchInterface} component.\n     */\n    enableDuplicateFiltering: ComponentOptions.buildBooleanOption({ defaultValue: false }),\n\n    /**\n     * Specifies the name of the query pipeline to use for the queries when the Tab is selected.\n     *\n     * You can specify a value for this option if your index is in a Coveo Cloud organization in which pipelines have\n     * been created (see [Adding and Managing Query Pipelines](https://docs.coveo.com/en/1791/)).\n     *\n     * Default value is `undefined`, which means that pipeline selection conditions defined in the Coveo Cloud\n     * organization apply.\n     */\n    pipeline: ComponentOptions.buildStringOption(),\n\n    /**\n     * Specifies the maximum age (in milliseconds) that cached query results can have to still be usable as results\n     * instead of performing a new query on the index from within the Tab. The cache is located in the Coveo Search API\n     * (which resides between the index and the search interface).\n     *\n     * If cached results that are older than the age you specify in this option are available, a new query will be\n     * performed on the index anyhow.\n     *\n     * On high-volume public web sites, specifying a higher value for this option can greatly improve query response\n     * time at the cost of result freshness.\n     *\n     * **Note:**\n     *\n     * > It is also possible to set a maximum cache age for the entire {@link SearchInterface} rather than for a single\n     * > Tab (see {@link SearchInterface.options.maximumAge}).\n     *\n     * Default value is `undefined` and the Coveo Search API determines the maximum cache age. This is typically\n     * equivalent to 30 minutes (see [maximumAge](https://docs.coveo.com/en/1461/#RestQueryParameters-maximumAge)).\n     */\n    maximumAge: ComponentOptions.buildNumberOption(),\n\n    /**\n     * Specifies whether to enable responsive mode for tabs. Responsive mode makes overflowing tabs disappear, instead\n     * making them available using a dropdown button. Responsive tabs are enabled either when tabs overflow or when the\n     * width of the search interface becomes too small.\n     *\n     * Disabling responsive mode for one Tab also disables it for all tabs. Therefore, you only need to set this option\n     * to `false` on one Tab to disable responsive mode.\n     *\n     * Default value is `true`.\n     *\n     * @availablesince [October 2016 Release (v1.1550.5)](https://docs.coveo.com/en/309/#october-2016-release-v115505)\n     */\n    enableResponsiveMode: ComponentOptions.buildBooleanOption({ defaultValue: true, section: 'ResponsiveOptions' }),\n\n    /**\n     * Specifies the label of the button that allows to show the hidden tabs when in responsive mode.\n     *\n     * If more than one Tab in the search interface specifies a value for this option, then the framework uses the first\n     * occurrence of the option.\n     *\n     * The default value is `\"More\"`.\n     */\n    dropdownHeaderLabel: ComponentOptions.buildLocalizedStringOption({ section: 'ResponsiveOptions' })\n  };\n\n  /**\n   * Creates a new Tab. Binds on buildingQuery event as well as an event on click of the element.\n   * @param element The HTMLElement on which to instantiate the component. Normally a `div`.\n   * @param options The options for the Tab component.\n   * @param bindings The bindings that the component requires to function normally. If not set, these will be\n   * automatically resolved (with a slower execution time).\n   */\n  constructor(public element: HTMLElement, public options?: ITabOptions, bindings?: IComponentBindings) {\n    super(element, Tab.ID, bindings);\n\n    this.options = ComponentOptions.initComponentOptions(element, Tab, options);\n\n    this.bind.onRootElement(QueryEvents.buildingQuery, (args: IBuildingQueryEventArgs) => this.handleBuildingQuery(args));\n    this.bind.onRootElement(InitializationEvents.afterInitialization, () => this.handleAfterInitialization());\n    this.bind.onQueryState(MODEL_EVENTS.CHANGE_ONE, QUERY_STATE_ATTRIBUTES.T, (args: IAttributeChangedEventArg) =>\n      this.handleQueryStateChanged(args)\n    );\n\n    new AccessibleButton()\n      .withElement(element)\n      .withSelectAction(() => this.select())\n      .withTitle(this.options.caption)\n      .withOwner(this.bind)\n      .build();\n\n    this.render();\n    ResponsiveTabs.init(this.root, this, this.options);\n  }\n\n  /**\n   * Selects the current Tab.\n   *\n   * Also logs the `interfaceChange` event in the usage analytics with the new current {@link Tab.options.id} as metada\n   * and triggers a new query.\n   */\n  public select() {\n    if (!this.disabled) {\n      const state = {\n        t: this.options.id,\n        sort: this.options.sort || QueryStateModel.defaultAttributes.sort\n      } as any;\n\n      if (this.options.layout) {\n        state.layout = this.options.layout;\n      }\n\n      this.queryStateModel.setMultiple(state);\n\n      this.usageAnalytics.logSearchEvent<IAnalyticsInterfaceChange>(analyticsActionCauseList.interfaceChange, {\n        interfaceChangeTo: this.options.id\n      });\n      this.queryController.executeQuery();\n    }\n  }\n\n  /**\n   * Indicates whether the HTMLElement argument is included in the Tab. *Included* elements are shown when the Tab is\n   * selected, whereas *excluded* elements are not.\n   * @param element The HTMLElement to verify.\n   * @returns {boolean} `true` if the HTMLElement is included in the Tab; `false` if it is excluded.\n   */\n  public isElementIncludedInTab(element: HTMLElement): boolean {\n    Assert.exists(element);\n\n    const includedTabs = this.splitListOfTabs(element.getAttribute('data-tab'));\n    const excludedTabs = this.splitListOfTabs(element.getAttribute('data-tab-not'));\n    Assert.check(\n      !(includedTabs.length != 0 && excludedTabs.length != 0),\n      'You cannot both explicitly include and exclude an element from tabs.'\n    );\n\n    return (\n      (includedTabs.length != 0 && indexOf(includedTabs, this.options.id) != -1) ||\n      (excludedTabs.length != 0 && indexOf(excludedTabs, this.options.id) == -1) ||\n      (includedTabs.length == 0 && excludedTabs.length == 0)\n    );\n  }\n\n  private render() {\n    const icon = this.options.icon;\n    if (Utils.isNonEmptyString(icon)) {\n      const iconSpan = $$('span').el;\n      $$(iconSpan).addClass(['coveo-icon', icon]);\n      this.element.insertBefore(iconSpan, this.element.firstChild);\n    }\n\n    const caption = this.options.caption;\n    if (Utils.isNonEmptyString(caption)) {\n      const captionP = document.createElement('p');\n      $$(captionP).text(caption);\n      this.element.appendChild(captionP);\n    }\n  }\n\n  protected handleBuildingQuery(data: IBuildingQueryEventArgs) {\n    Assert.exists(data);\n    if (!this.disabled && this.isSelected()) {\n      data.queryBuilder.tab = this.options.id;\n\n      if (Utils.isNonEmptyString(this.options.expression)) {\n        if (this.options.constant) {\n          data.queryBuilder.constantExpression.add(this.options.expression);\n        } else {\n          data.queryBuilder.advancedExpression.add(this.options.expression);\n        }\n      }\n\n      if (this.options.enableDuplicateFiltering) {\n        data.queryBuilder.enableDuplicateFiltering = true;\n      }\n\n      if (this.options.pipeline != null) {\n        data.queryBuilder.pipeline = this.options.pipeline;\n      }\n\n      if (this.options.maximumAge != null) {\n        data.queryBuilder.maximumAge = this.options.maximumAge;\n      }\n    }\n  }\n\n  private handleQueryStateChanged(data: IAttributeChangedEventArg) {\n    Assert.exists(data);\n    if (!this.disabled && this.isSelected()) {\n      $$(this.element).addClass('coveo-selected');\n      this.queryController.setEndpoint(this.options.endpoint);\n      this.showAndHideAppropriateElements();\n    } else {\n      $$(this.element).removeClass('coveo-selected');\n    }\n  }\n\n  private handleAfterInitialization() {\n    if (this.isSelected() && this.options.layout) {\n      this.queryStateModel.set(QUERY_STATE_ATTRIBUTES.LAYOUT, this.options.layout);\n    }\n  }\n\n  protected isSelected(): boolean {\n    const activeTab = this.queryStateModel.get(QueryStateModel.attributesEnum.t);\n    return activeTab == this.options.id;\n  }\n\n  private showAndHideAppropriateElements() {\n    const showElements = [];\n    const hideElements = [];\n\n    each($$(this.root).findAll('[data-tab],[data-tab-not]'), element => {\n      if (this.isElementIncludedInTab(element)) {\n        this.toggleAllComponentsUnder(element, true);\n        showElements.push(element);\n      } else {\n        this.toggleAllComponentsUnder(element, false);\n        hideElements.push(element);\n      }\n    });\n\n    $$(this.root).one(QueryEvents.querySuccess, () => {\n      each(showElements, elem => $$(elem).removeClass('coveo-tab-disabled'));\n      each(hideElements, elem => $$(elem).addClass('coveo-tab-disabled'));\n    });\n  }\n\n  private splitListOfTabs(value: string): string[] {\n    if (Utils.exists(value)) {\n      return map(value.split(','), tab => Utils.trim(tab));\n    } else {\n      return [];\n    }\n  }\n\n  private toggleAllComponentsUnder(element: HTMLElement, enable: boolean) {\n    Assert.exists(element);\n\n    const togglePossibleComponent = (possibleComponent: HTMLElement) => {\n      const possibleCmp = Component.get(possibleComponent, undefined, true);\n      if (possibleCmp) {\n        if (enable) {\n          possibleCmp.enable();\n        } else {\n          possibleCmp.disable();\n        }\n      }\n    };\n\n    togglePossibleComponent(element);\n    each($$(element).findAll('*'), el => {\n      togglePossibleComponent(el);\n    });\n  }\n\n  public enable() {\n    super.enable();\n    this.element.style.display = '';\n  }\n\n  public disable() {\n    super.disable();\n    this.element.style.display = 'none';\n  }\n}\n\nInitialization.registerAutoCreateComponent(Tab);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/Tab/Tab.ts","import 'styling/_ResponsiveTabs';\nimport { filter, each, last } from 'underscore';\nimport { InitializationEvents } from '../../events/InitializationEvents';\nimport { Logger } from '../../misc/Logger';\nimport { l } from '../../strings/Strings';\nimport { $$, Dom } from '../../utils/Dom';\nimport { EventsUtils } from '../../utils/EventsUtils';\nimport { SVGDom } from '../../utils/SVGDom';\nimport { SVGIcons } from '../../utils/SVGIcons';\nimport { Utils } from '../../utils/Utils';\nimport { Component } from '../Base/Component';\nimport { SearchInterface } from '../SearchInterface/SearchInterface';\nimport { Tab } from '../Tab/Tab';\nimport { ResponsiveComponents } from './ResponsiveComponents';\nimport { IResponsiveComponent, IResponsiveComponentOptions, ResponsiveComponentsManager } from './ResponsiveComponentsManager';\nimport { ResponsiveComponentsUtils } from './ResponsiveComponentsUtils';\nimport { AccessibleButton } from '../../utils/AccessibleButton';\nimport Popper from 'popper.js';\nimport { KeyboardUtils, KEYBOARD } from '../../utils/KeyboardUtils';\n\nexport class ResponsiveTabs implements IResponsiveComponent {\n  private static DROPDOWN_HEADER_LABEL_DEFAULT_VALUE = 'More';\n  private static TAB_IN_DROPDOWN_CSS_CLASS = 'coveo-tab-dropdown';\n  private static TAB_IN_DROPDOWN_HEADER_CSS_CLASS = `${ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS}-header`;\n  private static ACTIVE_DROPDOWN_CSS_CLASS = 'coveo-dropdown-header-active';\n  private static logger: Logger;\n  private dropdownHeader: Dom;\n  private dropdownContent: Dom;\n  private tabSection: Dom;\n  private searchInterface: SearchInterface;\n  private dropdownHeaderLabel: string;\n  private initialTabOrder: HTMLElement[];\n\n  private documentClickListener: EventListener;\n  private dropdownClickListener: EventListener;\n  private ignoreNextDocumentClick = false;\n\n  constructor(private coveoRoot: Dom, public ID: string) {\n    this.dropdownHeaderLabel = this.getDropdownHeaderLabel();\n    this.searchInterface = <SearchInterface>Component.get(this.coveoRoot.el, SearchInterface, false);\n    this.dropdownContent = this.buildDropdownContent();\n    this.dropdownHeader = this.buildDropdownHeader();\n    this.bindDropdownContentEvents();\n    this.bindDropdownHeaderEvents();\n    this.tabSection = $$(<HTMLElement>this.coveoRoot.find('.coveo-tab-section'));\n    this.manageTabSwapping();\n    this.bindNukeEvents();\n    this.initialTabOrder = [...this.tabsInTabSection];\n  }\n\n  public static init(root: HTMLElement, component: Component, options: IResponsiveComponentOptions) {\n    this.logger = new Logger('ResponsiveTabs');\n    if (!$$(root).find('.coveo-tab-section')) {\n      this.logger.info('No element with class coveo-tab-section. Responsive tabs cannot be enabled.');\n      return;\n    }\n    ResponsiveComponentsManager.register(ResponsiveTabs, $$(root), Tab.ID, component, options);\n  }\n\n  public handleResizeEvent(): void {\n    if (this.needSmallMode() && !ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)) {\n      this.changeToSmallMode();\n    } else if (!this.needSmallMode() && ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)) {\n      this.changeToLargeMode();\n    }\n\n    if (this.shouldAddTabsToDropdown()) {\n      this.addTabsToDropdown();\n    } else if (this.shouldRemoveTabsFromDropdown()) {\n      this.removeTabsFromDropdown();\n    }\n\n    if (this.isDropdownOpen()) {\n      this.positionPopup();\n    }\n  }\n\n  private needSmallMode(): boolean {\n    // Ignore everything if the responsiveMode is not auto.\n    if (!this.searchInterface) {\n      return this.shouldAutoModeResolveToSmall();\n    }\n    switch (this.searchInterface.responsiveComponents.getResponsiveMode()) {\n      case 'small':\n      case 'medium':\n        return true;\n      case 'auto':\n      default:\n        return this.shouldAutoModeResolveToSmall();\n    }\n  }\n\n  private shouldAutoModeResolveToSmall() {\n    const mediumWidth = this.searchInterface\n      ? this.searchInterface.responsiveComponents.getMediumScreenWidth()\n      : new ResponsiveComponents().getMediumScreenWidth();\n    if (this.coveoRoot.width() <= mediumWidth) {\n      return true;\n    } else if (!ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)) {\n      return this.isOverflowing(this.tabSection.el);\n    } else {\n      return this.isLargeFormatOverflowing();\n    }\n  }\n\n  private changeToSmallMode(): void {\n    ResponsiveComponentsUtils.activateSmallTabs(this.coveoRoot);\n  }\n\n  private changeToLargeMode(): void {\n    this.emptyDropdown();\n    this.cleanUpDropdown();\n    ResponsiveComponentsUtils.deactivateSmallTabs(this.coveoRoot);\n  }\n\n  private shouldAddTabsToDropdown(): boolean {\n    return (\n      (this.isOverflowing(this.tabSection.el) || this.tabSection.el.clientWidth === 0) &&\n      ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot)\n    );\n  }\n\n  private addTabsToDropdown(): void {\n    let currentTab;\n    if (!this.tabSection.find(`.${ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS}`)) {\n      const facetDropdownHeader = this.tabSection.find('.coveo-facet-dropdown-header');\n      if (facetDropdownHeader) {\n        this.dropdownHeader.insertBefore(facetDropdownHeader);\n      } else {\n        this.tabSection.el.appendChild(this.dropdownHeader.el);\n      }\n    }\n    for (let i = this.initialTabOrder.length - 1; i >= 0; i--) {\n      currentTab = this.initialTabOrder[i];\n\n      if (this.tabIsSelected(currentTab) && i > 0) {\n        currentTab = this.initialTabOrder[--i];\n      }\n\n      this.addToDropdownIfNeeded(currentTab);\n\n      if (!this.isOverflowing(this.tabSection.el)) {\n        break;\n      }\n    }\n  }\n\n  private shouldRemoveTabsFromDropdown(): boolean {\n    return (\n      !this.isOverflowing(this.tabSection.el) &&\n      this.tabSection.el.clientWidth !== 0 &&\n      ResponsiveComponentsUtils.isSmallTabsActivated(this.coveoRoot) &&\n      !this.isDropdownEmpty()\n    );\n  }\n\n  private removeTabsFromDropdown() {\n    const dropdownTabs = this.tabsInTabDropdown;\n\n    let current: HTMLElement;\n    while (!this.isOverflowing(this.tabSection.el) && !this.isDropdownEmpty()) {\n      current = dropdownTabs.shift();\n      this.removeFromDropdownIfNeeded(current);\n      this.fromDropdownToTabSection($$(current));\n    }\n\n    if (this.isOverflowing(this.tabSection.el)) {\n      const unselectedTabs = filter(this.tabsInTabSection, tab => !this.tabIsSelected(tab));\n      this.addToDropdownIfNeeded(unselectedTabs.pop());\n    }\n\n    if (this.isDropdownEmpty()) {\n      this.cleanUpDropdown();\n    }\n  }\n\n  private emptyDropdown(): void {\n    if (!this.isDropdownEmpty()) {\n      const dropdownTabs = this.tabsInTabDropdown;\n      while (!this.isDropdownEmpty()) {\n        const current = dropdownTabs.shift();\n        this.removeFromDropdownIfNeeded(current);\n      }\n      this.initialTabOrder.forEach(tab => this.tabSection.append(tab));\n    }\n  }\n\n  private isLargeFormatOverflowing(): boolean {\n    const virtualTabSection = $$(<HTMLElement>this.tabSection.el.cloneNode(true));\n\n    const dropdownHeader = virtualTabSection.find(`.${ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS}`);\n    if (dropdownHeader) {\n      virtualTabSection.el.removeChild(dropdownHeader);\n    }\n\n    virtualTabSection.el.style.position = 'absolute';\n    virtualTabSection.el.style.visibility = 'hidden';\n\n    if (!this.isDropdownEmpty()) {\n      each(this.dropdownContent.findAll('.CoveoTab'), tab => {\n        virtualTabSection.el.appendChild(tab.cloneNode(true));\n      });\n    }\n    virtualTabSection.insertBefore(this.tabSection.el);\n\n    ResponsiveComponentsUtils.deactivateSmallTabs(this.coveoRoot);\n    const isOverflowing = this.isOverflowing(this.tabSection.el) || this.isOverflowing(virtualTabSection.el);\n    ResponsiveComponentsUtils.activateSmallTabs(this.coveoRoot);\n\n    virtualTabSection.detach();\n    return isOverflowing;\n  }\n\n  private isOverflowing(el: HTMLElement) {\n    return el.clientWidth < el.scrollWidth;\n  }\n\n  private buildDropdownHeader(): Dom {\n    const dropdownHeader = $$('a', { className: `coveo-dropdown-header ${ResponsiveTabs.TAB_IN_DROPDOWN_HEADER_CSS_CLASS}` });\n    const content = $$('p');\n    content.text(this.dropdownHeaderLabel);\n    const icon = $$('span', { className: 'coveo-more-tabs' }, SVGIcons.icons.arrowDown);\n    SVGDom.addClassToSVGInContainer(icon.el, 'coveo-more-tabs-svg');\n    content.el.appendChild(icon.el);\n    dropdownHeader.el.appendChild(content.el);\n    return dropdownHeader;\n  }\n\n  private bindDropdownHeaderEvents() {\n    const toggle = (event: Event) => {\n      if (this.isDropdownOpen()) {\n        this.closeDropdown();\n      } else {\n        this.openDropdown();\n      }\n\n      if (event.type === 'click') {\n        this.ignoreNextDocumentClick = true;\n      }\n    };\n    new AccessibleButton()\n      .withElement(this.dropdownHeader)\n      .withSelectAction(toggle)\n      .withLabel(this.getDropdownHeaderLabel())\n      .build();\n  }\n\n  private buildDropdownContent() {\n    const dropdownContent = $$('div', {\n      className: 'coveo-tab-list-container ' + SearchInterface.SMALL_INTERFACE_CLASS_NAME\n    });\n    const contentList = $$('ol', { className: 'coveo-tab-list' });\n    dropdownContent.el.appendChild(contentList.el);\n    return dropdownContent;\n  }\n\n  private bindDropdownContentEvents() {\n    this.dropdownClickListener = () => {\n      if (this.isDropdownOpen()) {\n        this.ignoreNextDocumentClick = true;\n      }\n    };\n\n    this.documentClickListener = event => {\n      if (!this.ignoreNextDocumentClick) {\n        this.closeDropdown();\n      }\n      this.ignoreNextDocumentClick = false;\n    };\n    $$(this.dropdownHeader).on('click', this.dropdownClickListener);\n    $$(this.dropdownContent).on('click', this.dropdownClickListener);\n  }\n\n  private isDropdownOpen(): boolean {\n    return this.dropdownHeader.hasClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n  }\n\n  private closeDropdown(): void {\n    $$(document.documentElement).off('click', this.documentClickListener);\n    this.dropdownContent.detach();\n    this.dropdownHeader.removeClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n  }\n\n  private openDropdown(): void {\n    $$(document.documentElement).on('click', this.documentClickListener);\n    this.positionPopup();\n    this.dropdownHeader.addClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n  }\n\n  private addToDropdownIfNeeded(tab: HTMLElement) {\n    if (!this.canAddTabToDropdown(tab)) {\n      return;\n    }\n\n    $$(tab).addClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n    const list = $$(this.dropdownContent.find('ol'));\n    const listElement = $$('li', null, tab);\n    list.prepend(listElement.el);\n  }\n\n  private removeFromDropdownIfNeeded(tab: HTMLElement) {\n    if (!this.canRemoveTabFromDropdown(tab)) {\n      return;\n    }\n\n    $$(tab as HTMLElement).removeClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n    $$(tab.parentElement).detach();\n  }\n\n  private canAddTabToDropdown(tab: HTMLElement) {\n    return tab && !this.tabIsInDropdown(tab) && this.dropdownHeader;\n  }\n\n  private canRemoveTabFromDropdown(tab: HTMLElement) {\n    return tab && this.tabIsInDropdown(tab) && this.dropdownContent;\n  }\n\n  private cleanUpDropdown() {\n    this.dropdownHeader.removeClass(ResponsiveTabs.ACTIVE_DROPDOWN_CSS_CLASS);\n    this.dropdownHeader.detach();\n    this.dropdownContent.detach();\n  }\n\n  private isDropdownEmpty(): boolean {\n    if (this.dropdownContent) {\n      const tabs = this.dropdownContent.findAll('.CoveoTab');\n      return tabs.length == 0;\n    }\n    return false;\n  }\n\n  private manageTabSwapping() {\n    each(this.coveoRoot.findAll('.' + Component.computeCssClassNameForType(this.ID)), tabElement => {\n      const tab = $$(tabElement);\n      const fadeOutFadeIn = event => {\n        const lastTabInSection = this.tabsInTabSection.pop();\n\n        if (event.propertyName == 'opacity') {\n          if (tab.el.style.opacity == '0') {\n            $$(lastTabInSection).addClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n            tab.replaceWith(lastTabInSection);\n            tab.removeClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n\n            this.fromDropdownToTabSection(tab);\n\n            // Because of the DOM manipulation, sometimes the animation will not trigger. Accessing the computed styles makes sure\n            // the animation will happen.\n            window.getComputedStyle(tab.el).opacity;\n            window.getComputedStyle(lastTabInSection).opacity;\n\n            tab.el.style.opacity = lastTabInSection.style.opacity = '1';\n          } else if (tab.el.style.opacity == '1') {\n            this.closeDropdown();\n            EventsUtils.removePrefixedEvent(tab.el, 'TransitionEnd', fadeOutFadeIn);\n            this.handleResizeEvent();\n          }\n        }\n      };\n\n      const swapOnSelect = () => {\n        if (this.tabIsInDropdown(tab)) {\n          let lastTabInSection = this.tabsInTabSection.pop();\n          if (lastTabInSection) {\n            EventsUtils.addPrefixedEvent(tab.el, 'TransitionEnd', fadeOutFadeIn);\n            tab.el.style.opacity = lastTabInSection.style.opacity = '0';\n          }\n        }\n      };\n\n      tab.on('click', () => swapOnSelect());\n      tab.on('keyup', KeyboardUtils.keypressAction(KEYBOARD.ENTER, swapOnSelect));\n      tab.on('blur', (e: FocusEvent) => {\n        if (e.relatedTarget && !this.tabIsInDropdown(e.relatedTarget as HTMLElement)) {\n          this.closeDropdown();\n        }\n      });\n    });\n  }\n\n  private bindNukeEvents() {\n    $$(this.coveoRoot).on(InitializationEvents.nuke, () => {\n      $$(document.documentElement).off('click', this.documentClickListener);\n    });\n  }\n\n  private positionPopup() {\n    this.dropdownContent.insertAfter(this.dropdownHeader.el);\n\n    new Popper(this.dropdownHeader.el, this.dropdownContent.el, {\n      modifiers: {\n        preventOverflow: {\n          boundariesElement: this.coveoRoot.el\n        }\n      }\n    });\n  }\n\n  private fromDropdownToTabSection(tab: Dom) {\n    const lastTabInTabSection = last(this.tabsInTabSection);\n    if (!lastTabInTabSection) {\n      this.tabSection.prepend(tab.el);\n      return;\n    }\n\n    const comesAfterInitialTabOrder = this.initialTabOrder.indexOf(tab.el) > this.initialTabOrder.indexOf(lastTabInTabSection);\n    if (comesAfterInitialTabOrder) {\n      tab.insertAfter(lastTabInTabSection);\n    } else {\n      tab.insertBefore(lastTabInTabSection);\n    }\n  }\n\n  private getDropdownHeaderLabel() {\n    let dropdownHeaderLabel: string;\n    each($$(this.coveoRoot.find('.coveo-tab-section')).findAll('.' + Component.computeCssClassName(Tab)), tabElement => {\n      const tab = <Tab>Component.get(tabElement, Tab);\n      if (!dropdownHeaderLabel && tab && tab.options.dropdownHeaderLabel) {\n        dropdownHeaderLabel = tab.options.dropdownHeaderLabel;\n      }\n    });\n\n    if (!dropdownHeaderLabel) {\n      dropdownHeaderLabel = l(ResponsiveTabs.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE);\n    }\n\n    return dropdownHeaderLabel;\n  }\n\n  private tabIsSelected(tab: Dom | HTMLElement) {\n    return $$(tab as HTMLElement).hasClass('coveo-selected');\n  }\n\n  private tabIsInDropdown(tab: Dom | HTMLElement) {\n    return $$(tab as HTMLElement).hasClass(ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS);\n  }\n\n  private get tabsInTabSection(): HTMLElement[] {\n    const tabsInSection = [];\n    each(this.tabSection.children(), childElement => {\n      if (Utils.isHtmlElement(childElement)) {\n        const child = $$(childElement);\n        const childHasTabCssClassName = child.hasClass(Component.computeCssClassNameForType(this.ID));\n        if (!this.tabIsInDropdown(child) && childHasTabCssClassName) {\n          tabsInSection.push(child.el);\n        }\n      }\n    });\n    return tabsInSection;\n  }\n\n  private get tabsInTabDropdown(): HTMLElement[] {\n    if (!this.dropdownContent) {\n      return [];\n    }\n    return this.dropdownContent.findAll(`.${ResponsiveTabs.TAB_IN_DROPDOWN_CSS_CLASS}`);\n  }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/ResponsiveComponents/ResponsiveTabs.ts"],"sourceRoot":""}