UNPKG

coveo-search-ui

Version:

Coveo JavaScript Search Framework

3 lines • 43.4 kB
webpackJsonpCoveo__temporary([21,42],{230:function(t,e,n){"use strict";function i(t){if(!t.answerSnippet)return"";try{return o.sanitize(t.answerSnippet,{USE_PROFILES:{html:!0}})}catch(e){return t.answerSnippet}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(589),r=n(1),s=n(475);e.getDefaultSnippetStyle=function(t){return'\n body {\n font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif, sans-serif;\n }\n\n .'+t+" > :first-child {\n margin-top: 0;\n }\n\n ."+t+" > :last-child {\n margin-bottom: 0;\n }\n"},e.getSanitizedAnswerSnippet=i,e.transformSnippetLinks=function(t,e,n){r.Dom.nodeListToArray(t.querySelectorAll("a")).forEach(function(t){s.bindAnalyticsToLink(t,function(){return n(t)}),t.target=e?"_blank":"_top"})}},300:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),n(710);var o=n(7),r=n(3),s=n(11),a=n(1),l=n(0),u=n(711),c=n(6),p=n(2),d=n(4),f=n(230),h=n(8),m="coveo-smart-snippet-suggestions-questions-title";e.SmartSnippetSuggestionsClassNames={HAS_QUESTIONS_CLASSNAME:"coveo-smart-snippet-suggestions-has-questions",QUESTIONS_LIST_CLASSNAME:"coveo-smart-snippet-suggestions-questions",QUESTIONS_LIST_TITLE_CLASSNAME:m};var g=function(t){function e(n,i,o){var r=t.call(this,n,e.ID,o)||this;return r.element=n,r.options=i,r.titleId=l.uniqueId(m),r.options=h.ComponentOptions.initComponentOptions(n,e,i),r.bind.onRootElement(s.QueryEvents.deferredQuerySuccess,function(t){return r.handleQuerySuccess(t)}),r}return i(e,t),Object.defineProperty(e.prototype,"loading",{get:function(){return this.contentLoaded},enumerable:!0,configurable:!0}),e.prototype.getCorrespondingResult=function(t){return l.find(this.queryController.getLastResults().results,function(e){return e.raw[t.documentId.contentIdKey]===t.documentId.contentIdValue})},e.prototype.handleQuerySuccess=function(t){var e=t.results.questionAnswer,n=!(!e||!e.relatedQuestions.length);if(a.$$(this.element).toggleClass("coveo-smart-snippet-suggestions-has-questions",n),n){if(this.searchUid=t.results.searchUid,this.renderedQuestionAnswer&&l.isEqual(e,this.renderedQuestionAnswer))return;this.detachContent(),this.element.appendChild((this.title=this.buildTitle()).el),this.element.appendChild((this.questionAnswers=this.buildQuestionAnswers(e.relatedQuestions)).el)}else this.detachContent();this.renderedQuestionAnswer=e},e.prototype.detachContent=function(){this.title&&this.title.detach(),this.questionAnswers&&this.questionAnswers.detach(),this.title=this.questionAnswers=null},e.prototype.buildTitle=function(){return a.$$("span",{className:m,id:this.titleId},c.l("SuggestedQuestions"))},e.prototype.buildQuestionAnswers=function(t){var e=this,n=this.getInnerCSS(),i=t.map(function(t){return new u.SmartSnippetCollapsibleSuggestion({questionAnswer:t,bindings:e.getBindings(),innerCSS:d.Utils.isNullOrUndefined(n)?f.getDefaultSnippetStyle(u.SmartSnippetCollapsibleSuggestionClassNames.RAW_CONTENT_CLASSNAME):n,searchUid:e.searchUid,titleField:e.options.titleField,hrefTemplate:e.options.hrefTemplate,alwaysOpenInNewWindow:e.options.alwaysOpenInNewWindow,source:e.getCorrespondingResult(t),useIFrame:e.options.useIFrame})}),o=a.$$.apply(void 0,["ul",{className:"coveo-smart-snippet-suggestions-questions",ariaLabelledby:this.titleId}].concat(i.map(function(t){return t.build()})));return this.contentLoaded=Promise.all(i.map(function(t){return t.loading.then(function(){return t})})),o},e.prototype.getInnerCSS=function(){var t=a.$$(this.element).children().filter(function(t){return t instanceof HTMLScriptElement&&"text/css"===t.type.toLowerCase()}).map(function(t){return t.innerHTML});return t.length?t.join("\n"):null},e.ID="SmartSnippetSuggestions",e.doExport=function(){r.exportGlobally({SmartSnippetSuggestions:e})},e.options={titleField:h.ComponentOptions.buildFieldOption({defaultValue:"@title"}),hrefTemplate:h.ComponentOptions.buildStringOption(),alwaysOpenInNewWindow:h.ComponentOptions.buildBooleanOption({defaultValue:!1}),useIFrame:h.ComponentOptions.buildBooleanOption({defaultValue:!0})},e}(o.Component);e.SmartSnippetSuggestions=g,p.Initialization.registerAutoCreateComponent(g),g.doExport()},475:function(t,e,n){"use strict";function i(t,e){var n=o.once(function(){return e()});r.$$(t).on(["contextmenu","click","mousedown","mouseup"],n);var i;r.$$(t).on("touchstart",function(){i=window.setTimeout(n,1e3)}),r.$$(t).on("touchend",function(){i&&clearTimeout(i)})}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1);e.bindAnalyticsToLink=i},523:function(t,e,n){"use strict";function i(t,e){return r(this,void 0,void 0,function(){var n,i,r,l,u;return s(this,function(s){switch(s.label){case 0:return n={className:"coveo-shadow-iframe",scrolling:"no",title:e.title},e.useIFrame?(i=a.$$("iframe",n).el,l=new Promise(function(t){return i.addEventListener("load",function(){return t()})}),t.appendChild(i),[4,l]):[3,2];case 1:return s.sent(),r=i.contentDocument.body,[3,3];case 2:i=a.$$("div",n).el,r=i,t.appendChild(i),s.label=3;case 3:return r.style.margin="0",u=a.$$("div",{style:"overflow: auto;"}).el,r.appendChild(u),o(i,u,e.onSizeChanged),"open"===e.mode&&Object.defineProperty(t,"shadowRoot",{get:function(){return u}}),[2,u]}})})}function o(t,e,n){var i=e.clientWidth,o=e.clientHeight;new MutationObserver(function(){i===e.clientWidth&&o===e.clientHeight||(i=e.clientWidth,o=e.clientHeight,t.style.width=e.clientWidth+"px",t.style.height=e.clientHeight+"px",n&&n())}).observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}var r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(o,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(s,a)}l((i=i.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){function n(t){return function(e){return i([t,e])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(s=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(r,n[1])).done)return s;switch(r=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,r=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){l.label=n[1];break}if(6===n[0]&&l.label<s[1]){l.label=s[1],s=n;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(n);break}s[2]&&l.ops.pop(),l.trys.pop();continue}n=e.call(t,l)}catch(t){n=[6,t],r=0}finally{o=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,r,s,a,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(e,"__esModule",{value:!0});var a=n(1);n(588),e.attachShadow=i},535:function(t,e){},588:function(t,e){},589:function(t,e,n){/*! @license DOMPurify 2.5.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.4/LICENSE */ !function(e,n){t.exports=n()}(0,function(){"use strict";function t(e){"@babel/helpers - typeof";return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,n){return(e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function i(t,o,r){return i=n()?Reflect.construct:function(t,n,i){var o=[null];o.push.apply(o,n);var r=Function.bind.apply(t,o),s=new r;return i&&e(s,i.prototype),s},i.apply(null,arguments)}function o(t){return r(t)||s(t)||a(t)||u()}function r(t){if(Array.isArray(t))return l(t)}function s(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t){return"number"==typeof t&&isNaN(t)}function p(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return T(t,e,i)}}function d(t,e,n){var i;n=null!==(i=n)&&void 0!==i?i:x,y&&y(t,null);for(var o=e.length;o--;){var r=e[o];if("string"==typeof r){var s=n(r);s!==r&&(b(e)||(e[o]=s),r=s)}t[r]=!0}return t}function f(t){var e,n=O(null);for(e in t)!0===T(g,t,[e])&&(n[e]=t[e]);return n}function h(t,e){function n(t){return console.warn("fallback value for",t),null}for(;null!==t;){var i=v(t,e);if(i){if(i.get)return p(i.get);if("function"==typeof i.value)return p(i.value)}t=S(t)}return n}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt(),n=function(t){return m(t)};if(n.version="2.5.4",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var i=e.document,r=e.document,s=e.DocumentFragment,a=e.HTMLTemplateElement,l=e.Node,u=e.Element,p=e.NodeFilter,g=e.NamedNodeMap,y=void 0===g?e.NamedNodeMap||e.MozNamedAttrMap:g,b=e.HTMLFormElement,S=e.DOMParser,v=e.trustedTypes,_=u.prototype,O=h(_,"cloneNode"),w=h(_,"nextSibling"),T=h(_,"childNodes"),C=h(_,"parentNode");if("function"==typeof a){var at=r.createElement("template");at.content&&at.content.ownerDocument&&(r=at.content.ownerDocument)}var lt=st(v,i),ut=lt?lt.createHTML(""):"",ct=r,pt=ct.implementation,dt=ct.createNodeIterator,ft=ct.createDocumentFragment,ht=ct.getElementsByTagName,mt=i.importNode,gt={};try{gt=f(r).documentMode?r.documentMode:{}}catch(t){}var yt={};n.isSupported="function"==typeof C&&pt&&void 0!==pt.createHTMLDocument&&9!==gt;var bt,St,vt=K,At=X,_t=Y,Ot=Z,wt=J,Tt=et,Ct=nt,Et=ot,Nt=tt,kt=null,xt=d({},[].concat(o(H),o($),o(P),o(W),o(z))),Lt=null,It=d({},[].concat(o(B),o(Q),o(G),o(V))),Mt=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Rt=null,Dt=null,Ut=!0,Ft=!0,Ht=!1,$t=!0,Pt=!1,jt=!0,Wt=!1,qt=!1,zt=!1,Bt=!1,Qt=!1,Gt=!1,Vt=!0,Kt=!1,Xt=!0,Yt=!1,Zt={},Jt=null,te=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ee=null,ne=d({},["audio","video","img","source","image","track"]),ie=null,oe=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),re="http://www.w3.org/1998/Math/MathML",se="http://www.w3.org/2000/svg",ae="http://www.w3.org/1999/xhtml",le=ae,ue=!1,ce=null,pe=d({},[re,se,ae],L),de=["application/xhtml+xml","text/html"],fe=null,he=r.createElement("form"),me=function(t){return t instanceof RegExp||t instanceof Function},ge=function(e){fe&&fe===e||(e&&"object"===t(e)||(e={}),e=f(e),bt=bt=-1===de.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,St="application/xhtml+xml"===bt?L:x,kt="ALLOWED_TAGS"in e?d({},e.ALLOWED_TAGS,St):xt,Lt="ALLOWED_ATTR"in e?d({},e.ALLOWED_ATTR,St):It,ce="ALLOWED_NAMESPACES"in e?d({},e.ALLOWED_NAMESPACES,L):pe,ie="ADD_URI_SAFE_ATTR"in e?d(f(oe),e.ADD_URI_SAFE_ATTR,St):oe,ee="ADD_DATA_URI_TAGS"in e?d(f(ne),e.ADD_DATA_URI_TAGS,St):ne,Jt="FORBID_CONTENTS"in e?d({},e.FORBID_CONTENTS,St):te,Rt="FORBID_TAGS"in e?d({},e.FORBID_TAGS,St):{},Dt="FORBID_ATTR"in e?d({},e.FORBID_ATTR,St):{},Zt="USE_PROFILES"in e&&e.USE_PROFILES,Ut=!1!==e.ALLOW_ARIA_ATTR,Ft=!1!==e.ALLOW_DATA_ATTR,Ht=e.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Pt=e.SAFE_FOR_TEMPLATES||!1,jt=!1!==e.SAFE_FOR_XML,Wt=e.WHOLE_DOCUMENT||!1,Bt=e.RETURN_DOM||!1,Qt=e.RETURN_DOM_FRAGMENT||!1,Gt=e.RETURN_TRUSTED_TYPE||!1,zt=e.FORCE_BODY||!1,Vt=!1!==e.SANITIZE_DOM,Kt=e.SANITIZE_NAMED_PROPS||!1,Xt=!1!==e.KEEP_CONTENT,Yt=e.IN_PLACE||!1,Nt=e.ALLOWED_URI_REGEXP||Nt,le=e.NAMESPACE||ae,Mt=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&me(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Mt.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&me(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Mt.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Mt.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(Ft=!1),Qt&&(Bt=!0),Zt&&(kt=d({},o(z)),Lt=[],!0===Zt.html&&(d(kt,H),d(Lt,B)),!0===Zt.svg&&(d(kt,$),d(Lt,Q),d(Lt,V)),!0===Zt.svgFilters&&(d(kt,P),d(Lt,Q),d(Lt,V)),!0===Zt.mathMl&&(d(kt,W),d(Lt,G),d(Lt,V))),e.ADD_TAGS&&(kt===xt&&(kt=f(kt)),d(kt,e.ADD_TAGS,St)),e.ADD_ATTR&&(Lt===It&&(Lt=f(Lt)),d(Lt,e.ADD_ATTR,St)),e.ADD_URI_SAFE_ATTR&&d(ie,e.ADD_URI_SAFE_ATTR,St),e.FORBID_CONTENTS&&(Jt===te&&(Jt=f(Jt)),d(Jt,e.FORBID_CONTENTS,St)),Xt&&(kt["#text"]=!0),Wt&&d(kt,["html","head","body"]),kt.table&&(d(kt,["tbody"]),delete Rt.tbody),A&&A(e),fe=e)},ye=d({},["mi","mo","mn","ms","mtext"]),be=d({},["foreignobject","annotation-xml"]),Se=d({},["title","style","font","a","script"]),ve=d({},$);d(ve,P),d(ve,j);var Ae=d({},W);d(Ae,q);var _e=function(t){var e=C(t);e&&e.tagName||(e={namespaceURI:le,tagName:"template"});var n=x(t.tagName),i=x(e.tagName);return!!ce[t.namespaceURI]&&(t.namespaceURI===se?e.namespaceURI===ae?"svg"===n:e.namespaceURI===re?"svg"===n&&("annotation-xml"===i||ye[i]):Boolean(ve[n]):t.namespaceURI===re?e.namespaceURI===ae?"math"===n:e.namespaceURI===se?"math"===n&&be[i]:Boolean(Ae[n]):t.namespaceURI===ae?!(e.namespaceURI===se&&!be[i])&&(!(e.namespaceURI===re&&!ye[i])&&(!Ae[n]&&(Se[n]||!ve[n]))):!("application/xhtml+xml"!==bt||!ce[t.namespaceURI]))},Oe=function(t){k(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=ut}catch(e){t.remove()}}},we=function(t,e){try{k(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){k(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!Lt[t])if(Bt||Qt)try{Oe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Te=function(t){var e,n;if(zt)t="<remove></remove>"+t;else{var i=I(t,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===bt&&le===ae&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var o=lt?lt.createHTML(t):t;if(le===ae)try{e=(new S).parseFromString(o,bt)}catch(t){}if(!e||!e.documentElement){e=pt.createDocument(le,"template",null);try{e.documentElement.innerHTML=ue?ut:o}catch(t){}}var s=e.body||e.documentElement;return t&&n&&s.insertBefore(r.createTextNode(n),s.childNodes[0]||null),le===ae?ht.call(e,Wt?"html":"body")[0]:Wt?e.documentElement:s},Ce=function(t){return dt.call(t.ownerDocument||t,t,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null,!1)},Ee=function(t){return t instanceof b&&(void 0!==t.__depth&&"number"!=typeof t.__depth||void 0!==t.__removalCount&&"number"!=typeof t.__removalCount||"string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof y)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Ne=function(e){return"object"===t(l)?e instanceof l:e&&"object"===t(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ke=function(t,e,i){yt[t]&&E(yt[t],function(t){t.call(n,e,i,fe)})},xe=function(t){var e;if(ke("beforeSanitizeElements",t,null),Ee(t))return Oe(t),!0;if(U(/[\u0080-\uFFFF]/,t.nodeName))return Oe(t),!0;var i=St(t.nodeName);if(ke("uponSanitizeElement",t,{tagName:i,allowedTags:kt}),t.hasChildNodes()&&!Ne(t.firstElementChild)&&(!Ne(t.content)||!Ne(t.content.firstElementChild))&&U(/<[/\w]/g,t.innerHTML)&&U(/<[/\w]/g,t.textContent))return Oe(t),!0;if("select"===i&&U(/<template/i,t.innerHTML))return Oe(t),!0;if(7===t.nodeType)return Oe(t),!0;if(jt&&8===t.nodeType&&U(/<[/\w]/g,t.data))return Oe(t),!0;if(!kt[i]||Rt[i]){if(!Rt[i]&&Ie(i)){if(Mt.tagNameCheck instanceof RegExp&&U(Mt.tagNameCheck,i))return!1;if(Mt.tagNameCheck instanceof Function&&Mt.tagNameCheck(i))return!1}if(Xt&&!Jt[i]){var o=C(t)||t.parentNode,r=T(t)||t.childNodes;if(r&&o)for(var s=r.length,a=s-1;a>=0;--a){var l=O(r[a],!0);l.__removalCount=(t.__removalCount||0)+1,o.insertBefore(l,w(t))}}return Oe(t),!0}return t instanceof u&&!_e(t)?(Oe(t),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!U(/<\/no(script|embed|frames)/i,t.innerHTML)?(Pt&&3===t.nodeType&&(e=t.textContent,e=M(e,vt," "),e=M(e,At," "),e=M(e,_t," "),t.textContent!==e&&(k(n.removed,{element:t.cloneNode()}),t.textContent=e)),ke("afterSanitizeElements",t,null),!1):(Oe(t),!0)},Le=function(t,e,n){if(Vt&&("id"===e||"name"===e)&&(n in r||n in he||"__depth"===n||"__removalCount"===n))return!1;if(Ft&&!Dt[e]&&U(Ot,e));else if(Ut&&U(wt,e));else if(!Lt[e]||Dt[e]){if(!(Ie(t)&&(Mt.tagNameCheck instanceof RegExp&&U(Mt.tagNameCheck,t)||Mt.tagNameCheck instanceof Function&&Mt.tagNameCheck(t))&&(Mt.attributeNameCheck instanceof RegExp&&U(Mt.attributeNameCheck,e)||Mt.attributeNameCheck instanceof Function&&Mt.attributeNameCheck(e))||"is"===e&&Mt.allowCustomizedBuiltInElements&&(Mt.tagNameCheck instanceof RegExp&&U(Mt.tagNameCheck,n)||Mt.tagNameCheck instanceof Function&&Mt.tagNameCheck(n))))return!1}else if(ie[e]);else if(U(Nt,M(n,Ct,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==R(n,"data:")||!ee[t]){if(Ht&&!U(Tt,M(n,Ct,"")));else if(n)return!1}else;return!0},Ie=function(t){return"annotation-xml"!==t&&I(t,Et)},Me=function(e){var i,o,r,s;ke("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Lt};for(s=a.length;s--;){i=a[s];var u=i,c=u.name,p=u.namespaceURI;if(o="value"===c?i.value:D(i.value),r=St(c),l.attrName=r,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,ke("uponSanitizeAttribute",e,l),o=l.attrValue,!l.forceKeepAttr&&(we(c,e),l.keepAttr))if($t||!U(/\/>/i,o))if(jt&&U(/((--!?|])>)|<\/(style|title)/i,o))we(c,e);else{Pt&&(o=M(o,vt," "),o=M(o,At," "),o=M(o,_t," "));var d=St(e.nodeName);if(Le(d,r,o)){if(!Kt||"id"!==r&&"name"!==r||(we(c,e),o="user-content-"+o),lt&&"object"===t(v)&&"function"==typeof v.getAttributeType)if(p);else switch(v.getAttributeType(d,r)){case"TrustedHTML":o=lt.createHTML(o);break;case"TrustedScriptURL":o=lt.createScriptURL(o)}try{p?e.setAttributeNS(p,c,o):e.setAttribute(c,o),Ee(e)?Oe(e):N(n.removed)}catch(t){}}}else we(c,e)}ke("afterSanitizeAttributes",e,null)}},Re=function t(e){var n,i=Ce(e);for(ke("beforeSanitizeShadowDOM",e,null);n=i.nextNode();)if(ke("uponSanitizeShadowNode",n,null),!xe(n)){var o=C(n);1===n.nodeType&&(o&&o.__depth?n.__depth=(n.__removalCount||0)+o.__depth+1:n.__depth=1),(n.__depth>=255||c(n.__depth))&&Oe(n),n.content instanceof s&&(n.content.__depth=n.__depth,t(n.content)),Me(n)}ke("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(o){var r,a,u,p,d,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ue=!o,ue&&(o="\x3c!--\x3e"),"string"!=typeof o&&!Ne(o)){if("function"!=typeof o.toString)throw F("toString is not a function");if("string"!=typeof(o=o.toString()))throw F("dirty is not a string, aborting")}if(!n.isSupported){if("object"===t(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof o)return e.toStaticHTML(o);if(Ne(o))return e.toStaticHTML(o.outerHTML)}return o}if(qt||ge(f),n.removed=[],"string"==typeof o&&(Yt=!1),Yt){if(o.nodeName){var h=St(o.nodeName);if(!kt[h]||Rt[h])throw F("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof l)r=Te("\x3c!----\x3e"),a=r.ownerDocument.importNode(o,!0),1===a.nodeType&&"BODY"===a.nodeName?r=a:"HTML"===a.nodeName?r=a:r.appendChild(a);else{if(!Bt&&!Pt&&!Wt&&-1===o.indexOf("<"))return lt&&Gt?lt.createHTML(o):o;if(!(r=Te(o)))return Bt?null:Gt?ut:""}r&&zt&&Oe(r.firstChild);for(var m=Ce(Yt?o:r);u=m.nextNode();)if((3!==u.nodeType||u!==p)&&!xe(u)){var g=C(u);1===u.nodeType&&(g&&g.__depth?u.__depth=(u.__removalCount||0)+g.__depth+1:u.__depth=1),(u.__depth>=255||c(u.__depth))&&Oe(u),u.content instanceof s&&(u.content.__depth=u.__depth,Re(u.content)),Me(u),p=u}if(p=null,Yt)return o;if(Bt){if(Qt)for(d=ft.call(r.ownerDocument);r.firstChild;)d.appendChild(r.firstChild);else d=r;return(Lt.shadowroot||Lt.shadowrootmod)&&(d=mt.call(i,d,!0)),d}var y=Wt?r.outerHTML:r.innerHTML;return Wt&&kt["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&U(it,r.ownerDocument.doctype.name)&&(y="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+y),Pt&&(y=M(y,vt," "),y=M(y,At," "),y=M(y,_t," ")),lt&&Gt?lt.createHTML(y):y},n.setConfig=function(t){ge(t),qt=!0},n.clearConfig=function(){fe=null,qt=!1},n.isValidAttribute=function(t,e,n){fe||ge({});var i=St(t),o=St(e);return Le(i,o,n)},n.addHook=function(t,e){"function"==typeof e&&(yt[t]=yt[t]||[],k(yt[t],e))},n.removeHook=function(t){if(yt[t])return N(yt[t])},n.removeHooks=function(t){yt[t]&&(yt[t]=[])},n.removeAllHooks=function(){yt={}},n}var g=Object.hasOwnProperty,y=Object.setPrototypeOf,b=Object.isFrozen,S=Object.getPrototypeOf,v=Object.getOwnPropertyDescriptor,A=Object.freeze,_=Object.seal,O=Object.create,w="undefined"!=typeof Reflect&&Reflect,T=w.apply,C=w.construct;T||(T=function(t,e,n){return t.apply(e,n)}),A||(A=function(t){return t}),_||(_=function(t){return t}),C||(C=function(t,e){return i(t,o(e))});var E=p(Array.prototype.forEach),N=p(Array.prototype.pop),k=p(Array.prototype.push),x=p(String.prototype.toLowerCase),L=p(String.prototype.toString),I=p(String.prototype.match),M=p(String.prototype.replace),R=p(String.prototype.indexOf),D=p(String.prototype.trim),U=p(RegExp.prototype.test),F=function(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return C(t,n)}}(TypeError),H=A(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$=A(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=A(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),j=A(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),W=A(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),q=A(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),z=A(["#text"]),B=A(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Q=A(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),G=A(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=A(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=_(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=_(/<%[\w\W]*|[\w\W]*%>/gm),Y=_(/\${[\w\W]*}/gm),Z=_(/^data-[\-\w.\u00B7-\uFFFF]/),J=_(/^aria-[\-\w]+$/),tt=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),et=_(/^(?:\w+script|data):/i),nt=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),it=_(/^html$/i),ot=_(/^[a-z][.\w]*(-[.\w]+)+$/i),rt=function(){return"undefined"==typeof window?null:window},st=function(e,n){if("object"!==t(e)||"function"!=typeof e.createPolicy)return null;var i=null;n.currentScript&&n.currentScript.hasAttribute("data-tt-policy-suffix")&&(i=n.currentScript.getAttribute("data-tt-policy-suffix"));var o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return m()})},71:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(8),a=n(28),l=n(10),u=n(29),c=n(69),p=n(24),d=n(181),f=n(2),h=n(21),m=n(5),g=n(4),y=n(31),b=n(1),S=n(120),v=n(22),A=n(0),_=n(3);n(535);var O=n(15),w=n(475),T=function(t){function e(n,i,r,l,u){var c=t.call(this,n,e.ID,r)||this;c.element=n,c.options=i,c.bindings=r,c.result=l,c.os=u,c.logAnalytics=A.debounce(function(){c.queryController.saveLastQuery();var t=b.$$(c.element).getAttribute("href");void 0!=t&&""!=t||(t=c.escapedClickUri),c.options.logAnalytics?c.options.logAnalytics(t):c.logDocumentOpen(t),y.Defer.flush()},1500,!0);var d=c.searchInterface.options.originalOptionsObject[e.ID]||{},f=s.ComponentOptions.initComponentOptions(n,e,o({},d,i)),h=c.componentOptionsModel.get(a.ComponentOptionsModel.attributesEnum.resultLink);return c.options=A.extend({},f,h),c.result=l||c.resolveResult(),null==c.options.openQuickview&&(c.options.openQuickview="ExchangeCrawler"==l.raw.connectortype&&p.DeviceUtils.isMobileDevice()),c.element.hasAttribute("tabindex")||c.element.setAttribute("tabindex","0"),m.Assert.exists(c.componentOptionsModel),m.Assert.exists(c.result),c.quickviewShouldBeOpened()||w.bindAnalyticsToLink(n,function(){return c.logAnalytics()}),c.renderUri(n,l),c.bindEventToOpen(),c}return i(e,t),e.prototype.renderUri=function(t,e){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)}},e.prototype.openLink=function(t){void 0===t&&(t=!0),t&&this.logAnalytics(),window.location.href=this.getResultUri()},e.prototype.openLinkInNewWindow=function(t){void 0===t&&(t=!0),t&&this.logAnalytics(),window.open(this.getResultUri(),"_blank")},e.prototype.openLinkInOutlook=function(t){void 0===t&&(t=!0),this.hasOutlookField()&&(t&&this.logAnalytics(),this.openLink())},e.prototype.openLinkAsConfigured=function(t){void 0===t&&(t=!0),this.toExecuteOnOpen&&(t&&this.logAnalytics(),this.toExecuteOnOpen())},e.prototype.bindEventToOpen=function(){return this.bindOnClickIfNotUndefined()||this.bindOpenQuickviewIfNotUndefined()||this.setHrefIfNotAlready()||this.openLinkThatIsNotAnAnchor()},e.prototype.getDisplayedTitle=function(){if(this.options.titleTemplate){var t=v.StringUtils.buildStringTemplateFromResult(this.options.titleTemplate,this.result);return t?S.StreamHighlightUtils.highlightStreamText(t,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},e.prototype.getDisplayedTitleAsText=function(){var t=b.$$("div");return t.setHtml(this.getDisplayedTitle()),t.text()},Object.defineProperty(e.prototype,"escapedClickUri",{get:function(){return A.escape(this.result.clickUri)},enumerable:!0,configurable:!0}),e.prototype.bindOnClickIfNotUndefined=function(){var t=this;return void 0!=this.options.onClick&&(this.toExecuteOnOpen=function(e){t.options.onClick.call(t,e,t.result)},(new O.AccessibleButton).withElement(this.element).withLabel(this.result.title).withSelectAction(function(e){return t.toExecuteOnOpen(e)}).build(),!0)},e.prototype.bindOpenQuickviewIfNotUndefined=function(){var t=this;return!!this.quickviewShouldBeOpened()&&(this.toExecuteOnOpen=function(){b.$$(t.bindings.resultElement).trigger(u.ResultListEvents.openQuickview)},b.$$(this.element).on("click",function(e){e.preventDefault(),t.toExecuteOnOpen()}),!0)},e.prototype.openLinkThatIsNotAnAnchor=function(){var t=this;return!this.elementIsAnAnchor()&&(this.toExecuteOnOpen=function(){t.options.alwaysOpenInNewWindow?t.options.openInOutlook?t.openLinkInOutlook():t.openLinkInNewWindow():t.openLink()},b.$$(this.element).on("click",function(){t.toExecuteOnOpen()}),!0)},e.prototype.setHrefIfNotAlready=function(){return!(!this.elementIsAnAnchor()||g.Utils.isNonEmptyString(b.$$(this.element).getAttribute("href")))&&(b.$$(this.element).setAttribute("href",this.getResultUri()),!this.options.alwaysOpenInNewWindow||this.options.openInOutlook&&this.hasOutlookField()||b.$$(this.element).setAttribute("target","_blank"),!0)},e.prototype.logDocumentOpen=function(t){this.usageAnalytics.logClickEvent(l.analyticsActionCauseList.documentOpen,{documentURL:t,documentTitle:this.result.title,author:g.Utils.getFieldValue(this.result,"author")},this.result,this.root)},e.prototype.filterProtocol=function(t){var e=/^(https?|ftp|file|mailto|tel|sip):/i.test(t),n=/^(\/|\.\/|\.\.\/)/.test(t);return e||n?t:""},e.prototype.getResultUri=function(){if(this.options.hrefTemplate){var t=v.StringUtils.buildStringTemplateFromResult(this.options.hrefTemplate,this.result);return this.filterProtocol(t)}return void 0==this.options.field&&this.options.openInOutlook&&this.setField(),void 0!=this.options.field?this.filterProtocol(g.Utils.getFieldValue(this.result,this.options.field)):this.filterProtocol(this.result.clickUri)},e.prototype.elementIsAnAnchor=function(){return"A"==this.element.tagName},e.prototype.setField=function(){var t=g.Utils.exists(this.os)?this.os:d.OSUtils.get();t==d.OS_NAME.MACOSX&&this.hasOutlookField()?this.options.field="@outlookformacuri":t==d.OS_NAME.WINDOWS&&this.hasOutlookField()&&(this.options.field="@outlookuri")},e.prototype.hasOutlookField=function(){var t=g.Utils.exists(this.os)?this.os:d.OSUtils.get();return t==d.OS_NAME.MACOSX&&void 0!=this.result.raw.outlookformacuri||t==d.OS_NAME.WINDOWS&&void 0!=this.result.raw.outlookuri},e.prototype.isUriThatMustBeOpenedInQuickview=function(){return 0==this.escapedClickUri.toLowerCase().indexOf("ldap://")},e.prototype.quickviewShouldBeOpened=function(){return(this.options.openQuickview||this.isUriThatMustBeOpenedInQuickview())&&h.QueryUtils.hasHTMLVersion(this.result)},e.ID="ResultLink",e.doExport=function(){_.exportGlobally({ResultLink:e})},e.options={field:s.ComponentOptions.buildFieldOption(),openInOutlook:s.ComponentOptions.buildBooleanOption({defaultValue:!1}),openQuickview:s.ComponentOptions.buildBooleanOption({defaultValue:!1}),alwaysOpenInNewWindow:s.ComponentOptions.buildBooleanOption({defaultValue:!1}),hrefTemplate:s.ComponentOptions.buildStringOption(),titleTemplate:s.ComponentOptions.buildStringOption(),onClick:s.ComponentOptions.buildCustomOption(function(){return null}),logAnalytics:s.ComponentOptions.buildCustomOption(function(){return null})},e}(r.Component);e.ResultLink=T,f.Initialization.registerAutoCreateComponent(T)},710:function(t,e){},711:function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(15),s=n(12),a=n(523),l=n(1),u=n(6),c=n(10),p=n(71),d=n(4),f=n(230),h="coveo-smart-snippet-suggestions-question",m=h+"-title",g=m+"-label",y=m+"-checkbox",b=h+"-snippet",S=b+"-container",v=b+"-hidden",A=b+"-content",_=A+"-raw",O=h+"-source";e.SmartSnippetCollapsibleSuggestionClassNames={QUESTION_CLASSNAME:h,QUESTION_TITLE_CLASSNAME:m,QUESTION_TITLE_LABEL_CLASSNAME:g,QUESTION_TITLE_CHECKBOX_CLASSNAME:y,QUESTION_SNIPPET_CLASSNAME:b,QUESTION_SNIPPET_CONTAINER_CLASSNAME:S,QUESTION_SNIPPET_HIDDEN_CLASSNAME:v,SHADOW_CLASSNAME:A,RAW_CONTENT_CLASSNAME:_,SOURCE_CLASSNAME:O,SOURCE_TITLE_CLASSNAME:"coveo-smart-snippet-suggestions-question-source-title",SOURCE_URL_CLASSNAME:"coveo-smart-snippet-suggestions-question-source-url"};var w=function(){function t(t){this.options=t,this.labelId=o.uniqueId(g),this.snippetId=o.uniqueId(b),this.checkboxId=o.uniqueId(y),this.expanded=!1}return Object.defineProperty(t.prototype,"loading",{get:function(){return this.contentLoaded},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"analyticsSuggestionMeta",{get:function(){var t=this.options.questionAnswer,e=t.documentId,n=t.question,i=t.answerSnippet;return{searchQueryUid:this.options.searchUid,documentId:e,question:n,answerSnippet:i}},enumerable:!0,configurable:!0}),t.prototype.build=function(){var t=this.buildCollapsibleContainer(this.options.questionAnswer,this.buildStyle(this.options.innerCSS)),e=this.buildTitle(this.options.questionAnswer.question);return this.updateExpanded(),l.$$("li",{className:h,ariaLabelledby:this.labelId},e,t).el},t.prototype.buildStyle=function(t){var e=document.createElement("style");return e.innerHTML=t,e},t.prototype.buildTitle=function(t){var e=this,n=this.buildCheckbox(t),i=l.$$("span",{className:g,id:this.labelId});i.text(t);var o=l.$$("span",{className:m},i,n);return o.on("click",function(){return e.toggle()}),o},t.prototype.buildCheckbox=function(t){var e=this;return this.checkbox=l.$$("div",{role:"button",tabindex:0,ariaControls:this.snippetId,className:y,id:this.checkboxId}),(new r.AccessibleButton).withElement(this.checkbox).withLabel(u.l("ExpandQuestionAnswer",t)).withEnterKeyboardAction(function(){return e.toggle()}).build(),this.checkbox},t.prototype.buildCollapsibleContainer=function(t,e){var n=this,i=l.$$("div",{className:A});return this.snippetAndSourceContainer=l.$$("div",{className:S},i),this.collapsibleContainer=l.$$("div",{className:b,id:this.snippetId},this.snippetAndSourceContainer),this.contentLoaded=a.attachShadow(i.el,{mode:"open",title:u.l("AnswerSpecificSnippet",t.question),useIFrame:this.options.useIFrame}).then(function(i){i.appendChild(n.buildAnswerSnippetContent(t,e).el)}),this.options.source&&(this.snippetAndSourceContainer.append(this.buildSourceUrl().el),this.snippetAndSourceContainer.append(this.buildSourceTitle().el)),this.collapsibleContainer},t.prototype.buildAnswerSnippetContent=function(t,e){var n=this,i=l.$$("div",{className:_},f.getSanitizedAnswerSnippet(t));f.transformSnippetLinks(i.el,this.options.alwaysOpenInNewWindow,function(t){return n.sendOpenSnippetLinkAnalytics(t)});var o=l.$$("div",{},i);return o.append(e),o},t.prototype.buildSourceTitle=function(){var t=this.buildLink("coveo-smart-snippet-suggestions-question-source-title");return t.text(d.Utils.getFieldValue(this.options.source,this.options.titleField)),t},t.prototype.buildSourceUrl=function(){var t=this.buildLink("coveo-smart-snippet-suggestions-question-source-url");return t.text(t.el.href),t},t.prototype.buildLink=function(t){var e=this,n=l.$$("a",{className:"CoveoResultLink "+t});return new p.ResultLink(n.el,{hrefTemplate:this.options.hrefTemplate,logAnalytics:function(t){return e.sendOpenSourceAnalytics(n.el,t)},alwaysOpenInNewWindow:this.options.alwaysOpenInNewWindow},i({},this.options.bindings,{resultElement:this.collapsibleContainer.el}),this.options.source),n},t.prototype.toggle=function(){this.expanded=!this.expanded,this.updateExpanded(),this.expanded?this.sendExpandAnalytics():this.sendCollapseAnalytics()},t.prototype.updateIFrameExpanded=function(){var t=this.snippetAndSourceContainer.find("iframe");t&&(this.expanded?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1"))},t.prototype.updateExpanded=function(){this.checkbox.setAttribute("aria-expanded",this.expanded.toString()),this.checkbox.setHtml(this.expanded?s.SVGIcons.icons.arrowUp:s.SVGIcons.icons.arrowDown),this.collapsibleContainer.setAttribute("aria-hidden",(!this.expanded).toString()),this.collapsibleContainer.toggleClass(v,!this.expanded),this.collapsibleContainer.el.style.visibility=this.expanded?"inherit":"hidden",this.collapsibleContainer.el.style.height=this.expanded?this.snippetAndSourceContainer.el.clientHeight+"px":"0px",this.updateIFrameExpanded()},t.prototype.sendExpandAnalytics=function(){return this.options.bindings.usageAnalytics.logCustomEvent(c.analyticsActionCauseList.expandSmartSnippetSuggestion,this.analyticsSuggestionMeta,this.checkbox.el)},t.prototype.sendCollapseAnalytics=function(){return this.options.bindings.usageAnalytics.logCustomEvent(c.analyticsActionCauseList.collapseSmartSnippetSuggestion,this.analyticsSuggestionMeta,this.checkbox.el)},t.prototype.sendOpenSourceAnalytics=function(t,e){return this.options.bindings.usageAnalytics.logClickEvent(c.analyticsActionCauseList.openSmartSnippetSuggestionSource,i({},this.analyticsSuggestionMeta,{documentTitle:this.options.source.title,author:d.Utils.getFieldValue(this.options.source,"author"),documentURL:e}),this.options.source,t)},t.prototype.sendOpenSnippetLinkAnalytics=function(t){return this.options.bindings.usageAnalytics.logClickEvent(c.analyticsActionCauseList.openSmartSnippetSuggestionInlineLink,i({},this.analyticsSuggestionMeta,{linkText:t.innerText,linkURL:t.href}),this.options.source,t)},t}();e.SmartSnippetCollapsibleSuggestion=w}}); //# sourceMappingURL=SmartSnippetSuggestions.min__cf4c4f4dd6c8a707e936.js.map