{"version":3,"sources":["FacetsMobileMode.min__7d400a8f34d33214ce02.js","./src/ui/FacetsMobileMode/FacetsMobileMode.ts"],"names":["webpackJsonpCoveo__temporary","85","module","exports","__webpack_require__","__extends","this","extendStatics","Object","setPrototypeOf","__proto__","Array","d","b","p","hasOwnProperty","__","constructor","prototype","create","defineProperty","value","element","options","bindings","FacetsMobileMode","ID","ComponentOptions","initComponentOptions","preventScrolling","scrollContainer","searchInterface","findParentScrollLockable","_this","breakpoint","buildNumberOption","isModal","buildBooleanOption","defaultValue","displayOverlayWhileOpen","postProcessing","Utils","isNullOrUndefined","buildChildHtmlElementOption","depend","doExport","exportGlobally","Component","Initialization","registerAutoCreateComponent"],"mappings":"AAAAA,8BAA8B,IAExBC,GACA,SAAUC,EAAQC,EAASC,GAEjC,YAEA,IAAIC,GAAaC,MAAQA,KAAKD,WAAc,WACxC,GAAIE,GAAgBC,OAAOC,iBACpBC,uBAA2BC,QAAS,SAAUC,EAAGC,GAAKD,EAAEF,UAAYG,IACvE,SAAUD,EAAGC,GAAK,IAAK,GAAIC,KAAKD,GAAOA,EAAEE,eAAeD,KAAIF,EAAEE,GAAKD,EAAEC,IACzE,OAAO,UAAUF,EAAGC,GAEhB,QAASG,KAAOV,KAAKW,YAAcL,EADnCL,EAAcK,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaL,OAAOW,OAAON,IAAMG,EAAGE,UAAYL,EAAEK,UAAW,GAAIF,OAGvFR,QAAOY,eAAejB,EAAS,cAAgBkB,OAAO,GCjBtD,YACA,OAEA,OACA,QACA,OAqBA,cA0DE,WAAmBC,EAAsBC,EAAoCC,GAA7E,MACE,YAAMF,EAASG,EAAiBC,GAAIF,IAAS,IAG7C,IAJiB,EAAAF,UAGjB,EAAKC,QAAU,EAAAI,iBAAiBC,qBAAqBN,EAASG,EAAkBF,GAC5E,EAAKA,QAAQM,iBAAkB,CACjC,GAAMC,GAAkB,EAAKP,QAAQO,iBAAmB,EAAKC,gBAAgBT,OAC7E,GAAKC,QAAQO,gBAAkB,EAAAH,iBAAiBK,yBAAyBF,GDlDvE,MAAOG,GCqDf,MAnEsC,QAC7B,EAAAP,GAAK,mBAKL,EAAAH,SAMLW,WAAY,EAAAP,iBAAiBQ,oBAK7BC,QAAS,EAAAT,iBAAiBU,oBAAqBC,cAAc,IAQ7DC,wBAAyB,EAAAZ,iBAAiBU,oBACxCG,eAAgB,SAACnB,EAAOE,GAAsC,MAAC,GAAAkB,MAAMC,kBAAkBrB,IAAUE,EAAQa,QAAUf,KASrHQ,iBAAkB,EAAAF,iBAAiBU,oBACjCG,eAAgB,SAACnB,EAAOE,GAAsC,MAAC,GAAAkB,MAAMC,kBAAkBrB,GAASE,EAAQa,QAAUf,KAWpHS,gBAAiB,EAAAH,iBAAiBgB,6BAA8BC,OAAQ,sBAGnE,EAAAC,SAAW,WAChB,EAAAC,gBACErB,iBAAkBA,KAexB,GAnEsC,EAAAsB,UAAzB,GAAAtB,mBAqEb,EAAAuB,eAAeC,4BAA4BxB","file":"FacetsMobileMode.min__7d400a8f34d33214ce02.js","sourcesContent":["webpackJsonpCoveo__temporary([3],{\n\n/***/ 85:\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 });\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Core_1 = __webpack_require__(20);\nvar Initialization_1 = __webpack_require__(2);\n/**\n * This component lets you customize the mobile responsive behavior of facets in your search interface.\n *\n * **Notes:**\n * - You can include this component anywhere under the root element of your search interface.\n * - You should only include this component once in your search interface.\n */\nvar FacetsMobileMode = /** @class */ (function (_super) {\n    __extends(FacetsMobileMode, _super);\n    function FacetsMobileMode(element, options, bindings) {\n        var _this = _super.call(this, element, FacetsMobileMode.ID, bindings) || this;\n        _this.element = element;\n        _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, FacetsMobileMode, options);\n        if (_this.options.preventScrolling) {\n            var scrollContainer = _this.options.scrollContainer || _this.searchInterface.element;\n            _this.options.scrollContainer = ComponentOptions_1.ComponentOptions.findParentScrollLockable(scrollContainer);\n        }\n        return _this;\n    }\n    FacetsMobileMode.ID = 'FacetsMobileMode';\n    /**\n     * @componentOptions\n     */\n    FacetsMobileMode.options = {\n        /**\n         * The screen width (in number of pixels) at which facets should enter mobile responsive mode and be collapsed under a single button.\n         *\n         * **Default:** `800`\n         */\n        breakpoint: ComponentOptions_1.ComponentOptions.buildNumberOption(),\n        /**\n         * Whether to display the facets in a modal instead of a pop-up when the end user expands them in mobile responsive mode.\n         * Set this option to `false` in order to keep the old behaviour.\n         */\n        isModal: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true }),\n        /**\n         * Whether to display an overlay behind the facets when the end user expands them in mobile responsive mode.\n         *\n         * By default, the following behavior applies:\n         * - `true` when [isModal]{@link FacetsMobileMode.options.isModal} is `false`\n         * - `false` when [isModal]{@link FacetsMobileMode.options.isModal} is `true`\n         */\n        displayOverlayWhileOpen: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n            postProcessing: function (value, options) { return (Core_1.Utils.isNullOrUndefined(value) ? !options.isModal : value); }\n        }),\n        /**\n         * Whether to disable vertical scrolling on the specified or resolved [`scrollContainer`]{@link FacetsMobileMode.options.scrollContainer} while facets are expanded in mobile responsive mode.\n         *\n         * By default, the following behavior applies:\n         * - `true` when [isModal]{@link FacetsMobileMode.options.isModal} is `true`\n         * - `false` when [isModal]{@link FacetsMobileMode.options.isModal} is `false`\n         */\n        preventScrolling: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n            postProcessing: function (value, options) { return (Core_1.Utils.isNullOrUndefined(value) ? options.isModal : value); }\n        }),\n        /**\n         * The HTML element whose vertical scrolling should be locked while facets are expanded in mobile responsive mode.\n         *\n         * By default, the component tries to detect and use the first ancestor element whose CSS `overflow-y` attribute is set to `scroll`, starting from the `FacetsMobileMode`'s element itself. If no such element is found, the `document.body` element is used.\n         *\n         * Since this heuristic is not perfect, we strongly recommend that you manually set this option by explicitly specifying the desired CSS selector.\n         *\n         * **Example:** `data-scroll-container-selector='#someCssSelector'`\n         */\n        scrollContainer: ComponentOptions_1.ComponentOptions.buildChildHtmlElementOption({ depend: 'preventScrolling' })\n    };\n    FacetsMobileMode.doExport = function () {\n        GlobalExports_1.exportGlobally({\n            FacetsMobileMode: FacetsMobileMode\n        });\n    };\n    return FacetsMobileMode;\n}(Component_1.Component));\nexports.FacetsMobileMode = FacetsMobileMode;\nInitialization_1.Initialization.registerAutoCreateComponent(FacetsMobileMode);\n\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// FacetsMobileMode.min__7d400a8f34d33214ce02.js","import { Component } from '../Base/Component';\nimport { ComponentOptions } from '../Base/ComponentOptions';\nimport { IComponentBindings } from '../Base/ComponentBindings';\nimport { exportGlobally } from '../../GlobalExports';\nimport { Utils } from '../../Core';\nimport { Initialization } from '../Base/Initialization';\n\nexport interface IFacetsMobileModeConstructor {\n  new (element: HTMLElement, options: IFacetsMobileModeOptions, bindings: IComponentBindings): FacetsMobileMode;\n}\n\nexport interface IFacetsMobileModeOptions {\n  breakpoint?: number;\n  isModal?: boolean;\n  displayOverlayWhileOpen?: boolean;\n  preventScrolling?: boolean;\n  scrollContainer?: HTMLElement;\n}\n\n/**\n * This component lets you customize the mobile responsive behavior of facets in your search interface.\n *\n * **Notes:**\n * - You can include this component anywhere under the root element of your search interface.\n * - You should only include this component once in your search interface.\n */\nexport class FacetsMobileMode extends Component {\n  static ID = 'FacetsMobileMode';\n\n  /**\n   * @componentOptions\n   */\n  static options: IFacetsMobileModeOptions = {\n    /**\n     * The screen width (in number of pixels) at which facets should enter mobile responsive mode and be collapsed under a single button.\n     *\n     * **Default:** `800`\n     */\n    breakpoint: ComponentOptions.buildNumberOption(),\n    /**\n     * Whether to display the facets in a modal instead of a pop-up when the end user expands them in mobile responsive mode.\n     * Set this option to `false` in order to keep the old behaviour.\n     */\n    isModal: ComponentOptions.buildBooleanOption({ defaultValue: true }),\n    /**\n     * Whether to display an overlay behind the facets when the end user expands them in mobile responsive mode.\n     *\n     * By default, the following behavior applies:\n     * - `true` when [isModal]{@link FacetsMobileMode.options.isModal} is `false`\n     * - `false` when [isModal]{@link FacetsMobileMode.options.isModal} is `true`\n     */\n    displayOverlayWhileOpen: ComponentOptions.buildBooleanOption({\n      postProcessing: (value, options: IFacetsMobileModeOptions) => (Utils.isNullOrUndefined(value) ? !options.isModal : value)\n    }),\n    /**\n     * Whether to disable vertical scrolling on the specified or resolved [`scrollContainer`]{@link FacetsMobileMode.options.scrollContainer} while facets are expanded in mobile responsive mode.\n     *\n     * By default, the following behavior applies:\n     * - `true` when [isModal]{@link FacetsMobileMode.options.isModal} is `true`\n     * - `false` when [isModal]{@link FacetsMobileMode.options.isModal} is `false`\n     */\n    preventScrolling: ComponentOptions.buildBooleanOption({\n      postProcessing: (value, options: IFacetsMobileModeOptions) => (Utils.isNullOrUndefined(value) ? options.isModal : value)\n    }),\n    /**\n     * The HTML element whose vertical scrolling should be locked while facets are expanded in mobile responsive mode.\n     *\n     * By default, the component tries to detect and use the first ancestor element whose CSS `overflow-y` attribute is set to `scroll`, starting from the `FacetsMobileMode`'s element itself. If no such element is found, the `document.body` element is used.\n     *\n     * Since this heuristic is not perfect, we strongly recommend that you manually set this option by explicitly specifying the desired CSS selector.\n     *\n     * **Example:** `data-scroll-container-selector='#someCssSelector'`\n     */\n    scrollContainer: ComponentOptions.buildChildHtmlElementOption({ depend: 'preventScrolling' })\n  };\n\n  static doExport = () => {\n    exportGlobally({\n      FacetsMobileMode: FacetsMobileMode\n    });\n  };\n\n  public options: IFacetsMobileModeOptions;\n\n  constructor(public element: HTMLElement, options?: IFacetsMobileModeOptions, bindings?: IComponentBindings) {\n    super(element, FacetsMobileMode.ID, bindings);\n\n    this.options = ComponentOptions.initComponentOptions(element, FacetsMobileMode, options);\n    if (this.options.preventScrolling) {\n      const scrollContainer = this.options.scrollContainer || this.searchInterface.element;\n      this.options.scrollContainer = ComponentOptions.findParentScrollLockable(scrollContainer);\n    }\n  }\n}\n\nInitialization.registerAutoCreateComponent(FacetsMobileMode);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/FacetsMobileMode/FacetsMobileMode.ts"],"sourceRoot":""}