coveo.analytics 2.27.1 → 2.27.3

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.
package/README.md CHANGED
@@ -100,22 +100,19 @@ You should be able to observe the click event being transmitted to the Coveo bac
100
100
 
101
101
  ## Sending commerce specific events
102
102
 
103
- Commerce specific events such as product selections, shopping cart modifications and transactions are sent to Coveo in the compact [collect protocol](https://docs.coveo.com/en/l41i0031/build-a-search-ui/log-collect-events). Rather than explicitly assembling these payloads by hand, the eCommerce plugin provides apis to assemble and transmit the payloads. There are two event names that are specific to the eCommerce plugin:
103
+ Commerce specific events such as product selections, shopping cart modifications and transactions are sent to Coveo in the compact [collect protocol](https://docs.coveo.com/en/l41i0031/build-a-search-ui/log-collect-events). Rather than explicitly assembling these payloads by hand, the eCommerce plugin provides APIs to assemble and transmit the payloads. There are two event names that are specific to the eCommerce plugin:
104
104
 
105
- - `event`: A generic event, which has been assembled through different plugin actions.
105
+ - `event`: An event, which has been assembled through different plugin actions.
106
106
  - `pageview`: An ecommerce specific pageview event which is automatically populated with the current page context.
107
107
 
108
- See the [Send an Event](https://docs.coveo.com/en/l3am0254/coveo-for-commerce/send-an-event) page for more information on the expected payloads for both of these.
108
+ The eCommerce plugin supports adding product data (`ec:addProduct`) as well as setting the [appropriate event action](https://docs.coveo.com/en/l29e0540/coveo-for-commerce/commerce-events-reference#product-action-type-reference) through `ec:setAction`. These calls can be used in series to assemble different types of payloads:
109
109
 
110
- The eCommerce plugin supports adding product data (`ec:addProduct`), product impression data (`ec:addImpression`) as well as setting the [appropriate event action](https://docs.coveo.com/en/l29e0540/coveo-for-commerce/commerce-events-reference#product-action-type-reference) through `ec:setAction`. These calls can be used in series to assemble different types of payloads:
111
-
112
- - A [product detail view](https://docs.coveo.com/en/3188/coveo-for-commerce/commerce-data-health-implementation-guide#measuring-a-product-details-view)
113
- - An [addition to the cart](https://docs.coveo.com/en/l3jg0266/coveo-for-commerce/measure-cart-page-events#measure-an-increase-in-item-quantity-in-cart)
114
- - A [removal from the cart](https://docs.coveo.com/en/l3jg0266/coveo-for-commerce/measure-cart-page-events#measure-a-decrease-in-item-quantity-in-cart)
110
+ - A [product detail view](https://docs.coveo.com/en/l2pd0522)
111
+ - [Cart modification events](https://docs.coveo.com/en/n39h1594/)
115
112
  - A [cart purchase](https://docs.coveo.com/en/l39m0327/coveo-for-commerce/measure-a-purchase)
116
113
  - An [event on a search-driven listing-page](https://docs.coveo.com/en/l41a1037/coveo-for-commerce/measure-events-on-a-listing-or-search-page)
117
114
 
118
- As a sample, here is how an [addition to the cart interaction](https://docs.coveo.com/en/l3jg0266/coveo-for-commerce/measure-cart-page-events#measure-an-increase-in-item-quantity-in-cart) is measured:
115
+ As a sample, here is how a [cart modification event](https://docs.coveo.com/en/l3jg0266/coveo-for-commerce/measure-cart-page-events#measure-an-increase-in-item-quantity-in-cart) is assembled:
119
116
 
120
117
  1. First use the `ec:addProduct` action to include the [relevant product data](https://docs.coveo.com/en/l29e0540/coveo-for-commerce/commerce-events-reference#product-data-fields-reference) in the event you’re about to send
121
118
  ```js
@@ -1,2 +1,2 @@
1
- var coveoua=function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(t,s)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function c(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function a(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(t){return!1}}function p(){return a()&&navigator.cookieEnabled}!function(t){t.search="search",t.click="click",t.custom="custom",t.view="view",t.collect="collect"}(n||(n={}));var h=[n.click,n.custom,n.search,n.view],d=function(t,e){return-1!==h.indexOf(t)?r({language:u()?document.documentElement.lang:"unknown",userAgent:a()?navigator.userAgent:"unknown"},e):e},v=function(){function t(){}return t.set=function(t,e,n){var r,o,i;n&&(r=new Date).setTime(r.getTime()+n),-1===(i=window.location.hostname).indexOf(".")?f(t,e,r):f(t,e,r,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},t.get=function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];if(0===(o=o.replace(/^\s+/,"")).lastIndexOf(e,0))return o.substring(e.length,o.length)}return null},t.erase=function(e){t.set(e,"",-1)},t}();function f(t,e,n,r){document.cookie="".concat(t,"=").concat(e)+(n?";expires=".concat(n.toUTCString()):"")+(r?";domain=".concat(r):"")+";SameSite=Lax"}function g(){return l()?localStorage:p()?new m:function(){try{return"undefined"!=typeof sessionStorage}catch(t){return!1}}()?sessionStorage:new S}var m=function(){function t(){}return t.prototype.getItem=function(e){return v.get("".concat(t.prefix).concat(e))},t.prototype.removeItem=function(e){v.erase("".concat(t.prefix).concat(e))},t.prototype.setItem=function(e,n,r){v.set("".concat(t.prefix).concat(e),n,r)},t.prefix="coveo_",t}(),y=function(){function t(){this.cookieStorage=new m}return t.prototype.getItem=function(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)},t.prototype.removeItem=function(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)},t.prototype.setItem=function(t,e){localStorage.setItem(t,e),this.cookieStorage.setItem(t,e,31556926e3)},t}(),S=function(){function t(){}return t.prototype.getItem=function(t){return null},t.prototype.removeItem=function(t){},t.prototype.setItem=function(t,e){},t}(),k=Object.freeze({__proto__:null,CookieAndLocalStorage:y,CookieStorage:m,NullStorage:S,getAvailableStorage:g,preferredStorage:null}),w="__coveo.analytics.history",I=function(){function t(t){this.store=t||g()}return t.prototype.addElement=function(t){t.internalTime=(new Date).getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));var e=this.getHistoryWithInternalTime();null!=e?this.isValidEntry(t)&&this.setHistory([t].concat(e)):this.setHistory([t])},t.prototype.addElementAsync=function(t){return i(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return t.internalTime=(new Date).getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(e=n.sent())?this.isValidEntry(t)&&this.setHistory([t].concat(e)):this.setHistory([t]),[2]}}))}))},t.prototype.getHistory=function(){var t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))},t.prototype.getHistoryAsync=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return t=e.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(t))]}}))}))},t.prototype.getHistoryWithInternalTime=function(){try{var t=this.store.getItem(w);return t&&"string"==typeof t?JSON.parse(t):[]}catch(t){return[]}},t.prototype.getHistoryWithInternalTimeAsync=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.store.getItem(w)];case 1:return(t=e.sent())?[2,JSON.parse(t)]:[2,[]];case 2:return e.sent(),[2,[]];case 3:return[2]}}))}))},t.prototype.setHistory=function(t){try{this.store.setItem(w,JSON.stringify(t.slice(0,20)))}catch(t){}},t.prototype.clear=function(){try{this.store.removeItem(w)}catch(t){}},t.prototype.getMostRecentElement=function(){var t=this.getHistoryWithInternalTime();return null!=t?t.sort((function(t,e){return(e.internalTime||0)-(t.internalTime||0)}))[0]:null},t.prototype.cropQueryElement=function(t){return t.name&&t.value&&"query"===t.name.toLowerCase()&&(t.value=t.value.slice(0,75)),t},t.prototype.isValidEntry=function(t){var e=this.getMostRecentElement();return!e||e.value!=t.value||(t.internalTime||0)-(e.internalTime||0)>6e4},t.prototype.stripInternalTime=function(t){return t.map((function(t){return{name:t.name,time:t.time,value:t.value}}))},t.prototype.stripEmptyQuery=function(t){var e=t.name,n=t.time,r=t.value;return e&&"string"==typeof r&&"query"===e.toLowerCase()&&""===r.trim()?{name:e,time:n}:t},t.prototype.stripEmptyQueries=function(t){var e=this;return t.map((function(t){return e.stripEmptyQuery(t)}))},t}(),b=Object.freeze({__proto__:null,HistoryStore:I,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MAX_VALUE_SIZE:75,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,STORE_KEY:w,default:I}),E=function(t,e){return i(void 0,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return t!==n.view?[3,2]:[4,C(e.contentIdValue)];case 1:return o.sent(),[2,r({location:window.location.toString(),referrer:document.referrer,title:document.title},e)];case 2:return[2,e]}}))}))},C=function(t){return i(void 0,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return e=new I,n={name:"PageView",value:t,time:JSON.stringify(new Date)},[4,e.addElementAsync(n)];case 1:return r.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(t){return"string"==typeof t&&A.test(t)}const F=[];for(let t=0;t<256;++t)F.push((t+256).toString(16).slice(1));function x(t,e=0){return(F[t[e+0]]+F[t[e+1]]+F[t[e+2]]+F[t[e+3]]+"-"+F[t[e+4]]+F[t[e+5]]+"-"+F[t[e+6]]+F[t[e+7]]+"-"+F[t[e+8]]+F[t[e+9]]+"-"+F[t[e+10]]+F[t[e+11]]+F[t[e+12]]+F[t[e+13]]+F[t[e+14]]+F[t[e+15]]).toLowerCase()}var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(t,e,n){if(T.randomUUID&&!e&&!t)return T.randomUUID();const r=(t=t||{}).random||(t.rng||R)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return x(r)}function O(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function V(t,e){return t<<e|t>>>32-e}var M=function(t,e,n){function r(t,r,o,i){var s;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=function(t){if(!P(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+t.length);if(c.set(r),c.set(t,r.length),c=n(c),c[6]=15&c[6]|e,c[8]=63&c[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=c[t];return o}return x(c)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=V(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],s=n[1],c=n[2],a=n[3],u=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=V(o,5)+O(n,s,c,a)+u+e[n]+r[t]>>>0;u=a,a=c,c=V(s,30)>>>0,s=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+s>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+a>>>0,n[4]=n[4]+u>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),q="2.27.1",_=function(t){return"".concat(t.protocol,"//").concat(t.hostname).concat(0===t.pathname.indexOf("/")?t.pathname:"/".concat(t.pathname)).concat(t.search)},N={pageview:"pageview",event:"event"},Q=function(t){var e=t.client,n=t.uuidGenerator,r=void 0===n?L:n;this.client=e,this.uuidGenerator=r},H=function(t){function n(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r,i=t.call(this,{client:n,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=_(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return e(n,t),n.prototype.getApi=function(t){return"setAction"===t?this.setAction:null},n.prototype.setAction=function(t,e){this.action=t,this.actionData=e},n.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},n.prototype.getLocationInformation=function(t,e){return r({hitType:t},this.getNextValues(t,e))},n.prototype.updateLocationInformation=function(t,e){this.updateLocationForNextPageView(t,e)},n.prototype.getDefaultContextInformation=function(t){var e={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},n={screenResolution:"".concat(screen.width,"x").concat(screen.height),screenColor:"".concat(screen.colorDepth,"-bit")},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return r(r(r(r({},i),n),o),e)},n.prototype.updateLocationForNextPageView=function(t,e){var n=this.getNextValues(t,e),r=n.pageViewId,o=n.referrer,i=n.location;this.lastReferrer=o,this.pageViewId=r,this.currentLocation=i,t===N.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},n.prototype.getNextValues=function(t,e){return{pageViewId:t===N.pageview?this.nextPageViewId:this.pageViewId,referrer:t===N.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===N.pageview?this.getCurrentLocationFromPayload(e):this.currentLocation}},n.prototype.getCurrentLocationFromPayload=function(t){if(t.page){return"".concat((e=this.currentLocation,e.split("/").slice(0,3).join("/"))).concat(t.page.replace(/^\/?(.*)$/,"/$1"))}return _(window.location);var e},n}(Q),B=function(){function t(t,e){if(!P(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(e/1e3)}return t.prototype.toString=function(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()},Object.defineProperty(t.prototype,"expired",{get:function(){var e=Math.floor(Date.now()/1e3)-this.creationDate;return e<0||e>t.expirationTime},enumerable:!1,configurable:!0}),t.prototype.validate=function(t,e){return!this.expired&&this.matchReferrer(t,e)},t.prototype.matchReferrer=function(t,e){try{var n=new URL(t);return e.some((function(t){return new RegExp(t.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host)}))}catch(t){return!1}},t.fromString=function(e){var n=e.split(".");if(2!==n.length)return null;var r=n[0],o=n[1];if(32!==r.length||isNaN(parseInt(o)))return null;var i=r.substring(0,8)+"-"+r.substring(8,12)+"-"+r.substring(12,16)+"-"+r.substring(16,20)+"-"+r.substring(20,32);return P(i)?new t(i,1e3*Number.parseInt(o)):null},t.cvo_cid="cvo_cid",t.expirationTime=120,t}(),j=function(t){function n(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r;return t.call(this,{client:n,uuidGenerator:o})||this}return e(n,t),n.prototype.getApi=function(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},n.prototype.decorate=function(t){return i(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");r.label=1;case 1:return r.trys.push([1,3,,4]),e=new URL(t),[4,this.client.getCurrentVisitorId()];case 2:return n=r.sent(),e.searchParams.set(B.cvo_cid,new B(n,Date.now()).toString()),[2,e.toString()];case 3:throw r.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},n.prototype.acceptFrom=function(t){this.client.setAcceptedLinkReferrers(t)},n.Id="link",n}(Q),Y=j,K=Object.keys;function z(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function W(t){return"string"!=typeof t||""==t||Number.isNaN(+t)?t:+t}var G={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"},$=c([],K(G).map((function(t){return G[t]})),!0).join("|"),J=new RegExp("^(".concat($,"$)")),X=[function(t){return J.test(t)}],Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},tt={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},nt={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},rt={id:"quoteId",affiliation:"quoteAffiliation"},ot={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},it={add:et,bookmark_add:et,bookmark_remove:et,click:et,checkout:et,checkout_option:et,detail:et,impression:et,remove:et,refund:r(r({},et),nt),purchase:r(r({},et),nt),quickview:et,quote:r(r({},et),rt),review:r(r({},et),ot)},st=function(t,e,n,o){return K(t).reduce((function(i,s){var c,a="il".concat(e+1).concat(o).concat(n+1).concat(tt[s]||s);return r(r({},i),((c={})[a]=t[s],c))}),{})},ct=K(Z).map((function(t){return Z[t]})),at=K(tt).map((function(t){return tt[t]})),ut=K(et).map((function(t){return et[t]})),lt=K(nt).map((function(t){return nt[t]})),pt=K(ot).map((function(t){return ot[t]})),ht=K(rt).map((function(t){return rt[t]})),dt=c(c([],ct,!0),["custom"],!1).join("|"),vt=c(c([],at,!0),["custom"],!1).join("|"),ft="(pr[0-9]+)",gt="(il[0-9]+pi[0-9]+)",mt=new RegExp("^".concat(ft,"(").concat(dt,")$")),yt=new RegExp("^(".concat(gt,"(").concat(vt,"))|(il[0-9]+nm)$")),St=new RegExp("^(".concat(ut.join("|"),")$")),kt=new RegExp("^(".concat(lt.join("|"),")$")),wt=new RegExp("^".concat(ft,"custom$")),It=new RegExp("^".concat(gt,"custom$")),bt=new RegExp("^(".concat(c(c(c([],["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],!0),pt,!0),ht,!0).join("|"),")$")),Et=[function(t){return yt.test(t)},function(t){return mt.test(t)},function(t){return St.test(t)},function(t){return kt.test(t)},function(t){return bt.test(t)}],Ct=[wt,It],Dt=r(r(r(r({},{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(t,e){var n;return r(r({},t),((n={})[e]=e,n))}),{})),Ut=r(r({},Dt),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Rt=K(Ut).map((function(t){return Ut[t]})),At=function(t){return-1!==Rt.indexOf(t)},Pt=function(t){return"custom"===t},Ft=function(t){var e=void 0;return c([],Ct,!0).every((function(n){var r;return e=null===(r=n.exec(t))||void 0===r?void 0:r[1],!Boolean(e)})),e},xt=function(t,e){return K(e).reduce((function(n,o){var i;return r(r({},n),((i={})["".concat(t).concat(o)]=e[o],i))}),{})},Tt=function(){function t(t){this.opts=t}return t.prototype.sendEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,o,i,c,a,u,l,p,h,d,v;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 n=this.opts,o=n.baseUrl,i=n.preprocessRequest,c=this.encodeForEventType(t,e),[4,this.getQueryParamsForEventType(t)];case 1:return a=s.sent(),u={url:"".concat(o,"/analytics/").concat(t,"?").concat(a),body:new Blob([c],{type:"application/x-www-form-urlencoded"})},d=[r({},u)],i?[4,i(u,"analyticsBeacon")]:[3,3];case 2:return v=s.sent(),[3,4];case 3:v={},s.label=4;case 4:return l=r.apply(void 0,d.concat([v])),p=l.url,h=l.body,console.log('Sending beacon for "'.concat(t,'" with: '),JSON.stringify(e)),navigator.sendBeacon(p,h),[2]}}))}))},t.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},t.prototype.encodeForEventType=function(t,e){return this.isEventTypeLegacy(t)?this.encodeForLegacyType(t,e):this.encodeForFormUrlEncoded(r({access_token:this.opts.token},e))},t.prototype.getQueryParamsForEventType=function(t){return i(this,void 0,void 0,(function(){var e,n,r;return s(this,(function(o){switch(o.label){case 0:return e=this.opts,n=e.token,[4,e.visitorIdProvider.getCurrentVisitorId()];case 1:return r=o.sent(),[2,[n&&this.isEventTypeLegacy(t)?"access_token=".concat(n):"",r?"visitorId=".concat(r):"","discardVisitInfo=true"].filter((function(t){return!!t})).join("&")]}}))}))},t.prototype.isEventTypeLegacy=function(t){return-1!==[n.click,n.custom,n.search,n.view].indexOf(t)},t.prototype.encodeForLegacyType=function(t,e){return"".concat(t,"Event=").concat(encodeURIComponent(JSON.stringify(e)))},t.prototype.encodeForFormUrlEncoded=function(t){var e=this;return Object.keys(t).filter((function(e){return!!t[e]})).map((function(n){return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(e.encodeValue(t[n])))})).join("&")},t.prototype.encodeValue=function(t){return"number"==typeof t||"string"==typeof t||"boolean"==typeof t?t:JSON.stringify(t)},t}(),Lt=function(){function t(){}return t.prototype.sendEvent=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,Promise.resolve()]}))}))},t.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,Promise.resolve()]}))}))},t}(),Ot=window.fetch,Vt=function(){function t(t){this.opts=t}return t.prototype.sendEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,i,c,a,u,l,p,h,d,v,f,g,m,y;return s(this,(function(s){switch(s.label){case 0:return n=this.opts,i=n.baseUrl,c=n.visitorIdProvider,a=n.preprocessRequest,this.shouldAppendVisitorId(t)?[4,this.getVisitorIdParam()]:[3,2];case 1:return l=s.sent(),[3,3];case 2:l="",s.label=3;case 3:return u=l,p={url:"".concat(i,"/analytics/").concat(t).concat(u),credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(e)},f=[r({},p)],a?[4,a(p,"analyticsFetch")]:[3,5];case 4:return g=s.sent(),[3,6];case 5:g={},s.label=6;case 6:return h=r.apply(void 0,f.concat([g])),d=h.url,v=o(h,["url"]),[4,Ot(d,v)];case 7:return(m=s.sent()).ok?[4,m.json()]:[3,9];case 8:return(y=s.sent()).visitorId&&c.setCurrentVisitorId(y.visitorId),[2,y];case 9:try{m.json()}catch(t){}throw console.error('An error has occured when sending the "'.concat(t,'" event.'),m,e),new Error('An error has occurred when sending the "'.concat(t,'" event. Check the console logs for more details.'))}}))}))},t.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return t=this.opts.baseUrl,e="".concat(t,"/analytics/visit"),[4,Ot(e,{headers:this.getHeaders(),method:"DELETE"})];case 1:return n.sent(),[2]}}))}))},t.prototype.shouldAppendVisitorId=function(t){return-1!==[n.click,n.custom,n.search,n.view].indexOf(t)},t.prototype.getVisitorIdParam=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(t=e.sent())?"?visitor=".concat(t):""]}}))}))},t.prototype.getHeaders=function(){var t=this.opts.token;return r(r({},t?{Authorization:"Bearer ".concat(t)}:{}),{"Content-Type":"application/json"})},t}(),Mt=function(t,e){var n=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 Vt(t),this.beaconClient=new Tt(t),window.addEventListener("beforeunload",(function(){for(var t=0,r=e();t<r.length;t++){var o=r[t],i=o.eventType,s=o.payload;n.beaconClient.sendEvent(i,s)}}))},qt=function(t,e){this.storage=e||new S,this.client=new Vt(t)},_t=function(){this.storage=new S,this.client=new Lt};var Nt=["1",1,"yes",!0];function Qt(){return a()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(t){return-1!==Nt.indexOf(t)}))}var Ht=Object.freeze({__proto__:null,default:Qt,doNotTrack:Qt}),Bt="v15",jt={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 Yt(t,e){void 0===t&&(t=jt.default),void 0===e&&(e=Bt);var n=-1!==t.indexOf(".cloud.coveo.com");return"".concat(t).concat(n?"":"/rest","/").concat(e)}var Kt,zt,Wt,Gt=function(){function t(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=r(r({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[E,d].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};var e={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(e),Qt()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return{endpoint:jt.default,token:"",version:Bt,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return q},enumerable:!1,configurable:!0}),t.prototype.initRuntime=function(t){var e=this;return"undefined"!=typeof window&&u()?new Mt(t,(function(){var t=c([],e.bufferedRequests,!0);return e.bufferedRequests=[],t})):("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 qt(t))},Object.defineProperty(t.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),t.prototype.determineVisitorId=function(){return i(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),(t=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:t=n.sent(),n.label=2;case 2:return[2,t||L()];case 3:return e=n.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",e),[2,L()];case 4:return[2]}}))}))},t.prototype.getCurrentVisitorId=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return t=e.sent(),[4,this.setCurrentVisitorId(t)];case 2:e.sent(),e.label=3;case 3:return[2,this.visitorId]}}))}))},t.prototype.setCurrentVisitorId=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.visitorId=t,[4,this.storage.setItem("visitorId",t)];case 1:return e.sent(),[2]}}))}))},t.prototype.setClientId=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){if(P(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!e)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(M(t,M(e,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}return[2]}))}))},t.prototype.getParameters=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,c([t],e,!1))];case 1:return[2,n.sent()]}}))}))},t.prototype.getPayload=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,c([t],e,!1))];case 1:return n=r.sent(),[4,this.resolvePayloadForParameters(t,n)];case 2:return[2,r.sent()]}}))}))},Object.defineProperty(t.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(L()),this.visitorId},set:function(t){this.visitorId=t,this.storage.setItem("visitorId",t)},enumerable:!1,configurable:!0}),t.prototype.extractClientIdFromLink=function(t){if(Qt())return null;try{var e=new URL(t).searchParams.get(B.cvo_cid);if(null==e)return null;var n=B.fromString(e);return n&&u()&&n.validate(document.referrer,this.acceptedLinkReferrers)?n.clientId:null}catch(t){}return null},t.prototype.resolveParameters=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,c,a,u,l,p,h,d,v,f,g,m=this;return s(this,(function(y){switch(y.label){case 0:return n=this.eventTypeMapping[t]||{},o=n.variableLengthArgumentsNames,c=void 0===o?[]:o,a=n.addVisitorIdParameter,u=void 0!==a&&a,l=n.usesMeasurementProtocol,p=void 0!==l&&l,h=n.addClientIdParameter,d=void 0!==h&&h,v=function(t){return i(m,void 0,void 0,(function(){var e,n,o;return s(this,(function(i){switch(i.label){case 0:return e=[r({},t)],o={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n="",i.label=3;case 3:return[2,r.apply(void 0,e.concat([(o.visitorId=n,o)]))]}}))}))},f=function(t){return i(m,void 0,void 0,(function(){var e,n;return s(this,(function(o){switch(o.label){case 0:return d?(e=[r({},t)],n={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,r.apply(void 0,e.concat([(n.clientId=o.sent(),n)]))];case 2:return[2,t]}}))}))},g=function(e){return m.beforeSendHooks.reduce((function(e,n){return i(m,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return[4,e];case 1:return r=o.sent(),[4,n(t,r)];case 2:return[2,o.sent()]}}))}))}),e)},[4,[function(t){return c.length>0?m.parseVariableArgumentsPayload(c,t):t[0]},v,f,function(t){return p?m.ensureAnonymousUserWhenUsingApiKey(t):t},g].reduce((function(t,e){return i(m,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),[4,e(n)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve(e))];case 1:return[2,y.sent()]}}))}))},t.prototype.resolvePayloadForParameters=function(t,e){return i(this,void 0,void 0,(function(){var n,o,c,a=this;return s(this,(function(u){switch(u.label){case 0:return n=(this.eventTypeMapping[t]||{}).usesMeasurementProtocol,o=void 0!==n&&n,c=function(t){return o?(n=!!(e=t).action&&it[e.action]||{},K(e).reduce((function(t,o){var i,s=n[o]||Ut[o]||o;return r(r({},t),((i={})[s]=e[o],i))}),{})):t;var e,n},[4,[function(e){return a.removeEmptyPayloadValues(e,t)},function(e){return a.validateParams(e,t)},c,function(t){return o?a.removeUnknownParameters(t):t},function(t){return o?a.processCustomParameters(t):a.mapCustomParametersToCustomData(t)}].reduce((function(t,e){return i(a,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),[4,e(n)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve(e))];case 1:return[2,u.sent()]}}))}))},t.prototype.makeEvent=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,a,u,l=this;return s(this,(function(p){switch(p.label){case 0:return n=(this.eventTypeMapping[t]||{}).newEventType,o=void 0===n?t:n,[4,this.resolveParameters.apply(this,c([t],e,!1))];case 1:return a=p.sent(),[4,this.resolvePayloadForParameters(t,a)];case 2:return u=p.sent(),[2,{eventType:o,payload:u,log:function(e){return i(l,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this.bufferedRequests.push({eventType:o,payload:r(r({},u),e)}),[4,Promise.all(this.afterSendHooks.map((function(n){return n(t,r(r({},a),e))})))];case 1:return n.sent(),[4,this.deferExecution()];case 2:return n.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,n.sent()]}}))}))}}]}}))}))},t.prototype.sendEvent=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeEvent.apply(this,c([t],e,!1))];case 1:return[2,n.sent().log({})]}}))}))},t.prototype.deferExecution=function(){return new Promise((function(t){return setTimeout(t,0)}))},t.prototype.sendFromBufferWithFetch=function(){return i(this,void 0,void 0,(function(){var t,e,n;return s(this,(function(r){return(t=this.bufferedRequests.shift())?(e=t.eventType,n=t.payload,[2,this.runtime.client.sendEvent(e,n)]):[2]}))}))},t.prototype.clear=function(){this.storage.removeItem("visitorId"),(new I).clear()},t.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},t.prototype.makeSearchEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.search,t)]}))}))},t.prototype.sendSearchEvent=function(t){var e=t.searchQueryUid,n=o(t,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchEvent(n)];case 1:return[2,t.sent().log({searchQueryUid:e})]}}))}))},t.prototype.makeClickEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.click,t)]}))}))},t.prototype.sendClickEvent=function(t){var e=t.searchQueryUid,n=o(t,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeClickEvent(n)];case 1:return[2,t.sent().log({searchQueryUid:e})]}}))}))},t.prototype.makeCustomEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.custom,t)]}))}))},t.prototype.sendCustomEvent=function(t){var e=t.lastSearchQueryUid,n=o(t,["lastSearchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCustomEvent(n)];case 1:return[2,t.sent().log({lastSearchQueryUid:e})]}}))}))},t.prototype.makeViewEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.view,t)]}))}))},t.prototype.sendViewEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeViewEvent(t)];case 1:return[2,e.sent().log({})]}}))}))},t.prototype.getVisit=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,fetch("".concat(this.baseUrl,"/analytics/visit"))];case 1:return[4,e.sent().json()];case 2:return t=e.sent(),this.visitorId=t.visitorId,[2,t]}}))}))},t.prototype.getHealth=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(this.baseUrl,"/analytics/monitoring/health"))];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()]}}))}))},t.prototype.registerBeforeSendEventHook=function(t){this.beforeSendHooks.push(t)},t.prototype.registerAfterSendEventHook=function(t){this.afterSendHooks.push(t)},t.prototype.addEventTypeMapping=function(t,e){this.eventTypeMapping[t]=e},t.prototype.setAcceptedLinkReferrers=function(t){if(!Array.isArray(t)||!t.every((function(t){return"string"==typeof t})))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=t},t.prototype.parseVariableArgumentsPayload=function(t,e){for(var n={},o=0,i=e.length;o<i;o++){var s=e[o];if("string"==typeof s)n[t[o]]=s;else if("object"==typeof s)return r(r({},n),s)}return n},t.prototype.isKeyAllowedEmpty=function(t,e){var r;return-1!==(((r={})[n.search]=["queryText"],r)[t]||[]).indexOf(e)},t.prototype.removeEmptyPayloadValues=function(t,e){var n=this;return Object.keys(t).filter((function(r){return n.isKeyAllowedEmpty(e,r)||null!=(o=t[r])&&""!==o;var o})).reduce((function(e,n){var o;return r(r({},e),((o={})[n]=t[n],o))}),{})},t.prototype.removeUnknownParameters=function(t){var e=Object.keys(t).filter((function(t){if(function(t){return c(c(c([],Et,!0),X,!0),[At,Pt],!1).some((function(e){return e(t)}))}(t))return!0;console.log(t,"is not processed by coveoua")})).reduce((function(e,n){var o;return r(r({},e),((o={})[n]=t[n],o))}),{});return e},t.prototype.processCustomParameters=function(t){var e=t.custom,n=o(t,["custom"]),i={};e&&z(e)&&(i=this.lowercaseKeys(e));var s,c=K(s=n).reduce((function(t,e){var n,o=Ft(e);return r(r({},t),o?xt(o,s[e]):((n={})[e]=s[e],n))}),{});return r(r({},i),c)},t.prototype.mapCustomParametersToCustomData=function(t){var e=t.custom,n=o(t,["custom"]);if(e&&z(e)){var i=this.lowercaseKeys(e);return r(r({},n),{customData:r(r({},i),t.customData)})}return t},t.prototype.lowercaseKeys=function(t){var e=Object.keys(t),n={};return e.forEach((function(e){n[e.toLowerCase()]=t[e]})),n},t.prototype.validateParams=function(t,e){var r=t.anonymizeIp,i=o(t,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf("".concat(r).toLowerCase())&&(i.anonymizeIp=1),e!=n.view&&e!=n.click&&e!=n.search&&e!=n.custom||(i.originLevel3=this.limit(i.originLevel3,128)),e==n.view&&(i.location=this.limit(i.location,128)),"pageview"!=e&&"event"!=e||(i.referrer=this.limit(i.referrer,2048),i.location=this.limit(i.location,2048),i.page=this.limit(i.page,2048)),i},t.prototype.ensureAnonymousUserWhenUsingApiKey=function(t){var e,n=t.userId,r=o(t,["userId"]);return(null==(e=this.options.token)?void 0:e.startsWith("xx"))&&!n?(r.userId="anonymous",r):t},t.prototype.limit=function(t,e){return"string"!=typeof t?t:t.substring(0,e)},Object.defineProperty(t.prototype,"baseUrl",{get:function(){return Yt(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),t}(),$t=Object.freeze({__proto__:null,CoveoAnalyticsClient:Gt,Endpoints:jt,Version:Bt,buildBaseUrl:Yt,default:Gt}),Jt=r({},N),Xt=Object.keys(Jt).map((function(t){return Jt[t]})),Zt=function(t){function i(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r,i=t.call(this,{client:n,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return e(i,t),i.prototype.getApi=function(e){var n=t.prototype.getApi.call(this,e);if(null!==n)return n;switch(e){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(t){this.products.push(t)},i.prototype.addImpression=function(t){this.impressions.push(t)},i.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},i.prototype.addHooksForECEvents=function(){var t=this;this.client.registerBeforeSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xt.indexOf(e)?t.addECDataToPayload(e,o):o})),this.client.registerAfterSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xt.indexOf(e)&&t.updateLocationInformation(e,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Jt.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Jt.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(t,e){var n=r(r(r(r({},this.getLocationInformation(t,e)),this.getDefaultContextInformation(t)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),r(r(r(r({},i),o),n),e)},i.prototype.getProductPayload=function(){var t=this;return this.products.map((function(e){return t.assureProductValidity(e)})).reduce((function(e,n,o){return r(r({},e),function(t,e){return K(t).reduce((function(n,o){var i,s="pr".concat(e+1).concat(Z[o]||o);return r(r({},n),((i={})[s]=t[o],i))}),{})}(t.convertNumberTypes(n),o))}),{})},i.prototype.convertNumberTypes=function(t){var e=r({},t);return"quantity"in e&&(e.quantity=W(e.quantity)),"position"in e&&(e.position=W(e.position)),e},i.prototype.getImpressionPayload=function(){var t=this;return this.getImpressionsByList().map((function(e){var n=e.impressions,i=o(e,["impressions"]);return r(r({},i),{impressions:n.map((function(e){return t.assureBaseImpressionValidity(e)}))})})).reduce((function(t,e,n){return r(r({},t),function(t,e,n){var o=t.impressions.reduce((function(t,o,i){return r(r({},t),st(o,e,i,n))}),{});return t.listName&&(o["il".concat(e+1,"nm")]=t.listName),o}(e,n,"pi"))}),{})},i.prototype.assureProductValidity=function(t){var e=t.position,n=o(t,["position"]);return void 0!==e&&e<1?(console.warn("The position for product '".concat(t.name||t.id,"' must be greater ")+"than 0 when provided."),n):t},i.prototype.assureBaseImpressionValidity=function(t){var e=t.position,n=o(t,["position"]);return void 0!==e&&e<1?(console.warn("The position for impression '".concat(t.name||t.id,"'")+" must be greater than 0 when provided."),n):t},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(t,e){var n=e.list,r=o(e,["list"]),i=t.find((function(t){return t.listName===n}));return i?i.impressions.push(r):t.push({listName:n,impressions:[r]}),t}),[])},i.Id="ec",i}(H),te=Zt,ee=r({},N),ne=Object.keys(ee).map((function(t){return ee[t]})),re=function(t){function o(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r,i=t.call(this,{client:n,uuidGenerator:o})||this;return i.ticket={},i}return e(o,t),o.prototype.getApi=function(e){var n=t.prototype.getApi.call(this,e);return null!==n?n:"setTicket"===e?this.setTicket:null},o.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},o.prototype.setTicket=function(t){this.ticket=t},o.prototype.clearPluginData=function(){this.ticket={}},o.prototype.addHooksForSVCEvents=function(){var t=this;this.client.registerBeforeSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==ne.indexOf(e)?t.addSVCDataToPayload(e,o):o})),this.client.registerAfterSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==ne.indexOf(e)&&t.updateLocationInformation(e,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(ee.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(ee.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(t,e){var n,o=r(r(r(r({},this.getLocationInformation(t,e)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(n=this.actionData)&&void 0!==n?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),r(r(r({},i),o),e)},o.prototype.getTicketPayload=function(){return t=this.ticket,K(t).filter((function(e){return void 0!==t[e]})).reduce((function(e,n){var o,i=G[n]||n;return r(r({},e),((o={})[i]=t[n],o))}),{});var t},o.Id="svc",o}(H),oe=re,ie=function(){function t(){var t;this.registeredPluginsMap=((t={})[te.Id]=te,t[oe.Id]=oe,t[Y.Id]=Y,t),this.requiredPlugins={}}return t.prototype.require=function(t,e){var n=this.registeredPluginsMap[t];if(!n)throw new Error('No plugin named "'.concat(t,"\" is currently registered. If you use a custom plugin, use 'provide' first."));this.requiredPlugins[t]=new n(e)},t.prototype.provide=function(t,e){this.registeredPluginsMap[t]=e},t.prototype.clearRequired=function(){this.requiredPlugins={}},t.prototype.execute=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.requiredPlugins[t];if(!o)throw new Error('The plugin "'.concat(t,'" is not required. Check that you required it on initialization.'));var i=o.getApi(e);if(!i)throw new Error('The function "'.concat(e,'" does not exist on the plugin "').concat(t,'".'));if("function"!=typeof i)throw new Error('"'.concat(e,'" of the plugin "').concat(t,'" is not a function.'));return i.apply(o,n)},t.DefaultPlugins=[te.Id,oe.Id,Y.Id],t}(),se=function(){function t(){this.plugins=new ie,this.params={}}return t.prototype.init=function(t,e){var o=this;if(!t)throw new Error("You must pass your token when you call 'init'");if("string"==typeof t?this.client=new Gt({token:t,endpoint:this.getEndpoint(e)}):this.isAnalyticsClient(t)&&(this.client=t),!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(e).forEach((function(t){return o.plugins.require(t,i)})),this.client.registerBeforeSendEventHook((function(t,e){return r(r({},e),o.params)})),this.client.addEventTypeMapping(n.view,{newEventType:n.view,addClientIdParameter:!0})},t.prototype.isAnalyticsClient=function(t){return"object"==typeof t&&void 0!==t.sendEvent},t.prototype.getPluginKeys=function(t){return"string"==typeof t?ie.DefaultPlugins:Array.isArray(null==t?void 0:t.plugins)?t.plugins:ie.DefaultPlugins},t.prototype.getEndpoint=function(t){return"string"==typeof t?t||jt.default:(null==t?void 0:t.endpoint)?t.endpoint:jt.default},t.prototype.initForProxy=function(t){if(!t)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof t)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new Gt({endpoint:t})},t.prototype.set=function(t,e){var n=this;"string"==typeof t?this.params[t]=e:Object.keys(t).map((function(e){n.params[e]=t[e]}))},t.prototype.send=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!r)throw new Error('You must provide an event type when calling "send".');return(t=this.client).sendEvent.apply(t,c([r.toLowerCase()],o,!1))},t.prototype.onLoad=function(t){if(void 0===t)throw new Error("You must pass a function when you call 'onLoad'");t()},t.prototype.provide=function(t,e){this.plugins.provide(t,e)},t.prototype.require=function(t,e){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(t,r(r({},e),{client:this.client}))},t.prototype.callPlugin=function(t,e){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(!this.client)throw new Error("You must call init before calling a plugin function");return(n=this.plugins).execute.apply(n,c([t,e],r,!1))},t.prototype.reset=function(){this.client=void 0,this.plugins=new ie,this.params={}},t.prototype.version=function(){return q},t}(),ce=new se,ae=function(){return ce.client},ue=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(t);r[1];var o=r[2],i=r[3],s=ce[i];if(o&&i)return ce.callPlugin.apply(ce,c([o,i],e,!1));if(s)return s.apply(ce,e);throw new Error('The action "'.concat(t,'" does not exist. Available actions: ').concat(["init","set","send","onLoad","callPlugin","reset","require","provide","version"].join(", "),"."))},le=Object.freeze({__proto__:null,CoveoUA:se,coveoua:ce,default:ue,getCurrentClient:ae,handleOneAnalyticsEvent:ue});!function(t){t.contextChanged="contextChanged",t.expandToFullUI="expandToFullUI",t.openUserActions="openUserActions",t.showPrecedingSessions="showPrecedingSessions",t.showFollowingSessions="showFollowingSessions",t.clickViewedDocument="clickViewedDocument",t.clickPageView="clickPageView"}(Kt||(Kt={})),function(t){t.interfaceLoad="interfaceLoad",t.interfaceChange="interfaceChange",t.didyoumeanAutomatic="didyoumeanAutomatic",t.didyoumeanClick="didyoumeanClick",t.resultsSort="resultsSort",t.searchboxSubmit="searchboxSubmit",t.searchboxClear="searchboxClear",t.searchboxAsYouType="searchboxAsYouType",t.breadcrumbFacet="breadcrumbFacet",t.breadcrumbResetAll="breadcrumbResetAll",t.documentQuickview="documentQuickview",t.documentOpen="documentOpen",t.omniboxAnalytics="omniboxAnalytics",t.omniboxFromLink="omniboxFromLink",t.searchFromLink="searchFromLink",t.triggerNotify="notify",t.triggerExecute="execute",t.triggerQuery="query",t.undoTriggerQuery="undoQuery",t.triggerRedirect="redirect",t.pagerResize="pagerResize",t.pagerNumber="pagerNumber",t.pagerNext="pagerNext",t.pagerPrevious="pagerPrevious",t.pagerScrolling="pagerScrolling",t.staticFilterClearAll="staticFilterClearAll",t.staticFilterSelect="staticFilterSelect",t.staticFilterDeselect="staticFilterDeselect",t.facetClearAll="facetClearAll",t.facetSearch="facetSearch",t.facetSelect="facetSelect",t.facetSelectAll="facetSelectAll",t.facetDeselect="facetDeselect",t.facetExclude="facetExclude",t.facetUnexclude="facetUnexclude",t.facetUpdateSort="facetUpdateSort",t.facetShowMore="showMoreFacetResults",t.facetShowLess="showLessFacetResults",t.queryError="query",t.queryErrorBack="errorBack",t.queryErrorClear="errorClearQuery",t.queryErrorRetry="errorRetry",t.recommendation="recommendation",t.recommendationInterfaceLoad="recommendationInterfaceLoad",t.recommendationOpen="recommendationOpen",t.likeSmartSnippet="likeSmartSnippet",t.dislikeSmartSnippet="dislikeSmartSnippet",t.expandSmartSnippet="expandSmartSnippet",t.collapseSmartSnippet="collapseSmartSnippet",t.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",t.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",t.sendSmartSnippetReason="sendSmartSnippetReason",t.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",t.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",t.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",t.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",t.openSmartSnippetSource="openSmartSnippetSource",t.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",t.openSmartSnippetInlineLink="openSmartSnippetInlineLink",t.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",t.recentQueryClick="recentQueriesClick",t.clearRecentQueries="clearRecentQueries",t.recentResultClick="recentResultClick",t.clearRecentResults="clearRecentResults",t.noResultsBack="noResultsBack",t.showMoreFoldedResults="showMoreFoldedResults",t.showLessFoldedResults="showLessFoldedResults",t.copyToClipboard="copyToClipboard",t.caseAttach="caseAttach",t.caseDetach="caseDetach"}(Wt||(Wt={}));var pe=((zt={})[Wt.triggerNotify]="queryPipelineTriggers",zt[Wt.triggerExecute]="queryPipelineTriggers",zt[Wt.triggerQuery]="queryPipelineTriggers",zt[Wt.triggerRedirect]="queryPipelineTriggers",zt[Wt.queryError]="errors",zt[Wt.queryErrorBack]="errors",zt[Wt.queryErrorClear]="errors",zt[Wt.queryErrorRetry]="errors",zt[Wt.pagerNext]="getMoreResults",zt[Wt.pagerPrevious]="getMoreResults",zt[Wt.pagerNumber]="getMoreResults",zt[Wt.pagerResize]="getMoreResults",zt[Wt.pagerScrolling]="getMoreResults",zt[Wt.facetSearch]="facet",zt[Wt.facetShowLess]="facet",zt[Wt.facetShowMore]="facet",zt[Wt.recommendation]="recommendation",zt[Wt.likeSmartSnippet]="smartSnippet",zt[Wt.dislikeSmartSnippet]="smartSnippet",zt[Wt.expandSmartSnippet]="smartSnippet",zt[Wt.collapseSmartSnippet]="smartSnippet",zt[Wt.openSmartSnippetFeedbackModal]="smartSnippet",zt[Wt.closeSmartSnippetFeedbackModal]="smartSnippet",zt[Wt.sendSmartSnippetReason]="smartSnippet",zt[Wt.expandSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.clearRecentQueries]="recentQueries",zt[Wt.recentResultClick]="recentlyClickedDocuments",zt[Wt.clearRecentResults]="recentlyClickedDocuments",zt[Wt.showLessFoldedResults]="folding",zt[Kt.expandToFullUI]="interface",zt[Kt.openUserActions]="User Actions",zt[Kt.showPrecedingSessions]="User Actions",zt[Kt.showFollowingSessions]="User Actions",zt[Kt.clickViewedDocument]="User Actions",zt[Kt.clickPageView]="User Actions",zt[Wt.caseDetach]="case",zt),he=function(){function t(){this.runtime=new _t,this.currentVisitorId=""}return t.prototype.getPayload=function(){return Promise.resolve()},t.prototype.getParameters=function(){return Promise.resolve()},t.prototype.makeEvent=function(t){return Promise.resolve({eventType:t,payload:null,log:function(){return Promise.resolve()}})},t.prototype.sendEvent=function(){return Promise.resolve()},t.prototype.makeSearchEvent=function(){return this.makeEvent(n.search)},t.prototype.sendSearchEvent=function(){return Promise.resolve()},t.prototype.makeClickEvent=function(){return this.makeEvent(n.click)},t.prototype.sendClickEvent=function(){return Promise.resolve()},t.prototype.makeCustomEvent=function(){return this.makeEvent(n.custom)},t.prototype.sendCustomEvent=function(){return Promise.resolve()},t.prototype.makeViewEvent=function(){return this.makeEvent(n.view)},t.prototype.sendViewEvent=function(){return Promise.resolve()},t.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},t.prototype.getHealth=function(){return Promise.resolve({status:""})},t.prototype.registerBeforeSendEventHook=function(){},t.prototype.registerAfterSendEventHook=function(){},t.prototype.addEventTypeMapping=function(){},Object.defineProperty(t.prototype,"version",{get:function(){return q},enumerable:!1,configurable:!0}),t}();function de(t){var e=t.join(";");return e.length<=256?e:de(t.slice(1))}var ve=function(t){var e=function(t){return t.map((function(t){return t.replace(/;/g,"")}))}(t),n=function(t){var e="";return t.filter((function(t){var n=t!==e;return e=t,n}))}(e);return de(n)};function fe(t){var e="string"==typeof t.partialQueries?t.partialQueries:ve(t.partialQueries),n="string"==typeof t.suggestions?t.suggestions:ve(t.suggestions);return r(r({},t),{partialQueries:e,suggestions:n})}var ge,me,ye,Se=function(){function t(t,e){this.opts=t,this.provider=e;var n=!1===t.enableAnalytics||Qt();this.coveoAnalyticsClient=n?new he:new Gt(t)}return t.prototype.disable=function(){this.coveoAnalyticsClient instanceof Gt&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new he},t.prototype.enable=function(){this.coveoAnalyticsClient=new Gt(this.opts)},t.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(Wt.interfaceLoad)},t.prototype.logInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeInterfaceLoad()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(Wt.recommendationInterfaceLoad)},t.prototype.logRecommendationInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeRecommendationInterfaceLoad()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecommendation=function(){return this.makeCustomEvent(Wt.recommendation)},t.prototype.logRecommendation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeRecommendation()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecommendationOpen=function(t,e){return this.makeClickEvent(Wt.recommendationOpen,t,e)},t.prototype.logRecommendationOpen=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecommendationOpen(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeStaticFilterClearAll=function(t){return this.makeSearchEvent(Wt.staticFilterClearAll,t)},t.prototype.logStaticFilterClearAll=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeStaticFilterClearAll(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeStaticFilterSelect=function(t){return this.makeSearchEvent(Wt.staticFilterSelect,t)},t.prototype.logStaticFilterSelect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeStaticFilterSelect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeStaticFilterDeselect=function(t){return this.makeSearchEvent(Wt.staticFilterDeselect,t)},t.prototype.logStaticFilterDeselect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeStaticFilterDeselect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(Wt.pagerScrolling,{type:"getMoreResults"})},t.prototype.logFetchMoreResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFetchMoreResults()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeInterfaceChange=function(t){return this.makeSearchEvent(Wt.interfaceChange,t)},t.prototype.logInterfaceChange=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeInterfaceChange(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(Wt.didyoumeanAutomatic)},t.prototype.logDidYouMeanAutomatic=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeDidYouMeanAutomatic()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(Wt.didyoumeanClick)},t.prototype.logDidYouMeanClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeDidYouMeanClick()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeResultsSort=function(t){return this.makeSearchEvent(Wt.resultsSort,t)},t.prototype.logResultsSort=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeResultsSort(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(Wt.searchboxSubmit)},t.prototype.logSearchboxSubmit=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchboxSubmit()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(Wt.searchboxClear)},t.prototype.logSearchboxClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchboxClear()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(Wt.searchboxAsYouType)},t.prototype.logSearchboxAsYouType=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchboxAsYouType()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeBreadcrumbFacet=function(t){return this.makeSearchEvent(Wt.breadcrumbFacet,t)},t.prototype.logBreadcrumbFacet=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeBreadcrumbFacet(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(Wt.breadcrumbResetAll)},t.prototype.logBreadcrumbResetAll=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeBreadcrumbResetAll()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDocumentQuickview=function(t,e){return this.makeClickEvent(Wt.documentQuickview,t,e)},t.prototype.logDocumentQuickview=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentQuickview(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDocumentOpen=function(t,e){return this.makeClickEvent(Wt.documentOpen,t,e)},t.prototype.logDocumentOpen=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentOpen(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOmniboxAnalytics=function(t){return this.makeSearchEvent(Wt.omniboxAnalytics,fe(t))},t.prototype.logOmniboxAnalytics=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOmniboxAnalytics(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOmniboxFromLink=function(t){return this.makeSearchEvent(Wt.omniboxFromLink,fe(t))},t.prototype.logOmniboxFromLink=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOmniboxFromLink(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(Wt.searchFromLink)},t.prototype.logSearchFromLink=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchFromLink()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerNotify=function(t){return this.makeCustomEvent(Wt.triggerNotify,t)},t.prototype.logTriggerNotify=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerNotify(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerExecute=function(t){return this.makeCustomEvent(Wt.triggerExecute,t)},t.prototype.logTriggerExecute=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerExecute(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(Wt.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},t.prototype.logTriggerQuery=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerQuery()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeUndoTriggerQuery=function(t){return this.makeSearchEvent(Wt.undoTriggerQuery,t)},t.prototype.logUndoTriggerQuery=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeUndoTriggerQuery(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerRedirect=function(t){return this.makeCustomEvent(Wt.triggerRedirect,r(r({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))},t.prototype.logTriggerRedirect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerRedirect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerResize=function(t){return this.makeCustomEvent(Wt.pagerResize,t)},t.prototype.logPagerResize=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerResize(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerNumber=function(t){return this.makeCustomEvent(Wt.pagerNumber,t)},t.prototype.logPagerNumber=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerNumber(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerNext=function(t){return this.makeCustomEvent(Wt.pagerNext,t)},t.prototype.logPagerNext=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerNext(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerPrevious=function(t){return this.makeCustomEvent(Wt.pagerPrevious,t)},t.prototype.logPagerPrevious=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerPrevious(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerScrolling=function(){return this.makeCustomEvent(Wt.pagerScrolling)},t.prototype.logPagerScrolling=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerScrolling()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetClearAll=function(t){return this.makeSearchEvent(Wt.facetClearAll,t)},t.prototype.logFacetClearAll=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetClearAll(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetSearch=function(t){return this.makeSearchEvent(Wt.facetSearch,t)},t.prototype.logFacetSearch=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetSearch(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetSelect=function(t){return this.makeSearchEvent(Wt.facetSelect,t)},t.prototype.logFacetSelect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetSelect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetDeselect=function(t){return this.makeSearchEvent(Wt.facetDeselect,t)},t.prototype.logFacetDeselect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetDeselect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetExclude=function(t){return this.makeSearchEvent(Wt.facetExclude,t)},t.prototype.logFacetExclude=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetExclude(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetUnexclude=function(t){return this.makeSearchEvent(Wt.facetUnexclude,t)},t.prototype.logFacetUnexclude=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetUnexclude(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetSelectAll=function(t){return this.makeSearchEvent(Wt.facetSelectAll,t)},t.prototype.logFacetSelectAll=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetSelectAll(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetUpdateSort=function(t){return this.makeSearchEvent(Wt.facetUpdateSort,t)},t.prototype.logFacetUpdateSort=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetUpdateSort(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetShowMore=function(t){return this.makeCustomEvent(Wt.facetShowMore,t)},t.prototype.logFacetShowMore=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetShowMore(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetShowLess=function(t){return this.makeCustomEvent(Wt.facetShowLess,t)},t.prototype.logFacetShowLess=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetShowLess(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryError=function(t){return this.makeCustomEvent(Wt.queryError,t)},t.prototype.logQueryError=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryError(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryErrorBack=function(){return i(this,void 0,void 0,(function(){var t,e=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(Wt.queryErrorBack)];case 1:return[2,{description:(t=n.sent()).description,log:function(){return i(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.log({searchUID:this.provider.getSearchUID()})];case 1:return e.sent(),[2,this.logSearchEvent(Wt.queryErrorBack)]}}))}))}}]}}))}))},t.prototype.logQueryErrorBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryErrorBack()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){var t,e=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(Wt.queryErrorRetry)];case 1:return[2,{description:(t=n.sent()).description,log:function(){return i(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.log({searchUID:this.provider.getSearchUID()})];case 1:return e.sent(),[2,this.logSearchEvent(Wt.queryErrorRetry)]}}))}))}}]}}))}))},t.prototype.logQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryErrorRetry()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryErrorClear=function(){return i(this,void 0,void 0,(function(){var t,e=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(Wt.queryErrorClear)];case 1:return[2,{description:(t=n.sent()).description,log:function(){return i(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.log({searchUID:this.provider.getSearchUID()})];case 1:return e.sent(),[2,this.logSearchEvent(Wt.queryErrorClear)]}}))}))}}]}}))}))},t.prototype.logQueryErrorClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryErrorClear()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(Wt.likeSmartSnippet)},t.prototype.logLikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeLikeSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(Wt.dislikeSmartSnippet)},t.prototype.logDislikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeDislikeSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(Wt.expandSmartSnippet)},t.prototype.logExpandSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeExpandSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(Wt.collapseSmartSnippet)},t.prototype.logCollapseSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCollapseSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Wt.openSmartSnippetFeedbackModal)},t.prototype.logOpenSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOpenSmartSnippetFeedbackModal()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Wt.closeSmartSnippetFeedbackModal)},t.prototype.logCloseSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCloseSmartSnippetFeedbackModal()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSmartSnippetFeedbackReason=function(t,e){return this.makeCustomEvent(Wt.sendSmartSnippetReason,{reason:t,details:e})},t.prototype.logSmartSnippetFeedbackReason=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeExpandSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})},t.prototype.logExpandSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeExpandSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCollapseSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})},t.prototype.logCollapseSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCollapseSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowMoreSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.showMoreSmartSnippetSuggestion,t)},t.prototype.logShowMoreSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowMoreSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowLessSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.showLessSmartSnippetSuggestion,t)},t.prototype.logShowLessSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowLessSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetSource=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetSource,t,e)},t.prototype.logOpenSmartSnippetSource=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSource(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetSuggestionSource=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetSuggestionSource,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},e)},t.prototype.makeCopyToClipboard=function(t,e){return this.makeClickEvent(Wt.copyToClipboard,t,e)},t.prototype.logCopyToClipboard=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCopyToClipboard(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.logOpenSmartSnippetSuggestionSource=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetInlineLink=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetInlineLink,t,{contentIDKey:e.contentIDKey,contentIDValue:e.contentIDValue},e)},t.prototype.logOpenSmartSnippetInlineLink=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},e)},t.prototype.logOpenSmartSnippetSuggestionInlineLink=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(Wt.recentQueryClick)},t.prototype.logRecentQueryClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeRecentQueryClick()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(Wt.clearRecentQueries)},t.prototype.logClearRecentQueries=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeClearRecentQueries()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecentResultClick=function(t,e){return this.makeCustomEvent(Wt.recentResultClick,{info:t,identifier:e})},t.prototype.logRecentResultClick=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecentResultClick(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(Wt.clearRecentResults)},t.prototype.logClearRecentResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeClearRecentResults()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(Wt.noResultsBack)},t.prototype.logNoResultsBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeNoResultsBack()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowMoreFoldedResults=function(t,e){return this.makeClickEvent(Wt.showMoreFoldedResults,t,e)},t.prototype.logShowMoreFoldedResults=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeShowMoreFoldedResults(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(Wt.showLessFoldedResults)},t.prototype.logShowLessFoldedResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowLessFoldedResults()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeEventDescription=function(t,e){var n;return{actionCause:e,customData:null===(n=t.payload)||void 0===n?void 0:n.customData}},t.prototype.makeCustomEvent=function(t,e,n){return void 0===n&&(n=pe[t]),i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=r(r({},this.provider.getBaseMetadata()),e),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:n,eventValue:t}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,t),log:function(t){var e=t.searchUID;return a.log({lastSearchQueryUid:e})}}]}}))}))},t.prototype.logCustomEvent=function(t,e,n){return void 0===n&&(n=pe[t]),i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(t,e,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCustomEventWithType=function(t,e,n){return i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return o=r(r({},this.provider.getBaseMetadata()),n),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:e,eventValue:t}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,t),log:function(t){var e=t.searchUID;return a.log({lastSearchQueryUid:e})}}]}}))}))},t.prototype.logCustomEventWithType=function(t,e,n){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEventWithType(t,e,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.logSearchEvent=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSearchEvent(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(t,e)];case 1:return n=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(n)];case 2:return r=o.sent(),[2,{description:this.makeEventDescription(r,t),log:function(t){var e=t.searchUID;return r.log({searchQueryUid:e})}}]}}))}))},t.prototype.makeClickEvent=function(t,e,n,o){return i(this,void 0,void 0,(function(){var i,c,a;return s(this,(function(s){switch(s.label){case 0:return c=[r({},e)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:t}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,t),log:function(t){var e=t.searchUID;return a.log({searchQueryUid:e})}}]}}))}))},t.prototype.logClickEvent=function(t,e,n,r){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(t,e,n,r)];case 1:return[2,o.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.getBaseSearchEventRequest=function(t,e){return i(this,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{queryPipeline:this.provider.getPipeline(),actionCause:t}])]}}))}))},t.prototype.getBaseEventRequest=function(t){return i(this,void 0,void 0,(function(){var e,n,o;return s(this,(function(i){switch(i.label){case 0:return e=r(r({},this.provider.getBaseMetadata()),t),n=[r(r({},this.getOrigins()),this.getSplitTestRun())],o={customData:e,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,r.apply(void 0,n.concat([(o.clientId=i.sent(),o)]))]}}))}))},t.prototype.getOrigins=function(){var t,e;return{originContext:null===(e=(t=this.provider).getOriginContext)||void 0===e?void 0:e.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},t.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof Gt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},t.prototype.getSplitTestRun=function(){var t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",e=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return r(r({},t&&{splitTestRunName:t}),e&&{splitTestRunVersion:e})},t}();!function(t){t.click="click",t.flowStart="flowStart"}(ge||(ge={})),function(t){t.enterInterface="ticket_create_start",t.fieldUpdate="ticket_field_update",t.fieldSuggestionClick="ticket_classification_click",t.suggestionClick="suggestion_click",t.suggestionRate="suggestion_rate",t.nextCaseStep="ticket_next_stage",t.caseCancelled="ticket_cancel",t.caseSolved="ticket_cancel",t.caseCreated="ticket_create"}(me||(me={})),function(t){t.quit="Quit",t.solved="Solved"}(ye||(ye={}));var ke=function(){function t(t,e){var n;this.options=t,this.provider=e;var r=(null===(n=t.enableAnalytics)||void 0===n||n)&&!Qt();this.coveoAnalyticsClient=r?new Gt(t):new he,this.svc=new re({client:this.coveoAnalyticsClient})}return t.prototype.disable=function(){this.coveoAnalyticsClient instanceof Gt&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new he,this.svc=new re({client:this.coveoAnalyticsClient})},t.prototype.enable=function(){this.coveoAnalyticsClient=new Gt(this.options),this.svc=new re({client:this.coveoAnalyticsClient})},t.prototype.logEnterInterface=function(t){return this.svc.setAction(me.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()},t.prototype.logUpdateCaseField=function(t){return this.svc.setAction(me.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logSelectFieldSuggestion=function(t){return this.svc.setAction(me.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logSelectDocumentSuggestion=function(t){return this.svc.setAction(me.suggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logRateDocumentSuggestion=function(t){return this.svc.setAction(me.suggestionRate,r({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logMoveToNextCaseStep=function(t){return this.svc.setAction(me.nextCaseStep,{stage:null==t?void 0:t.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logCaseCancelled=function(t){return this.svc.setAction(me.caseCancelled,{reason:ye.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logCaseSolved=function(t){return this.svc.setAction(me.caseSolved,{reason:ye.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logCaseCreated=function(t){return this.svc.setAction(me.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",ge.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},t.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",ge.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},t}(),we=function(t,e){void 0===e&&(e=!0),t.caseContext;var n=t.caseId,i=t.caseNumber,s=o(t,["caseContext","caseId","caseNumber"]),c=function(t){var e={};return t.caseContext&&Object.keys(t.caseContext).forEach((function(n){var r,o=null===(r=t.caseContext)||void 0===r?void 0:r[n];if(o){var i="context_".concat(n);e[i]=o}})),e}(t);return r(r(r({CaseId:n,CaseNumber:i},s),!!c.context_Case_Subject&&{CaseSubject:c.context_Case_Subject}),e&&c)},Ie=function(){function t(t,e){this.opts=t,this.provider=e;var n=!1===t.enableAnalytics||Qt();this.coveoAnalyticsClient=n?new he:new Gt(t)}return t.prototype.disable=function(){this.coveoAnalyticsClient instanceof Gt&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new he},t.prototype.enable=function(){this.coveoAnalyticsClient=new Gt(this.opts)},t.prototype.logInterfaceLoad=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.interfaceLoad,e)}return this.logSearchEvent(Wt.interfaceLoad)},t.prototype.logInterfaceChange=function(t){var e=we(t);return this.logSearchEvent(Wt.interfaceChange,e)},t.prototype.logStaticFilterDeselect=function(t){var e=we(t);return this.logSearchEvent(Wt.staticFilterDeselect,e)},t.prototype.logFetchMoreResults=function(t){if(t){var e=we(t);return this.logCustomEvent(Wt.pagerScrolling,r(r({},e),{type:"getMoreResults"}))}return this.logCustomEvent(Wt.pagerScrolling,{type:"getMoreResults"})},t.prototype.logBreadcrumbFacet=function(t){var e=we(t);return this.logSearchEvent(Wt.breadcrumbFacet,e)},t.prototype.logBreadcrumbResetAll=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.breadcrumbResetAll,e)}return this.logSearchEvent(Wt.breadcrumbResetAll)},t.prototype.logFacetSelect=function(t){var e=we(t);return this.logSearchEvent(Wt.facetSelect,e)},t.prototype.logFacetDeselect=function(t){var e=we(t);return this.logSearchEvent(Wt.facetDeselect,e)},t.prototype.logFacetUpdateSort=function(t){var e=we(t);return this.logSearchEvent(Wt.facetUpdateSort,e)},t.prototype.logFacetClearAll=function(t){var e=we(t);return this.logSearchEvent(Wt.facetClearAll,e)},t.prototype.logFacetShowMore=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.facetShowMore,e)},t.prototype.logFacetShowLess=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.facetShowLess,e)},t.prototype.logQueryError=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.queryError,e)},t.prototype.logPagerNumber=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.pagerNumber,e)},t.prototype.logPagerNext=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.pagerNext,e)},t.prototype.logPagerPrevious=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.pagerPrevious,e)},t.prototype.logDidYouMeanAutomatic=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.didyoumeanAutomatic,e)}return this.logSearchEvent(Wt.didyoumeanAutomatic)},t.prototype.logDidYouMeanClick=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.didyoumeanClick,e)}return this.logSearchEvent(Wt.didyoumeanClick)},t.prototype.logResultsSort=function(t){var e=we(t);return this.logSearchEvent(Wt.resultsSort,e)},t.prototype.logSearchboxSubmit=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.searchboxSubmit,e)}return this.logSearchEvent(Wt.searchboxSubmit)},t.prototype.logContextChanged=function(t){var e=we(t);return this.logSearchEvent(Kt.contextChanged,e)},t.prototype.logExpandToFullUI=function(t){var e=we(t);return this.logCustomEvent(Kt.expandToFullUI,e)},t.prototype.logOpenUserActions=function(t){var e=we(t,!1);return this.logCustomEvent(Kt.openUserActions,e)},t.prototype.logShowPrecedingSessions=function(t){var e=we(t,!1);return this.logCustomEvent(Kt.showPrecedingSessions,e)},t.prototype.logShowFollowingSessions=function(t){var e=we(t,!1);return this.logCustomEvent(Kt.showFollowingSessions,e)},t.prototype.logViewedDocumentClick=function(t,e){return this.logCustomEvent(Kt.clickViewedDocument,r(r({},we(e,!1)),{document:t}))},t.prototype.logPageViewClick=function(t,e){return this.logCustomEvent(Kt.clickPageView,r(r({},we(e,!1)),{pageView:t}))},t.prototype.logDocumentOpen=function(t,e,n){return this.logClickEvent(Wt.documentOpen,t,e,n?we(n,!1):void 0)},t.prototype.logCopyToClipboard=function(t,e,n){return this.logClickEvent(Wt.copyToClipboard,t,e,n?we(n,!1):void 0)},t.prototype.logDocumentQuickview=function(t,e,n){var o={documentTitle:t.documentTitle,documentURL:t.documentUrl};return this.logClickEvent(Wt.documentQuickview,t,e,n?r(r({},we(n,!1)),o):o)},t.prototype.logCaseAttach=function(t,e,n){var o={documentTitle:t.documentTitle,documentURL:t.documentUrl,resultUriHash:t.documentUriHash};return this.logClickEvent(Wt.caseAttach,t,e,n?r(r({},we(n,!1)),o):o)},t.prototype.logCaseDetach=function(t,e){return this.logCustomEvent(Wt.caseDetach,e?r(r({},we(e,!1)),{resultUriHash:t}):{resultUriHash:t})},t.prototype.logLikeSmartSnippet=function(t){return this.logCustomEvent(Wt.likeSmartSnippet,t?we(t,!1):void 0)},t.prototype.logDislikeSmartSnippet=function(t){return this.logCustomEvent(Wt.dislikeSmartSnippet,t?we(t,!1):void 0)},t.prototype.logExpandSmartSnippet=function(t){return this.logCustomEvent(Wt.expandSmartSnippet,t?we(t,!1):void 0)},t.prototype.logCollapseSmartSnippet=function(t){return this.logCustomEvent(Wt.collapseSmartSnippet,t?we(t,!1):void 0)},t.prototype.logOpenSmartSnippetFeedbackModal=function(t){return this.logCustomEvent(Wt.openSmartSnippetFeedbackModal,t?we(t,!1):void 0)},t.prototype.logCloseSmartSnippetFeedbackModal=function(t){return this.logCustomEvent(Wt.closeSmartSnippetFeedbackModal,t?we(t,!1):void 0)},t.prototype.logSmartSnippetFeedbackReason=function(t,e,n){return this.logCustomEvent(Wt.sendSmartSnippetReason,n?r(r({},we(n,!1)),{reason:t,details:e}):{reason:t,details:e})},t.prototype.logExpandSmartSnippetSuggestion=function(t,e){var n="documentId"in t?t:{documentId:t};return this.logCustomEvent(Wt.expandSmartSnippetSuggestion,e?r(r({},we(e,!1)),n):n)},t.prototype.logCollapseSmartSnippetSuggestion=function(t,e){var n="documentId"in t?t:{documentId:t};return this.logCustomEvent(Wt.collapseSmartSnippetSuggestion,e?r(r({},we(e,!1)),n):n)},t.prototype.logOpenSmartSnippetSource=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetSource,t,e,n?we(n,!1):void 0)},t.prototype.logOpenSmartSnippetSuggestionSource=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetSuggestionSource,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},n?r(r({},we(n,!1)),e):e)},t.prototype.logOpenSmartSnippetInlineLink=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetInlineLink,t,{contentIDKey:e.contentIDKey,contentIDValue:e.contentIDValue},n?r(r({},we(n,!1)),e):e)},t.prototype.logOpenSmartSnippetSuggestionInlineLink=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},n?r(r({},we(n,!1)),e):e)},t.prototype.logCustomEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,o,i;return s(this,(function(s){switch(s.label){case 0:return n=r(r({},this.provider.getBaseMetadata()),e),i=[{}],[4,this.getBaseCustomEventRequest(n)];case 1:return o=r.apply(void 0,[r.apply(void 0,i.concat([s.sent()])),{eventType:pe[t],eventValue:t}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},t.prototype.logSearchEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return r=(n=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(t,e)];case 1:return[2,r.apply(n,[o.sent()])]}}))}))},t.prototype.logClickEvent=function(t,e,n,o){return i(this,void 0,void 0,(function(){var i,c;return s(this,(function(s){switch(s.label){case 0:return c=[r({},e)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t}]),[2,this.coveoAnalyticsClient.sendClickEvent(i)]}}))}))},t.prototype.getBaseCustomEventRequest=function(t){return i(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return e=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,r.apply(void 0,[r.apply(void 0,e.concat([n.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},t.prototype.getBaseSearchEventRequest=function(t,e){return i(this,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t}])]}}))}))},t.prototype.getBaseEventRequest=function(t){return i(this,void 0,void 0,(function(){var e,n,o;return s(this,(function(i){switch(i.label){case 0:return e=r(r({},this.provider.getBaseMetadata()),t),n=[r({},this.getOrigins())],o={customData:e,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,r.apply(void 0,n.concat([(o.clientId=i.sent(),o)]))]}}))}))},t.prototype.getOrigins=function(){var t,e;return{originContext:null===(e=(t=this.provider).getOriginContext)||void 0===e?void 0:e.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},t.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof Gt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},t}(),be=Object.freeze({__proto__:null,get CaseAssistActions(){return me},CaseAssistClient:ke,get CaseAssistEvents(){return ge},get CaseCancelledReasons(){return ye},CoveoAnalyticsClient:Gt,CoveoInsightClient:Ie,CoveoSearchPageClient:Se,CoveoUA:se,CustomEventsTypes:pe,get EventType(){return n},get InsightEvents(){return Kt},get SearchPageEvents(){return Wt},SimpleAnalytics:le,analytics:$t,donottrack:Ht,getCurrentClient:ae,handleOneAnalyticsEvent:ue,history:b,storage:k});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 Ee=self.coveoua||ue;if(self.coveoua=ue,self.coveoanalytics=be,Ee.q){var Ce=Ee.q.filter((function(t){return"init"===t[0]})),De=Ee.q.filter((function(t){return"init"!==t[0]}));c(c([],Ce,!0),De,!0).forEach((function(t){return ue.apply(void 0,t)}))}return self.coveoua}();
1
+ var coveoua=function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(t,s)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function c(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function a(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(t){return!1}}function p(){return a()&&navigator.cookieEnabled}!function(t){t.search="search",t.click="click",t.custom="custom",t.view="view",t.collect="collect"}(n||(n={}));var h=[n.click,n.custom,n.search,n.view],d=function(t,e){return-1!==h.indexOf(t)?r({language:u()?document.documentElement.lang:"unknown",userAgent:a()?navigator.userAgent:"unknown"},e):e},v=function(){function t(){}return t.set=function(t,e,n){var r,o,i;n&&(r=new Date).setTime(r.getTime()+n),-1===(i=window.location.hostname).indexOf(".")?f(t,e,r):f(t,e,r,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},t.get=function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];if(0===(o=o.replace(/^\s+/,"")).lastIndexOf(e,0))return o.substring(e.length,o.length)}return null},t.erase=function(e){t.set(e,"",-1)},t}();function f(t,e,n,r){document.cookie="".concat(t,"=").concat(e)+(n?";expires=".concat(n.toUTCString()):"")+(r?";domain=".concat(r):"")+";SameSite=Lax"}function g(){return l()?localStorage:p()?new m:function(){try{return"undefined"!=typeof sessionStorage}catch(t){return!1}}()?sessionStorage:new S}var m=function(){function t(){}return t.prototype.getItem=function(e){return v.get("".concat(t.prefix).concat(e))},t.prototype.removeItem=function(e){v.erase("".concat(t.prefix).concat(e))},t.prototype.setItem=function(e,n,r){v.set("".concat(t.prefix).concat(e),n,r)},t.prefix="coveo_",t}(),y=function(){function t(){this.cookieStorage=new m}return t.prototype.getItem=function(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)},t.prototype.removeItem=function(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)},t.prototype.setItem=function(t,e){localStorage.setItem(t,e),this.cookieStorage.setItem(t,e,31556926e3)},t}(),S=function(){function t(){}return t.prototype.getItem=function(t){return null},t.prototype.removeItem=function(t){},t.prototype.setItem=function(t,e){},t}(),k=Object.freeze({__proto__:null,CookieAndLocalStorage:y,CookieStorage:m,NullStorage:S,getAvailableStorage:g,preferredStorage:null}),w="__coveo.analytics.history",I=function(){function t(t){this.store=t||g()}return t.prototype.addElement=function(t){t.internalTime=(new Date).getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));var e=this.getHistoryWithInternalTime();null!=e?this.isValidEntry(t)&&this.setHistory([t].concat(e)):this.setHistory([t])},t.prototype.addElementAsync=function(t){return i(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return t.internalTime=(new Date).getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(e=n.sent())?this.isValidEntry(t)&&this.setHistory([t].concat(e)):this.setHistory([t]),[2]}}))}))},t.prototype.getHistory=function(){var t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))},t.prototype.getHistoryAsync=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return t=e.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(t))]}}))}))},t.prototype.getHistoryWithInternalTime=function(){try{var t=this.store.getItem(w);return t&&"string"==typeof t?JSON.parse(t):[]}catch(t){return[]}},t.prototype.getHistoryWithInternalTimeAsync=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.store.getItem(w)];case 1:return(t=e.sent())?[2,JSON.parse(t)]:[2,[]];case 2:return e.sent(),[2,[]];case 3:return[2]}}))}))},t.prototype.setHistory=function(t){try{this.store.setItem(w,JSON.stringify(t.slice(0,20)))}catch(t){}},t.prototype.clear=function(){try{this.store.removeItem(w)}catch(t){}},t.prototype.getMostRecentElement=function(){var t=this.getHistoryWithInternalTime();return null!=t?t.sort((function(t,e){return(e.internalTime||0)-(t.internalTime||0)}))[0]:null},t.prototype.cropQueryElement=function(t){return t.name&&t.value&&"query"===t.name.toLowerCase()&&(t.value=t.value.slice(0,75)),t},t.prototype.isValidEntry=function(t){var e=this.getMostRecentElement();return!e||e.value!=t.value||(t.internalTime||0)-(e.internalTime||0)>6e4},t.prototype.stripInternalTime=function(t){return t.map((function(t){return{name:t.name,time:t.time,value:t.value}}))},t.prototype.stripEmptyQuery=function(t){var e=t.name,n=t.time,r=t.value;return e&&"string"==typeof r&&"query"===e.toLowerCase()&&""===r.trim()?{name:e,time:n}:t},t.prototype.stripEmptyQueries=function(t){var e=this;return t.map((function(t){return e.stripEmptyQuery(t)}))},t}(),b=Object.freeze({__proto__:null,HistoryStore:I,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MAX_VALUE_SIZE:75,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,STORE_KEY:w,default:I}),E=function(t,e){return i(void 0,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return t!==n.view?[3,2]:[4,C(e.contentIdValue)];case 1:return o.sent(),[2,r({location:window.location.toString(),referrer:document.referrer,title:document.title},e)];case 2:return[2,e]}}))}))},C=function(t){return i(void 0,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return e=new I,n={name:"PageView",value:t,time:JSON.stringify(new Date)},[4,e.addElementAsync(n)];case 1:return r.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(t){return"string"==typeof t&&A.test(t)}const F=[];for(let t=0;t<256;++t)F.push((t+256).toString(16).slice(1));function x(t,e=0){return(F[t[e+0]]+F[t[e+1]]+F[t[e+2]]+F[t[e+3]]+"-"+F[t[e+4]]+F[t[e+5]]+"-"+F[t[e+6]]+F[t[e+7]]+"-"+F[t[e+8]]+F[t[e+9]]+"-"+F[t[e+10]]+F[t[e+11]]+F[t[e+12]]+F[t[e+13]]+F[t[e+14]]+F[t[e+15]]).toLowerCase()}var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(t,e,n){if(T.randomUUID&&!e&&!t)return T.randomUUID();const r=(t=t||{}).random||(t.rng||R)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return x(r)}function O(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function V(t,e){return t<<e|t>>>32-e}var M=function(t,e,n){function r(t,r,o,i){var s;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=function(t){if(!P(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+t.length);if(c.set(r),c.set(t,r.length),c=n(c),c[6]=15&c[6]|e,c[8]=63&c[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=c[t];return o}return x(c)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=V(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],s=n[1],c=n[2],a=n[3],u=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=V(o,5)+O(n,s,c,a)+u+e[n]+r[t]>>>0;u=a,a=c,c=V(s,30)>>>0,s=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+s>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+a>>>0,n[4]=n[4]+u>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),q="2.27.3",_=function(t){return"".concat(t.protocol,"//").concat(t.hostname).concat(0===t.pathname.indexOf("/")?t.pathname:"/".concat(t.pathname)).concat(t.search)},N={pageview:"pageview",event:"event"},Q=function(t){var e=t.client,n=t.uuidGenerator,r=void 0===n?L:n;this.client=e,this.uuidGenerator=r},H=function(t){function n(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r,i=t.call(this,{client:n,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=_(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return e(n,t),n.prototype.getApi=function(t){return"setAction"===t?this.setAction:null},n.prototype.setAction=function(t,e){this.action=t,this.actionData=e},n.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},n.prototype.getLocationInformation=function(t,e){return r({hitType:t},this.getNextValues(t,e))},n.prototype.updateLocationInformation=function(t,e){this.updateLocationForNextPageView(t,e)},n.prototype.getDefaultContextInformation=function(t){var e={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},n={screenResolution:"".concat(screen.width,"x").concat(screen.height),screenColor:"".concat(screen.colorDepth,"-bit")},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return r(r(r(r({},i),n),o),e)},n.prototype.updateLocationForNextPageView=function(t,e){var n=this.getNextValues(t,e),r=n.pageViewId,o=n.referrer,i=n.location;this.lastReferrer=o,this.pageViewId=r,this.currentLocation=i,t===N.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},n.prototype.getNextValues=function(t,e){return{pageViewId:t===N.pageview?this.nextPageViewId:this.pageViewId,referrer:t===N.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===N.pageview?this.getCurrentLocationFromPayload(e):this.currentLocation}},n.prototype.getCurrentLocationFromPayload=function(t){if(t.page){return"".concat((e=this.currentLocation,e.split("/").slice(0,3).join("/"))).concat(t.page.replace(/^\/?(.*)$/,"/$1"))}return _(window.location);var e},n}(Q),B=function(){function t(t,e){if(!P(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(e/1e3)}return t.prototype.toString=function(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()},Object.defineProperty(t.prototype,"expired",{get:function(){var e=Math.floor(Date.now()/1e3)-this.creationDate;return e<0||e>t.expirationTime},enumerable:!1,configurable:!0}),t.prototype.validate=function(t,e){return!this.expired&&this.matchReferrer(t,e)},t.prototype.matchReferrer=function(t,e){try{var n=new URL(t);return e.some((function(t){return new RegExp(t.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host)}))}catch(t){return!1}},t.fromString=function(e){var n=e.split(".");if(2!==n.length)return null;var r=n[0],o=n[1];if(32!==r.length||isNaN(parseInt(o)))return null;var i=r.substring(0,8)+"-"+r.substring(8,12)+"-"+r.substring(12,16)+"-"+r.substring(16,20)+"-"+r.substring(20,32);return P(i)?new t(i,1e3*Number.parseInt(o)):null},t.cvo_cid="cvo_cid",t.expirationTime=120,t}(),j=function(t){function n(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r;return t.call(this,{client:n,uuidGenerator:o})||this}return e(n,t),n.prototype.getApi=function(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},n.prototype.decorate=function(t){return i(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");r.label=1;case 1:return r.trys.push([1,3,,4]),e=new URL(t),[4,this.client.getCurrentVisitorId()];case 2:return n=r.sent(),e.searchParams.set(B.cvo_cid,new B(n,Date.now()).toString()),[2,e.toString()];case 3:throw r.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},n.prototype.acceptFrom=function(t){this.client.setAcceptedLinkReferrers(t)},n.Id="link",n}(Q),Y=j,K=Object.keys;function z(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function W(t){return"string"!=typeof t||""==t||Number.isNaN(+t)?t:+t}var G={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"},$=c([],K(G).map((function(t){return G[t]})),!0).join("|"),J=new RegExp("^(".concat($,"$)")),X=[function(t){return J.test(t)}],Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},tt={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},nt={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},rt={id:"quoteId",affiliation:"quoteAffiliation"},ot={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},it={add:et,bookmark_add:et,bookmark_remove:et,click:et,checkout:et,checkout_option:et,detail:et,impression:et,remove:et,refund:r(r({},et),nt),purchase:r(r({},et),nt),quickview:et,quote:r(r({},et),rt),review:r(r({},et),ot)},st=function(t,e,n,o){return K(t).reduce((function(i,s){var c,a="il".concat(e+1).concat(o).concat(n+1).concat(tt[s]||s);return r(r({},i),((c={})[a]=t[s],c))}),{})},ct=K(Z).map((function(t){return Z[t]})),at=K(tt).map((function(t){return tt[t]})),ut=K(et).map((function(t){return et[t]})),lt=K(nt).map((function(t){return nt[t]})),pt=K(ot).map((function(t){return ot[t]})),ht=K(rt).map((function(t){return rt[t]})),dt=c(c([],ct,!0),["custom"],!1).join("|"),vt=c(c([],at,!0),["custom"],!1).join("|"),ft="(pr[0-9]+)",gt="(il[0-9]+pi[0-9]+)",mt=new RegExp("^".concat(ft,"(").concat(dt,")$")),yt=new RegExp("^(".concat(gt,"(").concat(vt,"))|(il[0-9]+nm)$")),St=new RegExp("^(".concat(ut.join("|"),")$")),kt=new RegExp("^(".concat(lt.join("|"),")$")),wt=new RegExp("^".concat(ft,"custom$")),It=new RegExp("^".concat(gt,"custom$")),bt=new RegExp("^(".concat(c(c(c([],["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],!0),pt,!0),ht,!0).join("|"),")$")),Et=[function(t){return yt.test(t)},function(t){return mt.test(t)},function(t){return St.test(t)},function(t){return kt.test(t)},function(t){return bt.test(t)}],Ct=[wt,It],Dt=r(r(r(r({},{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(t,e){var n;return r(r({},t),((n={})[e]=e,n))}),{})),Ut=r(r({},Dt),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Rt=K(Ut).map((function(t){return Ut[t]})),At=function(t){return-1!==Rt.indexOf(t)},Pt=function(t){return"custom"===t},Ft=function(t){var e=void 0;return c([],Ct,!0).every((function(n){var r;return e=null===(r=n.exec(t))||void 0===r?void 0:r[1],!Boolean(e)})),e},xt=function(t,e){return K(e).reduce((function(n,o){var i;return r(r({},n),((i={})["".concat(t).concat(o)]=e[o],i))}),{})},Tt=function(){function t(t){this.opts=t}return t.prototype.sendEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,o,i,c,a,u,l,p,h,d,v;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 n=this.opts,o=n.baseUrl,i=n.preprocessRequest,c=this.encodeForEventType(t,e),[4,this.getQueryParamsForEventType(t)];case 1:return a=s.sent(),u={url:"".concat(o,"/analytics/").concat(t,"?").concat(a),body:new Blob([c],{type:"application/x-www-form-urlencoded"})},d=[r({},u)],i?[4,i(u,"analyticsBeacon")]:[3,3];case 2:return v=s.sent(),[3,4];case 3:v={},s.label=4;case 4:return l=r.apply(void 0,d.concat([v])),p=l.url,h=l.body,console.log('Sending beacon for "'.concat(t,'" with: '),JSON.stringify(e)),navigator.sendBeacon(p,h),[2]}}))}))},t.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},t.prototype.encodeForEventType=function(t,e){return this.isEventTypeLegacy(t)?this.encodeForLegacyType(t,e):this.encodeForFormUrlEncoded(r({access_token:this.opts.token},e))},t.prototype.getQueryParamsForEventType=function(t){return i(this,void 0,void 0,(function(){var e,n,r;return s(this,(function(o){switch(o.label){case 0:return e=this.opts,n=e.token,[4,e.visitorIdProvider.getCurrentVisitorId()];case 1:return r=o.sent(),[2,[n&&this.isEventTypeLegacy(t)?"access_token=".concat(n):"",r?"visitorId=".concat(r):"","discardVisitInfo=true"].filter((function(t){return!!t})).join("&")]}}))}))},t.prototype.isEventTypeLegacy=function(t){return-1!==[n.click,n.custom,n.search,n.view].indexOf(t)},t.prototype.encodeForLegacyType=function(t,e){return"".concat(t,"Event=").concat(encodeURIComponent(JSON.stringify(e)))},t.prototype.encodeForFormUrlEncoded=function(t){var e=this;return Object.keys(t).filter((function(e){return!!t[e]})).map((function(n){return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(e.encodeValue(t[n])))})).join("&")},t.prototype.encodeValue=function(t){return"number"==typeof t||"string"==typeof t||"boolean"==typeof t?t:JSON.stringify(t)},t}(),Lt=function(){function t(){}return t.prototype.sendEvent=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,Promise.resolve()]}))}))},t.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,Promise.resolve()]}))}))},t}(),Ot=window.fetch,Vt=function(){function t(t){this.opts=t}return t.prototype.sendEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,i,c,a,u,l,p,h,d,v,f,g,m,y;return s(this,(function(s){switch(s.label){case 0:return n=this.opts,i=n.baseUrl,c=n.visitorIdProvider,a=n.preprocessRequest,this.shouldAppendVisitorId(t)?[4,this.getVisitorIdParam()]:[3,2];case 1:return l=s.sent(),[3,3];case 2:l="",s.label=3;case 3:return u=l,p={url:"".concat(i,"/analytics/").concat(t).concat(u),credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(e)},f=[r({},p)],a?[4,a(p,"analyticsFetch")]:[3,5];case 4:return g=s.sent(),[3,6];case 5:g={},s.label=6;case 6:return h=r.apply(void 0,f.concat([g])),d=h.url,v=o(h,["url"]),[4,Ot(d,v)];case 7:return(m=s.sent()).ok?[4,m.json()]:[3,9];case 8:return(y=s.sent()).visitorId&&c.setCurrentVisitorId(y.visitorId),[2,y];case 9:try{m.json()}catch(t){}throw console.error('An error has occured when sending the "'.concat(t,'" event.'),m,e),new Error('An error has occurred when sending the "'.concat(t,'" event. Check the console logs for more details.'))}}))}))},t.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return t=this.opts.baseUrl,e="".concat(t,"/analytics/visit"),[4,Ot(e,{headers:this.getHeaders(),method:"DELETE"})];case 1:return n.sent(),[2]}}))}))},t.prototype.shouldAppendVisitorId=function(t){return-1!==[n.click,n.custom,n.search,n.view].indexOf(t)},t.prototype.getVisitorIdParam=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(t=e.sent())?"?visitor=".concat(t):""]}}))}))},t.prototype.getHeaders=function(){var t=this.opts.token;return r(r({},t?{Authorization:"Bearer ".concat(t)}:{}),{"Content-Type":"application/json"})},t}(),Mt=function(t,e){var n=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 Vt(t),this.beaconClient=new Tt(t),window.addEventListener("beforeunload",(function(){for(var t=0,r=e();t<r.length;t++){var o=r[t],i=o.eventType,s=o.payload;n.beaconClient.sendEvent(i,s)}}))},qt=function(t,e){this.storage=e||new S,this.client=new Vt(t)},_t=function(){this.storage=new S,this.client=new Lt};var Nt=["1",1,"yes",!0];function Qt(){return a()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(t){return-1!==Nt.indexOf(t)}))}var Ht=Object.freeze({__proto__:null,default:Qt,doNotTrack:Qt}),Bt="v15",jt={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 Yt(t,e){void 0===t&&(t=jt.default),void 0===e&&(e=Bt);var n=-1!==t.indexOf(".cloud.coveo.com");return"".concat(t).concat(n?"":"/rest","/").concat(e)}var Kt,zt,Wt,Gt=function(){function t(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=r(r({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[E,d].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};var e={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(e),Qt()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return{endpoint:jt.default,token:"",version:Bt,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return q},enumerable:!1,configurable:!0}),t.prototype.initRuntime=function(t){var e=this;return"undefined"!=typeof window&&u()?new Mt(t,(function(){var t=c([],e.bufferedRequests,!0);return e.bufferedRequests=[],t})):("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 qt(t))},Object.defineProperty(t.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),t.prototype.determineVisitorId=function(){return i(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),(t=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:t=n.sent(),n.label=2;case 2:return[2,t||L()];case 3:return e=n.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",e),[2,L()];case 4:return[2]}}))}))},t.prototype.getCurrentVisitorId=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return t=e.sent(),[4,this.setCurrentVisitorId(t)];case 2:e.sent(),e.label=3;case 3:return[2,this.visitorId]}}))}))},t.prototype.setCurrentVisitorId=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.visitorId=t,[4,this.storage.setItem("visitorId",t)];case 1:return e.sent(),[2]}}))}))},t.prototype.setClientId=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){if(P(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!e)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(M(t,M(e,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}return[2]}))}))},t.prototype.getParameters=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,c([t],e,!1))];case 1:return[2,n.sent()]}}))}))},t.prototype.getPayload=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,c([t],e,!1))];case 1:return n=r.sent(),[4,this.resolvePayloadForParameters(t,n)];case 2:return[2,r.sent()]}}))}))},Object.defineProperty(t.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(L()),this.visitorId},set:function(t){this.visitorId=t,this.storage.setItem("visitorId",t)},enumerable:!1,configurable:!0}),t.prototype.extractClientIdFromLink=function(t){if(Qt())return null;try{var e=new URL(t).searchParams.get(B.cvo_cid);if(null==e)return null;var n=B.fromString(e);return n&&u()&&n.validate(document.referrer,this.acceptedLinkReferrers)?n.clientId:null}catch(t){}return null},t.prototype.resolveParameters=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,c,a,u,l,p,h,d,v,f,g,m=this;return s(this,(function(y){switch(y.label){case 0:return n=this.eventTypeMapping[t]||{},o=n.variableLengthArgumentsNames,c=void 0===o?[]:o,a=n.addVisitorIdParameter,u=void 0!==a&&a,l=n.usesMeasurementProtocol,p=void 0!==l&&l,h=n.addClientIdParameter,d=void 0!==h&&h,v=function(t){return i(m,void 0,void 0,(function(){var e,n,o;return s(this,(function(i){switch(i.label){case 0:return e=[r({},t)],o={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n="",i.label=3;case 3:return[2,r.apply(void 0,e.concat([(o.visitorId=n,o)]))]}}))}))},f=function(t){return i(m,void 0,void 0,(function(){var e,n;return s(this,(function(o){switch(o.label){case 0:return d?(e=[r({},t)],n={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,r.apply(void 0,e.concat([(n.clientId=o.sent(),n)]))];case 2:return[2,t]}}))}))},g=function(e){return m.beforeSendHooks.reduce((function(e,n){return i(m,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return[4,e];case 1:return r=o.sent(),[4,n(t,r)];case 2:return[2,o.sent()]}}))}))}),e)},[4,[function(t){return c.length>0?m.parseVariableArgumentsPayload(c,t):t[0]},v,f,function(t){return p?m.ensureAnonymousUserWhenUsingApiKey(t):t},g].reduce((function(t,e){return i(m,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),[4,e(n)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve(e))];case 1:return[2,y.sent()]}}))}))},t.prototype.resolvePayloadForParameters=function(t,e){return i(this,void 0,void 0,(function(){var n,o,c,a=this;return s(this,(function(u){switch(u.label){case 0:return n=(this.eventTypeMapping[t]||{}).usesMeasurementProtocol,o=void 0!==n&&n,c=function(t){return o?(n=!!(e=t).action&&it[e.action]||{},K(e).reduce((function(t,o){var i,s=n[o]||Ut[o]||o;return r(r({},t),((i={})[s]=e[o],i))}),{})):t;var e,n},[4,[function(e){return a.removeEmptyPayloadValues(e,t)},function(e){return a.validateParams(e,t)},c,function(t){return o?a.removeUnknownParameters(t):t},function(t){return o?a.processCustomParameters(t):a.mapCustomParametersToCustomData(t)}].reduce((function(t,e){return i(a,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),[4,e(n)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve(e))];case 1:return[2,u.sent()]}}))}))},t.prototype.makeEvent=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,a,u,l=this;return s(this,(function(p){switch(p.label){case 0:return n=(this.eventTypeMapping[t]||{}).newEventType,o=void 0===n?t:n,[4,this.resolveParameters.apply(this,c([t],e,!1))];case 1:return a=p.sent(),[4,this.resolvePayloadForParameters(t,a)];case 2:return u=p.sent(),[2,{eventType:o,payload:u,log:function(e){return i(l,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this.bufferedRequests.push({eventType:o,payload:r(r({},u),e)}),[4,Promise.all(this.afterSendHooks.map((function(n){return n(t,r(r({},a),e))})))];case 1:return n.sent(),[4,this.deferExecution()];case 2:return n.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,n.sent()]}}))}))}}]}}))}))},t.prototype.sendEvent=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeEvent.apply(this,c([t],e,!1))];case 1:return[2,n.sent().log({})]}}))}))},t.prototype.deferExecution=function(){return new Promise((function(t){return setTimeout(t,0)}))},t.prototype.sendFromBufferWithFetch=function(){return i(this,void 0,void 0,(function(){var t,e,n;return s(this,(function(r){return(t=this.bufferedRequests.shift())?(e=t.eventType,n=t.payload,[2,this.runtime.client.sendEvent(e,n)]):[2]}))}))},t.prototype.clear=function(){this.storage.removeItem("visitorId"),(new I).clear()},t.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},t.prototype.makeSearchEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.search,t)]}))}))},t.prototype.sendSearchEvent=function(t){var e=t.searchQueryUid,n=o(t,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchEvent(n)];case 1:return[2,t.sent().log({searchQueryUid:e})]}}))}))},t.prototype.makeClickEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.click,t)]}))}))},t.prototype.sendClickEvent=function(t){var e=t.searchQueryUid,n=o(t,["searchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeClickEvent(n)];case 1:return[2,t.sent().log({searchQueryUid:e})]}}))}))},t.prototype.makeCustomEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.custom,t)]}))}))},t.prototype.sendCustomEvent=function(t){var e=t.lastSearchQueryUid,n=o(t,["lastSearchQueryUid"]);return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCustomEvent(n)];case 1:return[2,t.sent().log({lastSearchQueryUid:e})]}}))}))},t.prototype.makeViewEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.makeEvent(n.view,t)]}))}))},t.prototype.sendViewEvent=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeViewEvent(t)];case 1:return[2,e.sent().log({})]}}))}))},t.prototype.getVisit=function(){return i(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,fetch("".concat(this.baseUrl,"/analytics/visit"))];case 1:return[4,e.sent().json()];case 2:return t=e.sent(),this.visitorId=t.visitorId,[2,t]}}))}))},t.prototype.getHealth=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(this.baseUrl,"/analytics/monitoring/health"))];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()]}}))}))},t.prototype.registerBeforeSendEventHook=function(t){this.beforeSendHooks.push(t)},t.prototype.registerAfterSendEventHook=function(t){this.afterSendHooks.push(t)},t.prototype.addEventTypeMapping=function(t,e){this.eventTypeMapping[t]=e},t.prototype.setAcceptedLinkReferrers=function(t){if(!Array.isArray(t)||!t.every((function(t){return"string"==typeof t})))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=t},t.prototype.parseVariableArgumentsPayload=function(t,e){for(var n={},o=0,i=e.length;o<i;o++){var s=e[o];if("string"==typeof s)n[t[o]]=s;else if("object"==typeof s)return r(r({},n),s)}return n},t.prototype.isKeyAllowedEmpty=function(t,e){var r;return-1!==(((r={})[n.search]=["queryText"],r)[t]||[]).indexOf(e)},t.prototype.removeEmptyPayloadValues=function(t,e){var n=this;return Object.keys(t).filter((function(r){return n.isKeyAllowedEmpty(e,r)||null!=(o=t[r])&&""!==o;var o})).reduce((function(e,n){var o;return r(r({},e),((o={})[n]=t[n],o))}),{})},t.prototype.removeUnknownParameters=function(t){var e=Object.keys(t).filter((function(t){if(function(t){return c(c(c([],Et,!0),X,!0),[At,Pt],!1).some((function(e){return e(t)}))}(t))return!0;console.log(t,"is not processed by coveoua")})).reduce((function(e,n){var o;return r(r({},e),((o={})[n]=t[n],o))}),{});return e},t.prototype.processCustomParameters=function(t){var e=t.custom,n=o(t,["custom"]),i={};e&&z(e)&&(i=this.lowercaseKeys(e));var s,c=K(s=n).reduce((function(t,e){var n,o=Ft(e);return r(r({},t),o?xt(o,s[e]):((n={})[e]=s[e],n))}),{});return r(r({},i),c)},t.prototype.mapCustomParametersToCustomData=function(t){var e=t.custom,n=o(t,["custom"]);if(e&&z(e)){var i=this.lowercaseKeys(e);return r(r({},n),{customData:r(r({},i),t.customData)})}return t},t.prototype.lowercaseKeys=function(t){var e=Object.keys(t),n={};return e.forEach((function(e){n[e.toLowerCase()]=t[e]})),n},t.prototype.validateParams=function(t,e){var r=t.anonymizeIp,i=o(t,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf("".concat(r).toLowerCase())&&(i.anonymizeIp=1),e!=n.view&&e!=n.click&&e!=n.search&&e!=n.custom||(i.originLevel3=this.limit(i.originLevel3,128)),e==n.view&&(i.location=this.limit(i.location,128)),"pageview"!=e&&"event"!=e||(i.referrer=this.limit(i.referrer,2048),i.location=this.limit(i.location,2048),i.page=this.limit(i.page,2048)),i},t.prototype.ensureAnonymousUserWhenUsingApiKey=function(t){var e,n=t.userId,r=o(t,["userId"]);return(null==(e=this.options.token)?void 0:e.startsWith("xx"))&&!n?(r.userId="anonymous",r):t},t.prototype.limit=function(t,e){return"string"!=typeof t?t:t.substring(0,e)},Object.defineProperty(t.prototype,"baseUrl",{get:function(){return Yt(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),t}(),$t=Object.freeze({__proto__:null,CoveoAnalyticsClient:Gt,Endpoints:jt,Version:Bt,buildBaseUrl:Yt,default:Gt}),Jt=r({},N),Xt=Object.keys(Jt).map((function(t){return Jt[t]})),Zt=function(t){function i(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r,i=t.call(this,{client:n,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return e(i,t),i.prototype.getApi=function(e){var n=t.prototype.getApi.call(this,e);if(null!==n)return n;switch(e){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(t){this.products.push(t)},i.prototype.addImpression=function(t){this.impressions.push(t)},i.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},i.prototype.addHooksForECEvents=function(){var t=this;this.client.registerBeforeSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xt.indexOf(e)?t.addECDataToPayload(e,o):o})),this.client.registerAfterSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xt.indexOf(e)&&t.updateLocationInformation(e,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Jt.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Jt.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(t,e){var n=r(r(r(r({},this.getLocationInformation(t,e)),this.getDefaultContextInformation(t)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),r(r(r(r({},i),o),n),e)},i.prototype.getProductPayload=function(){var t=this;return this.products.map((function(e){return t.assureProductValidity(e)})).reduce((function(e,n,o){return r(r({},e),function(t,e){return K(t).reduce((function(n,o){var i,s="pr".concat(e+1).concat(Z[o]||o);return r(r({},n),((i={})[s]=t[o],i))}),{})}(t.convertNumberTypes(n),o))}),{})},i.prototype.convertNumberTypes=function(t){var e=r({},t);return"quantity"in e&&(e.quantity=W(e.quantity)),"position"in e&&(e.position=W(e.position)),e},i.prototype.getImpressionPayload=function(){var t=this;return this.getImpressionsByList().map((function(e){var n=e.impressions,i=o(e,["impressions"]);return r(r({},i),{impressions:n.map((function(e){return t.assureBaseImpressionValidity(e)}))})})).reduce((function(t,e,n){return r(r({},t),function(t,e,n){var o=t.impressions.reduce((function(t,o,i){return r(r({},t),st(o,e,i,n))}),{});return t.listName&&(o["il".concat(e+1,"nm")]=t.listName),o}(e,n,"pi"))}),{})},i.prototype.assureProductValidity=function(t){var e=t.position,n=o(t,["position"]);return void 0!==e&&e<1?(console.warn("The position for product '".concat(t.name||t.id,"' must be greater ")+"than 0 when provided."),n):t},i.prototype.assureBaseImpressionValidity=function(t){var e=t.position,n=o(t,["position"]);return void 0!==e&&e<1?(console.warn("The position for impression '".concat(t.name||t.id,"'")+" must be greater than 0 when provided."),n):t},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(t,e){var n=e.list,r=o(e,["list"]),i=t.find((function(t){return t.listName===n}));return i?i.impressions.push(r):t.push({listName:n,impressions:[r]}),t}),[])},i.Id="ec",i}(H),te=Zt,ee=r({},N),ne=Object.keys(ee).map((function(t){return ee[t]})),re=function(t){function o(e){var n=e.client,r=e.uuidGenerator,o=void 0===r?L:r,i=t.call(this,{client:n,uuidGenerator:o})||this;return i.ticket={},i}return e(o,t),o.prototype.getApi=function(e){var n=t.prototype.getApi.call(this,e);return null!==n?n:"setTicket"===e?this.setTicket:null},o.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},o.prototype.setTicket=function(t){this.ticket=t},o.prototype.clearPluginData=function(){this.ticket={}},o.prototype.addHooksForSVCEvents=function(){var t=this;this.client.registerBeforeSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==ne.indexOf(e)?t.addSVCDataToPayload(e,o):o})),this.client.registerAfterSendEventHook((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==ne.indexOf(e)&&t.updateLocationInformation(e,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(ee.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(ee.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(t,e){var n,o=r(r(r(r({},this.getLocationInformation(t,e)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(n=this.actionData)&&void 0!==n?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),r(r(r({},i),o),e)},o.prototype.getTicketPayload=function(){return t=this.ticket,K(t).filter((function(e){return void 0!==t[e]})).reduce((function(e,n){var o,i=G[n]||n;return r(r({},e),((o={})[i]=t[n],o))}),{});var t},o.Id="svc",o}(H),oe=re,ie=function(){function t(){var t;this.registeredPluginsMap=((t={})[te.Id]=te,t[oe.Id]=oe,t[Y.Id]=Y,t),this.requiredPlugins={}}return t.prototype.require=function(t,e){var n=this.registeredPluginsMap[t];if(!n)throw new Error('No plugin named "'.concat(t,"\" is currently registered. If you use a custom plugin, use 'provide' first."));this.requiredPlugins[t]=new n(e)},t.prototype.provide=function(t,e){this.registeredPluginsMap[t]=e},t.prototype.clearRequired=function(){this.requiredPlugins={}},t.prototype.execute=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.requiredPlugins[t];if(!o)throw new Error('The plugin "'.concat(t,'" is not required. Check that you required it on initialization.'));var i=o.getApi(e);if(!i)throw new Error('The function "'.concat(e,'" does not exist on the plugin "').concat(t,'".'));if("function"!=typeof i)throw new Error('"'.concat(e,'" of the plugin "').concat(t,'" is not a function.'));return i.apply(o,n)},t.DefaultPlugins=[te.Id,oe.Id,Y.Id],t}(),se=function(){function t(){this.plugins=new ie,this.params={}}return t.prototype.init=function(t,e){var o=this;if(!t)throw new Error("You must pass your token when you call 'init'");if("string"==typeof t?this.client=new Gt({token:t,endpoint:this.getEndpoint(e)}):this.isAnalyticsClient(t)&&(this.client=t),!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(e).forEach((function(t){return o.plugins.require(t,i)})),this.client.registerBeforeSendEventHook((function(t,e){return r(r({},e),o.params)})),this.client.addEventTypeMapping(n.view,{newEventType:n.view,addClientIdParameter:!0})},t.prototype.isAnalyticsClient=function(t){return"object"==typeof t&&void 0!==t.sendEvent},t.prototype.getPluginKeys=function(t){return"string"==typeof t?ie.DefaultPlugins:Array.isArray(null==t?void 0:t.plugins)?t.plugins:ie.DefaultPlugins},t.prototype.getEndpoint=function(t){return"string"==typeof t?t||jt.default:(null==t?void 0:t.endpoint)?t.endpoint:jt.default},t.prototype.initForProxy=function(t){if(!t)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof t)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new Gt({endpoint:t})},t.prototype.set=function(t,e){var n=this;"string"==typeof t?this.params[t]=e:Object.keys(t).map((function(e){n.params[e]=t[e]}))},t.prototype.send=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!r)throw new Error('You must provide an event type when calling "send".');return(t=this.client).sendEvent.apply(t,c([r.toLowerCase()],o,!1))},t.prototype.onLoad=function(t){if(void 0===t)throw new Error("You must pass a function when you call 'onLoad'");t()},t.prototype.provide=function(t,e){this.plugins.provide(t,e)},t.prototype.require=function(t,e){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(t,r(r({},e),{client:this.client}))},t.prototype.callPlugin=function(t,e){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(!this.client)throw new Error("You must call init before calling a plugin function");return(n=this.plugins).execute.apply(n,c([t,e],r,!1))},t.prototype.reset=function(){this.client=void 0,this.plugins=new ie,this.params={}},t.prototype.version=function(){return q},t}(),ce=new se,ae=function(){return ce.client},ue=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(t);r[1];var o=r[2],i=r[3],s=ce[i];if(o&&i)return ce.callPlugin.apply(ce,c([o,i],e,!1));if(s)return s.apply(ce,e);throw new Error('The action "'.concat(t,'" does not exist. Available actions: ').concat(["init","set","send","onLoad","callPlugin","reset","require","provide","version"].join(", "),"."))},le=Object.freeze({__proto__:null,CoveoUA:se,coveoua:ce,default:ue,getCurrentClient:ae,handleOneAnalyticsEvent:ue});!function(t){t.contextChanged="contextChanged",t.expandToFullUI="expandToFullUI",t.openUserActions="openUserActions",t.showPrecedingSessions="showPrecedingSessions",t.showFollowingSessions="showFollowingSessions",t.clickViewedDocument="clickViewedDocument",t.clickPageView="clickPageView"}(Kt||(Kt={})),function(t){t.interfaceLoad="interfaceLoad",t.interfaceChange="interfaceChange",t.didyoumeanAutomatic="didyoumeanAutomatic",t.didyoumeanClick="didyoumeanClick",t.resultsSort="resultsSort",t.searchboxSubmit="searchboxSubmit",t.searchboxClear="searchboxClear",t.searchboxAsYouType="searchboxAsYouType",t.breadcrumbFacet="breadcrumbFacet",t.breadcrumbResetAll="breadcrumbResetAll",t.documentQuickview="documentQuickview",t.documentOpen="documentOpen",t.omniboxAnalytics="omniboxAnalytics",t.omniboxFromLink="omniboxFromLink",t.searchFromLink="searchFromLink",t.triggerNotify="notify",t.triggerExecute="execute",t.triggerQuery="query",t.undoTriggerQuery="undoQuery",t.triggerRedirect="redirect",t.pagerResize="pagerResize",t.pagerNumber="pagerNumber",t.pagerNext="pagerNext",t.pagerPrevious="pagerPrevious",t.pagerScrolling="pagerScrolling",t.staticFilterClearAll="staticFilterClearAll",t.staticFilterSelect="staticFilterSelect",t.staticFilterDeselect="staticFilterDeselect",t.facetClearAll="facetClearAll",t.facetSearch="facetSearch",t.facetSelect="facetSelect",t.facetSelectAll="facetSelectAll",t.facetDeselect="facetDeselect",t.facetExclude="facetExclude",t.facetUnexclude="facetUnexclude",t.facetUpdateSort="facetUpdateSort",t.facetShowMore="showMoreFacetResults",t.facetShowLess="showLessFacetResults",t.queryError="query",t.queryErrorBack="errorBack",t.queryErrorClear="errorClearQuery",t.queryErrorRetry="errorRetry",t.recommendation="recommendation",t.recommendationInterfaceLoad="recommendationInterfaceLoad",t.recommendationOpen="recommendationOpen",t.likeSmartSnippet="likeSmartSnippet",t.dislikeSmartSnippet="dislikeSmartSnippet",t.expandSmartSnippet="expandSmartSnippet",t.collapseSmartSnippet="collapseSmartSnippet",t.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",t.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",t.sendSmartSnippetReason="sendSmartSnippetReason",t.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",t.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",t.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",t.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",t.openSmartSnippetSource="openSmartSnippetSource",t.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",t.openSmartSnippetInlineLink="openSmartSnippetInlineLink",t.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",t.recentQueryClick="recentQueriesClick",t.clearRecentQueries="clearRecentQueries",t.recentResultClick="recentResultClick",t.clearRecentResults="clearRecentResults",t.noResultsBack="noResultsBack",t.showMoreFoldedResults="showMoreFoldedResults",t.showLessFoldedResults="showLessFoldedResults",t.copyToClipboard="copyToClipboard",t.caseAttach="caseAttach",t.caseDetach="caseDetach"}(Wt||(Wt={}));var pe=((zt={})[Wt.triggerNotify]="queryPipelineTriggers",zt[Wt.triggerExecute]="queryPipelineTriggers",zt[Wt.triggerQuery]="queryPipelineTriggers",zt[Wt.triggerRedirect]="queryPipelineTriggers",zt[Wt.queryError]="errors",zt[Wt.queryErrorBack]="errors",zt[Wt.queryErrorClear]="errors",zt[Wt.queryErrorRetry]="errors",zt[Wt.pagerNext]="getMoreResults",zt[Wt.pagerPrevious]="getMoreResults",zt[Wt.pagerNumber]="getMoreResults",zt[Wt.pagerResize]="getMoreResults",zt[Wt.pagerScrolling]="getMoreResults",zt[Wt.facetSearch]="facet",zt[Wt.facetShowLess]="facet",zt[Wt.facetShowMore]="facet",zt[Wt.recommendation]="recommendation",zt[Wt.likeSmartSnippet]="smartSnippet",zt[Wt.dislikeSmartSnippet]="smartSnippet",zt[Wt.expandSmartSnippet]="smartSnippet",zt[Wt.collapseSmartSnippet]="smartSnippet",zt[Wt.openSmartSnippetFeedbackModal]="smartSnippet",zt[Wt.closeSmartSnippetFeedbackModal]="smartSnippet",zt[Wt.sendSmartSnippetReason]="smartSnippet",zt[Wt.expandSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",zt[Wt.clearRecentQueries]="recentQueries",zt[Wt.recentResultClick]="recentlyClickedDocuments",zt[Wt.clearRecentResults]="recentlyClickedDocuments",zt[Wt.showLessFoldedResults]="folding",zt[Kt.expandToFullUI]="interface",zt[Kt.openUserActions]="User Actions",zt[Kt.showPrecedingSessions]="User Actions",zt[Kt.showFollowingSessions]="User Actions",zt[Kt.clickViewedDocument]="User Actions",zt[Kt.clickPageView]="User Actions",zt[Wt.caseDetach]="case",zt),he=function(){function t(){this.runtime=new _t,this.currentVisitorId=""}return t.prototype.getPayload=function(){return Promise.resolve()},t.prototype.getParameters=function(){return Promise.resolve()},t.prototype.makeEvent=function(t){return Promise.resolve({eventType:t,payload:null,log:function(){return Promise.resolve()}})},t.prototype.sendEvent=function(){return Promise.resolve()},t.prototype.makeSearchEvent=function(){return this.makeEvent(n.search)},t.prototype.sendSearchEvent=function(){return Promise.resolve()},t.prototype.makeClickEvent=function(){return this.makeEvent(n.click)},t.prototype.sendClickEvent=function(){return Promise.resolve()},t.prototype.makeCustomEvent=function(){return this.makeEvent(n.custom)},t.prototype.sendCustomEvent=function(){return Promise.resolve()},t.prototype.makeViewEvent=function(){return this.makeEvent(n.view)},t.prototype.sendViewEvent=function(){return Promise.resolve()},t.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},t.prototype.getHealth=function(){return Promise.resolve({status:""})},t.prototype.registerBeforeSendEventHook=function(){},t.prototype.registerAfterSendEventHook=function(){},t.prototype.addEventTypeMapping=function(){},Object.defineProperty(t.prototype,"version",{get:function(){return q},enumerable:!1,configurable:!0}),t}();function de(t){var e=t.join(";");return e.length<=256?e:de(t.slice(1))}var ve=function(t){var e=function(t){return t.map((function(t){return t.replace(/;/g,"")}))}(t),n=function(t){var e="";return t.filter((function(t){var n=t!==e;return e=t,n}))}(e);return de(n)};function fe(t){var e="string"==typeof t.partialQueries?t.partialQueries:ve(t.partialQueries),n="string"==typeof t.suggestions?t.suggestions:ve(t.suggestions);return r(r({},t),{partialQueries:e,suggestions:n})}var ge,me,ye,Se=function(){function t(t,e){this.opts=t,this.provider=e;var n=!1===t.enableAnalytics||Qt();this.coveoAnalyticsClient=n?new he:new Gt(t)}return t.prototype.disable=function(){this.coveoAnalyticsClient instanceof Gt&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new he},t.prototype.enable=function(){this.coveoAnalyticsClient=new Gt(this.opts)},t.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(Wt.interfaceLoad)},t.prototype.logInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeInterfaceLoad()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(Wt.recommendationInterfaceLoad)},t.prototype.logRecommendationInterfaceLoad=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeRecommendationInterfaceLoad()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecommendation=function(){return this.makeCustomEvent(Wt.recommendation)},t.prototype.logRecommendation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeRecommendation()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecommendationOpen=function(t,e){return this.makeClickEvent(Wt.recommendationOpen,t,e)},t.prototype.logRecommendationOpen=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecommendationOpen(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeStaticFilterClearAll=function(t){return this.makeSearchEvent(Wt.staticFilterClearAll,t)},t.prototype.logStaticFilterClearAll=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeStaticFilterClearAll(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeStaticFilterSelect=function(t){return this.makeSearchEvent(Wt.staticFilterSelect,t)},t.prototype.logStaticFilterSelect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeStaticFilterSelect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeStaticFilterDeselect=function(t){return this.makeSearchEvent(Wt.staticFilterDeselect,t)},t.prototype.logStaticFilterDeselect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeStaticFilterDeselect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(Wt.pagerScrolling,{type:"getMoreResults"})},t.prototype.logFetchMoreResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeFetchMoreResults()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeInterfaceChange=function(t){return this.makeSearchEvent(Wt.interfaceChange,t)},t.prototype.logInterfaceChange=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeInterfaceChange(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(Wt.didyoumeanAutomatic)},t.prototype.logDidYouMeanAutomatic=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeDidYouMeanAutomatic()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(Wt.didyoumeanClick)},t.prototype.logDidYouMeanClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeDidYouMeanClick()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeResultsSort=function(t){return this.makeSearchEvent(Wt.resultsSort,t)},t.prototype.logResultsSort=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeResultsSort(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(Wt.searchboxSubmit)},t.prototype.logSearchboxSubmit=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchboxSubmit()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(Wt.searchboxClear)},t.prototype.logSearchboxClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchboxClear()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(Wt.searchboxAsYouType)},t.prototype.logSearchboxAsYouType=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchboxAsYouType()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeBreadcrumbFacet=function(t){return this.makeSearchEvent(Wt.breadcrumbFacet,t)},t.prototype.logBreadcrumbFacet=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeBreadcrumbFacet(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(Wt.breadcrumbResetAll)},t.prototype.logBreadcrumbResetAll=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeBreadcrumbResetAll()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDocumentQuickview=function(t,e){return this.makeClickEvent(Wt.documentQuickview,t,e)},t.prototype.logDocumentQuickview=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentQuickview(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDocumentOpen=function(t,e){return this.makeClickEvent(Wt.documentOpen,t,e)},t.prototype.logDocumentOpen=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentOpen(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOmniboxAnalytics=function(t){return this.makeSearchEvent(Wt.omniboxAnalytics,fe(t))},t.prototype.logOmniboxAnalytics=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOmniboxAnalytics(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOmniboxFromLink=function(t){return this.makeSearchEvent(Wt.omniboxFromLink,fe(t))},t.prototype.logOmniboxFromLink=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeOmniboxFromLink(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(Wt.searchFromLink)},t.prototype.logSearchFromLink=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeSearchFromLink()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerNotify=function(t){return this.makeCustomEvent(Wt.triggerNotify,t)},t.prototype.logTriggerNotify=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerNotify(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerExecute=function(t){return this.makeCustomEvent(Wt.triggerExecute,t)},t.prototype.logTriggerExecute=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerExecute(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(Wt.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},t.prototype.logTriggerQuery=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeTriggerQuery()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeUndoTriggerQuery=function(t){return this.makeSearchEvent(Wt.undoTriggerQuery,t)},t.prototype.logUndoTriggerQuery=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeUndoTriggerQuery(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeTriggerRedirect=function(t){return this.makeCustomEvent(Wt.triggerRedirect,r(r({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))},t.prototype.logTriggerRedirect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeTriggerRedirect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerResize=function(t){return this.makeCustomEvent(Wt.pagerResize,t)},t.prototype.logPagerResize=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerResize(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerNumber=function(t){return this.makeCustomEvent(Wt.pagerNumber,t)},t.prototype.logPagerNumber=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerNumber(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerNext=function(t){return this.makeCustomEvent(Wt.pagerNext,t)},t.prototype.logPagerNext=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerNext(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerPrevious=function(t){return this.makeCustomEvent(Wt.pagerPrevious,t)},t.prototype.logPagerPrevious=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makePagerPrevious(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makePagerScrolling=function(){return this.makeCustomEvent(Wt.pagerScrolling)},t.prototype.logPagerScrolling=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makePagerScrolling()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetClearAll=function(t){return this.makeSearchEvent(Wt.facetClearAll,t)},t.prototype.logFacetClearAll=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetClearAll(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetSearch=function(t){return this.makeSearchEvent(Wt.facetSearch,t)},t.prototype.logFacetSearch=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetSearch(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetSelect=function(t){return this.makeSearchEvent(Wt.facetSelect,t)},t.prototype.logFacetSelect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetSelect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetDeselect=function(t){return this.makeSearchEvent(Wt.facetDeselect,t)},t.prototype.logFacetDeselect=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetDeselect(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetExclude=function(t){return this.makeSearchEvent(Wt.facetExclude,t)},t.prototype.logFacetExclude=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetExclude(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetUnexclude=function(t){return this.makeSearchEvent(Wt.facetUnexclude,t)},t.prototype.logFacetUnexclude=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetUnexclude(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetSelectAll=function(t){return this.makeSearchEvent(Wt.facetSelectAll,t)},t.prototype.logFacetSelectAll=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetSelectAll(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetUpdateSort=function(t){return this.makeSearchEvent(Wt.facetUpdateSort,t)},t.prototype.logFacetUpdateSort=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetUpdateSort(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetShowMore=function(t){return this.makeCustomEvent(Wt.facetShowMore,t)},t.prototype.logFacetShowMore=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetShowMore(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeFacetShowLess=function(t){return this.makeCustomEvent(Wt.facetShowLess,t)},t.prototype.logFacetShowLess=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeFacetShowLess(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryError=function(t){return this.makeCustomEvent(Wt.queryError,t)},t.prototype.logQueryError=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeQueryError(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryErrorBack=function(){return i(this,void 0,void 0,(function(){var t,e=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(Wt.queryErrorBack)];case 1:return[2,{description:(t=n.sent()).description,log:function(){return i(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.log({searchUID:this.provider.getSearchUID()})];case 1:return e.sent(),[2,this.logSearchEvent(Wt.queryErrorBack)]}}))}))}}]}}))}))},t.prototype.logQueryErrorBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryErrorBack()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){var t,e=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(Wt.queryErrorRetry)];case 1:return[2,{description:(t=n.sent()).description,log:function(){return i(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.log({searchUID:this.provider.getSearchUID()})];case 1:return e.sent(),[2,this.logSearchEvent(Wt.queryErrorRetry)]}}))}))}}]}}))}))},t.prototype.logQueryErrorRetry=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryErrorRetry()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeQueryErrorClear=function(){return i(this,void 0,void 0,(function(){var t,e=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCustomEvent(Wt.queryErrorClear)];case 1:return[2,{description:(t=n.sent()).description,log:function(){return i(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.log({searchUID:this.provider.getSearchUID()})];case 1:return e.sent(),[2,this.logSearchEvent(Wt.queryErrorClear)]}}))}))}}]}}))}))},t.prototype.logQueryErrorClear=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeQueryErrorClear()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(Wt.likeSmartSnippet)},t.prototype.logLikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeLikeSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(Wt.dislikeSmartSnippet)},t.prototype.logDislikeSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeDislikeSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(Wt.expandSmartSnippet)},t.prototype.logExpandSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeExpandSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(Wt.collapseSmartSnippet)},t.prototype.logCollapseSmartSnippet=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCollapseSmartSnippet()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Wt.openSmartSnippetFeedbackModal)},t.prototype.logOpenSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeOpenSmartSnippetFeedbackModal()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(Wt.closeSmartSnippetFeedbackModal)},t.prototype.logCloseSmartSnippetFeedbackModal=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeCloseSmartSnippetFeedbackModal()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSmartSnippetFeedbackReason=function(t,e){return this.makeCustomEvent(Wt.sendSmartSnippetReason,{reason:t,details:e})},t.prototype.logSmartSnippetFeedbackReason=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeExpandSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})},t.prototype.logExpandSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeExpandSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCollapseSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})},t.prototype.logCollapseSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeCollapseSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowMoreSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.showMoreSmartSnippetSuggestion,t)},t.prototype.logShowMoreSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowMoreSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowLessSmartSnippetSuggestion=function(t){return this.makeCustomEvent(Wt.showLessSmartSnippetSuggestion,t)},t.prototype.logShowLessSmartSnippetSuggestion=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.makeShowLessSmartSnippetSuggestion(t)];case 1:return[2,e.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetSource=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetSource,t,e)},t.prototype.logOpenSmartSnippetSource=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSource(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetSuggestionSource=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetSuggestionSource,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},e)},t.prototype.makeCopyToClipboard=function(t,e){return this.makeClickEvent(Wt.copyToClipboard,t,e)},t.prototype.logCopyToClipboard=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCopyToClipboard(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.logOpenSmartSnippetSuggestionSource=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetInlineLink=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetInlineLink,t,{contentIDKey:e.contentIDKey,contentIDValue:e.contentIDValue},e)},t.prototype.logOpenSmartSnippetInlineLink=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(t,e){return this.makeClickEvent(Wt.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},e)},t.prototype.logOpenSmartSnippetSuggestionInlineLink=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(Wt.recentQueryClick)},t.prototype.logRecentQueryClick=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeRecentQueryClick()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(Wt.clearRecentQueries)},t.prototype.logClearRecentQueries=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeClearRecentQueries()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeRecentResultClick=function(t,e){return this.makeCustomEvent(Wt.recentResultClick,{info:t,identifier:e})},t.prototype.logRecentResultClick=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecentResultClick(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(Wt.clearRecentResults)},t.prototype.logClearRecentResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeClearRecentResults()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(Wt.noResultsBack)},t.prototype.logNoResultsBack=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeNoResultsBack()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowMoreFoldedResults=function(t,e){return this.makeClickEvent(Wt.showMoreFoldedResults,t,e)},t.prototype.logShowMoreFoldedResults=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeShowMoreFoldedResults(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(Wt.showLessFoldedResults)},t.prototype.logShowLessFoldedResults=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.makeShowLessFoldedResults()];case 1:return[2,t.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeEventDescription=function(t,e){var n;return{actionCause:e,customData:null===(n=t.payload)||void 0===n?void 0:n.customData}},t.prototype.makeCustomEvent=function(t,e,n){return void 0===n&&(n=pe[t]),i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=r(r({},this.provider.getBaseMetadata()),e),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:n,eventValue:t}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,t),log:function(t){var e=t.searchUID;return a.log({lastSearchQueryUid:e})}}]}}))}))},t.prototype.logCustomEvent=function(t,e,n){return void 0===n&&(n=pe[t]),i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(t,e,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeCustomEventWithType=function(t,e,n){return i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return o=r(r({},this.provider.getBaseMetadata()),n),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:e,eventValue:t}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,t),log:function(t){var e=t.searchUID;return a.log({lastSearchQueryUid:e})}}]}}))}))},t.prototype.logCustomEventWithType=function(t,e,n){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEventWithType(t,e,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.logSearchEvent=function(t,e){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSearchEvent(t,e)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.makeSearchEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(t,e)];case 1:return n=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(n)];case 2:return r=o.sent(),[2,{description:this.makeEventDescription(r,t),log:function(t){var e=t.searchUID;return r.log({searchQueryUid:e})}}]}}))}))},t.prototype.makeClickEvent=function(t,e,n,o){return i(this,void 0,void 0,(function(){var i,c,a;return s(this,(function(s){switch(s.label){case 0:return c=[r({},e)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:t}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,t),log:function(t){var e=t.searchUID;return a.log({searchQueryUid:e})}}]}}))}))},t.prototype.logClickEvent=function(t,e,n,r){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(t,e,n,r)];case 1:return[2,o.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},t.prototype.getBaseSearchEventRequest=function(t,e){return i(this,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{queryPipeline:this.provider.getPipeline(),actionCause:t}])]}}))}))},t.prototype.getBaseEventRequest=function(t){return i(this,void 0,void 0,(function(){var e,n,o;return s(this,(function(i){switch(i.label){case 0:return e=r(r({},this.provider.getBaseMetadata()),t),n=[r(r({},this.getOrigins()),this.getSplitTestRun())],o={customData:e,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,r.apply(void 0,n.concat([(o.clientId=i.sent(),o)]))]}}))}))},t.prototype.getOrigins=function(){var t,e;return{originContext:null===(e=(t=this.provider).getOriginContext)||void 0===e?void 0:e.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},t.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof Gt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},t.prototype.getSplitTestRun=function(){var t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",e=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return r(r({},t&&{splitTestRunName:t}),e&&{splitTestRunVersion:e})},t}();!function(t){t.click="click",t.flowStart="flowStart"}(ge||(ge={})),function(t){t.enterInterface="ticket_create_start",t.fieldUpdate="ticket_field_update",t.fieldSuggestionClick="ticket_classification_click",t.suggestionClick="suggestion_click",t.suggestionRate="suggestion_rate",t.nextCaseStep="ticket_next_stage",t.caseCancelled="ticket_cancel",t.caseSolved="ticket_cancel",t.caseCreated="ticket_create"}(me||(me={})),function(t){t.quit="Quit",t.solved="Solved"}(ye||(ye={}));var ke=function(){function t(t,e){var n;this.options=t,this.provider=e;var r=(null===(n=t.enableAnalytics)||void 0===n||n)&&!Qt();this.coveoAnalyticsClient=r?new Gt(t):new he,this.svc=new re({client:this.coveoAnalyticsClient})}return t.prototype.disable=function(){this.coveoAnalyticsClient instanceof Gt&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new he,this.svc=new re({client:this.coveoAnalyticsClient})},t.prototype.enable=function(){this.coveoAnalyticsClient=new Gt(this.options),this.svc=new re({client:this.coveoAnalyticsClient})},t.prototype.logEnterInterface=function(t){return this.svc.setAction(me.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()},t.prototype.logUpdateCaseField=function(t){return this.svc.setAction(me.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logSelectFieldSuggestion=function(t){return this.svc.setAction(me.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logSelectDocumentSuggestion=function(t){return this.svc.setAction(me.suggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logRateDocumentSuggestion=function(t){return this.svc.setAction(me.suggestionRate,r({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logMoveToNextCaseStep=function(t){return this.svc.setAction(me.nextCaseStep,{stage:null==t?void 0:t.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logCaseCancelled=function(t){return this.svc.setAction(me.caseCancelled,{reason:ye.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logCaseSolved=function(t){return this.svc.setAction(me.caseSolved,{reason:ye.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.logCaseCreated=function(t){return this.svc.setAction(me.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()},t.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",ge.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},t.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",ge.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},t}(),we=function(t,e){void 0===e&&(e=!0),t.caseContext;var n=t.caseId,i=t.caseNumber,s=o(t,["caseContext","caseId","caseNumber"]),c=function(t){var e={};return t.caseContext&&Object.keys(t.caseContext).forEach((function(n){var r,o=null===(r=t.caseContext)||void 0===r?void 0:r[n];if(o){var i="context_".concat(n);e[i]=o}})),e}(t);return r(r(r({CaseId:n,CaseNumber:i},s),!!c.context_Case_Subject&&{CaseSubject:c.context_Case_Subject}),e&&c)},Ie=function(){function t(t,e){this.opts=t,this.provider=e;var n=!1===t.enableAnalytics||Qt();this.coveoAnalyticsClient=n?new he:new Gt(t)}return t.prototype.disable=function(){this.coveoAnalyticsClient instanceof Gt&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new he},t.prototype.enable=function(){this.coveoAnalyticsClient=new Gt(this.opts)},t.prototype.logInterfaceLoad=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.interfaceLoad,e)}return this.logSearchEvent(Wt.interfaceLoad)},t.prototype.logInterfaceChange=function(t){var e=we(t);return this.logSearchEvent(Wt.interfaceChange,e)},t.prototype.logStaticFilterDeselect=function(t){var e=we(t);return this.logSearchEvent(Wt.staticFilterDeselect,e)},t.prototype.logFetchMoreResults=function(t){if(t){var e=we(t);return this.logCustomEvent(Wt.pagerScrolling,r(r({},e),{type:"getMoreResults"}))}return this.logCustomEvent(Wt.pagerScrolling,{type:"getMoreResults"})},t.prototype.logBreadcrumbFacet=function(t){var e=we(t);return this.logSearchEvent(Wt.breadcrumbFacet,e)},t.prototype.logBreadcrumbResetAll=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.breadcrumbResetAll,e)}return this.logSearchEvent(Wt.breadcrumbResetAll)},t.prototype.logFacetSelect=function(t){var e=we(t);return this.logSearchEvent(Wt.facetSelect,e)},t.prototype.logFacetDeselect=function(t){var e=we(t);return this.logSearchEvent(Wt.facetDeselect,e)},t.prototype.logFacetUpdateSort=function(t){var e=we(t);return this.logSearchEvent(Wt.facetUpdateSort,e)},t.prototype.logFacetClearAll=function(t){var e=we(t);return this.logSearchEvent(Wt.facetClearAll,e)},t.prototype.logFacetShowMore=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.facetShowMore,e)},t.prototype.logFacetShowLess=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.facetShowLess,e)},t.prototype.logQueryError=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.queryError,e)},t.prototype.logPagerNumber=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.pagerNumber,e)},t.prototype.logPagerNext=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.pagerNext,e)},t.prototype.logPagerPrevious=function(t){var e=we(t,!1);return this.logCustomEvent(Wt.pagerPrevious,e)},t.prototype.logDidYouMeanAutomatic=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.didyoumeanAutomatic,e)}return this.logSearchEvent(Wt.didyoumeanAutomatic)},t.prototype.logDidYouMeanClick=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.didyoumeanClick,e)}return this.logSearchEvent(Wt.didyoumeanClick)},t.prototype.logResultsSort=function(t){var e=we(t);return this.logSearchEvent(Wt.resultsSort,e)},t.prototype.logSearchboxSubmit=function(t){if(t){var e=we(t);return this.logSearchEvent(Wt.searchboxSubmit,e)}return this.logSearchEvent(Wt.searchboxSubmit)},t.prototype.logContextChanged=function(t){var e=we(t);return this.logSearchEvent(Kt.contextChanged,e)},t.prototype.logExpandToFullUI=function(t){var e=we(t);return this.logCustomEvent(Kt.expandToFullUI,e)},t.prototype.logOpenUserActions=function(t){var e=we(t,!1);return this.logCustomEvent(Kt.openUserActions,e)},t.prototype.logShowPrecedingSessions=function(t){var e=we(t,!1);return this.logCustomEvent(Kt.showPrecedingSessions,e)},t.prototype.logShowFollowingSessions=function(t){var e=we(t,!1);return this.logCustomEvent(Kt.showFollowingSessions,e)},t.prototype.logViewedDocumentClick=function(t,e){return this.logCustomEvent(Kt.clickViewedDocument,r(r({},we(e,!1)),{document:t}))},t.prototype.logPageViewClick=function(t,e){return this.logCustomEvent(Kt.clickPageView,r(r({},we(e,!1)),{pageView:t}))},t.prototype.logDocumentOpen=function(t,e,n){return this.logClickEvent(Wt.documentOpen,t,e,n?we(n,!1):void 0)},t.prototype.logCopyToClipboard=function(t,e,n){return this.logClickEvent(Wt.copyToClipboard,t,e,n?we(n,!1):void 0)},t.prototype.logDocumentQuickview=function(t,e,n){var o={documentTitle:t.documentTitle,documentURL:t.documentUrl};return this.logClickEvent(Wt.documentQuickview,t,e,n?r(r({},we(n,!1)),o):o)},t.prototype.logCaseAttach=function(t,e,n){var o={documentTitle:t.documentTitle,documentURL:t.documentUrl,resultUriHash:t.documentUriHash};return this.logClickEvent(Wt.caseAttach,t,e,n?r(r({},we(n,!1)),o):o)},t.prototype.logCaseDetach=function(t,e){return this.logCustomEvent(Wt.caseDetach,e?r(r({},we(e,!1)),{resultUriHash:t}):{resultUriHash:t})},t.prototype.logLikeSmartSnippet=function(t){return this.logCustomEvent(Wt.likeSmartSnippet,t?we(t,!1):void 0)},t.prototype.logDislikeSmartSnippet=function(t){return this.logCustomEvent(Wt.dislikeSmartSnippet,t?we(t,!1):void 0)},t.prototype.logExpandSmartSnippet=function(t){return this.logCustomEvent(Wt.expandSmartSnippet,t?we(t,!1):void 0)},t.prototype.logCollapseSmartSnippet=function(t){return this.logCustomEvent(Wt.collapseSmartSnippet,t?we(t,!1):void 0)},t.prototype.logOpenSmartSnippetFeedbackModal=function(t){return this.logCustomEvent(Wt.openSmartSnippetFeedbackModal,t?we(t,!1):void 0)},t.prototype.logCloseSmartSnippetFeedbackModal=function(t){return this.logCustomEvent(Wt.closeSmartSnippetFeedbackModal,t?we(t,!1):void 0)},t.prototype.logSmartSnippetFeedbackReason=function(t,e,n){return this.logCustomEvent(Wt.sendSmartSnippetReason,n?r(r({},we(n,!1)),{reason:t,details:e}):{reason:t,details:e})},t.prototype.logExpandSmartSnippetSuggestion=function(t,e){var n="documentId"in t?t:{documentId:t};return this.logCustomEvent(Wt.expandSmartSnippetSuggestion,e?r(r({},we(e,!1)),n):n)},t.prototype.logCollapseSmartSnippetSuggestion=function(t,e){var n="documentId"in t?t:{documentId:t};return this.logCustomEvent(Wt.collapseSmartSnippetSuggestion,e?r(r({},we(e,!1)),n):n)},t.prototype.logOpenSmartSnippetSource=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetSource,t,e,n?we(n,!1):void 0)},t.prototype.logOpenSmartSnippetSuggestionSource=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetSuggestionSource,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},n?r(r({},we(n,!1)),e):e)},t.prototype.logOpenSmartSnippetInlineLink=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetInlineLink,t,{contentIDKey:e.contentIDKey,contentIDValue:e.contentIDValue},n?r(r({},we(n,!1)),e):e)},t.prototype.logOpenSmartSnippetSuggestionInlineLink=function(t,e,n){return this.logClickEvent(Wt.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:e.documentId.contentIdKey,contentIDValue:e.documentId.contentIdValue},n?r(r({},we(n,!1)),e):e)},t.prototype.logCustomEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,o,i;return s(this,(function(s){switch(s.label){case 0:return n=r(r({},this.provider.getBaseMetadata()),e),i=[{}],[4,this.getBaseCustomEventRequest(n)];case 1:return o=r.apply(void 0,[r.apply(void 0,i.concat([s.sent()])),{eventType:pe[t],eventValue:t}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},t.prototype.logSearchEvent=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return r=(n=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(t,e)];case 1:return[2,r.apply(n,[o.sent()])]}}))}))},t.prototype.logClickEvent=function(t,e,n,o){return i(this,void 0,void 0,(function(){var i,c;return s(this,(function(s){switch(s.label){case 0:return c=[r({},e)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t}]),[2,this.coveoAnalyticsClient.sendClickEvent(i)]}}))}))},t.prototype.getBaseCustomEventRequest=function(t){return i(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return e=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,r.apply(void 0,[r.apply(void 0,e.concat([n.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},t.prototype.getBaseSearchEventRequest=function(t,e){return i(this,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.concat([o.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t}])]}}))}))},t.prototype.getBaseEventRequest=function(t){return i(this,void 0,void 0,(function(){var e,n,o;return s(this,(function(i){switch(i.label){case 0:return e=r(r({},this.provider.getBaseMetadata()),t),n=[r({},this.getOrigins())],o={customData:e,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,r.apply(void 0,n.concat([(o.clientId=i.sent(),o)]))]}}))}))},t.prototype.getOrigins=function(){var t,e;return{originContext:null===(e=(t=this.provider).getOriginContext)||void 0===e?void 0:e.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},t.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof Gt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},t}(),be=Object.freeze({__proto__:null,get CaseAssistActions(){return me},CaseAssistClient:ke,get CaseAssistEvents(){return ge},get CaseCancelledReasons(){return ye},CoveoAnalyticsClient:Gt,CoveoInsightClient:Ie,CoveoSearchPageClient:Se,CoveoUA:se,CustomEventsTypes:pe,get EventType(){return n},get InsightEvents(){return Kt},get SearchPageEvents(){return Wt},SimpleAnalytics:le,analytics:$t,donottrack:Ht,getCurrentClient:ae,handleOneAnalyticsEvent:ue,history:b,storage:k});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 Ee=self.coveoua||ue;if(self.coveoua=ue,self.coveoanalytics=be,Ee.q){var Ce=Ee.q.filter((function(t){return"init"===t[0]})),De=Ee.q.filter((function(t){return"init"!==t[0]}));c(c([],Ce,!0),De,!0).forEach((function(t){return ue.apply(void 0,t)}))}return self.coveoua}();
2
2
  //# sourceMappingURL=coveoua.browser.js.map
@@ -725,7 +725,7 @@
725
725
  const v5 = v35('v5', 0x50, sha1);
726
726
  var uuidv5 = v5;
727
727
 
728
- var libVersion = "2.27.1" ;
728
+ var libVersion = "2.27.3" ;
729
729
 
730
730
  var getFormattedLocation = function (location) {
731
731
  return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(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,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function c(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function a(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}function p(){return a()&&navigator.cookieEnabled}!function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"}(n||(n={}));var h=[n.click,n.custom,n.search,n.view],d=function(e,t){return-1!==h.indexOf(e)?r({language:u()?document.documentElement.lang:"unknown",userAgent:a()?navigator.userAgent:"unknown"},t):t},f=function(){function e(){}return e.set=function(e,t,n){var r,o,i;n&&(r=new Date).setTime(r.getTime()+n),-1===(i=window.location.hostname).indexOf(".")?v(e,t,r):v(e,t,r,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},e.get=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];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,n,r){document.cookie="".concat(e,"=").concat(t)+(n?";expires=".concat(n.toUTCString()):"")+(r?";domain=".concat(r):"")+";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("".concat(e.prefix).concat(t))},e.prototype.removeItem=function(t){f.erase("".concat(e.prefix).concat(t))},e.prototype.setItem=function(t,n,r){f.set("".concat(e.prefix).concat(t),n,r)},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,CookieAndLocalStorage:y,CookieStorage:m,NullStorage:S,getAvailableStorage:g,preferredStorage:null}),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(n){switch(n.label){case 0:return e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=n.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,n=e.time,r=e.value;return t&&"string"==typeof r&&"query"===t.toLowerCase()&&""===r.trim()?{name:t,time:n}:e},e.prototype.stripEmptyQueries=function(e){var t=this;return e.map((function(e){return t.stripEmptyQuery(e)}))},e}(),b=Object.freeze({__proto__:null,HistoryStore:I,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MAX_VALUE_SIZE:75,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,STORE_KEY:w,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!==n.view?[3,2]:[4,C(t.contentIdValue)];case 1:return o.sent(),[2,r({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,n;return s(this,(function(r){switch(r.label){case 0:return t=new I,n={name:"PageView",value:e,time:JSON.stringify(new Date)},[4,t.addElementAsync(n)];case 1:return r.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,n){if(T.randomUUID&&!t&&!e)return T.randomUUID();const r=(e=e||{}).random||(e.rng||R)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return x(r)}function O(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function V(e,t){return e<<t|e>>>32-t}var M=function(e,t,n){function r(e,r,o,i){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=function(e){if(!P(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(r),c.set(e,r.length),c=n(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=c[e];return o}return x(c)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const r=e.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let t=0;t<o;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];i[t]=n}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 r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=i[e][t];for(let e=16;e<80;++e)r[e]=V(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let o=n[0],s=n[1],c=n[2],a=n[3],u=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),i=V(o,5)+O(n,s,c,a)+u+t[n]+r[e]>>>0;u=a,a=c,c=V(s,30)>>>0,s=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+s>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+a>>>0,n[4]=n[4]+u>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),q="2.27.1",_=function(e){return"".concat(e.protocol,"//").concat(e.hostname).concat(0===e.pathname.indexOf("/")?e.pathname:"/".concat(e.pathname)).concat(e.search)},N={pageview:"pageview",event:"event"},Q=function(e){var t=e.client,n=e.uuidGenerator,r=void 0===n?L:n;this.client=t,this.uuidGenerator=r},H=function(e){function n(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r,i=e.call(this,{client:n,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=_(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return t(n,e),n.prototype.getApi=function(e){return"setAction"===e?this.setAction:null},n.prototype.setAction=function(e,t){this.action=e,this.actionData=t},n.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},n.prototype.getLocationInformation=function(e,t){return r({hitType:e},this.getNextValues(e,t))},n.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},n.prototype.getDefaultContextInformation=function(e){var t={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},n={screenResolution:"".concat(screen.width,"x").concat(screen.height),screenColor:"".concat(screen.colorDepth,"-bit")},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return r(r(r(r({},i),n),o),t)},n.prototype.updateLocationForNextPageView=function(e,t){var n=this.getNextValues(e,t),r=n.pageViewId,o=n.referrer,i=n.location;this.lastReferrer=o,this.pageViewId=r,this.currentLocation=i,e===N.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},n.prototype.getNextValues=function(e,t){return{pageViewId:e===N.pageview?this.nextPageViewId:this.pageViewId,referrer:e===N.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===N.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},n.prototype.getCurrentLocationFromPayload=function(e){if(e.page){return"".concat((t=this.currentLocation,t.split("/").slice(0,3).join("/"))).concat(e.page.replace(/^\/?(.*)$/,"/$1"))}return _(window.location);var t},n}(Q),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 n=new URL(e);return t.some((function(e){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host)}))}catch(e){return!1}},e.fromString=function(t){var n=t.split(".");if(2!==n.length)return null;var r=n[0],o=n[1];if(32!==r.length||isNaN(parseInt(o)))return null;var i=r.substring(0,8)+"-"+r.substring(8,12)+"-"+r.substring(12,16)+"-"+r.substring(16,20)+"-"+r.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 n(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r;return e.call(this,{client:n,uuidGenerator:o})||this}return t(n,e),n.prototype.getApi=function(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},n.prototype.decorate=function(e){return i(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");r.label=1;case 1:return r.trys.push([1,3,,4]),t=new URL(e),[4,this.client.getCurrentVisitorId()];case 2:return n=r.sent(),t.searchParams.set(B.cvo_cid,new B(n,Date.now()).toString()),[2,t.toString()];case 3:throw r.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},n.prototype.acceptFrom=function(e){this.client.setAcceptedLinkReferrers(e)},n.Id="link",n}(Q),Y=j,K=Object.keys;function z(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function W(e){return"string"!=typeof e||""==e||Number.isNaN(+e)?e:+e}var G={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"},$=c([],K(G).map((function(e){return G[e]})),!0).join("|"),J=new RegExp("^(".concat($,"$)")),X=[function(e){return J.test(e)}],Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ee={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},te={action:"pa",list:"pal",listSource:"pls"},ne={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},re={id:"quoteId",affiliation:"quoteAffiliation"},oe={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ie={add:te,bookmark_add:te,bookmark_remove:te,click:te,checkout:te,checkout_option:te,detail:te,impression:te,remove:te,refund:r(r({},te),ne),purchase:r(r({},te),ne),quickview:te,quote:r(r({},te),re),review:r(r({},te),oe)},se=function(e,t,n,o){return K(e).reduce((function(i,s){var c,a="il".concat(t+1).concat(o).concat(n+1).concat(ee[s]||s);return r(r({},i),((c={})[a]=e[s],c))}),{})},ce=K(Z).map((function(e){return Z[e]})),ae=K(ee).map((function(e){return ee[e]})),ue=K(te).map((function(e){return te[e]})),le=K(ne).map((function(e){return ne[e]})),pe=K(oe).map((function(e){return oe[e]})),he=K(re).map((function(e){return re[e]})),de=c(c([],ce,!0),["custom"],!1).join("|"),fe=c(c([],ae,!0),["custom"],!1).join("|"),ve="(pr[0-9]+)",ge="(il[0-9]+pi[0-9]+)",me=new RegExp("^".concat(ve,"(").concat(de,")$")),ye=new RegExp("^(".concat(ge,"(").concat(fe,"))|(il[0-9]+nm)$")),Se=new RegExp("^(".concat(ue.join("|"),")$")),ke=new RegExp("^(".concat(le.join("|"),")$")),we=new RegExp("^".concat(ve,"custom$")),Ie=new RegExp("^".concat(ge,"custom$")),be=new RegExp("^(".concat(c(c(c([],["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],!0),pe,!0),he,!0).join("|"),")$")),Ee=[function(e){return ye.test(e)},function(e){return me.test(e)},function(e){return Se.test(e)},function(e){return ke.test(e)},function(e){return be.test(e)}],Ce=[we,Ie],De=r(r(r(r({},{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 n;return r(r({},e),((n={})[t]=t,n))}),{})),Ue=r(r({},De),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Re=K(Ue).map((function(e){return Ue[e]})),Ae=function(e){return-1!==Re.indexOf(e)},Pe=function(e){return"custom"===e},Fe=function(e){var t=void 0;return c([],Ce,!0).every((function(n){var r;return t=null===(r=n.exec(e))||void 0===r?void 0:r[1],!Boolean(t)})),t},xe=function(e,t){return K(t).reduce((function(n,o){var i;return r(r({},n),((i={})["".concat(e).concat(o)]=t[o],i))}),{})},Te=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,o,i,c,a,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 n=this.opts,o=n.baseUrl,i=n.preprocessRequest,c=this.encodeForEventType(e,t),[4,this.getQueryParamsForEventType(e)];case 1:return a=s.sent(),u={url:"".concat(o,"/analytics/").concat(e,"?").concat(a),body:new Blob([c],{type:"application/x-www-form-urlencoded"})},d=[r({},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=r.apply(void 0,d.concat([f])),p=l.url,h=l.body,console.log('Sending beacon for "'.concat(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(r({access_token:this.opts.token},t))},e.prototype.getQueryParamsForEventType=function(e){return i(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return t=this.opts,n=t.token,[4,t.visitorIdProvider.getCurrentVisitorId()];case 1:return r=o.sent(),[2,[n&&this.isEventTypeLegacy(e)?"access_token=".concat(n):"",r?"visitorId=".concat(r):"","discardVisitInfo=true"].filter((function(e){return!!e})).join("&")]}}))}))},e.prototype.isEventTypeLegacy=function(e){return-1!==[n.click,n.custom,n.search,n.view].indexOf(e)},e.prototype.encodeForLegacyType=function(e,t){return"".concat(e,"Event=").concat(encodeURIComponent(JSON.stringify(t)))},e.prototype.encodeForFormUrlEncoded=function(e){var t=this;return Object.keys(e).filter((function(t){return!!e[t]})).map((function(n){return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.encodeValue(e[n])))})).join("&")},e.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},e}(),Le=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}(),Oe=window.fetch,Ve=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,i,c,a,u,l,p,h,d,f,v,g,m,y;return s(this,(function(s){switch(s.label){case 0:return n=this.opts,i=n.baseUrl,c=n.visitorIdProvider,a=n.preprocessRequest,this.shouldAppendVisitorId(e)?[4,this.getVisitorIdParam()]:[3,2];case 1:return l=s.sent(),[3,3];case 2:l="",s.label=3;case 3:return u=l,p={url:"".concat(i,"/analytics/").concat(e).concat(u),credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},v=[r({},p)],a?[4,a(p,"analyticsFetch")]:[3,5];case 4:return g=s.sent(),[3,6];case 5:g={},s.label=6;case 6:return h=r.apply(void 0,v.concat([g])),d=h.url,f=o(h,["url"]),[4,Oe(d,f)];case 7:return(m=s.sent()).ok?[4,m.json()]:[3,9];case 8:return(y=s.sent()).visitorId&&c.setCurrentVisitorId(y.visitorId),[2,y];case 9:try{m.json()}catch(e){}throw console.error('An error has occured when sending the "'.concat(e,'" event.'),m,t),new Error('An error has occurred when sending the "'.concat(e,'" event. Check the console logs for more details.'))}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return e=this.opts.baseUrl,t="".concat(e,"/analytics/visit"),[4,Oe(t,{headers:this.getHeaders(),method:"DELETE"})];case 1:return n.sent(),[2]}}))}))},e.prototype.shouldAppendVisitorId=function(e){return-1!==[n.click,n.custom,n.search,n.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=".concat(e):""]}}))}))},e.prototype.getHeaders=function(){var e=this.opts.token;return r(r({},e?{Authorization:"Bearer ".concat(e)}:{}),{"Content-Type":"application/json"})},e}(),Me=function(e,t){var n=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 Ve(e),this.beaconClient=new Te(e),window.addEventListener("beforeunload",(function(){for(var e=0,r=t();e<r.length;e++){var o=r[e],i=o.eventType,s=o.payload;n.beaconClient.sendEvent(i,s)}}))},qe=function(e,t){this.storage=t||new S,this.client=new Ve(e)},_e=function(){this.storage=new S,this.client=new Le};var Ne=["1",1,"yes",!0];function Qe(){return a()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(e){return-1!==Ne.indexOf(e)}))}var He=Object.freeze({__proto__:null,default:Qe,doNotTrack:Qe}),Be="v15",je={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 Ye(e,t){void 0===e&&(e=je.default),void 0===t&&(t=Be);var n=-1!==e.indexOf(".cloud.coveo.com");return"".concat(e).concat(n?"":"/rest","/").concat(t)}var Ke,ze,We,Ge=function(){function e(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=r(r({},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),Qe()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return{endpoint:je.default,token:"",version:Be,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return q},enumerable:!1,configurable:!0}),e.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&u()?new Me(e,(function(){var e=c([],t.bufferedRequests,!0);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 qe(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(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),(e=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:e=n.sent(),n.label=2;case 2:return[2,e||L()];case 3:return t=n.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(n){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=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,c([e],t,!1))];case 1:return[2,n.sent()]}}))}))},e.prototype.getPayload=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,c([e],t,!1))];case 1:return n=r.sent(),[4,this.resolvePayloadForParameters(e,n)];case 2:return[2,r.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(Qe())return null;try{var t=new URL(e).searchParams.get(B.cvo_cid);if(null==t)return null;var n=B.fromString(t);return n&&u()&&n.validate(document.referrer,this.acceptedLinkReferrers)?n.clientId:null}catch(e){}return null},e.prototype.resolveParameters=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,c,a,u,l,p,h,d,f,v,g,m=this;return s(this,(function(y){switch(y.label){case 0:return n=this.eventTypeMapping[e]||{},o=n.variableLengthArgumentsNames,c=void 0===o?[]:o,a=n.addVisitorIdParameter,u=void 0!==a&&a,l=n.usesMeasurementProtocol,p=void 0!==l&&l,h=n.addClientIdParameter,d=void 0!==h&&h,f=function(e){return i(m,void 0,void 0,(function(){var t,n,o;return s(this,(function(i){switch(i.label){case 0:return t=[r({},e)],o={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n="",i.label=3;case 3:return[2,r.apply(void 0,t.concat([(o.visitorId=n,o)]))]}}))}))},v=function(e){return i(m,void 0,void 0,(function(){var t,n;return s(this,(function(o){switch(o.label){case 0:return d?(t=[r({},e)],n={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,r.apply(void 0,t.concat([(n.clientId=o.sent(),n)]))];case 2:return[2,e]}}))}))},g=function(t){return m.beforeSendHooks.reduce((function(t,n){return i(m,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return r=o.sent(),[4,n(e,r)];case 2:return[2,o.sent()]}}))}))}),t)},[4,[function(e){return c.length>0?m.parseVariableArgumentsPayload(c,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 n;return s(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),[4,t(n)];case 2:return[2,r.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 n,o,c,a=this;return s(this,(function(u){switch(u.label){case 0:return n=(this.eventTypeMapping[e]||{}).usesMeasurementProtocol,o=void 0!==n&&n,c=function(e){return o?(n=!!(t=e).action&&ie[t.action]||{},K(t).reduce((function(e,o){var i,s=n[o]||Ue[o]||o;return r(r({},e),((i={})[s]=t[o],i))}),{})):e;var t,n},[4,[function(t){return a.removeEmptyPayloadValues(t,e)},function(t){return a.validateParams(t,e)},c,function(e){return o?a.removeUnknownParameters(e):e},function(e){return o?a.processCustomParameters(e):a.mapCustomParametersToCustomData(e)}].reduce((function(e,t){return i(a,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),[4,t(n)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,u.sent()]}}))}))},e.prototype.makeEvent=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,a,u,l=this;return s(this,(function(p){switch(p.label){case 0:return n=(this.eventTypeMapping[e]||{}).newEventType,o=void 0===n?e:n,[4,this.resolveParameters.apply(this,c([e],t,!1))];case 1:return a=p.sent(),[4,this.resolvePayloadForParameters(e,a)];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(n){switch(n.label){case 0:return this.bufferedRequests.push({eventType:o,payload:r(r({},u),t)}),[4,Promise.all(this.afterSendHooks.map((function(n){return n(e,r(r({},a),t))})))];case 1:return n.sent(),[4,this.deferExecution()];case 2:return n.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,n.sent()]}}))}))}}]}}))}))},e.prototype.sendEvent=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeEvent.apply(this,c([e],t,!1))];case 1:return[2,n.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,n;return s(this,(function(r){return(e=this.bufferedRequests.shift())?(t=e.eventType,n=e.payload,[2,this.runtime.client.sendEvent(t,n)]):[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(n.search,e)]}))}))},e.prototype.sendSearchEvent=function(e){var t=e.searchQueryUid,n=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(n)];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(n.click,e)]}))}))},e.prototype.sendClickEvent=function(e){var t=e.searchQueryUid,n=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(n)];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(n.custom,e)]}))}))},e.prototype.sendCustomEvent=function(e){var t=e.lastSearchQueryUid,n=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(n)];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(n.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("".concat(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("".concat(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 n={},o=0,i=t.length;o<i;o++){var s=t[o];if("string"==typeof s)n[e[o]]=s;else if("object"==typeof s)return r(r({},n),s)}return n},e.prototype.isKeyAllowedEmpty=function(e,t){var r;return-1!==(((r={})[n.search]=["queryText"],r)[e]||[]).indexOf(t)},e.prototype.removeEmptyPayloadValues=function(e,t){var n=this;return Object.keys(e).filter((function(r){return n.isKeyAllowedEmpty(t,r)||null!=(o=e[r])&&""!==o;var o})).reduce((function(t,n){var o;return r(r({},t),((o={})[n]=e[n],o))}),{})},e.prototype.removeUnknownParameters=function(e){var t=Object.keys(e).filter((function(e){if(function(e){return c(c(c([],Ee,!0),X,!0),[Ae,Pe],!1).some((function(t){return t(e)}))}(e))return!0;console.log(e,"is not processed by coveoua")})).reduce((function(t,n){var o;return r(r({},t),((o={})[n]=e[n],o))}),{});return t},e.prototype.processCustomParameters=function(e){var t=e.custom,n=o(e,["custom"]),i={};t&&z(t)&&(i=this.lowercaseKeys(t));var s,c=K(s=n).reduce((function(e,t){var n,o=Fe(t);return r(r({},e),o?xe(o,s[t]):((n={})[t]=s[t],n))}),{});return r(r({},i),c)},e.prototype.mapCustomParametersToCustomData=function(e){var t=e.custom,n=o(e,["custom"]);if(t&&z(t)){var i=this.lowercaseKeys(t);return r(r({},n),{customData:r(r({},i),e.customData)})}return e},e.prototype.lowercaseKeys=function(e){var t=Object.keys(e),n={};return t.forEach((function(t){n[t.toLowerCase()]=e[t]})),n},e.prototype.validateParams=function(e,t){var r=e.anonymizeIp,i=o(e,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf("".concat(r).toLowerCase())&&(i.anonymizeIp=1),t!=n.view&&t!=n.click&&t!=n.search&&t!=n.custom||(i.originLevel3=this.limit(i.originLevel3,128)),t==n.view&&(i.location=this.limit(i.location,128)),"pageview"!=t&&"event"!=t||(i.referrer=this.limit(i.referrer,2048),i.location=this.limit(i.location,2048),i.page=this.limit(i.page,2048)),i},e.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,n=e.userId,r=o(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!n?(r.userId="anonymous",r):e},e.prototype.limit=function(e,t){return"string"!=typeof e?e:e.substring(0,t)},Object.defineProperty(e.prototype,"baseUrl",{get:function(){return Ye(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),e}(),$e=Object.freeze({__proto__:null,CoveoAnalyticsClient:Ge,Endpoints:je,Version:Be,buildBaseUrl:Ye,default:Ge}),Je=r({},N),Xe=Object.keys(Je).map((function(e){return Je[e]})),Ze=function(e){function i(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r,i=e.call(this,{client:n,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return t(i,e),i.prototype.getApi=function(t){var n=e.prototype.getApi.call(this,t);if(null!==n)return n;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 n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xe.indexOf(t)?e.addECDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xe.indexOf(t)&&e.updateLocationInformation(t,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Je.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Je.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(e,t){var n=r(r(r(r({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),r(r(r(r({},i),o),n),t)},i.prototype.getProductPayload=function(){var e=this;return this.products.map((function(t){return e.assureProductValidity(t)})).reduce((function(t,n,o){return r(r({},t),function(e,t){return K(e).reduce((function(n,o){var i,s="pr".concat(t+1).concat(Z[o]||o);return r(r({},n),((i={})[s]=e[o],i))}),{})}(e.convertNumberTypes(n),o))}),{})},i.prototype.convertNumberTypes=function(e){var t=r({},e);return"quantity"in t&&(t.quantity=W(t.quantity)),"position"in t&&(t.position=W(t.position)),t},i.prototype.getImpressionPayload=function(){var e=this;return this.getImpressionsByList().map((function(t){var n=t.impressions,i=o(t,["impressions"]);return r(r({},i),{impressions:n.map((function(t){return e.assureBaseImpressionValidity(t)}))})})).reduce((function(e,t,n){return r(r({},e),function(e,t,n){var o=e.impressions.reduce((function(e,o,i){return r(r({},e),se(o,t,i,n))}),{});return e.listName&&(o["il".concat(t+1,"nm")]=e.listName),o}(t,n,"pi"))}),{})},i.prototype.assureProductValidity=function(e){var t=e.position,n=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '".concat(e.name||e.id,"' must be greater ")+"than 0 when provided."),n):e},i.prototype.assureBaseImpressionValidity=function(e){var t=e.position,n=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '".concat(e.name||e.id,"'")+" must be greater than 0 when provided."),n):e},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(e,t){var n=t.list,r=o(t,["list"]),i=e.find((function(e){return e.listName===n}));return i?i.impressions.push(r):e.push({listName:n,impressions:[r]}),e}),[])},i.Id="ec",i}(H),et=Ze,tt=r({},N),nt=Object.keys(tt).map((function(e){return tt[e]})),rt=function(e){function o(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r,i=e.call(this,{client:n,uuidGenerator:o})||this;return i.ticket={},i}return t(o,e),o.prototype.getApi=function(t){var n=e.prototype.getApi.call(this,t);return null!==n?n:"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 n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==nt.indexOf(t)?e.addSVCDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==nt.indexOf(t)&&e.updateLocationInformation(t,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(tt.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(tt.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(e,t){var n,o=r(r(r(r({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(n=this.actionData)&&void 0!==n?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),r(r(r({},i),o),t)},o.prototype.getTicketPayload=function(){return e=this.ticket,K(e).filter((function(t){return void 0!==e[t]})).reduce((function(t,n){var o,i=G[n]||n;return r(r({},t),((o={})[i]=e[n],o))}),{});var e},o.Id="svc",o}(H),ot=rt,it=function(){function e(){var e;this.registeredPluginsMap=((e={})[et.Id]=et,e[ot.Id]=ot,e[Y.Id]=Y,e),this.requiredPlugins={}}return e.prototype.require=function(e,t){var n=this.registeredPluginsMap[e];if(!n)throw new Error('No plugin named "'.concat(e,"\" is currently registered. If you use a custom plugin, use 'provide' first."));this.requiredPlugins[e]=new n(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 n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'.concat(e,'" is not required. Check that you required it on initialization.'));var i=o.getApi(t);if(!i)throw new Error('The function "'.concat(t,'" does not exist on the plugin "').concat(e,'".'));if("function"!=typeof i)throw new Error('"'.concat(t,'" of the plugin "').concat(e,'" is not a function.'));return i.apply(o,n)},e.DefaultPlugins=[et.Id,ot.Id,Y.Id],e}(),st=function(){function e(){this.plugins=new it,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 Ge({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 r(r({},t),o.params)})),this.client.addEventTypeMapping(n.view,{newEventType:n.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?it.DefaultPlugins:Array.isArray(null==e?void 0:e.plugins)?e.plugins:it.DefaultPlugins},e.prototype.getEndpoint=function(e){return"string"==typeof e?e||je.default:(null==e?void 0:e.endpoint)?e.endpoint:je.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 Ge({endpoint:e})},e.prototype.set=function(e,t){var n=this;"string"==typeof e?this.params[e]=t:Object.keys(e).map((function(t){n.params[t]=e[t]}))},e.prototype.send=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!r)throw new Error('You must provide an event type when calling "send".');return(e=this.client).sendEvent.apply(e,c([r.toLowerCase()],o,!1))},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,r(r({},t),{client:this.client}))},e.prototype.callPlugin=function(e,t){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(!this.client)throw new Error("You must call init before calling a plugin function");return(n=this.plugins).execute.apply(n,c([e,t],r,!1))},e.prototype.reset=function(){this.client=void 0,this.plugins=new it,this.params={}},e.prototype.version=function(){return q},e}(),ct=new st,at=function(){return ct.client},ut=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e);r[1];var o=r[2],i=r[3],s=ct[i];if(o&&i)return ct.callPlugin.apply(ct,c([o,i],t,!1));if(s)return s.apply(ct,t);throw new Error('The action "'.concat(e,'" does not exist. Available actions: ').concat(["init","set","send","onLoad","callPlugin","reset","require","provide","version"].join(", "),"."))},lt=Object.freeze({__proto__:null,CoveoUA:st,coveoua:ct,default:ut,getCurrentClient:at,handleOneAnalyticsEvent:ut});!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView"}(Ke||(Ke={})),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"}(We||(We={}));var pt=((ze={})[We.triggerNotify]="queryPipelineTriggers",ze[We.triggerExecute]="queryPipelineTriggers",ze[We.triggerQuery]="queryPipelineTriggers",ze[We.triggerRedirect]="queryPipelineTriggers",ze[We.queryError]="errors",ze[We.queryErrorBack]="errors",ze[We.queryErrorClear]="errors",ze[We.queryErrorRetry]="errors",ze[We.pagerNext]="getMoreResults",ze[We.pagerPrevious]="getMoreResults",ze[We.pagerNumber]="getMoreResults",ze[We.pagerResize]="getMoreResults",ze[We.pagerScrolling]="getMoreResults",ze[We.facetSearch]="facet",ze[We.facetShowLess]="facet",ze[We.facetShowMore]="facet",ze[We.recommendation]="recommendation",ze[We.likeSmartSnippet]="smartSnippet",ze[We.dislikeSmartSnippet]="smartSnippet",ze[We.expandSmartSnippet]="smartSnippet",ze[We.collapseSmartSnippet]="smartSnippet",ze[We.openSmartSnippetFeedbackModal]="smartSnippet",ze[We.closeSmartSnippetFeedbackModal]="smartSnippet",ze[We.sendSmartSnippetReason]="smartSnippet",ze[We.expandSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.clearRecentQueries]="recentQueries",ze[We.recentResultClick]="recentlyClickedDocuments",ze[We.clearRecentResults]="recentlyClickedDocuments",ze[We.showLessFoldedResults]="folding",ze[Ke.expandToFullUI]="interface",ze[Ke.openUserActions]="User Actions",ze[Ke.showPrecedingSessions]="User Actions",ze[Ke.showFollowingSessions]="User Actions",ze[Ke.clickViewedDocument]="User Actions",ze[Ke.clickPageView]="User Actions",ze[We.caseDetach]="case",ze),ht=function(){function e(){this.runtime=new _e,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(n.search)},e.prototype.sendSearchEvent=function(){return Promise.resolve()},e.prototype.makeClickEvent=function(){return this.makeEvent(n.click)},e.prototype.sendClickEvent=function(){return Promise.resolve()},e.prototype.makeCustomEvent=function(){return this.makeEvent(n.custom)},e.prototype.sendCustomEvent=function(){return Promise.resolve()},e.prototype.makeViewEvent=function(){return this.makeEvent(n.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 q},enumerable:!1,configurable:!0}),e}();function dt(e){var t=e.join(";");return t.length<=256?t:dt(e.slice(1))}var ft=function(e){var t=function(e){return e.map((function(e){return e.replace(/;/g,"")}))}(e),n=function(e){var t="";return e.filter((function(e){var n=e!==t;return t=e,n}))}(t);return dt(n)};function vt(e){var t="string"==typeof e.partialQueries?e.partialQueries:ft(e.partialQueries),n="string"==typeof e.suggestions?e.suggestions:ft(e.suggestions);return r(r({},e),{partialQueries:t,suggestions:n})}var gt,mt,yt,St=function(){function e(e,t){this.opts=e,this.provider=t;var n=!1===e.enableAnalytics||Qe();this.coveoAnalyticsClient=n?new ht:new Ge(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof Ge&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ht},e.prototype.enable=function(){this.coveoAnalyticsClient=new Ge(this.opts)},e.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(We.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(We.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(We.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(We.recommendationOpen,e,t)},e.prototype.logRecommendationOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecommendationOpen(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.documentQuickview,e,t)},e.prototype.logDocumentQuickview=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentQuickview(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(We.documentOpen,e,t)},e.prototype.logDocumentOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentOpen(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(We.omniboxAnalytics,vt(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(We.omniboxFromLink,vt(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(We.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(We.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(We.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(We.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(We.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(We.triggerRedirect,r(r({},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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(n){switch(n.label){case 0:return[4,this.makeCustomEvent(We.queryErrorBack)];case 1:return[2,{description:(e=n.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(We.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(n){switch(n.label){case 0:return[4,this.makeCustomEvent(We.queryErrorRetry)];case 1:return[2,{description:(e=n.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(We.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(n){switch(n.label){case 0:return[4,this.makeCustomEvent(We.queryErrorClear)];case 1:return[2,{description:(e=n.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.sendSmartSnippetReason,{reason:e,details:t})},e.prototype.logSmartSnippetFeedbackReason=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(We.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(We.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(We.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(We.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(We.openSmartSnippetSource,e,t)},e.prototype.logOpenSmartSnippetSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSource(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(We.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.makeCopyToClipboard=function(e,t){return this.makeClickEvent(We.copyToClipboard,e,t)},e.prototype.logCopyToClipboard=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCopyToClipboard(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(We.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(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(We.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(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(We.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(We.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(We.recentResultClick,{info:e,identifier:t})},e.prototype.logRecentResultClick=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecentResultClick(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(We.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(We.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(We.showMoreFoldedResults,e,t)},e.prototype.logShowMoreFoldedResults=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeShowMoreFoldedResults(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(We.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 n;return{actionCause:t,customData:null===(n=e.payload)||void 0===n?void 0:n.customData}},e.prototype.makeCustomEvent=function(e,t,n){return void 0===n&&(n=pt[e]),i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=r(r({},this.provider.getBaseMetadata()),t),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:n,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,e),log:function(e){var t=e.searchUID;return a.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEvent=function(e,t,n){return void 0===n&&(n=pt[e]),i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(e,t,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCustomEventWithType=function(e,t,n){return i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return o=r(r({},this.provider.getBaseMetadata()),n),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:t,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,e),log:function(e){var t=e.searchUID;return a.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEventWithType=function(e,t,n){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEventWithType(e,t,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSearchEvent(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(e,t)];case 1:return n=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(n)];case 2:return r=o.sent(),[2,{description:this.makeEventDescription(r,e),log:function(e){var t=e.searchUID;return r.log({searchQueryUid:t})}}]}}))}))},e.prototype.makeClickEvent=function(e,t,n,o){return i(this,void 0,void 0,(function(){var i,c,a;return s(this,(function(s){switch(s.label){case 0:return c=[r({},t)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:e}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,e),log:function(e){var t=e.searchUID;return a.log({searchQueryUid:t})}}]}}))}))},e.prototype.logClickEvent=function(e,t,n,r){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(e,t,n,r)];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 n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.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,n,o;return s(this,(function(i){switch(i.label){case 0:return t=r(r({},this.provider.getBaseMetadata()),e),n=[r(r({},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,r.apply(void 0,n.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 Ge?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 r(r({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})},e}();!function(e){e.click="click",e.flowStart="flowStart"}(gt||(gt={})),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"}(mt||(mt={})),function(e){e.quit="Quit",e.solved="Solved"}(yt||(yt={}));var kt=function(){function e(e,t){var n;this.options=e,this.provider=t;var r=(null===(n=e.enableAnalytics)||void 0===n||n)&&!Qe();this.coveoAnalyticsClient=r?new Ge(e):new ht,this.svc=new rt({client:this.coveoAnalyticsClient})}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof Ge&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ht,this.svc=new rt({client:this.coveoAnalyticsClient})},e.prototype.enable=function(){this.coveoAnalyticsClient=new Ge(this.options),this.svc=new rt({client:this.coveoAnalyticsClient})},e.prototype.logEnterInterface=function(e){return this.svc.setAction(mt.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},e.prototype.logUpdateCaseField=function(e){return this.svc.setAction(mt.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(mt.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(mt.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(mt.suggestionRate,r({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(mt.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCancelled=function(e){return this.svc.setAction(mt.caseCancelled,{reason:yt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseSolved=function(e){return this.svc.setAction(mt.caseSolved,{reason:yt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCreated=function(e){return this.svc.setAction(mt.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",gt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",gt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e}(),wt=function(e,t){void 0===t&&(t=!0),e.caseContext;var n=e.caseId,i=e.caseNumber,s=o(e,["caseContext","caseId","caseNumber"]),c=function(e){var t={};return e.caseContext&&Object.keys(e.caseContext).forEach((function(n){var r,o=null===(r=e.caseContext)||void 0===r?void 0:r[n];if(o){var i="context_".concat(n);t[i]=o}})),t}(e);return r(r(r({CaseId:n,CaseNumber:i},s),!!c.context_Case_Subject&&{CaseSubject:c.context_Case_Subject}),t&&c)},It=function(){function e(e,t){this.opts=e,this.provider=t;var n=!1===e.enableAnalytics||Qe();this.coveoAnalyticsClient=n?new ht:new Ge(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof Ge&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ht},e.prototype.enable=function(){this.coveoAnalyticsClient=new Ge(this.opts)},e.prototype.logInterfaceLoad=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.interfaceLoad,t)}return this.logSearchEvent(We.interfaceLoad)},e.prototype.logInterfaceChange=function(e){var t=wt(e);return this.logSearchEvent(We.interfaceChange,t)},e.prototype.logStaticFilterDeselect=function(e){var t=wt(e);return this.logSearchEvent(We.staticFilterDeselect,t)},e.prototype.logFetchMoreResults=function(e){if(e){var t=wt(e);return this.logCustomEvent(We.pagerScrolling,r(r({},t),{type:"getMoreResults"}))}return this.logCustomEvent(We.pagerScrolling,{type:"getMoreResults"})},e.prototype.logBreadcrumbFacet=function(e){var t=wt(e);return this.logSearchEvent(We.breadcrumbFacet,t)},e.prototype.logBreadcrumbResetAll=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.breadcrumbResetAll,t)}return this.logSearchEvent(We.breadcrumbResetAll)},e.prototype.logFacetSelect=function(e){var t=wt(e);return this.logSearchEvent(We.facetSelect,t)},e.prototype.logFacetDeselect=function(e){var t=wt(e);return this.logSearchEvent(We.facetDeselect,t)},e.prototype.logFacetUpdateSort=function(e){var t=wt(e);return this.logSearchEvent(We.facetUpdateSort,t)},e.prototype.logFacetClearAll=function(e){var t=wt(e);return this.logSearchEvent(We.facetClearAll,t)},e.prototype.logFacetShowMore=function(e){var t=wt(e,!1);return this.logCustomEvent(We.facetShowMore,t)},e.prototype.logFacetShowLess=function(e){var t=wt(e,!1);return this.logCustomEvent(We.facetShowLess,t)},e.prototype.logQueryError=function(e){var t=wt(e,!1);return this.logCustomEvent(We.queryError,t)},e.prototype.logPagerNumber=function(e){var t=wt(e,!1);return this.logCustomEvent(We.pagerNumber,t)},e.prototype.logPagerNext=function(e){var t=wt(e,!1);return this.logCustomEvent(We.pagerNext,t)},e.prototype.logPagerPrevious=function(e){var t=wt(e,!1);return this.logCustomEvent(We.pagerPrevious,t)},e.prototype.logDidYouMeanAutomatic=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.didyoumeanAutomatic,t)}return this.logSearchEvent(We.didyoumeanAutomatic)},e.prototype.logDidYouMeanClick=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.didyoumeanClick,t)}return this.logSearchEvent(We.didyoumeanClick)},e.prototype.logResultsSort=function(e){var t=wt(e);return this.logSearchEvent(We.resultsSort,t)},e.prototype.logSearchboxSubmit=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.searchboxSubmit,t)}return this.logSearchEvent(We.searchboxSubmit)},e.prototype.logContextChanged=function(e){var t=wt(e);return this.logSearchEvent(Ke.contextChanged,t)},e.prototype.logExpandToFullUI=function(e){var t=wt(e);return this.logCustomEvent(Ke.expandToFullUI,t)},e.prototype.logOpenUserActions=function(e){var t=wt(e,!1);return this.logCustomEvent(Ke.openUserActions,t)},e.prototype.logShowPrecedingSessions=function(e){var t=wt(e,!1);return this.logCustomEvent(Ke.showPrecedingSessions,t)},e.prototype.logShowFollowingSessions=function(e){var t=wt(e,!1);return this.logCustomEvent(Ke.showFollowingSessions,t)},e.prototype.logViewedDocumentClick=function(e,t){return this.logCustomEvent(Ke.clickViewedDocument,r(r({},wt(t,!1)),{document:e}))},e.prototype.logPageViewClick=function(e,t){return this.logCustomEvent(Ke.clickPageView,r(r({},wt(t,!1)),{pageView:e}))},e.prototype.logDocumentOpen=function(e,t,n){return this.logClickEvent(We.documentOpen,e,t,n?wt(n,!1):void 0)},e.prototype.logCopyToClipboard=function(e,t,n){return this.logClickEvent(We.copyToClipboard,e,t,n?wt(n,!1):void 0)},e.prototype.logDocumentQuickview=function(e,t,n){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl};return this.logClickEvent(We.documentQuickview,e,t,n?r(r({},wt(n,!1)),o):o)},e.prototype.logCaseAttach=function(e,t,n){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl,resultUriHash:e.documentUriHash};return this.logClickEvent(We.caseAttach,e,t,n?r(r({},wt(n,!1)),o):o)},e.prototype.logCaseDetach=function(e,t){return this.logCustomEvent(We.caseDetach,t?r(r({},wt(t,!1)),{resultUriHash:e}):{resultUriHash:e})},e.prototype.logLikeSmartSnippet=function(e){return this.logCustomEvent(We.likeSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logDislikeSmartSnippet=function(e){return this.logCustomEvent(We.dislikeSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logExpandSmartSnippet=function(e){return this.logCustomEvent(We.expandSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logCollapseSmartSnippet=function(e){return this.logCustomEvent(We.collapseSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logOpenSmartSnippetFeedbackModal=function(e){return this.logCustomEvent(We.openSmartSnippetFeedbackModal,e?wt(e,!1):void 0)},e.prototype.logCloseSmartSnippetFeedbackModal=function(e){return this.logCustomEvent(We.closeSmartSnippetFeedbackModal,e?wt(e,!1):void 0)},e.prototype.logSmartSnippetFeedbackReason=function(e,t,n){return this.logCustomEvent(We.sendSmartSnippetReason,n?r(r({},wt(n,!1)),{reason:e,details:t}):{reason:e,details:t})},e.prototype.logExpandSmartSnippetSuggestion=function(e,t){var n="documentId"in e?e:{documentId:e};return this.logCustomEvent(We.expandSmartSnippetSuggestion,t?r(r({},wt(t,!1)),n):n)},e.prototype.logCollapseSmartSnippetSuggestion=function(e,t){var n="documentId"in e?e:{documentId:e};return this.logCustomEvent(We.collapseSmartSnippetSuggestion,t?r(r({},wt(t,!1)),n):n)},e.prototype.logOpenSmartSnippetSource=function(e,t,n){return this.logClickEvent(We.openSmartSnippetSource,e,t,n?wt(n,!1):void 0)},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t,n){return this.logClickEvent(We.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},n?r(r({},wt(n,!1)),t):t)},e.prototype.logOpenSmartSnippetInlineLink=function(e,t,n){return this.logClickEvent(We.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},n?r(r({},wt(n,!1)),t):t)},e.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t,n){return this.logClickEvent(We.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},n?r(r({},wt(n,!1)),t):t)},e.prototype.logCustomEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,o,i;return s(this,(function(s){switch(s.label){case 0:return n=r(r({},this.provider.getBaseMetadata()),t),i=[{}],[4,this.getBaseCustomEventRequest(n)];case 1:return o=r.apply(void 0,[r.apply(void 0,i.concat([s.sent()])),{eventType:pt[e],eventValue:e}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return r=(n=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(e,t)];case 1:return[2,r.apply(n,[o.sent()])]}}))}))},e.prototype.logClickEvent=function(e,t,n,o){return i(this,void 0,void 0,(function(){var i,c;return s(this,(function(s){switch(s.label){case 0:return c=[r({},t)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.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(n){switch(n.label){case 0:return t=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,r.apply(void 0,[r.apply(void 0,t.concat([n.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.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,n,o;return s(this,(function(i){switch(i.label){case 0:return t=r(r({},this.provider.getBaseMetadata()),e),n=[r({},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,r.apply(void 0,n.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 Ge?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e}(),bt=Object.freeze({__proto__:null,get CaseAssistActions(){return mt},CaseAssistClient:kt,get CaseAssistEvents(){return gt},get CaseCancelledReasons(){return yt},CoveoAnalyticsClient:Ge,CoveoInsightClient:It,CoveoSearchPageClient:St,CoveoUA:st,CustomEventsTypes:pt,get EventType(){return n},get InsightEvents(){return Ke},get SearchPageEvents(){return We},SimpleAnalytics:lt,analytics:$e,donottrack:He,getCurrentClient:at,handleOneAnalyticsEvent:ut,history:b,storage:k});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 Et=self.coveoua||ut;if(self.coveoua=ut,self.coveoanalytics=bt,Et.q){var Ct=Et.q.filter((function(e){return"init"===e[0]})),Dt=Et.q.filter((function(e){return"init"!==e[0]}));c(c([],Ct,!0),Dt,!0).forEach((function(e){return ut.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,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function c(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function a(){return"undefined"!=typeof navigator}function u(){return"undefined"!=typeof document}function l(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}function p(){return a()&&navigator.cookieEnabled}!function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"}(n||(n={}));var h=[n.click,n.custom,n.search,n.view],d=function(e,t){return-1!==h.indexOf(e)?r({language:u()?document.documentElement.lang:"unknown",userAgent:a()?navigator.userAgent:"unknown"},t):t},f=function(){function e(){}return e.set=function(e,t,n){var r,o,i;n&&(r=new Date).setTime(r.getTime()+n),-1===(i=window.location.hostname).indexOf(".")?v(e,t,r):v(e,t,r,(o=i.split("."))[o.length-2]+"."+o[o.length-1])},e.get=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];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,n,r){document.cookie="".concat(e,"=").concat(t)+(n?";expires=".concat(n.toUTCString()):"")+(r?";domain=".concat(r):"")+";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("".concat(e.prefix).concat(t))},e.prototype.removeItem=function(t){f.erase("".concat(e.prefix).concat(t))},e.prototype.setItem=function(t,n,r){f.set("".concat(e.prefix).concat(t),n,r)},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,CookieAndLocalStorage:y,CookieStorage:m,NullStorage:S,getAvailableStorage:g,preferredStorage:null}),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(n){switch(n.label){case 0:return e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=n.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,n=e.time,r=e.value;return t&&"string"==typeof r&&"query"===t.toLowerCase()&&""===r.trim()?{name:t,time:n}:e},e.prototype.stripEmptyQueries=function(e){var t=this;return e.map((function(e){return t.stripEmptyQuery(e)}))},e}(),b=Object.freeze({__proto__:null,HistoryStore:I,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MAX_VALUE_SIZE:75,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,STORE_KEY:w,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!==n.view?[3,2]:[4,C(t.contentIdValue)];case 1:return o.sent(),[2,r({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,n;return s(this,(function(r){switch(r.label){case 0:return t=new I,n={name:"PageView",value:e,time:JSON.stringify(new Date)},[4,t.addElementAsync(n)];case 1:return r.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,n){if(T.randomUUID&&!t&&!e)return T.randomUUID();const r=(e=e||{}).random||(e.rng||R)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return x(r)}function O(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function V(e,t){return e<<t|e>>>32-t}var M=function(e,t,n){function r(e,r,o,i){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=function(e){if(!P(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(r),c.set(e,r.length),c=n(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=c[e];return o}return x(c)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const r=e.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let t=0;t<o;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];i[t]=n}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 r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=i[e][t];for(let e=16;e<80;++e)r[e]=V(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let o=n[0],s=n[1],c=n[2],a=n[3],u=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),i=V(o,5)+O(n,s,c,a)+u+t[n]+r[e]>>>0;u=a,a=c,c=V(s,30)>>>0,s=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+s>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+a>>>0,n[4]=n[4]+u>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),q="2.27.3",_=function(e){return"".concat(e.protocol,"//").concat(e.hostname).concat(0===e.pathname.indexOf("/")?e.pathname:"/".concat(e.pathname)).concat(e.search)},N={pageview:"pageview",event:"event"},Q=function(e){var t=e.client,n=e.uuidGenerator,r=void 0===n?L:n;this.client=t,this.uuidGenerator=r},H=function(e){function n(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r,i=e.call(this,{client:n,uuidGenerator:o})||this;return i.actionData={},i.pageViewId=o(),i.nextPageViewId=i.pageViewId,i.currentLocation=_(window.location),i.lastReferrer=u()?document.referrer:"",i.addHooks(),i}return t(n,e),n.prototype.getApi=function(e){return"setAction"===e?this.setAction:null},n.prototype.setAction=function(e,t){this.action=e,this.actionData=t},n.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},n.prototype.getLocationInformation=function(e,t){return r({hitType:e},this.getNextValues(e,t))},n.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},n.prototype.getDefaultContextInformation=function(e){var t={title:u()?document.title:"",encoding:u()?document.characterSet:"UTF-8"},n={screenResolution:"".concat(screen.width,"x").concat(screen.height),screenColor:"".concat(screen.colorDepth,"-bit")},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return r(r(r(r({},i),n),o),t)},n.prototype.updateLocationForNextPageView=function(e,t){var n=this.getNextValues(e,t),r=n.pageViewId,o=n.referrer,i=n.location;this.lastReferrer=o,this.pageViewId=r,this.currentLocation=i,e===N.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},n.prototype.getNextValues=function(e,t){return{pageViewId:e===N.pageview?this.nextPageViewId:this.pageViewId,referrer:e===N.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===N.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},n.prototype.getCurrentLocationFromPayload=function(e){if(e.page){return"".concat((t=this.currentLocation,t.split("/").slice(0,3).join("/"))).concat(e.page.replace(/^\/?(.*)$/,"/$1"))}return _(window.location);var t},n}(Q),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 n=new URL(e);return t.some((function(e){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host)}))}catch(e){return!1}},e.fromString=function(t){var n=t.split(".");if(2!==n.length)return null;var r=n[0],o=n[1];if(32!==r.length||isNaN(parseInt(o)))return null;var i=r.substring(0,8)+"-"+r.substring(8,12)+"-"+r.substring(12,16)+"-"+r.substring(16,20)+"-"+r.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 n(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r;return e.call(this,{client:n,uuidGenerator:o})||this}return t(n,e),n.prototype.getApi=function(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}},n.prototype.decorate=function(e){return i(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");r.label=1;case 1:return r.trys.push([1,3,,4]),t=new URL(e),[4,this.client.getCurrentVisitorId()];case 2:return n=r.sent(),t.searchParams.set(B.cvo_cid,new B(n,Date.now()).toString()),[2,t.toString()];case 3:throw r.sent(),new Error("Invalid URL provided");case 4:return[2]}}))}))},n.prototype.acceptFrom=function(e){this.client.setAcceptedLinkReferrers(e)},n.Id="link",n}(Q),Y=j,K=Object.keys;function z(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function W(e){return"string"!=typeof e||""==e||Number.isNaN(+e)?e:+e}var G={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"},$=c([],K(G).map((function(e){return G[e]})),!0).join("|"),J=new RegExp("^(".concat($,"$)")),X=[function(e){return J.test(e)}],Z={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ee={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},te={action:"pa",list:"pal",listSource:"pls"},ne={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},re={id:"quoteId",affiliation:"quoteAffiliation"},oe={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ie={add:te,bookmark_add:te,bookmark_remove:te,click:te,checkout:te,checkout_option:te,detail:te,impression:te,remove:te,refund:r(r({},te),ne),purchase:r(r({},te),ne),quickview:te,quote:r(r({},te),re),review:r(r({},te),oe)},se=function(e,t,n,o){return K(e).reduce((function(i,s){var c,a="il".concat(t+1).concat(o).concat(n+1).concat(ee[s]||s);return r(r({},i),((c={})[a]=e[s],c))}),{})},ce=K(Z).map((function(e){return Z[e]})),ae=K(ee).map((function(e){return ee[e]})),ue=K(te).map((function(e){return te[e]})),le=K(ne).map((function(e){return ne[e]})),pe=K(oe).map((function(e){return oe[e]})),he=K(re).map((function(e){return re[e]})),de=c(c([],ce,!0),["custom"],!1).join("|"),fe=c(c([],ae,!0),["custom"],!1).join("|"),ve="(pr[0-9]+)",ge="(il[0-9]+pi[0-9]+)",me=new RegExp("^".concat(ve,"(").concat(de,")$")),ye=new RegExp("^(".concat(ge,"(").concat(fe,"))|(il[0-9]+nm)$")),Se=new RegExp("^(".concat(ue.join("|"),")$")),ke=new RegExp("^(".concat(le.join("|"),")$")),we=new RegExp("^".concat(ve,"custom$")),Ie=new RegExp("^".concat(ge,"custom$")),be=new RegExp("^(".concat(c(c(c([],["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],!0),pe,!0),he,!0).join("|"),")$")),Ee=[function(e){return ye.test(e)},function(e){return me.test(e)},function(e){return Se.test(e)},function(e){return ke.test(e)},function(e){return be.test(e)}],Ce=[we,Ie],De=r(r(r(r({},{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 n;return r(r({},e),((n={})[t]=t,n))}),{})),Ue=r(r({},De),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Re=K(Ue).map((function(e){return Ue[e]})),Ae=function(e){return-1!==Re.indexOf(e)},Pe=function(e){return"custom"===e},Fe=function(e){var t=void 0;return c([],Ce,!0).every((function(n){var r;return t=null===(r=n.exec(e))||void 0===r?void 0:r[1],!Boolean(t)})),t},xe=function(e,t){return K(t).reduce((function(n,o){var i;return r(r({},n),((i={})["".concat(e).concat(o)]=t[o],i))}),{})},Te=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,o,i,c,a,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 n=this.opts,o=n.baseUrl,i=n.preprocessRequest,c=this.encodeForEventType(e,t),[4,this.getQueryParamsForEventType(e)];case 1:return a=s.sent(),u={url:"".concat(o,"/analytics/").concat(e,"?").concat(a),body:new Blob([c],{type:"application/x-www-form-urlencoded"})},d=[r({},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=r.apply(void 0,d.concat([f])),p=l.url,h=l.body,console.log('Sending beacon for "'.concat(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(r({access_token:this.opts.token},t))},e.prototype.getQueryParamsForEventType=function(e){return i(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return t=this.opts,n=t.token,[4,t.visitorIdProvider.getCurrentVisitorId()];case 1:return r=o.sent(),[2,[n&&this.isEventTypeLegacy(e)?"access_token=".concat(n):"",r?"visitorId=".concat(r):"","discardVisitInfo=true"].filter((function(e){return!!e})).join("&")]}}))}))},e.prototype.isEventTypeLegacy=function(e){return-1!==[n.click,n.custom,n.search,n.view].indexOf(e)},e.prototype.encodeForLegacyType=function(e,t){return"".concat(e,"Event=").concat(encodeURIComponent(JSON.stringify(t)))},e.prototype.encodeForFormUrlEncoded=function(e){var t=this;return Object.keys(e).filter((function(t){return!!e[t]})).map((function(n){return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.encodeValue(e[n])))})).join("&")},e.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},e}(),Le=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}(),Oe=window.fetch,Ve=function(){function e(e){this.opts=e}return e.prototype.sendEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,i,c,a,u,l,p,h,d,f,v,g,m,y;return s(this,(function(s){switch(s.label){case 0:return n=this.opts,i=n.baseUrl,c=n.visitorIdProvider,a=n.preprocessRequest,this.shouldAppendVisitorId(e)?[4,this.getVisitorIdParam()]:[3,2];case 1:return l=s.sent(),[3,3];case 2:l="",s.label=3;case 3:return u=l,p={url:"".concat(i,"/analytics/").concat(e).concat(u),credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},v=[r({},p)],a?[4,a(p,"analyticsFetch")]:[3,5];case 4:return g=s.sent(),[3,6];case 5:g={},s.label=6;case 6:return h=r.apply(void 0,v.concat([g])),d=h.url,f=o(h,["url"]),[4,Oe(d,f)];case 7:return(m=s.sent()).ok?[4,m.json()]:[3,9];case 8:return(y=s.sent()).visitorId&&c.setCurrentVisitorId(y.visitorId),[2,y];case 9:try{m.json()}catch(e){}throw console.error('An error has occured when sending the "'.concat(e,'" event.'),m,t),new Error('An error has occurred when sending the "'.concat(e,'" event. Check the console logs for more details.'))}}))}))},e.prototype.deleteHttpCookieVisitorId=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return e=this.opts.baseUrl,t="".concat(e,"/analytics/visit"),[4,Oe(t,{headers:this.getHeaders(),method:"DELETE"})];case 1:return n.sent(),[2]}}))}))},e.prototype.shouldAppendVisitorId=function(e){return-1!==[n.click,n.custom,n.search,n.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=".concat(e):""]}}))}))},e.prototype.getHeaders=function(){var e=this.opts.token;return r(r({},e?{Authorization:"Bearer ".concat(e)}:{}),{"Content-Type":"application/json"})},e}(),Me=function(e,t){var n=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 Ve(e),this.beaconClient=new Te(e),window.addEventListener("beforeunload",(function(){for(var e=0,r=t();e<r.length;e++){var o=r[e],i=o.eventType,s=o.payload;n.beaconClient.sendEvent(i,s)}}))},qe=function(e,t){this.storage=t||new S,this.client=new Ve(e)},_e=function(){this.storage=new S,this.client=new Le};var Ne=["1",1,"yes",!0];function Qe(){return a()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((function(e){return-1!==Ne.indexOf(e)}))}var He=Object.freeze({__proto__:null,default:Qe,doNotTrack:Qe}),Be="v15",je={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 Ye(e,t){void 0===e&&(e=je.default),void 0===t&&(t=Be);var n=-1!==e.indexOf(".cloud.coveo.com");return"".concat(e).concat(n?"":"/rest","/").concat(t)}var Ke,ze,We,Ge=function(){function e(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=r(r({},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),Qe()&&(this.clear(),this.runtime.storage=new S)}return Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return{endpoint:je.default,token:"",version:Be,beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return q},enumerable:!1,configurable:!0}),e.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&u()?new Me(e,(function(){var e=c([],t.bufferedRequests,!0);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 qe(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(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),(e=this.extractClientIdFromLink(window.location.href))?[3,2]:[4,this.storage.getItem("visitorId")];case 1:e=n.sent(),n.label=2;case 2:return[2,e||L()];case 3:return t=n.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(n){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=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.resolveParameters.apply(this,c([e],t,!1))];case 1:return[2,n.sent()]}}))}))},e.prototype.getPayload=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.resolveParameters.apply(this,c([e],t,!1))];case 1:return n=r.sent(),[4,this.resolvePayloadForParameters(e,n)];case 2:return[2,r.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(Qe())return null;try{var t=new URL(e).searchParams.get(B.cvo_cid);if(null==t)return null;var n=B.fromString(t);return n&&u()&&n.validate(document.referrer,this.acceptedLinkReferrers)?n.clientId:null}catch(e){}return null},e.prototype.resolveParameters=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,c,a,u,l,p,h,d,f,v,g,m=this;return s(this,(function(y){switch(y.label){case 0:return n=this.eventTypeMapping[e]||{},o=n.variableLengthArgumentsNames,c=void 0===o?[]:o,a=n.addVisitorIdParameter,u=void 0!==a&&a,l=n.usesMeasurementProtocol,p=void 0!==l&&l,h=n.addClientIdParameter,d=void 0!==h&&h,f=function(e){return i(m,void 0,void 0,(function(){var t,n,o;return s(this,(function(i){switch(i.label){case 0:return t=[r({},e)],o={},u?[4,this.getCurrentVisitorId()]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n="",i.label=3;case 3:return[2,r.apply(void 0,t.concat([(o.visitorId=n,o)]))]}}))}))},v=function(e){return i(m,void 0,void 0,(function(){var t,n;return s(this,(function(o){switch(o.label){case 0:return d?(t=[r({},e)],n={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,r.apply(void 0,t.concat([(n.clientId=o.sent(),n)]))];case 2:return[2,e]}}))}))},g=function(t){return m.beforeSendHooks.reduce((function(t,n){return i(m,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return r=o.sent(),[4,n(e,r)];case 2:return[2,o.sent()]}}))}))}),t)},[4,[function(e){return c.length>0?m.parseVariableArgumentsPayload(c,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 n;return s(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),[4,t(n)];case 2:return[2,r.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 n,o,c,a=this;return s(this,(function(u){switch(u.label){case 0:return n=(this.eventTypeMapping[e]||{}).usesMeasurementProtocol,o=void 0!==n&&n,c=function(e){return o?(n=!!(t=e).action&&ie[t.action]||{},K(t).reduce((function(e,o){var i,s=n[o]||Ue[o]||o;return r(r({},e),((i={})[s]=t[o],i))}),{})):e;var t,n},[4,[function(t){return a.removeEmptyPayloadValues(t,e)},function(t){return a.validateParams(t,e)},c,function(e){return o?a.removeUnknownParameters(e):e},function(e){return o?a.processCustomParameters(e):a.mapCustomParametersToCustomData(e)}].reduce((function(e,t){return i(a,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),[4,t(n)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve(t))];case 1:return[2,u.sent()]}}))}))},e.prototype.makeEvent=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){var n,o,a,u,l=this;return s(this,(function(p){switch(p.label){case 0:return n=(this.eventTypeMapping[e]||{}).newEventType,o=void 0===n?e:n,[4,this.resolveParameters.apply(this,c([e],t,!1))];case 1:return a=p.sent(),[4,this.resolvePayloadForParameters(e,a)];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(n){switch(n.label){case 0:return this.bufferedRequests.push({eventType:o,payload:r(r({},u),t)}),[4,Promise.all(this.afterSendHooks.map((function(n){return n(e,r(r({},a),t))})))];case 1:return n.sent(),[4,this.deferExecution()];case 2:return n.sent(),[4,this.sendFromBufferWithFetch()];case 3:return[2,n.sent()]}}))}))}}]}}))}))},e.prototype.sendEvent=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeEvent.apply(this,c([e],t,!1))];case 1:return[2,n.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,n;return s(this,(function(r){return(e=this.bufferedRequests.shift())?(t=e.eventType,n=e.payload,[2,this.runtime.client.sendEvent(t,n)]):[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(n.search,e)]}))}))},e.prototype.sendSearchEvent=function(e){var t=e.searchQueryUid,n=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(n)];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(n.click,e)]}))}))},e.prototype.sendClickEvent=function(e){var t=e.searchQueryUid,n=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(n)];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(n.custom,e)]}))}))},e.prototype.sendCustomEvent=function(e){var t=e.lastSearchQueryUid,n=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(n)];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(n.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("".concat(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("".concat(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 n={},o=0,i=t.length;o<i;o++){var s=t[o];if("string"==typeof s)n[e[o]]=s;else if("object"==typeof s)return r(r({},n),s)}return n},e.prototype.isKeyAllowedEmpty=function(e,t){var r;return-1!==(((r={})[n.search]=["queryText"],r)[e]||[]).indexOf(t)},e.prototype.removeEmptyPayloadValues=function(e,t){var n=this;return Object.keys(e).filter((function(r){return n.isKeyAllowedEmpty(t,r)||null!=(o=e[r])&&""!==o;var o})).reduce((function(t,n){var o;return r(r({},t),((o={})[n]=e[n],o))}),{})},e.prototype.removeUnknownParameters=function(e){var t=Object.keys(e).filter((function(e){if(function(e){return c(c(c([],Ee,!0),X,!0),[Ae,Pe],!1).some((function(t){return t(e)}))}(e))return!0;console.log(e,"is not processed by coveoua")})).reduce((function(t,n){var o;return r(r({},t),((o={})[n]=e[n],o))}),{});return t},e.prototype.processCustomParameters=function(e){var t=e.custom,n=o(e,["custom"]),i={};t&&z(t)&&(i=this.lowercaseKeys(t));var s,c=K(s=n).reduce((function(e,t){var n,o=Fe(t);return r(r({},e),o?xe(o,s[t]):((n={})[t]=s[t],n))}),{});return r(r({},i),c)},e.prototype.mapCustomParametersToCustomData=function(e){var t=e.custom,n=o(e,["custom"]);if(t&&z(t)){var i=this.lowercaseKeys(t);return r(r({},n),{customData:r(r({},i),e.customData)})}return e},e.prototype.lowercaseKeys=function(e){var t=Object.keys(e),n={};return t.forEach((function(t){n[t.toLowerCase()]=e[t]})),n},e.prototype.validateParams=function(e,t){var r=e.anonymizeIp,i=o(e,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf("".concat(r).toLowerCase())&&(i.anonymizeIp=1),t!=n.view&&t!=n.click&&t!=n.search&&t!=n.custom||(i.originLevel3=this.limit(i.originLevel3,128)),t==n.view&&(i.location=this.limit(i.location,128)),"pageview"!=t&&"event"!=t||(i.referrer=this.limit(i.referrer,2048),i.location=this.limit(i.location,2048),i.page=this.limit(i.page,2048)),i},e.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,n=e.userId,r=o(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!n?(r.userId="anonymous",r):e},e.prototype.limit=function(e,t){return"string"!=typeof e?e:e.substring(0,t)},Object.defineProperty(e.prototype,"baseUrl",{get:function(){return Ye(this.options.endpoint,this.options.version)},enumerable:!1,configurable:!0}),e}(),$e=Object.freeze({__proto__:null,CoveoAnalyticsClient:Ge,Endpoints:je,Version:Be,buildBaseUrl:Ye,default:Ge}),Je=r({},N),Xe=Object.keys(Je).map((function(e){return Je[e]})),Ze=function(e){function i(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r,i=e.call(this,{client:n,uuidGenerator:o})||this;return i.products=[],i.impressions=[],i}return t(i,e),i.prototype.getApi=function(t){var n=e.prototype.getApi.call(this,t);if(null!==n)return n;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 n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xe.indexOf(t)?e.addECDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==Xe.indexOf(t)&&e.updateLocationInformation(t,o),o}))},i.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Je.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Je.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},i.prototype.addECDataToPayload=function(e,t){var n=r(r(r(r({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),o=this.getProductPayload(),i=this.getImpressionPayload();return this.clearData(),r(r(r(r({},i),o),n),t)},i.prototype.getProductPayload=function(){var e=this;return this.products.map((function(t){return e.assureProductValidity(t)})).reduce((function(t,n,o){return r(r({},t),function(e,t){return K(e).reduce((function(n,o){var i,s="pr".concat(t+1).concat(Z[o]||o);return r(r({},n),((i={})[s]=e[o],i))}),{})}(e.convertNumberTypes(n),o))}),{})},i.prototype.convertNumberTypes=function(e){var t=r({},e);return"quantity"in t&&(t.quantity=W(t.quantity)),"position"in t&&(t.position=W(t.position)),t},i.prototype.getImpressionPayload=function(){var e=this;return this.getImpressionsByList().map((function(t){var n=t.impressions,i=o(t,["impressions"]);return r(r({},i),{impressions:n.map((function(t){return e.assureBaseImpressionValidity(t)}))})})).reduce((function(e,t,n){return r(r({},e),function(e,t,n){var o=e.impressions.reduce((function(e,o,i){return r(r({},e),se(o,t,i,n))}),{});return e.listName&&(o["il".concat(t+1,"nm")]=e.listName),o}(t,n,"pi"))}),{})},i.prototype.assureProductValidity=function(e){var t=e.position,n=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '".concat(e.name||e.id,"' must be greater ")+"than 0 when provided."),n):e},i.prototype.assureBaseImpressionValidity=function(e){var t=e.position,n=o(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '".concat(e.name||e.id,"'")+" must be greater than 0 when provided."),n):e},i.prototype.getImpressionsByList=function(){return this.impressions.reduce((function(e,t){var n=t.list,r=o(t,["list"]),i=e.find((function(e){return e.listName===n}));return i?i.impressions.push(r):e.push({listName:n,impressions:[r]}),e}),[])},i.Id="ec",i}(H),et=Ze,tt=r({},N),nt=Object.keys(tt).map((function(e){return tt[e]})),rt=function(e){function o(t){var n=t.client,r=t.uuidGenerator,o=void 0===r?L:r,i=e.call(this,{client:n,uuidGenerator:o})||this;return i.ticket={},i}return t(o,e),o.prototype.getApi=function(t){var n=e.prototype.getApi.call(this,t);return null!==n?n:"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 n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==nt.indexOf(t)?e.addSVCDataToPayload(t,o):o})),this.client.registerAfterSendEventHook((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=n[0];return-1!==nt.indexOf(t)&&e.updateLocationInformation(t,o),o}))},o.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(tt.pageview,{newEventType:n.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(tt.event,{newEventType:n.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},o.prototype.addSVCDataToPayload=function(e,t){var n,o=r(r(r(r({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(n=this.actionData)&&void 0!==n?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),r(r(r({},i),o),t)},o.prototype.getTicketPayload=function(){return e=this.ticket,K(e).filter((function(t){return void 0!==e[t]})).reduce((function(t,n){var o,i=G[n]||n;return r(r({},t),((o={})[i]=e[n],o))}),{});var e},o.Id="svc",o}(H),ot=rt,it=function(){function e(){var e;this.registeredPluginsMap=((e={})[et.Id]=et,e[ot.Id]=ot,e[Y.Id]=Y,e),this.requiredPlugins={}}return e.prototype.require=function(e,t){var n=this.registeredPluginsMap[e];if(!n)throw new Error('No plugin named "'.concat(e,"\" is currently registered. If you use a custom plugin, use 'provide' first."));this.requiredPlugins[e]=new n(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 n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'.concat(e,'" is not required. Check that you required it on initialization.'));var i=o.getApi(t);if(!i)throw new Error('The function "'.concat(t,'" does not exist on the plugin "').concat(e,'".'));if("function"!=typeof i)throw new Error('"'.concat(t,'" of the plugin "').concat(e,'" is not a function.'));return i.apply(o,n)},e.DefaultPlugins=[et.Id,ot.Id,Y.Id],e}(),st=function(){function e(){this.plugins=new it,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 Ge({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 r(r({},t),o.params)})),this.client.addEventTypeMapping(n.view,{newEventType:n.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?it.DefaultPlugins:Array.isArray(null==e?void 0:e.plugins)?e.plugins:it.DefaultPlugins},e.prototype.getEndpoint=function(e){return"string"==typeof e?e||je.default:(null==e?void 0:e.endpoint)?e.endpoint:je.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 Ge({endpoint:e})},e.prototype.set=function(e,t){var n=this;"string"==typeof e?this.params[e]=t:Object.keys(e).map((function(t){n.params[t]=e[t]}))},e.prototype.send=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(!r)throw new Error('You must provide an event type when calling "send".');return(e=this.client).sendEvent.apply(e,c([r.toLowerCase()],o,!1))},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,r(r({},t),{client:this.client}))},e.prototype.callPlugin=function(e,t){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(!this.client)throw new Error("You must call init before calling a plugin function");return(n=this.plugins).execute.apply(n,c([e,t],r,!1))},e.prototype.reset=function(){this.client=void 0,this.plugins=new it,this.params={}},e.prototype.version=function(){return q},e}(),ct=new st,at=function(){return ct.client},ut=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e);r[1];var o=r[2],i=r[3],s=ct[i];if(o&&i)return ct.callPlugin.apply(ct,c([o,i],t,!1));if(s)return s.apply(ct,t);throw new Error('The action "'.concat(e,'" does not exist. Available actions: ').concat(["init","set","send","onLoad","callPlugin","reset","require","provide","version"].join(", "),"."))},lt=Object.freeze({__proto__:null,CoveoUA:st,coveoua:ct,default:ut,getCurrentClient:at,handleOneAnalyticsEvent:ut});!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView"}(Ke||(Ke={})),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"}(We||(We={}));var pt=((ze={})[We.triggerNotify]="queryPipelineTriggers",ze[We.triggerExecute]="queryPipelineTriggers",ze[We.triggerQuery]="queryPipelineTriggers",ze[We.triggerRedirect]="queryPipelineTriggers",ze[We.queryError]="errors",ze[We.queryErrorBack]="errors",ze[We.queryErrorClear]="errors",ze[We.queryErrorRetry]="errors",ze[We.pagerNext]="getMoreResults",ze[We.pagerPrevious]="getMoreResults",ze[We.pagerNumber]="getMoreResults",ze[We.pagerResize]="getMoreResults",ze[We.pagerScrolling]="getMoreResults",ze[We.facetSearch]="facet",ze[We.facetShowLess]="facet",ze[We.facetShowMore]="facet",ze[We.recommendation]="recommendation",ze[We.likeSmartSnippet]="smartSnippet",ze[We.dislikeSmartSnippet]="smartSnippet",ze[We.expandSmartSnippet]="smartSnippet",ze[We.collapseSmartSnippet]="smartSnippet",ze[We.openSmartSnippetFeedbackModal]="smartSnippet",ze[We.closeSmartSnippetFeedbackModal]="smartSnippet",ze[We.sendSmartSnippetReason]="smartSnippet",ze[We.expandSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",ze[We.clearRecentQueries]="recentQueries",ze[We.recentResultClick]="recentlyClickedDocuments",ze[We.clearRecentResults]="recentlyClickedDocuments",ze[We.showLessFoldedResults]="folding",ze[Ke.expandToFullUI]="interface",ze[Ke.openUserActions]="User Actions",ze[Ke.showPrecedingSessions]="User Actions",ze[Ke.showFollowingSessions]="User Actions",ze[Ke.clickViewedDocument]="User Actions",ze[Ke.clickPageView]="User Actions",ze[We.caseDetach]="case",ze),ht=function(){function e(){this.runtime=new _e,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(n.search)},e.prototype.sendSearchEvent=function(){return Promise.resolve()},e.prototype.makeClickEvent=function(){return this.makeEvent(n.click)},e.prototype.sendClickEvent=function(){return Promise.resolve()},e.prototype.makeCustomEvent=function(){return this.makeEvent(n.custom)},e.prototype.sendCustomEvent=function(){return Promise.resolve()},e.prototype.makeViewEvent=function(){return this.makeEvent(n.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 q},enumerable:!1,configurable:!0}),e}();function dt(e){var t=e.join(";");return t.length<=256?t:dt(e.slice(1))}var ft=function(e){var t=function(e){return e.map((function(e){return e.replace(/;/g,"")}))}(e),n=function(e){var t="";return e.filter((function(e){var n=e!==t;return t=e,n}))}(t);return dt(n)};function vt(e){var t="string"==typeof e.partialQueries?e.partialQueries:ft(e.partialQueries),n="string"==typeof e.suggestions?e.suggestions:ft(e.suggestions);return r(r({},e),{partialQueries:t,suggestions:n})}var gt,mt,yt,St=function(){function e(e,t){this.opts=e,this.provider=t;var n=!1===e.enableAnalytics||Qe();this.coveoAnalyticsClient=n?new ht:new Ge(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof Ge&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ht},e.prototype.enable=function(){this.coveoAnalyticsClient=new Ge(this.opts)},e.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(We.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(We.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(We.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(We.recommendationOpen,e,t)},e.prototype.logRecommendationOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecommendationOpen(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.documentQuickview,e,t)},e.prototype.logDocumentQuickview=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentQuickview(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(We.documentOpen,e,t)},e.prototype.logDocumentOpen=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeDocumentOpen(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(We.omniboxAnalytics,vt(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(We.omniboxFromLink,vt(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(We.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(We.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(We.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(We.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(We.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(We.triggerRedirect,r(r({},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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(n){switch(n.label){case 0:return[4,this.makeCustomEvent(We.queryErrorBack)];case 1:return[2,{description:(e=n.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(We.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(n){switch(n.label){case 0:return[4,this.makeCustomEvent(We.queryErrorRetry)];case 1:return[2,{description:(e=n.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(We.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(n){switch(n.label){case 0:return[4,this.makeCustomEvent(We.queryErrorClear)];case 1:return[2,{description:(e=n.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(We.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(We.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(We.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(We.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(We.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(We.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(We.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(We.sendSmartSnippetReason,{reason:e,details:t})},e.prototype.logSmartSnippetFeedbackReason=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSmartSnippetFeedbackReason(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(We.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(We.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(We.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(We.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(We.openSmartSnippetSource,e,t)},e.prototype.logOpenSmartSnippetSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSource(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(We.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},e.prototype.makeCopyToClipboard=function(e,t){return this.makeClickEvent(We.copyToClipboard,e,t)},e.prototype.logCopyToClipboard=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeCopyToClipboard(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionSource(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(We.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(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetInlineLink(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(We.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(n){switch(n.label){case 0:return[4,this.makeOpenSmartSnippetSuggestionInlineLink(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(We.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(We.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(We.recentResultClick,{info:e,identifier:t})},e.prototype.logRecentResultClick=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeRecentResultClick(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(We.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(We.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(We.showMoreFoldedResults,e,t)},e.prototype.logShowMoreFoldedResults=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeShowMoreFoldedResults(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(We.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 n;return{actionCause:t,customData:null===(n=e.payload)||void 0===n?void 0:n.customData}},e.prototype.makeCustomEvent=function(e,t,n){return void 0===n&&(n=pt[e]),i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return this.coveoAnalyticsClient.getParameters,o=r(r({},this.provider.getBaseMetadata()),t),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:n,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,e),log:function(e){var t=e.searchUID;return a.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEvent=function(e,t,n){return void 0===n&&(n=pt[e]),i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEvent(e,t,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeCustomEventWithType=function(e,t,n){return i(this,void 0,void 0,(function(){var o,i,c,a;return s(this,(function(s){switch(s.label){case 0:return o=r(r({},this.provider.getBaseMetadata()),n),c=[{}],[4,this.getBaseEventRequest(o)];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{eventType:t,eventValue:e}]),[4,this.coveoAnalyticsClient.makeCustomEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,e),log:function(e){var t=e.searchUID;return a.log({lastSearchQueryUid:t})}}]}}))}))},e.prototype.logCustomEventWithType=function(e,t,n){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.makeCustomEventWithType(e,t,n)];case 1:return[2,r.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.makeSearchEvent(e,t)];case 1:return[2,n.sent().log({searchUID:this.provider.getSearchUID()})]}}))}))},e.prototype.makeSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return[4,this.getBaseSearchEventRequest(e,t)];case 1:return n=o.sent(),[4,this.coveoAnalyticsClient.makeSearchEvent(n)];case 2:return r=o.sent(),[2,{description:this.makeEventDescription(r,e),log:function(e){var t=e.searchUID;return r.log({searchQueryUid:t})}}]}}))}))},e.prototype.makeClickEvent=function(e,t,n,o){return i(this,void 0,void 0,(function(){var i,c,a;return s(this,(function(s){switch(s.label){case 0:return c=[r({},t)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.concat([s.sent()])),{queryPipeline:this.provider.getPipeline(),actionCause:e}]),[4,this.coveoAnalyticsClient.makeClickEvent(i)];case 2:return a=s.sent(),[2,{description:this.makeEventDescription(a,e),log:function(e){var t=e.searchUID;return a.log({searchQueryUid:t})}}]}}))}))},e.prototype.logClickEvent=function(e,t,n,r){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.makeClickEvent(e,t,n,r)];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 n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.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,n,o;return s(this,(function(i){switch(i.label){case 0:return t=r(r({},this.provider.getBaseMetadata()),e),n=[r(r({},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,r.apply(void 0,n.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 Ge?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 r(r({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})},e}();!function(e){e.click="click",e.flowStart="flowStart"}(gt||(gt={})),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"}(mt||(mt={})),function(e){e.quit="Quit",e.solved="Solved"}(yt||(yt={}));var kt=function(){function e(e,t){var n;this.options=e,this.provider=t;var r=(null===(n=e.enableAnalytics)||void 0===n||n)&&!Qe();this.coveoAnalyticsClient=r?new Ge(e):new ht,this.svc=new rt({client:this.coveoAnalyticsClient})}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof Ge&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ht,this.svc=new rt({client:this.coveoAnalyticsClient})},e.prototype.enable=function(){this.coveoAnalyticsClient=new Ge(this.options),this.svc=new rt({client:this.coveoAnalyticsClient})},e.prototype.logEnterInterface=function(e){return this.svc.setAction(mt.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},e.prototype.logUpdateCaseField=function(e){return this.svc.setAction(mt.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(mt.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(mt.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(mt.suggestionRate,r({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(mt.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCancelled=function(e){return this.svc.setAction(mt.caseCancelled,{reason:yt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseSolved=function(e){return this.svc.setAction(mt.caseSolved,{reason:yt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.logCaseCreated=function(e){return this.svc.setAction(mt.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},e.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",gt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",gt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},e}(),wt=function(e,t){void 0===t&&(t=!0),e.caseContext;var n=e.caseId,i=e.caseNumber,s=o(e,["caseContext","caseId","caseNumber"]),c=function(e){var t={};return e.caseContext&&Object.keys(e.caseContext).forEach((function(n){var r,o=null===(r=e.caseContext)||void 0===r?void 0:r[n];if(o){var i="context_".concat(n);t[i]=o}})),t}(e);return r(r(r({CaseId:n,CaseNumber:i},s),!!c.context_Case_Subject&&{CaseSubject:c.context_Case_Subject}),t&&c)},It=function(){function e(e,t){this.opts=e,this.provider=t;var n=!1===e.enableAnalytics||Qe();this.coveoAnalyticsClient=n?new ht:new Ge(e)}return e.prototype.disable=function(){this.coveoAnalyticsClient instanceof Ge&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new ht},e.prototype.enable=function(){this.coveoAnalyticsClient=new Ge(this.opts)},e.prototype.logInterfaceLoad=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.interfaceLoad,t)}return this.logSearchEvent(We.interfaceLoad)},e.prototype.logInterfaceChange=function(e){var t=wt(e);return this.logSearchEvent(We.interfaceChange,t)},e.prototype.logStaticFilterDeselect=function(e){var t=wt(e);return this.logSearchEvent(We.staticFilterDeselect,t)},e.prototype.logFetchMoreResults=function(e){if(e){var t=wt(e);return this.logCustomEvent(We.pagerScrolling,r(r({},t),{type:"getMoreResults"}))}return this.logCustomEvent(We.pagerScrolling,{type:"getMoreResults"})},e.prototype.logBreadcrumbFacet=function(e){var t=wt(e);return this.logSearchEvent(We.breadcrumbFacet,t)},e.prototype.logBreadcrumbResetAll=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.breadcrumbResetAll,t)}return this.logSearchEvent(We.breadcrumbResetAll)},e.prototype.logFacetSelect=function(e){var t=wt(e);return this.logSearchEvent(We.facetSelect,t)},e.prototype.logFacetDeselect=function(e){var t=wt(e);return this.logSearchEvent(We.facetDeselect,t)},e.prototype.logFacetUpdateSort=function(e){var t=wt(e);return this.logSearchEvent(We.facetUpdateSort,t)},e.prototype.logFacetClearAll=function(e){var t=wt(e);return this.logSearchEvent(We.facetClearAll,t)},e.prototype.logFacetShowMore=function(e){var t=wt(e,!1);return this.logCustomEvent(We.facetShowMore,t)},e.prototype.logFacetShowLess=function(e){var t=wt(e,!1);return this.logCustomEvent(We.facetShowLess,t)},e.prototype.logQueryError=function(e){var t=wt(e,!1);return this.logCustomEvent(We.queryError,t)},e.prototype.logPagerNumber=function(e){var t=wt(e,!1);return this.logCustomEvent(We.pagerNumber,t)},e.prototype.logPagerNext=function(e){var t=wt(e,!1);return this.logCustomEvent(We.pagerNext,t)},e.prototype.logPagerPrevious=function(e){var t=wt(e,!1);return this.logCustomEvent(We.pagerPrevious,t)},e.prototype.logDidYouMeanAutomatic=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.didyoumeanAutomatic,t)}return this.logSearchEvent(We.didyoumeanAutomatic)},e.prototype.logDidYouMeanClick=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.didyoumeanClick,t)}return this.logSearchEvent(We.didyoumeanClick)},e.prototype.logResultsSort=function(e){var t=wt(e);return this.logSearchEvent(We.resultsSort,t)},e.prototype.logSearchboxSubmit=function(e){if(e){var t=wt(e);return this.logSearchEvent(We.searchboxSubmit,t)}return this.logSearchEvent(We.searchboxSubmit)},e.prototype.logContextChanged=function(e){var t=wt(e);return this.logSearchEvent(Ke.contextChanged,t)},e.prototype.logExpandToFullUI=function(e){var t=wt(e);return this.logCustomEvent(Ke.expandToFullUI,t)},e.prototype.logOpenUserActions=function(e){var t=wt(e,!1);return this.logCustomEvent(Ke.openUserActions,t)},e.prototype.logShowPrecedingSessions=function(e){var t=wt(e,!1);return this.logCustomEvent(Ke.showPrecedingSessions,t)},e.prototype.logShowFollowingSessions=function(e){var t=wt(e,!1);return this.logCustomEvent(Ke.showFollowingSessions,t)},e.prototype.logViewedDocumentClick=function(e,t){return this.logCustomEvent(Ke.clickViewedDocument,r(r({},wt(t,!1)),{document:e}))},e.prototype.logPageViewClick=function(e,t){return this.logCustomEvent(Ke.clickPageView,r(r({},wt(t,!1)),{pageView:e}))},e.prototype.logDocumentOpen=function(e,t,n){return this.logClickEvent(We.documentOpen,e,t,n?wt(n,!1):void 0)},e.prototype.logCopyToClipboard=function(e,t,n){return this.logClickEvent(We.copyToClipboard,e,t,n?wt(n,!1):void 0)},e.prototype.logDocumentQuickview=function(e,t,n){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl};return this.logClickEvent(We.documentQuickview,e,t,n?r(r({},wt(n,!1)),o):o)},e.prototype.logCaseAttach=function(e,t,n){var o={documentTitle:e.documentTitle,documentURL:e.documentUrl,resultUriHash:e.documentUriHash};return this.logClickEvent(We.caseAttach,e,t,n?r(r({},wt(n,!1)),o):o)},e.prototype.logCaseDetach=function(e,t){return this.logCustomEvent(We.caseDetach,t?r(r({},wt(t,!1)),{resultUriHash:e}):{resultUriHash:e})},e.prototype.logLikeSmartSnippet=function(e){return this.logCustomEvent(We.likeSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logDislikeSmartSnippet=function(e){return this.logCustomEvent(We.dislikeSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logExpandSmartSnippet=function(e){return this.logCustomEvent(We.expandSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logCollapseSmartSnippet=function(e){return this.logCustomEvent(We.collapseSmartSnippet,e?wt(e,!1):void 0)},e.prototype.logOpenSmartSnippetFeedbackModal=function(e){return this.logCustomEvent(We.openSmartSnippetFeedbackModal,e?wt(e,!1):void 0)},e.prototype.logCloseSmartSnippetFeedbackModal=function(e){return this.logCustomEvent(We.closeSmartSnippetFeedbackModal,e?wt(e,!1):void 0)},e.prototype.logSmartSnippetFeedbackReason=function(e,t,n){return this.logCustomEvent(We.sendSmartSnippetReason,n?r(r({},wt(n,!1)),{reason:e,details:t}):{reason:e,details:t})},e.prototype.logExpandSmartSnippetSuggestion=function(e,t){var n="documentId"in e?e:{documentId:e};return this.logCustomEvent(We.expandSmartSnippetSuggestion,t?r(r({},wt(t,!1)),n):n)},e.prototype.logCollapseSmartSnippetSuggestion=function(e,t){var n="documentId"in e?e:{documentId:e};return this.logCustomEvent(We.collapseSmartSnippetSuggestion,t?r(r({},wt(t,!1)),n):n)},e.prototype.logOpenSmartSnippetSource=function(e,t,n){return this.logClickEvent(We.openSmartSnippetSource,e,t,n?wt(n,!1):void 0)},e.prototype.logOpenSmartSnippetSuggestionSource=function(e,t,n){return this.logClickEvent(We.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},n?r(r({},wt(n,!1)),t):t)},e.prototype.logOpenSmartSnippetInlineLink=function(e,t,n){return this.logClickEvent(We.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},n?r(r({},wt(n,!1)),t):t)},e.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t,n){return this.logClickEvent(We.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},n?r(r({},wt(n,!1)),t):t)},e.prototype.logCustomEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,o,i;return s(this,(function(s){switch(s.label){case 0:return n=r(r({},this.provider.getBaseMetadata()),t),i=[{}],[4,this.getBaseCustomEventRequest(n)];case 1:return o=r.apply(void 0,[r.apply(void 0,i.concat([s.sent()])),{eventType:pt[e],eventValue:e}]),[2,this.coveoAnalyticsClient.sendCustomEvent(o)]}}))}))},e.prototype.logSearchEvent=function(e,t){return i(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return r=(n=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(e,t)];case 1:return[2,r.apply(n,[o.sent()])]}}))}))},e.prototype.logClickEvent=function(e,t,n,o){return i(this,void 0,void 0,(function(){var i,c;return s(this,(function(s){switch(s.label){case 0:return c=[r({},t)],[4,this.getBaseEventRequest(r(r({},n),o))];case 1:return i=r.apply(void 0,[r.apply(void 0,c.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(n){switch(n.label){case 0:return t=[{}],[4,this.getBaseEventRequest(e)];case 1:return[2,r.apply(void 0,[r.apply(void 0,t.concat([n.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}}))}))},e.prototype.getBaseSearchEventRequest=function(e,t){return i(this,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return n=[{}],[4,this.getBaseEventRequest(t)];case 1:return[2,r.apply(void 0,[r.apply(void 0,[r.apply(void 0,n.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,n,o;return s(this,(function(i){switch(i.label){case 0:return t=r(r({},this.provider.getBaseMetadata()),e),n=[r({},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,r.apply(void 0,n.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 Ge?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},e}(),bt=Object.freeze({__proto__:null,get CaseAssistActions(){return mt},CaseAssistClient:kt,get CaseAssistEvents(){return gt},get CaseCancelledReasons(){return yt},CoveoAnalyticsClient:Ge,CoveoInsightClient:It,CoveoSearchPageClient:St,CoveoUA:st,CustomEventsTypes:pt,get EventType(){return n},get InsightEvents(){return Ke},get SearchPageEvents(){return We},SimpleAnalytics:lt,analytics:$e,donottrack:He,getCurrentClient:at,handleOneAnalyticsEvent:ut,history:b,storage:k});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 Et=self.coveoua||ut;if(self.coveoua=ut,self.coveoanalytics=bt,Et.q){var Ct=Et.q.filter((function(e){return"init"===e[0]})),Dt=Et.q.filter((function(e){return"init"!==e[0]}));c(c([],Ct,!0),Dt,!0).forEach((function(e){return ut.apply(void 0,e)}))}return self.coveoua}));
2
2
  //# sourceMappingURL=coveoua.js.map
@@ -1 +1 @@
1
- export declare const libVersion = "2.27.1";
1
+ export declare const libVersion = "2.27.3";
@@ -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.27.1" ;
596
+ const libVersion = "2.27.3" ;
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
@@ -728,7 +728,7 @@ function sha1(bytes) {
728
728
  const v5 = v35('v5', 0x50, sha1);
729
729
  var uuidv5 = v5;
730
730
 
731
- var libVersion = "2.27.1" ;
731
+ var libVersion = "2.27.3" ;
732
732
 
733
733
  var getFormattedLocation = function (location) {
734
734
  return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(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.27.1" ;
658
+ const libVersion = "2.27.3" ;
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.27.1",
3
+ "version": "2.27.3",
4
4
  "description": "📈 Coveo analytics client (node and browser compatible) ",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.es.js",