coveo.analytics 2.26.3 → 2.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var coveoua=function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function a(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function c(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}function p(){return c()&&navigator.cookieEnabled}!function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"}(r||(r={}));var h=[r.click,r.custom,r.search,r.view],d=function(e,t){return-1!==h.indexOf(e)?n({language:u()?document.documentElement.lang:"unknown",userAgent:c()?navigator.userAgent:"unknown"},t):t},f=function(){function e(){}return e.set=function(e,t,r){var n,o,i;r&&(n=new Date).setTime(n.getTime()+r),-1===(i=window.location.hostname).indexOf(".")?v(e,t,n):v(e,t,n,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},e.get=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n];if(0===(o=o.replace(/^\s+/,"")).lastIndexOf(t,0))return o.substring(t.length,o.length)}return null},e.erase=function(t){e.set(t,"",-1)},e}();function v(e,t,r,n){document.cookie=e+"="+t+(r?";expires="+r.toUTCString():"")+(n?";domain="+n:"")+";SameSite=Lax"}function g(){return l()?localStorage:p()?new m:function(){try{return"undefined"!=typeof sessionStorage}catch(e){return!1}}()?sessionStorage:new S}var m=function(){function e(){}return e.prototype.getItem=function(t){return f.get(""+e.prefix+t)},e.prototype.removeItem=function(t){f.erase(""+e.prefix+t)},e.prototype.setItem=function(t,r,n){f.set(""+e.prefix+t,r,n)},e.prefix="coveo_",e}(),y=function(){function e(){this.cookieStorage=new m}return e.prototype.getItem=function(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)},e.prototype.removeItem=function(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)},e.prototype.setItem=function(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)},e}(),S=function(){function e(){}return e.prototype.getItem=function(e){return null},e.prototype.removeItem=function(e){},e.prototype.setItem=function(e,t){},e}(),k=Object.freeze({__proto__:null,preferredStorage:null,getAvailableStorage:g,CookieStorage:m,CookieAndLocalStorage:y,NullStorage:S}),w="__coveo.analytics.history",I=function(){function e(e){this.store=e||g()}return e.prototype.addElement=function(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));var t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])},e.prototype.addElementAsync=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=r.sent())?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e]),[2]}}))}))},e.prototype.getHistory=function(){var e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))},e.prototype.getHistoryAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return e=t.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(e))]}}))}))},e.prototype.getHistoryWithInternalTime=function(){try{var e=this.store.getItem(w);return e&&"string"==typeof e?JSON.parse(e):[]}catch(e){return[]}},e.prototype.getHistoryWithInternalTimeAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.store.getItem(w)];case 1:return(e=t.sent())?[2,JSON.parse(e)]:[2,[]];case 2:return t.sent(),[2,[]];case 3:return[2]}}))}))},e.prototype.setHistory=function(e){try{this.store.setItem(w,JSON.stringify(e.slice(0,20)))}catch(e){}},e.prototype.clear=function(){try{this.store.removeItem(w)}catch(e){}},e.prototype.getMostRecentElement=function(){var e=this.getHistoryWithInternalTime();return null!=e?e.sort((function(e,t){return(t.internalTime||0)-(e.internalTime||0)}))[0]:null},e.prototype.cropQueryElement=function(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e},e.prototype.isValidEntry=function(e){var t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4},e.prototype.stripInternalTime=function(e){return e.map((function(e){return{name:e.name,time:e.time,value:e.value}}))},e.prototype.stripEmptyQuery=function(e){var t=e.name,r=e.time,n=e.value;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e},e.prototype.stripEmptyQueries=function(e){var t=this;return e.map((function(e){return t.stripEmptyQuery(e)}))},e}(),b=Object.freeze({__proto__:null,STORE_KEY:w,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,MAX_VALUE_SIZE:75,HistoryStore:I,default:I}),E=function(e,t){return i(void 0,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return e!==r.view?[3,2]:[4,C(t.contentIdValue)];case 1:return o.sent(),[2,n({location:window.location.toString(),referrer:document.referrer,title:document.title},t)];case 2:return[2,t]}}))}))},C=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=new I,r={name:"PageView",value:e,time:JSON.stringify(new Date)},[4,t.addElementAsync(r)];case 1:return n.sent(),[2]}}))}))};let D;const U=new Uint8Array(16);function R(){if(!D&&(D="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!D))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return D(U)}var A=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(e){return"string"==typeof e&&A.test(e)}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));function x(e,t=0){return(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase()}var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(e,t,r){if(T.randomUUID&&!t&&!e)return T.randomUUID();const n=(e=e||{}).random||(e.rng||R)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return x(n)}function O(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function V(e,t){return e<<t|e>>>32-t}var M=function(e,t,r){function n(e,n,o,i){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=function(e){if(!P(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}(n)),16!==(null===(s=n)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),a=r(a),a[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=a[e];return o}return x(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let t=0;t<o;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];i[t]=r}i[o-1][14]=8*(e.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<o;++e){const n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=i[e][t];for(let e=16;e<80;++e)n[e]=V(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let o=r[0],s=r[1],a=r[2],c=r[3],u=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),i=V(o,5)+O(r,s,a,c)+u+t[r]+n[e]>>>0;u=c,c=a,a=V(s,30)>>>0,s=o,o=i}r[0]=r[0]+o>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),_="2.26.3",q=function(e){return e.protocol+"//"+e.hostname+(0===e.pathname.indexOf("/")?e.pathname:"/"+e.pathname)+e.search},Q={pageview:"pageview",event:"event"},N=function(e){var t=e.client,r=e.uuidGenerator,n=void 0===r?L:r;this.client=t,this.uuidGenerator=n},H=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=q(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return t(r,e),r.prototype.getApi=function(e){return"setAction"===e?this.setAction:null},r.prototype.setAction=function(e,t){this.action=e,this.actionData=t},r.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},r.prototype.getLocationInformation=function(e,t){return n({hitType:e},this.getNextValues(e,t))},r.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},r.prototype.getDefaultContextInformation=function(e){var t={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},r={screenResolution:screen.width+"x"+screen.height,screenColor:screen.colorDepth+"-bit"},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return n(n(n(n({},i),r),o),t)},r.prototype.updateLocationForNextPageView=function(e,t){var r=this.getNextValues(e,t),n=r.pageViewId,o=r.referrer,i=r.location;this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,e===Q.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},r.prototype.getNextValues=function(e,t){return{pageViewId:e===Q.pageview?this.nextPageViewId:this.pageViewId,referrer:e===Q.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===Q.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},r.prototype.getCurrentLocationFromPayload=function(e){if(e.page){return""+this.currentLocation.split("/").slice(0,3).join("/")+e.page.replace(/^\/?(.*)$/,"/$1")}return q(window.location)},r}(N),B=function(){function e(e,t){if(!P(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/1e3)}return e.prototype.toString=function(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()},Object.defineProperty(e.prototype,"expired",{get:function(){var t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime},enumerable:!1,configurable:!0}),e.prototype.validate=function(e,t){return!this.expired&&this.matchReferrer(e,t)},e.prototype.matchReferrer=function(e,t){try{var r=new URL(e);return t.some((function(e){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host)}))}catch(e){return!1}},e.fromString=function(t){var r=t.split(".");if(2!==r.length)return null;var n=r[0],o=r[1];if(32!==n.length||isNaN(parseInt(o)))return null;var i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return P(i)?new e(i,1e3*Number.parseInt(o)):null},e.cvo_cid="cvo_cid",e.expirationTime=120,e}(),j=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n;return e.call(this,{client:r,uuidGenerator:o})||this}return t(r,e),r.prototype.getApi=function(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},r.prototype.decorate=function(e){return i(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");n.label=1;case 1:return n.trys.push([1,3,,4]),t=new URL(e),[4,this.client.getCurrentVisitorId()];case 2:return r=n.sent(),t.searchParams.set(B.cvo_cid,new B(r,Date.now()).toString()),[2,t.toString()];case 3:throw n.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},r.prototype.acceptFrom=function(e){this.client.setAcceptedLinkReferrers(e)},r.Id="link",r}(N),Y=j,z=Object.keys;function K(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var W={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},G=a(z(W).map((function(e){return W[e]}))).join("|"),$=new RegExp("^("+G+"$)"),J=[function(e){return $.test(e)}],X={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ee={action:"pa",list:"pal",listSource:"pls"},te={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},re={id:"quoteId",affiliation:"quoteAffiliation"},ne={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},oe={add:ee,bookmark_add:ee,bookmark_remove:ee,click:ee,checkout:ee,checkout_option:ee,detail:ee,impression:ee,remove:ee,refund:n(n({},ee),te),purchase:n(n({},ee),te),quickview:ee,quote:n(n({},ee),re),review:n(n({},ee),ne)},ie=function(e,t,r,o){return z(e).reduce((function(i,s){var a,c="il"+(t+1)+o+(r+1)+(Z[s]||s);return n(n({},i),((a={})[c]=e[s],a))}),{})},se=z(X).map((function(e){return X[e]})),ae=z(Z).map((function(e){return Z[e]})),ce=z(ee).map((function(e){return ee[e]})),ue=z(te).map((function(e){return te[e]})),le=z(ne).map((function(e){return ne[e]})),pe=z(re).map((function(e){return re[e]})),he=a(se,["custom"]).join("|"),de=a(ae,["custom"]).join("|"),fe=new RegExp("^(pr[0-9]+)("+he+")$"),ve=new RegExp("^((il[0-9]+pi[0-9]+)("+de+"))|(il[0-9]+nm)$"),ge=new RegExp("^("+ce.join("|")+")$"),me=new RegExp("^("+ue.join("|")+")$"),ye=new RegExp("^(pr[0-9]+)custom$"),Se=new RegExp("^(il[0-9]+pi[0-9]+)custom$"),ke=new RegExp("^("+a(["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],le,pe).join("|")+")$"),we=[function(e){return ve.test(e)},function(e){return fe.test(e)},function(e){return ge.test(e)},function(e){return me.test(e)},function(e){return ke.test(e)}],Ie=[ye,Se],be=n(n(n(n({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale"].reduce((function(e,t){var r;return n(n({},e),((r={})[t]=t,r))}),{})),Ee=n(n({},be),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Ce=z(Ee).map((function(e){return Ee[e]})),De=function(e){return-1!==Ce.indexOf(e)},Ue=function(e){return"custom"===e},Re=function(e){var t=void 0;return a(Ie).every((function(r){var n;return t=null===(n=r.exec(e))||void 0===n?void 0:n[1],!Boolean(t)})),t},Ae=function(e,t){return z(t).reduce((function(r,o){var i;return n(n({},r),((i={})[""+e+o]=t[o],i))}),{})},Pe=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i,a,c,u,l,p,h,d,f;return s(this,(function(s){switch(s.label){case 0:if(!navigator.sendBeacon)throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');return r=this.opts,o=r.baseUrl,i=r.preprocessRequest,a=this.encodeForEventType(e,t),[4,this.getQueryParamsForEventType(e)];case 1:return c=s.sent(),u={url:o+"/analytics/"+e+"?"+c,body:new Blob([a],{type:"application/x-www-form-urlencoded"})},d=[n({},u)],i?[4,i(u,"analyticsBeacon")]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f={},s.label=4;case 4:return l=n.apply(void 0,d.concat([f])),p=l.url,h=l.body,console.log('Sending beacon for "'+e+'" with: ',JSON.stringify(t)),navigator.sendBeacon(p,h),[2]}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},e.prototype.encodeForEventType=function(e,t){return this.isEventTypeLegacy(e)?this.encodeForLegacyType(e,t):this.encodeForFormUrlEncoded(n({access_token:this.opts.token},t))},e.prototype.getQueryParamsForEventType=function(e){return i(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(o){switch(o.label){case 0:return t=this.opts,r=t.token,[4,t.visitorIdProvider.getCurrentVisitorId()];case 1:return n=o.sent(),[2,[r&&this.isEventTypeLegacy(e)?"access_token="+r:"",n?"visitorId="+n:"","discardVisitInfo=true"].filter((function(e){return!!e})).join("&")]}}))}))},e.prototype.isEventTypeLegacy=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.encodeForLegacyType=function(e,t){return e+"Event="+encodeURIComponent(JSON.stringify(t))},e.prototype.encodeForFormUrlEncoded=function(e){var t=this;return Object.keys(e).filter((function(t){return!!e[t]})).map((function(r){return encodeURIComponent(r)+"="+encodeURIComponent(t.encodeValue(e[r]))})).join("&")},e.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},e}(),Fe=function(){function e(){}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e}(),xe=window.fetch,Te=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,i,a,c,u,l,p,h,d,f,v,g,m;return s(this,(function(s){switch(s.label){case 0:return r=this.opts,i=r.baseUrl,a=r.visitorIdProvider,c=r.preprocessRequest,this.shouldAppendVisitorId(e)?[4,this.getVisitorIdParam()]:[3,2];case 1:return u=s.sent(),[3,3];case 2:u="",s.label=3;case 3:return l={url:i+"/analytics/"+e+u,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},f=[n({},l)],c?[4,c(l,"analyticsFetch")]:[3,5];case 4:return v=s.sent(),[3,6];case 5:v={},s.label=6;case 6:return p=n.apply(void 0,f.concat([v])),h=p.url,d=o(p,["url"]),[4,xe(h,d)];case 7:return(g=s.sent()).ok?[4,g.json()]:[3,9];case 8:return(m=s.sent()).visitorId&&a.setCurrentVisitorId(m.visitorId),[2,m];case 9:try{g.json()}catch(e){}throw console.error('An error has occured when sending the "'+e+'" event.',g,t),new Error('An error has occurred when sending the "'+e+'" event. Check the console logs for more details.')}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this.opts.baseUrl,[4,xe(e+"/analytics/visit",{headers:this.getHeaders(),method:"DELETE"})];case 1:return t.sent(),[2]}}))}))},e.prototype.shouldAppendVisitorId=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.getVisitorIdParam=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(e=t.sent())?"?visitor="+e:""]}}))}))},e.prototype.getHeaders=function(){var e=this.opts.token;return n(n({},e?{Authorization:"Bearer "+e}:{}),{"Content-Type":"application/json"})},e}(),Le=function(e,t){var r=this;l()&&p()?this.storage=new y:l()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new S),this.client=new Te(e),this.beaconClient=new Pe(e),window.addEventListener("beforeunload",(function(){for(var e=0,n=t();e<n.length;e++){var o=n[e],i=o.eventType,s=o.payload;r.beaconClient.sendEvent(i,s)}}))},Oe=function(e,t){this.storage=t||new S,this.client=new Te(e)},Ve=function(){this.storage=new S,this.client=new Fe};var Me=["1",1,"yes",!0];function _e(){return c()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(e){return-1!==Me.indexOf(e)}))}var qe=Object.freeze({__proto__:null,doNotTrack:_e,default:_e}),Qe="v15",Ne={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function He(e,t){void 0===e&&(e=Ne.default),void 0===t&&(t=Qe);var r=-1!==e.indexOf(".cloud.coveo.com");return e+(r?"":"/rest")+"/"+t}var Be,je,Ye,ze=function(){function e(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=n(n({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[E,d].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};var t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),_e()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return{endpoint:Ne.default,token:"",version:Qe,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&u()?new Le(e,(function(){var e=a(t.bufferedRequests);return t.bufferedRequests=[],e})):("undefined"!=typeof navigator&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please use the \"coveo.analytics/react-native\" subpackage.\n Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native\n "),new Oe(e))},Object.defineProperty(e.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),e.prototype.determineVisitorId=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),(e=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:e=r.sent(),r.label=2;case 2:return[2,e||L()];case 3:return t=r.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),[2,L()];case 4:return[2]}}))}))},e.prototype.getCurrentVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return e=t.sent(),[4,this.setCurrentVisitorId(e)];case 2:t.sent(),t.label=3;case 3:return[2,this.visitorId]}}))}))},e.prototype.setCurrentVisitorId=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.visitorId=e,[4,this.storage.setItem("visitorId",e)];case 1:return t.sent(),[2]}}))}))},e.prototype.setClientId=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){if(P(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(M(e,M(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}return[2]}))}))},e.prototype.getParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return[2,r.sent()]}}))}))},e.prototype.getPayload=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return r=n.sent(),[4,this.resolvePayloadForParameters(e,r)];case 2:return[2,n.sent()]}}))}))},Object.defineProperty(e.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(L()),this.visitorId},set:function(e){this.visitorId=e,this.storage.setItem("visitorId",e)},enumerable:!1,configurable:!0}),e.prototype.extractClientIdFromLink=function(e){if(_e())return null;try{var t=new URL(e).searchParams.get(B.cvo_cid);if(null==t)return null;var r=B.fromString(t);return r&&u()&&r.validate(document.referrer,this.acceptedLinkReferrers)?r.clientId:null}catch(e){}return null},e.prototype.resolveParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,a,c,u,l,p,h,d,f,v,g,m=this;return s(this,(function(y){switch(y.label){case 0:return r=this.eventTypeMapping[e]||{},o=r.variableLengthArgumentsNames,a=void 0===o?[]:o,c=r.addVisitorIdParameter,u=void 0!==c&&c,l=r.usesMeasurementProtocol,p=void 0!==l&&l,h=r.addClientIdParameter,d=void 0!==h&&h,f=function(e){return i(m,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=[n({},e)],r={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return o=i.sent(),[3,3];case 2:o="",i.label=3;case 3:return[2,n.apply(void 0,t.concat([(r.visitorId=o,r)]))]}}))}))},v=function(e){return i(m,void 0,void 0,(function(){var t,r;return s(this,(function(o){switch(o.label){case 0:return d?(t=[n({},e)],r={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,n.apply(void 0,t.concat([(r.clientId=o.sent(),r)]))];case 2:return[2,e]}}))}))},g=function(t){return m.beforeSendHooks.reduce((function(t,r){return i(m,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return n=o.sent(),[4,r(e,n)];case 2:return[2,o.sent()]}}))}))}),t)},[4,[function(e){return a.length>0?m.parseVariableArgumentsPayload(a,e):e[0]},f,v,function(e){return p?m.ensureAnonymousUserWhenUsingApiKey(e):e},g].reduce((function(e,t){return i(m,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,y.sent()]}}))}))},e.prototype.resolvePayloadForParameters=function(e,t){return i(this,void 0,void 0,(function(){var r,o,a,c=this;return s(this,(function(u){switch(u.label){case 0:return r=(this.eventTypeMapping[e]||{}).usesMeasurementProtocol,o=void 0!==r&&r,a=function(e){return o?(r=!!(t=e).action&&oe[t.action]||{},z(t).reduce((function(e,o){var i,s=r[o]||Ee[o]||o;return n(n({},e),((i={})[s]=t[o],i))}),{})):e;var t,r},[4,[function(t){return c.removeEmptyPayloadValues(t,e)},function(e){return c.validateParams(e)},a,function(e){return o?c.removeUnknownParameters(e):e},function(e){return o?c.processCustomParameters(e):c.mapCustomParametersToCustomData(e)}].reduce((function(e,t){return i(c,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,u.sent()]}}))}))},e.prototype.makeEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,c,u,l=this;return s(this,(function(p){switch(p.label){case 0:return r=(this.eventTypeMapping[e]||{}).newEventType,o=void 0===r?e:r,[4,this.resolveParameters.apply(this,a([e],t))];case 1:return c=p.sent(),[4,this.resolvePayloadForParameters(e,c)];case 2:return u=p.sent(),[2,{eventType:o,payload:u,log:function(t){return i(l,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.bufferedRequests.push({eventType:o,payload:n(n({},u),t)}),[4,Promise.all(this.afterSendHooks.map((function(r){return r(e,n(n({},c),t))})))];case 1:return r.sent(),[4,this.deferExecution()];case 2:return r.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,r.sent()]}}))}))}}]}}))}))},e.prototype.sendEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeEvent.apply(this,a([e],t))];case 1:return[2,r.sent().log({})]}}))}))},e.prototype.deferExecution=function(){return new Promise((function(e){return setTimeout(e,0)}))},e.prototype.sendFromBufferWithFetch=function(){return i(this,void 0,void 0,(function(){var e,t,r;return s(this,(function(n){return(e=this.bufferedRequests.shift())?(t=e.eventType,r=e.payload,[2,this.runtime.client.sendEvent(t,r)]):[2]}))}))},e.prototype.clear=function(){this.storage.removeItem("visitorId"),(new I).clear()},e.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},e.prototype.makeSearchEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.search,e)]}))}))},e.prototype.sendSearchEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeClickEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.click,e)]}))}))},e.prototype.sendClickEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClickEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeCustomEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.custom,e)]}))}))},e.prototype.sendCustomEvent=function(e){var t=e.lastSearchQueryUid,r=o(e,["lastSearchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCustomEvent(r)];case 1:return[2,e.sent().log({lastSearchQueryUid:t})]}}))}))},e.prototype.makeViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.view,e)]}))}))},e.prototype.sendViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeViewEvent(e)];case 1:return[2,t.sent().log({})]}}))}))},e.prototype.getVisit=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,fetch(this.baseUrl+"/analytics/visit")];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),this.visitorId=e.visitorId,[2,e]}}))}))},e.prototype.getHealth=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/monitoring/health")];case 1:return[4,e.sent().json()];case 2:return[2,e.sent()]}}))}))},e.prototype.registerBeforeSendEventHook=function(e){this.beforeSendHooks.push(e)},e.prototype.registerAfterSendEventHook=function(e){this.afterSendHooks.push(e)},e.prototype.addEventTypeMapping=function(e,t){this.eventTypeMapping[e]=t},e.prototype.setAcceptedLinkReferrers=function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e})))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=e},e.prototype.parseVariableArgumentsPayload=function(e,t){for(var r={},o=0,i=t.length;o<i;o++){var s=t[o];if("string"==typeof s)r[e[o]]=s;else if("object"==typeof s)return n(n({},r),s)}return r},e.prototype.isKeyAllowedEmpty=function(e,t){var n;return-1!==(((n={})[r.search]=["queryText"],n)[e]||[]).indexOf(t)},e.prototype.removeEmptyPayloadValues=function(e,t){var r=this;return Object.keys(e).filter((function(n){return r.isKeyAllowedEmpty(t,n)||null!=(o=e[n])&&""!==o;var o})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{})},e.prototype.removeUnknownParameters=function(e){var t=Object.keys(e).filter((function(e){if(function(e){return a(we,J,[De,Ue]).some((function(t){return t(e)}))}(e))return!0;console.log(e,"is not processed by coveoua")})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{});return t},e.prototype.processCustomParameters=function(e){var t=e.custom,r=o(e,["custom"]),i={};t&&K(t)&&(i=this.lowercaseKeys(t));var s,a=z(s=r).reduce((function(e,t){var r,o=Re(t);return n(n({},e),o?Ae(o,s[t]):((r={})[t]=s[t],r))}),{});return n(n({},i),a)},e.prototype.mapCustomParametersToCustomData=function(e){var t=e.custom,r=o(e,["custom"]);if(t&&K(t)){var i=this.lowercaseKeys(t);return n(n({},r),{customData:n(n({},i),e.customData)})}return e},e.prototype.lowercaseKeys=function(e){var t=Object.keys(e),r={};return t.forEach((function(t){r[t.toLowerCase()]=e[t]})),r},e.prototype.validateParams=function(e){var t=e.anonymizeIp,r=o(e,["anonymizeIp"]);return void 0!==t&&-1==["0","false","undefined","null","{}","[]",""].indexOf((""+t).toLowerCase())&&(r.anonymizeIp=1),r},e.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,r=e.userId,n=o(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!r?(n.userId="anonymous",n):e},Object.defineProperty(e.prototype,"baseUrl",{get:function(){return He(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),e}(),Ke=Object.freeze({__proto__:null,Version:Qe,Endpoints:Ne,buildBaseUrl:He,CoveoAnalyticsClient:ze,default:ze}),We=n({},Q),Ge=Object.keys(We).map((function(e){return We[e]})),$e=function(e){function i(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return t(i,e),i.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);if(null!==r)return r;switch(t){case"addProduct":return this.addProduct;case"addImpression":return this.addImpression;default:return null}},i.prototype.addHooks=function(){this.addHooksForPageView(),this.addHooksForEvent(),this.addHooksForECEvents()},i.prototype.addProduct=function(e){this.products.push(e)},i.prototype.addImpression=function(e){this.impressions.push(e)},i.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},i.prototype.addHooksForECEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)?e.addECDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)&&e.updateLocationInformation(t,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(We.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(We.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(e,t){var r=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),n(n(n(n({},i),o),r),t)},i.prototype.getProductPayload=function(){var e=this;return this.products.map((function(t){return e.assureProductValidity(t)})).reduce((function(e,t,r){return n(n({},e),function(e,t){return z(e).reduce((function(r,o){var i,s="pr"+(t+1)+(X[o]||o);return n(n({},r),((i={})[s]=e[o],i))}),{})}(t,r))}),{})},i.prototype.getImpressionPayload=function(){var e=this;return this.getImpressionsByList().map((function(t){var r=t.impressions,i=o(t,["impressions"]);return n(n({},i),{impressions:r.map((function(t){return e.assureBaseImpressionValidity(t)}))})})).reduce((function(e,t,r){return n(n({},e),function(e,t,r){var o=e.impressions.reduce((function(e,o,i){return n(n({},e),ie(o,t,i,r))}),{});return e.listName&&(o["il"+(t+1)+"nm"]=e.listName),o}(t,r,"pi"))}),{})},i.prototype.assureProductValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.assureBaseImpressionValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(e,t){var r=t.list,n=o(t,["list"]),i=e.find((function(e){return e.listName===r}));return i?i.impressions.push(n):e.push({listName:r,impressions:[n]}),e}),[])},i.Id="ec",i}(H),Je=$e,Xe=n({},Q),Ze=Object.keys(Xe).map((function(e){return Xe[e]})),et=function(e){function o(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.ticket={},i}return t(o,e),o.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);return null!==r?r:"setTicket"===t?this.setTicket:null},o.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},o.prototype.setTicket=function(e){this.ticket=e},o.prototype.clearPluginData=function(){this.ticket={}},o.prototype.addHooksForSVCEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)?e.addSVCDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)&&e.updateLocationInformation(t,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Xe.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Xe.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(e,t){var r,o=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(r=this.actionData)&&void 0!==r?r:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),n(n(n({},i),o),t)},o.prototype.getTicketPayload=function(){return e=this.ticket,z(e).filter((function(t){return void 0!==e[t]})).reduce((function(t,r){var o,i=W[r]||r;return n(n({},t),((o={})[i]=e[r],o))}),{});var e},o.Id="svc",o}(H),tt=et,rt=function(){function e(){var e;this.registeredPluginsMap=((e={})[Je.Id]=Je,e[tt.Id]=tt,e[Y.Id]=Y,e),this.requiredPlugins={}}return e.prototype.require=function(e,t){var r=this.registeredPluginsMap[e];if(!r)throw new Error('No plugin named "'+e+"\" is currently registered. If you use a custom plugin, use 'provide' first.");this.requiredPlugins[e]=new r(t)},e.prototype.provide=function(e,t){this.registeredPluginsMap[e]=t},e.prototype.clearRequired=function(){this.requiredPlugins={}},e.prototype.execute=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'+e+'" is not required. Check that you required it on initialization.');var i=o.getApi(t);if(!i)throw new Error('The function "'+t+'" does not exist on the plugin "'+e+'".');if("function"!=typeof i)throw new Error('"'+t+'" of the plugin "'+e+'" is not a function.');return i.apply(o,r)},e.DefaultPlugins=[Je.Id,tt.Id,Y.Id],e}(),nt=function(){function e(){this.plugins=new rt,this.params={}}return e.prototype.init=function(e,t){var o=this;if(!e)throw new Error("You must pass your token when you call 'init'");if("string"==typeof e?this.client=new ze({token:e,endpoint:this.getEndpoint(t)}):this.isAnalyticsClient(e)&&(this.client=e),!this.client)throw new Error("You must pass either your token or a valid object when you call 'init'");var i={client:this.client};this.plugins.clearRequired(),this.getPluginKeys(t).forEach((function(e){return o.plugins.require(e,i)})),this.client.registerBeforeSendEventHook((function(e,t){return n(n({},t),o.params)})),this.client.addEventTypeMapping(r.view,{newEventType:r.view,addClientIdParameter:!0})},e.prototype.isAnalyticsClient=function(e){return"object"==typeof e&&void 0!==e.sendEvent},e.prototype.getPluginKeys=function(e){return"string"==typeof e?rt.DefaultPlugins:Array.isArray(null==e?void 0:e.plugins)?e.plugins:rt.DefaultPlugins},e.prototype.getEndpoint=function(e){return"string"==typeof e?e||Ne.default:(null==e?void 0:e.endpoint)?e.endpoint:Ne.default},e.prototype.initForProxy=function(e){if(!e)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof e)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new ze({endpoint:e})},e.prototype.set=function(e,t){var r=this;"string"==typeof e?this.params[e]=t:Object.keys(e).map((function(t){r.params[t]=e[t]}))},e.prototype.send=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!n)throw new Error('You must provide an event type when calling "send".');return(e=this.client).sendEvent.apply(e,a([n.toLowerCase()],o))},e.prototype.onLoad=function(e){if(void 0===e)throw new Error("You must pass a function when you call 'onLoad'");e()},e.prototype.provide=function(e,t){this.plugins.provide(e,t)},e.prototype.require=function(e,t){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(e,n(n({},t),{client:this.client}))},e.prototype.callPlugin=function(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return(r=this.plugins).execute.apply(r,a([e,t],n))},e.prototype.reset=function(){this.client=void 0,this.plugins=new rt,this.params={}},e.prototype.version=function(){return _},e}(),ot=new nt,it=function(){return ot.client},st=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e);n[1];var o=n[2],i=n[3],s=ot[i];if(o&&i)return ot.callPlugin.apply(ot,a([o,i],t));if(s)return s.apply(ot,t);var c=["init","set","send","onLoad","callPlugin","reset","require","provide","version"];throw new Error('The action "'+e+'" does not exist. Available actions: '+c.join(", ")+".")},at=Object.freeze({__proto__:null,CoveoUA:nt,coveoua:ot,getCurrentClient:it,handleOneAnalyticsEvent:st,default:st});!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView"}(Be||(Be={})),function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseAttach="caseAttach",e.caseDetach="caseDetach"}(Ye||(Ye={}));var ct=((je={})[Ye.triggerNotify]="queryPipelineTriggers",je[Ye.triggerExecute]="queryPipelineTriggers",je[Ye.triggerQuery]="queryPipelineTriggers",je[Ye.triggerRedirect]="queryPipelineTriggers",je[Ye.queryError]="errors",je[Ye.queryErrorBack]="errors",je[Ye.queryErrorClear]="errors",je[Ye.queryErrorRetry]="errors",je[Ye.pagerNext]="getMoreResults",je[Ye.pagerPrevious]="getMoreResults",je[Ye.pagerNumber]="getMoreResults",je[Ye.pagerResize]="getMoreResults",je[Ye.pagerScrolling]="getMoreResults",je[Ye.facetSearch]="facet",je[Ye.facetShowLess]="facet",je[Ye.facetShowMore]="facet",je[Ye.recommendation]="recommendation",je[Ye.likeSmartSnippet]="smartSnippet",je[Ye.dislikeSmartSnippet]="smartSnippet",je[Ye.expandSmartSnippet]="smartSnippet",je[Ye.collapseSmartSnippet]="smartSnippet",je[Ye.openSmartSnippetFeedbackModal]="smartSnippet",je[Ye.closeSmartSnippetFeedbackModal]="smartSnippet",je[Ye.sendSmartSnippetReason]="smartSnippet",je[Ye.expandSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.clearRecentQueries]="recentQueries",je[Ye.recentResultClick]="recentlyClickedDocuments",je[Ye.clearRecentResults]="recentlyClickedDocuments",je[Ye.showLessFoldedResults]="folding",je[Be.expandToFullUI]="interface",je[Be.openUserActions]="User Actions",je[Be.showPrecedingSessions]="User Actions",je[Be.showFollowingSessions]="User Actions",je[Be.clickViewedDocument]="User Actions",je[Be.clickPageView]="User Actions",je[Ye.caseDetach]="case",je),ut=function(){function e(){this.runtime=new Ve,this.currentVisitorId=""}return e.prototype.getPayload=function(){return Promise.resolve()},e.prototype.getParameters=function(){return Promise.resolve()},e.prototype.makeEvent=function(e){return Promise.resolve({eventType:e,payload:null,log:function(){return Promise.resolve()}})},e.prototype.sendEvent=function(){return Promise.resolve()},e.prototype.makeSearchEvent=function(){return this.makeEvent(r.search)},e.prototype.sendSearchEvent=function(){return Promise.resolve()},e.prototype.makeClickEvent=function(){return this.makeEvent(r.click)},e.prototype.sendClickEvent=function(){return Promise.resolve()},e.prototype.makeCustomEvent=function(){return this.makeEvent(r.custom)},e.prototype.sendCustomEvent=function(){return Promise.resolve()},e.prototype.makeViewEvent=function(){return this.makeEvent(r.view)},e.prototype.sendViewEvent=function(){return Promise.resolve()},e.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},e.prototype.getHealth=function(){return Promise.resolve({status:""})},e.prototype.registerBeforeSendEventHook=function(){},e.prototype.registerAfterSendEventHook=function(){},e.prototype.addEventTypeMapping=function(){},Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e}();function lt(e){var t=e.join(";");return t.length<=256?t:lt(e.slice(1))}var pt=function(e){var t=function(e){return e.map((function(e){return e.replace(/;/g,"")}))}(e),r=function(e){var t="";return e.filter((function(e){var r=e!==t;return t=e,r}))}(t);return lt(r)};function ht(e){var t="string"==typeof e.partialQueries?e.partialQueries:pt(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:pt(e.suggestions);return n(n({},e),{partialQueries:t,suggestions:r})}var dt,ft,vt,gt=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(Ye.recommendationInterfaceLoad)},e.prototype.logRecommendationInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendationInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendation=function(){return this.makeCustomEvent(Ye.recommendation)},e.prototype.logRecommendation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendation()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationOpen=function(e,t){return this.makeClickEvent(Ye.recommendationOpen,e,t)},e.prototype.logRecommendationOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecommendationOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(Ye.staticFilterClearAll,e)},e.prototype.logStaticFilterClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterSelect=function(e){return this.makeSearchEvent(Ye.staticFilterSelect,e)},e.prototype.logStaticFilterSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterDeselect=function(e){return this.makeSearchEvent(Ye.staticFilterDeselect,e)},e.prototype.logStaticFilterDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logFetchMoreResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFetchMoreResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeInterfaceChange=function(e){return this.makeSearchEvent(Ye.interfaceChange,e)},e.prototype.logInterfaceChange=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeInterfaceChange(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanAutomatic=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanAutomatic()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(Ye.didyoumeanClick)},e.prototype.logDidYouMeanClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeResultsSort=function(e){return this.makeSearchEvent(Ye.resultsSort,e)},e.prototype.logResultsSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeResultsSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(Ye.searchboxSubmit)},e.prototype.logSearchboxSubmit=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxSubmit()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(Ye.searchboxClear)},e.prototype.logSearchboxClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(Ye.searchboxAsYouType)},e.prototype.logSearchboxAsYouType=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxAsYouType()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbFacet=function(e){return this.makeSearchEvent(Ye.breadcrumbFacet,e)},e.prototype.logBreadcrumbFacet=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeBreadcrumbFacet(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logBreadcrumbResetAll=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeBreadcrumbResetAll()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentQuickview=function(e,t){return this.makeClickEvent(Ye.documentQuickview,e,t)},e.prototype.logDocumentQuickview=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentQuickview(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(Ye.documentOpen,e,t)},e.prototype.logDocumentOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(Ye.omniboxAnalytics,ht(e))},e.prototype.logOmniboxAnalytics=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxAnalytics(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxFromLink=function(e){return this.makeSearchEvent(Ye.omniboxFromLink,ht(e))},e.prototype.logOmniboxFromLink=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxFromLink(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(Ye.searchFromLink)},e.prototype.logSearchFromLink=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchFromLink()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerNotify=function(e){return this.makeCustomEvent(Ye.triggerNotify,e)},e.prototype.logTriggerNotify=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerNotify(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerExecute=function(e){return this.makeCustomEvent(Ye.triggerExecute,e)},e.prototype.logTriggerExecute=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerExecute(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(Ye.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},e.prototype.logTriggerQuery=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerQuery()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeUndoTriggerQuery=function(e){return this.makeSearchEvent(Ye.undoTriggerQuery,e)},e.prototype.logUndoTriggerQuery=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeUndoTriggerQuery(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerRedirect=function(e){return this.makeCustomEvent(Ye.triggerRedirect,n(n({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))},e.prototype.logTriggerRedirect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerRedirect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerResize=function(e){return this.makeCustomEvent(Ye.pagerResize,e)},e.prototype.logPagerResize=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerResize(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNumber=function(e){return this.makeCustomEvent(Ye.pagerNumber,e)},e.prototype.logPagerNumber=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNumber(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNext=function(e){return this.makeCustomEvent(Ye.pagerNext,e)},e.prototype.logPagerNext=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNext(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerPrevious=function(e){return this.makeCustomEvent(Ye.pagerPrevious,e)},e.prototype.logPagerPrevious=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerPrevious(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerScrolling=function(){return this.makeCustomEvent(Ye.pagerScrolling)},e.prototype.logPagerScrolling=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerScrolling()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetClearAll=function(e){return this.makeSearchEvent(Ye.facetClearAll,e)},e.prototype.logFacetClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSearch=function(e){return this.makeSearchEvent(Ye.facetSearch,e)},e.prototype.logFacetSearch=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSearch(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelect=function(e){return this.makeSearchEvent(Ye.facetSelect,e)},e.prototype.logFacetSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetDeselect=function(e){return this.makeSearchEvent(Ye.facetDeselect,e)},e.prototype.logFacetDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetExclude=function(e){return this.makeSearchEvent(Ye.facetExclude,e)},e.prototype.logFacetExclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetExclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUnexclude=function(e){return this.makeSearchEvent(Ye.facetUnexclude,e)},e.prototype.logFacetUnexclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUnexclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelectAll=function(e){return this.makeSearchEvent(Ye.facetSelectAll,e)},e.prototype.logFacetSelectAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelectAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUpdateSort=function(e){return this.makeSearchEvent(Ye.facetUpdateSort,e)},e.prototype.logFacetUpdateSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUpdateSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowMore=function(e){return this.makeCustomEvent(Ye.facetShowMore,e)},e.prototype.logFacetShowMore=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowMore(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowLess=function(e){return this.makeCustomEvent(Ye.facetShowLess,e)},e.prototype.logFacetShowLess=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowLess(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryError=function(e){return this.makeCustomEvent(Ye.queryError,e)},e.prototype.logQueryError=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryError(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorBack=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorBack)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorBack)]}}))}))}}]}}))}))},e.prototype.logQueryErrorBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorRetry)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorRetry)]}}))}))}}]}}))}))},e.prototype.logQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorRetry()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorClear=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorClear)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorClear)]}}))}))}}]}}))}))},e.prototype.logQueryErrorClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(Ye.likeSmartSnippet)},e.prototype.logLikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeLikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(Ye.dislikeSmartSnippet)},e.prototype.logDislikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDislikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(Ye.expandSmartSnippet)},e.prototype.logExpandSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeExpandSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(Ye.collapseSmartSnippet)},e.prototype.logCollapseSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCollapseSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.openSmartSnippetFeedbackModal)},e.prototype.logOpenSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOpenSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.closeSmartSnippetFeedbackModal)},e.prototype.logCloseSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCloseSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSmartSnippetFeedbackReason=function(e,t){return this.makeCustomEvent(Ye.sendSmartSnippetReason,{reason:e,details:t})},e.prototype.logSmartSnippetFeedbackReason=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logExpandSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeExpandSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logCollapseSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCollapseSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showMoreSmartSnippetSuggestion,e)},e.prototype.logShowMoreSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowMoreSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showLessSmartSnippetSuggestion,e)},e.prototype.logShowLessSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowLessSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSource,e,t)},e.prototype.logOpenSmartSnippetSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.makeCopyToClipboard=function(e,t){return this.makeClickEvent(Ye.copyToClipboard,e,t)},e.prototype.logCopyToClipboard=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCopyToClipboard(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)},e.prototype.logOpenSmartSnippetInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(Ye.recentQueryClick)},e.prototype.logRecentQueryClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecentQueryClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(Ye.clearRecentQueries)},e.prototype.logClearRecentQueries=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentQueries()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentResultClick=function(e,t){return this.makeCustomEvent(Ye.recentResultClick,{info:e,identifier:t})},e.prototype.logRecentResultClick=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecentResultClick(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(Ye.clearRecentResults)},e.prototype.logClearRecentResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(Ye.noResultsBack)},e.prototype.logNoResultsBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeNoResultsBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreFoldedResults=function(e,t){return this.makeClickEvent(Ye.showMoreFoldedResults,e,t)},e.prototype.logShowMoreFoldedResults=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeShowMoreFoldedResults(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(Ye.showLessFoldedResults)},e.prototype.logShowLessFoldedResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowLessFoldedResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeEventDescription=function(e,t){var r;return{actionCause:t,customData:null===(r=e.payload)||void 0===r?void 0:r.customData}},e.prototype.makeCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=n(n({},this.provider.getBaseMetadata()),t),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:r,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return o=n(n({},this.provider.getBaseMetadata()),r),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:t,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEventWithType(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSearchEvent(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(e,t)];case 1:return r=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(r)];case 2:return n=o.sent(),[2,{description:this.makeEventDescription(n,e),log:function(e){var t=e.searchUID;return n.log({searchQueryUid:t})}}]}}))}))},e.prototype.makeClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a,c;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:e}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({searchQueryUid:t})}}]}}))}))},e.prototype.logClickEvent=function(e,t,r,n){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(e,t,r,n)];case 1:return[2,o.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n(n({},this.getOrigins()),this.getSplitTestRun())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e.prototype.getSplitTestRun=function(){var e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return n(n({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})},e}();!function(e){e.click="click",e.flowStart="flowStart"}(dt||(dt={})),function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.suggestionClick="suggestion_click",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"}(ft||(ft={})),function(e){e.quit="Quit",e.solved="Solved"}(vt||(vt={}));var mt=function(){function e(e,t){var r;this.options=e,this.provider=t;var n=(null===(r=e.enableAnalytics)||void 0===r||r)&&!_e();this.coveoAnalyticsClient=n?new ze(e):new ut,this.svc=new et({client:this.coveoAnalyticsClient})}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut,this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.options),this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.logEnterInterface=function(e){return this.svc.setAction(ft.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},e.prototype.logUpdateCaseField=function(e){return this.svc.setAction(ft.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(ft.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionRate,n({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(ft.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCancelled=function(e){return this.svc.setAction(ft.caseCancelled,{reason:vt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseSolved=function(e){return this.svc.setAction(ft.caseSolved,{reason:vt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCreated=function(e){return this.svc.setAction(ft.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e}(),yt=function(e,t){void 0===t&&(t=!0),e.caseContext;var r=e.caseId,i=e.caseNumber,s=o(e,["caseContext","caseId","caseNumber"]),a=function(e){var t={};return e.caseContext&&Object.keys(e.caseContext).forEach((function(r){var n,o=null===(n=e.caseContext)||void 0===n?void 0:n[r];o&&(t["context_"+r]=o)})),t}(e);return n(n(n({CaseId:r,CaseNumber:i},s),!!a.context_Case_Subject&&{CaseSubject:a.context_Case_Subject}),t&&a)},St=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.logInterfaceLoad=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceLoad,t)}return this.logSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceChange=function(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceChange,t)},e.prototype.logStaticFilterDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.staticFilterDeselect,t)},e.prototype.logFetchMoreResults=function(e){if(e){var t=yt(e);return this.logCustomEvent(Ye.pagerScrolling,n(n({},t),{type:"getMoreResults"}))}return this.logCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logBreadcrumbFacet=function(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbFacet,t)},e.prototype.logBreadcrumbResetAll=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbResetAll,t)}return this.logSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logFacetSelect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetSelect,t)},e.prototype.logFacetDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetDeselect,t)},e.prototype.logFacetUpdateSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetUpdateSort,t)},e.prototype.logFacetClearAll=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetClearAll,t)},e.prototype.logFacetShowMore=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowMore,t)},e.prototype.logFacetShowLess=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowLess,t)},e.prototype.logQueryError=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.queryError,t)},e.prototype.logPagerNumber=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNumber,t)},e.prototype.logPagerNext=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNext,t)},e.prototype.logPagerPrevious=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerPrevious,t)},e.prototype.logDidYouMeanAutomatic=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanAutomatic,t)}return this.logSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanClick=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanClick,t)}return this.logSearchEvent(Ye.didyoumeanClick)},e.prototype.logResultsSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.resultsSort,t)},e.prototype.logSearchboxSubmit=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.searchboxSubmit,t)}return this.logSearchEvent(Ye.searchboxSubmit)},e.prototype.logContextChanged=function(e){var t=yt(e);return this.logSearchEvent(Be.contextChanged,t)},e.prototype.logExpandToFullUI=function(e){var t=yt(e);return this.logCustomEvent(Be.expandToFullUI,t)},e.prototype.logOpenUserActions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.openUserActions,t)},e.prototype.logShowPrecedingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showPrecedingSessions,t)},e.prototype.logShowFollowingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showFollowingSessions,t)},e.prototype.logViewedDocumentClick=function(e,t){return this.logCustomEvent(Be.clickViewedDocument,n(n({},yt(t,!1)),{document:e}))},e.prototype.logPageViewClick=function(e,t){return this.logCustomEvent(Be.clickPageView,n(n({},yt(t,!1)),{pageView:e}))},e.prototype.logDocumentOpen=function(e,t,r){return this.logClickEvent(Ye.documentOpen,e,t,r?yt(r,!1):void 0)},e.prototype.logCopyToClipboard=function(e,t,r){return this.logClickEvent(Ye.copyToClipboard,e,t,r?yt(r,!1):void 0)},e.prototype.logDocumentQuickview=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl};return this.logClickEvent(Ye.documentQuickview,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseAttach=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl,resultUriHash:e.documentUriHash};return this.logClickEvent(Ye.caseAttach,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseDetach=function(e,t){return this.logCustomEvent(Ye.caseDetach,t?n(n({},yt(t,!1)),{resultUriHash:e}):{resultUriHash:e})},e.prototype.logCustomEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(s){switch(s.label){case 0:return r=n(n({},this.provider.getBaseMetadata()),t),i=[{}],[4,this.getBaseCustomEventRequest(r)];case 1:return o=n.apply(void 0,[n.apply(void 0,i.concat([s.sent()])),{eventType:ct[e],eventValue:e}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return n=(r=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(e,t)];case 1:return[2,n.apply(r,[o.sent()])]}}))}))},e.prototype.logClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}]),[2,this.coveoAnalyticsClient.sendClickEvent(i)]}}))}))},e.prototype.getBaseCustomEventRequest=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,t.concat([r.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n({},this.getOrigins())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e}(),kt=Object.freeze({__proto__:null,analytics:Ke,donottrack:qe,history:b,SimpleAnalytics:at,storage:k,CoveoAnalyticsClient:ze,CoveoUA:nt,getCurrentClient:it,handleOneAnalyticsEvent:st,CoveoSearchPageClient:gt,CaseAssistClient:mt,CoveoInsightClient:St});window.Promise instanceof Function||global||console.error('This script uses window.Promise which is not supported in your browser. Consider adding a polyfill like "es6-promise".'),window.fetch instanceof Function||global||console.error('This script uses window.fetch which is not supported in your browser. Consider adding a polyfill like "fetch".');var wt=self.coveoua||st;(self.coveoua=st,self.coveoanalytics=kt,wt.q)&&a(wt.q.filter((function(e){return"init"===e[0]})),wt.q.filter((function(e){return"init"!==e[0]}))).forEach((function(e){return st.apply(void 0,e)}));return self.coveoua}();
1
+ var coveoua=function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function a(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function c(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}function p(){return c()&&navigator.cookieEnabled}!function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"}(r||(r={}));var h=[r.click,r.custom,r.search,r.view],d=function(e,t){return-1!==h.indexOf(e)?n({language:u()?document.documentElement.lang:"unknown",userAgent:c()?navigator.userAgent:"unknown"},t):t},f=function(){function e(){}return e.set=function(e,t,r){var n,o,i;r&&(n=new Date).setTime(n.getTime()+r),-1===(i=window.location.hostname).indexOf(".")?v(e,t,n):v(e,t,n,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},e.get=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n];if(0===(o=o.replace(/^\s+/,"")).lastIndexOf(t,0))return o.substring(t.length,o.length)}return null},e.erase=function(t){e.set(t,"",-1)},e}();function v(e,t,r,n){document.cookie=e+"="+t+(r?";expires="+r.toUTCString():"")+(n?";domain="+n:"")+";SameSite=Lax"}function g(){return l()?localStorage:p()?new m:function(){try{return"undefined"!=typeof sessionStorage}catch(e){return!1}}()?sessionStorage:new S}var m=function(){function e(){}return e.prototype.getItem=function(t){return f.get(""+e.prefix+t)},e.prototype.removeItem=function(t){f.erase(""+e.prefix+t)},e.prototype.setItem=function(t,r,n){f.set(""+e.prefix+t,r,n)},e.prefix="coveo_",e}(),y=function(){function e(){this.cookieStorage=new m}return e.prototype.getItem=function(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)},e.prototype.removeItem=function(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)},e.prototype.setItem=function(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)},e}(),S=function(){function e(){}return e.prototype.getItem=function(e){return null},e.prototype.removeItem=function(e){},e.prototype.setItem=function(e,t){},e}(),k=Object.freeze({__proto__:null,preferredStorage:null,getAvailableStorage:g,CookieStorage:m,CookieAndLocalStorage:y,NullStorage:S}),w="__coveo.analytics.history",I=function(){function e(e){this.store=e||g()}return e.prototype.addElement=function(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));var t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])},e.prototype.addElementAsync=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=r.sent())?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e]),[2]}}))}))},e.prototype.getHistory=function(){var e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))},e.prototype.getHistoryAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return e=t.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(e))]}}))}))},e.prototype.getHistoryWithInternalTime=function(){try{var e=this.store.getItem(w);return e&&"string"==typeof e?JSON.parse(e):[]}catch(e){return[]}},e.prototype.getHistoryWithInternalTimeAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.store.getItem(w)];case 1:return(e=t.sent())?[2,JSON.parse(e)]:[2,[]];case 2:return t.sent(),[2,[]];case 3:return[2]}}))}))},e.prototype.setHistory=function(e){try{this.store.setItem(w,JSON.stringify(e.slice(0,20)))}catch(e){}},e.prototype.clear=function(){try{this.store.removeItem(w)}catch(e){}},e.prototype.getMostRecentElement=function(){var e=this.getHistoryWithInternalTime();return null!=e?e.sort((function(e,t){return(t.internalTime||0)-(e.internalTime||0)}))[0]:null},e.prototype.cropQueryElement=function(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e},e.prototype.isValidEntry=function(e){var t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4},e.prototype.stripInternalTime=function(e){return e.map((function(e){return{name:e.name,time:e.time,value:e.value}}))},e.prototype.stripEmptyQuery=function(e){var t=e.name,r=e.time,n=e.value;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e},e.prototype.stripEmptyQueries=function(e){var t=this;return e.map((function(e){return t.stripEmptyQuery(e)}))},e}(),b=Object.freeze({__proto__:null,STORE_KEY:w,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,MAX_VALUE_SIZE:75,HistoryStore:I,default:I}),E=function(e,t){return i(void 0,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return e!==r.view?[3,2]:[4,C(t.contentIdValue)];case 1:return o.sent(),[2,n({location:window.location.toString(),referrer:document.referrer,title:document.title},t)];case 2:return[2,t]}}))}))},C=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=new I,r={name:"PageView",value:e,time:JSON.stringify(new Date)},[4,t.addElementAsync(r)];case 1:return n.sent(),[2]}}))}))};let D;const U=new Uint8Array(16);function R(){if(!D&&(D="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!D))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return D(U)}var A=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(e){return"string"==typeof e&&A.test(e)}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));function x(e,t=0){return(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase()}var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(e,t,r){if(T.randomUUID&&!t&&!e)return T.randomUUID();const n=(e=e||{}).random||(e.rng||R)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return x(n)}function O(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function V(e,t){return e<<t|e>>>32-t}var M=function(e,t,r){function n(e,n,o,i){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=function(e){if(!P(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}(n)),16!==(null===(s=n)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),a=r(a),a[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=a[e];return o}return x(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let t=0;t<o;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];i[t]=r}i[o-1][14]=8*(e.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<o;++e){const n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=i[e][t];for(let e=16;e<80;++e)n[e]=V(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let o=r[0],s=r[1],a=r[2],c=r[3],u=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),i=V(o,5)+O(r,s,a,c)+u+t[r]+n[e]>>>0;u=c,c=a,a=V(s,30)>>>0,s=o,o=i}r[0]=r[0]+o>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),_="2.26.4",q=function(e){return e.protocol+"//"+e.hostname+(0===e.pathname.indexOf("/")?e.pathname:"/"+e.pathname)+e.search},Q={pageview:"pageview",event:"event"},N=function(e){var t=e.client,r=e.uuidGenerator,n=void 0===r?L:r;this.client=t,this.uuidGenerator=n},H=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=q(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return t(r,e),r.prototype.getApi=function(e){return"setAction"===e?this.setAction:null},r.prototype.setAction=function(e,t){this.action=e,this.actionData=t},r.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},r.prototype.getLocationInformation=function(e,t){return n({hitType:e},this.getNextValues(e,t))},r.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},r.prototype.getDefaultContextInformation=function(e){var t={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},r={screenResolution:screen.width+"x"+screen.height,screenColor:screen.colorDepth+"-bit"},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return n(n(n(n({},i),r),o),t)},r.prototype.updateLocationForNextPageView=function(e,t){var r=this.getNextValues(e,t),n=r.pageViewId,o=r.referrer,i=r.location;this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,e===Q.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},r.prototype.getNextValues=function(e,t){return{pageViewId:e===Q.pageview?this.nextPageViewId:this.pageViewId,referrer:e===Q.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===Q.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},r.prototype.getCurrentLocationFromPayload=function(e){if(e.page){return""+this.currentLocation.split("/").slice(0,3).join("/")+e.page.replace(/^\/?(.*)$/,"/$1")}return q(window.location)},r}(N),B=function(){function e(e,t){if(!P(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/1e3)}return e.prototype.toString=function(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()},Object.defineProperty(e.prototype,"expired",{get:function(){var t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime},enumerable:!1,configurable:!0}),e.prototype.validate=function(e,t){return!this.expired&&this.matchReferrer(e,t)},e.prototype.matchReferrer=function(e,t){try{var r=new URL(e);return t.some((function(e){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host)}))}catch(e){return!1}},e.fromString=function(t){var r=t.split(".");if(2!==r.length)return null;var n=r[0],o=r[1];if(32!==n.length||isNaN(parseInt(o)))return null;var i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return P(i)?new e(i,1e3*Number.parseInt(o)):null},e.cvo_cid="cvo_cid",e.expirationTime=120,e}(),j=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n;return e.call(this,{client:r,uuidGenerator:o})||this}return t(r,e),r.prototype.getApi=function(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},r.prototype.decorate=function(e){return i(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");n.label=1;case 1:return n.trys.push([1,3,,4]),t=new URL(e),[4,this.client.getCurrentVisitorId()];case 2:return r=n.sent(),t.searchParams.set(B.cvo_cid,new B(r,Date.now()).toString()),[2,t.toString()];case 3:throw n.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},r.prototype.acceptFrom=function(e){this.client.setAcceptedLinkReferrers(e)},r.Id="link",r}(N),Y=j,z=Object.keys;function K(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var W={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},G=a(z(W).map((function(e){return W[e]}))).join("|"),$=new RegExp("^("+G+"$)"),J=[function(e){return $.test(e)}],X={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ee={action:"pa",list:"pal",listSource:"pls"},te={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},re={id:"quoteId",affiliation:"quoteAffiliation"},ne={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},oe={add:ee,bookmark_add:ee,bookmark_remove:ee,click:ee,checkout:ee,checkout_option:ee,detail:ee,impression:ee,remove:ee,refund:n(n({},ee),te),purchase:n(n({},ee),te),quickview:ee,quote:n(n({},ee),re),review:n(n({},ee),ne)},ie=function(e,t,r,o){return z(e).reduce((function(i,s){var a,c="il"+(t+1)+o+(r+1)+(Z[s]||s);return n(n({},i),((a={})[c]=e[s],a))}),{})},se=z(X).map((function(e){return X[e]})),ae=z(Z).map((function(e){return Z[e]})),ce=z(ee).map((function(e){return ee[e]})),ue=z(te).map((function(e){return te[e]})),le=z(ne).map((function(e){return ne[e]})),pe=z(re).map((function(e){return re[e]})),he=a(se,["custom"]).join("|"),de=a(ae,["custom"]).join("|"),fe=new RegExp("^(pr[0-9]+)("+he+")$"),ve=new RegExp("^((il[0-9]+pi[0-9]+)("+de+"))|(il[0-9]+nm)$"),ge=new RegExp("^("+ce.join("|")+")$"),me=new RegExp("^("+ue.join("|")+")$"),ye=new RegExp("^(pr[0-9]+)custom$"),Se=new RegExp("^(il[0-9]+pi[0-9]+)custom$"),ke=new RegExp("^("+a(["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],le,pe).join("|")+")$"),we=[function(e){return ve.test(e)},function(e){return fe.test(e)},function(e){return ge.test(e)},function(e){return me.test(e)},function(e){return ke.test(e)}],Ie=[ye,Se],be=n(n(n(n({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale"].reduce((function(e,t){var r;return n(n({},e),((r={})[t]=t,r))}),{})),Ee=n(n({},be),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Ce=z(Ee).map((function(e){return Ee[e]})),De=function(e){return-1!==Ce.indexOf(e)},Ue=function(e){return"custom"===e},Re=function(e){var t=void 0;return a(Ie).every((function(r){var n;return t=null===(n=r.exec(e))||void 0===n?void 0:n[1],!Boolean(t)})),t},Ae=function(e,t){return z(t).reduce((function(r,o){var i;return n(n({},r),((i={})[""+e+o]=t[o],i))}),{})},Pe=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i,a,c,u,l,p,h,d,f;return s(this,(function(s){switch(s.label){case 0:if(!navigator.sendBeacon)throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');return r=this.opts,o=r.baseUrl,i=r.preprocessRequest,a=this.encodeForEventType(e,t),[4,this.getQueryParamsForEventType(e)];case 1:return c=s.sent(),u={url:o+"/analytics/"+e+"?"+c,body:new Blob([a],{type:"application/x-www-form-urlencoded"})},d=[n({},u)],i?[4,i(u,"analyticsBeacon")]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f={},s.label=4;case 4:return l=n.apply(void 0,d.concat([f])),p=l.url,h=l.body,console.log('Sending beacon for "'+e+'" with: ',JSON.stringify(t)),navigator.sendBeacon(p,h),[2]}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},e.prototype.encodeForEventType=function(e,t){return this.isEventTypeLegacy(e)?this.encodeForLegacyType(e,t):this.encodeForFormUrlEncoded(n({access_token:this.opts.token},t))},e.prototype.getQueryParamsForEventType=function(e){return i(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(o){switch(o.label){case 0:return t=this.opts,r=t.token,[4,t.visitorIdProvider.getCurrentVisitorId()];case 1:return n=o.sent(),[2,[r&&this.isEventTypeLegacy(e)?"access_token="+r:"",n?"visitorId="+n:"","discardVisitInfo=true"].filter((function(e){return!!e})).join("&")]}}))}))},e.prototype.isEventTypeLegacy=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.encodeForLegacyType=function(e,t){return e+"Event="+encodeURIComponent(JSON.stringify(t))},e.prototype.encodeForFormUrlEncoded=function(e){var t=this;return Object.keys(e).filter((function(t){return!!e[t]})).map((function(r){return encodeURIComponent(r)+"="+encodeURIComponent(t.encodeValue(e[r]))})).join("&")},e.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},e}(),Fe=function(){function e(){}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e}(),xe=window.fetch,Te=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,i,a,c,u,l,p,h,d,f,v,g,m;return s(this,(function(s){switch(s.label){case 0:return r=this.opts,i=r.baseUrl,a=r.visitorIdProvider,c=r.preprocessRequest,this.shouldAppendVisitorId(e)?[4,this.getVisitorIdParam()]:[3,2];case 1:return u=s.sent(),[3,3];case 2:u="",s.label=3;case 3:return l={url:i+"/analytics/"+e+u,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},f=[n({},l)],c?[4,c(l,"analyticsFetch")]:[3,5];case 4:return v=s.sent(),[3,6];case 5:v={},s.label=6;case 6:return p=n.apply(void 0,f.concat([v])),h=p.url,d=o(p,["url"]),[4,xe(h,d)];case 7:return(g=s.sent()).ok?[4,g.json()]:[3,9];case 8:return(m=s.sent()).visitorId&&a.setCurrentVisitorId(m.visitorId),[2,m];case 9:try{g.json()}catch(e){}throw console.error('An error has occured when sending the "'+e+'" event.',g,t),new Error('An error has occurred when sending the "'+e+'" event. Check the console logs for more details.')}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this.opts.baseUrl,[4,xe(e+"/analytics/visit",{headers:this.getHeaders(),method:"DELETE"})];case 1:return t.sent(),[2]}}))}))},e.prototype.shouldAppendVisitorId=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.getVisitorIdParam=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(e=t.sent())?"?visitor="+e:""]}}))}))},e.prototype.getHeaders=function(){var e=this.opts.token;return n(n({},e?{Authorization:"Bearer "+e}:{}),{"Content-Type":"application/json"})},e}(),Le=function(e,t){var r=this;l()&&p()?this.storage=new y:l()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new S),this.client=new Te(e),this.beaconClient=new Pe(e),window.addEventListener("beforeunload",(function(){for(var e=0,n=t();e<n.length;e++){var o=n[e],i=o.eventType,s=o.payload;r.beaconClient.sendEvent(i,s)}}))},Oe=function(e,t){this.storage=t||new S,this.client=new Te(e)},Ve=function(){this.storage=new S,this.client=new Fe};var Me=["1",1,"yes",!0];function _e(){return c()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(e){return-1!==Me.indexOf(e)}))}var qe=Object.freeze({__proto__:null,doNotTrack:_e,default:_e}),Qe="v15",Ne={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function He(e,t){void 0===e&&(e=Ne.default),void 0===t&&(t=Qe);var r=-1!==e.indexOf(".cloud.coveo.com");return e+(r?"":"/rest")+"/"+t}var Be,je,Ye,ze=function(){function e(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=n(n({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[E,d].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};var t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),_e()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return{endpoint:Ne.default,token:"",version:Qe,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&u()?new Le(e,(function(){var e=a(t.bufferedRequests);return t.bufferedRequests=[],e})):("undefined"!=typeof navigator&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please use the \"coveo.analytics/react-native\" subpackage.\n Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native\n "),new Oe(e))},Object.defineProperty(e.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),e.prototype.determineVisitorId=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),(e=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:e=r.sent(),r.label=2;case 2:return[2,e||L()];case 3:return t=r.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),[2,L()];case 4:return[2]}}))}))},e.prototype.getCurrentVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return e=t.sent(),[4,this.setCurrentVisitorId(e)];case 2:t.sent(),t.label=3;case 3:return[2,this.visitorId]}}))}))},e.prototype.setCurrentVisitorId=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.visitorId=e,[4,this.storage.setItem("visitorId",e)];case 1:return t.sent(),[2]}}))}))},e.prototype.setClientId=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){if(P(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(M(e,M(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}return[2]}))}))},e.prototype.getParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return[2,r.sent()]}}))}))},e.prototype.getPayload=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return r=n.sent(),[4,this.resolvePayloadForParameters(e,r)];case 2:return[2,n.sent()]}}))}))},Object.defineProperty(e.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(L()),this.visitorId},set:function(e){this.visitorId=e,this.storage.setItem("visitorId",e)},enumerable:!1,configurable:!0}),e.prototype.extractClientIdFromLink=function(e){if(_e())return null;try{var t=new URL(e).searchParams.get(B.cvo_cid);if(null==t)return null;var r=B.fromString(t);return r&&u()&&r.validate(document.referrer,this.acceptedLinkReferrers)?r.clientId:null}catch(e){}return null},e.prototype.resolveParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,a,c,u,l,p,h,d,f,v,g,m=this;return s(this,(function(y){switch(y.label){case 0:return r=this.eventTypeMapping[e]||{},o=r.variableLengthArgumentsNames,a=void 0===o?[]:o,c=r.addVisitorIdParameter,u=void 0!==c&&c,l=r.usesMeasurementProtocol,p=void 0!==l&&l,h=r.addClientIdParameter,d=void 0!==h&&h,f=function(e){return i(m,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=[n({},e)],r={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return o=i.sent(),[3,3];case 2:o="",i.label=3;case 3:return[2,n.apply(void 0,t.concat([(r.visitorId=o,r)]))]}}))}))},v=function(e){return i(m,void 0,void 0,(function(){var t,r;return s(this,(function(o){switch(o.label){case 0:return d?(t=[n({},e)],r={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,n.apply(void 0,t.concat([(r.clientId=o.sent(),r)]))];case 2:return[2,e]}}))}))},g=function(t){return m.beforeSendHooks.reduce((function(t,r){return i(m,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return n=o.sent(),[4,r(e,n)];case 2:return[2,o.sent()]}}))}))}),t)},[4,[function(e){return a.length>0?m.parseVariableArgumentsPayload(a,e):e[0]},f,v,function(e){return p?m.ensureAnonymousUserWhenUsingApiKey(e):e},g].reduce((function(e,t){return i(m,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,y.sent()]}}))}))},e.prototype.resolvePayloadForParameters=function(e,t){return i(this,void 0,void 0,(function(){var r,o,a,c=this;return s(this,(function(u){switch(u.label){case 0:return r=(this.eventTypeMapping[e]||{}).usesMeasurementProtocol,o=void 0!==r&&r,a=function(e){return o?(r=!!(t=e).action&&oe[t.action]||{},z(t).reduce((function(e,o){var i,s=r[o]||Ee[o]||o;return n(n({},e),((i={})[s]=t[o],i))}),{})):e;var t,r},[4,[function(t){return c.removeEmptyPayloadValues(t,e)},function(e){return c.validateParams(e)},a,function(e){return o?c.removeUnknownParameters(e):e},function(e){return o?c.processCustomParameters(e):c.mapCustomParametersToCustomData(e)}].reduce((function(e,t){return i(c,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,u.sent()]}}))}))},e.prototype.makeEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,c,u,l=this;return s(this,(function(p){switch(p.label){case 0:return r=(this.eventTypeMapping[e]||{}).newEventType,o=void 0===r?e:r,[4,this.resolveParameters.apply(this,a([e],t))];case 1:return c=p.sent(),[4,this.resolvePayloadForParameters(e,c)];case 2:return u=p.sent(),[2,{eventType:o,payload:u,log:function(t){return i(l,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.bufferedRequests.push({eventType:o,payload:n(n({},u),t)}),[4,Promise.all(this.afterSendHooks.map((function(r){return r(e,n(n({},c),t))})))];case 1:return r.sent(),[4,this.deferExecution()];case 2:return r.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,r.sent()]}}))}))}}]}}))}))},e.prototype.sendEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeEvent.apply(this,a([e],t))];case 1:return[2,r.sent().log({})]}}))}))},e.prototype.deferExecution=function(){return new Promise((function(e){return setTimeout(e,0)}))},e.prototype.sendFromBufferWithFetch=function(){return i(this,void 0,void 0,(function(){var e,t,r;return s(this,(function(n){return(e=this.bufferedRequests.shift())?(t=e.eventType,r=e.payload,[2,this.runtime.client.sendEvent(t,r)]):[2]}))}))},e.prototype.clear=function(){this.storage.removeItem("visitorId"),(new I).clear()},e.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},e.prototype.makeSearchEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.search,e)]}))}))},e.prototype.sendSearchEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeClickEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.click,e)]}))}))},e.prototype.sendClickEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClickEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeCustomEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.custom,e)]}))}))},e.prototype.sendCustomEvent=function(e){var t=e.lastSearchQueryUid,r=o(e,["lastSearchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCustomEvent(r)];case 1:return[2,e.sent().log({lastSearchQueryUid:t})]}}))}))},e.prototype.makeViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.view,e)]}))}))},e.prototype.sendViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeViewEvent(e)];case 1:return[2,t.sent().log({})]}}))}))},e.prototype.getVisit=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,fetch(this.baseUrl+"/analytics/visit")];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),this.visitorId=e.visitorId,[2,e]}}))}))},e.prototype.getHealth=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/monitoring/health")];case 1:return[4,e.sent().json()];case 2:return[2,e.sent()]}}))}))},e.prototype.registerBeforeSendEventHook=function(e){this.beforeSendHooks.push(e)},e.prototype.registerAfterSendEventHook=function(e){this.afterSendHooks.push(e)},e.prototype.addEventTypeMapping=function(e,t){this.eventTypeMapping[e]=t},e.prototype.setAcceptedLinkReferrers=function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e})))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=e},e.prototype.parseVariableArgumentsPayload=function(e,t){for(var r={},o=0,i=t.length;o<i;o++){var s=t[o];if("string"==typeof s)r[e[o]]=s;else if("object"==typeof s)return n(n({},r),s)}return r},e.prototype.isKeyAllowedEmpty=function(e,t){var n;return-1!==(((n={})[r.search]=["queryText"],n)[e]||[]).indexOf(t)},e.prototype.removeEmptyPayloadValues=function(e,t){var r=this;return Object.keys(e).filter((function(n){return r.isKeyAllowedEmpty(t,n)||null!=(o=e[n])&&""!==o;var o})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{})},e.prototype.removeUnknownParameters=function(e){var t=Object.keys(e).filter((function(e){if(function(e){return a(we,J,[De,Ue]).some((function(t){return t(e)}))}(e))return!0;console.log(e,"is not processed by coveoua")})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{});return t},e.prototype.processCustomParameters=function(e){var t=e.custom,r=o(e,["custom"]),i={};t&&K(t)&&(i=this.lowercaseKeys(t));var s,a=z(s=r).reduce((function(e,t){var r,o=Re(t);return n(n({},e),o?Ae(o,s[t]):((r={})[t]=s[t],r))}),{});return n(n({},i),a)},e.prototype.mapCustomParametersToCustomData=function(e){var t=e.custom,r=o(e,["custom"]);if(t&&K(t)){var i=this.lowercaseKeys(t);return n(n({},r),{customData:n(n({},i),e.customData)})}return e},e.prototype.lowercaseKeys=function(e){var t=Object.keys(e),r={};return t.forEach((function(t){r[t.toLowerCase()]=e[t]})),r},e.prototype.validateParams=function(e){var t=e.anonymizeIp,r=o(e,["anonymizeIp"]);return void 0!==t&&-1==["0","false","undefined","null","{}","[]",""].indexOf((""+t).toLowerCase())&&(r.anonymizeIp=1),r},e.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,r=e.userId,n=o(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!r?(n.userId="anonymous",n):e},Object.defineProperty(e.prototype,"baseUrl",{get:function(){return He(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),e}(),Ke=Object.freeze({__proto__:null,Version:Qe,Endpoints:Ne,buildBaseUrl:He,CoveoAnalyticsClient:ze,default:ze}),We=n({},Q),Ge=Object.keys(We).map((function(e){return We[e]})),$e=function(e){function i(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return t(i,e),i.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);if(null!==r)return r;switch(t){case"addProduct":return this.addProduct;case"addImpression":return this.addImpression;default:return null}},i.prototype.addHooks=function(){this.addHooksForPageView(),this.addHooksForEvent(),this.addHooksForECEvents()},i.prototype.addProduct=function(e){this.products.push(e)},i.prototype.addImpression=function(e){this.impressions.push(e)},i.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},i.prototype.addHooksForECEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)?e.addECDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)&&e.updateLocationInformation(t,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(We.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(We.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(e,t){var r=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),n(n(n(n({},i),o),r),t)},i.prototype.getProductPayload=function(){var e=this;return this.products.map((function(t){return e.assureProductValidity(t)})).reduce((function(e,t,r){return n(n({},e),function(e,t){return z(e).reduce((function(r,o){var i,s="pr"+(t+1)+(X[o]||o);return n(n({},r),((i={})[s]=e[o],i))}),{})}(t,r))}),{})},i.prototype.getImpressionPayload=function(){var e=this;return this.getImpressionsByList().map((function(t){var r=t.impressions,i=o(t,["impressions"]);return n(n({},i),{impressions:r.map((function(t){return e.assureBaseImpressionValidity(t)}))})})).reduce((function(e,t,r){return n(n({},e),function(e,t,r){var o=e.impressions.reduce((function(e,o,i){return n(n({},e),ie(o,t,i,r))}),{});return e.listName&&(o["il"+(t+1)+"nm"]=e.listName),o}(t,r,"pi"))}),{})},i.prototype.assureProductValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.assureBaseImpressionValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(e,t){var r=t.list,n=o(t,["list"]),i=e.find((function(e){return e.listName===r}));return i?i.impressions.push(n):e.push({listName:r,impressions:[n]}),e}),[])},i.Id="ec",i}(H),Je=$e,Xe=n({},Q),Ze=Object.keys(Xe).map((function(e){return Xe[e]})),et=function(e){function o(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.ticket={},i}return t(o,e),o.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);return null!==r?r:"setTicket"===t?this.setTicket:null},o.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},o.prototype.setTicket=function(e){this.ticket=e},o.prototype.clearPluginData=function(){this.ticket={}},o.prototype.addHooksForSVCEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)?e.addSVCDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)&&e.updateLocationInformation(t,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Xe.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Xe.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(e,t){var r,o=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(r=this.actionData)&&void 0!==r?r:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),n(n(n({},i),o),t)},o.prototype.getTicketPayload=function(){return e=this.ticket,z(e).filter((function(t){return void 0!==e[t]})).reduce((function(t,r){var o,i=W[r]||r;return n(n({},t),((o={})[i]=e[r],o))}),{});var e},o.Id="svc",o}(H),tt=et,rt=function(){function e(){var e;this.registeredPluginsMap=((e={})[Je.Id]=Je,e[tt.Id]=tt,e[Y.Id]=Y,e),this.requiredPlugins={}}return e.prototype.require=function(e,t){var r=this.registeredPluginsMap[e];if(!r)throw new Error('No plugin named "'+e+"\" is currently registered. If you use a custom plugin, use 'provide' first.");this.requiredPlugins[e]=new r(t)},e.prototype.provide=function(e,t){this.registeredPluginsMap[e]=t},e.prototype.clearRequired=function(){this.requiredPlugins={}},e.prototype.execute=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'+e+'" is not required. Check that you required it on initialization.');var i=o.getApi(t);if(!i)throw new Error('The function "'+t+'" does not exist on the plugin "'+e+'".');if("function"!=typeof i)throw new Error('"'+t+'" of the plugin "'+e+'" is not a function.');return i.apply(o,r)},e.DefaultPlugins=[Je.Id,tt.Id,Y.Id],e}(),nt=function(){function e(){this.plugins=new rt,this.params={}}return e.prototype.init=function(e,t){var o=this;if(!e)throw new Error("You must pass your token when you call 'init'");if("string"==typeof e?this.client=new ze({token:e,endpoint:this.getEndpoint(t)}):this.isAnalyticsClient(e)&&(this.client=e),!this.client)throw new Error("You must pass either your token or a valid object when you call 'init'");var i={client:this.client};this.plugins.clearRequired(),this.getPluginKeys(t).forEach((function(e){return o.plugins.require(e,i)})),this.client.registerBeforeSendEventHook((function(e,t){return n(n({},t),o.params)})),this.client.addEventTypeMapping(r.view,{newEventType:r.view,addClientIdParameter:!0})},e.prototype.isAnalyticsClient=function(e){return"object"==typeof e&&void 0!==e.sendEvent},e.prototype.getPluginKeys=function(e){return"string"==typeof e?rt.DefaultPlugins:Array.isArray(null==e?void 0:e.plugins)?e.plugins:rt.DefaultPlugins},e.prototype.getEndpoint=function(e){return"string"==typeof e?e||Ne.default:(null==e?void 0:e.endpoint)?e.endpoint:Ne.default},e.prototype.initForProxy=function(e){if(!e)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof e)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new ze({endpoint:e})},e.prototype.set=function(e,t){var r=this;"string"==typeof e?this.params[e]=t:Object.keys(e).map((function(t){r.params[t]=e[t]}))},e.prototype.send=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!n)throw new Error('You must provide an event type when calling "send".');return(e=this.client).sendEvent.apply(e,a([n.toLowerCase()],o))},e.prototype.onLoad=function(e){if(void 0===e)throw new Error("You must pass a function when you call 'onLoad'");e()},e.prototype.provide=function(e,t){this.plugins.provide(e,t)},e.prototype.require=function(e,t){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(e,n(n({},t),{client:this.client}))},e.prototype.callPlugin=function(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return(r=this.plugins).execute.apply(r,a([e,t],n))},e.prototype.reset=function(){this.client=void 0,this.plugins=new rt,this.params={}},e.prototype.version=function(){return _},e}(),ot=new nt,it=function(){return ot.client},st=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e);n[1];var o=n[2],i=n[3],s=ot[i];if(o&&i)return ot.callPlugin.apply(ot,a([o,i],t));if(s)return s.apply(ot,t);var c=["init","set","send","onLoad","callPlugin","reset","require","provide","version"];throw new Error('The action "'+e+'" does not exist. Available actions: '+c.join(", ")+".")},at=Object.freeze({__proto__:null,CoveoUA:nt,coveoua:ot,getCurrentClient:it,handleOneAnalyticsEvent:st,default:st});!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView"}(Be||(Be={})),function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseAttach="caseAttach",e.caseDetach="caseDetach"}(Ye||(Ye={}));var ct=((je={})[Ye.triggerNotify]="queryPipelineTriggers",je[Ye.triggerExecute]="queryPipelineTriggers",je[Ye.triggerQuery]="queryPipelineTriggers",je[Ye.triggerRedirect]="queryPipelineTriggers",je[Ye.queryError]="errors",je[Ye.queryErrorBack]="errors",je[Ye.queryErrorClear]="errors",je[Ye.queryErrorRetry]="errors",je[Ye.pagerNext]="getMoreResults",je[Ye.pagerPrevious]="getMoreResults",je[Ye.pagerNumber]="getMoreResults",je[Ye.pagerResize]="getMoreResults",je[Ye.pagerScrolling]="getMoreResults",je[Ye.facetSearch]="facet",je[Ye.facetShowLess]="facet",je[Ye.facetShowMore]="facet",je[Ye.recommendation]="recommendation",je[Ye.likeSmartSnippet]="smartSnippet",je[Ye.dislikeSmartSnippet]="smartSnippet",je[Ye.expandSmartSnippet]="smartSnippet",je[Ye.collapseSmartSnippet]="smartSnippet",je[Ye.openSmartSnippetFeedbackModal]="smartSnippet",je[Ye.closeSmartSnippetFeedbackModal]="smartSnippet",je[Ye.sendSmartSnippetReason]="smartSnippet",je[Ye.expandSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.clearRecentQueries]="recentQueries",je[Ye.recentResultClick]="recentlyClickedDocuments",je[Ye.clearRecentResults]="recentlyClickedDocuments",je[Ye.showLessFoldedResults]="folding",je[Be.expandToFullUI]="interface",je[Be.openUserActions]="User Actions",je[Be.showPrecedingSessions]="User Actions",je[Be.showFollowingSessions]="User Actions",je[Be.clickViewedDocument]="User Actions",je[Be.clickPageView]="User Actions",je[Ye.caseDetach]="case",je),ut=function(){function e(){this.runtime=new Ve,this.currentVisitorId=""}return e.prototype.getPayload=function(){return Promise.resolve()},e.prototype.getParameters=function(){return Promise.resolve()},e.prototype.makeEvent=function(e){return Promise.resolve({eventType:e,payload:null,log:function(){return Promise.resolve()}})},e.prototype.sendEvent=function(){return Promise.resolve()},e.prototype.makeSearchEvent=function(){return this.makeEvent(r.search)},e.prototype.sendSearchEvent=function(){return Promise.resolve()},e.prototype.makeClickEvent=function(){return this.makeEvent(r.click)},e.prototype.sendClickEvent=function(){return Promise.resolve()},e.prototype.makeCustomEvent=function(){return this.makeEvent(r.custom)},e.prototype.sendCustomEvent=function(){return Promise.resolve()},e.prototype.makeViewEvent=function(){return this.makeEvent(r.view)},e.prototype.sendViewEvent=function(){return Promise.resolve()},e.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},e.prototype.getHealth=function(){return Promise.resolve({status:""})},e.prototype.registerBeforeSendEventHook=function(){},e.prototype.registerAfterSendEventHook=function(){},e.prototype.addEventTypeMapping=function(){},Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e}();function lt(e){var t=e.join(";");return t.length<=256?t:lt(e.slice(1))}var pt=function(e){var t=function(e){return e.map((function(e){return e.replace(/;/g,"")}))}(e),r=function(e){var t="";return e.filter((function(e){var r=e!==t;return t=e,r}))}(t);return lt(r)};function ht(e){var t="string"==typeof e.partialQueries?e.partialQueries:pt(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:pt(e.suggestions);return n(n({},e),{partialQueries:t,suggestions:r})}var dt,ft,vt,gt=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(Ye.recommendationInterfaceLoad)},e.prototype.logRecommendationInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendationInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendation=function(){return this.makeCustomEvent(Ye.recommendation)},e.prototype.logRecommendation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendation()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationOpen=function(e,t){return this.makeClickEvent(Ye.recommendationOpen,e,t)},e.prototype.logRecommendationOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecommendationOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(Ye.staticFilterClearAll,e)},e.prototype.logStaticFilterClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterSelect=function(e){return this.makeSearchEvent(Ye.staticFilterSelect,e)},e.prototype.logStaticFilterSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterDeselect=function(e){return this.makeSearchEvent(Ye.staticFilterDeselect,e)},e.prototype.logStaticFilterDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logFetchMoreResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFetchMoreResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeInterfaceChange=function(e){return this.makeSearchEvent(Ye.interfaceChange,e)},e.prototype.logInterfaceChange=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeInterfaceChange(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanAutomatic=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanAutomatic()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(Ye.didyoumeanClick)},e.prototype.logDidYouMeanClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeResultsSort=function(e){return this.makeSearchEvent(Ye.resultsSort,e)},e.prototype.logResultsSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeResultsSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(Ye.searchboxSubmit)},e.prototype.logSearchboxSubmit=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxSubmit()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(Ye.searchboxClear)},e.prototype.logSearchboxClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(Ye.searchboxAsYouType)},e.prototype.logSearchboxAsYouType=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxAsYouType()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbFacet=function(e){return this.makeSearchEvent(Ye.breadcrumbFacet,e)},e.prototype.logBreadcrumbFacet=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeBreadcrumbFacet(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logBreadcrumbResetAll=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeBreadcrumbResetAll()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentQuickview=function(e,t){return this.makeClickEvent(Ye.documentQuickview,e,t)},e.prototype.logDocumentQuickview=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentQuickview(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(Ye.documentOpen,e,t)},e.prototype.logDocumentOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(Ye.omniboxAnalytics,ht(e))},e.prototype.logOmniboxAnalytics=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxAnalytics(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxFromLink=function(e){return this.makeSearchEvent(Ye.omniboxFromLink,ht(e))},e.prototype.logOmniboxFromLink=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxFromLink(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(Ye.searchFromLink)},e.prototype.logSearchFromLink=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchFromLink()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerNotify=function(e){return this.makeCustomEvent(Ye.triggerNotify,e)},e.prototype.logTriggerNotify=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerNotify(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerExecute=function(e){return this.makeCustomEvent(Ye.triggerExecute,e)},e.prototype.logTriggerExecute=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerExecute(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(Ye.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},e.prototype.logTriggerQuery=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerQuery()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeUndoTriggerQuery=function(e){return this.makeSearchEvent(Ye.undoTriggerQuery,e)},e.prototype.logUndoTriggerQuery=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeUndoTriggerQuery(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerRedirect=function(e){return this.makeCustomEvent(Ye.triggerRedirect,n(n({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))},e.prototype.logTriggerRedirect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerRedirect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerResize=function(e){return this.makeCustomEvent(Ye.pagerResize,e)},e.prototype.logPagerResize=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerResize(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNumber=function(e){return this.makeCustomEvent(Ye.pagerNumber,e)},e.prototype.logPagerNumber=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNumber(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNext=function(e){return this.makeCustomEvent(Ye.pagerNext,e)},e.prototype.logPagerNext=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNext(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerPrevious=function(e){return this.makeCustomEvent(Ye.pagerPrevious,e)},e.prototype.logPagerPrevious=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerPrevious(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerScrolling=function(){return this.makeCustomEvent(Ye.pagerScrolling)},e.prototype.logPagerScrolling=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerScrolling()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetClearAll=function(e){return this.makeSearchEvent(Ye.facetClearAll,e)},e.prototype.logFacetClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSearch=function(e){return this.makeSearchEvent(Ye.facetSearch,e)},e.prototype.logFacetSearch=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSearch(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelect=function(e){return this.makeSearchEvent(Ye.facetSelect,e)},e.prototype.logFacetSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetDeselect=function(e){return this.makeSearchEvent(Ye.facetDeselect,e)},e.prototype.logFacetDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetExclude=function(e){return this.makeSearchEvent(Ye.facetExclude,e)},e.prototype.logFacetExclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetExclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUnexclude=function(e){return this.makeSearchEvent(Ye.facetUnexclude,e)},e.prototype.logFacetUnexclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUnexclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelectAll=function(e){return this.makeSearchEvent(Ye.facetSelectAll,e)},e.prototype.logFacetSelectAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelectAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUpdateSort=function(e){return this.makeSearchEvent(Ye.facetUpdateSort,e)},e.prototype.logFacetUpdateSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUpdateSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowMore=function(e){return this.makeCustomEvent(Ye.facetShowMore,e)},e.prototype.logFacetShowMore=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowMore(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowLess=function(e){return this.makeCustomEvent(Ye.facetShowLess,e)},e.prototype.logFacetShowLess=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowLess(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryError=function(e){return this.makeCustomEvent(Ye.queryError,e)},e.prototype.logQueryError=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryError(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorBack=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorBack)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorBack)]}}))}))}}]}}))}))},e.prototype.logQueryErrorBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorRetry)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorRetry)]}}))}))}}]}}))}))},e.prototype.logQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorRetry()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorClear=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorClear)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorClear)]}}))}))}}]}}))}))},e.prototype.logQueryErrorClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(Ye.likeSmartSnippet)},e.prototype.logLikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeLikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(Ye.dislikeSmartSnippet)},e.prototype.logDislikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDislikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(Ye.expandSmartSnippet)},e.prototype.logExpandSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeExpandSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(Ye.collapseSmartSnippet)},e.prototype.logCollapseSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCollapseSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.openSmartSnippetFeedbackModal)},e.prototype.logOpenSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOpenSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.closeSmartSnippetFeedbackModal)},e.prototype.logCloseSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCloseSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSmartSnippetFeedbackReason=function(e,t){return this.makeCustomEvent(Ye.sendSmartSnippetReason,{reason:e,details:t})},e.prototype.logSmartSnippetFeedbackReason=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logExpandSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeExpandSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logCollapseSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCollapseSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showMoreSmartSnippetSuggestion,e)},e.prototype.logShowMoreSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowMoreSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showLessSmartSnippetSuggestion,e)},e.prototype.logShowLessSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowLessSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSource,e,t)},e.prototype.logOpenSmartSnippetSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.makeCopyToClipboard=function(e,t){return this.makeClickEvent(Ye.copyToClipboard,e,t)},e.prototype.logCopyToClipboard=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCopyToClipboard(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)},e.prototype.logOpenSmartSnippetInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(Ye.recentQueryClick)},e.prototype.logRecentQueryClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecentQueryClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(Ye.clearRecentQueries)},e.prototype.logClearRecentQueries=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentQueries()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentResultClick=function(e,t){return this.makeCustomEvent(Ye.recentResultClick,{info:e,identifier:t})},e.prototype.logRecentResultClick=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecentResultClick(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(Ye.clearRecentResults)},e.prototype.logClearRecentResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(Ye.noResultsBack)},e.prototype.logNoResultsBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeNoResultsBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreFoldedResults=function(e,t){return this.makeClickEvent(Ye.showMoreFoldedResults,e,t)},e.prototype.logShowMoreFoldedResults=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeShowMoreFoldedResults(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(Ye.showLessFoldedResults)},e.prototype.logShowLessFoldedResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowLessFoldedResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeEventDescription=function(e,t){var r;return{actionCause:t,customData:null===(r=e.payload)||void 0===r?void 0:r.customData}},e.prototype.makeCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=n(n({},this.provider.getBaseMetadata()),t),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:r,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return o=n(n({},this.provider.getBaseMetadata()),r),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:t,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEventWithType(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSearchEvent(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(e,t)];case 1:return r=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(r)];case 2:return n=o.sent(),[2,{description:this.makeEventDescription(n,e),log:function(e){var t=e.searchUID;return n.log({searchQueryUid:t})}}]}}))}))},e.prototype.makeClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a,c;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:e}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({searchQueryUid:t})}}]}}))}))},e.prototype.logClickEvent=function(e,t,r,n){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(e,t,r,n)];case 1:return[2,o.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n(n({},this.getOrigins()),this.getSplitTestRun())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e.prototype.getSplitTestRun=function(){var e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return n(n({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})},e}();!function(e){e.click="click",e.flowStart="flowStart"}(dt||(dt={})),function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.suggestionClick="suggestion_click",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"}(ft||(ft={})),function(e){e.quit="Quit",e.solved="Solved"}(vt||(vt={}));var mt=function(){function e(e,t){var r;this.options=e,this.provider=t;var n=(null===(r=e.enableAnalytics)||void 0===r||r)&&!_e();this.coveoAnalyticsClient=n?new ze(e):new ut,this.svc=new et({client:this.coveoAnalyticsClient})}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut,this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.options),this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.logEnterInterface=function(e){return this.svc.setAction(ft.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},e.prototype.logUpdateCaseField=function(e){return this.svc.setAction(ft.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(ft.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionRate,n({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(ft.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCancelled=function(e){return this.svc.setAction(ft.caseCancelled,{reason:vt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseSolved=function(e){return this.svc.setAction(ft.caseSolved,{reason:vt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCreated=function(e){return this.svc.setAction(ft.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e}(),yt=function(e,t){void 0===t&&(t=!0),e.caseContext;var r=e.caseId,i=e.caseNumber,s=o(e,["caseContext","caseId","caseNumber"]),a=function(e){var t={};return e.caseContext&&Object.keys(e.caseContext).forEach((function(r){var n,o=null===(n=e.caseContext)||void 0===n?void 0:n[r];o&&(t["context_"+r]=o)})),t}(e);return n(n(n({CaseId:r,CaseNumber:i},s),!!a.context_Case_Subject&&{CaseSubject:a.context_Case_Subject}),t&&a)},St=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.logInterfaceLoad=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceLoad,t)}return this.logSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceChange=function(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceChange,t)},e.prototype.logStaticFilterDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.staticFilterDeselect,t)},e.prototype.logFetchMoreResults=function(e){if(e){var t=yt(e);return this.logCustomEvent(Ye.pagerScrolling,n(n({},t),{type:"getMoreResults"}))}return this.logCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logBreadcrumbFacet=function(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbFacet,t)},e.prototype.logBreadcrumbResetAll=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbResetAll,t)}return this.logSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logFacetSelect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetSelect,t)},e.prototype.logFacetDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetDeselect,t)},e.prototype.logFacetUpdateSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetUpdateSort,t)},e.prototype.logFacetClearAll=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetClearAll,t)},e.prototype.logFacetShowMore=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowMore,t)},e.prototype.logFacetShowLess=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowLess,t)},e.prototype.logQueryError=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.queryError,t)},e.prototype.logPagerNumber=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNumber,t)},e.prototype.logPagerNext=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNext,t)},e.prototype.logPagerPrevious=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerPrevious,t)},e.prototype.logDidYouMeanAutomatic=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanAutomatic,t)}return this.logSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanClick=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanClick,t)}return this.logSearchEvent(Ye.didyoumeanClick)},e.prototype.logResultsSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.resultsSort,t)},e.prototype.logSearchboxSubmit=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.searchboxSubmit,t)}return this.logSearchEvent(Ye.searchboxSubmit)},e.prototype.logContextChanged=function(e){var t=yt(e);return this.logSearchEvent(Be.contextChanged,t)},e.prototype.logExpandToFullUI=function(e){var t=yt(e);return this.logCustomEvent(Be.expandToFullUI,t)},e.prototype.logOpenUserActions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.openUserActions,t)},e.prototype.logShowPrecedingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showPrecedingSessions,t)},e.prototype.logShowFollowingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showFollowingSessions,t)},e.prototype.logViewedDocumentClick=function(e,t){return this.logCustomEvent(Be.clickViewedDocument,n(n({},yt(t,!1)),{document:e}))},e.prototype.logPageViewClick=function(e,t){return this.logCustomEvent(Be.clickPageView,n(n({},yt(t,!1)),{pageView:e}))},e.prototype.logDocumentOpen=function(e,t,r){return this.logClickEvent(Ye.documentOpen,e,t,r?yt(r,!1):void 0)},e.prototype.logCopyToClipboard=function(e,t,r){return this.logClickEvent(Ye.copyToClipboard,e,t,r?yt(r,!1):void 0)},e.prototype.logDocumentQuickview=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl};return this.logClickEvent(Ye.documentQuickview,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseAttach=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl,resultUriHash:e.documentUriHash};return this.logClickEvent(Ye.caseAttach,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseDetach=function(e,t){return this.logCustomEvent(Ye.caseDetach,t?n(n({},yt(t,!1)),{resultUriHash:e}):{resultUriHash:e})},e.prototype.logCustomEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(s){switch(s.label){case 0:return r=n(n({},this.provider.getBaseMetadata()),t),i=[{}],[4,this.getBaseCustomEventRequest(r)];case 1:return o=n.apply(void 0,[n.apply(void 0,i.concat([s.sent()])),{eventType:ct[e],eventValue:e}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return n=(r=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(e,t)];case 1:return[2,n.apply(r,[o.sent()])]}}))}))},e.prototype.logClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}]),[2,this.coveoAnalyticsClient.sendClickEvent(i)]}}))}))},e.prototype.getBaseCustomEventRequest=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,t.concat([r.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n({},this.getOrigins())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e}(),kt=Object.freeze({__proto__:null,analytics:Ke,donottrack:qe,history:b,SimpleAnalytics:at,storage:k,CoveoAnalyticsClient:ze,CoveoUA:nt,getCurrentClient:it,handleOneAnalyticsEvent:st,CoveoSearchPageClient:gt,CaseAssistClient:mt,CoveoInsightClient:St});window.Promise instanceof Function||global||console.error('This script uses window.Promise which is not supported in your browser. Consider adding a polyfill like "es6-promise".'),window.fetch instanceof Function||global||console.error('This script uses window.fetch which is not supported in your browser. Consider adding a polyfill like "fetch".');var wt=self.coveoua||st;(self.coveoua=st,self.coveoanalytics=kt,wt.q)&&a(wt.q.filter((function(e){return"init"===e[0]})),wt.q.filter((function(e){return"init"!==e[0]}))).forEach((function(e){return st.apply(void 0,e)}));return self.coveoua}();
2
2
  //# sourceMappingURL=coveoua.browser.js.map
@@ -724,7 +724,7 @@
724
724
  const v5 = v35('v5', 0x50, sha1);
725
725
  var uuidv5 = v5;
726
726
 
727
- var libVersion = "2.26.3" ;
727
+ var libVersion = "2.26.4" ;
728
728
 
729
729
  var getFormattedLocation = function (location) {
730
730
  return location.protocol + "//" + location.hostname + (location.pathname.indexOf('/') === 0 ? location.pathname : "/" + location.pathname) + location.search;
package/dist/coveoua.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).coveoua=t()}(this,(function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function a(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function c(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}function p(){return c()&&navigator.cookieEnabled}!function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"}(r||(r={}));var h=[r.click,r.custom,r.search,r.view],d=function(e,t){return-1!==h.indexOf(e)?n({language:u()?document.documentElement.lang:"unknown",userAgent:c()?navigator.userAgent:"unknown"},t):t},f=function(){function e(){}return e.set=function(e,t,r){var n,o,i;r&&(n=new Date).setTime(n.getTime()+r),-1===(i=window.location.hostname).indexOf(".")?v(e,t,n):v(e,t,n,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},e.get=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n];if(0===(o=o.replace(/^\s+/,"")).lastIndexOf(t,0))return o.substring(t.length,o.length)}return null},e.erase=function(t){e.set(t,"",-1)},e}();function v(e,t,r,n){document.cookie=e+"="+t+(r?";expires="+r.toUTCString():"")+(n?";domain="+n:"")+";SameSite=Lax"}function g(){return l()?localStorage:p()?new m:function(){try{return"undefined"!=typeof sessionStorage}catch(e){return!1}}()?sessionStorage:new S}var m=function(){function e(){}return e.prototype.getItem=function(t){return f.get(""+e.prefix+t)},e.prototype.removeItem=function(t){f.erase(""+e.prefix+t)},e.prototype.setItem=function(t,r,n){f.set(""+e.prefix+t,r,n)},e.prefix="coveo_",e}(),y=function(){function e(){this.cookieStorage=new m}return e.prototype.getItem=function(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)},e.prototype.removeItem=function(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)},e.prototype.setItem=function(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)},e}(),S=function(){function e(){}return e.prototype.getItem=function(e){return null},e.prototype.removeItem=function(e){},e.prototype.setItem=function(e,t){},e}(),k=Object.freeze({__proto__:null,preferredStorage:null,getAvailableStorage:g,CookieStorage:m,CookieAndLocalStorage:y,NullStorage:S}),w="__coveo.analytics.history",I=function(){function e(e){this.store=e||g()}return e.prototype.addElement=function(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));var t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])},e.prototype.addElementAsync=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=r.sent())?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e]),[2]}}))}))},e.prototype.getHistory=function(){var e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))},e.prototype.getHistoryAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return e=t.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(e))]}}))}))},e.prototype.getHistoryWithInternalTime=function(){try{var e=this.store.getItem(w);return e&&"string"==typeof e?JSON.parse(e):[]}catch(e){return[]}},e.prototype.getHistoryWithInternalTimeAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.store.getItem(w)];case 1:return(e=t.sent())?[2,JSON.parse(e)]:[2,[]];case 2:return t.sent(),[2,[]];case 3:return[2]}}))}))},e.prototype.setHistory=function(e){try{this.store.setItem(w,JSON.stringify(e.slice(0,20)))}catch(e){}},e.prototype.clear=function(){try{this.store.removeItem(w)}catch(e){}},e.prototype.getMostRecentElement=function(){var e=this.getHistoryWithInternalTime();return null!=e?e.sort((function(e,t){return(t.internalTime||0)-(e.internalTime||0)}))[0]:null},e.prototype.cropQueryElement=function(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e},e.prototype.isValidEntry=function(e){var t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4},e.prototype.stripInternalTime=function(e){return e.map((function(e){return{name:e.name,time:e.time,value:e.value}}))},e.prototype.stripEmptyQuery=function(e){var t=e.name,r=e.time,n=e.value;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e},e.prototype.stripEmptyQueries=function(e){var t=this;return e.map((function(e){return t.stripEmptyQuery(e)}))},e}(),b=Object.freeze({__proto__:null,STORE_KEY:w,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,MAX_VALUE_SIZE:75,HistoryStore:I,default:I}),E=function(e,t){return i(void 0,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return e!==r.view?[3,2]:[4,C(t.contentIdValue)];case 1:return o.sent(),[2,n({location:window.location.toString(),referrer:document.referrer,title:document.title},t)];case 2:return[2,t]}}))}))},C=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=new I,r={name:"PageView",value:e,time:JSON.stringify(new Date)},[4,t.addElementAsync(r)];case 1:return n.sent(),[2]}}))}))};let D;const U=new Uint8Array(16);function R(){if(!D&&(D="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!D))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return D(U)}var A=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(e){return"string"==typeof e&&A.test(e)}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));function x(e,t=0){return(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase()}var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(e,t,r){if(T.randomUUID&&!t&&!e)return T.randomUUID();const n=(e=e||{}).random||(e.rng||R)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return x(n)}function O(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function V(e,t){return e<<t|e>>>32-t}var M=function(e,t,r){function n(e,n,o,i){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=function(e){if(!P(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}(n)),16!==(null===(s=n)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),a=r(a),a[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=a[e];return o}return x(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let t=0;t<o;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];i[t]=r}i[o-1][14]=8*(e.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<o;++e){const n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=i[e][t];for(let e=16;e<80;++e)n[e]=V(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let o=r[0],s=r[1],a=r[2],c=r[3],u=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),i=V(o,5)+O(r,s,a,c)+u+t[r]+n[e]>>>0;u=c,c=a,a=V(s,30)>>>0,s=o,o=i}r[0]=r[0]+o>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),_="2.26.3",q=function(e){return e.protocol+"//"+e.hostname+(0===e.pathname.indexOf("/")?e.pathname:"/"+e.pathname)+e.search},Q={pageview:"pageview",event:"event"},N=function(e){var t=e.client,r=e.uuidGenerator,n=void 0===r?L:r;this.client=t,this.uuidGenerator=n},H=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=q(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return t(r,e),r.prototype.getApi=function(e){return"setAction"===e?this.setAction:null},r.prototype.setAction=function(e,t){this.action=e,this.actionData=t},r.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},r.prototype.getLocationInformation=function(e,t){return n({hitType:e},this.getNextValues(e,t))},r.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},r.prototype.getDefaultContextInformation=function(e){var t={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},r={screenResolution:screen.width+"x"+screen.height,screenColor:screen.colorDepth+"-bit"},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return n(n(n(n({},i),r),o),t)},r.prototype.updateLocationForNextPageView=function(e,t){var r=this.getNextValues(e,t),n=r.pageViewId,o=r.referrer,i=r.location;this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,e===Q.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},r.prototype.getNextValues=function(e,t){return{pageViewId:e===Q.pageview?this.nextPageViewId:this.pageViewId,referrer:e===Q.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===Q.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},r.prototype.getCurrentLocationFromPayload=function(e){if(e.page){return""+this.currentLocation.split("/").slice(0,3).join("/")+e.page.replace(/^\/?(.*)$/,"/$1")}return q(window.location)},r}(N),B=function(){function e(e,t){if(!P(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/1e3)}return e.prototype.toString=function(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()},Object.defineProperty(e.prototype,"expired",{get:function(){var t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime},enumerable:!1,configurable:!0}),e.prototype.validate=function(e,t){return!this.expired&&this.matchReferrer(e,t)},e.prototype.matchReferrer=function(e,t){try{var r=new URL(e);return t.some((function(e){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host)}))}catch(e){return!1}},e.fromString=function(t){var r=t.split(".");if(2!==r.length)return null;var n=r[0],o=r[1];if(32!==n.length||isNaN(parseInt(o)))return null;var i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return P(i)?new e(i,1e3*Number.parseInt(o)):null},e.cvo_cid="cvo_cid",e.expirationTime=120,e}(),j=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n;return e.call(this,{client:r,uuidGenerator:o})||this}return t(r,e),r.prototype.getApi=function(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},r.prototype.decorate=function(e){return i(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");n.label=1;case 1:return n.trys.push([1,3,,4]),t=new URL(e),[4,this.client.getCurrentVisitorId()];case 2:return r=n.sent(),t.searchParams.set(B.cvo_cid,new B(r,Date.now()).toString()),[2,t.toString()];case 3:throw n.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},r.prototype.acceptFrom=function(e){this.client.setAcceptedLinkReferrers(e)},r.Id="link",r}(N),Y=j,z=Object.keys;function K(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var W={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},G=a(z(W).map((function(e){return W[e]}))).join("|"),$=new RegExp("^("+G+"$)"),J=[function(e){return $.test(e)}],X={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ee={action:"pa",list:"pal",listSource:"pls"},te={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},re={id:"quoteId",affiliation:"quoteAffiliation"},ne={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},oe={add:ee,bookmark_add:ee,bookmark_remove:ee,click:ee,checkout:ee,checkout_option:ee,detail:ee,impression:ee,remove:ee,refund:n(n({},ee),te),purchase:n(n({},ee),te),quickview:ee,quote:n(n({},ee),re),review:n(n({},ee),ne)},ie=function(e,t,r,o){return z(e).reduce((function(i,s){var a,c="il"+(t+1)+o+(r+1)+(Z[s]||s);return n(n({},i),((a={})[c]=e[s],a))}),{})},se=z(X).map((function(e){return X[e]})),ae=z(Z).map((function(e){return Z[e]})),ce=z(ee).map((function(e){return ee[e]})),ue=z(te).map((function(e){return te[e]})),le=z(ne).map((function(e){return ne[e]})),pe=z(re).map((function(e){return re[e]})),he=a(se,["custom"]).join("|"),de=a(ae,["custom"]).join("|"),fe=new RegExp("^(pr[0-9]+)("+he+")$"),ve=new RegExp("^((il[0-9]+pi[0-9]+)("+de+"))|(il[0-9]+nm)$"),ge=new RegExp("^("+ce.join("|")+")$"),me=new RegExp("^("+ue.join("|")+")$"),ye=new RegExp("^(pr[0-9]+)custom$"),Se=new RegExp("^(il[0-9]+pi[0-9]+)custom$"),ke=new RegExp("^("+a(["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],le,pe).join("|")+")$"),we=[function(e){return ve.test(e)},function(e){return fe.test(e)},function(e){return ge.test(e)},function(e){return me.test(e)},function(e){return ke.test(e)}],Ie=[ye,Se],be=n(n(n(n({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale"].reduce((function(e,t){var r;return n(n({},e),((r={})[t]=t,r))}),{})),Ee=n(n({},be),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Ce=z(Ee).map((function(e){return Ee[e]})),De=function(e){return-1!==Ce.indexOf(e)},Ue=function(e){return"custom"===e},Re=function(e){var t=void 0;return a(Ie).every((function(r){var n;return t=null===(n=r.exec(e))||void 0===n?void 0:n[1],!Boolean(t)})),t},Ae=function(e,t){return z(t).reduce((function(r,o){var i;return n(n({},r),((i={})[""+e+o]=t[o],i))}),{})},Pe=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i,a,c,u,l,p,h,d,f;return s(this,(function(s){switch(s.label){case 0:if(!navigator.sendBeacon)throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');return r=this.opts,o=r.baseUrl,i=r.preprocessRequest,a=this.encodeForEventType(e,t),[4,this.getQueryParamsForEventType(e)];case 1:return c=s.sent(),u={url:o+"/analytics/"+e+"?"+c,body:new Blob([a],{type:"application/x-www-form-urlencoded"})},d=[n({},u)],i?[4,i(u,"analyticsBeacon")]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f={},s.label=4;case 4:return l=n.apply(void 0,d.concat([f])),p=l.url,h=l.body,console.log('Sending beacon for "'+e+'" with: ',JSON.stringify(t)),navigator.sendBeacon(p,h),[2]}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},e.prototype.encodeForEventType=function(e,t){return this.isEventTypeLegacy(e)?this.encodeForLegacyType(e,t):this.encodeForFormUrlEncoded(n({access_token:this.opts.token},t))},e.prototype.getQueryParamsForEventType=function(e){return i(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(o){switch(o.label){case 0:return t=this.opts,r=t.token,[4,t.visitorIdProvider.getCurrentVisitorId()];case 1:return n=o.sent(),[2,[r&&this.isEventTypeLegacy(e)?"access_token="+r:"",n?"visitorId="+n:"","discardVisitInfo=true"].filter((function(e){return!!e})).join("&")]}}))}))},e.prototype.isEventTypeLegacy=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.encodeForLegacyType=function(e,t){return e+"Event="+encodeURIComponent(JSON.stringify(t))},e.prototype.encodeForFormUrlEncoded=function(e){var t=this;return Object.keys(e).filter((function(t){return!!e[t]})).map((function(r){return encodeURIComponent(r)+"="+encodeURIComponent(t.encodeValue(e[r]))})).join("&")},e.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},e}(),Fe=function(){function e(){}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e}(),xe=window.fetch,Te=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,i,a,c,u,l,p,h,d,f,v,g,m;return s(this,(function(s){switch(s.label){case 0:return r=this.opts,i=r.baseUrl,a=r.visitorIdProvider,c=r.preprocessRequest,this.shouldAppendVisitorId(e)?[4,this.getVisitorIdParam()]:[3,2];case 1:return u=s.sent(),[3,3];case 2:u="",s.label=3;case 3:return l={url:i+"/analytics/"+e+u,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},f=[n({},l)],c?[4,c(l,"analyticsFetch")]:[3,5];case 4:return v=s.sent(),[3,6];case 5:v={},s.label=6;case 6:return p=n.apply(void 0,f.concat([v])),h=p.url,d=o(p,["url"]),[4,xe(h,d)];case 7:return(g=s.sent()).ok?[4,g.json()]:[3,9];case 8:return(m=s.sent()).visitorId&&a.setCurrentVisitorId(m.visitorId),[2,m];case 9:try{g.json()}catch(e){}throw console.error('An error has occured when sending the "'+e+'" event.',g,t),new Error('An error has occurred when sending the "'+e+'" event. Check the console logs for more details.')}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this.opts.baseUrl,[4,xe(e+"/analytics/visit",{headers:this.getHeaders(),method:"DELETE"})];case 1:return t.sent(),[2]}}))}))},e.prototype.shouldAppendVisitorId=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.getVisitorIdParam=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(e=t.sent())?"?visitor="+e:""]}}))}))},e.prototype.getHeaders=function(){var e=this.opts.token;return n(n({},e?{Authorization:"Bearer "+e}:{}),{"Content-Type":"application/json"})},e}(),Le=function(e,t){var r=this;l()&&p()?this.storage=new y:l()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new S),this.client=new Te(e),this.beaconClient=new Pe(e),window.addEventListener("beforeunload",(function(){for(var e=0,n=t();e<n.length;e++){var o=n[e],i=o.eventType,s=o.payload;r.beaconClient.sendEvent(i,s)}}))},Oe=function(e,t){this.storage=t||new S,this.client=new Te(e)},Ve=function(){this.storage=new S,this.client=new Fe};var Me=["1",1,"yes",!0];function _e(){return c()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(e){return-1!==Me.indexOf(e)}))}var qe=Object.freeze({__proto__:null,doNotTrack:_e,default:_e}),Qe="v15",Ne={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function He(e,t){void 0===e&&(e=Ne.default),void 0===t&&(t=Qe);var r=-1!==e.indexOf(".cloud.coveo.com");return e+(r?"":"/rest")+"/"+t}var Be,je,Ye,ze=function(){function e(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=n(n({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[E,d].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};var t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),_e()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return{endpoint:Ne.default,token:"",version:Qe,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&u()?new Le(e,(function(){var e=a(t.bufferedRequests);return t.bufferedRequests=[],e})):("undefined"!=typeof navigator&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please use the \"coveo.analytics/react-native\" subpackage.\n Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native\n "),new Oe(e))},Object.defineProperty(e.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),e.prototype.determineVisitorId=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),(e=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:e=r.sent(),r.label=2;case 2:return[2,e||L()];case 3:return t=r.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),[2,L()];case 4:return[2]}}))}))},e.prototype.getCurrentVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return e=t.sent(),[4,this.setCurrentVisitorId(e)];case 2:t.sent(),t.label=3;case 3:return[2,this.visitorId]}}))}))},e.prototype.setCurrentVisitorId=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.visitorId=e,[4,this.storage.setItem("visitorId",e)];case 1:return t.sent(),[2]}}))}))},e.prototype.setClientId=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){if(P(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(M(e,M(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}return[2]}))}))},e.prototype.getParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return[2,r.sent()]}}))}))},e.prototype.getPayload=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return r=n.sent(),[4,this.resolvePayloadForParameters(e,r)];case 2:return[2,n.sent()]}}))}))},Object.defineProperty(e.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(L()),this.visitorId},set:function(e){this.visitorId=e,this.storage.setItem("visitorId",e)},enumerable:!1,configurable:!0}),e.prototype.extractClientIdFromLink=function(e){if(_e())return null;try{var t=new URL(e).searchParams.get(B.cvo_cid);if(null==t)return null;var r=B.fromString(t);return r&&u()&&r.validate(document.referrer,this.acceptedLinkReferrers)?r.clientId:null}catch(e){}return null},e.prototype.resolveParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,a,c,u,l,p,h,d,f,v,g,m=this;return s(this,(function(y){switch(y.label){case 0:return r=this.eventTypeMapping[e]||{},o=r.variableLengthArgumentsNames,a=void 0===o?[]:o,c=r.addVisitorIdParameter,u=void 0!==c&&c,l=r.usesMeasurementProtocol,p=void 0!==l&&l,h=r.addClientIdParameter,d=void 0!==h&&h,f=function(e){return i(m,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=[n({},e)],r={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return o=i.sent(),[3,3];case 2:o="",i.label=3;case 3:return[2,n.apply(void 0,t.concat([(r.visitorId=o,r)]))]}}))}))},v=function(e){return i(m,void 0,void 0,(function(){var t,r;return s(this,(function(o){switch(o.label){case 0:return d?(t=[n({},e)],r={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,n.apply(void 0,t.concat([(r.clientId=o.sent(),r)]))];case 2:return[2,e]}}))}))},g=function(t){return m.beforeSendHooks.reduce((function(t,r){return i(m,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return n=o.sent(),[4,r(e,n)];case 2:return[2,o.sent()]}}))}))}),t)},[4,[function(e){return a.length>0?m.parseVariableArgumentsPayload(a,e):e[0]},f,v,function(e){return p?m.ensureAnonymousUserWhenUsingApiKey(e):e},g].reduce((function(e,t){return i(m,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,y.sent()]}}))}))},e.prototype.resolvePayloadForParameters=function(e,t){return i(this,void 0,void 0,(function(){var r,o,a,c=this;return s(this,(function(u){switch(u.label){case 0:return r=(this.eventTypeMapping[e]||{}).usesMeasurementProtocol,o=void 0!==r&&r,a=function(e){return o?(r=!!(t=e).action&&oe[t.action]||{},z(t).reduce((function(e,o){var i,s=r[o]||Ee[o]||o;return n(n({},e),((i={})[s]=t[o],i))}),{})):e;var t,r},[4,[function(t){return c.removeEmptyPayloadValues(t,e)},function(e){return c.validateParams(e)},a,function(e){return o?c.removeUnknownParameters(e):e},function(e){return o?c.processCustomParameters(e):c.mapCustomParametersToCustomData(e)}].reduce((function(e,t){return i(c,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,u.sent()]}}))}))},e.prototype.makeEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,c,u,l=this;return s(this,(function(p){switch(p.label){case 0:return r=(this.eventTypeMapping[e]||{}).newEventType,o=void 0===r?e:r,[4,this.resolveParameters.apply(this,a([e],t))];case 1:return c=p.sent(),[4,this.resolvePayloadForParameters(e,c)];case 2:return u=p.sent(),[2,{eventType:o,payload:u,log:function(t){return i(l,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.bufferedRequests.push({eventType:o,payload:n(n({},u),t)}),[4,Promise.all(this.afterSendHooks.map((function(r){return r(e,n(n({},c),t))})))];case 1:return r.sent(),[4,this.deferExecution()];case 2:return r.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,r.sent()]}}))}))}}]}}))}))},e.prototype.sendEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeEvent.apply(this,a([e],t))];case 1:return[2,r.sent().log({})]}}))}))},e.prototype.deferExecution=function(){return new Promise((function(e){return setTimeout(e,0)}))},e.prototype.sendFromBufferWithFetch=function(){return i(this,void 0,void 0,(function(){var e,t,r;return s(this,(function(n){return(e=this.bufferedRequests.shift())?(t=e.eventType,r=e.payload,[2,this.runtime.client.sendEvent(t,r)]):[2]}))}))},e.prototype.clear=function(){this.storage.removeItem("visitorId"),(new I).clear()},e.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},e.prototype.makeSearchEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.search,e)]}))}))},e.prototype.sendSearchEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeClickEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.click,e)]}))}))},e.prototype.sendClickEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClickEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeCustomEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.custom,e)]}))}))},e.prototype.sendCustomEvent=function(e){var t=e.lastSearchQueryUid,r=o(e,["lastSearchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCustomEvent(r)];case 1:return[2,e.sent().log({lastSearchQueryUid:t})]}}))}))},e.prototype.makeViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.view,e)]}))}))},e.prototype.sendViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeViewEvent(e)];case 1:return[2,t.sent().log({})]}}))}))},e.prototype.getVisit=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,fetch(this.baseUrl+"/analytics/visit")];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),this.visitorId=e.visitorId,[2,e]}}))}))},e.prototype.getHealth=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/monitoring/health")];case 1:return[4,e.sent().json()];case 2:return[2,e.sent()]}}))}))},e.prototype.registerBeforeSendEventHook=function(e){this.beforeSendHooks.push(e)},e.prototype.registerAfterSendEventHook=function(e){this.afterSendHooks.push(e)},e.prototype.addEventTypeMapping=function(e,t){this.eventTypeMapping[e]=t},e.prototype.setAcceptedLinkReferrers=function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e})))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=e},e.prototype.parseVariableArgumentsPayload=function(e,t){for(var r={},o=0,i=t.length;o<i;o++){var s=t[o];if("string"==typeof s)r[e[o]]=s;else if("object"==typeof s)return n(n({},r),s)}return r},e.prototype.isKeyAllowedEmpty=function(e,t){var n;return-1!==(((n={})[r.search]=["queryText"],n)[e]||[]).indexOf(t)},e.prototype.removeEmptyPayloadValues=function(e,t){var r=this;return Object.keys(e).filter((function(n){return r.isKeyAllowedEmpty(t,n)||null!=(o=e[n])&&""!==o;var o})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{})},e.prototype.removeUnknownParameters=function(e){var t=Object.keys(e).filter((function(e){if(function(e){return a(we,J,[De,Ue]).some((function(t){return t(e)}))}(e))return!0;console.log(e,"is not processed by coveoua")})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{});return t},e.prototype.processCustomParameters=function(e){var t=e.custom,r=o(e,["custom"]),i={};t&&K(t)&&(i=this.lowercaseKeys(t));var s,a=z(s=r).reduce((function(e,t){var r,o=Re(t);return n(n({},e),o?Ae(o,s[t]):((r={})[t]=s[t],r))}),{});return n(n({},i),a)},e.prototype.mapCustomParametersToCustomData=function(e){var t=e.custom,r=o(e,["custom"]);if(t&&K(t)){var i=this.lowercaseKeys(t);return n(n({},r),{customData:n(n({},i),e.customData)})}return e},e.prototype.lowercaseKeys=function(e){var t=Object.keys(e),r={};return t.forEach((function(t){r[t.toLowerCase()]=e[t]})),r},e.prototype.validateParams=function(e){var t=e.anonymizeIp,r=o(e,["anonymizeIp"]);return void 0!==t&&-1==["0","false","undefined","null","{}","[]",""].indexOf((""+t).toLowerCase())&&(r.anonymizeIp=1),r},e.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,r=e.userId,n=o(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!r?(n.userId="anonymous",n):e},Object.defineProperty(e.prototype,"baseUrl",{get:function(){return He(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),e}(),Ke=Object.freeze({__proto__:null,Version:Qe,Endpoints:Ne,buildBaseUrl:He,CoveoAnalyticsClient:ze,default:ze}),We=n({},Q),Ge=Object.keys(We).map((function(e){return We[e]})),$e=function(e){function i(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return t(i,e),i.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);if(null!==r)return r;switch(t){case"addProduct":return this.addProduct;case"addImpression":return this.addImpression;default:return null}},i.prototype.addHooks=function(){this.addHooksForPageView(),this.addHooksForEvent(),this.addHooksForECEvents()},i.prototype.addProduct=function(e){this.products.push(e)},i.prototype.addImpression=function(e){this.impressions.push(e)},i.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},i.prototype.addHooksForECEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)?e.addECDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)&&e.updateLocationInformation(t,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(We.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(We.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(e,t){var r=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),n(n(n(n({},i),o),r),t)},i.prototype.getProductPayload=function(){var e=this;return this.products.map((function(t){return e.assureProductValidity(t)})).reduce((function(e,t,r){return n(n({},e),function(e,t){return z(e).reduce((function(r,o){var i,s="pr"+(t+1)+(X[o]||o);return n(n({},r),((i={})[s]=e[o],i))}),{})}(t,r))}),{})},i.prototype.getImpressionPayload=function(){var e=this;return this.getImpressionsByList().map((function(t){var r=t.impressions,i=o(t,["impressions"]);return n(n({},i),{impressions:r.map((function(t){return e.assureBaseImpressionValidity(t)}))})})).reduce((function(e,t,r){return n(n({},e),function(e,t,r){var o=e.impressions.reduce((function(e,o,i){return n(n({},e),ie(o,t,i,r))}),{});return e.listName&&(o["il"+(t+1)+"nm"]=e.listName),o}(t,r,"pi"))}),{})},i.prototype.assureProductValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.assureBaseImpressionValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(e,t){var r=t.list,n=o(t,["list"]),i=e.find((function(e){return e.listName===r}));return i?i.impressions.push(n):e.push({listName:r,impressions:[n]}),e}),[])},i.Id="ec",i}(H),Je=$e,Xe=n({},Q),Ze=Object.keys(Xe).map((function(e){return Xe[e]})),et=function(e){function o(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.ticket={},i}return t(o,e),o.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);return null!==r?r:"setTicket"===t?this.setTicket:null},o.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},o.prototype.setTicket=function(e){this.ticket=e},o.prototype.clearPluginData=function(){this.ticket={}},o.prototype.addHooksForSVCEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)?e.addSVCDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)&&e.updateLocationInformation(t,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Xe.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Xe.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(e,t){var r,o=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(r=this.actionData)&&void 0!==r?r:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),n(n(n({},i),o),t)},o.prototype.getTicketPayload=function(){return e=this.ticket,z(e).filter((function(t){return void 0!==e[t]})).reduce((function(t,r){var o,i=W[r]||r;return n(n({},t),((o={})[i]=e[r],o))}),{});var e},o.Id="svc",o}(H),tt=et,rt=function(){function e(){var e;this.registeredPluginsMap=((e={})[Je.Id]=Je,e[tt.Id]=tt,e[Y.Id]=Y,e),this.requiredPlugins={}}return e.prototype.require=function(e,t){var r=this.registeredPluginsMap[e];if(!r)throw new Error('No plugin named "'+e+"\" is currently registered. If you use a custom plugin, use 'provide' first.");this.requiredPlugins[e]=new r(t)},e.prototype.provide=function(e,t){this.registeredPluginsMap[e]=t},e.prototype.clearRequired=function(){this.requiredPlugins={}},e.prototype.execute=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'+e+'" is not required. Check that you required it on initialization.');var i=o.getApi(t);if(!i)throw new Error('The function "'+t+'" does not exist on the plugin "'+e+'".');if("function"!=typeof i)throw new Error('"'+t+'" of the plugin "'+e+'" is not a function.');return i.apply(o,r)},e.DefaultPlugins=[Je.Id,tt.Id,Y.Id],e}(),nt=function(){function e(){this.plugins=new rt,this.params={}}return e.prototype.init=function(e,t){var o=this;if(!e)throw new Error("You must pass your token when you call 'init'");if("string"==typeof e?this.client=new ze({token:e,endpoint:this.getEndpoint(t)}):this.isAnalyticsClient(e)&&(this.client=e),!this.client)throw new Error("You must pass either your token or a valid object when you call 'init'");var i={client:this.client};this.plugins.clearRequired(),this.getPluginKeys(t).forEach((function(e){return o.plugins.require(e,i)})),this.client.registerBeforeSendEventHook((function(e,t){return n(n({},t),o.params)})),this.client.addEventTypeMapping(r.view,{newEventType:r.view,addClientIdParameter:!0})},e.prototype.isAnalyticsClient=function(e){return"object"==typeof e&&void 0!==e.sendEvent},e.prototype.getPluginKeys=function(e){return"string"==typeof e?rt.DefaultPlugins:Array.isArray(null==e?void 0:e.plugins)?e.plugins:rt.DefaultPlugins},e.prototype.getEndpoint=function(e){return"string"==typeof e?e||Ne.default:(null==e?void 0:e.endpoint)?e.endpoint:Ne.default},e.prototype.initForProxy=function(e){if(!e)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof e)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new ze({endpoint:e})},e.prototype.set=function(e,t){var r=this;"string"==typeof e?this.params[e]=t:Object.keys(e).map((function(t){r.params[t]=e[t]}))},e.prototype.send=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!n)throw new Error('You must provide an event type when calling "send".');return(e=this.client).sendEvent.apply(e,a([n.toLowerCase()],o))},e.prototype.onLoad=function(e){if(void 0===e)throw new Error("You must pass a function when you call 'onLoad'");e()},e.prototype.provide=function(e,t){this.plugins.provide(e,t)},e.prototype.require=function(e,t){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(e,n(n({},t),{client:this.client}))},e.prototype.callPlugin=function(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return(r=this.plugins).execute.apply(r,a([e,t],n))},e.prototype.reset=function(){this.client=void 0,this.plugins=new rt,this.params={}},e.prototype.version=function(){return _},e}(),ot=new nt,it=function(){return ot.client},st=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e);n[1];var o=n[2],i=n[3],s=ot[i];if(o&&i)return ot.callPlugin.apply(ot,a([o,i],t));if(s)return s.apply(ot,t);var c=["init","set","send","onLoad","callPlugin","reset","require","provide","version"];throw new Error('The action "'+e+'" does not exist. Available actions: '+c.join(", ")+".")},at=Object.freeze({__proto__:null,CoveoUA:nt,coveoua:ot,getCurrentClient:it,handleOneAnalyticsEvent:st,default:st});!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView"}(Be||(Be={})),function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseAttach="caseAttach",e.caseDetach="caseDetach"}(Ye||(Ye={}));var ct=((je={})[Ye.triggerNotify]="queryPipelineTriggers",je[Ye.triggerExecute]="queryPipelineTriggers",je[Ye.triggerQuery]="queryPipelineTriggers",je[Ye.triggerRedirect]="queryPipelineTriggers",je[Ye.queryError]="errors",je[Ye.queryErrorBack]="errors",je[Ye.queryErrorClear]="errors",je[Ye.queryErrorRetry]="errors",je[Ye.pagerNext]="getMoreResults",je[Ye.pagerPrevious]="getMoreResults",je[Ye.pagerNumber]="getMoreResults",je[Ye.pagerResize]="getMoreResults",je[Ye.pagerScrolling]="getMoreResults",je[Ye.facetSearch]="facet",je[Ye.facetShowLess]="facet",je[Ye.facetShowMore]="facet",je[Ye.recommendation]="recommendation",je[Ye.likeSmartSnippet]="smartSnippet",je[Ye.dislikeSmartSnippet]="smartSnippet",je[Ye.expandSmartSnippet]="smartSnippet",je[Ye.collapseSmartSnippet]="smartSnippet",je[Ye.openSmartSnippetFeedbackModal]="smartSnippet",je[Ye.closeSmartSnippetFeedbackModal]="smartSnippet",je[Ye.sendSmartSnippetReason]="smartSnippet",je[Ye.expandSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.clearRecentQueries]="recentQueries",je[Ye.recentResultClick]="recentlyClickedDocuments",je[Ye.clearRecentResults]="recentlyClickedDocuments",je[Ye.showLessFoldedResults]="folding",je[Be.expandToFullUI]="interface",je[Be.openUserActions]="User Actions",je[Be.showPrecedingSessions]="User Actions",je[Be.showFollowingSessions]="User Actions",je[Be.clickViewedDocument]="User Actions",je[Be.clickPageView]="User Actions",je[Ye.caseDetach]="case",je),ut=function(){function e(){this.runtime=new Ve,this.currentVisitorId=""}return e.prototype.getPayload=function(){return Promise.resolve()},e.prototype.getParameters=function(){return Promise.resolve()},e.prototype.makeEvent=function(e){return Promise.resolve({eventType:e,payload:null,log:function(){return Promise.resolve()}})},e.prototype.sendEvent=function(){return Promise.resolve()},e.prototype.makeSearchEvent=function(){return this.makeEvent(r.search)},e.prototype.sendSearchEvent=function(){return Promise.resolve()},e.prototype.makeClickEvent=function(){return this.makeEvent(r.click)},e.prototype.sendClickEvent=function(){return Promise.resolve()},e.prototype.makeCustomEvent=function(){return this.makeEvent(r.custom)},e.prototype.sendCustomEvent=function(){return Promise.resolve()},e.prototype.makeViewEvent=function(){return this.makeEvent(r.view)},e.prototype.sendViewEvent=function(){return Promise.resolve()},e.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},e.prototype.getHealth=function(){return Promise.resolve({status:""})},e.prototype.registerBeforeSendEventHook=function(){},e.prototype.registerAfterSendEventHook=function(){},e.prototype.addEventTypeMapping=function(){},Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e}();function lt(e){var t=e.join(";");return t.length<=256?t:lt(e.slice(1))}var pt=function(e){var t=function(e){return e.map((function(e){return e.replace(/;/g,"")}))}(e),r=function(e){var t="";return e.filter((function(e){var r=e!==t;return t=e,r}))}(t);return lt(r)};function ht(e){var t="string"==typeof e.partialQueries?e.partialQueries:pt(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:pt(e.suggestions);return n(n({},e),{partialQueries:t,suggestions:r})}var dt,ft,vt,gt=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(Ye.recommendationInterfaceLoad)},e.prototype.logRecommendationInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendationInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendation=function(){return this.makeCustomEvent(Ye.recommendation)},e.prototype.logRecommendation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendation()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationOpen=function(e,t){return this.makeClickEvent(Ye.recommendationOpen,e,t)},e.prototype.logRecommendationOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecommendationOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(Ye.staticFilterClearAll,e)},e.prototype.logStaticFilterClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterSelect=function(e){return this.makeSearchEvent(Ye.staticFilterSelect,e)},e.prototype.logStaticFilterSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterDeselect=function(e){return this.makeSearchEvent(Ye.staticFilterDeselect,e)},e.prototype.logStaticFilterDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logFetchMoreResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFetchMoreResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeInterfaceChange=function(e){return this.makeSearchEvent(Ye.interfaceChange,e)},e.prototype.logInterfaceChange=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeInterfaceChange(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanAutomatic=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanAutomatic()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(Ye.didyoumeanClick)},e.prototype.logDidYouMeanClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeResultsSort=function(e){return this.makeSearchEvent(Ye.resultsSort,e)},e.prototype.logResultsSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeResultsSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(Ye.searchboxSubmit)},e.prototype.logSearchboxSubmit=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxSubmit()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(Ye.searchboxClear)},e.prototype.logSearchboxClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(Ye.searchboxAsYouType)},e.prototype.logSearchboxAsYouType=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxAsYouType()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbFacet=function(e){return this.makeSearchEvent(Ye.breadcrumbFacet,e)},e.prototype.logBreadcrumbFacet=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeBreadcrumbFacet(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logBreadcrumbResetAll=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeBreadcrumbResetAll()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentQuickview=function(e,t){return this.makeClickEvent(Ye.documentQuickview,e,t)},e.prototype.logDocumentQuickview=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentQuickview(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(Ye.documentOpen,e,t)},e.prototype.logDocumentOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(Ye.omniboxAnalytics,ht(e))},e.prototype.logOmniboxAnalytics=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxAnalytics(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxFromLink=function(e){return this.makeSearchEvent(Ye.omniboxFromLink,ht(e))},e.prototype.logOmniboxFromLink=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxFromLink(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(Ye.searchFromLink)},e.prototype.logSearchFromLink=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchFromLink()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerNotify=function(e){return this.makeCustomEvent(Ye.triggerNotify,e)},e.prototype.logTriggerNotify=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerNotify(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerExecute=function(e){return this.makeCustomEvent(Ye.triggerExecute,e)},e.prototype.logTriggerExecute=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerExecute(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(Ye.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},e.prototype.logTriggerQuery=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerQuery()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeUndoTriggerQuery=function(e){return this.makeSearchEvent(Ye.undoTriggerQuery,e)},e.prototype.logUndoTriggerQuery=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeUndoTriggerQuery(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerRedirect=function(e){return this.makeCustomEvent(Ye.triggerRedirect,n(n({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))},e.prototype.logTriggerRedirect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerRedirect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerResize=function(e){return this.makeCustomEvent(Ye.pagerResize,e)},e.prototype.logPagerResize=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerResize(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNumber=function(e){return this.makeCustomEvent(Ye.pagerNumber,e)},e.prototype.logPagerNumber=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNumber(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNext=function(e){return this.makeCustomEvent(Ye.pagerNext,e)},e.prototype.logPagerNext=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNext(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerPrevious=function(e){return this.makeCustomEvent(Ye.pagerPrevious,e)},e.prototype.logPagerPrevious=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerPrevious(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerScrolling=function(){return this.makeCustomEvent(Ye.pagerScrolling)},e.prototype.logPagerScrolling=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerScrolling()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetClearAll=function(e){return this.makeSearchEvent(Ye.facetClearAll,e)},e.prototype.logFacetClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSearch=function(e){return this.makeSearchEvent(Ye.facetSearch,e)},e.prototype.logFacetSearch=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSearch(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelect=function(e){return this.makeSearchEvent(Ye.facetSelect,e)},e.prototype.logFacetSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetDeselect=function(e){return this.makeSearchEvent(Ye.facetDeselect,e)},e.prototype.logFacetDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetExclude=function(e){return this.makeSearchEvent(Ye.facetExclude,e)},e.prototype.logFacetExclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetExclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUnexclude=function(e){return this.makeSearchEvent(Ye.facetUnexclude,e)},e.prototype.logFacetUnexclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUnexclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelectAll=function(e){return this.makeSearchEvent(Ye.facetSelectAll,e)},e.prototype.logFacetSelectAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelectAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUpdateSort=function(e){return this.makeSearchEvent(Ye.facetUpdateSort,e)},e.prototype.logFacetUpdateSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUpdateSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowMore=function(e){return this.makeCustomEvent(Ye.facetShowMore,e)},e.prototype.logFacetShowMore=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowMore(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowLess=function(e){return this.makeCustomEvent(Ye.facetShowLess,e)},e.prototype.logFacetShowLess=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowLess(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryError=function(e){return this.makeCustomEvent(Ye.queryError,e)},e.prototype.logQueryError=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryError(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorBack=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorBack)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorBack)]}}))}))}}]}}))}))},e.prototype.logQueryErrorBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorRetry)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorRetry)]}}))}))}}]}}))}))},e.prototype.logQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorRetry()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorClear=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorClear)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorClear)]}}))}))}}]}}))}))},e.prototype.logQueryErrorClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(Ye.likeSmartSnippet)},e.prototype.logLikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeLikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(Ye.dislikeSmartSnippet)},e.prototype.logDislikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDislikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(Ye.expandSmartSnippet)},e.prototype.logExpandSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeExpandSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(Ye.collapseSmartSnippet)},e.prototype.logCollapseSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCollapseSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.openSmartSnippetFeedbackModal)},e.prototype.logOpenSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOpenSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.closeSmartSnippetFeedbackModal)},e.prototype.logCloseSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCloseSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSmartSnippetFeedbackReason=function(e,t){return this.makeCustomEvent(Ye.sendSmartSnippetReason,{reason:e,details:t})},e.prototype.logSmartSnippetFeedbackReason=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logExpandSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeExpandSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logCollapseSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCollapseSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showMoreSmartSnippetSuggestion,e)},e.prototype.logShowMoreSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowMoreSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showLessSmartSnippetSuggestion,e)},e.prototype.logShowLessSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowLessSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSource,e,t)},e.prototype.logOpenSmartSnippetSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.makeCopyToClipboard=function(e,t){return this.makeClickEvent(Ye.copyToClipboard,e,t)},e.prototype.logCopyToClipboard=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCopyToClipboard(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)},e.prototype.logOpenSmartSnippetInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(Ye.recentQueryClick)},e.prototype.logRecentQueryClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecentQueryClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(Ye.clearRecentQueries)},e.prototype.logClearRecentQueries=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentQueries()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentResultClick=function(e,t){return this.makeCustomEvent(Ye.recentResultClick,{info:e,identifier:t})},e.prototype.logRecentResultClick=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecentResultClick(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(Ye.clearRecentResults)},e.prototype.logClearRecentResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(Ye.noResultsBack)},e.prototype.logNoResultsBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeNoResultsBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreFoldedResults=function(e,t){return this.makeClickEvent(Ye.showMoreFoldedResults,e,t)},e.prototype.logShowMoreFoldedResults=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeShowMoreFoldedResults(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(Ye.showLessFoldedResults)},e.prototype.logShowLessFoldedResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowLessFoldedResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeEventDescription=function(e,t){var r;return{actionCause:t,customData:null===(r=e.payload)||void 0===r?void 0:r.customData}},e.prototype.makeCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=n(n({},this.provider.getBaseMetadata()),t),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:r,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return o=n(n({},this.provider.getBaseMetadata()),r),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:t,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEventWithType(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSearchEvent(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(e,t)];case 1:return r=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(r)];case 2:return n=o.sent(),[2,{description:this.makeEventDescription(n,e),log:function(e){var t=e.searchUID;return n.log({searchQueryUid:t})}}]}}))}))},e.prototype.makeClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a,c;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:e}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({searchQueryUid:t})}}]}}))}))},e.prototype.logClickEvent=function(e,t,r,n){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(e,t,r,n)];case 1:return[2,o.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n(n({},this.getOrigins()),this.getSplitTestRun())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e.prototype.getSplitTestRun=function(){var e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return n(n({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})},e}();!function(e){e.click="click",e.flowStart="flowStart"}(dt||(dt={})),function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.suggestionClick="suggestion_click",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"}(ft||(ft={})),function(e){e.quit="Quit",e.solved="Solved"}(vt||(vt={}));var mt=function(){function e(e,t){var r;this.options=e,this.provider=t;var n=(null===(r=e.enableAnalytics)||void 0===r||r)&&!_e();this.coveoAnalyticsClient=n?new ze(e):new ut,this.svc=new et({client:this.coveoAnalyticsClient})}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut,this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.options),this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.logEnterInterface=function(e){return this.svc.setAction(ft.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},e.prototype.logUpdateCaseField=function(e){return this.svc.setAction(ft.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(ft.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionRate,n({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(ft.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCancelled=function(e){return this.svc.setAction(ft.caseCancelled,{reason:vt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseSolved=function(e){return this.svc.setAction(ft.caseSolved,{reason:vt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCreated=function(e){return this.svc.setAction(ft.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e}(),yt=function(e,t){void 0===t&&(t=!0),e.caseContext;var r=e.caseId,i=e.caseNumber,s=o(e,["caseContext","caseId","caseNumber"]),a=function(e){var t={};return e.caseContext&&Object.keys(e.caseContext).forEach((function(r){var n,o=null===(n=e.caseContext)||void 0===n?void 0:n[r];o&&(t["context_"+r]=o)})),t}(e);return n(n(n({CaseId:r,CaseNumber:i},s),!!a.context_Case_Subject&&{CaseSubject:a.context_Case_Subject}),t&&a)},St=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.logInterfaceLoad=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceLoad,t)}return this.logSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceChange=function(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceChange,t)},e.prototype.logStaticFilterDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.staticFilterDeselect,t)},e.prototype.logFetchMoreResults=function(e){if(e){var t=yt(e);return this.logCustomEvent(Ye.pagerScrolling,n(n({},t),{type:"getMoreResults"}))}return this.logCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logBreadcrumbFacet=function(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbFacet,t)},e.prototype.logBreadcrumbResetAll=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbResetAll,t)}return this.logSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logFacetSelect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetSelect,t)},e.prototype.logFacetDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetDeselect,t)},e.prototype.logFacetUpdateSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetUpdateSort,t)},e.prototype.logFacetClearAll=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetClearAll,t)},e.prototype.logFacetShowMore=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowMore,t)},e.prototype.logFacetShowLess=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowLess,t)},e.prototype.logQueryError=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.queryError,t)},e.prototype.logPagerNumber=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNumber,t)},e.prototype.logPagerNext=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNext,t)},e.prototype.logPagerPrevious=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerPrevious,t)},e.prototype.logDidYouMeanAutomatic=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanAutomatic,t)}return this.logSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanClick=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanClick,t)}return this.logSearchEvent(Ye.didyoumeanClick)},e.prototype.logResultsSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.resultsSort,t)},e.prototype.logSearchboxSubmit=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.searchboxSubmit,t)}return this.logSearchEvent(Ye.searchboxSubmit)},e.prototype.logContextChanged=function(e){var t=yt(e);return this.logSearchEvent(Be.contextChanged,t)},e.prototype.logExpandToFullUI=function(e){var t=yt(e);return this.logCustomEvent(Be.expandToFullUI,t)},e.prototype.logOpenUserActions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.openUserActions,t)},e.prototype.logShowPrecedingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showPrecedingSessions,t)},e.prototype.logShowFollowingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showFollowingSessions,t)},e.prototype.logViewedDocumentClick=function(e,t){return this.logCustomEvent(Be.clickViewedDocument,n(n({},yt(t,!1)),{document:e}))},e.prototype.logPageViewClick=function(e,t){return this.logCustomEvent(Be.clickPageView,n(n({},yt(t,!1)),{pageView:e}))},e.prototype.logDocumentOpen=function(e,t,r){return this.logClickEvent(Ye.documentOpen,e,t,r?yt(r,!1):void 0)},e.prototype.logCopyToClipboard=function(e,t,r){return this.logClickEvent(Ye.copyToClipboard,e,t,r?yt(r,!1):void 0)},e.prototype.logDocumentQuickview=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl};return this.logClickEvent(Ye.documentQuickview,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseAttach=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl,resultUriHash:e.documentUriHash};return this.logClickEvent(Ye.caseAttach,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseDetach=function(e,t){return this.logCustomEvent(Ye.caseDetach,t?n(n({},yt(t,!1)),{resultUriHash:e}):{resultUriHash:e})},e.prototype.logCustomEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(s){switch(s.label){case 0:return r=n(n({},this.provider.getBaseMetadata()),t),i=[{}],[4,this.getBaseCustomEventRequest(r)];case 1:return o=n.apply(void 0,[n.apply(void 0,i.concat([s.sent()])),{eventType:ct[e],eventValue:e}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return n=(r=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(e,t)];case 1:return[2,n.apply(r,[o.sent()])]}}))}))},e.prototype.logClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}]),[2,this.coveoAnalyticsClient.sendClickEvent(i)]}}))}))},e.prototype.getBaseCustomEventRequest=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,t.concat([r.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n({},this.getOrigins())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e}(),kt=Object.freeze({__proto__:null,analytics:Ke,donottrack:qe,history:b,SimpleAnalytics:at,storage:k,CoveoAnalyticsClient:ze,CoveoUA:nt,getCurrentClient:it,handleOneAnalyticsEvent:st,CoveoSearchPageClient:gt,CaseAssistClient:mt,CoveoInsightClient:St});window.Promise instanceof Function||global||console.error('This script uses window.Promise which is not supported in your browser. Consider adding a polyfill like "es6-promise".'),window.fetch instanceof Function||global||console.error('This script uses window.fetch which is not supported in your browser. Consider adding a polyfill like "fetch".');var wt=self.coveoua||st;(self.coveoua=st,self.coveoanalytics=kt,wt.q)&&a(wt.q.filter((function(e){return"init"===e[0]})),wt.q.filter((function(e){return"init"!==e[0]}))).forEach((function(e){return st.apply(void 0,e)}));return self.coveoua}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).coveoua=t()}(this,(function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function a(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function c(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}function p(){return c()&&navigator.cookieEnabled}!function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"}(r||(r={}));var h=[r.click,r.custom,r.search,r.view],d=function(e,t){return-1!==h.indexOf(e)?n({language:u()?document.documentElement.lang:"unknown",userAgent:c()?navigator.userAgent:"unknown"},t):t},f=function(){function e(){}return e.set=function(e,t,r){var n,o,i;r&&(n=new Date).setTime(n.getTime()+r),-1===(i=window.location.hostname).indexOf(".")?v(e,t,n):v(e,t,n,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},e.get=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n];if(0===(o=o.replace(/^\s+/,"")).lastIndexOf(t,0))return o.substring(t.length,o.length)}return null},e.erase=function(t){e.set(t,"",-1)},e}();function v(e,t,r,n){document.cookie=e+"="+t+(r?";expires="+r.toUTCString():"")+(n?";domain="+n:"")+";SameSite=Lax"}function g(){return l()?localStorage:p()?new m:function(){try{return"undefined"!=typeof sessionStorage}catch(e){return!1}}()?sessionStorage:new S}var m=function(){function e(){}return e.prototype.getItem=function(t){return f.get(""+e.prefix+t)},e.prototype.removeItem=function(t){f.erase(""+e.prefix+t)},e.prototype.setItem=function(t,r,n){f.set(""+e.prefix+t,r,n)},e.prefix="coveo_",e}(),y=function(){function e(){this.cookieStorage=new m}return e.prototype.getItem=function(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)},e.prototype.removeItem=function(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)},e.prototype.setItem=function(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)},e}(),S=function(){function e(){}return e.prototype.getItem=function(e){return null},e.prototype.removeItem=function(e){},e.prototype.setItem=function(e,t){},e}(),k=Object.freeze({__proto__:null,preferredStorage:null,getAvailableStorage:g,CookieStorage:m,CookieAndLocalStorage:y,NullStorage:S}),w="__coveo.analytics.history",I=function(){function e(e){this.store=e||g()}return e.prototype.addElement=function(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));var t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])},e.prototype.addElementAsync=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=r.sent())?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e]),[2]}}))}))},e.prototype.getHistory=function(){var e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))},e.prototype.getHistoryAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return e=t.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(e))]}}))}))},e.prototype.getHistoryWithInternalTime=function(){try{var e=this.store.getItem(w);return e&&"string"==typeof e?JSON.parse(e):[]}catch(e){return[]}},e.prototype.getHistoryWithInternalTimeAsync=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.store.getItem(w)];case 1:return(e=t.sent())?[2,JSON.parse(e)]:[2,[]];case 2:return t.sent(),[2,[]];case 3:return[2]}}))}))},e.prototype.setHistory=function(e){try{this.store.setItem(w,JSON.stringify(e.slice(0,20)))}catch(e){}},e.prototype.clear=function(){try{this.store.removeItem(w)}catch(e){}},e.prototype.getMostRecentElement=function(){var e=this.getHistoryWithInternalTime();return null!=e?e.sort((function(e,t){return(t.internalTime||0)-(e.internalTime||0)}))[0]:null},e.prototype.cropQueryElement=function(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e},e.prototype.isValidEntry=function(e){var t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4},e.prototype.stripInternalTime=function(e){return e.map((function(e){return{name:e.name,time:e.time,value:e.value}}))},e.prototype.stripEmptyQuery=function(e){var t=e.name,r=e.time,n=e.value;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e},e.prototype.stripEmptyQueries=function(e){var t=this;return e.map((function(e){return t.stripEmptyQuery(e)}))},e}(),b=Object.freeze({__proto__:null,STORE_KEY:w,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,MAX_VALUE_SIZE:75,HistoryStore:I,default:I}),E=function(e,t){return i(void 0,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return e!==r.view?[3,2]:[4,C(t.contentIdValue)];case 1:return o.sent(),[2,n({location:window.location.toString(),referrer:document.referrer,title:document.title},t)];case 2:return[2,t]}}))}))},C=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=new I,r={name:"PageView",value:e,time:JSON.stringify(new Date)},[4,t.addElementAsync(r)];case 1:return n.sent(),[2]}}))}))};let D;const U=new Uint8Array(16);function R(){if(!D&&(D="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!D))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return D(U)}var A=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(e){return"string"==typeof e&&A.test(e)}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));function x(e,t=0){return(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase()}var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(e,t,r){if(T.randomUUID&&!t&&!e)return T.randomUUID();const n=(e=e||{}).random||(e.rng||R)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return x(n)}function O(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function V(e,t){return e<<t|e>>>32-t}var M=function(e,t,r){function n(e,n,o,i){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=function(e){if(!P(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}(n)),16!==(null===(s=n)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),a=r(a),a[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=a[e];return o}return x(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let t=0;t<o;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];i[t]=r}i[o-1][14]=8*(e.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<o;++e){const n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=i[e][t];for(let e=16;e<80;++e)n[e]=V(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let o=r[0],s=r[1],a=r[2],c=r[3],u=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),i=V(o,5)+O(r,s,a,c)+u+t[r]+n[e]>>>0;u=c,c=a,a=V(s,30)>>>0,s=o,o=i}r[0]=r[0]+o>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),_="2.26.4",q=function(e){return e.protocol+"//"+e.hostname+(0===e.pathname.indexOf("/")?e.pathname:"/"+e.pathname)+e.search},Q={pageview:"pageview",event:"event"},N=function(e){var t=e.client,r=e.uuidGenerator,n=void 0===r?L:r;this.client=t,this.uuidGenerator=n},H=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=q(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return t(r,e),r.prototype.getApi=function(e){return"setAction"===e?this.setAction:null},r.prototype.setAction=function(e,t){this.action=e,this.actionData=t},r.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},r.prototype.getLocationInformation=function(e,t){return n({hitType:e},this.getNextValues(e,t))},r.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},r.prototype.getDefaultContextInformation=function(e){var t={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},r={screenResolution:screen.width+"x"+screen.height,screenColor:screen.colorDepth+"-bit"},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return n(n(n(n({},i),r),o),t)},r.prototype.updateLocationForNextPageView=function(e,t){var r=this.getNextValues(e,t),n=r.pageViewId,o=r.referrer,i=r.location;this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,e===Q.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},r.prototype.getNextValues=function(e,t){return{pageViewId:e===Q.pageview?this.nextPageViewId:this.pageViewId,referrer:e===Q.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===Q.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},r.prototype.getCurrentLocationFromPayload=function(e){if(e.page){return""+this.currentLocation.split("/").slice(0,3).join("/")+e.page.replace(/^\/?(.*)$/,"/$1")}return q(window.location)},r}(N),B=function(){function e(e,t){if(!P(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/1e3)}return e.prototype.toString=function(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()},Object.defineProperty(e.prototype,"expired",{get:function(){var t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime},enumerable:!1,configurable:!0}),e.prototype.validate=function(e,t){return!this.expired&&this.matchReferrer(e,t)},e.prototype.matchReferrer=function(e,t){try{var r=new URL(e);return t.some((function(e){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host)}))}catch(e){return!1}},e.fromString=function(t){var r=t.split(".");if(2!==r.length)return null;var n=r[0],o=r[1];if(32!==n.length||isNaN(parseInt(o)))return null;var i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return P(i)?new e(i,1e3*Number.parseInt(o)):null},e.cvo_cid="cvo_cid",e.expirationTime=120,e}(),j=function(e){function r(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n;return e.call(this,{client:r,uuidGenerator:o})||this}return t(r,e),r.prototype.getApi=function(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},r.prototype.decorate=function(e){return i(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");n.label=1;case 1:return n.trys.push([1,3,,4]),t=new URL(e),[4,this.client.getCurrentVisitorId()];case 2:return r=n.sent(),t.searchParams.set(B.cvo_cid,new B(r,Date.now()).toString()),[2,t.toString()];case 3:throw n.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},r.prototype.acceptFrom=function(e){this.client.setAcceptedLinkReferrers(e)},r.Id="link",r}(N),Y=j,z=Object.keys;function K(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var W={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},G=a(z(W).map((function(e){return W[e]}))).join("|"),$=new RegExp("^("+G+"$)"),J=[function(e){return $.test(e)}],X={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ee={action:"pa",list:"pal",listSource:"pls"},te={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},re={id:"quoteId",affiliation:"quoteAffiliation"},ne={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},oe={add:ee,bookmark_add:ee,bookmark_remove:ee,click:ee,checkout:ee,checkout_option:ee,detail:ee,impression:ee,remove:ee,refund:n(n({},ee),te),purchase:n(n({},ee),te),quickview:ee,quote:n(n({},ee),re),review:n(n({},ee),ne)},ie=function(e,t,r,o){return z(e).reduce((function(i,s){var a,c="il"+(t+1)+o+(r+1)+(Z[s]||s);return n(n({},i),((a={})[c]=e[s],a))}),{})},se=z(X).map((function(e){return X[e]})),ae=z(Z).map((function(e){return Z[e]})),ce=z(ee).map((function(e){return ee[e]})),ue=z(te).map((function(e){return te[e]})),le=z(ne).map((function(e){return ne[e]})),pe=z(re).map((function(e){return re[e]})),he=a(se,["custom"]).join("|"),de=a(ae,["custom"]).join("|"),fe=new RegExp("^(pr[0-9]+)("+he+")$"),ve=new RegExp("^((il[0-9]+pi[0-9]+)("+de+"))|(il[0-9]+nm)$"),ge=new RegExp("^("+ce.join("|")+")$"),me=new RegExp("^("+ue.join("|")+")$"),ye=new RegExp("^(pr[0-9]+)custom$"),Se=new RegExp("^(il[0-9]+pi[0-9]+)custom$"),ke=new RegExp("^("+a(["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],le,pe).join("|")+")$"),we=[function(e){return ve.test(e)},function(e){return fe.test(e)},function(e){return ge.test(e)},function(e){return me.test(e)},function(e){return ke.test(e)}],Ie=[ye,Se],be=n(n(n(n({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale"].reduce((function(e,t){var r;return n(n({},e),((r={})[t]=t,r))}),{})),Ee=n(n({},be),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Ce=z(Ee).map((function(e){return Ee[e]})),De=function(e){return-1!==Ce.indexOf(e)},Ue=function(e){return"custom"===e},Re=function(e){var t=void 0;return a(Ie).every((function(r){var n;return t=null===(n=r.exec(e))||void 0===n?void 0:n[1],!Boolean(t)})),t},Ae=function(e,t){return z(t).reduce((function(r,o){var i;return n(n({},r),((i={})[""+e+o]=t[o],i))}),{})},Pe=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i,a,c,u,l,p,h,d,f;return s(this,(function(s){switch(s.label){case 0:if(!navigator.sendBeacon)throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');return r=this.opts,o=r.baseUrl,i=r.preprocessRequest,a=this.encodeForEventType(e,t),[4,this.getQueryParamsForEventType(e)];case 1:return c=s.sent(),u={url:o+"/analytics/"+e+"?"+c,body:new Blob([a],{type:"application/x-www-form-urlencoded"})},d=[n({},u)],i?[4,i(u,"analyticsBeacon")]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f={},s.label=4;case 4:return l=n.apply(void 0,d.concat([f])),p=l.url,h=l.body,console.log('Sending beacon for "'+e+'" with: ',JSON.stringify(t)),navigator.sendBeacon(p,h),[2]}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},e.prototype.encodeForEventType=function(e,t){return this.isEventTypeLegacy(e)?this.encodeForLegacyType(e,t):this.encodeForFormUrlEncoded(n({access_token:this.opts.token},t))},e.prototype.getQueryParamsForEventType=function(e){return i(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(o){switch(o.label){case 0:return t=this.opts,r=t.token,[4,t.visitorIdProvider.getCurrentVisitorId()];case 1:return n=o.sent(),[2,[r&&this.isEventTypeLegacy(e)?"access_token="+r:"",n?"visitorId="+n:"","discardVisitInfo=true"].filter((function(e){return!!e})).join("&")]}}))}))},e.prototype.isEventTypeLegacy=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.encodeForLegacyType=function(e,t){return e+"Event="+encodeURIComponent(JSON.stringify(t))},e.prototype.encodeForFormUrlEncoded=function(e){var t=this;return Object.keys(e).filter((function(t){return!!e[t]})).map((function(r){return encodeURIComponent(r)+"="+encodeURIComponent(t.encodeValue(e[r]))})).join("&")},e.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},e}(),Fe=function(){function e(){}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve()]}))}))},e}(),xe=window.fetch,Te=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,i,a,c,u,l,p,h,d,f,v,g,m;return s(this,(function(s){switch(s.label){case 0:return r=this.opts,i=r.baseUrl,a=r.visitorIdProvider,c=r.preprocessRequest,this.shouldAppendVisitorId(e)?[4,this.getVisitorIdParam()]:[3,2];case 1:return u=s.sent(),[3,3];case 2:u="",s.label=3;case 3:return l={url:i+"/analytics/"+e+u,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},f=[n({},l)],c?[4,c(l,"analyticsFetch")]:[3,5];case 4:return v=s.sent(),[3,6];case 5:v={},s.label=6;case 6:return p=n.apply(void 0,f.concat([v])),h=p.url,d=o(p,["url"]),[4,xe(h,d)];case 7:return(g=s.sent()).ok?[4,g.json()]:[3,9];case 8:return(m=s.sent()).visitorId&&a.setCurrentVisitorId(m.visitorId),[2,m];case 9:try{g.json()}catch(e){}throw console.error('An error has occured when sending the "'+e+'" event.',g,t),new Error('An error has occurred when sending the "'+e+'" event. Check the console logs for more details.')}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this.opts.baseUrl,[4,xe(e+"/analytics/visit",{headers:this.getHeaders(),method:"DELETE"})];case 1:return t.sent(),[2]}}))}))},e.prototype.shouldAppendVisitorId=function(e){return-1!==[r.click,r.custom,r.search,r.view].indexOf(e)},e.prototype.getVisitorIdParam=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(e=t.sent())?"?visitor="+e:""]}}))}))},e.prototype.getHeaders=function(){var e=this.opts.token;return n(n({},e?{Authorization:"Bearer "+e}:{}),{"Content-Type":"application/json"})},e}(),Le=function(e,t){var r=this;l()&&p()?this.storage=new y:l()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new S),this.client=new Te(e),this.beaconClient=new Pe(e),window.addEventListener("beforeunload",(function(){for(var e=0,n=t();e<n.length;e++){var o=n[e],i=o.eventType,s=o.payload;r.beaconClient.sendEvent(i,s)}}))},Oe=function(e,t){this.storage=t||new S,this.client=new Te(e)},Ve=function(){this.storage=new S,this.client=new Fe};var Me=["1",1,"yes",!0];function _e(){return c()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(e){return-1!==Me.indexOf(e)}))}var qe=Object.freeze({__proto__:null,doNotTrack:_e,default:_e}),Qe="v15",Ne={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function He(e,t){void 0===e&&(e=Ne.default),void 0===t&&(t=Qe);var r=-1!==e.indexOf(".cloud.coveo.com");return e+(r?"":"/rest")+"/"+t}var Be,je,Ye,ze=function(){function e(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=n(n({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[E,d].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};var t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),_e()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return{endpoint:Ne.default,token:"",version:Qe,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&u()?new Le(e,(function(){var e=a(t.bufferedRequests);return t.bufferedRequests=[],e})):("undefined"!=typeof navigator&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please use the \"coveo.analytics/react-native\" subpackage.\n Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native\n "),new Oe(e))},Object.defineProperty(e.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),e.prototype.determineVisitorId=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),(e=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:e=r.sent(),r.label=2;case 2:return[2,e||L()];case 3:return t=r.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),[2,L()];case 4:return[2]}}))}))},e.prototype.getCurrentVisitorId=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return e=t.sent(),[4,this.setCurrentVisitorId(e)];case 2:t.sent(),t.label=3;case 3:return[2,this.visitorId]}}))}))},e.prototype.setCurrentVisitorId=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.visitorId=e,[4,this.storage.setItem("visitorId",e)];case 1:return t.sent(),[2]}}))}))},e.prototype.setClientId=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){if(P(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(M(e,M(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}return[2]}))}))},e.prototype.getParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return[2,r.sent()]}}))}))},e.prototype.getPayload=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,a([e],t))];case 1:return r=n.sent(),[4,this.resolvePayloadForParameters(e,r)];case 2:return[2,n.sent()]}}))}))},Object.defineProperty(e.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(L()),this.visitorId},set:function(e){this.visitorId=e,this.storage.setItem("visitorId",e)},enumerable:!1,configurable:!0}),e.prototype.extractClientIdFromLink=function(e){if(_e())return null;try{var t=new URL(e).searchParams.get(B.cvo_cid);if(null==t)return null;var r=B.fromString(t);return r&&u()&&r.validate(document.referrer,this.acceptedLinkReferrers)?r.clientId:null}catch(e){}return null},e.prototype.resolveParameters=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,a,c,u,l,p,h,d,f,v,g,m=this;return s(this,(function(y){switch(y.label){case 0:return r=this.eventTypeMapping[e]||{},o=r.variableLengthArgumentsNames,a=void 0===o?[]:o,c=r.addVisitorIdParameter,u=void 0!==c&&c,l=r.usesMeasurementProtocol,p=void 0!==l&&l,h=r.addClientIdParameter,d=void 0!==h&&h,f=function(e){return i(m,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=[n({},e)],r={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return o=i.sent(),[3,3];case 2:o="",i.label=3;case 3:return[2,n.apply(void 0,t.concat([(r.visitorId=o,r)]))]}}))}))},v=function(e){return i(m,void 0,void 0,(function(){var t,r;return s(this,(function(o){switch(o.label){case 0:return d?(t=[n({},e)],r={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,n.apply(void 0,t.concat([(r.clientId=o.sent(),r)]))];case 2:return[2,e]}}))}))},g=function(t){return m.beforeSendHooks.reduce((function(t,r){return i(m,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return n=o.sent(),[4,r(e,n)];case 2:return[2,o.sent()]}}))}))}),t)},[4,[function(e){return a.length>0?m.parseVariableArgumentsPayload(a,e):e[0]},f,v,function(e){return p?m.ensureAnonymousUserWhenUsingApiKey(e):e},g].reduce((function(e,t){return i(m,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,y.sent()]}}))}))},e.prototype.resolvePayloadForParameters=function(e,t){return i(this,void 0,void 0,(function(){var r,o,a,c=this;return s(this,(function(u){switch(u.label){case 0:return r=(this.eventTypeMapping[e]||{}).usesMeasurementProtocol,o=void 0!==r&&r,a=function(e){return o?(r=!!(t=e).action&&oe[t.action]||{},z(t).reduce((function(e,o){var i,s=r[o]||Ee[o]||o;return n(n({},e),((i={})[s]=t[o],i))}),{})):e;var t,r},[4,[function(t){return c.removeEmptyPayloadValues(t,e)},function(e){return c.validateParams(e)},a,function(e){return o?c.removeUnknownParameters(e):e},function(e){return o?c.processCustomParameters(e):c.mapCustomParametersToCustomData(e)}].reduce((function(e,t){return i(c,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=n.sent(),[4,t(r)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,u.sent()]}}))}))},e.prototype.makeEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,c,u,l=this;return s(this,(function(p){switch(p.label){case 0:return r=(this.eventTypeMapping[e]||{}).newEventType,o=void 0===r?e:r,[4,this.resolveParameters.apply(this,a([e],t))];case 1:return c=p.sent(),[4,this.resolvePayloadForParameters(e,c)];case 2:return u=p.sent(),[2,{eventType:o,payload:u,log:function(t){return i(l,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.bufferedRequests.push({eventType:o,payload:n(n({},u),t)}),[4,Promise.all(this.afterSendHooks.map((function(r){return r(e,n(n({},c),t))})))];case 1:return r.sent(),[4,this.deferExecution()];case 2:return r.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,r.sent()]}}))}))}}]}}))}))},e.prototype.sendEvent=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeEvent.apply(this,a([e],t))];case 1:return[2,r.sent().log({})]}}))}))},e.prototype.deferExecution=function(){return new Promise((function(e){return setTimeout(e,0)}))},e.prototype.sendFromBufferWithFetch=function(){return i(this,void 0,void 0,(function(){var e,t,r;return s(this,(function(n){return(e=this.bufferedRequests.shift())?(t=e.eventType,r=e.payload,[2,this.runtime.client.sendEvent(t,r)]):[2]}))}))},e.prototype.clear=function(){this.storage.removeItem("visitorId"),(new I).clear()},e.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},e.prototype.makeSearchEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.search,e)]}))}))},e.prototype.sendSearchEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeClickEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.click,e)]}))}))},e.prototype.sendClickEvent=function(e){var t=e.searchQueryUid,r=o(e,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClickEvent(r)];case 1:return[2,e.sent().log({searchQueryUid:t})]}}))}))},e.prototype.makeCustomEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.custom,e)]}))}))},e.prototype.sendCustomEvent=function(e){var t=e.lastSearchQueryUid,r=o(e,["lastSearchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCustomEvent(r)];case 1:return[2,e.sent().log({lastSearchQueryUid:t})]}}))}))},e.prototype.makeViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.makeEvent(r.view,e)]}))}))},e.prototype.sendViewEvent=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeViewEvent(e)];case 1:return[2,t.sent().log({})]}}))}))},e.prototype.getVisit=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,fetch(this.baseUrl+"/analytics/visit")];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),this.visitorId=e.visitorId,[2,e]}}))}))},e.prototype.getHealth=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/monitoring/health")];case 1:return[4,e.sent().json()];case 2:return[2,e.sent()]}}))}))},e.prototype.registerBeforeSendEventHook=function(e){this.beforeSendHooks.push(e)},e.prototype.registerAfterSendEventHook=function(e){this.afterSendHooks.push(e)},e.prototype.addEventTypeMapping=function(e,t){this.eventTypeMapping[e]=t},e.prototype.setAcceptedLinkReferrers=function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e})))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=e},e.prototype.parseVariableArgumentsPayload=function(e,t){for(var r={},o=0,i=t.length;o<i;o++){var s=t[o];if("string"==typeof s)r[e[o]]=s;else if("object"==typeof s)return n(n({},r),s)}return r},e.prototype.isKeyAllowedEmpty=function(e,t){var n;return-1!==(((n={})[r.search]=["queryText"],n)[e]||[]).indexOf(t)},e.prototype.removeEmptyPayloadValues=function(e,t){var r=this;return Object.keys(e).filter((function(n){return r.isKeyAllowedEmpty(t,n)||null!=(o=e[n])&&""!==o;var o})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{})},e.prototype.removeUnknownParameters=function(e){var t=Object.keys(e).filter((function(e){if(function(e){return a(we,J,[De,Ue]).some((function(t){return t(e)}))}(e))return!0;console.log(e,"is not processed by coveoua")})).reduce((function(t,r){var o;return n(n({},t),((o={})[r]=e[r],o))}),{});return t},e.prototype.processCustomParameters=function(e){var t=e.custom,r=o(e,["custom"]),i={};t&&K(t)&&(i=this.lowercaseKeys(t));var s,a=z(s=r).reduce((function(e,t){var r,o=Re(t);return n(n({},e),o?Ae(o,s[t]):((r={})[t]=s[t],r))}),{});return n(n({},i),a)},e.prototype.mapCustomParametersToCustomData=function(e){var t=e.custom,r=o(e,["custom"]);if(t&&K(t)){var i=this.lowercaseKeys(t);return n(n({},r),{customData:n(n({},i),e.customData)})}return e},e.prototype.lowercaseKeys=function(e){var t=Object.keys(e),r={};return t.forEach((function(t){r[t.toLowerCase()]=e[t]})),r},e.prototype.validateParams=function(e){var t=e.anonymizeIp,r=o(e,["anonymizeIp"]);return void 0!==t&&-1==["0","false","undefined","null","{}","[]",""].indexOf((""+t).toLowerCase())&&(r.anonymizeIp=1),r},e.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,r=e.userId,n=o(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!r?(n.userId="anonymous",n):e},Object.defineProperty(e.prototype,"baseUrl",{get:function(){return He(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),e}(),Ke=Object.freeze({__proto__:null,Version:Qe,Endpoints:Ne,buildBaseUrl:He,CoveoAnalyticsClient:ze,default:ze}),We=n({},Q),Ge=Object.keys(We).map((function(e){return We[e]})),$e=function(e){function i(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return t(i,e),i.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);if(null!==r)return r;switch(t){case"addProduct":return this.addProduct;case"addImpression":return this.addImpression;default:return null}},i.prototype.addHooks=function(){this.addHooksForPageView(),this.addHooksForEvent(),this.addHooksForECEvents()},i.prototype.addProduct=function(e){this.products.push(e)},i.prototype.addImpression=function(e){this.impressions.push(e)},i.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},i.prototype.addHooksForECEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)?e.addECDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ge.indexOf(t)&&e.updateLocationInformation(t,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(We.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(We.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(e,t){var r=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),n(n(n(n({},i),o),r),t)},i.prototype.getProductPayload=function(){var e=this;return this.products.map((function(t){return e.assureProductValidity(t)})).reduce((function(e,t,r){return n(n({},e),function(e,t){return z(e).reduce((function(r,o){var i,s="pr"+(t+1)+(X[o]||o);return n(n({},r),((i={})[s]=e[o],i))}),{})}(t,r))}),{})},i.prototype.getImpressionPayload=function(){var e=this;return this.getImpressionsByList().map((function(t){var r=t.impressions,i=o(t,["impressions"]);return n(n({},i),{impressions:r.map((function(t){return e.assureBaseImpressionValidity(t)}))})})).reduce((function(e,t,r){return n(n({},e),function(e,t,r){var o=e.impressions.reduce((function(e,o,i){return n(n({},e),ie(o,t,i,r))}),{});return e.listName&&(o["il"+(t+1)+"nm"]=e.listName),o}(t,r,"pi"))}),{})},i.prototype.assureProductValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.assureBaseImpressionValidity=function(e){var t=e.position,r=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '"+(e.name||e.id)+"' must be greater than 0 when provided."),r):e},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(e,t){var r=t.list,n=o(t,["list"]),i=e.find((function(e){return e.listName===r}));return i?i.impressions.push(n):e.push({listName:r,impressions:[n]}),e}),[])},i.Id="ec",i}(H),Je=$e,Xe=n({},Q),Ze=Object.keys(Xe).map((function(e){return Xe[e]})),et=function(e){function o(t){var r=t.client,n=t.uuidGenerator,o=void 0===n?L:n,i=e.call(this,{client:r,uuidGenerator:o})||this;return i.ticket={},i}return t(o,e),o.prototype.getApi=function(t){var r=e.prototype.getApi.call(this,t);return null!==r?r:"setTicket"===t?this.setTicket:null},o.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},o.prototype.setTicket=function(e){this.ticket=e},o.prototype.clearPluginData=function(){this.ticket={}},o.prototype.addHooksForSVCEvents=function(){var e=this;this.client.registerBeforeSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)?e.addSVCDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=r[0];return-1!==Ze.indexOf(t)&&e.updateLocationInformation(t,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Xe.pageview,{newEventType:r.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Xe.event,{newEventType:r.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(e,t){var r,o=n(n(n(n({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(r=this.actionData)&&void 0!==r?r:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),n(n(n({},i),o),t)},o.prototype.getTicketPayload=function(){return e=this.ticket,z(e).filter((function(t){return void 0!==e[t]})).reduce((function(t,r){var o,i=W[r]||r;return n(n({},t),((o={})[i]=e[r],o))}),{});var e},o.Id="svc",o}(H),tt=et,rt=function(){function e(){var e;this.registeredPluginsMap=((e={})[Je.Id]=Je,e[tt.Id]=tt,e[Y.Id]=Y,e),this.requiredPlugins={}}return e.prototype.require=function(e,t){var r=this.registeredPluginsMap[e];if(!r)throw new Error('No plugin named "'+e+"\" is currently registered. If you use a custom plugin, use 'provide' first.");this.requiredPlugins[e]=new r(t)},e.prototype.provide=function(e,t){this.registeredPluginsMap[e]=t},e.prototype.clearRequired=function(){this.requiredPlugins={}},e.prototype.execute=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'+e+'" is not required. Check that you required it on initialization.');var i=o.getApi(t);if(!i)throw new Error('The function "'+t+'" does not exist on the plugin "'+e+'".');if("function"!=typeof i)throw new Error('"'+t+'" of the plugin "'+e+'" is not a function.');return i.apply(o,r)},e.DefaultPlugins=[Je.Id,tt.Id,Y.Id],e}(),nt=function(){function e(){this.plugins=new rt,this.params={}}return e.prototype.init=function(e,t){var o=this;if(!e)throw new Error("You must pass your token when you call 'init'");if("string"==typeof e?this.client=new ze({token:e,endpoint:this.getEndpoint(t)}):this.isAnalyticsClient(e)&&(this.client=e),!this.client)throw new Error("You must pass either your token or a valid object when you call 'init'");var i={client:this.client};this.plugins.clearRequired(),this.getPluginKeys(t).forEach((function(e){return o.plugins.require(e,i)})),this.client.registerBeforeSendEventHook((function(e,t){return n(n({},t),o.params)})),this.client.addEventTypeMapping(r.view,{newEventType:r.view,addClientIdParameter:!0})},e.prototype.isAnalyticsClient=function(e){return"object"==typeof e&&void 0!==e.sendEvent},e.prototype.getPluginKeys=function(e){return"string"==typeof e?rt.DefaultPlugins:Array.isArray(null==e?void 0:e.plugins)?e.plugins:rt.DefaultPlugins},e.prototype.getEndpoint=function(e){return"string"==typeof e?e||Ne.default:(null==e?void 0:e.endpoint)?e.endpoint:Ne.default},e.prototype.initForProxy=function(e){if(!e)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof e)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new ze({endpoint:e})},e.prototype.set=function(e,t){var r=this;"string"==typeof e?this.params[e]=t:Object.keys(e).map((function(t){r.params[t]=e[t]}))},e.prototype.send=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!n)throw new Error('You must provide an event type when calling "send".');return(e=this.client).sendEvent.apply(e,a([n.toLowerCase()],o))},e.prototype.onLoad=function(e){if(void 0===e)throw new Error("You must pass a function when you call 'onLoad'");e()},e.prototype.provide=function(e,t){this.plugins.provide(e,t)},e.prototype.require=function(e,t){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(e,n(n({},t),{client:this.client}))},e.prototype.callPlugin=function(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return(r=this.plugins).execute.apply(r,a([e,t],n))},e.prototype.reset=function(){this.client=void 0,this.plugins=new rt,this.params={}},e.prototype.version=function(){return _},e}(),ot=new nt,it=function(){return ot.client},st=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e);n[1];var o=n[2],i=n[3],s=ot[i];if(o&&i)return ot.callPlugin.apply(ot,a([o,i],t));if(s)return s.apply(ot,t);var c=["init","set","send","onLoad","callPlugin","reset","require","provide","version"];throw new Error('The action "'+e+'" does not exist. Available actions: '+c.join(", ")+".")},at=Object.freeze({__proto__:null,CoveoUA:nt,coveoua:ot,getCurrentClient:it,handleOneAnalyticsEvent:st,default:st});!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView"}(Be||(Be={})),function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseAttach="caseAttach",e.caseDetach="caseDetach"}(Ye||(Ye={}));var ct=((je={})[Ye.triggerNotify]="queryPipelineTriggers",je[Ye.triggerExecute]="queryPipelineTriggers",je[Ye.triggerQuery]="queryPipelineTriggers",je[Ye.triggerRedirect]="queryPipelineTriggers",je[Ye.queryError]="errors",je[Ye.queryErrorBack]="errors",je[Ye.queryErrorClear]="errors",je[Ye.queryErrorRetry]="errors",je[Ye.pagerNext]="getMoreResults",je[Ye.pagerPrevious]="getMoreResults",je[Ye.pagerNumber]="getMoreResults",je[Ye.pagerResize]="getMoreResults",je[Ye.pagerScrolling]="getMoreResults",je[Ye.facetSearch]="facet",je[Ye.facetShowLess]="facet",je[Ye.facetShowMore]="facet",je[Ye.recommendation]="recommendation",je[Ye.likeSmartSnippet]="smartSnippet",je[Ye.dislikeSmartSnippet]="smartSnippet",je[Ye.expandSmartSnippet]="smartSnippet",je[Ye.collapseSmartSnippet]="smartSnippet",je[Ye.openSmartSnippetFeedbackModal]="smartSnippet",je[Ye.closeSmartSnippetFeedbackModal]="smartSnippet",je[Ye.sendSmartSnippetReason]="smartSnippet",je[Ye.expandSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",je[Ye.clearRecentQueries]="recentQueries",je[Ye.recentResultClick]="recentlyClickedDocuments",je[Ye.clearRecentResults]="recentlyClickedDocuments",je[Ye.showLessFoldedResults]="folding",je[Be.expandToFullUI]="interface",je[Be.openUserActions]="User Actions",je[Be.showPrecedingSessions]="User Actions",je[Be.showFollowingSessions]="User Actions",je[Be.clickViewedDocument]="User Actions",je[Be.clickPageView]="User Actions",je[Ye.caseDetach]="case",je),ut=function(){function e(){this.runtime=new Ve,this.currentVisitorId=""}return e.prototype.getPayload=function(){return Promise.resolve()},e.prototype.getParameters=function(){return Promise.resolve()},e.prototype.makeEvent=function(e){return Promise.resolve({eventType:e,payload:null,log:function(){return Promise.resolve()}})},e.prototype.sendEvent=function(){return Promise.resolve()},e.prototype.makeSearchEvent=function(){return this.makeEvent(r.search)},e.prototype.sendSearchEvent=function(){return Promise.resolve()},e.prototype.makeClickEvent=function(){return this.makeEvent(r.click)},e.prototype.sendClickEvent=function(){return Promise.resolve()},e.prototype.makeCustomEvent=function(){return this.makeEvent(r.custom)},e.prototype.sendCustomEvent=function(){return Promise.resolve()},e.prototype.makeViewEvent=function(){return this.makeEvent(r.view)},e.prototype.sendViewEvent=function(){return Promise.resolve()},e.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},e.prototype.getHealth=function(){return Promise.resolve({status:""})},e.prototype.registerBeforeSendEventHook=function(){},e.prototype.registerAfterSendEventHook=function(){},e.prototype.addEventTypeMapping=function(){},Object.defineProperty(e.prototype,"version",{get:function(){return _},enumerable:!1,configurable:!0}),e}();function lt(e){var t=e.join(";");return t.length<=256?t:lt(e.slice(1))}var pt=function(e){var t=function(e){return e.map((function(e){return e.replace(/;/g,"")}))}(e),r=function(e){var t="";return e.filter((function(e){var r=e!==t;return t=e,r}))}(t);return lt(r)};function ht(e){var t="string"==typeof e.partialQueries?e.partialQueries:pt(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:pt(e.suggestions);return n(n({},e),{partialQueries:t,suggestions:r})}var dt,ft,vt,gt=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(Ye.recommendationInterfaceLoad)},e.prototype.logRecommendationInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendationInterfaceLoad()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendation=function(){return this.makeCustomEvent(Ye.recommendation)},e.prototype.logRecommendation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecommendation()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecommendationOpen=function(e,t){return this.makeClickEvent(Ye.recommendationOpen,e,t)},e.prototype.logRecommendationOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecommendationOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(Ye.staticFilterClearAll,e)},e.prototype.logStaticFilterClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterSelect=function(e){return this.makeSearchEvent(Ye.staticFilterSelect,e)},e.prototype.logStaticFilterSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterDeselect=function(e){return this.makeSearchEvent(Ye.staticFilterDeselect,e)},e.prototype.logStaticFilterDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeStaticFilterDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logFetchMoreResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFetchMoreResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeInterfaceChange=function(e){return this.makeSearchEvent(Ye.interfaceChange,e)},e.prototype.logInterfaceChange=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeInterfaceChange(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanAutomatic=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanAutomatic()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(Ye.didyoumeanClick)},e.prototype.logDidYouMeanClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDidYouMeanClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeResultsSort=function(e){return this.makeSearchEvent(Ye.resultsSort,e)},e.prototype.logResultsSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeResultsSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(Ye.searchboxSubmit)},e.prototype.logSearchboxSubmit=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxSubmit()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(Ye.searchboxClear)},e.prototype.logSearchboxClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(Ye.searchboxAsYouType)},e.prototype.logSearchboxAsYouType=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchboxAsYouType()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbFacet=function(e){return this.makeSearchEvent(Ye.breadcrumbFacet,e)},e.prototype.logBreadcrumbFacet=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeBreadcrumbFacet(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logBreadcrumbResetAll=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeBreadcrumbResetAll()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentQuickview=function(e,t){return this.makeClickEvent(Ye.documentQuickview,e,t)},e.prototype.logDocumentQuickview=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentQuickview(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(Ye.documentOpen,e,t)},e.prototype.logDocumentOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeDocumentOpen(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(Ye.omniboxAnalytics,ht(e))},e.prototype.logOmniboxAnalytics=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxAnalytics(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxFromLink=function(e){return this.makeSearchEvent(Ye.omniboxFromLink,ht(e))},e.prototype.logOmniboxFromLink=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOmniboxFromLink(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(Ye.searchFromLink)},e.prototype.logSearchFromLink=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeSearchFromLink()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerNotify=function(e){return this.makeCustomEvent(Ye.triggerNotify,e)},e.prototype.logTriggerNotify=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerNotify(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerExecute=function(e){return this.makeCustomEvent(Ye.triggerExecute,e)},e.prototype.logTriggerExecute=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerExecute(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(Ye.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},e.prototype.logTriggerQuery=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerQuery()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeUndoTriggerQuery=function(e){return this.makeSearchEvent(Ye.undoTriggerQuery,e)},e.prototype.logUndoTriggerQuery=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeUndoTriggerQuery(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeTriggerRedirect=function(e){return this.makeCustomEvent(Ye.triggerRedirect,n(n({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))},e.prototype.logTriggerRedirect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerRedirect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerResize=function(e){return this.makeCustomEvent(Ye.pagerResize,e)},e.prototype.logPagerResize=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerResize(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNumber=function(e){return this.makeCustomEvent(Ye.pagerNumber,e)},e.prototype.logPagerNumber=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNumber(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerNext=function(e){return this.makeCustomEvent(Ye.pagerNext,e)},e.prototype.logPagerNext=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerNext(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerPrevious=function(e){return this.makeCustomEvent(Ye.pagerPrevious,e)},e.prototype.logPagerPrevious=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerPrevious(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makePagerScrolling=function(){return this.makeCustomEvent(Ye.pagerScrolling)},e.prototype.logPagerScrolling=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerScrolling()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetClearAll=function(e){return this.makeSearchEvent(Ye.facetClearAll,e)},e.prototype.logFacetClearAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetClearAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSearch=function(e){return this.makeSearchEvent(Ye.facetSearch,e)},e.prototype.logFacetSearch=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSearch(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelect=function(e){return this.makeSearchEvent(Ye.facetSelect,e)},e.prototype.logFacetSelect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetDeselect=function(e){return this.makeSearchEvent(Ye.facetDeselect,e)},e.prototype.logFacetDeselect=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetDeselect(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetExclude=function(e){return this.makeSearchEvent(Ye.facetExclude,e)},e.prototype.logFacetExclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetExclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUnexclude=function(e){return this.makeSearchEvent(Ye.facetUnexclude,e)},e.prototype.logFacetUnexclude=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUnexclude(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetSelectAll=function(e){return this.makeSearchEvent(Ye.facetSelectAll,e)},e.prototype.logFacetSelectAll=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetSelectAll(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetUpdateSort=function(e){return this.makeSearchEvent(Ye.facetUpdateSort,e)},e.prototype.logFacetUpdateSort=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetUpdateSort(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowMore=function(e){return this.makeCustomEvent(Ye.facetShowMore,e)},e.prototype.logFacetShowMore=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowMore(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeFacetShowLess=function(e){return this.makeCustomEvent(Ye.facetShowLess,e)},e.prototype.logFacetShowLess=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFacetShowLess(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryError=function(e){return this.makeCustomEvent(Ye.queryError,e)},e.prototype.logQueryError=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryError(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorBack=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorBack)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorBack)]}}))}))}}]}}))}))},e.prototype.logQueryErrorBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorRetry)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorRetry)]}}))}))}}]}}))}))},e.prototype.logQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorRetry()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeQueryErrorClear=function(){return i(this,void 0,void 0,(function(){var e,t=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(Ye.queryErrorClear)];case 1:return[2,{description:(e=r.sent()).description,log:function(){return i(t,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.log({searchUID:this.provider.getSearchUID()})];case 1:return t.sent(),[2,this.logSearchEvent(Ye.queryErrorClear)]}}))}))}}]}}))}))},e.prototype.logQueryErrorClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryErrorClear()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(Ye.likeSmartSnippet)},e.prototype.logLikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeLikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(Ye.dislikeSmartSnippet)},e.prototype.logDislikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeDislikeSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(Ye.expandSmartSnippet)},e.prototype.logExpandSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeExpandSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(Ye.collapseSmartSnippet)},e.prototype.logCollapseSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCollapseSmartSnippet()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.openSmartSnippetFeedbackModal)},e.prototype.logOpenSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOpenSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Ye.closeSmartSnippetFeedbackModal)},e.prototype.logCloseSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCloseSmartSnippetFeedbackModal()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSmartSnippetFeedbackReason=function(e,t){return this.makeCustomEvent(Ye.sendSmartSnippetReason,{reason:e,details:t})},e.prototype.logSmartSnippetFeedbackReason=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logExpandSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeExpandSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCollapseSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},e.prototype.logCollapseSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCollapseSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showMoreSmartSnippetSuggestion,e)},e.prototype.logShowMoreSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowMoreSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessSmartSnippetSuggestion=function(e){return this.makeCustomEvent(Ye.showLessSmartSnippetSuggestion,e)},e.prototype.logShowLessSmartSnippetSuggestion=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowLessSmartSnippetSuggestion(e)];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSource,e,t)},e.prototype.logOpenSmartSnippetSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.makeCopyToClipboard=function(e,t){return this.makeClickEvent(Ye.copyToClipboard,e,t)},e.prototype.logCopyToClipboard=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCopyToClipboard(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)},e.prototype.logOpenSmartSnippetInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(Ye.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(Ye.recentQueryClick)},e.prototype.logRecentQueryClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeRecentQueryClick()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(Ye.clearRecentQueries)},e.prototype.logClearRecentQueries=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentQueries()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentResultClick=function(e,t){return this.makeCustomEvent(Ye.recentResultClick,{info:e,identifier:t})},e.prototype.logRecentResultClick=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeRecentResultClick(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(Ye.clearRecentResults)},e.prototype.logClearRecentResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeClearRecentResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(Ye.noResultsBack)},e.prototype.logNoResultsBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeNoResultsBack()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowMoreFoldedResults=function(e,t){return this.makeClickEvent(Ye.showMoreFoldedResults,e,t)},e.prototype.logShowMoreFoldedResults=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeShowMoreFoldedResults(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(Ye.showLessFoldedResults)},e.prototype.logShowLessFoldedResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowLessFoldedResults()];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeEventDescription=function(e,t){var r;return{actionCause:t,customData:null===(r=e.payload)||void 0===r?void 0:r.customData}},e.prototype.makeCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=n(n({},this.provider.getBaseMetadata()),t),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:r,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEvent=function(e,t,r){return void 0===r&&(r=ct[e]),i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){var o,i,a,c;return s(this,(function(s){switch(s.label){case 0:return o=n(n({},this.provider.getBaseMetadata()),r),a=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{eventType:t,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEventWithType=function(e,t,r){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEventWithType(e,t,r)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeSearchEvent(e,t)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(e,t)];case 1:return r=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(r)];case 2:return n=o.sent(),[2,{description:this.makeEventDescription(n,e),log:function(e){var t=e.searchUID;return n.log({searchQueryUid:t})}}]}}))}))},e.prototype.makeClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a,c;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:e}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return c=s.sent(),[2,{description:this.makeEventDescription(c,e),log:function(e){var t=e.searchUID;return c.log({searchQueryUid:t})}}]}}))}))},e.prototype.logClickEvent=function(e,t,r,n){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(e,t,r,n)];case 1:return[2,o.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n(n({},this.getOrigins()),this.getSplitTestRun())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e.prototype.getSplitTestRun=function(){var e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return n(n({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})},e}();!function(e){e.click="click",e.flowStart="flowStart"}(dt||(dt={})),function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.suggestionClick="suggestion_click",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"}(ft||(ft={})),function(e){e.quit="Quit",e.solved="Solved"}(vt||(vt={}));var mt=function(){function e(e,t){var r;this.options=e,this.provider=t;var n=(null===(r=e.enableAnalytics)||void 0===r||r)&&!_e();this.coveoAnalyticsClient=n?new ze(e):new ut,this.svc=new et({client:this.coveoAnalyticsClient})}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut,this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.options),this.svc=new et({client:this.coveoAnalyticsClient})},e.prototype.logEnterInterface=function(e){return this.svc.setAction(ft.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},e.prototype.logUpdateCaseField=function(e){return this.svc.setAction(ft.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(ft.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(ft.suggestionRate,n({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(ft.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCancelled=function(e){return this.svc.setAction(ft.caseCancelled,{reason:vt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseSolved=function(e){return this.svc.setAction(ft.caseSolved,{reason:vt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCreated=function(e){return this.svc.setAction(ft.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",dt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e}(),yt=function(e,t){void 0===t&&(t=!0),e.caseContext;var r=e.caseId,i=e.caseNumber,s=o(e,["caseContext","caseId","caseNumber"]),a=function(e){var t={};return e.caseContext&&Object.keys(e.caseContext).forEach((function(r){var n,o=null===(n=e.caseContext)||void 0===n?void 0:n[r];o&&(t["context_"+r]=o)})),t}(e);return n(n(n({CaseId:r,CaseNumber:i},s),!!a.context_Case_Subject&&{CaseSubject:a.context_Case_Subject}),t&&a)},St=function(){function e(e,t){this.opts=e,this.provider=t;var r=!1===e.enableAnalytics||_e();this.coveoAnalyticsClient=r?new ut:new ze(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof ze&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ut},e.prototype.enable=function(){this.coveoAnalyticsClient=new ze(this.opts)},e.prototype.logInterfaceLoad=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceLoad,t)}return this.logSearchEvent(Ye.interfaceLoad)},e.prototype.logInterfaceChange=function(e){var t=yt(e);return this.logSearchEvent(Ye.interfaceChange,t)},e.prototype.logStaticFilterDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.staticFilterDeselect,t)},e.prototype.logFetchMoreResults=function(e){if(e){var t=yt(e);return this.logCustomEvent(Ye.pagerScrolling,n(n({},t),{type:"getMoreResults"}))}return this.logCustomEvent(Ye.pagerScrolling,{type:"getMoreResults"})},e.prototype.logBreadcrumbFacet=function(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbFacet,t)},e.prototype.logBreadcrumbResetAll=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.breadcrumbResetAll,t)}return this.logSearchEvent(Ye.breadcrumbResetAll)},e.prototype.logFacetSelect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetSelect,t)},e.prototype.logFacetDeselect=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetDeselect,t)},e.prototype.logFacetUpdateSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetUpdateSort,t)},e.prototype.logFacetClearAll=function(e){var t=yt(e);return this.logSearchEvent(Ye.facetClearAll,t)},e.prototype.logFacetShowMore=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowMore,t)},e.prototype.logFacetShowLess=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.facetShowLess,t)},e.prototype.logQueryError=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.queryError,t)},e.prototype.logPagerNumber=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNumber,t)},e.prototype.logPagerNext=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerNext,t)},e.prototype.logPagerPrevious=function(e){var t=yt(e,!1);return this.logCustomEvent(Ye.pagerPrevious,t)},e.prototype.logDidYouMeanAutomatic=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanAutomatic,t)}return this.logSearchEvent(Ye.didyoumeanAutomatic)},e.prototype.logDidYouMeanClick=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.didyoumeanClick,t)}return this.logSearchEvent(Ye.didyoumeanClick)},e.prototype.logResultsSort=function(e){var t=yt(e);return this.logSearchEvent(Ye.resultsSort,t)},e.prototype.logSearchboxSubmit=function(e){if(e){var t=yt(e);return this.logSearchEvent(Ye.searchboxSubmit,t)}return this.logSearchEvent(Ye.searchboxSubmit)},e.prototype.logContextChanged=function(e){var t=yt(e);return this.logSearchEvent(Be.contextChanged,t)},e.prototype.logExpandToFullUI=function(e){var t=yt(e);return this.logCustomEvent(Be.expandToFullUI,t)},e.prototype.logOpenUserActions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.openUserActions,t)},e.prototype.logShowPrecedingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showPrecedingSessions,t)},e.prototype.logShowFollowingSessions=function(e){var t=yt(e,!1);return this.logCustomEvent(Be.showFollowingSessions,t)},e.prototype.logViewedDocumentClick=function(e,t){return this.logCustomEvent(Be.clickViewedDocument,n(n({},yt(t,!1)),{document:e}))},e.prototype.logPageViewClick=function(e,t){return this.logCustomEvent(Be.clickPageView,n(n({},yt(t,!1)),{pageView:e}))},e.prototype.logDocumentOpen=function(e,t,r){return this.logClickEvent(Ye.documentOpen,e,t,r?yt(r,!1):void 0)},e.prototype.logCopyToClipboard=function(e,t,r){return this.logClickEvent(Ye.copyToClipboard,e,t,r?yt(r,!1):void 0)},e.prototype.logDocumentQuickview=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl};return this.logClickEvent(Ye.documentQuickview,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseAttach=function(e,t,r){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl,resultUriHash:e.documentUriHash};return this.logClickEvent(Ye.caseAttach,e,t,r?n(n({},yt(r,!1)),o):o)},e.prototype.logCaseDetach=function(e,t){return this.logCustomEvent(Ye.caseDetach,t?n(n({},yt(t,!1)),{resultUriHash:e}):{resultUriHash:e})},e.prototype.logCustomEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(s){switch(s.label){case 0:return r=n(n({},this.provider.getBaseMetadata()),t),i=[{}],[4,this.getBaseCustomEventRequest(r)];case 1:return o=n.apply(void 0,[n.apply(void 0,i.concat([s.sent()])),{eventType:ct[e],eventValue:e}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return n=(r=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(e,t)];case 1:return[2,n.apply(r,[o.sent()])]}}))}))},e.prototype.logClickEvent=function(e,t,r,o){return i(this,void 0,void 0,(function(){var i,a;return s(this,(function(s){switch(s.label){case 0:return a=[n({},t)],[4,this.getBaseEventRequest(n(n({},r),o))];case 1:return i=n.apply(void 0,[n.apply(void 0,a.concat([s.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}]),[2,this.coveoAnalyticsClient.sendClickEvent(i)]}}))}))},e.prototype.getBaseCustomEventRequest=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,t.concat([r.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,n.apply(void 0,[n.apply(void 0,[n.apply(void 0,r.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:e}])]}}))}))},e.prototype.getBaseEventRequest=function(e){return i(this,void 0,void 0,(function(){var t,r,o;return s(this,(function(i){switch(i.label){case 0:return t=n(n({},this.provider.getBaseMetadata()),e),r=[n({},this.getOrigins())],o={customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,n.apply(void 0,r.concat([(o.clientId=i.sent(),o)]))]}}))}))},e.prototype.getOrigins=function(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},e.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e}(),kt=Object.freeze({__proto__:null,analytics:Ke,donottrack:qe,history:b,SimpleAnalytics:at,storage:k,CoveoAnalyticsClient:ze,CoveoUA:nt,getCurrentClient:it,handleOneAnalyticsEvent:st,CoveoSearchPageClient:gt,CaseAssistClient:mt,CoveoInsightClient:St});window.Promise instanceof Function||global||console.error('This script uses window.Promise which is not supported in your browser. Consider adding a polyfill like "es6-promise".'),window.fetch instanceof Function||global||console.error('This script uses window.fetch which is not supported in your browser. Consider adding a polyfill like "fetch".');var wt=self.coveoua||st;(self.coveoua=st,self.coveoanalytics=kt,wt.q)&&a(wt.q.filter((function(e){return"init"===e[0]})),wt.q.filter((function(e){return"init"!==e[0]}))).forEach((function(e){return st.apply(void 0,e)}));return self.coveoua}));
2
2
  //# sourceMappingURL=coveoua.js.map
@@ -1 +1 @@
1
- export declare const libVersion = "2.26.3";
1
+ export declare const libVersion = "2.26.4";
@@ -593,7 +593,7 @@ function sha1(bytes) {
593
593
  const v5 = v35('v5', 0x50, sha1);
594
594
  var uuidv5 = v5;
595
595
 
596
- const libVersion = "2.26.3" ;
596
+ const libVersion = "2.26.4" ;
597
597
 
598
598
  const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
599
599
 
package/dist/library.js CHANGED
@@ -740,7 +740,7 @@ function sha1(bytes) {
740
740
  const v5 = v35('v5', 0x50, sha1);
741
741
  var uuidv5 = v5;
742
742
 
743
- var libVersion = "2.26.3" ;
743
+ var libVersion = "2.26.4" ;
744
744
 
745
745
  var getFormattedLocation = function (location) {
746
746
  return location.protocol + "//" + location.hostname + (location.pathname.indexOf('/') === 0 ? location.pathname : "/" + location.pathname) + location.search;
@@ -655,7 +655,7 @@ const addPageViewToHistory = (pageViewValue) => __awaiter(void 0, void 0, void 0
655
655
  yield store.addElementAsync(historyElement);
656
656
  });
657
657
 
658
- const libVersion = "2.26.3" ;
658
+ const libVersion = "2.26.4" ;
659
659
 
660
660
  const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
661
661
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coveo.analytics",
3
- "version": "2.26.3",
3
+ "version": "2.26.4",
4
4
  "description": "📈 Coveo analytics client (node and browser compatible) ",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.es.js",