coveo-search-ui
Version:
Coveo JavaScript Search Framework
2 lines • 73.4 kB
JavaScript
webpackJsonpCoveo__temporary([0,42],{236:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var o=n(817),a=n(819),l=n(1),s=n(26),u=n(20),c=n(820);n(821);var p=n(812),d=n(829),h=n(0),f=n(830),v=function(){function e(e,t){var n=this;this.element=e,this.bindings=t,this.opened=!1,this.modalBoxModule=s.ModalBox,l.$$(this.element).text("Relevance Inspector"),l.$$(this.element).addClass("coveo-button coveo-relevance-inspector"),l.$$(this.bindings.root).on(this.bindings.queryStateModel.getEventName(u.QueryStateModel.eventTypes.changeOne+u.QueryStateModel.attributesEnum.debug),function(e,t){return n.toggleFromState(t.value)}),l.$$(this.element).on("click",function(){return n.open()}),l.$$(this.bindings.root).on(u.ResultListEvents.newResultDisplayed,function(e,t){return n.handleNewResultDisplayed(t)}),this.bindings.queryStateModel.get(u.QueryStateModel.attributesEnum.debug)?this.show():this.hide()}return Object.defineProperty(e.prototype,"modalBox",{get:function(){return this.modalBoxModule},set:function(e){this.modalBoxModule=e},enumerable:!0,configurable:!0}),e.prototype.hide=function(){l.$$(this.element).addClass("coveo-hidden")},e.prototype.show=function(){l.$$(this.element).removeClass("coveo-hidden")},e.prototype.open=function(){return i(this,void 0,void 0,function(){var e,t,n;return r(this,function(i){switch(i.label){case 0:return this.opened?[2]:(this.opened=!0,e=l.$$("div"),t=u.DomUtils.getBasicLoadingAnimation(),e.append(t),this.modalBox.open(e.el,this.modalBoxOptions),[4,this.buildTabs()]);case 1:return n=i.sent(),n?(t.remove(),e.append(n.el)):this.modalBox.close(),[2]}})})},e.prototype.handleNewResultDisplayed=function(e){this.bindings.queryStateModel.get(u.QueryStateModel.attributesEnum.debug)&&(l.$$(e.item).addClass("coveo-with-inline-ranking-info"),l.$$(e.item).hasClass("coveo-table-layout")?l.$$(e.item).append(new f.InlineRankingInfo(e.result).build().el):l.$$(e.item).prepend(new f.InlineRankingInfo(e.result).build().el))},Object.defineProperty(e.prototype,"modalBoxOptions",{get:function(){var e=this;return{title:"Relevance Inspector",titleClose:!1,overlayClose:!0,sizeMod:"big",className:"relevance-inspector-modal",validation:function(){return e.opened=!1,!0},body:document.getElementsByClassName("CoveoSearchInterface")[0]}},enumerable:!0,configurable:!0}),e.prototype.toggleFromState=function(e){0!=e?this.show():this.hide(),this.modalBox.close()},e.prototype.buildTabs=function(){return i(this,void 0,void 0,function(){var e,t,n,i,s,f,v,b,g,y,m,w,O,x,E,R,S,k,$,T,_=this;return r(this,function(r){switch(r.label){case 0:return(e=this.bindings.queryController.getLastResults().results)&&0!=e.length?e[0].rankingInfo?(t=l.$$("div"),n=new o.RankingInfoTable(e,this.bindings),i=new a.MetaDataTable(e,this.bindings),s=new p.ExecutionReport(this.bindings.queryController.getLastResults(),this.bindings),f=new d.AvailableFieldsTable(this.bindings),this.tabs={relevanceInspectorRankingInfo:n,relevanceInspectorMetadata:i,relevanceInspectorExecutionReport:s,relevanceInspectorAvailableFields:f},v=new c.RelevanceInspectorTabs(function(e){_.activeTab=e,_.resize()}),b=h.debounce(function(){return _.resize()},100),window.addEventListener("resize",b),y=(g=v).addSection,m=["Ranking Information"],[4,n.build()]):(new u.Logger(this).error("Could not open Relevance Inspector because there is no ranking info returned on the results. Please execute a query in debug mode beforehad",e),[2]):(new u.Logger(this).error("Could not open Relevance Inspector because there is no results to display. Please execute a query beforehand",e),[2]);case 1:return y.apply(g,m.concat([r.sent(),"relevanceInspectorRankingInfo"])),O=(w=v).addSection,x=["Metadata"],[4,i.build()];case 2:return O.apply(w,x.concat([r.sent(),"relevanceInspectorMetadata"])),R=(E=v).addSection,S=["Execution Report"],[4,s.build()];case 3:return R.apply(E,S.concat([r.sent(),"relevanceInspectorExecutionReport"])),$=(k=v).addSection,T=["Available Fields"],[4,f.build()];case 4:return $.apply(k,T.concat([r.sent(),"relevanceInspectorAvailableFields"])),v.select("relevanceInspectorRankingInfo"),t.append(v.navigationSection.el),t.append(v.tabContentSection.el),[2,t]}})})},e.prototype.resize=function(){this.activeTab&&this.tabs[this.activeTab]&&this.tabs[this.activeTab].gridOptions.api.sizeColumnsToFit()},e}();t.RelevanceInspector=v},475:function(e,t,n){"use strict";function i(e,t){var n=r.once(function(){return t()});o.$$(e).on(["contextmenu","click","mousedown","mouseup"],n);var i;o.$$(e).on("touchstart",function(){i=window.setTimeout(n,1e3)}),o.$$(e).on("touchend",function(){i&&clearTimeout(i)})}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1);t.bindAnalyticsToLink=i},535:function(e,t){},71:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),a=n(8),l=n(28),s=n(10),u=n(29),c=n(69),p=n(24),d=n(181),h=n(2),f=n(21),v=n(5),b=n(4),g=n(31),y=n(1),m=n(120),w=n(22),O=n(0),x=n(3);n(535);var E=n(15),R=n(475),S=function(e){function t(n,i,o,s,u){var c=e.call(this,n,t.ID,o)||this;c.element=n,c.options=i,c.bindings=o,c.result=s,c.os=u,c.logAnalytics=O.debounce(function(){c.queryController.saveLastQuery();var e=y.$$(c.element).getAttribute("href");void 0!=e&&""!=e||(e=c.escapedClickUri),c.options.logAnalytics?c.options.logAnalytics(e):c.logDocumentOpen(e),g.Defer.flush()},1500,!0);var d=c.searchInterface.options.originalOptionsObject[t.ID]||{},h=a.ComponentOptions.initComponentOptions(n,t,r({},d,i)),f=c.componentOptionsModel.get(l.ComponentOptionsModel.attributesEnum.resultLink);return c.options=O.extend({},h,f),c.result=s||c.resolveResult(),null==c.options.openQuickview&&(c.options.openQuickview="ExchangeCrawler"==s.raw.connectortype&&p.DeviceUtils.isMobileDevice()),c.element.hasAttribute("tabindex")||c.element.setAttribute("tabindex","0"),v.Assert.exists(c.componentOptionsModel),v.Assert.exists(c.result),c.quickviewShouldBeOpened()||R.bindAnalyticsToLink(n,function(){return c.logAnalytics()}),c.renderUri(n,s),c.bindEventToOpen(),c}return i(t,e),t.prototype.renderUri=function(e,t){if(/^\s*$/.test(this.element.innerHTML)){var n=this.getDisplayedTitle();this.element.innerHTML=n;var i=this.getDisplayedTitleAsText();this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label",i),this.element.title||(this.element.title=i)}},t.prototype.openLink=function(e){void 0===e&&(e=!0),e&&this.logAnalytics(),window.location.href=this.getResultUri()},t.prototype.openLinkInNewWindow=function(e){void 0===e&&(e=!0),e&&this.logAnalytics(),window.open(this.getResultUri(),"_blank")},t.prototype.openLinkInOutlook=function(e){void 0===e&&(e=!0),this.hasOutlookField()&&(e&&this.logAnalytics(),this.openLink())},t.prototype.openLinkAsConfigured=function(e){void 0===e&&(e=!0),this.toExecuteOnOpen&&(e&&this.logAnalytics(),this.toExecuteOnOpen())},t.prototype.bindEventToOpen=function(){return this.bindOnClickIfNotUndefined()||this.bindOpenQuickviewIfNotUndefined()||this.setHrefIfNotAlready()||this.openLinkThatIsNotAnAnchor()},t.prototype.getDisplayedTitle=function(){if(this.options.titleTemplate){var e=w.StringUtils.buildStringTemplateFromResult(this.options.titleTemplate,this.result);return e?m.StreamHighlightUtils.highlightStreamText(e,this.result.termsToHighlight,this.result.phrasesToHighlight):this.escapedClickUri}return this.result.title?c.HighlightUtils.highlightString(this.result.title,this.result.titleHighlights,null,"coveo-highlight"):this.escapedClickUri},t.prototype.getDisplayedTitleAsText=function(){var e=y.$$("div");return e.setHtml(this.getDisplayedTitle()),e.text()},Object.defineProperty(t.prototype,"escapedClickUri",{get:function(){return O.escape(this.result.clickUri)},enumerable:!0,configurable:!0}),t.prototype.bindOnClickIfNotUndefined=function(){var e=this;return void 0!=this.options.onClick&&(this.toExecuteOnOpen=function(t){e.options.onClick.call(e,t,e.result)},(new E.AccessibleButton).withElement(this.element).withLabel(this.result.title).withSelectAction(function(t){return e.toExecuteOnOpen(t)}).build(),!0)},t.prototype.bindOpenQuickviewIfNotUndefined=function(){var e=this;return!!this.quickviewShouldBeOpened()&&(this.toExecuteOnOpen=function(){y.$$(e.bindings.resultElement).trigger(u.ResultListEvents.openQuickview)},y.$$(this.element).on("click",function(t){t.preventDefault(),e.toExecuteOnOpen()}),!0)},t.prototype.openLinkThatIsNotAnAnchor=function(){var e=this;return!this.elementIsAnAnchor()&&(this.toExecuteOnOpen=function(){e.options.alwaysOpenInNewWindow?e.options.openInOutlook?e.openLinkInOutlook():e.openLinkInNewWindow():e.openLink()},y.$$(this.element).on("click",function(){e.toExecuteOnOpen()}),!0)},t.prototype.setHrefIfNotAlready=function(){return!(!this.elementIsAnAnchor()||b.Utils.isNonEmptyString(y.$$(this.element).getAttribute("href")))&&(y.$$(this.element).setAttribute("href",this.getResultUri()),!this.options.alwaysOpenInNewWindow||this.options.openInOutlook&&this.hasOutlookField()||y.$$(this.element).setAttribute("target","_blank"),!0)},t.prototype.logDocumentOpen=function(e){this.usageAnalytics.logClickEvent(s.analyticsActionCauseList.documentOpen,{documentURL:e,documentTitle:this.result.title,author:b.Utils.getFieldValue(this.result,"author")},this.result,this.root)},t.prototype.filterProtocol=function(e){var t=/^(https?|ftp|file|mailto|tel|sip):/i.test(e),n=/^(\/|\.\/|\.\.\/)/.test(e);return t||n?e:""},t.prototype.getResultUri=function(){if(this.options.hrefTemplate){var e=w.StringUtils.buildStringTemplateFromResult(this.options.hrefTemplate,this.result);return this.filterProtocol(e)}return void 0==this.options.field&&this.options.openInOutlook&&this.setField(),void 0!=this.options.field?this.filterProtocol(b.Utils.getFieldValue(this.result,this.options.field)):this.filterProtocol(this.result.clickUri)},t.prototype.elementIsAnAnchor=function(){return"A"==this.element.tagName},t.prototype.setField=function(){var e=b.Utils.exists(this.os)?this.os:d.OSUtils.get();e==d.OS_NAME.MACOSX&&this.hasOutlookField()?this.options.field="@outlookformacuri":e==d.OS_NAME.WINDOWS&&this.hasOutlookField()&&(this.options.field="@outlookuri")},t.prototype.hasOutlookField=function(){var e=b.Utils.exists(this.os)?this.os:d.OSUtils.get();return e==d.OS_NAME.MACOSX&&void 0!=this.result.raw.outlookformacuri||e==d.OS_NAME.WINDOWS&&void 0!=this.result.raw.outlookuri},t.prototype.isUriThatMustBeOpenedInQuickview=function(){return 0==this.escapedClickUri.toLowerCase().indexOf("ldap://")},t.prototype.quickviewShouldBeOpened=function(){return(this.options.openQuickview||this.isUriThatMustBeOpenedInQuickview())&&f.QueryUtils.hasHTMLVersion(this.result)},t.ID="ResultLink",t.doExport=function(){x.exportGlobally({ResultLink:t})},t.options={field:a.ComponentOptions.buildFieldOption(),openInOutlook:a.ComponentOptions.buildBooleanOption({defaultValue:!1}),openQuickview:a.ComponentOptions.buildBooleanOption({defaultValue:!1}),alwaysOpenInNewWindow:a.ComponentOptions.buildBooleanOption({defaultValue:!1}),hrefTemplate:a.ComponentOptions.buildStringOption(),titleTemplate:a.ComponentOptions.buildStringOption(),onClick:a.ComponentOptions.buildCustomOption(function(){return null}),logAnalytics:a.ComponentOptions.buildCustomOption(function(){return null})},t}(o.Component);t.ResultLink=S,h.Initialization.registerAutoCreateComponent(S)},811:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(818),l=n(0),s=n(74),u=n(71);t.defaultGridOptions={domLayout:"autoHeight",enableColResize:!0,rowHeight:100,enableRangeSelection:!0,suppressRowClickSelection:!0,suppressCellSelection:!0,defaultColDef:{width:100},enableSorting:!0,autoSizePadding:10};var c=function(){function e(){}return e.prototype.build=function(e,n,s){return void 0===s&&(s=t.defaultGridOptions),r(this,void 0,void 0,function(){var r,u,c,p,d;return o(this,function(o){switch(o.label){case 0:return r=l.first(e)||{},u=function(e,t){return e.children?{field:t,headerName:t,marryChildren:!0,children:l.flatten(e.children.map(function(e){return l.map(e,u)}))}:i({field:t,headerName:t},e)},c=l.map(r,u),p=l.map(e,function(e){var t={},n=function(e,i){e.content?t[i]=e.content:e.children&&l.each(e.children,function(e){l.each(e,n)})};return l.each(e,n),t}),this.gridOptions=i({},t.defaultGridOptions,{columnDefs:c,rowData:p},s),[4,a.loadAgGridLibrary()];case 1:return o.sent(),d=new agGrid.Grid(n.el,this.gridOptions),[2,{grid:d,gridOptions:this.gridOptions}]}})})},e.thumbnailCell=function(e,t){return{Document:{content:{result:e,bindings:t},cellRenderer:p,width:550,getQuickFilterText:function(e){return""}}}},e}();t.TableBuilder=c;var p=function(){function e(){}return e.prototype.init=function(e){e&&(this.element=e.value,this.currentFilter=e.api.filterManager.quickFilter)},e.prototype.getGui=function(){var e=s.$$("div",{className:"coveo-relevance-inspector-thumbnail-cell"});if(this.element){var t=this.thumbnail(this.element.result,this.element.bindings);e.append(t.el)}else e.append(s.$$("p",void 0,"-- NULL --").el);return e.el},e.prototype.thumbnail=function(e,t){var n;if(t&&e){var i=t.searchInterface.getComponents("ResultList"),r=l.find(i,function(e){return!e.disabled});r?(n=s.$$("div",{className:"coveo-relevance-inspector-result-thumbnail"}),r.buildResult(e).then(function(e){n.append(e)})):(n=s.$$("a",{className:"CoveoResultLink"}),new u.ResultLink(n.el,{alwaysOpenInNewWindow:!0},t,e)),this.currentFilter&&this.highlightSearch(n.el,this.currentFilter)}else n=s.$$("div",void 0,"-- NULL --");return n},e.prototype.refresh=function(e){return!0},e.prototype.highlightSearch=function(e,t){var n=e;if(null!=n&&null!=n.innerText){var i=n.innerText.split(new RegExp("(?="+s.StringUtils.regexEncode(t)+")","gi"));n.innerHTML="",i.forEach(function(e){var i,r=new RegExp("("+s.StringUtils.regexEncode(t)+")","i"),o=e.match(r);null!=o?(i=s.$$("span",{className:"coveo-relevance-inspector-highlight"}),i.text(o[1]),n.appendChild(i.el),i=s.$$("span"),i.text(e.substr(o[1].length)),n.appendChild(i.el)):(i=s.$$("span"),i.text(e),n.appendChild(i.el))})}},e}();t.ThumbnailHtmlRenderer=p;var d=function(){function e(){}return e.prototype.init=function(e){e&&e.api&&(this.element=e.value,this.currentFilter=e.api.filterManager.quickFilter)},e.prototype.getGui=function(){return this.element&&this.currentFilter?s.$$("div",void 0,s.StreamHighlightUtils.highlightStreamHTML(this.element,{Precision:["precision"]},{})).el:this.element?s.$$("div",void 0,this.element).el:s.$$("div",void 0,"-- NULL --").el},e.prototype.refresh=function(e){return!0},e}();t.GenericHtmlRenderer=d},812:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var o,a=n(823),l=n(824),s=n(825),u=n(816),c=n(826),p=n(74),d=n(827),h=n(20),f=n(828);!function(e){e.PERFORM_AUTHENTICATION="PerformAuthentication",e.RESOLVE_PIPELINE="ResolvePipeline",e.QUERY_PARAM_OVERRIDE="ApplyQueryParamOverrideFeature",e.THESAURUS="ApplyThesaurusFeature",e.PREPROCESS_QUERY_EXPRESSION="PreprocessQueryExpression",e.PREPROCESS_QUERY="PreprocessQuery",e.STOP_WORDS="ApplyStopWordFeature",e.FILTERS="ApplyFilterFeature",e.RANKING="ApplyRankingFeature",e.TOP_RESULT="ApplyTopResultFeature",e.RANKING_WEIGHT="ApplyRankingWeightFeature",e.INDEX_QUERY="Send query to index",e.TOP_CLICKS="EvaluatingTopClicks",e.PARTIAL_MATCH="PartialMatch",e.NONE="NONE"}(o=t.EXECUTION_REPORT_SECTION||(t.EXECUTION_REPORT_SECTION={}));var v=function(){function e(e,t){this.results=e,this.bindings=t}return e.standardSectionHeader=function(e){var t=p.$$("div");t.append(p.$$("h4",void 0,e).el);var n=p.$$("div",{className:"ag-theme-fresh"});return t.append(n.el),{container:t,agGridElement:n}},e.prototype.build=function(){return i(this,void 0,void 0,function(){var e,t,n,i,v,b,g,y,m,w,O,x,E,R;return r(this,function(r){switch(r.label){case 0:return this.results.executionReport?(e=p.$$("div",{className:"execution-report-debug"}),t=[],[4,(new a.ExecutionReportAuthenticationSection).build(this.results.executionReport)]):(new h.Logger(this).error("Could not open execution report : Missing execution report on results. Try executing the query in debug mode."),[2,p.$$("div")]);case 1:return n=r.sent(),e.append(n.container.el),n.gridOptions&&t.push(n.gridOptions),[4,(new l.ExecutionReportResolvedPipelineSection).build(this.results.executionReport)];case 2:return i=r.sent(),e.append(i.container.el),i.gridOptions&&t.push(i.gridOptions),[4,(new d.ExecutionReportRankingModifiers).build(this.results.results,this.results.rankingExpressions,this.bindings)];case 3:return v=r.sent(),e.append(v.container.el),v.gridOptions&&t.push(v.gridOptions),[4,(new s.ExecutionReportQueryOverrideSection).build(this.results.executionReport)];case 4:return b=r.sent(),e.append(b.container.el),b.gridOptions&&t.push(b.gridOptions),[4,new u.ExecutionReportSimpleSection(o.PREPROCESS_QUERY_EXPRESSION,o.THESAURUS,"Thesaurus").build(this.results.executionReport)];case 5:return g=r.sent(),e.append(g.container.el),g.gridOptions&&t.push(g.gridOptions),[4,new u.ExecutionReportSimpleSection(o.PREPROCESS_QUERY_EXPRESSION,o.STOP_WORDS,"Stop words").build(this.results.executionReport)];case 6:return y=r.sent(),e.append(y.container.el),y.gridOptions&&t.push(y.gridOptions),[4,new u.ExecutionReportSimpleSection(o.PREPROCESS_QUERY,o.FILTERS,"Filters").build(this.results.executionReport)];case 7:return m=r.sent(),e.append(m.container.el),m.gridOptions&&t.push(m.gridOptions),[4,new u.ExecutionReportSimpleSection(o.PREPROCESS_QUERY,o.RANKING,"Ranking").build(this.results.executionReport)];case 8:return w=r.sent(),e.append(w.container.el),w.gridOptions&&t.push(w.gridOptions),[4,new u.ExecutionReportSimpleSection(o.PREPROCESS_QUERY,o.TOP_RESULT,"Featured Results").build(this.results.executionReport)];case 9:return O=r.sent(),e.append(O.container.el),O.gridOptions&&t.push(O.gridOptions),[4,(new f.ExecutionReportITDSection).build(this.results.executionReport)];case 10:return x=r.sent(),e.append(x.container.el),x.gridOptions&&t.push(x.gridOptions),[4,new u.ExecutionReportSimpleSection(o.PREPROCESS_QUERY,o.RANKING_WEIGHT,"Ranking weights").build(this.results.executionReport)];case 11:return E=r.sent(),e.append(E.container.el),E.gridOptions&&t.push(E.gridOptions),[4,(new c.ExecutionReportEffectiveIndexQuerySection).build(this.results.executionReport)];case 12:return R=r.sent(),e.append(R.container.el),this.gridOptions={api:{sizeColumnsToFit:function(){t.forEach(function(e){return e.api?e.api.sizeColumnsToFit():null})}}},[2,e]}})})},e}();t.ExecutionReport=v},813:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(811),r=n(0),o=n(1),a=function(){function e(){}return e.prototype.output=function(e){return r.isArray(e)?this.arrayJoined(e):r.isObject(e)?this.objectJoined(e):this.simpleValue(e)},e.prototype.simpleValue=function(e){return{content:this.valueOrNullOutput(e)}},e.prototype.objectJoined=function(e){var t=this,n="";return r.each(e,function(e,i){if(r.isArray(e)){var a=o.$$("dl");a.append(o.$$("dt",void 0,i).el);var l=o.$$("dd",void 0,t.arrayJoined(e).content);a.append(l.el),n+=a.el.outerHTML}else if(r.isObject(e))n+=t.objectJoined(e).content;else{var a=o.$$("dl");a.append(o.$$("dt",void 0,i).el),a.append(o.$$("dd",void 0,t.valueOrNullOutput(e)).el),n+=a.el.outerHTML}}),{content:n,cellRenderer:i.GenericHtmlRenderer}},e.prototype.arrayJoined=function(e){var t=this;if(!e||0==e.length)return{content:"-- NULL --"};var n=o.$$("ul",{className:"relevance-inspector-list-output"});return e.forEach(function(e){r.isObject(e)?n.append(o.$$("li",void 0,t.objectJoined(e).content).el):n.append(o.$$("li",void 0,t.valueOrNullOutput(e)).el)}),{content:n.el.outerHTML,cellRenderer:i.GenericHtmlRenderer}},e.prototype.valueOrNullOutput=function(e){return null!=e&&""!==e?e.toString():"-- NULL --"},e}();t.GenericValueOutput=a},814:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e};Object.defineProperty(t,"__esModule",{value:!0});var r=n(813),o=function(){function e(){}return e.prototype.build=function(e){return i({},this.descriptionSection(e),this.durationSection(e))},e.prototype.descriptionSection=function(e){return{Description:(new r.GenericValueOutput).output(e.description)}},e.prototype.durationSection=function(e){return{Duration:(new r.GenericValueOutput).output(e.duration+" ms")}},e}();t.ExecutionReportGenericSection=o},815:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(22),o=n(1);t.buildListOfTermsElement=function(e){var t=i.map(e,function(e,t){return{dt:o.$$("dt",{className:"coveo-relevance-inspector-dt"},""+t),dd:o.$$("dd",{className:"coveo-relevance-inspector-dd"},""+e)}}),n=i.reduce(e,function(e,t){return e+t},0),r=o.$$("dl");return t.forEach(function(e){r.append(e.dt.el),r.append(e.dd.el)}),r.append(o.$$("dt",{className:"coveo-relevance-inspector-dt"},"Total").el),r.append(o.$$("dd",{className:"coveo-relevance-inspector-dd coveo-relevance-inspector-highlight"},""+n).el),r},t.parseRankingInfo=function(e){var t=/Document weights:\n((?:.)*?)\n+/g,n=/Terms weights:\n((?:.|\n)*)\n+/g,i=/Total weight: ([0-9]+)/g;if(e){var r=t.exec(e),o=n.exec(e),u=i.exec(e),c=s(e);return{documentWeights:a(r?r[1]:null),termsWeight:l(o),totalWeight:u?Number(u[1]):null,qreWeights:c}}return null};var a=function(e){var t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,n=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(e){var r=e.match(t);if(r)return i.object(r.map(function(e){var t=e.match(n);if(t){var i=t[1],r=t[2];return[i,Number(r)]}return null}))}return null},l=function(e){var t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,n=/([^:]+): ([0-9]+), ([0-9]+); /g;if(e&&e[1]){var o=r.StringUtils.match(e[1],t);return i.object(i.map(o,function(e){var t=i.object(i.map(r.StringUtils.match(e[1],n),function(e){return[e[1],{Correlation:Number(e[2]),"TF-IDF":Number(e[3])}]})),o=a(e[2]);return[i.keys(t).join(", "),{terms:t,Weights:o}]}))}return null},s=function(e){for(var t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,n=t.exec(e),i=[];n;)i.push({expression:n[1],score:parseInt(n[2],10)}),n=t.exec(e);return i}},816:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(812),l=n(0),s=n(814),u=n(813),c=n(811),p=function(){function e(e,t,n){this.topLevelProperty=e,this.secondLevelProperty=t,this.sectionTitle=n}return e.prototype.build=function(e){return r(this,void 0,void 0,function(){var t,n,r,p,d,h,f,v,v,b,g=this;return o(this,function(o){switch(o.label){case 0:return t=a.ExecutionReport.standardSectionHeader(this.sectionTitle),n=t.container,r=t.agGridElement,(d=l.find(e.children,function(e){return e.name==g.topLevelProperty&&e.children&&l.findWhere(e.children,{name:g.secondLevelProperty})}))&&d.children?(h=l.findWhere(d.children,{name:this.secondLevelProperty}))?(f=[i({},(new s.ExecutionReportGenericSection).build(h),{Applied:(new u.GenericValueOutput).output(h.applied)})],[4,(new c.TableBuilder).build(f,r)]):[3,2]:[3,3];case 1:v=o.sent(),p=v.gridOptions,o.label=2;case 2:return[3,5];case 3:return[4,(new c.TableBuilder).build([(b={},b[""+this.sectionTitle]={content:"NO DATA AVAILABLE FOR "+this.sectionTitle+" IN CURRENT EXECUTION REPORT"},b)],r)];case 4:v=o.sent(),p=v.gridOptions,o.label=5;case 5:return[2,{container:n,gridOptions:p}]}})})},e}();t.ExecutionReportSimpleSection=p},817:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(815),l=n(0),s=n(811),u=n(1),c=function(){function e(e,t){this.results=e,this.bindings=t}return e.prototype.build=function(){return r(this,void 0,void 0,function(){var e,t,n,r,c,p,d=this;return o(this,function(o){switch(o.label){case 0:return e=u.$$("div"),t=u.$$("div",{className:"ag-theme-fresh"}),e.append(t.el),n=[],r=!1,this.results.forEach(function(e){var t=a.parseRankingInfo(e.rankingInfo);r=null!=t.termsWeight,t&&t.documentWeights&&l.each(t.documentWeights,function(e,t){0!=e&&n.push(t)})}),n=l.uniq(n),c=this.results.map(function(e){var t=a.parseRankingInfo(e.rankingInfo);if(t){var r=d.buildTopLevelDocumentsWeights(t,n),o={},u={};l.chain(t.termsWeight).keys().sortBy(function(e){return l.reduce(t.termsWeight[e].Weights,function(e,t){return e+t},0)}).reverse().first(3).each(function(e){u[e]=t.termsWeight[e]}),l.each(u,function(e,t){o["Keyword: "+t]={content:a.buildListOfTermsElement(e.Weights).el.outerHTML,cellRenderer:s.GenericHtmlRenderer,width:200}});var c=t.totalWeight?t.totalWeight:0;return i({},s.TableBuilder.thumbnailCell(e,d.bindings),r,o,{Total:{content:c||0}})}return{}}),[4,(new s.TableBuilder).build(c,t,{getRowHeight:function(){return r?400:250},onGridReady:function(e){setTimeout(function(){e&&(e.api.sizeColumnsToFit(),e.api.setSortModel([{colId:"Total",sort:"desc"}]))},0)}})];case 1:return p=o.sent().gridOptions,this.gridOptions=p,[2,e]}})})},e.prototype.buildTopLevelDocumentsWeights=function(e,t){var n={};return l.each(e.documentWeights||{},function(e,i){l.contains(t,i)&&(n[i]={content:e||0})}),n},e}();t.RankingInfoTable=c},818:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=!1,o=null;t.reset=function(e){void 0===e&&(e=document),r=!1,o=null},t.loadAgGridLibrary=function(e){return void 0===e&&(e=document),new Promise(function(t,n){r?t(!0):"undefined"!=typeof agGrid?(r=!0,t(!0)):(a(e),o.then(function(){return t(!0)}),o.catch(function(){return n(!1)}))})};var a=function(e){if(void 0===e&&(e=document),!o){var t=i.$$("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ag-grid/16.0.1/ag-grid.min.noStyle.js",type:"text/javascript",async:!0}).el,n=i.$$("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/ag-grid/16.0.1/styles/ag-grid.css",rel:"stylesheet",type:"text/css"}).el,a=i.$$("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/ag-grid/16.0.1/styles/ag-theme-fresh.css",rel:"stylesheet",type:"text/css"}).el;e.head.appendChild(t),e.head.appendChild(n),e.head.appendChild(a),o=new Promise(function(e,n){t.onload=function(){e(!0)},t.onerror=function(){r=!1,n(!1)}})}}},819:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(811),l=n(0),s=n(1),u=n(22),c=n(33),p=n(57),d=function(){function e(e,t){this.results=e,this.bindings=t}return e.prototype.build=function(){return r(this,void 0,void 0,function(){var e,t,n,u,c,d=this;return o(this,function(f){switch(f.label){case 0:return this.bindings.queryController?[4,this.bindings.queryController.getEndpoint().listFields()]:[2];case 1:return e=f.sent(),t=s.$$("div",{className:"metadata-table"}),n=this.results.map(function(n){return r(d,void 0,void 0,function(){var r,u,c,p;return o(this,function(o){switch(o.label){case 0:return r=s.$$("div"),t.append(r.el),u=s.$$("div",{className:"ag-theme-fresh"}),r.append(u.el),c=a.TableBuilder.thumbnailCell(n,this.bindings),p={},p["Fields Values"]={content:{result:n,fieldsDescription:e},cellRenderer:h,width:900,getQuickFilterText:function(e){var t=l.map(e.value.result.raw,function(e){return e.toString()});return Object.keys(e.value.result.raw).concat(t).join(" ")},onCellDoubleClicked:function(e){var t=e.event?e.event.target:null;if(t&&window.getSelection&&document.createRange){var n=window.getSelection(),i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}}},[4,(new a.TableBuilder).build([i({},c,p)],u,{rowHeight:400})];case 1:return[2,o.sent()]}})})}),this.gridOptions={api:{sizeColumnsToFit:function(){u.forEach(function(e){return e.gridOptions.api?e.gridOptions.api.sizeColumnsToFit:null})}}},[4,Promise.all(n)];case 2:return u=f.sent(),c=new p.TextInput(function(e){u.forEach(function(t){var n=t.gridOptions&&t.gridOptions.api;n&&(n.setQuickFilter(e.getValue()),n.onRowHeightChanged())})},"Filters on Fields Values"),t.prepend(c.getElement()),[2,t]}})})},e}();t.MetaDataTable=d;var h=function(){function e(){}return e.prototype.init=function(e){this.element=e.value,this.params=e,this.currentFilter=e.api.filterManager.quickFilter,e.value.el=this.listAsInput(this.element.result)},e.prototype.getGui=function(){if(this.element){var e=this.listAsInput(this.element.result);this.params.eParentOfValue.appendChild(e.el);var t=Math.max(e.height()+50,200),n=Math.min(t,5e3);return this.params.node.setRowHeight(n),s.$$("div",void 0,e).el}return s.$$("div",void 0,"N.A").el},e.prototype.listAsInput=function(e){var t=this,n=s.$$("div");return l.each(e.raw,function(i,r){if("allmetadatavalues"!=r&&0!=r.indexOf("sys")&&!t.isCurrentElementFilteredOut(i,r)){var o=s.$$("div",{className:"coveo-relevance-inspector-input-group"}),a=s.$$("div",{className:"coveo-relevance-inspector-metadata-name"},r),l=t.convertFieldValueToReadableFormat(e,r),u=s.$$("div",{className:"coveo-relevance-inspector-metadata-value"},l);t.currentFilter&&(t.highlightSearch(a.el,t.currentFilter),t.highlightSearch(u.el,t.currentFilter)),o.append(a.el),o.append(u.el),n.append(o.el)}}),n},e.prototype.isCurrentElementFilteredOut=function(e,t){if(this.currentFilter){var n=-1!=t.toLowerCase().indexOf(this.currentFilter.toLowerCase()),i=!!e&&-1!=e.toString().toLowerCase().indexOf(this.currentFilter.toLowerCase());if(!n&&!i)return!0}return!1},e.prototype.convertFieldValueToReadableFormat=function(e,t){var n=e.raw[t].toString();if(this.element.fieldsDescription){var i=l.find(this.element.fieldsDescription,function(e){return e.name.replace("@","").toLowerCase()==t});i&&"Date"==i.fieldType&&(n=c.DateUtils.convertToStandardDate(n).toString()+" ( Epoch : "+n+" )")}return n},e.prototype.highlightSearch=function(e,t){var n=e;if(null!=n&&null!=n.innerText){var i=n.innerText.split(new RegExp("(?="+u.StringUtils.regexEncode(t)+")","gi"));n.innerHTML="",i.forEach(function(e){var i,r=new RegExp("("+u.StringUtils.regexEncode(t)+")","i"),o=e.match(r);null!=o?(i=s.$$("span",{className:"coveo-relevance-inspector-highlight"}),i.text(o[1]),n.appendChild(i.el),i=s.$$("span"),i.text(e.substr(o[1].length)),n.appendChild(i.el)):(i=s.$$("span"),i.text(e),n.appendChild(i.el))})}},e.prototype.refresh=function(e){return!0},e}();t.FieldValuesRenderer=h},820:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=n(0),o=function(){function e(e){this.onTabChange=e,this.navigationSection=i.$$("div",{className:"coveo-relevance-inspector-tab-navigation-section"}),this.tabContentSection=i.$$("div",{className:"coveo-relevance-inspector-tab-content-section"}),this.navigationElements=[],this.tabContentElements=[]}return e.prototype.select=function(e){var t=this.findNavigationById(e),n=this.findTabContentById(e);t&&n&&(this.activateTabNavigation(t),this.activateTabContent(n),this.onTabChange&&this.onTabChange(e))},e.prototype.addNavigation=function(e,t){var n=this,r=i.$$("div",{id:t,className:"coveo-relevance-inspector-tab"},e);return r.on("click",function(){return n.select(t)}),this.navigationElements.push(r),this.navigationSection.append(r.el),this},e.prototype.addContent=function(e,t){var n=i.$$("div",{className:"coveo-relevance-inspector-tab-content","data-target-tab":t});return n.append(e.el),this.tabContentElements.push(n),this.tabContentSection.append(n.el),this},e.prototype.addSection=function(e,t,n){return this.addNavigation(e,n).addContent(t,n)},e.prototype.findNavigationById=function(e){return r.find(this.navigationElements,function(t){return t.getAttribute("id")==e})},e.prototype.findTabContentById=function(e){return r.find(this.tabContentElements,function(t){return t.getAttribute("data-target-tab")==e})},e.prototype.activateTabNavigation=function(e){this.navigationElements.forEach(function(e){e.removeClass("coveo-selected")}),e.addClass("coveo-selected")},e.prototype.activateTabContent=function(e){this.tabContentElements.forEach(function(e){e.removeClass("coveo-selected")}),e.addClass("coveo-selected")},e}();t.RelevanceInspectorTabs=o},821:function(e,t,n){var i=n(822);"string"==typeof i&&(i=[[e.i,i,""]]);var r={hmr:!0};r.transform=void 0;n(713)(i,r);i.locals&&(e.exports=i.locals)},822:function(e,t,n){t=e.exports=n(712)(),t.push([e.i,"@keyframes fadeout{0%{opacity:1}to{opacity:0}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@keyframes slideInLeft{0%{transform:translateX(-2000px);opacity:0}to{transform:translateX(0);opacity:1}}@keyframes coveo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes loadingFade{0%{opacity:0}50%{opacity:.8}to{opacity:0}}.coveo-relevance-inspector{text-align:center;padding:10px;line-height:20px;height:40px;top:0;z-index:1000}.coveo-relevance-inspector.coveo-hidden{display:none}.relevance-inspector-modal .coveo-logo{height:64px;width:178px}.ag-theme-fresh .ag-cell{overflow:auto;white-space:normal;word-break:break-word}.ag-theme-fresh .ag-font-style{user-select:auto}.coveo-relevance-inspector-tab-navigation-section{margin-bottom:20px}.coveo-relevance-inspector-tab-content{display:none}.coveo-relevance-inspector-tab-content.coveo-selected{display:block;animation:slideInLeft .3s ease-in}.coveo-relevance-inspector-tab{display:-moz-flex;display:-ms-flexbox;display:flex;box-align:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-ms-flex-align:center;font-size:12px;font-weight:700;padding:0 5px 10px;border-bottom:1px solid #bcc3ca;text-transform:uppercase;border-bottom:2px solid #bcc3ca;display:inline-block;margin-right:10px}.coveo-relevance-inspector-tab.coveo-selected,.coveo-relevance-inspector-tab.coveo-selected:hover{border-bottom:2px solid #263e55}.coveo-relevance-inspector-tab:hover{color:#263e55}.coveo-relevance-inspector-highlight{display:inline-block;font-weight:700}.coveo-relevance-inspector-result-thumbnail{min-width:500px;white-space:normal}.coveo-relevance-inspector-dt{font-weight:700}.coveo-relevance-inspector-dd,.coveo-relevance-inspector-dt{font-size:14px;line-height:14px;padding:2px 0 4px}.coveo-relevance-inspector-metadata-name,.coveo-relevance-inspector-metadata-value{background-color:#e9ecef;display:block;padding:10px;line-height:1.5;border:1px solid #ced4da;border-radius:2px;position:relative;flex:1 1 auto;margin-bottom:0}.coveo-relevance-inspector-metadata-name{max-width:25%;min-width:25%}.coveo-relevance-inspector-metadata-value{width:75%;overflow:auto}.coveo-relevance-inspector-input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.coveo-relevance-inspector-tab-content .coveo-input{margin:40px 0 10px}.coveo-relevance-inspector-available-fields-popup{background:#fff;border:1px solid #bcc3ca;border-radius:2px;padding:10px 5px 10px 20px;width:200px;overflow:hidden;list-style-type:none}.coveo-relevance-inspector-available-fields-popup-value{padding:0 0 10px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.coveo-available-fields-table-button{overflow:hidden;display:inline-block;position:relative;top:50%;transform:translateY(-50%)}.coveo-relevance-inspector-effective-query-collapsible{display:none}.coveo-relevance-inspector-effective-query-collapsible.coveo-active{display:inherit}.coveo-relevance-inspector-table{width:100%;text-align:left;border:none;border-spacing:0}.coveo-relevance-inspector-table tr{height:37px;font-size:15px;line-height:18px}.coveo-relevance-inspector-table tr:first-child{padding-left:10px}.coveo-relevance-inspector-table tr:hover td{background-color:#e6ecf0}.coveo-relevance-inspector-table td{position:relative;vertical-align:middle;padding:9px 15px;margin-left:15px;text-align:left;border-bottom:1px solid #bcc3ca}.coveo-relevance-inspector-table td:first-child{border-left:5px solid transparent}.coveo-relevance-inspector-inline-ranking{border:1px solid #bcc3ca;border-radius:2px;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-lines:multiple;-moz-box-lines:multiple;box-lines:multiple;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:10px;margin-bottom:10px}.coveo-relevance-inspector-inline-ranking-section{margin:10px}.coveo-relevance-inspector-inline-ranking-terms{display:none;padding:10px;width:100%}.coveo-relevance-inspector-inline-ranking-terms.coveo-active{display:block;animation:fadein .5s}.coveo-relevance-inspector-inline-ranking-terms h2{border-bottom:1px solid #bcc3ca}.coveo-relevance-inspector-inline-ranking-terms dl{display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-lines:multiple;-moz-box-lines:multiple;box-lines:multiple;-ms-flex-wrap:wrap;flex-wrap:wrap;box-align:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-ms-flex-align:center}.coveo-relevance-inspector-inline-ranking-terms dt{margin:10px 20px}.coveo-relevance-inspector-inline-ranking-terms dd{margin-left:0}.coveo-relevance-inspector-inline-ranking-button{height:35px;margin:5px 0}.relevance-inspector-list-output{padding-left:5px;margin-top:0}.coveo-relevance-inspector-inline-ranking-qre-expression{font-weight:700;word-break:break-all}",""])},823:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(812),l=n(811),s=n(0),u=n(814),c=n(813),p=function(){function e(){}return e.prototype.build=function(e){return r(this,void 0,void 0,function(){var t,n,r,c,p,d,h;return o(this,function(o){switch(o.label){case 0:return t=a.ExecutionReport.standardSectionHeader("Authentication"),n=t.container,r=t.agGridElement,(p=s.find(e.children,function(e){return e.name==a.EXECUTION_REPORT_SECTION.PERFORM_AUTHENTICATION}))?(d=[i({},(new u.ExecutionReportGenericSection).build(p),this.configurationSection(p),this.pipelineOuputSection(p))],[4,(new l.TableBuilder).build(d,r,{rowHeight:150})]):[3,2];case 1:h=o.sent(),c=h.gridOptions,o.label=2;case 2:return[2,{container:n,gridOptions:c}]}})})},e.prototype.configurationSection=function(e){return{Configured:{children:[{Primary:this.genericOutput(e.configured.primary),Secondary:this.genericOutput(e.configured.secondary),Mandatory:this.genericOutput(e.configured.mandatory)}]}}},e.prototype.pipelineOuputSection=function(e){return{"Pipeline Output":{children:[{"User ids":{children:this.usersIds(e.result.userIds)},"Query restriction":{children:this.queryRestrictions(e.result.queryRestrictions)},Roles:i({},this.genericOutput(e.result.roles),{width:200}),"User groups":this.genericOutput(e.result.userGroups)}]}}},e.prototype.usersIds=function(e){var t=this;return s.map(e,function(e){return n={},n[e.name]={children:[{Kind:t.genericOutput(e.kind),Provider:i({},t.genericOutput(e.provider),{width:150}),Info:{content:e.info}}]},n;var n})},e.prototype.genericOutput=function(e){return(new c.GenericValueOutput).output(e)},e.prototype.queryRestrictions=function(e){var t=this;return s.map(e,function(e,n){return i={},i[n]=t.genericOutput(e),i;var i})},e}();t.ExecutionReportAuthenticationSection=p},824:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(812),l=n(0),s=n(814),u=n(811),c=n(813),p=function(){function e(){}return e.prototype.build=function(e){return r(this,void 0,void 0,function(){var t,n,r,p,d,h,f;return o(this,function(o){switch(o.label){case 0:return t=a.ExecutionReport.standardSectionHeader("Pipeline"),n=t.container,r=t.agGridElement,(d=l.find(e.children,function(e){return e.name==a.EXECUTION_REPORT_SECTION.RESOLVE_PIPELINE}))?(h=[i({},(new s.ExecutionReportGenericSection).build(d),{Pipeline:(new c.GenericValueOutput).output(d.result.pipeline)},{"Split Test":(new c.GenericValueOutput).output(d.result.splitTest)})],[4,(new u.TableBuilder).build(h,r)]):[3,2];case 1:f=o.sent(),p=f.gridOptions,o.label=2;case 2:return[2,{container:n,gridOptions:p}]}})})},e}();t.ExecutionReportResolvedPipelineSection=p},825:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(812),l=n(0),s=n(814),u=n(811),c=n(813),p=function(){function e(){}return e.prototype.build=function(e){return r(this,void 0,void 0,function(){var t,n,r,p,d,h,f;return o(this,function(o){switch(o.label){case 0:return t=a.ExecutionReport.standardSectionHeader("Query Params Override"),n=t.container,r=t.agGridElement,(d=l.find(e.children,function(e){return e.name==a.EXECUTION_REPORT_SECTION.QUERY_PARAM_OVERRIDE}))?(h=[i({},(new s.ExecutionReportGenericSection).build(d),{Applied:(new c.GenericValueOutput).output(d.applied)})],[4,(new u.TableBuilder).build(h,r)]):[3,2];case 1:f=o.sent(),p=f.gridOptions,o.label=2;case 2:return[2,{container:n,gridOptions:p}]}})})},e}();t.ExecutionReportQueryOverrideSection=p},826:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var o=n(812),a=n(0),l=n(813),s=n(1),u=["Facets","RankingOverrides","RankingExpressions"],c=function(){function e(){}return e.prototype.build=function(e){return i(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){return t=o.ExecutionReport.standardSectionHeader("Query sent to index").container,n=s.$$("table",{className:"coveo-relevance-inspector-table"}),t.append(n.el),i=a.findWhere(e.children,{description:o.EXECUTION_REPORT_SECTION.INDEX_QUERY}),i&&a.each(i.result.in,function(e,t){var i=s.$$("tr");n.append(i.el);var r="executionReportIndexExecution"+t;if(a.contains(u,t)&&e){var o=s.$$("button",{className:"coveo-button",type:"button"},t),c=s.$$("td",{id:r,className:"coveo-relevance-inspector-effective-query-collapsible"},(new l.GenericValueOutput).output(e).content);o.on("click",function(){c.toggleClass("coveo-active")}),i.append(s.$$("td",void 0,o).el),i.append(c.el)}else i.append(s.$$("td",void 0,t).el),i.append(s.$$("td",void 0,(new l.GenericValueOutput).output(e).content).el)}),[2,{container:t}]})})},e}();t.ExecutionReportEffectiveIndexQuerySection=c},827:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(812),l=n(811),s=n(0),u=n(813),c=n(49),p=function(){function e(){}return e.prototype.build=function(e,t,n){return r(this,void 0,void 0,function(){var c,p,d,h,f,v,b=this;return o(this,function(g){switch(g.label){case 0:return c=a.ExecutionReport.standardSectionHeader("Ranking Modifiers & Machine Learning Boosts"),p=c.container,d=c.agGridElement,h=s.map(t,function(t){return r(b,void 0,void 0,function(){var r,a,s,c,p,d,h;return o(this,function(o){switch(o.label){case 0:return r=/^(@permanentid|@urihash)="?([a-zA-Z0-9]+)"?$/,(a=l.TableBuilder.thumbnailCell(null,null),s="-- NULL --",c=null,p=t.expression.match(r))?(d=p[2],[4,this.extractDocumentInfoFromBoost(e,d,t,n)]):[3,2];case 1:h=o.sent(),a=l.TableBuilder.thumbnailCell(h.result,n),c=h.result,s=h.returnedByIndexForCurrentQuery.toString(),o.label=2;case 2:return[2,i({},a,{ReturnedByIndexForCurrentQuery:(new u.GenericValueOutput).output(s),IsRecommendation:(new u.GenericValueOutput).output(c?c.isRecommendation:"-- NULL --"),Expression:i({},(new u.GenericValueOutput).output(t.expression),{width:150}),Modifier:(new u.GenericValueOutput).output(t.modifier)})]}})})}),[4,Promise.all(h)];case 1:return f=g.sent(),[4,(new l.TableBuilder).build(f,d,{rowHeight:150})];case 2:return v=g.sent().gridOptions,[2,{container:p,gridOptions:v}]}})})},e.prototype.extractDocumentInfoFromBoost=function(e,t,n,i){return r(this,void 0,void 0,function(){var r,a,l,u;return o(this,function(o){switch(o.label){case 0:return r={result:null,returnedByIndexForCurrentQuery:!1},(a=s.find(e,function(e){return e.raw.permanentid==t||e.raw.urihash==t}))?(r={result:a,returnedByIndexForCurrentQuery:!0},[2,r]):(l=new c.QueryBuilder,l.advancedExpression.add(n.expression),[4,i.queryController.getEndpoint().search(l.build())]);case 1:return u=o.sent(),r={result:u.results[0],returnedByIndexForCurrentQuery:!1},[2,r]}})})},e}();t.ExecutionReportRankingModifiers=p},828:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var o=n(812),a=n(0),l=n(811),s=n(1),u=n(4),c=n(120),p=n(816),d=function(){function e(){}return e.prototype.build=function(e){return i(this,void 0,void 0,function(){var t,n,i,s,u,c,p,d,h;return r(this,function(r){switch(r.label){case 0:return(t=a.find(e.children,function(e){return e.name==o.EXECUTION_REPORT_SECTION.PREPROCESS_QUERY}))?(n=t.result.in.lq,(i=a.find(t.children,function(e){return e.name==o.EXECUTION_REPORT_SECTION.TOP_CLICKS}))&&n?(s=o.ExecutionReport.standardSectionHeader("Large Query Intelligent Term Detection (ITD)"),u=s.container,c=s.agGridElement,d=[{"Original large query":this.buildOriginalLongQueryCell(n,i.refinedQueries),"Keyword(s) extracted":this.buildRefinedQueryCell(e,i.refinedQueries,t)}],[4,(new l.TableBuilder).build(d,c,{rowHeight:300})]):[2,this.buildFallbackEmptyTable(e)]):[2,this.buildFallbackEmptyTable(e)];case 1:return h=r.sent(),p=h.gridOptions,[2,{container:u,gridOptions:p}]}})})},e.prototype.doHighlights=function(e,t){var n={};return a.each(t,function(e){n[e.q]=[]}),c.StreamHighlightUtils.highlightStreamText(e,n,{})},e.prototype.buildOriginalLongQueryCell=function(e,t){return{content:this.doHighlights(e,t),cellRenderer:l.GenericHtmlRenderer}},e.prototype.buildRefinedQueryCell=function(e,t,n){if(u.Utils.isNonEmptyArray(t))return this.buildRefinedQueryByMLCell(t);var i=a.find(n.children,function(e){return e.name==o.EXECUTION_REPORT_SECTION.PARTIAL_MATCH});return!!i&&i.result.out.match(/^PartialMatch/)?this.buildRefinedQueryByPartialMatchCell(i):this.buildRefinedQueryNoExtraction()},e.prototype.buildRefinedQueryByMLCell=function(e){var t=this,n=s.$$("div",void 0,s.$$("h2",void 0,"Extraction and scoring performed using Coveo Machine Learning:")),i=s.$$("ul");return n.append(i.el),a.chain(e).map(function(e){var n=t.doHighlights("Keyword: "+e.q+" ==> Score: "+e.score,[e]);return s.$$("li",null,n)}).each(function(e){i.append(e.el)}),{content:n,cellRenderer:l.GenericHtmlRenderer}},e.prototype.buildRefinedQueryByPartialMatchCell=function(e){var t=s.$$("div");t.append(s.$$("h2",void 0,"Coveo Machine learning was unable to suggest any refined keywords").el),t.append(s.$$("h4",void 0,"Fallback on Coveo Index partial match feature").el);var n=s.$$("code",void 0,e.result.out);return t.append(n.el),{content:t,cellRenderer:l.GenericHtmlRenderer}},e.prototype.buildRefinedQueryNoExtraction=function(){var e=s.$$("div");return e.append(s.$$("h2",void 0,"No keywords were extracted").el),e.append(s.$$("h4",void 0,"The query is probably too small, or Coveo is lacking usage analytics data to return any meaningful suggestions.").el),{content:e,cellRenderer:l.GenericHtmlRenderer}},e.prototype.buildFallbackEmptyTable=function(e){return new p.ExecutionReportSimpleSection(o.EXECUTION_REPORT_SECTION.NONE,o.EXECUTION_REPORT_SECTION.NONE,"Large Query Intelligent Term Detection (ITD)").build(e)},e}();t.ExecutionReportITDSection=d},829:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,l,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var a=n(811),l=n(0),s=n(813),u=n(74),c=n(49),p=n(198),d=function(){function e(e){this.bindings=e}return e.prototype.build=function(){return r(this,void 0,void 0,function(){var e,t,n,r,c,p,d=this;return o(this,function(o){switch(o.label){case 0:return e=u.$$("div"),t=u.$$("div",{className:"ag-theme-fresh"}),e.append(t.el),this.bindings.queryController?[4,this.bindings.queryController.getEndpoint().listFields()]:[3,2];case 1:return r=o.sent(),[3,3];case 2:r=null,o.label=3;case 3:return(n=r)?(c=l.map(n,function(t){return{Name:(new s.GenericValueOutput).output(t.name),Description:i({},(new s.GenericValueOutput).output(t.description),{width:150}),"Default Value":(new s.GenericValueOutput).output(t.defaultValue),"Field Type":(new s.GenericValueOutput).output(t.fieldType),"Field Source Type":(new s.GenericValueOutput).output(t.fieldSourceType),"Include In Query":(new s.GenericValueOutput).output(t.includeInQuery),"Include In Results":(new s.GenericValueOutput).output(t.includeInResults),"Group By Field":(new s.GenericValueOutput).output(t.groupByField),"Split Group By Field":(new s.GenericValueOutput).output(t.splitGroupByField),"Sort By Field":(new s.GenericValueOutput).output(t.sortByField),"Sample Of Available Values":{content:{content:{description:t,bindings:d.bindings,container:e}},width:200,suppressSorting:!0,suppressFilter:!0,cellRenderer:h}}}),[4,(new a.TableBuilder).build(c,t,{enableFilter:!0,rowModelType:"infinite",pagination:!0,paginationPageSize:25,rowHeight:100,enableServerSideFilter:!0,enableServerSideSorting:!0,datasource:new f(c)})]):[3,5];case 4:p=o.sent().gridOptions,this.gridOptions=p,o.label=5;case 5:return[2,e]}})})},e}();t.AvailableFieldsTable=d;var h=function(){function e(){}return e.prototype.init=function(e){e.value&&e.value.content&&(this.description=e.value.content.description,this.bindings=e.value.content.bindings,this.container=e.value.content.container)},e.prototype.getGui=function(){var e,t=this,n=u.$$("button",{className:"coveo-button coveo-available-fields-table-button",type:"button"},"Hover For Sample Values"),i=!1;return n.on("mouseover",function(){return r(t,void 0,void 0,function(){var t;return o(this,function(r){switch(r.label){case 0:return i=!0,this.description&&this.container&&i?[4,this.getFieldsValues(this.description)]:[3,2];case 1:t=r.sent(),i&&(e=this.renderFieldValues(t),this.container.append(e.el),u.PopupUtils.positionPopup(e.el,n.el,document.body,{horizontal:p.PopupHorizontalAlignment.LEFT,vertical:p.PopupVerticalAlignment.MIDDLE})),i=!1,r.label=2;case 2:return[2]}})})}),n.on("mouseout",function(){e&&e.remove(),i=!1}),n.el},e.prototype.getFieldsValues=function(e){return r(this,void 0,void 0,function(){var t,n,i;return o(this,function(r){switch(r.label){case 0:return this.bindings&&this.description&&this.bindings.queryController&&this.container?e.groupByField?[4,this.bindings.queryController.getEndpoint().listFieldValues({field:this.description.name})]:[3,2]:[2,[]];case 1:return[2,r.sent()];case 2:return t=new c.QueryBuilder,t.advancedExpression.add(e.name),this.bindings?[4,this.bindings.queryController.getEndpoint().search(t.build())]:[3,4];case 3:return i=r.sent(),[3,5];case 4:i=null,r.label=5;case 5:return n=i,n?[2,l.map(n.results,function(t){return{value:u.Utils.getFieldValue(t,e.name)}})]:[2,[]];case 6:return[2]}})})},e.prototype.renderFieldValues=function(e){var t=u.$$("ul",{className:"coveo-relevance-inspector-available-fields-popup"});return t.el.style.background="white",0==e.length?t.append(u.$$("li",void 0,"No Values Available ...").el):e.forEach(function(e){var n=u.$$("li",{className:"coveo-relevance-inspector-available-fields-popup-value"},(new s.GenericValueOutput).output(e.value).content);t.append(n.el)}),t},e.prototype.refresh=function(){return!0},e}();t.AvailableFieldsSampleValue=h;var f=function(){function e(e){this.dataSource=e,this.rowsData=[],this.rowsData=l.map(this.dataSource,function(e){var t={},n=function(e,i){null!=e.content?t[i]=e.content:e.children&&l.each(e.children,function(e){l.each(e,n)})};return l.each(e,n),t})}return e.prototype.getRows=function(e){var t=this.filter(this.rowsData,e.filterModel),n=this.sort(t,e.sortModel);e.successCallback(n.slice(e.startRow,e.endRow),n.length)},e.prototype.filter=function(e,t){return l.each(t,function(t,n){switch(t.type){case"equals":e=l.where(e,(i={},i[n]=t.filter,i));break;case"notEqual":e=l.reject(e,function(e){return e[n]==t.filter});break;case"startsWith":e=l.filter(e,function(e){return 0==e[n].toLowerCase().indexOf(t.filter)});break;case"endsWith":e=l.filter(e,function(e){return e[n].toLowerCase().indexOf(t.filter)==e[n].length-t.filter.length});break;case"contains":e=l.filter(e,function(e){return-1!=e[n].toLowerCase().indexOf(t.filter)});break;case"notContains":e=l.filter(e,function(e){return-1==e[n].toLowerCase().indexOf(t.filter)})}var i}),e},e.prototype.sort=function(e,t){if(t&&t[0]){var n=t[0];return e.sort(function(e,t){var i=e[n.colId],r=t[n.colId],o="asc"==n.sort?1:-1;return u.Utils.isNullOrEmptyString(i)&&u.Utils.isNullOrEmptyString(r)?0:u.Utils.isNullOrEmptyString(i)?-1*o:u.Utils.isNullOrEmptyString(r)?1*o:isNaN(i)||isNaN(r)?i.localeCompare(r)*o:(Number(i)-Number(r))*o})}return e},e}();t.AvailableFieldsDatasource=f},830:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(815),r=n(1),o=n(0),a=n(4),l=function(){function e(e){this.result=e,this.rankingInfo=i.parseRankingInfo(e.rankingInfo)}return e.prototype.build=function(){var e=r.$$("div",{className:"coveo-relevance-inspector-inline-ranking"});o.each(this.rankingInfo.documentWeights,function(t,n){var i=r.$$("div",{className:"coveo-relevance-inspector-inline-ranking-section"},n+": "+t);e.append(i.el)});var t=r.$$("div",{className:"coveo-relevance-inspector-highlight coveo-relevance-inspector-inline-ranking-section"},"Total: "+this.rankingInfo.totalWeight);return e.append(t.el),this.rankingInfo.termsWeight&&this.buildTogglableTermsSection(e),a.Utils.isNonEmptyArray(this.rankingInfo.qreWeights)&&this.buildTogglableQRESection(e),e},e.prototype.buildTogglableTermsSection=function(e){var t=r.$$("button",{className:"coveo-button coveo-relevance-inspector-inline-ranking-button",type:"button"},"Toggle Terms Relevancy Breakdown");e.append(t.el);var n=r.$$("div",{className:"coveo-relevance-inspector-inline-ranking-terms"});e.append(n.el),o.each(this.rankingInfo.termsWeight||{},function(e,t){var o="Keyword: "+t;n.append(r.$$("h2",void 0,o).el),n.append(i.buildListOfTermsElement(e.Weights).el)}),t.on("click",function(){return n.toggleClass("coveo-active")})},e.prototype.buildTogglableQRESection=function(e){var t=r.$$("button",{className:"coveo-button coveo-relevance-inspector-inline-ranking-button",type:"button"},"Toggle QRE Breakdown");e.append(t.el);var n=r.$$("ul",{className:"coveo-relevance-inspector-inline-ranking-terms"});e.append(n.el),o.each(this.rankingInfo.qreWeights,function(e){n.append(r.$$("dd",{className:"coveo-relevance-inspector-inline-ranking-qre-expression"},""+e.expression).el),n.append(r.$$("dt",void 0,"Score: "+e.score).el)}),t.on("click",function(){return n.toggleClass("coveo-active")})},e}();t.InlineRankingInfo=l}});
//# sourceMappingURL=RelevanceInspector.min__cf4c4f4dd6c8a707e936.js.map