{"version":3,"sources":["ResultsPreferences.min__d67acfe80778de2e04cc.js","./src/ui/FormWidgets/FormGroup.ts","./src/ui/ResultsPreferences/ResultsPreferences.ts","./src/ui/FormWidgets/RadioButton.ts"],"names":["webpackJsonpCoveo__temporary","139","module","exports","__webpack_require__","Object","defineProperty","value","contents","label","this","labelElement","$$","className","text","element","_","each","content","append","build","doExport","exportGlobally","FormGroup","el","277","__extends","extendStatics","setPrototypeOf","__proto__","Array","d","b","p","hasOwnProperty","__","constructor","prototype","create","options","bindings","ResultsPreferences","ID","preferencePanelCheckboxInputs","preferencePanelRadioInputs","ComponentOptions","initComponentOptions","preferencesPanel","closest","Component","computeCssClassNameForType","preferencePanelLocalStorage","StorageUtils","Assert","exists","componentOptionsModel","preferences","load","adjustPreferencesToComponentConfig","updateComponentOptionsModel","bind","on","PreferencesPanelEvents","savePreferences","save","exitPreferencesWithoutSave","exitWithoutSave","buildCheckboxesInput","buildRadiosInput","_this","fromInputToPreferences","logger","info","fromPreferencesToCheckboxInput","resultLinkOption","pick","searchBoxOption","set","ComponentOptionsModel","attributesEnum","resultLink","searchBox","enableQuerySyntax","RadioButton","radioButtonInstance","fromPreferenceChangeEventToUsageAnalyticsLog","isSelected","queryController","executeQuery","closeModalBox","translatedLabels","map","l","radios","radio","formGroup","fromPreferencesToRadioInput","createCheckbox","checkbox","Checkbox","checkboxInstance","checkboxes","enableOpenInOutlook","push","enableOpenInNewWindow","appendChild","openInOutlook","alwaysOpenInNewWindow","undefined","select","type","preference","usageAnalytics","logCustomEvent","analyticsActionCauseList","preferencesChange","preferenceName","preferenceType","logSearchEvent","needToSave","Defer","defer","checkingFor","input","buildBooleanOption","defaultValue","Initialization","registerAutoCreateComponent","560","566","667","98","onChange","name","id","radioButton","buildContent","reset","currentlySelected","getRadio","checked","triggerChange","getElement","getValue","find","getLabel","radioOption","radioInput","labelInput","for"],"mappings":"AAAAA,8BAA8B,GAAG,GAAG,KAE9BC,IACA,SAAUC,EAAQC,EAASC,GAEjC,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AU,MAAP,WACE,MAAOV,MAAKK,SAOP,YAAA+H,WAAP,WACE,MAAOpI,MAAKK,SAGP,YAAAgI,SAAP,WACE,MAAOrI,MAAKD,OAOP,YAAA6E,WAAP,WACE,MAAO5E,MAAKiI,WAAWC,SAOlB,YAAAD,SAAP,WACE,MAAyB,GAAA/H,GAAGF,KAAKK,SAASiI,KAAK,UAO1C,YAAAC,SAAP,WACE,MAAyB,GAAArI,GAAGF,KAAKK,SAASiI,KAAK,UAGzC,YAAAR,aAAR,sBACQU,EAAc,EAAAtI,GAAG,OAASC,UAAW,gBACrCsI,EAAa,EAAAvI,GAAG,SAAWkG,KAAM,QAASuB,KAAM3H,KAAK2H,KAAMC,GAAI5H,KAAK4H,KACpEc,EAAa,EAAAxI,GAAG,SAAWC,UAAW,0BAA2BwI,IAAK3I,KAAK4H,IACjFc,GAAWtI,KAAKJ,KAAKD,OACrB0I,EAAWtF,GAAG,SAAU,WACtB,EAAKuE,SAAS,KAGhBc,EAAY/H,OAAOgI,EAAW3H,IAC9B0H,EAAY/H,OAAOiI,EAAW5H,IAC9Bd,KAAKK,QAAUmI,EAAY1H,IAE/B,IAzGa,GAAA2D","file":"ResultsPreferences.min__d67acfe80778de2e04cc.js","sourcesContent":["webpackJsonpCoveo__temporary([25,56,58],{\n\n/***/ 139:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom_1 = __webpack_require__(1);\nvar _ = __webpack_require__(0);\n__webpack_require__(566);\nvar GlobalExports_1 = __webpack_require__(3);\n/**\n * A simple `fieldset` HTMLElement containing multiple form widgets.\n */\nvar FormGroup = /** @class */ (function () {\n /**\n * Creates a new `FormGroup`.\n * @param contents The form widgets to include in the form group.\n * @param label The label to display for the form group.\n */\n function FormGroup(contents, label) {\n var _this = this;\n this.labelElement = Dom_1.$$('span', { className: 'coveo-form-group-label' });\n this.labelElement.text(label);\n this.element = Dom_1.$$('fieldset', { className: 'coveo-form-group' }, this.labelElement);\n _.each(contents, function (content) {\n _this.element.append(content.build());\n });\n }\n FormGroup.doExport = function () {\n GlobalExports_1.exportGlobally({\n FormGroup: FormGroup\n });\n };\n /**\n * Gets the element on which the form group is bound.\n * @returns {HTMLElement} The form group element.\n */\n FormGroup.prototype.build = function () {\n return this.element.el;\n };\n return FormGroup;\n}());\nexports.FormGroup = FormGroup;\n\n\n/***/ }),\n\n/***/ 277:\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__(667);\nvar _ = __webpack_require__(0);\nvar PreferencesPanelEvents_1 = __webpack_require__(100);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Assert_1 = __webpack_require__(5);\nvar Defer_1 = __webpack_require__(31);\nvar ComponentOptionsModel_1 = __webpack_require__(28);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar StorageUtils_1 = __webpack_require__(208);\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 Checkbox_1 = __webpack_require__(65);\nvar FormGroup_1 = __webpack_require__(139);\nvar RadioButton_1 = __webpack_require__(98);\n/**\n * The ResultsPreferences component allows the end user to select preferences related to the search results. These\n * preferences are then saved in the local storage of the end user.\n *\n * This component is normally accessible through the {@link Settings} menu. Its usual location in the DOM is inside the\n * {@link PreferencesPanel} component.\n *\n * See also the {@link ResultsFiltersPreferences} component.\n */\nvar ResultsPreferences = /** @class */ (function (_super) {\n __extends(ResultsPreferences, _super);\n /**\n * Creates a new ResultsPreference component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the ResultsPreferences 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 ResultsPreferences(element, options, bindings) {\n var _this = _super.call(this, element, ResultsPreferences.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.bindings = bindings;\n _this.preferencePanelCheckboxInputs = {};\n _this.preferencePanelRadioInputs = {};\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, ResultsPreferences, options);\n _this.preferencesPanel = Dom_1.$$(_this.element).closest(Component_1.Component.computeCssClassNameForType('PreferencesPanel'));\n _this.preferencePanelLocalStorage = new StorageUtils_1.StorageUtils(ResultsPreferences.ID);\n Assert_1.Assert.exists(_this.componentOptionsModel);\n Assert_1.Assert.exists(_this.preferencesPanel);\n _this.preferences = _this.preferencePanelLocalStorage.load() || {};\n _this.adjustPreferencesToComponentConfig();\n ComponentOptions_1.ComponentOptions.initComponentOptions(_this.element, ResultsPreferences, _this.options);\n _this.updateComponentOptionsModel();\n _this.bind.on(_this.preferencesPanel, PreferencesPanelEvents_1.PreferencesPanelEvents.savePreferences, function () { return _this.save(); });\n _this.bind.on(_this.preferencesPanel, PreferencesPanelEvents_1.PreferencesPanelEvents.exitPreferencesWithoutSave, function () { return _this.exitWithoutSave(); });\n _this.buildCheckboxesInput();\n _this.buildRadiosInput();\n return _this;\n }\n /**\n * Saves the current state of the ResultsPreferences component in the local storage.\n */\n ResultsPreferences.prototype.save = function () {\n this.fromInputToPreferences();\n this.logger.info('Saving preferences', this.preferences);\n this.preferencePanelLocalStorage.save(this.preferences);\n this.updateComponentOptionsModel();\n };\n ResultsPreferences.prototype.exitWithoutSave = function () {\n this.fromPreferencesToCheckboxInput();\n };\n ResultsPreferences.prototype.updateComponentOptionsModel = function () {\n var resultLinkOption = _.pick(this.preferences, 'openInOutlook', 'alwaysOpenInNewWindow');\n var searchBoxOption = _.pick(this.preferences, 'enableQuerySyntax');\n this.componentOptionsModel.set(ComponentOptionsModel_1.ComponentOptionsModel.attributesEnum.resultLink, resultLinkOption);\n this.componentOptionsModel.set(ComponentOptionsModel_1.ComponentOptionsModel.attributesEnum.searchBox, searchBoxOption);\n };\n ResultsPreferences.prototype.buildRadiosInput = function () {\n var _this = this;\n if (this.options.enableQuerySyntax) {\n var createRadioButton_1 = function (label) {\n var radio = new RadioButton_1.RadioButton(function (radioButtonInstance) {\n _this.fromPreferenceChangeEventToUsageAnalyticsLog(radioButtonInstance.isSelected() ? 'selected' : 'unselected', label);\n _this.save();\n _this.queryController.executeQuery({\n closeModalBox: false\n });\n }, label, 'coveo-results-preferences-query-syntax');\n return radio;\n };\n var translatedLabels = _.map(['On', 'Off', 'Automatic'], function (label) { return Strings_1.l(label); });\n var radios = _.map(translatedLabels, function (label) {\n var radio = createRadioButton_1(label);\n _this.preferencePanelRadioInputs[label] = radio;\n return radio;\n });\n var formGroup = new FormGroup_1.FormGroup(radios, Strings_1.l('EnableQuerySyntax'));\n Dom_1.$$(this.element).append(formGroup.build());\n this.fromPreferencesToRadioInput();\n }\n };\n ResultsPreferences.prototype.buildCheckboxesInput = function () {\n var _this = this;\n var createCheckbox = function (label) {\n var checkbox = new Checkbox_1.Checkbox(function (checkboxInstance) {\n _this.fromPreferenceChangeEventToUsageAnalyticsLog(checkboxInstance.isSelected() ? 'selected' : 'unselected', label);\n _this.save();\n _this.queryController.executeQuery({\n closeModalBox: false\n });\n }, label);\n _this.preferencePanelCheckboxInputs[label] = checkbox;\n return checkbox;\n };\n var checkboxes = [];\n if (this.options.enableOpenInOutlook) {\n checkboxes.push(createCheckbox(Strings_1.l('OpenInOutlookWhenPossible')));\n }\n if (this.options.enableOpenInNewWindow) {\n checkboxes.push(createCheckbox(Strings_1.l('AlwaysOpenInNewWindow')));\n }\n this.element.appendChild(new FormGroup_1.FormGroup(checkboxes, Strings_1.l('ResultLinks')).build());\n this.fromPreferencesToCheckboxInput();\n };\n ResultsPreferences.prototype.fromInputToPreferences = function () {\n var _this = this;\n this.preferences = this.preferences || {\n openInOutlook: false,\n alwaysOpenInNewWindow: false,\n enableQuerySyntax: undefined\n };\n _.each(this.preferencePanelCheckboxInputs, function (checkbox, label) {\n if (label == Strings_1.l('OpenInOutlookWhenPossible')) {\n if (_this.isSelected(Strings_1.l('OpenInOutlookWhenPossible'), label, checkbox)) {\n _this.preferences.openInOutlook = true;\n }\n else if (_this.preferences.openInOutlook != null) {\n _this.preferences.openInOutlook = false;\n }\n }\n if (label == Strings_1.l('AlwaysOpenInNewWindow')) {\n if (_this.isSelected(Strings_1.l('AlwaysOpenInNewWindow'), label, checkbox)) {\n _this.preferences.alwaysOpenInNewWindow = true;\n }\n else if (_this.preferences.alwaysOpenInNewWindow != null) {\n _this.preferences.alwaysOpenInNewWindow = false;\n }\n }\n });\n _.each(this.preferencePanelRadioInputs, function (radio, label) {\n if (_this.isSelected(Strings_1.l('On'), label, radio)) {\n _this.preferences.enableQuerySyntax = true;\n }\n if (_this.isSelected(Strings_1.l('Off'), label, radio)) {\n _this.preferences.enableQuerySyntax = false;\n }\n if (_this.isSelected(Strings_1.l('Automatic'), label, radio)) {\n delete _this.preferences.enableQuerySyntax;\n }\n });\n };\n ResultsPreferences.prototype.fromPreferencesToCheckboxInput = function () {\n if (this.preferences.openInOutlook) {\n this.preferencePanelCheckboxInputs[Strings_1.l('OpenInOutlookWhenPossible')].select(false);\n }\n if (this.preferences.alwaysOpenInNewWindow) {\n this.preferencePanelCheckboxInputs[Strings_1.l('AlwaysOpenInNewWindow')].select(false);\n }\n };\n ResultsPreferences.prototype.fromPreferencesToRadioInput = function () {\n if (this.preferences.enableQuerySyntax === true) {\n this.preferencePanelRadioInputs[Strings_1.l('On')].select(false);\n }\n else if (this.preferences.enableQuerySyntax === false) {\n this.preferencePanelRadioInputs[Strings_1.l('Off')].select(false);\n }\n else {\n this.preferencePanelRadioInputs[Strings_1.l('Automatic')].select(false);\n }\n };\n ResultsPreferences.prototype.fromPreferenceChangeEventToUsageAnalyticsLog = function (type, preference) {\n this.usageAnalytics.logCustomEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.preferencesChange, { preferenceName: preference, preferenceType: type }, this.element);\n this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.preferencesChange, {\n preferenceName: preference,\n preferenceType: type\n });\n };\n ResultsPreferences.prototype.adjustPreferencesToComponentConfig = function () {\n var _this = this;\n // This method is used when there are illogical configuration between what's saved in local storage (the preferences)\n // and how the component is configured.\n // This can happen if an admin change the component configuration after end users have already selected a preferences.\n // We need to adapt the saved preferences to what's actually available in the component\n var needToSave = false;\n if (!this.options.enableOpenInNewWindow) {\n delete this.preferences.alwaysOpenInNewWindow;\n needToSave = true;\n }\n if (!this.options.enableOpenInOutlook) {\n delete this.preferences.openInOutlook;\n needToSave = true;\n }\n if (!this.options.enableQuerySyntax) {\n delete this.preferences.enableQuerySyntax;\n needToSave = true;\n }\n if (needToSave) {\n Defer_1.Defer.defer(function () {\n _this.save();\n });\n }\n };\n ResultsPreferences.prototype.isSelected = function (checkingFor, label, input) {\n return checkingFor == label && input.isSelected();\n };\n ResultsPreferences.ID = 'ResultsPreferences';\n ResultsPreferences.doExport = function () {\n GlobalExports_1.exportGlobally({\n ResultsPreferences: ResultsPreferences\n });\n };\n /**\n * The options for the component\n * @componentOptions\n */\n ResultsPreferences.options = {\n /**\n * Specifies whether to make the option to open results in Microsoft Outlook available.\n *\n * Default value is `false`\n */\n enableOpenInOutlook: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false }),\n /**\n * Specifies whether to make the option to open results in a new window available.\n *\n * Default value is `true`\n */\n enableOpenInNewWindow: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true }),\n /**\n * Specifies whether to make the option to allow end users to turn query syntax on or off available.\n *\n * If query syntax is enabled, the Coveo Platform tries to interpret special query syntax (e.g.,\n * `@objecttype=message`) when the end user types a query in the [`Querybox`]{@link Querybox} (see\n * [Coveo Query Syntax Reference](https://docs.coveo.com/en/1552/searching-with-coveo/coveo-cloud-query-syntax)). Enabling query\n * syntax also causes the `Querybox` to highlight any query syntax.\n *\n * Selecting **On** for the **Enable query syntax** setting enables query syntax, whereas selecting **Off** disables\n * it. Selecting **Automatic** uses the `Querybox` [`enableQuerySyntax`]{@link Querybox.options.enableQuerySyntax}\n * option value (which is `false` by default).\n *\n * Default value is `false`\n */\n enableQuerySyntax: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false })\n };\n return ResultsPreferences;\n}(Component_1.Component));\nexports.ResultsPreferences = ResultsPreferences;\nInitialization_1.Initialization.registerAutoCreateComponent(ResultsPreferences);\n\n\n/***/ }),\n\n/***/ 560:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 566:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 667:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 98:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom_1 = __webpack_require__(1);\n__webpack_require__(560);\nvar GlobalExports_1 = __webpack_require__(3);\n/**\n * A radio button widget with standard styling.\n */\nvar RadioButton = /** @class */ (function () {\n /**\n * Creates a new `RadioButton`.\n * @param onChange The function to call when the radio button value changes. This function takes the current\n * `RadioButton` instance as an argument.\n * @param label The label to display next to the radio button.\n * @param name The value to set the `input` HTMLElement `name` attribute to.\n */\n function RadioButton(onChange, label, name, id) {\n if (onChange === void 0) { onChange = function (radioButton) { }; }\n if (id === void 0) { id = label; }\n this.onChange = onChange;\n this.label = label;\n this.name = name;\n this.id = id;\n this.buildContent();\n }\n RadioButton.doExport = function () {\n GlobalExports_1.exportGlobally({\n RadioButton: RadioButton\n });\n };\n /**\n * Resets the radio button.\n */\n RadioButton.prototype.reset = function () {\n var currentlySelected = this.isSelected();\n this.getRadio().checked = false;\n if (currentlySelected) {\n this.onChange(this);\n }\n };\n /**\n * Select the radio button\n * @param triggerChange will trigger change event if specified and the radio button is not already selected\n */\n RadioButton.prototype.select = function (triggerChange) {\n if (triggerChange === void 0) { triggerChange = true; }\n var currentlySelected = this.isSelected();\n this.getRadio().checked = true;\n if (!currentlySelected && triggerChange) {\n this.onChange(this);\n }\n };\n /**\n * Gets the element on which the radio button is bound.\n * @returns {HTMLElement} The radio button element.\n */\n RadioButton.prototype.build = function () {\n return this.element;\n };\n /**\n * Gets the element on which the radio button is bound.\n * @returns {HTMLElement} The radio button element.\n */\n RadioButton.prototype.getElement = function () {\n return this.element;\n };\n RadioButton.prototype.getValue = function () {\n return this.label;\n };\n /**\n * Indicates whether the radio button is selected.\n * @returns {boolean} `true` if the radio button is selected, `false` otherwise.\n */\n RadioButton.prototype.isSelected = function () {\n return this.getRadio().checked;\n };\n /**\n * Gets the `input` element (the radio button itself).\n * @returns {HTMLInputElement} The `input` element.\n */\n RadioButton.prototype.getRadio = function () {\n return Dom_1.$$(this.element).find('input');\n };\n /**\n * Gets the radio button [`label`]{@link RadioButton.label} element.\n * @returns {HTMLLabelElement} The `label` element.\n */\n RadioButton.prototype.getLabel = function () {\n return Dom_1.$$(this.element).find('label');\n };\n RadioButton.prototype.buildContent = function () {\n var _this = this;\n var radioOption = Dom_1.$$('div', { className: 'coveo-radio' });\n var radioInput = Dom_1.$$('input', { type: 'radio', name: this.name, id: this.id });\n var labelInput = Dom_1.$$('label', { className: 'coveo-radio-input-label', for: this.id });\n labelInput.text(this.label);\n radioInput.on('change', function () {\n _this.onChange(_this);\n });\n radioOption.append(radioInput.el);\n radioOption.append(labelInput.el);\n this.element = radioOption.el;\n };\n return RadioButton;\n}());\nexports.RadioButton = RadioButton;\n\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// ResultsPreferences.min__d67acfe80778de2e04cc.js","import { IFormWidget } from './FormWidgets';\nimport { Dom, $$ } from '../../utils/Dom';\nimport * as _ from 'underscore';\n\nimport 'styling/vapor/_FormGroup';\nimport { exportGlobally } from '../../GlobalExports';\n\n/**\n * A simple `fieldset` HTMLElement containing multiple form widgets.\n */\nexport class FormGroup {\n private element: Dom;\n public labelElement: Dom;\n\n static doExport() {\n exportGlobally({\n FormGroup: FormGroup\n });\n }\n\n /**\n * Creates a new `FormGroup`.\n * @param contents The form widgets to include in the form group.\n * @param label The label to display for the form group.\n */\n constructor(contents: IFormWidget[], label: string) {\n this.labelElement = $$('span', { className: 'coveo-form-group-label' });\n this.labelElement.text(label);\n this.element = $$('fieldset', { className: 'coveo-form-group' }, this.labelElement);\n _.each(contents, (content: IFormWidget) => {\n this.element.append(content.build());\n });\n }\n\n /**\n * Gets the element on which the form group is bound.\n * @returns {HTMLElement} The form group element.\n */\n public build(): HTMLElement {\n return this.element.el;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/FormWidgets/FormGroup.ts","import 'styling/_ResultsPreferences';\nimport * as _ from 'underscore';\nimport { PreferencesPanelEvents } from '../../events/PreferencesPanelEvents';\nimport { exportGlobally } from '../../GlobalExports';\nimport { Assert } from '../../misc/Assert';\nimport { Defer } from '../../misc/Defer';\nimport { ComponentOptionsModel } from '../../models/ComponentOptionsModel';\nimport { l } from '../../strings/Strings';\nimport { $$ } from '../../utils/Dom';\nimport { StorageUtils } from '../../utils/StorageUtils';\nimport { analyticsActionCauseList, IAnalyticsPreferencesChangeMeta } from '../Analytics/AnalyticsActionListMeta';\nimport { Component } from '../Base/Component';\nimport { IComponentBindings } from '../Base/ComponentBindings';\nimport { ComponentOptions } from '../Base/ComponentOptions';\nimport { Initialization } from '../Base/Initialization';\nimport { Checkbox } from '../FormWidgets/Checkbox';\nimport { FormGroup } from '../FormWidgets/FormGroup';\nimport { IFormWidgetSelectable } from '../FormWidgets/FormWidgets';\nimport { RadioButton } from '../FormWidgets/RadioButton';\n\nexport interface IResultsPreferencesOptions {\n enableOpenInOutlook?: boolean;\n enableOpenInNewWindow?: boolean;\n enableQuerySyntax?: boolean;\n}\n\nexport interface IPossiblePreferences {\n openInOutlook?: boolean;\n alwaysOpenInNewWindow?: boolean;\n enableQuerySyntax?: boolean;\n}\n\n/**\n * The ResultsPreferences component allows the end user to select preferences related to the search results. These\n * preferences are then saved in the local storage of the end user.\n *\n * This component is normally accessible through the {@link Settings} menu. Its usual location in the DOM is inside the\n * {@link PreferencesPanel} component.\n *\n * See also the {@link ResultsFiltersPreferences} component.\n */\nexport class ResultsPreferences extends Component {\n static ID = 'ResultsPreferences';\n\n static doExport = () => {\n exportGlobally({\n ResultsPreferences: ResultsPreferences\n });\n };\n\n /**\n * The options for the component\n * @componentOptions\n */\n static options: IResultsPreferencesOptions = {\n /**\n * Specifies whether to make the option to open results in Microsoft Outlook available.\n *\n * Default value is `false`\n */\n enableOpenInOutlook: ComponentOptions.buildBooleanOption({ defaultValue: false }),\n /**\n * Specifies whether to make the option to open results in a new window available.\n *\n * Default value is `true`\n */\n enableOpenInNewWindow: ComponentOptions.buildBooleanOption({ defaultValue: true }),\n /**\n * Specifies whether to make the option to allow end users to turn query syntax on or off available.\n *\n * If query syntax is enabled, the Coveo Platform tries to interpret special query syntax (e.g.,\n * `@objecttype=message`) when the end user types a query in the [`Querybox`]{@link Querybox} (see\n * [Coveo Query Syntax Reference](https://docs.coveo.com/en/1552/searching-with-coveo/coveo-cloud-query-syntax)). Enabling query\n * syntax also causes the `Querybox` to highlight any query syntax.\n *\n * Selecting **On** for the **Enable query syntax** setting enables query syntax, whereas selecting **Off** disables\n * it. Selecting **Automatic** uses the `Querybox` [`enableQuerySyntax`]{@link Querybox.options.enableQuerySyntax}\n * option value (which is `false` by default).\n *\n * Default value is `false`\n */\n enableQuerySyntax: ComponentOptions.buildBooleanOption({ defaultValue: false })\n };\n\n public preferences: IPossiblePreferences;\n private preferencePanelLocalStorage: StorageUtils;\n private preferencesPanel: HTMLElement;\n private preferencePanelCheckboxInputs: { [label: string]: Checkbox } = {};\n private preferencePanelRadioInputs: { [label: string]: RadioButton } = {};\n\n /**\n * Creates a new ResultsPreference component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the ResultsPreferences 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: IResultsPreferencesOptions, public bindings: IComponentBindings) {\n super(element, ResultsPreferences.ID, bindings);\n\n this.options = ComponentOptions.initComponentOptions(element, ResultsPreferences, options);\n\n this.preferencesPanel = $$(this.element).closest(Component.computeCssClassNameForType('PreferencesPanel'));\n this.preferencePanelLocalStorage = new StorageUtils(ResultsPreferences.ID);\n Assert.exists(this.componentOptionsModel);\n Assert.exists(this.preferencesPanel);\n\n this.preferences = this.preferencePanelLocalStorage.load() || {};\n this.adjustPreferencesToComponentConfig();\n\n ComponentOptions.initComponentOptions(this.element, ResultsPreferences, this.options);\n\n this.updateComponentOptionsModel();\n\n this.bind.on(this.preferencesPanel, PreferencesPanelEvents.savePreferences, () => this.save());\n this.bind.on(this.preferencesPanel, PreferencesPanelEvents.exitPreferencesWithoutSave, () => this.exitWithoutSave());\n this.buildCheckboxesInput();\n this.buildRadiosInput();\n }\n\n /**\n * Saves the current state of the ResultsPreferences component in the local storage.\n */\n public save() {\n this.fromInputToPreferences();\n this.logger.info('Saving preferences', this.preferences);\n this.preferencePanelLocalStorage.save(this.preferences);\n this.updateComponentOptionsModel();\n }\n\n public exitWithoutSave() {\n this.fromPreferencesToCheckboxInput();\n }\n\n private updateComponentOptionsModel() {\n const resultLinkOption = _.pick(this.preferences, 'openInOutlook', 'alwaysOpenInNewWindow');\n const searchBoxOption = _.pick(this.preferences, 'enableQuerySyntax');\n this.componentOptionsModel.set(ComponentOptionsModel.attributesEnum.resultLink, resultLinkOption);\n this.componentOptionsModel.set(ComponentOptionsModel.attributesEnum.searchBox, searchBoxOption);\n }\n\n private buildRadiosInput() {\n if (this.options.enableQuerySyntax) {\n const createRadioButton = (label: string) => {\n const radio = new RadioButton(\n radioButtonInstance => {\n this.fromPreferenceChangeEventToUsageAnalyticsLog(radioButtonInstance.isSelected() ? 'selected' : 'unselected', label);\n this.save();\n\n this.queryController.executeQuery({\n closeModalBox: false\n });\n },\n label,\n 'coveo-results-preferences-query-syntax'\n );\n return radio;\n };\n\n const translatedLabels = _.map(['On', 'Off', 'Automatic'], label => l(label));\n const radios = _.map(translatedLabels, label => {\n const radio = createRadioButton(label);\n this.preferencePanelRadioInputs[label] = radio;\n return radio;\n });\n\n const formGroup = new FormGroup(radios, l('EnableQuerySyntax'));\n $$(this.element).append(formGroup.build());\n this.fromPreferencesToRadioInput();\n }\n }\n\n private buildCheckboxesInput() {\n const createCheckbox = (label: string) => {\n const checkbox = new Checkbox(checkboxInstance => {\n this.fromPreferenceChangeEventToUsageAnalyticsLog(checkboxInstance.isSelected() ? 'selected' : 'unselected', label);\n this.save();\n this.queryController.executeQuery({\n closeModalBox: false\n });\n }, label);\n this.preferencePanelCheckboxInputs[label] = checkbox;\n return checkbox;\n };\n\n const checkboxes: Checkbox[] = [];\n\n if (this.options.enableOpenInOutlook) {\n checkboxes.push(createCheckbox(l('OpenInOutlookWhenPossible')));\n }\n if (this.options.enableOpenInNewWindow) {\n checkboxes.push(createCheckbox(l('AlwaysOpenInNewWindow')));\n }\n\n this.element.appendChild(new FormGroup(checkboxes, l('ResultLinks')).build());\n this.fromPreferencesToCheckboxInput();\n }\n\n private fromInputToPreferences() {\n this.preferences = this.preferences || {\n openInOutlook: false,\n alwaysOpenInNewWindow: false,\n enableQuerySyntax: undefined\n };\n\n _.each(this.preferencePanelCheckboxInputs, (checkbox: Checkbox, label: string) => {\n if (label == l('OpenInOutlookWhenPossible')) {\n if (this.isSelected(l('OpenInOutlookWhenPossible'), label, checkbox)) {\n this.preferences.openInOutlook = true;\n } else if (this.preferences.openInOutlook != null) {\n this.preferences.openInOutlook = false;\n }\n }\n if (label == l('AlwaysOpenInNewWindow')) {\n if (this.isSelected(l('AlwaysOpenInNewWindow'), label, checkbox)) {\n this.preferences.alwaysOpenInNewWindow = true;\n } else if (this.preferences.alwaysOpenInNewWindow != null) {\n this.preferences.alwaysOpenInNewWindow = false;\n }\n }\n });\n\n _.each(this.preferencePanelRadioInputs, (radio: RadioButton, label: string) => {\n if (this.isSelected(l('On'), label, radio)) {\n this.preferences.enableQuerySyntax = true;\n }\n if (this.isSelected(l('Off'), label, radio)) {\n this.preferences.enableQuerySyntax = false;\n }\n if (this.isSelected(l('Automatic'), label, radio)) {\n delete this.preferences.enableQuerySyntax;\n }\n });\n }\n\n private fromPreferencesToCheckboxInput() {\n if (this.preferences.openInOutlook) {\n this.preferencePanelCheckboxInputs[l('OpenInOutlookWhenPossible')].select(false);\n }\n if (this.preferences.alwaysOpenInNewWindow) {\n this.preferencePanelCheckboxInputs[l('AlwaysOpenInNewWindow')].select(false);\n }\n }\n\n private fromPreferencesToRadioInput() {\n if (this.preferences.enableQuerySyntax === true) {\n this.preferencePanelRadioInputs[l('On')].select(false);\n } else if (this.preferences.enableQuerySyntax === false) {\n this.preferencePanelRadioInputs[l('Off')].select(false);\n } else {\n this.preferencePanelRadioInputs[l('Automatic')].select(false);\n }\n }\n\n private fromPreferenceChangeEventToUsageAnalyticsLog(type: 'selected' | 'unselected', preference: string) {\n this.usageAnalytics.logCustomEvent(\n analyticsActionCauseList.preferencesChange,\n { preferenceName: preference, preferenceType: type },\n this.element\n );\n this.usageAnalytics.logSearchEvent(analyticsActionCauseList.preferencesChange, {\n preferenceName: preference,\n preferenceType: type\n });\n }\n\n private adjustPreferencesToComponentConfig() {\n // This method is used when there are illogical configuration between what's saved in local storage (the preferences)\n // and how the component is configured.\n // This can happen if an admin change the component configuration after end users have already selected a preferences.\n // We need to adapt the saved preferences to what's actually available in the component\n let needToSave = false;\n if (!this.options.enableOpenInNewWindow) {\n delete this.preferences.alwaysOpenInNewWindow;\n needToSave = true;\n }\n\n if (!this.options.enableOpenInOutlook) {\n delete this.preferences.openInOutlook;\n needToSave = true;\n }\n\n if (!this.options.enableQuerySyntax) {\n delete this.preferences.enableQuerySyntax;\n needToSave = true;\n }\n\n if (needToSave) {\n Defer.defer(() => {\n this.save();\n });\n }\n }\n\n private isSelected(checkingFor: string, label: string, input: IFormWidgetSelectable) {\n return checkingFor == label && input.isSelected();\n }\n}\n\nInitialization.registerAutoCreateComponent(ResultsPreferences);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/ResultsPreferences/ResultsPreferences.ts","import { $$ } from '../../utils/Dom';\nimport { IFormWidgetWithLabel, IFormWidgetSelectable } from './FormWidgets';\nimport 'styling/vapor/_Radio';\nimport { exportGlobally } from '../../GlobalExports';\n\n/**\n * A radio button widget with standard styling.\n */\nexport class RadioButton implements IFormWidgetWithLabel, IFormWidgetSelectable {\n protected element: HTMLElement;\n\n static doExport() {\n exportGlobally({\n RadioButton: RadioButton\n });\n }\n\n /**\n * Creates a new `RadioButton`.\n * @param onChange The function to call when the radio button value changes. This function takes the current\n * `RadioButton` instance as an argument.\n * @param label The label to display next to the radio button.\n * @param name The value to set the `input` HTMLElement `name` attribute to.\n */\n constructor(\n public onChange: (radioButton: RadioButton) => void = (radioButton: RadioButton) => {},\n public label: string,\n public name: string,\n private id: string = label\n ) {\n this.buildContent();\n }\n\n /**\n * Resets the radio button.\n */\n public reset() {\n const currentlySelected = this.isSelected();\n this.getRadio().checked = false;\n if (currentlySelected) {\n this.onChange(this);\n }\n }\n\n /**\n * Select the radio button\n * @param triggerChange will trigger change event if specified and the radio button is not already selected\n */\n public select(triggerChange = true) {\n const currentlySelected = this.isSelected();\n this.getRadio().checked = true;\n if (!currentlySelected && triggerChange) {\n this.onChange(this);\n }\n }\n\n /**\n * Gets the element on which the radio button is bound.\n * @returns {HTMLElement} The radio button element.\n */\n public build(): HTMLElement {\n return this.element;\n }\n\n /**\n * Gets the element on which the radio button is bound.\n * @returns {HTMLElement} The radio button element.\n */\n public getElement(): HTMLElement {\n return this.element;\n }\n\n public getValue(): string {\n return this.label;\n }\n\n /**\n * Indicates whether the radio button is selected.\n * @returns {boolean} `true` if the radio button is selected, `false` otherwise.\n */\n public isSelected(): boolean {\n return this.getRadio().checked;\n }\n\n /**\n * Gets the `input` element (the radio button itself).\n * @returns {HTMLInputElement} The `input` element.\n */\n public getRadio(): HTMLInputElement {\n return $$(this.element).find('input');\n }\n\n /**\n * Gets the radio button [`label`]{@link RadioButton.label} element.\n * @returns {HTMLLabelElement} The `label` element.\n */\n public getLabel(): HTMLLabelElement {\n return $$(this.element).find('label');\n }\n\n private buildContent() {\n const radioOption = $$('div', { className: 'coveo-radio' });\n const radioInput = $$('input', { type: 'radio', name: this.name, id: this.id });\n const labelInput = $$('label', { className: 'coveo-radio-input-label', for: this.id });\n labelInput.text(this.label);\n radioInput.on('change', () => {\n this.onChange(this);\n });\n\n radioOption.append(radioInput.el);\n radioOption.append(labelInput.el);\n this.element = radioOption.el;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/FormWidgets/RadioButton.ts"],"sourceRoot":""}