text: webpackJsonpCoveo__temporary([15],{127:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(48),i=n(48);t.notWordStart=" ()[],$@'\"",t.notInWord=" ()[],:",t.Basic={basicExpressions:["Word","DoubleQuoted"],grammars:{DoubleQuoted:'"[NotDoubleQuote]"',NotDoubleQuote:/[^"]*/,SingleQuoted:"'[NotSingleQuote]'",NotSingleQuote:/[^']*/,Number:/-?(0|[1-9]\d*)(\.\d+)?/,Word:function(e,n,r){var o=new RegExp("[^"+t.notWordStart.replace(/(.)/g,"\\$1")+"][^"+t.notInWord.replace(/(.)/g,"\\$1")+"]*"),u=e.match(o);null!=u&&0!=u.index&&(u=null);var a=new s.Result(null!=u?u[0]:null,r,e);return a.isSuccess()&&n&&e.length>a.value.length?new i.EndOfInputResult(a):a}}}},135:function(e,t,n){"use strict";var s=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 s(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(s.prototype=n.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0}),n(540);var i=n(11),r=n(92),o=n(3),u=n(175),a=n(213),l=n(5),c=n(15),p=n(13),h=n(6),g=n(1),d=n(10),f=n(7),y=n(8),v=n(2),m=n(481),b=n(482),x=function(e){function t(n,s,o){var l=e.call(this,n,t.ID,o)||this;l.element=n,l.options=s,l.bindings=o,n instanceof HTMLInputElement&&l.logger.error("Querybox cannot be used on an HTMLInputElement"),l.options=y.ComponentOptions.initComponentOptions(n,t,s),new m.QueryboxOptionsProcessing(l).postProcess(),g.$$(l.element).toggleClass("coveo-query-syntax-disabled",0==l.options.enableQuerySyntax),l.magicBox=a.createMagicBox(n,new u.Grammar("Query",{Query:"[Term*][Spaces?]",Term:"[Spaces?][Word]",Spaces:/ +/,Word:/[^ ]+/}),{inline:!0});var f=g.$$(l.magicBox.element).find("input");return f&&g.$$(f).setAttribute("aria-label",l.options.placeholder||h.l("Search")),l.bind.onRootElement(i.QueryEvents.buildingQuery,function(e){return l.handleBuildingQuery(e)}),l.bind.onRootElement(r.StandaloneSearchInterfaceEvents.beforeRedirect,function(){return l.updateQueryState()}),l.bind.onQueryState(c.MODEL_EVENTS.CHANGE_ONE,p.QUERY_STATE_ATTRIBUTES.Q,function(e){return l.handleQueryStateChanged(e)}),l.options.enableSearchAsYouType&&(g.$$(l.element).addClass("coveo-search-as-you-type"),l.magicBox.onchange=function(){l.searchAsYouType()}),l.magicBox.onsubmit=function(){l.submit()},l.magicBox.onblur=function(){l.updateQueryState()},l.magicBox.onclear=function(){l.updateQueryState(),l.options.triggerQueryOnClear&&(l.usageAnalytics.logSearchEvent(d.analyticsActionCauseList.searchboxClear,{}),l.triggerNewQuery(!1))},l}return s(t,e),t.prototype.submit=function(){this.magicBox.clearSuggestion(),this.updateQueryState(),this.usageAnalytics.logSearchEvent(d.analyticsActionCauseList.searchboxSubmit,{}),this.triggerNewQuery(!1)},t.prototype.setText=function(e){this.magicBox.setText(e),this.updateQueryState()},t.prototype.clear=function(){this.magicBox.clear()},t.prototype.getText=function(){return this.magicBox.getText()},t.prototype.getResult=function(){return this.magicBox.getResult()},t.prototype.getDisplayedResult=function(){return this.magicBox.getDisplayedResult()},t.prototype.getCursor=function(){return this.magicBox.getCursor()},t.prototype.resultAtCursor=function(e){return this.magicBox.resultAtCursor(e)},t.prototype.handleBuildingQuery=function(e){l.Assert.exists(e),l.Assert.exists(e.queryBuilder),this.updateQueryState(),this.lastQuery=this.magicBox.getText(),new b.QueryboxQueryParameters(this.options).addParameters(e.queryBuilder,this.lastQuery)},t.prototype.triggerNewQuery=function(e){clearTimeout(this.searchAsYouTypeTimeout);var t=this.magicBox.getText();this.lastQuery!=t&&null!=t&&(this.lastQuery=t,this.queryController.executeQuery({searchAsYouType:e,logInActionsHistory:!0}))},t.prototype.updateQueryState=function(){this.queryStateModel.set(p.QueryStateModel.attributesEnum.q,this.magicBox.getText())},t.prototype.handleQueryStateChanged=function(e){l.Assert.exists(e);var t=e.value;t!=this.magicBox.getText()&&this.magicBox.setText(t)},t.prototype.searchAsYouType=function(){var e=this;clearTimeout(this.searchAsYouTypeTimeout),this.searchAsYouTypeTimeout=window.setTimeout(function(){e.usageAnalytics.logSearchAsYouType(d.analyticsActionCauseList.searchboxAsYouType,{}),e.triggerNewQuery(!0)},this.options.searchAsYouTypeDelay)},t.ID="Querybox",t.doExport=function(){o.exportGlobally({Querybox:t,QueryboxQueryParameters:b.QueryboxQueryParameters})},t.options={enableSearchAsYouType:y.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"Advanced Options"}),searchAsYouTypeDelay:y.ComponentOptions.buildNumberOption({defaultValue:50,min:0,section:"Advanced Options"}),enableQuerySyntax:y.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"Advanced Options"}),enableWildcards:y.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"Advanced Options"}),enableQuestionMarks:y.ComponentOptions.buildBooleanOption({defaultValue:!1,depend:"enableWildcards"}),enableLowercaseOperators:y.ComponentOptions.buildBooleanOption({defaultValue:!1,depend:"enableQuerySyntax"}),enablePartialMatch:y.ComponentOptions.buildBooleanOption({defaultValue:!1}),partialMatchKeywords:y.ComponentOptions.buildNumberOption({defaultValue:5,min:1,depend:"enablePartialMatch"}),partialMatchThreshold:y.ComponentOptions.buildStringOption({defaultValue:"50%",depend:"enablePartialMatch"}),triggerQueryOnClear:y.ComponentOptions.buildBooleanOption({defaultValue:!1})},t}(f.Component);t.Querybox=x,v.Initialization.registerAutoCreateComponent(x)},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(465),i=n(467),r=n(469),o=n(0),u=n(470),a=n(210),l=n(471),c=function(){function e(e,t){void 0===t&&(t={}),this.expressions={},this.start=new s.ExpressionRef(e,null,"start",this),this.addExpressions(t)}return e.prototype.addExpressions=function(e){var t=this;o.each(e,function(e,n){t.addExpression(n,e)})},e.prototype.addExpression=function(t,n){if(t in this.expressions)throw new Error("Grammar already contain the id:"+t);this.expressions[t]=e.buildExpression(n,t,this)},e.prototype.getExpression=function(e){return this.expressions[e]},e.prototype.parse=function(e){return this.start.parse(e,!0)},e.buildExpression=function(e,t,n){if(void 0===e)throw new Error("Invalid Expression: "+e);if(o.isString(e))return this.buildStringExpression(e,t,n);if(o.isArray(e))return new i.ExpressionOptions(o.map(e,function(e,i){return new s.ExpressionRef(e,null,t+"_"+i,n)}),t);if(o.isRegExp(e))return new r.ExpressionRegExp(e,t,n);if(o.isFunction(e))return new u.ExpressionFunction(e,t,n);throw new Error("Invalid Expression: "+e)},e.buildStringExpression=function(t,n,i){var r=e.stringMatch(t,e.spliter),u=o.map(r,function(e,t){if(e[1]){var r=e[1],o=e[3]?Number(e[3]):e[2]||null;return new s.ExpressionRef(r,o,n+"_"+t,i)}return new a.ExpressionConstant(e[4],n+"_"+t)});if(1==u.length){var c=u[0];return c.id=n,c}return new l.ExpressionList(u,n)},e.stringMatch=function(e,t){for(var n=[],s=new RegExp(t.source,"g"),i=s.exec(e);null!==i;)n.push(i),i=s.exec(e);return n},e.spliter=/\[(\w+)(\*|\+|\?|\{([1-9][0-9]*)\})?\]|(.[^\[]*)/,e}();t.Grammar=c},209:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionEndOfInput={id:"end of input",parse:null}},210:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(48),i=n(48),r=function(){function e(e,t){this.value=e,this.id=t}return e.prototype.parse=function(e,t){var n=0==e.indexOf(this.value),r=new s.Result(n?this.value:null,this,e);return n&&t&&e.length>this.value.length?new i.EndOfInputResult(r):r},e.prototype.toString=function(){return this.value},e}();t.ExpressionConstant=r},211:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(127),i=n(473);t.Field={basicExpressions:["FieldSimpleQuery","FieldQuery","Field"],grammars:{FieldQuery:"[Field][OptionalSpaces][FieldQueryOperation]",FieldQueryOperation:["FieldQueryValue","FieldQueryNumeric"],FieldQueryValue:"[FieldOperator][OptionalSpaces][FieldValue]",FieldQueryNumeric:"[FieldOperatorNumeric][OptionalSpaces][FieldValueNumeric]",FieldSimpleQuery:"[FieldName]:[OptionalSpaces][FieldValue]",Field:"@[FieldName]",FieldName:/[a-zA-Z][a-zA-Z0-9\.\_]*/,FieldOperator:/==|=|<>/,FieldOperatorNumeric:/<=|>=|<|>/,FieldValue:["DateRange","NumberRange","DateRelative","Date","Number","FieldValueList","FieldValueString"],FieldValueNumeric:["DateRelative","Date","Number"],FieldValueString:["DoubleQuoted","FieldValueNotQuoted"],FieldValueList:"([FieldValueString][FieldValueStringList*])",FieldValueStringList:"[FieldValueSeparator][FieldValueString]",FieldValueSeparator:/ *, */,FieldValueNotQuoted:/[^ \(\),]+/,NumberRange:"[Number][Spaces?]..[Spaces?][Number]"},include:[i.Date,s.Basic]}},212:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{a(s.next(e))}catch(e){r(e)}}function u(e){try{a(s.throw(e))}catch(e){r(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}a((s=s.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){function n(e){return function(t){return s([e,t])}}function s(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(o=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[0,o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],r=0}finally{i=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),u=n(33),a=n(7),l=n(1),c=n(538),p=n(477);!function(e){e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right"}(r=t.Direction||(t.Direction={}));var h=function(){function e(e,t,n,s){var i=this;this.element=e,this.magicBoxContainer=t,this.inputManager=n,this.root=a.Component.resolveRoot(e),this.options=o.defaults(s,{suggestionClass:"magic-box-suggestion",selectedClass:"magic-box-selected"}),void 0==this.options.timeout&&(this.options.timeout=500),this.hasSuggestions=!1,l.$$(this.element).on("mouseover",function(e){i.handleMouseOver(e)}),l.$$(this.element).on("mouseout",function(e){i.handleMouseOut(e)}),this.suggestionsProcessor=new p.QueryProcessor({timeout:this.options.timeout}),this.resultPreviewsManager=new c.ResultPreviewsManager(e,{selectedClass:this.options.selectedClass,timeout:this.options.timeout}),this.suggestionsListbox=this.buildSuggestionsContainer(),l.$$(this.element).append(this.suggestionsListbox.el),this.addAccessibilityPropertiesForCombobox(),this.appendEmptySuggestionOption()}return Object.defineProperty(e.prototype,"hasFocus",{get:function(){return l.$$(this.element).findClass(this.options.selectedClass).length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPreviews",{get:function(){return this.resultPreviewsManager.hasPreviews},enumerable:!0,configurable:!0}),e.prototype.handleMouseOver=function(e){var t=l.$$(e.target),n=t.parents(this.options.suggestionClass);t.hasClass(this.options.suggestionClass)?this.processMouseSelection(t.el):n.length>0&&this.element.contains(n[0])&&this.processMouseSelection(n[0])},e.prototype.handleMouseOut=function(e){var t=l.$$(e.target),n=t.parents(this.options.suggestionClass);if(e.relatedTarget&&l.$$(e.relatedTarget).isValid()){var s=l.$$(e.relatedTarget).parents(this.options.suggestionClass);t.hasClass(this.options.selectedClass)&&!l.$$(e.relatedTarget).hasClass(this.options.suggestionClass)?this.removeSelectedStatus(t.el):0==s.length&&n.length>0&&this.removeSelectedStatus(n[0])}else t.hasClass(this.options.selectedClass)?this.removeSelectedStatus(t.el):n.length>0&&this.removeSelectedStatus(n[0]);l.$$(this.root).trigger(u.OmniboxEvents.querySuggestLoseFocus)},e.prototype.moveDown=function(){return s(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.move(r.Down)];case 1:return e.sent(),[2]}})})},e.prototype.moveUp=function(){return s(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.move(r.Up)];case 1:return e.sent(),[2]}})})},e.prototype.moveLeft=function(){return s(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.move(r.Left)];case 1:return e.sent(),[2]}})})},e.prototype.moveRight=function(){return s(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.move(r.Right)];case 1:return e.sent(),[2]}})})},e.prototype.selectAndReturnKeyboardFocusedElement=function(){var e=this.keyboardFocusedElement;return e&&(l.$$(e).trigger("keyboardSelect"),this.keyboardFocusedElement=null,this.inputManager.blur()),e},e.prototype.clearKeyboardFocusedElement=function(){this.keyboardFocusedElement=null},e.prototype.receiveSuggestions=function(e){return s(this,void 0,void 0,function(){var t,n,s;return i(this,function(i){switch(i.label){case 0:return[4,this.suggestionsProcessor.processQueries(e)];case 1:return t=i.sent(),(n=t.results,s=t.status,s===p.ProcessingStatus.Overriden)?[2,[]]:(this.updateSuggestions(n),[2,n])}})})},e.prototype.clearSuggestions=function(){this.updateSuggestions([])},e.prototype.updateSuggestions=function(e){var t=this;if(this.suggestionsListbox.empty(),this.inputManager.input.removeAttribute("aria-activedescendant"),this.hasSuggestions=e.length>0,l.$$(this.element).toggleClass("magic-box-hasSuggestion",this.hasSuggestions),l.$$(this.magicBoxContainer).setAttribute("aria-expanded",this.hasSuggestions.toString()),this.resultPreviewsManager.displaySearchResultPreviewsForSuggestion(null),!this.hasSuggestions)return this.appendEmptySuggestionOption(),void l.$$(this.root).trigger(u.OmniboxEvents.querySuggestLoseFocus);o.each(e,function(n){var s=n.dom?t.modifyDomFromExistingSuggestion(n.dom):t.createDomFromSuggestion(n);s.setAttribute("id","magic-box-suggestion-"+o.indexOf(e,n)),s.setAttribute("role","option"),s.setAttribute("aria-selected","false"),s.setAttribute("aria-label",s.text()),s.suggestion=n,t.suggestionsListbox.append(s.el)}),l.$$(this.root).trigger(u.OmniboxEvents.querySuggestRendered)},Object.defineProperty(e.prototype,"selectedSuggestion",{get:function(){return this.htmlElementIsSuggestion(this.keyboardFocusedElement)?this.returnMoved(this.keyboardFocusedElement):null},enumerable:!0,configurable:!0}),e.prototype.processKeyboardSelection=function(e){return s(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.addSelectedStatus(e),this.keyboardFocusedElement=e,l.$$(this.inputManager.input).setAttribute("aria-activedescendant",l.$$(e).getAttribute("id")),[4,this.updateSelectedSuggestion(e)];case 1:return t.sent(),[2]}})})},e.prototype.processKeyboardPreviewSelection=function(e){this.addSelectedStatus(e),this.keyboardFocusedElement=e},e.prototype.processMouseSelection=function(e){this.addSelectedStatus(e),this.updateSelectedSuggestion(e),this.keyboardFocusedElement=null},e.prototype.buildSuggestionsContainer=function(){return l.$$("div",{className:"coveo-magicbox-suggestions",id:"coveo-magicbox-suggestions",role:"listbox"})},e.prototype.createDomFromSuggestion=function(e){var t=this,n=l.$$("div",{className:"magic-box-suggestion "+this.options.suggestionClass});if(n.on("click",function(){t.selectSuggestion(e)}),n.on("keyboardSelect",function(){t.selectSuggestion(e)}),e.html)return n.el.innerHTML=e.html,n;if(e.text)return n.text(e.text),n;if(e.separator){n.addClass("magic-box-suggestion-seperator");var s=l.$$("div",{className:"magic-box-suggestion-seperator-label"},e.separator);return n.append(s.el),n}return n},e.prototype.selectSuggestion=function(e){e.onSelect(),l.$$(this.root).trigger(u.OmniboxEvents.querySuggestSelection,{suggestion:e.text})},e.prototype.appendEmptySuggestionOption=function(){this.suggestionsListbox.append(l.$$("div",{role:"option"}).el)},e.prototype.modifyDomFromExistingSuggestion=function(e){this.removeSelectedStatus(e);var t=l.$$(e).find("."+this.options.suggestionClass);return this.removeSelectedStatus(t),l.$$(e)},e.prototype.move=function(e){return s(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.resultPreviewsManager.focusedPreviewElement?[4,this.moveWithinPreview(e)]:[3,2];case 1:return n.sent(),[2];case 2:return e!==r.Right&&e!==r.Left||!(t=this.resultPreviewsManager.previewElements[0])?[4,this.moveWithinSuggestion(e)]:(this.processKeyboardPreviewSelection(t),[2]);case 3:return n.sent(),[2]}})})},e.prototype.moveWithinSuggestion=function(e){return s(this,void 0,void 0,function(){var t,n,s,u;return i(this,function(i){switch(i.label){case 0:return t=l.$$(this.element).find("."+this.options.selectedClass),n=l.$$(this.element).findAll("."+this.options.suggestionClass),s=o.indexOf(n,t),u=e===r.Up?s-1:s+1,u=(u+n.length)%n.length,[4,this.selectQuerySuggest(n[u])];case 1:return i.sent(),[2]}})})},e.prototype.selectQuerySuggest=function(e){return s(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e?[4,this.processKeyboardSelection(e)]:[3,2];case 1:return t.sent(),[3,3];case 2:this.keyboardFocusedElement=null,this.inputManager.input.removeAttribute("aria-activedescendant"),t.label=3;case 3:return[2,e]}})})},e.prototype.moveWithinPreview=function(e){return s(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return t=this.resultPreviewsManager.getElementInDirection(e),t?[3,2]:[4,this.selectQuerySuggest(this.resultPreviewsManager.previewsOwner)];case 1:return n.sent(),[2];case 2:return this.processKeyboardPreviewSelection(t),[2]}})})},e.prototype.returnMoved=function(e){if(e){if(e.suggestion)return e.suggestion;if(e["no-text-suggestion"])return null;if(e instanceof HTMLElement)return{text:l.$$(e).text()}}return null},e.prototype.addSelectedStatus=function(e){for(var t=this.element.getElementsByClassName(this.options.selectedClass),n=0;n<t.length;n++){var s=t.item(n);this.removeSelectedStatus(s)}l.$$(e).addClass(this.options.selectedClass),this.updateAreaSelectedIfDefined(e,"true")},e.prototype.updateSelectedSuggestion=function(e){return s(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return l.$$(this.root).trigger(u.OmniboxEvents.querySuggestGetFocus,{suggestion:e.innerText}),[4,this.resultPreviewsManager.displaySearchResultPreviewsForSuggestion(e)];case 1:return t.sent(),[2]}})})},e.prototype.removeSelectedStatus=function(e){l.$$(e).removeClass(this.options.selectedClass),this.updateAreaSelectedIfDefined(e,"false")},e.prototype.updateAreaSelectedIfDefined=function(e,t){l.$$(e).getAttribute("aria-selected")&&l.$$(e).setAttribute("aria-selected",t)},e.prototype.addAccessibilityPropertiesForCombobox=function(){var e=l.$$(this.magicBoxContainer),t=l.$$(this.inputManager.input);e.setAttribute("aria-expanded","false"),e.setAttribute("role","combobox"),e.setAttribute("aria-owns","coveo-magicbox-suggestions"),e.setAttribute("aria-haspopup","listbox"),t.el.removeAttribute("aria-activedescendant"),t.setAttribute("aria-controls","coveo-magicbox-suggestions"),t.setAttribute("aria-autocomplete","list")},e.prototype.htmlElementIsSuggestion=function(e){var t=l.$$(this.element).findAll("."+this.options.suggestionClass);return o.indexOf(t,e)>-1},e}();t.SuggestionsManager=h},213:function(e,t,n){"use strict";function s(e,t,n){return new d(e,t,n)}function i(e){return"requestAnimationFrame"in window?window.requestAnimationFrame(e):setTimeout(e)}var r=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{a(s.next(e))}catch(e){r(e)}}function u(e){try{a(s.throw(e))}catch(e){r(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}a((s=s.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return s([e,t])}}function s(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(o=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[0,o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],r=0}finally{i=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),a=n(23),l=n(1),c=n(536),p=n(476),h=n(539),g=n(212),d=function(){function e(e,t,n){void 0===n&&(n={});var s=this;this.element=e,this.grammar=t,this.options=n,this.lastSuggestions=[],u.isUndefined(this.options.inline)&&(this.options.inline=!1),l.$$(e).addClass("magic-box"),this.options.inline&&l.$$(e).addClass("magic-box-inline"),this.result=this.grammar.parse(""),this.displayedResult=this.result.clean();var i=l.$$(e).find(".magic-box-input");i||(i=document.createElement("div"),i.className="magic-box-input",e.appendChild(i)),this.inputManager=new p.InputManager(i,function(e,t){t?(s.setText(e),s.onselect&&s.onselect(s.firstSuggestionWithText)):(s.setText(e),s.addSuggestions(),s.onchange&&s.onchange())},this),this.inputManager.ontabpress=function(){s.ontabpress&&s.ontabpress()};var r=this.inputManager.getValue();r&&(this.displayedResult.input=r),this.inputManager.setResult(this.displayedResult);var o=document.createElement("div");o.className="magic-box-suggestions",this.element.appendChild(o),this.suggestionsManager=new g.SuggestionsManager(o,this.element,this.inputManager,{suggestionClass:this.options.selectableSuggestionClass,selectedClass:this.options.selectedSuggestionClass,timeout:this.options.suggestionTimeout}),this.magicBoxClear=new h.MagicBoxClear(this),this.setupHandler()}return Object.defineProperty(e.prototype,"firstSuggestionWithText",{get:function(){return u.find(this.lastSuggestions,function(e){return e.text})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstSuggestionText",{get:function(){var e=this.firstSuggestionWithText;return e?e.text:""},enumerable:!0,configurable:!0}),e.prototype.getResult=function(){return this.result},e.prototype.getDisplayedResult=function(){return this.displayedResult},e.prototype.setText=function(e){l.$$(this.element).toggleClass("magic-box-notEmpty",e.length>0),this.magicBoxClear.toggleTabindexAndAriaHidden(e.length>0),this.result=this.grammar.parse(e),this.displayedResult=this.result.clean(),this.inputManager.setResult(this.displayedResult)},e.prototype.setCursor=function(e){this.inputManager.setCursor(e)},e.prototype.getCursor=function(){return this.inputManager.getCursor()},e.prototype.resultAtCursor=function(e){return this.displayedResult.resultAt(this.getCursor(),e)},e.prototype.setupHandler=function(){var e=this;this.inputManager.onblur=function(){l.$$(e.element).removeClass("magic-box-hasFocus"),e.onblur&&e.onblur(),e.options.inline||e.clearSuggestion()},this.inputManager.onfocus=function(){l.$$(e.element).addClass("magic-box-hasFocus"),e.addSuggestions(),e.onfocus&&e.onfocus()},this.inputManager.onkeydown=function(t){if(e.shouldMoveInSuggestions(t))return!1;if(t===a.KEYBOARD.ENTER){return null==e.suggestionsManager.selectAndReturnKeyboardFocusedElement()&&e.onsubmit&&e.onsubmit(),!1}return t===a.KEYBOARD.ESCAPE?(e.clearSuggestion(),e.blur()):e.suggestionsManager.clearKeyboardFocusedElement(),!0},this.inputManager.onchangecursor=function(){e.addSuggestions()},this.inputManager.onkeyup=function(t){if(e.onmove&&e.onmove(),!e.shouldMoveInSuggestions(t))return!0;switch(t){case a.KEYBOARD.UP_ARROW:e.suggestionsManager.moveUp();break;case a.KEYBOARD.DOWN_ARROW:e.suggestionsManager.moveDown();break;case a.KEYBOARD.LEFT_ARROW:e.suggestionsManager.moveLeft();break;case a.KEYBOARD.RIGHT_ARROW:e.suggestionsManager.moveRight()}return e.suggestionsManager.selectedSuggestion&&e.focusOnSuggestion(e.suggestionsManager.selectedSuggestion),e.onchange&&e.onchange(),!1}},e.prototype.addSuggestions=function(){return r(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,this.suggestionsManager.receiveSuggestions(null!=this.getSuggestions?this.getSuggestions():[])];case 1:return e=t.sent(),this.addSelectEventHandlers(e),this.inputManager.setWordCompletion(this.firstSuggestionText),this.onSuggestions(e),[2]}})})},e.prototype.shouldMoveInSuggestions=function(e){switch(e){case a.KEYBOARD.UP_ARROW:case a.KEYBOARD.DOWN_ARROW:return!0;case a.KEYBOARD.LEFT_ARROW:case a.KEYBOARD.RIGHT_ARROW:if(this.suggestionsManager.hasFocus&&this.suggestionsManager.hasPreviews)return!0}return!1},e.prototype.addSelectEventHandlers=function(e){var t=this;u.each(e,function(e){null==e.onSelect&&null!=e.text&&(e.onSelect=function(){t.setText(e.text),t.onselect&&t.onselect(e)})})},e.prototype.focus=function(){l.$$(this.element).addClass("magic-box-hasFocus"),this.inputManager.focus()},e.prototype.blur=function(){this.inputManager.blur()},e.prototype.clearSuggestion=function(){return r(this,void 0,void 0,function(){return o(this,function(e){return this.inputManager.setWordCompletion(null),this.suggestionsManager.clearSuggestions(),this.onSuggestions([]),[2]})})},e.prototype.focusOnSuggestion=function(e){null==e||null==e.text?this.inputManager.setResult(this.displayedResult,this.firstSuggestionText):this.inputManager.setResult(this.grammar.parse(e.text).clean(),e.text)},e.prototype.getText=function(){return this.inputManager.getValue()},e.prototype.getWordCompletion=function(){return this.inputManager.getWordCompletion()},e.prototype.clear=function(){this.setText(""),this.clearSuggestion(),this.focus(),this.onclear&&this.onclear()},e.prototype.hasSuggestions=function(){return this.suggestionsManager.hasSuggestions},e}();t.MagicBoxInstance=d,t.createMagicBox=s,t.requestAnimationFrame=i,c.doMagicBoxExport()},214:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),i=function(){function e(){}return e.escapeRegExp=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},e.highlightText=function(e,t,n,s,i){var r=this;if(void 0===n&&(n=!1),void 0===s&&(s="magic-box-hightlight"),void 0===i&&(i=""),0==t.length)return e;var o=this.escapeRegExp(t),u="("+o+")|(.*?(?="+o+")|.+)",a=new RegExp(u,n?"gi":"g");return e.replace(a,function(e,t,n){return r.escapeText(null!=t?s:i,e)})},e.escapeText=function(e,t){return'<span class="'+e+'">'+s.escape(t)+"</span>"},e}();t.MagicBoxUtils=i},465:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(48),i=n(466),r=n(209),o=n(0),u=function(){function e(e,t,n,s){this.ref=e,this.occurrence=t,this.id=n,this.grammar=s}return e.prototype.parse=function(e,t){var n=this.grammar.getExpression(this.ref);if(null==n)throw new Error("Expression not found:"+this.ref);return"?"==this.occurrence||null==this.occurrence?this.parseOnce(e,t,n):this.parseMany(e,t,n)},e.prototype.parseOnce=function(e,t,n){var u=n.parse(e,t),a=u.isSuccess();return a||"?"!=this.occurrence?new i.RefResult([u],this,e,a?null:u):t?0==e.length?new i.RefResult([],this,e,u):o.all(u.getBestExpect(),function(e){return e.expression==r.ExpressionEndOfInput})?new i.RefResult([new s.Result(null,r.ExpressionEndOfInput,e)],this,e,u):u:new i.RefResult([],this,e,null)},e.prototype.parseMany=function(e,t,n){var u,a,l=[],c=e;do{u=n.parse(c,!1),(a=u.isSuccess())&&(l.push(u),c=c.substr(u.getLength()))}while(a&&u.input!=c);var p=o.isNumber(this.occurrence)?this.occurrence:"+"==this.occurrence?1:0;if(l.length<p)l.push(u);else if(t)if(l.length>0){var h=o.last(l);u=n.parse(h.input,!0),u.isSuccess()?l[l.length-1]=u:(l.push(new s.Result(null,r.ExpressionEndOfInput,h.input.substr(h.getLength()))),u=n.parse(h.input.substr(h.getLength()),!0))}else if(0!=e.length){var g=new s.Result(null,r.ExpressionEndOfInput,e);return new i.RefResult([g],this,e,u)}return new i.RefResult(l,this,e,u)},e.prototype.toString=function(){return this.id},e}();t.ExpressionRef=u},466:function(e,t,n){"use strict";var s=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 s(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(s.prototype=n.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(48),r=n(0),o=function(e){function t(t,n,s,i){var o=e.call(this,t,n,s)||this;return o.expression=n,o.input=s,r.last(t)!=i&&(o.failAttempt=i,null!=o.failAttempt&&(o.failAttempt.parent=o)),o}return s(t,e),t.prototype.getExpect=function(){var t=e.prototype.getExpect.call(this);return null!=this.failAttempt?t.concat(this.failAttempt.getExpect()):t},t.prototype.clean=function(t){if(null!=this.failAttempt&&(null!=t||!this.isSuccess())){t=t||r.last(this.getBestExpect()).path(this);var n=r.first(t);if(null!=n&&n==this.failAttempt){var s=r.last(this.subResults),o=r.map(null!=s&&s.isSuccess()?this.subResults:r.initial(this.subResults),function(e){return e.clean()});return o.push(n.clean(r.rest(t))),new i.Result(o,this.expression,this.input)}}return e.prototype.clean.call(this,t)},t}(i.Result);t.RefResult=o},467:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(468),i=function(){function e(e,t){this.parts=e,this.id=t}return e.prototype.parse=function(e,t){for(var n=[],i=0;i<this.parts.length;i++){var r=this.parts[i].parse(e,t);if(r.isSuccess())return new s.OptionResult(r,this,e,n);n.push(r)}return new s.OptionResult(null,this,e,n)},e.prototype.toString=function(){return this.id},e}();t.ExpressionOptions=i},468:function(e,t,n){"use strict";var s=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 s(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(s.prototype=n.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(48),r=n(0),o=function(e){function t(t,n,s,i){var o=e.call(this,null!=t?[t]:null,n,s)||this;return o.result=t,o.expression=n,o.input=s,o.failAttempt=i,r.forEach(o.failAttempt,function(e){e.parent=o}),o}return s(t,e),t.prototype.getExpect=function(){var e=this,t=[];return null!=this.result&&(t=this.result.getExpect()),t=r.reduce(this.failAttempt,function(e,t){return e.concat(t.getExpect())},t),t.length>0&&r.all(t,function(t){return t.input==e.input})?[this]:t},t.prototype.clean=function(e){if(null!=e||!this.isSuccess()){e=r.rest(e||r.last(this.getBestExpect()).path(this));var t=r.first(e);return null==t?new i.Result(null,this.expression,this.input):new i.Result([t.clean(r.rest(e))],this.expression,this.input)}return new i.Result(r.map(this.result.subResults,function(e){return e.clean()}),this.expression,this.input)},t}(i.Result);t.OptionResult=o},469:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(48),i=n(48),r=function(){function e(e,t,n){this.value=e,this.id=t}return e.prototype.parse=function(e,t){var n=e.match(this.value);null!=n&&0!=n.index&&(n=null);var r=new s.Result(null!=n?n[0]:null,this,e);return r.isSuccess()&&t&&e.length>r.value.length?new i.EndOfInputResult(r):r},e.prototype.toString=function(){return this.id},e}();t.ExpressionRegExp=r},470:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t,n){this.func=e,this.id=t,this.grammar=n}return e.prototype.parse=function(e,t){return this.func(e,t,this)},e.prototype.toString=function(){return this.id},e}();t.ExpressionFunction=s},471:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(48),i=function(){function e(e,t){if(this.parts=e,this.id=t,0==e.length)throw new Error(JSON.stringify(t)+" should have at least 1 parts")}return e.prototype.parse=function(e,t){for(var n,i=[],r=e,o=0;o<this.parts.length;o++){if(n=this.parts[o].parse(r,t&&o==this.parts.length-1),i.push(n),!n.isSuccess())break;r=r.substr(n.getLength())}return new s.Result(i,this,e)},e.prototype.toString=function(){return this.id},e}();t.ExpressionList=i},472:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(211);t.NestedQuery={basicExpressions:["NestedQuery"],grammars:{NestedQuery:"[[NestedField][OptionalSpaces][Expressions]]",NestedField:"[[Field]]",FieldValue:["NestedQuery"]},include:[s.Field]}},473:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(127);t.Date={grammars:{Date:"[DateYear]/[DateMonth]/[DateDay]",DateYear:/([0-9]{4})/,DateMonth:/(1[0-2]|0?[1-9])/,DateDay:/([1-2][0-9]|3[0-1]|0?[1-9])/,DateRange:"[Date][Spaces?]..[Spaces?][Date]",DateRelative:["DateRelativeNegative","DateRelativeTerm"],DateRelativeTerm:/now|today|yesterday/,DateRelativeNegative:"[DateRelativeTerm][DateRelativeNegativeRef]",DateRelativeNegativeRef:/([\-\+][0-9]+(s|m|h|d|mo|y))/},include:[s.Basic]}},474:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(127);t.QueryExtension={basicExpressions:["QueryExtension"],grammars:{QueryExtension:"$[QueryExtensionName]([QueryExtensionArguments])",QueryExtensionName:/\w+/,QueryExtensionArguments:"[QueryExtensionArgumentList*][QueryExtensionArgument]",QueryExtensionArgumentList:"[QueryExtensionArgument][Spaces?],[Spaces?]",QueryExtensionArgument:"[QueryExtensionArgumentName]:[Spaces?][QueryExtensionArgumentValue]",QueryExtensionArgumentName:/\w+/,QueryExtensionArgumentValue:["SingleQuoted","Expressions"]},include:[s.Basic]}},475:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubExpression={basicExpressions:["SubExpression"],grammars:{SubExpression:"([Expressions])"}}},476:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),i=n(23),r=n(6),o=n(1),u=n(25),a=function(){function e(e,t,n){this.onchange=t,this.magicBox=n,this.hasFocus=!1,this.root=i.Component.resolveRoot(e),this.underlay=document.createElement("div"),this.underlay.className="magic-box-underlay",this.highlightContainer=document.createElement("span"),this.highlightContainer.className="magic-box-highlight-container",this.underlay.appendChild(this.highlightContainer),this.ghostTextContainer=document.createElement("span"),this.ghostTextContainer.className="magic-box-ghost-text",this.underlay.appendChild(this.ghostTextContainer),this.input=o.$$(e).find("input"),this.input?e.insertBefore(this.underlay,this.input):(this.input=document.createElement("input"),e.appendChild(this.underlay),e.appendChild(this.input)),this.setupHandler(),this.addAccessibilitiesProperties()}return e.prototype.updateInput=function(){this.input.value!=this.result.input&&(this.input.value=this.result.input,this.hasFocus&&this.setCursor(this.getValue().length))},e.prototype.updateHighlight=function(){o.$$(this.highlightContainer).empty(),this.highlightContainer.appendChild(this.result.toHtmlElement())},e.prototype.updateWordCompletion=function(){o.$$(this.ghostTextContainer).empty(),this.ghostTextContainer.innerHTML="",null!=this.wordCompletion&&this.ghostTextContainer.appendChild(document.createTextNode(this.wordCompletion.substr(this.result.input.length)))},e.prototype.setResult=function(e,t){this.result=e,this.updateInput(),this.updateHighlight(),s.isUndefined(t)&&null!=this.wordCompletion&&0==this.wordCompletion.indexOf(this.result.input)?this.updateWordCompletion():this.setWordCompletion(t),this.updateScroll()},e.prototype.setWordCompletion=function(e){null!=e&&0!=e.toLowerCase().indexOf(this.result.input.toLowerCase())&&(e=null),this.wordCompletion=e,this.updateWordCompletion(),this.updateScroll()},e.prototype.setCursor=function(e){if(this.input.focus(),this.input.createTextRange){var t=this.input.createTextRange();t.move("character",e),t.select()}else null!=this.input.selectionStart&&(this.input.focus(),this.input.setSelectionRange(e,e))},e.prototype.getCursor=function(){return this.input.selectionStart},e.prototype.updateScroll=function(e){var t=this;void 0===e&&(e=!0);var n=function(){t.underlay.clientWidth<t.underlay.scrollWidth&&(t.underlay.style.visibility="hidden",t.underlay.scrollLeft=t.input.scrollLeft,t.underlay.scrollTop=t.input.scrollTop,t.underlay.style.visibility="visible"),t.updateScrollDefer=null,t.hasFocus&&t.updateScroll()};e?null==this.updateScrollDefer&&(this.updateScrollDefer=requestAnimationFrame(n)):n()},e.prototype.setupHandler=function(){var e=this;this.input.onblur=function(){e.hasFocus=!1,setTimeout(function(){e.hasFocus||e.onblur&&e.onblur()},300),e.updateScroll()},this.input.onfocus=function(){e.hasFocus||(e.hasFocus=!0,e.updateScroll(),e.onfocus&&e.onfocus())},this.input.onkeydown=function(t){e.keydown(t)},this.input.onkeyup=function(t){e.keyup(t)},this.input.oncut=function(){setTimeout(function(){e.onInputChange()})},this.input.onpaste=function(){setTimeout(function(){e.onInputChange()})}},e.prototype.addAccessibilitiesProperties=function(){this.input.setAttribute("type","text"),this.input.setAttribute("role","searchbox"),this.input.setAttribute("form","coveo-dummy-form"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("title",r.l("InsertAQuery")+". "+r.l("PressEnterToSend"))},e.prototype.focus=function(){var e=this;this.hasFocus=!0,setTimeout(function(){e.input.focus(),e.setCursor(e.getValue().length)})},e.prototype.blur=function(){this.hasFocus&&this.input.blur()},e.prototype.keydown=function(e){var t=this;switch(e.keyCode||e.which){case u.KEYBOARD.TAB:this.tabPress(),this.magicBox.clearSuggestion();break;default:e.stopPropagation(),null==this.onkeydown||this.onkeydown(e.keyCode||e.which)?requestAnimationFrame(function(){t.onInputChange()}):e.preventDefault()}},e.prototype.keyup=function(e){switch(e.keyCode||e.which){case u.KEYBOARD.LEFT_ARROW:case u.KEYBOARD.RIGHT_ARROW:this.handleLeftRightArrow(e);break;default:null==this.onkeydown||this.onkeyup(e.keyCode||e.which)?this.onInputChange():e.preventDefault()}},e.prototype.handleLeftRightArrow=function(e){o.$$(this.root).find("."+i.Component.computeCssClassNameForType("QuerySuggestPreview"))||this.onchangecursor(),null==this.onkeydown||this.onkeyup(e.keyCode||e.which)?this.onInputChange():e.preventDefault()},e.prototype.tabPress=function(){this.ontabpress&&this.ontabpress(),this.onblur&&this.onblur()},e.prototype.onInputChange=function(){this.result.input!=this.input.value&&this.onchange(this.input.value,!1)},e.prototype.getValue=function(){return this.input.value},e.prototype.getWordCompletion=function(){return this.wordCompletion},e}();t.InputManager=a},477:function(e,t,n){"use strict";function s(e){return new Promise(function(t,n){return e.forEach(function(e){return Promise.resolve(e).then(t,n)})})}var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},r=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{a(s.next(e))}catch(e){r(e)}}function u(e){try{a(s.throw(e))}catch(e){r(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}a((s=s.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return s([e,t])}}function s(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(o=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[0,o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],r=0}finally{i=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};Object.defineProperty(t,"__esModule",{value:!0});var u,a=n(0);!function(e){e[e.Finished=0]="Finished",e[e.TimedOut=1]="TimedOut",e[e.Overriden=2]="Overriden"}(u=t.ProcessingStatus||(t.ProcessingStatus={}));var l=function(){function e(e){void 0===e&&(e={}),this.options=i({timeout:500},e)}return e.prototype.processQueries=function(e){return r(this,void 0,void 0,function(){var t,n=this;return o(this,function(i){return this.overrideIfProcessing(),this.processedResults=new Array(e.length),t=e.map(function(e){return e instanceof Promise?e:Promise.resolve(e)}),[2,s([this.accumulateResultsChronologically(t).then(function(){return n.buildProcessResults(u.Finished)}),this.waitForOverride().then(function(){return n.buildProcessResults(u.Overriden)}),this.waitForTimeout().then(function(){return n.buildProcessResults(u.TimedOut)})])]})})},e.prototype.overrideIfProcessing=function(){return r(this,void 0,void 0,function(){return o(this,function(e){return this.override&&this.override(),[2]})})},Object.defineProperty(e.prototype,"orderedResults",{get:function(){return a.flatten(this.processedResults.filter(function(e){return!!e}),!0)},enumerable:!0,configurable:!0}),e.prototype.buildProcessResults=function(e){return{status:e,results:e!==u.Overriden?this.orderedResults:[]}},e.prototype.accumulateResultsChronologically=function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return t=this.processedResults,[4,Promise.all(e.map(function(e,n){return e.then(function(e){return t[n]=e})}))];case 1:return n.sent(),[2]}})})},e.prototype.waitForOverride=function(){var e=this;return new Promise(function(t){e.override=function(){e.override=null,t()}})},e.prototype.waitForTimeout=function(){var e=this;return new Promise(function(t){return setTimeout(function(){return t()},e.options.timeout)})},e}();t.QueryProcessor=l},478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(472),i=n(474),r=n(127),o=n(211),u=n(475);t.Complete={include:[s.NestedQuery,i.QueryExtension,u.SubExpression,o.Field,r.Basic]}},479:function(e,t,n){"use strict";function s(e,t,n,s){u.each(s.expressions,function(t){u.contains(e,t)||e.push(t)}),u.each(s.basicExpressions,function(e){u.contains(t,e)||t.push(e)}),u.each(s.grammars,function(e,t){if(t in n){if(!u.isArray(n[t])||!u.isArray(e))throw u.each(e,function(e){n[t].push(e)}),new Error("Can not merge "+t+"("+JSON.stringify(e)+" => "+JSON.stringify(n[t])+")");u.each(e,function(e){n[t].push(e)})}else n[t]=e})}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],i=[],r={Start:["Expressions","Empty"],Expressions:"[OptionalSpaces][Expression][ExpressionsList*][OptionalSpaces]",ExpressionsList:"[Spaces][Expression]",Expression:n,BasicExpression:i,OptionalSpaces:/ */,Spaces:/ +/,Empty:/(?!.)/},o=0;o<e.length;o++)s(n,i,r,e[o]),u.each(e[o].include,function(t){u.contains(e,t)||e.push(t)});return n.push("BasicExpression"),{start:"Start",expressions:r}}function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.apply(this,e);return new o.Grammar(n.start,n.expressions)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(175),u=n(0);t.Expressions=i,t.ExpressionsGrammar=r},48:function(e,t,n){"use strict";var s=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 s(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(s.prototype=n.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(209),r=n(210),o=n(0),u=function(){function e(e,t,n){var s=this;this.expression=t,this.input=n,o.isString(e)?this.value=e:o.isArray(e)&&(this.subResults=e,o.forEach(this.subResults,function(e){e.parent=s}))}return e.prototype.isSuccess=function(){return null!=this.value||null!=this.subResults&&o.all(this.subResults,function(e){return e.isSuccess()})},e.prototype.path=function(e){var t=null!=this.parent&&this.parent!=e?this.parent.path(e):[];return t.push(this),t},e.prototype.findParent=function(e){for(var t=this,n=o.isString(e)?function(t){return e==t.expression.id}:e;null!=t&&!n(t);)t=t.parent;return t},e.prototype.find=function(e){var t=o.isString(e)?function(t){return e==t.expression.id}:e;if(t(this))return this;if(this.subResults)for(var n=0;n<this.subResults.length;n++){var s=this.subResults[n].find(t);if(s)return s}return null},e.prototype.findAll=function(e){var t=[],n=o.isString(e)?function(t){return e==t.expression.id}:e;return n(this)&&t.push(this),this.subResults&&(t=o.reduce(this.subResults,function(e,t){return e.concat(t.findAll(n))},t)),t},e.prototype.resultAt=function(e,t){if(e<0||e>this.getLength())return[];if(null!=t){if(o.isString(t)){if(t==this.expression.id)return[this]}else if(t(this))return[this]}else{if(null!=(null==this.value&&null==this.subResults?this.input:this.value))return[this]}if(null!=this.subResults){for(var n=[],s=0;s<this.subResults.length;s++){var i=this.subResults[s];if(n=n.concat(i.resultAt(e,t)),(e-=i.getLength())<0)break}return n}return[]},e.prototype.getExpect=function(){return null==this.value&&null==this.subResults?[this]:null!=this.subResults?o.reduce(this.subResults,function(e,t){return e.concat(t.getExpect())},[]):[]},e.prototype.getBestExpect=function(){var e=this.getExpect(),t=o.groupBy(e,function(e){return e.input}),n=o.last(o.keys(t).sort(function(e,t){return t.length-e.length})),s=t[n],t=o.groupBy(s,function(e){return e.expression.id});return o.map(t,function(e){return o.chain(e).map(function(e){return{path:e.path().length,result:e}}).sortBy("path").pluck("result").first().value()})},e.prototype.getHumanReadableExpect=function(){var e=this.getBestExpect(),t=e.length>0?o.last(e).input:"";return"Expected "+o.map(e,function(e){return e.getHumanReadable()}).join(" or ")+" but "+(t.length>0?JSON.stringify(t[0]):"end of input")+" found."},e.prototype.before=function(){if(null==this.parent)return"";var e=o.indexOf(this.parent.subResults,this);return this.parent.before()+o.chain(this.parent.subResults).first(e).map(function(e){return e.toString()}).join("").value()},e.prototype.after=function(){if(null==this.parent)return"";var e=o.indexOf(this.parent.subResults,this);return o.chain(this.parent.subResults).last(this.parent.subResults.length-e-1).map(function(e){return e.toString()}).join("").value()+this.parent.after()},e.prototype.getLength=function(){return null!=this.value?this.value.length:null!=this.subResults?o.reduce(this.subResults,function(e,t){return e+t.getLength()},0):this.input.length},e.prototype.toHtmlElement=function(){var e=document.createElement("span"),t=null!=this.expression?this.expression.id:null;return null!=t&&e.setAttribute("data-id",t),e.setAttribute("data-success",this.isSuccess().toString()),null!=this.value?(e.appendChild(document.createTextNode(this.value)),e.setAttribute("data-value",this.value)):null!=this.subResults?o.each(this.subResults,function(t){e.appendChild(t.toHtmlElement())}):(e.appendChild(document.createTextNode(this.input)),e.setAttribute("data-input",this.input),e.className="magic-box-error"+(this.input.length>0?"":" magic-box-error-empty")),e.result=this,e},e.prototype.clean=function(t){if(null!=t||!this.isSuccess()){t=t||o.last(this.getBestExpect()).path(this);var n=o.first(t);if(null!=n){var s=o.indexOf(this.subResults,n),i=-1==s?[]:o.map(o.first(this.subResults,s),function(e){return e.clean()});return i.push(n.clean(o.rest(t))),new e(i,this.expression,this.input)}return new e(null,this.expression,this.input)}return null!=this.value?new e(this.value,this.expression,this.input):null!=this.subResults?new e(o.map(this.subResults,function(e){return e.clean()}),this.expression,this.input):void 0},e.prototype.clone=function(){return null!=this.value?new e(this.value,this.expression,this.input):null!=this.subResults?new e(o.map(this.subResults,function(e){return e.clone()}),this.expression,this.input):new e(null,this.expression,this.input)},e.prototype.toString=function(){return null!=this.value?this.value:null!=this.subResults?o.map(this.subResults,function(e){return e.toString()}).join(""):this.input},e.prototype.getHumanReadable=function(){return this.expression instanceof r.ExpressionConstant?JSON.stringify(this.expression.value):this.expression.id},e}();t.Result=u;var a=function(e){function t(t){var n=e.call(this,[t],i.ExpressionEndOfInput,t.input)||this,s=new u(null,i.ExpressionEndOfInput,t.input.substr(t.getLength()));return s.parent=n,n.subResults.push(s),n}return s(t,e),t}(u);t.EndOfInputResult=a},480:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(){}return e.updateResultPreviewsManagerOptions="updateResultPreviewsManagerOptions",e.populateSearchResultPreviews="populateSearchResultPreviews",e}();t.ResultPreviewsManagerEvents=s},481:function(e,t,n){"use strict";var s=this&&this.__assign||Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(27),r=function(){function e(e){this.owner=e}return Object.defineProperty(e.prototype,"options",{get:function(){return this.owner.options},set:function(e){this.owner.options=e},enumerable:!0,configurable:!0}),e.prototype.postProcess=function(){this.options=s({},this.options,this.owner.componentOptionsModel.get(i.ComponentOptionsModel.attributesEnum.searchBox)),this.processQueryOnClearVersusEmptyQuery(),this.processQueryOnClearVersusSearchAsYouType()},e.prototype.processQueryOnClearVersusEmptyQuery=function(){this.options.triggerQueryOnClear&&!1===this.owner.searchInterface.options.allowQueriesWithoutKeywords&&(this.owner.logger.warn('Forcing option triggerQueryOnClear to false, as it is not supported when the search interface is configured to not allow queries without keywords (data-allow-queries-without-keywords="false")',this.owner),this.options.triggerQueryOnClear=!1)},e.prototype.processQueryOnClearVersusSearchAsYouType=function(){!0===this.owner.searchInterface.options.allowQueriesWithoutKeywords&&!1===this.options.triggerQueryOnClear&&!0===this.options.enableSearchAsYouType&&(this.owner.logger.warn("Forcing option triggerQueryOnClear to true, since search-as-you-type is enabled",this.owner),this.options.triggerQueryOnClear=!0)},e}();t.QueryboxOptionsProcessing=r},482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),i=n(70),r=function(){function e(e){this.options=e}return e.queryIsBlocked=function(){return!!e.queryIsCurrentlyBlocked||(e.queryIsCurrentlyBlocked=!0,i.Defer.defer(function(){return e.allowDuplicateQuery()}),!1)},e.allowDuplicateQuery=function(){e.queryIsCurrentlyBlocked=!1},e.prototype.addParameters=function(t,n){e.queryIsBlocked()||(this.options.enableWildcards&&(t.enableWildcards=!0),this.options.enableQuestionMarks&&(t.enableQuestionMarks=!0),this.options.enableLowercaseOperators&&(t.enableLowercaseOperators=!0),s.isEmpty(n)||(t.enableQuerySyntax=this.options.enableQuerySyntax,t.expression.add(n),this.options.enablePartialMatch&&(t.enablePartialMatch=this.options.enablePartialMatch,this.options.partialMatchKeywords&&(t.partialMatchKeywords=this.options.partialMatchKeywords),this.options.partialMatchThreshold&&(t.partialMatchThreshold=this.options.partialMatchThreshold))))},e.queryIsCurrentlyBlocked=!1,e}();t.QueryboxQueryParameters=r},536:function(e,t,n){"use strict";function s(){i.exportGlobally({MagicBox:{EndOfInputResult:b.EndOfInputResult,ExpressionConstant:r.ExpressionConstant,ExpressionEndOfInput:o.ExpressionEndOfInput,ExpressionFunction:u.ExpressionFunction,ExpressionList:a.ExpressionList,ExpressionOptions:l.ExpressionOptions,ExpressionRef:c.ExpressionRef,ExpressionRegExp:p.ExpressionRegExp,Grammar:h.Grammar,Grammars:g.Grammars,InputManager:d.InputManager,Instance:f.MagicBoxInstance,OptionResult:v.OptionResult,RefResult:m.RefResult,Result:b.Result,SuggestionsManager:x.SuggestionsManager,Utils:y.MagicBoxUtils,create:f.createMagicBox,requestAnimationFrame:f.requestAnimationFrame}})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),r=n(210),o=n(209),u=n(470),a=n(471),l=n(467),c=n(465),p=n(469),h=n(175),g=n(537),d=n(476),f=n(213),y=n(214),v=n(468),m=n(466),b=n(48),x=n(212);t.GrammarsImportedLocally=g.Grammars,t.doMagicBoxExport=s},537:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(127),i=n(478),r=n(473),o=n(479),u=n(211),a=n(472),l=n(474),c=n(475);t.Grammars={Basic:s.Basic,notInWord:s.notInWord,notWordStart:s.notWordStart,Complete:i.Complete,Date:r.Date,Expressions:o.Expressions,ExpressionsGrammar:o.ExpressionsGrammar,Field:u.Field,NestedQuery:a.NestedQuery,QueryExtension:l.QueryExtension,SubExpression:c.SubExpression}},538:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{a(s.next(e))}catch(e){r(e)}}function u(e){try{a(s.throw(e))}catch(e){r(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}a((s=s.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){function n(e){return function(t){return s([e,t])}}function s(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(o=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[0,o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],r=0}finally{i=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(6),u=n(0),a=n(7),l=n(212),c=n(480),p=n(477),h=n(4),g=function(){function e(e,t){void 0===t&&(t={}),this.element=e,this.options=u.defaults(t,{previewHeaderText:o.l("QuerySuggestPreview"),previewClass:"coveo-preview-selectable",selectedClass:"magic-box-selected"}),this.root=a.Component.resolveRoot(e),this.previewsProcessor=new p.QueryProcessor({timeout:this.options.timeout})}return Object.defineProperty(e.prototype,"previewsOwner",{get:function(){return this.lastDisplayedSuggestion},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPreviews",{get:function(){return!!this.suggestionsPreviewContainer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focusedPreviewElement",{get:function(){if(!this.hasPreviews)return null;var e=this.suggestionsPreviewContainer.findClass(this.options.selectedClass)[0];return e&&e.classList.contains(this.options.previewClass)?e:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewElements",{get:function(){return this.hasPreviews?this.suggestionsPreviewContainer.findClass(this.options.previewClass):[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suggestionsListbox",{get:function(){return r.$$(r.$$(this.element).findClass("coveo-magicbox-suggestions")[0])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberOfResultsPerRow",{get:function(){var e=this.suggestionsPreviewContainer.findClass(this.options.previewClass);if(0===e.length)return 0;var t=e[0].offsetTop,n=u.findIndex(e,function(e){return e.offsetTop!==t});return-1!==n?n:e.length},enumerable:!0,configurable:!0}),e.prototype.displaySearchResultPreviewsForSuggestion=function(e){return s(this,void 0,void 0,function(){var t,n,s,r,o,u,a;return i(this,function(i){switch(i.label){case 0:return t=this.getExternalOptions(),n=this.lastDelay=h.Utils.resolveAfter(h.Utils.isNullOrUndefined(t.displayAfterDuration)?200:t.displayAfterDuration),[4,n];case 1:return i.sent(),n!==this.lastDelay?[2]:(s=e&&this.lastQueriedSuggestion===e)?[2]:(r=this.lastDisplayedSuggestion===e)?(this.previewsProcessor.overrideIfProcessing(),this.lastQueriedSuggestion=null,[2]):(this.lastQueriedSuggestion=e,e?[4,this.getSearchResultPreviewsQuery(e)]:(this.displaySuggestionPreviews(null,[]),[2]));case 2:return o=i.sent(),(u=o.status,a=o.results,u===p.ProcessingStatus.Overriden)?[2]:(this.lastQueriedSuggestion=null,this.displaySuggestionPreviews(e,a),[2])}})})},e.prototype.getElementInDirection=function(e){var t=this.previewElements,n=t.indexOf(this.focusedPreviewElement);return-1===n?null:0===n&&e===l.Direction.Left?null:t[(n+this.getIncrementInDirection(e))%t.length]},e.prototype.getIncrementInDirection=function(e){switch(e){case l.Direction.Left:return-1;case l.Direction.Right:return 1;case l.Direction.Up:return-this.numberOfResultsPerRow;case l.Direction.Down:return this.numberOfResultsPerRow}},e.prototype.setHasPreviews=function(e){this.hasPreviews!==!!e&&(e?this.initPreviewForSuggestions():this.revertPreviewForSuggestions())},e.prototype.initPreviewForSuggestions=function(){this.suggestionsPreviewContainer=r.$$("div",{className:"coveo-suggestion-container"},this.suggestionsListbox.el,this.buildPreviewContainer()),this.element.appendChild(this.suggestionsPreviewContainer.el)},e.prototype.revertPreviewForSuggestions=function(){this.element.appendChild(this.suggestionsListbox.el),this.suggestionsPreviewContainer.remove(),this.suggestionsPreviewContainer=null},e.prototype.buildPreviewContainer=function(){return r.$$("div",{className:"coveo-preview-container"},this.resultPreviewsHeader=r.$$("div",{className:"coveo-preview-header"}),this.resultPreviewsContainer=r.$$("div",{className:"coveo-preview-results"})).el},e.prototype.getExternalOptions=function(){var e={};return r.$$(this.root).trigger(c.ResultPreviewsManagerEvents.updateResultPreviewsManagerOptions,e),e},e.prototype.getSearchResultPreviewsQuery=function(e){var t={suggestionText:e.innerText,previewsQueries:[]};return r.$$(this.root).trigger(c.ResultPreviewsManagerEvents.populateSearchResultPreviews,t),this.previewsProcessor.processQueries(t.previewsQueries)},e.prototype.updateSearchResultPreviewsHeader=function(e){this.resultPreviewsHeader.text(this.options.previewHeaderText+' "'+e+'"')},e.prototype.appendSearchResultPreview=function(e){this.resultPreviewsContainer.append(e.element);var t=r.$$(e.element);t.on("click",function(){return e.onSelect()}),t.on("keyboardSelect",function(){return e.onSelect()})},e.prototype.appendSearchResultPreviews=function(e){var t=this;this.resultPreviewsContainer.empty(),e.forEach(function(e){return t.appendSearchResultPreview(e)})},e.prototype.displaySuggestionPreviews=function(e,t){this.setHasPreviews(t&&t.length>0),this.element.classList.toggle("magic-box-hasPreviews",this.hasPreviews),this.lastDisplayedSuggestion=e,this.hasPreviews&&(this.appendSearchResultPreviews(t),this.updateSearchResultPreviewsHeader(e.innerText))},e}();t.ResultPreviewsManager=g},539:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),i=n(6),r=n(17),o=function(){function e(e){this.element=s.$$("div",{className:"magic-box-clear"});var t=s.$$("div",{className:"magic-box-icon"});this.element.append(t.el),this.element.insertAfter(s.$$(e.element).find("input")),(new r.AccessibleButton).withElement(this.element).withLabel(i.l("Clear")).withSelectAction(function(){return e.clear()}).build(),this.toggleTabindexAndAriaHidden(!1)}return e.prototype.toggleTabindexAndAriaHidden=function(e){var t=e?"0":"-1";this.element.setAttribute("tabindex",t),this.element.setAttribute("aria-hidden",""+!e)},e}();t.MagicBoxClear=o},540:function(e,t){}});