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nC;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA4BG;QACH,KAAK,EAAE,mCAAgB,CAAC,gBAAgB,EAAE;QAE1C;;;;;;;;;;WAUG;QACH,aAAa,EAAE,mCAAgB,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QAE3E;;;;;WAKG;QACH,aAAa,EAAE,mCAAgB,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QAE3E;;;;;;;;;;;;;;;;WAgBG;QACH,qBAAqB,EAAE,mCAAgB,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QAEnF;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QACH,YAAY,EAAE,mCAAgB,CAAC,iBAAiB,EAAE;QAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAsCG;QACH,aAAa,EAAE,mCAAgB,CAAC,iBAAiB,EAAE;QAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuCG;QACH,OAAO,EAAE,mCAAgB,CAAC,iBAAiB,CAA0C;YACnF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QAEF;;;;;;;;;;;;;;;;;;;;;;;WAuBG;QACH,YAAY,EAAE,mCAAgB,CAAC,iBAAiB,CAAyB,cAAM,WAAI,EAAJ,CAAI,CAAC;KACrF,CAAC;IAwTJ,iBAAC;CAAA,CAthB+B,qBAAS,GAshBxC;AAthBY,gCAAU;AAwhBvB,+BAAc,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC","file":"ResultLink__7f0661f464388d8314e9.js","sourcesContent":["import { once } from 'underscore';\nimport { $$ } from '../../utils/Dom';\n\nexport function bindAnalyticsToLink(element: HTMLElement, logAnalytics: () => void) {\n const executeOnlyOnce = once(() => logAnalytics());\n\n $$(element).on(['contextmenu', 'click', 'mousedown', 'mouseup'], executeOnlyOnce);\n let longPressTimer: number;\n $$(element).on('touchstart', () => {\n longPressTimer = window.setTimeout(executeOnlyOnce, 1000);\n });\n $$(element).on('touchend', () => {\n if (longPressTimer) {\n clearTimeout(longPressTimer);\n }\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/ResultLink/ResultLinkCommon.ts","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sass/_ResultLink.scss\n// module id = 534\n// module chunks = 0 12 18 21 23 27 28 30 42 88","import { Component } from '../Base/Component';\nimport { ComponentOptions } from '../Base/ComponentOptions';\nimport { ComponentOptionsModel } from '../../models/ComponentOptionsModel';\nimport { IResultsComponentBindings } from '../Base/ResultsComponentBindings';\nimport { analyticsActionCauseList } from '../Analytics/AnalyticsActionListMeta';\nimport { IResultLinkOptions } from './ResultLinkOptions';\nimport { ResultListEvents } from '../../events/ResultListEvents';\nimport { HighlightUtils } from '../../utils/HighlightUtils';\nimport { IQueryResult } from '../../rest/QueryResult';\nimport { DeviceUtils } from '../../utils/DeviceUtils';\nimport { OS_NAME, OSUtils } from '../../utils/OSUtils';\nimport { Initialization } from '../Base/Initialization';\nimport { QueryUtils } from '../../utils/QueryUtils';\nimport { Assert } from '../../misc/Assert';\nimport { Utils } from '../../utils/Utils';\nimport { Defer } from '../../misc/Defer';\nimport { $$ } from '../../utils/Dom';\nimport { StreamHighlightUtils } from '../../utils/StreamHighlightUtils';\nimport { StringUtils } from '../../utils/StringUtils';\nimport { debounce, extend, escape } from 'underscore';\nimport { exportGlobally } from '../../GlobalExports';\n\nimport 'styling/_ResultLink';\nimport { AccessibleButton } from '../../utils/AccessibleButton';\nimport { bindAnalyticsToLink } from './ResultLinkCommon';\n\n/**\n * The `ResultLink` component automatically transform a search result title into a clickable link pointing to the\n * original item.\n *\n * This component is a result template component (see [Result Templates](https://docs.coveo.com/en/413/)).\n */\nexport class ResultLink extends Component {\n static ID = 'ResultLink';\n\n static doExport = () => {\n exportGlobally({\n ResultLink: ResultLink\n });\n };\n\n /**\n * The options for the ResultLink\n * @componentOptions\n */\n static options: IResultLinkOptions = {\n /**\n * Specifies the field to use to output the component `href` attribute value.\n *\n * **Tip:**\n * > Instead of specifying a value for the `field` option, you can directly add an `href` attribute to the\n * > `ResultLink` HTML element. Then, you can use a custom script to generate the `href` value.\n *\n * **Examples:**\n * - With the following markup, the `ResultLink` outputs its `href` value using the `@uri` field (rather than the\n * default field):\n *\n * ```html\n * \n * ```\n *\n * - In the following result template, the custom `getMyKBUri()` function provides the `href` value:\n *\n * ```html\n * \n * ```\n *\n * See also [`hrefTemplate`]{@link ResultLink.options.hrefTemplate}, which can override this option.\n *\n * By default, the component uses the `@clickUri` field of the item to output the value of its `href` attribute.\n */\n field: ComponentOptions.buildFieldOption(),\n\n /**\n * Specifies whether the component should try to open its link in Microsoft Outlook.\n *\n * Setting this option to `true` is normally useful for `ResultLink` instances related to Microsoft Exchange emails.\n *\n * If this option is `true`, clicking the `ResultLink` calls the\n * [`openLinkInOutlook`]{@link ResultLink.openLinkInOutlook} method instead of the\n * [`openLink`]{@link ResultLink.openLink} method.\n *\n * Default value is `false`.\n */\n openInOutlook: ComponentOptions.buildBooleanOption({ defaultValue: false }),\n\n /**\n * Specifies whether the component should open its link in the [`Quickview`]{@link Quickview} component rather than\n * loading through the original URL.\n *\n * Default value is `false`.\n */\n openQuickview: ComponentOptions.buildBooleanOption({ defaultValue: false }),\n\n /**\n * Specifies whether the component should open its link in a new window instead of opening it in the current\n * context.\n *\n * If this option is `true`, clicking the `ResultLink` calls the\n * [`openLinkInNewWindow`]{@link ResultLink.openLinkInNewWindow} method instead of the\n * [`openLink`]{@link ResultLink.openLink} method.\n *\n * **Note:**\n * > If a search page contains a [`ResultPreferences`]{@link ResultsPreferences} component whose\n * > [`enableOpenInNewWindow`]{@link ResultsPreferences.options.enableOpenInNewWindow} option is `true`, and the end\n * > user checks the Always open results in new window box, `ResultLink` components in this page will always\n * > open their links in a new window when the end user clicks them, no matter what the value of their\n * > `alwaysOpenInNewWindow` option is.\n *\n * Default value is `false`.\n */\n alwaysOpenInNewWindow: ComponentOptions.buildBooleanOption({ defaultValue: false }),\n\n /**\n * Specifies a template literal from which to generate the `ResultLink` `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * This option overrides the [`field`]{@link ResultLink.options.field} option value.\n *\n * The template literal can reference any number of fields from the parent result. It can also reference global\n * scope properties.\n *\n * **Examples:**\n *\n * - The following markup generates an `href` value such as `http://uri.com?id=itemTitle`:\n *\n * ```html\n * \n * ```\n *\n * - The following markup generates an `href` value such as `localhost/fooBar`:\n *\n * ```html\n * \n * ```\n *\n * Default value is `undefined`.\n */\n hrefTemplate: ComponentOptions.buildStringOption(),\n\n /**\n * Specifies a template literal from which to generate the `ResultLink` display title (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * This option overrides the default `ResultLink` display title behavior.\n *\n * The template literal can reference any number of fields from the parent result. However, if the template literal\n * references a key whose value is undefined in the parent result fields, the `ResultLink` title displays the\n * name of this key instead.\n *\n * This option is ignored if the `ResultLink` innerHTML contains any value.\n *\n * **Examples:**\n *\n * - The following markup generates a `ResultLink` display title such as `Case number: 123456` if both the\n * `raw.objecttype` and `raw.objectnumber` keys are defined in the parent result fields:\n *\n * ```html\n * \n * ```\n *\n * - The following markup generates `${myField}` as a `ResultLink` display title if the `myField` key is undefined\n * in the parent result fields:\n *\n * ```html\n * \n * ```\n *\n * - The following markup generates `Foobar` as a `ResultLink` display title, because the `ResultLink` innterHTML is\n * not empty:\n *\n * ```html\n * Foobar\n * ```\n *\n * Default value is `undefined`.\n *\n * @availablesince [January 2017 Release (v1.1865.9)](https://docs.coveo.com/en/396/#january-2017-release-v118659)\n */\n titleTemplate: ComponentOptions.buildStringOption(),\n\n /**\n * Specifies an event handler function to execute when the user clicks the `ResultLink` component.\n *\n * The handler function takes a JavaScript [`Event`](https://developer.mozilla.org/en/docs/Web/API/Event) object and\n * an [`IQueryResult`]{@link IQueryResult} as its parameters.\n *\n * Overriding the default behavior of the `onClick` event can allow you to execute specific code instead.\n *\n * **Note:**\n * > You cannot set this option directly in the component markup as an HTML attribute. You must either set it in the\n * > [`init`]{@link init} call of your search interface (see\n * > [Passing Component Options in the init Call](https://docs.coveo.com/en/346/#passing-component-options-in-the-init-call)),\n * > or before the `init` call, using the `options` top-level function (see\n * > [Passing Component Options Before the init Call](https://docs.coveo.com/en/346/#passing-component-options-before-the-init-call)).\n *\n * **Example:**\n * ```javascript\n * // You can set the option in the 'init' call:\n * Coveo.init(document.querySelector(\"#search\"), {\n * ResultLink : {\n * onClick : function(e, result) {\n * e.preventDefault();\n * // Custom code to execute with the item URI and title.\n * openUriInASpecialTab(result.clickUri, result.title);\n * }\n * }\n * });\n *\n * // Or before the 'init' call, using the 'options' top-level function:\n * // Coveo.options(document.querySelector('#search'), {\n * // ResultLink : {\n * // onClick : function(e, result) {\n * // e.preventDefault();\n * // // Custom code to execute with the item URI and title.\n * // openUriInASpecialTab(result.clickUri, result.title);\n * // }\n * // }\n * // });\n * ```\n */\n onClick: ComponentOptions.buildCustomOption<(e: Event, result: IQueryResult) => any>(() => {\n return null;\n }),\n\n /**\n * Specify this option to log additional analytics when this result link is pressed.\n *\n * **Example:**\n * ```javascript\n * const resultLink = new Coveo.ResultLink(\n * linkElement,\n * {\n * logAnalytics: (href) => Coveo.logCustomEvent(\n * Coveo.analyticsActionCauseList.openSmartSnippetSource,\n * {\n * searchQueryUid: searchInterface.queryController.lastSearchUid,\n * documentTitle: result.title,\n * author: Utils.getFieldValue(result, 'author'),\n * documentURL: href\n * },\n * element\n * )\n * },\n * searchInterface.getBindings(),\n * result\n * )\n * ```\n */\n logAnalytics: ComponentOptions.buildCustomOption<(href: string) => void>(() => null)\n };\n\n private toExecuteOnOpen: (e?: Event) => void;\n\n /**\n * Creates a new `ResultLink` component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the `ResultLink` 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 * @param result The result to associate the component with.\n * @param os\n */\n constructor(\n public element: HTMLElement,\n public options: IResultLinkOptions,\n public bindings?: IResultsComponentBindings,\n public result?: IQueryResult,\n public os?: OS_NAME\n ) {\n super(element, ResultLink.ID, bindings);\n\n const globalOptions = this.searchInterface.options.originalOptionsObject[ResultLink.ID] || {};\n const initialOptions = ComponentOptions.initComponentOptions(element, ResultLink, { ...globalOptions, ...options });\n const resultLinkOptions = this.componentOptionsModel.get(ComponentOptionsModel.attributesEnum.resultLink);\n this.options = extend({}, initialOptions, resultLinkOptions);\n\n this.result = result || this.resolveResult();\n\n if (this.options.openQuickview == null) {\n this.options.openQuickview = result.raw['connectortype'] == 'ExchangeCrawler' && DeviceUtils.isMobileDevice();\n }\n if (!this.element.hasAttribute('tabindex')) {\n this.element.setAttribute('tabindex', '0');\n }\n\n Assert.exists(this.componentOptionsModel);\n Assert.exists(this.result);\n\n if (!this.quickviewShouldBeOpened()) {\n // Bind on multiple \"click\" or \"mouse\" events.\n // Create a function that will be executed only once, so as not to log multiple events\n // Once a result link has been opened, and that we log at least one analytics event,\n // it should not matter if the end user open the same link multiple times with different methods.\n // It's still only one \"click\" event as far as UA is concerned.\n // Also need to handle \"longpress\" on mobile (the contextual menu), which we assume to be 1 s long.\n\n bindAnalyticsToLink(element, () => this.logAnalytics());\n }\n this.renderUri(element, result);\n this.bindEventToOpen();\n }\n public renderUri(element: HTMLElement, result?: IQueryResult) {\n if (/^\\s*$/.test(this.element.innerHTML)) {\n const title = this.getDisplayedTitle();\n this.element.innerHTML = title;\n\n const titleAsText = this.getDisplayedTitleAsText();\n if (!this.element.hasAttribute('aria-label')) {\n this.element.setAttribute('aria-label', titleAsText);\n }\n\n if (!this.element.title) {\n this.element.title = titleAsText;\n }\n }\n }\n /**\n * Opens the result in the same window, no matter how the actual component is configured for the end user.\n * @param logAnalytics Specifies whether the method should log an analytics event.\n */\n public openLink(logAnalytics = true) {\n if (logAnalytics) {\n this.logAnalytics();\n }\n window.location.href = this.getResultUri();\n }\n\n /**\n * Opens the result in a new window, no matter how the actual component is configured for the end user.\n * @param logAnalytics Specifies whether the method should log an analytics event.\n */\n public openLinkInNewWindow(logAnalytics = true) {\n if (logAnalytics) {\n this.logAnalytics();\n }\n window.open(this.getResultUri(), '_blank');\n }\n\n /**\n * Tries to open the result in Microsoft Outlook if the result has an `outlookformacuri` or `outlookuri` field.\n *\n * Normally, this implies the result should be a link to an email.\n *\n * If the needed fields are not present, this method does nothing.\n * @param logAnalytics Specifies whether the method should log an analytics event.\n */\n public openLinkInOutlook(logAnalytics = true) {\n if (this.hasOutlookField()) {\n if (logAnalytics) {\n this.logAnalytics();\n }\n this.openLink();\n }\n }\n\n /**\n * Opens the link in the same manner the end user would.\n *\n * This essentially simulates a click on the result link.\n *\n * @param logAnalytics Specifies whether the method should log an analytics event.\n */\n public openLinkAsConfigured(logAnalytics = true) {\n if (this.toExecuteOnOpen) {\n if (logAnalytics) {\n this.logAnalytics();\n }\n this.toExecuteOnOpen();\n }\n }\n\n protected bindEventToOpen(): boolean {\n return (\n this.bindOnClickIfNotUndefined() ||\n this.bindOpenQuickviewIfNotUndefined() ||\n this.setHrefIfNotAlready() ||\n this.openLinkThatIsNotAnAnchor()\n );\n }\n\n private getDisplayedTitle() {\n if (!this.options.titleTemplate) {\n return this.result.title\n ? HighlightUtils.highlightString(this.result.title, this.result.titleHighlights, null, 'coveo-highlight')\n : this.escapedClickUri;\n } else {\n let newTitle = StringUtils.buildStringTemplateFromResult(this.options.titleTemplate, this.result);\n return newTitle\n ? StreamHighlightUtils.highlightStreamText(newTitle, this.result.termsToHighlight, this.result.phrasesToHighlight)\n : this.escapedClickUri;\n }\n }\n\n private getDisplayedTitleAsText() {\n const container = $$('div');\n container.setHtml(this.getDisplayedTitle());\n return container.text();\n }\n\n private get escapedClickUri() {\n return escape(this.result.clickUri);\n }\n\n private bindOnClickIfNotUndefined() {\n if (this.options.onClick != undefined) {\n this.toExecuteOnOpen = (e: MouseEvent) => {\n this.options.onClick.call(this, e, this.result);\n };\n\n new AccessibleButton()\n .withElement(this.element)\n .withLabel(this.result.title)\n .withSelectAction((e: Event) => this.toExecuteOnOpen(e))\n .build();\n\n return true;\n } else {\n return false;\n }\n }\n\n private bindOpenQuickviewIfNotUndefined() {\n if (this.quickviewShouldBeOpened()) {\n this.toExecuteOnOpen = () => {\n $$(this.bindings.resultElement).trigger(ResultListEvents.openQuickview);\n };\n\n $$(this.element).on('click', (e: Event) => {\n e.preventDefault();\n this.toExecuteOnOpen();\n });\n\n return true;\n } else {\n return false;\n }\n }\n\n private openLinkThatIsNotAnAnchor() {\n if (!this.elementIsAnAnchor()) {\n this.toExecuteOnOpen = () => {\n if (this.options.alwaysOpenInNewWindow) {\n if (this.options.openInOutlook) {\n this.openLinkInOutlook();\n } else {\n this.openLinkInNewWindow();\n }\n } else {\n this.openLink();\n }\n };\n\n $$(this.element).on('click', () => {\n this.toExecuteOnOpen();\n });\n\n return true;\n }\n return false;\n }\n\n private setHrefIfNotAlready() {\n // Do not erase any value put in href by the template, etc. Allows\n // using custom click urls while still keeping analytics recording\n // and other behavior brought by the component.\n if (this.elementIsAnAnchor() && !Utils.isNonEmptyString($$(this.element).getAttribute('href'))) {\n $$(this.element).setAttribute('href', this.getResultUri());\n if (this.options.alwaysOpenInNewWindow && !(this.options.openInOutlook && this.hasOutlookField())) {\n $$(this.element).setAttribute('target', '_blank');\n }\n return true;\n } else {\n return false;\n }\n }\n\n private logDocumentOpen(href: string) {\n this.usageAnalytics.logClickEvent(\n analyticsActionCauseList.documentOpen,\n {\n documentURL: href,\n documentTitle: this.result.title,\n author: Utils.getFieldValue(this.result, 'author')\n },\n this.result,\n this.root\n );\n }\n\n private logAnalytics = debounce(\n () => {\n this.queryController.saveLastQuery();\n let documentURL = $$(this.element).getAttribute('href');\n if (documentURL == undefined || documentURL == '') {\n documentURL = this.escapedClickUri;\n }\n if (this.options.logAnalytics) {\n this.options.logAnalytics(documentURL);\n } else {\n this.logDocumentOpen(documentURL);\n }\n Defer.flush();\n },\n 1500,\n true\n );\n\n private filterProtocol(uri: string) {\n const isAbsolute = /^(https?|ftp|file|mailto|tel):/i.test(uri);\n const isRelative = /^(\\/|\\.\\/|\\.\\.\\/)/.test(uri);\n\n return isAbsolute || isRelative ? uri : '';\n }\n\n private getResultUri(): string {\n if (this.options.hrefTemplate) {\n const uri = StringUtils.buildStringTemplateFromResult(this.options.hrefTemplate, this.result);\n return this.filterProtocol(uri);\n }\n\n if (this.options.field == undefined && this.options.openInOutlook) {\n this.setField();\n }\n\n if (this.options.field != undefined) {\n return this.filterProtocol(Utils.getFieldValue(this.result, this.options.field));\n }\n\n return this.filterProtocol(this.result.clickUri);\n }\n\n private elementIsAnAnchor() {\n return this.element.tagName == 'A';\n }\n\n private setField() {\n let os = Utils.exists(this.os) ? this.os : OSUtils.get();\n if (os == OS_NAME.MACOSX && this.hasOutlookField()) {\n this.options.field = '@outlookformacuri';\n } else if (os == OS_NAME.WINDOWS && this.hasOutlookField()) {\n this.options.field = '@outlookuri';\n }\n }\n\n private hasOutlookField() {\n let os = Utils.exists(this.os) ? this.os : OSUtils.get();\n if (os == OS_NAME.MACOSX && this.result.raw['outlookformacuri'] != undefined) {\n return true;\n } else if (os == OS_NAME.WINDOWS && this.result.raw['outlookuri'] != undefined) {\n return true;\n }\n return false;\n }\n\n private isUriThatMustBeOpenedInQuickview(): boolean {\n return this.escapedClickUri.toLowerCase().indexOf('ldap://') == 0;\n }\n\n private quickviewShouldBeOpened() {\n return (this.options.openQuickview || this.isUriThatMustBeOpenedInQuickview()) && QueryUtils.hasHTMLVersion(this.result);\n }\n}\n\nInitialization.registerAutoCreateComponent(ResultLink);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/ResultLink/ResultLink.ts"],"sourceRoot":""}