@coveo/quantic 3.37.2 → 3.37.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
23
23
  `)}
24
24
 
25
25
  ${t}
26
- `;return new ni(r)}var ni=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},gt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw kw(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&se(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Xe(e){return e===void 0}function Ow(e){return e===null}function se(e){return Xe(e)||Ow(e)}var fe=class{constructor(e={}){Ae(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(Pw(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Pw(e){return Xe(e)||Ap(e)}function Ap(e){return typeof e=="boolean"}var ne=class{constructor(e={}){Ae(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(Nw(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Nw(e){return Xe(e)||xp(e)}function xp(e){return typeof e=="number"&&!Number.isNaN(e)}var Fw=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){Ae(this,"value");Ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Xe(e))return null;if(!xa(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Fw.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function xa(e){return Object.prototype.toString.call(e)==="[object String]"}var re=class{constructor(e={}){Ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Cp(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Cp(e){return e!==void 0&&typeof e=="object"}var he=class{constructor(e={}){Ae(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&se(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ap(e)||xa(e)||xp(e)||Cp(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ep(e){return Array.isArray(e)}var el=class{constructor(e){Ae(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();p();f();function Rp(e){return Array.isArray(e)}function Ca(e){return e.trim()===""}var Dw=new Set(["1",1,"yes",!0]);function Ip(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>Dw.has(r))}function Tp(e){let t={};for(let[r,n]of e)t[r]=n;return t}function oi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ea(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function Mw(e){if(Ca(e.openingDelimiter)||Ca(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||Ca(e.content))return e.content;if(e.highlights.length===0)return Gn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Gn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Gn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Gn(e.content.slice(n))),r}function qw(e,t){return e=Gn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?tl(n,t.notMatchDelimiters):o?tl(o,t.exactMatchDelimiters):i?tl(i,t.correctionDelimiters):r)}function tl(e,t){return t?t.open+e+t.close:e}function Gn(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();p();f();var Vp=Dt(Mp(),1);m();d();p();f();var Bt=new Error("Failed to load reducers."),Qn=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},Yr=class extends Error{constructor(r,n){super();Ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();p();f();function qp(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function jp(e){return typeof e!="object"||!e?!1:Object.values(e).every(uA)}function uA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Lp(e){return e===429}var Mt=class e{static call(t){return _asyncToGenerator(function*(){let r=lA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield w(i,a);if(Lp(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,Vp.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&Lp(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Yr(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=oi(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function Je(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function vr(e,t="prod"){return`${Je(e,t)}/rest/search/v2`}function Ia(e,t="prod"){return`${Je(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function lA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=dA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function dA(e,t){return t==="application/x-www-form-urlencoded"?jp(e)?qp(e):"":JSON.stringify(e)}m();d();p();f();m();d();p();f();var Ta=e=>e;m();d();p();f();m();d();p();f();function _a(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function $t(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:_a(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:_a(),extendedResults:{},searchAction:void 0}}m();d();p();f();function br(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var wr=e=>{let{response:t}=e;return t.body?fA(e):pA(t)},fA=e=>gA(e)?hA(e):mA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},pA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function mA(e){return e.body.statusCode!==void 0}function gA(e){return e.body.exception!==void 0}var hA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();p();f();var Ar=class{constructor(){Ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();p();f();m();d();p();f();var si=class{constructor(t){Ae(this,"_basePath");Ae(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();p();f();function Up(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();p();f();var nr=(e,t,r,n)=>{let o=new si(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Bp=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Mt.call({...nr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:br(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Up(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return yA(a)?{success:a}:{error:wr({response:r,body:a})}});return function Bp(_x3,_x4){return _ref3.apply(this,arguments)}}();function yA(e){return typeof e=="string"}m();d();p();f();function SA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function vA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ka(e,t){if(t&&e.name==="AbortError")return{error:vA(e)};if(e instanceof Yr)return{error:SA(e)};throw e}var Oa=class{constructor(t){this.options=t;Ae(this,"apiCallsQueues",{unknown:new Ar,mainSearch:new Ar,facetValues:new Ar,foldingCollection:new Ar,instantResults:new Ar})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/plan"),requestParams:br(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return ka(r);let n=yield r.json();return wA(n)?{success:n}:{error:wr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:br(t),..._this3.options});if(r instanceof Error)return ka(r);let n=yield r.json(),o={response:r,body:n};return bA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:wr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>Mt.call({...nr(t,"POST","application/json",""),requestParams:br(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return ka(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return $p(i)?(a.body=Gp(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:wr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/facet"),requestParams:br(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json",""),requestParams:br(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if($p(n)){let o={response:r,body:n};return o.body=Gp(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:wr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Bp(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return AA(n)?{success:n}:{error:wr({response:r,body:n})}})()}},Pa=e=>e.success!==void 0,ht=e=>e.error!==void 0;function $p(e){return e.results!==void 0}function Gp(e){let t=_a();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function bA(e){return e.completions!==void 0}function wA(e){return e.preprocessingOutput!==void 0}function AA(e){return e.fields!==void 0}m();d();p();f();var Qp=e=>e,Hp=e=>e,zp=e=>e;m();d();p();f();m();d();p();f();m();d();p();f();function Ze(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var xA=typeof Symbol=="function"&&Symbol.observable||"@@observable",Wp=xA,dl=()=>Math.random().toString(36).substring(7).split("").join("."),CA={INIT:`@@redux/INIT${dl()}`,REPLACE:`@@redux/REPLACE${dl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${dl()}`},Na=CA;function Gt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function fl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(fl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((C,E)=>{a.set(E,C)}))}function h(){if(c)throw new Error(Ze(3));return o}function S(C){if(typeof C!="function")throw new Error(Ze(4));if(c)throw new Error(Ze(5));let E=!0;u();let _=s++;return a.set(_,C),function(){if(E){if(c)throw new Error(Ze(6));E=!1,u(),a.delete(_),i=null}}}function v(C){if(!Gt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(c)throw new Error(Ze(9));try{c=!0,o=n(o,C)}finally{c=!1}return(i=a).forEach(_=>{_()}),C}function g(C){if(typeof C!="function")throw new Error(Ze(10));n=C,v({type:Na.REPLACE})}function y(){let C=S;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ze(11));function _(){let k=E;k.next&&k.next(h())}return _(),{unsubscribe:C(_)}},[Wp](){return this}}}return v({type:Na.INIT}),{dispatch:v,subscribe:S,getState:h,replaceReducer:g,[Wp]:y}}function EA(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Na.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Na.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function Hn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{EA(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let S=0;S<n.length;S++){let v=n[S],g=r[v],y=s[v],x=g(y,c);if(typeof x>"u"){let C=c&&c.type;throw new Error(Ze(14))}h[v]=x,u=u||x!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function ci(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Kp(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=ci(...s)(o.dispatch),{...o,dispatch:i}}}function ui(e){return Gt(e)&&"type"in e&&typeof e.type=="string"}m();d();p();f();var wl=Symbol.for("immer-nothing"),li=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function et(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var At=Object,Jr=At.getPrototypeOf,fi="constructor",yi="prototype",gl="configurable",qa="enumerable",Da="writable",pi="value",dt=e=>!!e&&!!e[ze];function ft(e){return e?nm(e)||vi(e)||!!e[li]||!!e[fi]?.[li]||bi(e)||wi(e):!1}var RA=At[yi][fi].toString(),Yp=new WeakMap;function nm(e){if(!e||!zn(e))return!1;let t=Jr(e);if(t===null||t===At[yi])return!0;let r=At.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=Yp.get(r);return n===void 0&&(n=Function.toString.call(r),Yp.set(r,n)),n===RA}function om(e){return dt(e)||et(15,e),e[ze].base_}function Si(e,t,r=!0){Zr(e)===0?(r?Reflect.ownKeys(e):At.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Zr(e){let t=e[ze];return t?t.type_:vi(e)?1:bi(e)?2:wi(e)?3:0}var di=(e,t,r=Zr(e))=>r===2?e.has(t):At[yi].hasOwnProperty.call(e,t),or=(e,t,r=Zr(e))=>r===2?e.get(t):e[t],ja=(e,t,r,n=Zr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function IA(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var vi=Array.isArray,bi=e=>e instanceof Map,wi=e=>e instanceof Set,zn=e=>typeof e=="object",Xr=e=>typeof e=="function",pl=e=>typeof e=="boolean";function TA(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var _A=e=>zn(e)?e?.[ze]:null,ir=e=>e.copy_||e.base_;var Al=e=>e.modified_?e.copy_:e.base_;function hl(e,t){if(bi(e))return new Map(e);if(wi(e))return new Set(e);if(vi(e))return Array[yi].slice.call(e);let r=nm(e);if(t===!0||t==="class_only"&&!r){let n=At.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[Da]===!1&&(s[Da]=!0,s[gl]=!0),(s.get||s.set)&&(n[a]={[gl]:!0,[Da]:!0,[qa]:s[qa],[pi]:e[a]})}return At.create(Jr(e),n)}else{let n=Jr(e);if(n!==null&&r)return{...e};let o=At.create(n);return At.assign(o,e)}}function xl(e,t=!1){return Ga(e)||dt(e)||!ft(e)||(Zr(e)>1&&At.defineProperties(e,{set:Fa,add:Fa,clear:Fa,delete:Fa}),At.freeze(e),t&&Si(e,(r,n)=>{xl(n,!0)},!1)),e}function kA(){et(2)}var Fa={[pi]:kA};function Ga(e){return e===null||!zn(e)?!0:At.isFrozen(e)}var La="MapSet",Va="Patches",Xp="ArrayMethods",Ua={};function en(e){let t=Ua[e];return t||et(0,e),t}var Jp=e=>!!Ua[e];function OA(e,t){Ua[e]||(Ua[e]=t)}var mi,im=()=>mi,PA=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Jp(La)?en(La):void 0,arrayMethodsPlugin_:Jp(Xp)?en(Xp):void 0});function Zp(e,t){t&&(e.patchPlugin_=en(Va),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yl(e){Sl(e),e.drafts_.forEach(NA),e.drafts_=null}function Sl(e){e===mi&&(mi=e.parent_)}var em=e=>mi=PA(mi,e);function NA(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(yl(t),et(4)),ft(e)&&(e=rm(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=rm(t,r);return FA(t,e,!0),yl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wl?e:void 0}function rm(e,t){if(Ga(t))return t;let r=t[ze];if(!r)return Ba(t,e.handledSet_,e);if(!Qa(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);cm(r,e)}return r.copy_}function FA(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xl(t,r)}function am(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Qa=(e,t)=>e.scope_===t,DA=[];function sm(e,t,r,n){let o=ir(e),i=e.type_;if(n!==void 0&&or(o,n,i)===t){ja(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(c,u)=>{if(dt(u)){let h=s.get(u)||[];h.push(c),s.set(u,h)}})}let a=e.draftLocations_.get(t)??DA;for(let s of a)ja(o,s,r,i)}function MA(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Qa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Al(i);sm(e,i.draft_??i,a,r),cm(i,o)})}function cm(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}am(e)}}function qA(e,t,r){let{scope_:n}=e;if(dt(r)){let o=r[ze];Qa(o,n)&&o.callbacks_.push(function(){Ma(e);let a=Al(o);sm(e,r,a,t)})}else ft(r)&&e.callbacks_.push(function(){let i=ir(e);e.type_===3?i.has(r)&&Ba(r,n.handledSet_,n):or(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ba(or(e.copy_,t,e.type_),n.handledSet_,n)})}function Ba(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||dt(e)||t.has(e)||!ft(e)||Ga(e)||(t.add(e),Si(e,(n,o)=>{if(dt(o)){let i=o[ze];if(Qa(i,r)){let a=Al(i);ja(e,n,a,e.type_),am(i)}}else ft(o)&&Ba(o,t,r)})),e}function jA(e,t){let r=vi(e),n={type_:r?1:0,scope_:t?t.scope_:im(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=$a;r&&(o=[n],i=gi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var $a={get(e,t){if(t===ze)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=ir(e);if(!di(o,t,e.type_))return LA(e,o,t);let i=o[t];if(e.finalized_||!ft(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&TA(t))return i;if(i===ml(e.base_,t)){Ma(e);let a=e.type_===1?+t:t,s=bl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ir(e)},ownKeys(e){return Reflect.ownKeys(ir(e))},set(e,t,r){let n=um(ir(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ml(ir(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(IA(r,o)&&(r!==void 0||di(e.base_,t,e.type_)))return!0;Ma(e),vl(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),qA(e,t,r)),!0},deleteProperty(e,t){return Ma(e),ml(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ir(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Da]:!0,[gl]:e.type_!==1||t!=="length",[qa]:n[qa],[pi]:r[t]}},defineProperty(){et(11)},getPrototypeOf(e){return Jr(e.base_)},setPrototypeOf(){et(12)}},gi={};for(let e in $a){let t=$a[e];gi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}gi.deleteProperty=function(e,t){return gi.set.call(this,e,t,void 0)};gi.set=function(e,t,r){return $a.set.call(this,e[0],t,r,e[0])};function ml(e,t){let r=e[ze];return(r?ir(r):e)[t]}function LA(e,t,r){let n=um(t,r);return n?pi in n?n[pi]:n.get?.call(e.draft_):void 0}function um(e,t){if(!(t in e))return;let r=Jr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Jr(r)}}function vl(e){e.modified_||(e.modified_=!0,e.parent_&&vl(e.parent_))}function Ma(e){e.copy_||(e.assigned_=new Map,e.copy_=hl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VA=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}Xr(r)||et(6),n!==void 0&&!Xr(n)&&et(7);let o;if(ft(t)){let i=em(this),a=bl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?yl(i):Sl(i)}return Zp(i,n),tm(o,i)}else if(!t||!zn(t)){if(o=r(t),o===void 0&&(o=t),o===wl&&(o=void 0),this.autoFreeze_&&xl(o,!0),n){let i=[],a=[];en(Va).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else et(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},pl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),pl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),pl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ft(e)||et(8),dt(e)&&(e=Ha(e));let t=em(this),r=bl(t,e,void 0);return r[ze].isManual_=!0,Sl(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&et(9);let{scope_:n}=r;return Zp(n,t),tm(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=en(Va).applyPatches_;return dt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function bl(e,t,r,n){let[o,i]=bi(t)?en(La).proxyMap_(t,r):wi(t)?en(La).proxySet_(t,r):jA(t,r);return(r?.scope_??im()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?MA(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),o}function Ha(e){return dt(e)||et(10,e),lm(e)}function lm(e){if(!ft(e)||Ga(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=hl(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=hl(e,!0);return Si(r,(o,i)=>{ja(r,o,lm(i))},n),t&&(t.finalized_=!1),r}function dm(){function t(y,x=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,E=_A(or(C,y.key_)),_=or(C,y.key_);if(_===void 0||_!==y.draft_&&_!==y.base_&&_!==y.copy_||E!=null&&E.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let T=y.parent_;k=Array.from(T.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||di(C,k)))return null;x.push(k)}if(y.parent_)return t(y.parent_,x);x.reverse();try{r(y.copy_,x)}catch{return null}return x}function r(y,x){let C=y;for(let E=0;E<x.length-1;E++){let _=x[E];if(C=or(C,_),!zn(C)||C===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,x,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:E,inversePatches_:_}=C;switch(y.type_){case 0:case 2:return c(y,x,E,_);case 1:return s(y,x,E,_);case 3:return u(y,x,E,_)}}function s(y,x,C,E){let{base_:_,assigned_:I}=y,k=y.copy_;k.length<_.length&&([_,k]=[k,_],[C,E]=[E,C]);let T=y.allIndicesReassigned_===!0;for(let D=0;D<_.length;D++){let B=k[D],L=_[D];if((T||I?.get(D.toString()))&&B!==L){let U=B?.[ze];if(U&&U.modified_)continue;let q=x.concat([D]);C.push({op:n,path:q,value:g(B)}),E.push({op:n,path:q,value:g(L)})}}for(let D=_.length;D<k.length;D++){let B=x.concat([D]);C.push({op:o,path:B,value:g(k[D])})}for(let D=k.length-1;_.length<=D;--D){let B=x.concat([D]);E.push({op:i,path:B})}}function c(y,x,C,E){let{base_:_,copy_:I,type_:k}=y;Si(y.assigned_,(T,D)=>{let B=or(_,T,k),L=or(I,T,k),j=D?di(_,T)?n:o:i;if(B===L&&j===n)return;let U=x.concat(T);C.push(j===i?{op:j,path:U}:{op:j,path:U,value:g(L)}),E.push(j===o?{op:i,path:U}:j===i?{op:o,path:U,value:g(B)}:{op:n,path:U,value:g(B)})})}function u(y,x,C,E){let{base_:_,copy_:I}=y,k=0;_.forEach(T=>{if(!I.has(T)){let D=x.concat([k]);C.push({op:i,path:D,value:T}),E.unshift({op:o,path:D,value:T})}k++}),k=0,I.forEach(T=>{if(!_.has(T)){let D=x.concat([k]);C.push({op:o,path:D,value:T}),E.unshift({op:i,path:D,value:T})}k++})}function h(y,x,C){let{patches_:E,inversePatches_:_}=C;E.push({op:n,path:[],value:x===wl?void 0:x}),_.push({op:n,path:[],value:y})}function S(y,x){return x.forEach(C=>{let{path:E,op:_}=C,I=y;for(let B=0;B<E.length-1;B++){let L=Zr(I),j=E[B];typeof j!="string"&&typeof j!="number"&&(j=""+j),(L===0||L===1)&&(j==="__proto__"||j===fi)&&et(19),Xr(I)&&j===yi&&et(19),I=or(I,j),zn(I)||et(18,E.join("/"))}let k=Zr(I),T=v(C.value),D=E[E.length-1];switch(_){case n:switch(k){case 2:return I.set(D,T);case 3:et(16);default:return I[D]=T}case o:switch(k){case 1:return D==="-"?I.push(T):I.splice(D,0,T);case 2:return I.set(D,T);case 3:return I.add(T);default:return I[D]=T}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:et(17,_)}}),y}function v(y){if(!ft(y))return y;if(vi(y))return y.map(v);if(bi(y))return new Map(Array.from(y.entries()).map(([C,E])=>[C,v(E)]));if(wi(y))return new Set(Array.from(y).map(v));let x=Object.create(Jr(y));for(let C in y)x[C]=v(y[C]);return di(y,li)&&(x[li]=y[li]),x}function g(y){return dt(y)?v(y):y}OA(Va,{applyPatches_:S,generatePatches_:a,generateReplacementPatches_:h,getPath:t})}var hi=new VA,tn=hi.produce,Cl=hi.produceWithPatches.bind(hi);var El=hi.applyPatches.bind(hi);m();d();p();f();function UA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function BA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $A(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var fm=e=>Array.isArray(e)?e:[e];function GA(e){let t=Array.isArray(e[0])?e[0]:e;return $A(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function QA(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var wD=Object.getPrototypeOf({});var HA=class{constructor(e){this.value=e}deref(){return this.value}},zA=typeof WeakRef<"u"?WeakRef:HA,WA=0,pm=1;function za(){return{s:WA,v:void 0,o:null,p:null}}function Ai(e,t={}){let r=za(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let S=0,v=c;S<v;S++){let g=arguments[S];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let x=y.get(g);x===void 0?(s=za(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);let x=y.get(g);x===void 0?(s=za(),y.set(g,s)):s=x}}let u=s,h;if(s.s===pm)h=s.v;else if(h=e.apply(null,arguments),i++,n){let S=o?.deref?.()??o;S!=null&&n(S,h)&&(h=S,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new zA(h):h}return u.s=pm,u.v=h,h}return a.clearCache=()=>{r=za(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function KA(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),UA(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:S,memoizeOptions:v=[],argsMemoize:g=Ai,argsMemoizeOptions:y=[],devModeChecks:x={}}=h,C=fm(v),E=fm(y),_=GA(o),I=S(function(){return i++,u.apply(null,arguments)},...C),k=!0,T=g(function(){a++;let B=QA(_,arguments);return s=I.apply(null,B),s},...E);return Object.assign(T,{resultFunc:u,memoizedResultFunc:I,dependencies:_,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:S,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Le=KA(Ai),YA=Object.assign((e,t=Le)=>{BA(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>YA});m();d();p();f();function mm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var gm=mm(),hm=mm;var XA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ci:ci.apply(null,arguments)},LD=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},JA=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ui(n)&&n.type===e,r}var Cm=class xi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xi.prototype)}static get[Symbol.species](){return xi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xi(...t[0].concat(this)):new xi(...t.concat(this))}};function ym(e){return ft(e)?tn(e,()=>{}):e}function Wa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ZA(e){return typeof e=="boolean"}var ex=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Cm;return r&&(ZA(r)?a.push(gm):a.push(hm(r.extraArgument))),a},Ci="RTK_autoBatch",Yn=()=>e=>({payload:e,meta:{[Ci]:!0}}),Sm=e=>t=>{setTimeout(t,e)},tx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Sm(10):e.type==="callback"?e.queueNotification:Sm(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let S=()=>o&&h(),v=n.subscribe(S);return s.add(h),()=>{v(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Ci],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},rx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Cm(e);return n&&o.push(tx(typeof n=="object"?n:void 0)),o};function Em(e){let t=ex(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Gt(r))c=Hn(r);else throw new Error(pt(1));let u;typeof n=="function"?u=n(t):u=t();let h=ci;o&&(h=XA({trace:!1,...(typeof o=="object"&&o)}));let S=Kp(...u),v=rx(S),g=typeof s=="function"?s(v):v(),y=h(...g);return fl(c,a,y)}function Rm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function nx(e){return typeof e=="function"}function Ve(e,t){let[r,n,o]=Rm(t),i;if(nx(e))i=()=>ym(e());else{let s=ym(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,S)=>{if(S)if(dt(h)){let g=S(h,c);return g===void 0?h:g}else{if(ft(h))return tn(h,v=>S(v,c));{let v=S(h,c);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},s)}return a.getInitialState=i,a}var Im=(e,t)=>JA(e)?e.match(t):e(t);function Qt(...e){return t=>e.some(r=>Im(r,t))}function Kn(...e){return t=>e.every(r=>Im(r,t))}function Ja(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Ei(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Za(...e){return e.length===0?t=>Ja(t,["pending"]):Ei(e)?Qt(...e.map(t=>t.pending)):Za()(e[0])}function nn(...e){return e.length===0?t=>Ja(t,["rejected"]):Ei(e)?Qt(...e.map(t=>t.rejected)):nn()(e[0])}function Ri(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kn(nn(...e),t):Ei(e)?Kn(nn(...e),t):Ri()(e[0])}function ar(...e){return e.length===0?t=>Ja(t,["fulfilled"]):Ei(e)?Qt(...e.map(t=>t.fulfilled)):ar()(e[0])}function es(...e){return e.length===0?t=>Ja(t,["pending","fulfilled","rejected"]):Ei(e)?Qt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):es()(e[0])}var ox="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ii=(e=21)=>{let t="",r=e;for(;r--;)t+=ox[Math.random()*64|0];return t},ix=["name","message","stack","code"],Rl=class{constructor(e,t){Ae(this,"_type");this.payload=e,this.meta=t}},vm=class{constructor(e,t){Ae(this,"_type");this.payload=e,this.meta=t}},ax=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of ix)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},bm="External signal was aborted",Ee=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(c,u,h,S)=>({payload:c,meta:{...(S||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=N(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=N(t+"/rejected",(c,u,h,S,v)=>({payload:S,error:(n&&n.serializeError||ax)(c||"Rejected"),meta:{...(v||{}),arg:h,requestId:u,rejectedWithValue:!!S,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c,{signal:u}={}){return(h,S,v)=>{let g=n?.idGenerator?n.idGenerator(c):Ii(),y=new l.AbortController,x,C;function E(I){C=I,y.abort()}u&&(u.aborted?E(bm):u.addEventListener("abort",()=>E(bm),{once:!0}));let _=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(c,{getState:S,extra:v});if(cx(T)&&(T=yield T),T===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((B,L)=>{x=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",x,{once:!0})});h(i(g,c,n?.getPendingMeta?.({requestId:g,arg:c},{getState:S,extra:v}))),I=yield Promise.race([D,Promise.resolve(r(c,{dispatch:h,getState:S,extra:v,requestId:g,signal:y.signal,abort:E,rejectWithValue:(B,L)=>new Rl(B,L),fulfillWithValue:(B,L)=>new vm(B,L)})).then(B=>{if(B instanceof Rl)throw B;return B instanceof vm?o(B.payload,g,c,B.meta):o(B,g,c)})])}catch(T){I=T instanceof Rl?a(null,g,c,T.payload,T.meta):a(T,g,c)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||h(I),I})();return Object.assign(_,{abort:E,requestId:g,arg:c,unwrap(){return _.then(sx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Qt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function sx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function cx(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Tm=Symbol.for("rtk-slice-createasyncthunk"),UD={[Tm]:Ee};function ux(e,t){return`${e}/${t}`}function lx({creators:e}={}){let t=e?.asyncThunk?.[Tm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(fx()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,k){let T=typeof I=="string"?I:I.type;if(!T)throw new Error(pt(12));if(T in c.sliceCaseReducersByType)throw new Error(pt(13));return c.sliceCaseReducersByType[T]=k,u},addMatcher(I,k){return c.sliceMatchers.push({matcher:I,reducer:k}),u},exposeAction(I,k){return c.actionCreators[I]=k,u},exposeCaseReducer(I,k){return c.sliceCaseReducersByName[I]=k,u}};s.forEach(I=>{let k=a[I],T={reducerName:I,type:ux(o,I),createNotation:typeof n.reducers=="function"};mx(k)?hx(T,k,u,t):px(T,k,u)});function h(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?Rm(n.extraReducers):[n.extraReducers],D={...I,...c.sliceCaseReducersByType};return Ve(n.initialState,B=>{for(let L in D)B.addCase(L,D[L]);for(let L of c.sliceMatchers)B.addMatcher(L.matcher,L.reducer);for(let L of k)B.addMatcher(L.matcher,L.reducer);T&&B.addDefaultCase(T)})}let S=I=>I,v=new Map,g=new WeakMap,y;function x(I,k){return y||(y=h()),y(I,k)}function C(){return y||(y=h()),y.getInitialState()}function E(I,k=!1){function T(B){let L=B[I];return typeof L>"u"&&k&&(L=Wa(g,T,C)),L}function D(B=S){let L=Wa(v,k,()=>new WeakMap);return Wa(L,B,()=>{let j={};for(let[U,q]of Object.entries(n.selectors??{}))j[U]=dx(q,B,()=>Wa(g,B,C),k);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let _={name:o,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:C,...E(i),injectInto(I,{reducerPath:k,...T}={}){let D=k??i;return I.inject({reducerPath:D,reducer:x},T),{..._,...E(D,!0)}}};return _}}function dx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=lx();function fx(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function px({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!gx(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?N(e,a):N(e))}function mx(e){return e._reducerDefinitionType==="asyncThunk"}function gx(e){return e._reducerDefinitionType==="reducerWithPrepare"}function hx({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,S=o(e,i,h);n.exposeAction(t,S),a&&n.addCase(S.fulfilled,a),s&&n.addCase(S.pending,s),c&&n.addCase(S.rejected,c),u&&n.addMatcher(S.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ka,pending:s||Ka,rejected:c||Ka,settled:u||Ka})}function Ka(){}var yx="task",_m="listener",km="completed",_l="cancelled",Sx=`task-${_l}`,vx=`task-${km}`,Il=`${_m}-${_l}`,bx=`${_m}-${km}`,ts=class{constructor(e){Ae(this,"name","TaskAbortError");Ae(this,"message");this.code=e,this.message=`${yx} ${_l} (reason: ${e})`}},kl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ya=()=>{},Om=(e,t=Ya)=>(e.catch(t),e),Pm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new ts(e.reason)};function Nm(e,t){let r=Ya;return new Promise((n,o)=>{let i=()=>o(new ts(e.reason));if(e.aborted){i();return}r=Pm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ya})}var wx=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof ts?"cancelled":"rejected",error:r}}finally{t?.()}});return function wx(_x5,_x6){return _ref5.apply(this,arguments)}}(),Xa=e=>t=>Om(Nm(e,t).then(r=>(rn(e),r))),Fm=e=>{let t=Xa(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wn}=Object,wm={},rs="listenerMiddleware",Ax=(e,t)=>{let r=n=>Pm(e,()=>n.abort(e.reason));return(n,o)=>{kl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=wx(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:Xa(i.signal),delay:Fm(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(vx));return o?.autoJoin&&t.push(a.catch(Ya)),{result:Xa(e)(a),cancel(){i.abort(Sx)}}}},xx=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(S,v)=>{v.unsubscribe(),c([S,v.getState(),v.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield Nm(t,Promise.race(s));return rn(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>Om(r(n,o))},Dm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return kl(i,"options.listener"),{predicate:o,type:t,effect:i}},Mm=Wn(e=>{let{type:t,predicate:r,effect:n}=Dm(e);return{id:Ii(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>Mm}),Am=(e,t)=>{let{type:r,effect:n,predicate:o}=Dm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Tl=e=>{e.pending.forEach(t=>{t.abort(Il)})},Cx=(e,t)=>()=>{for(let r of t.keys())Tl(r);e.clear()},xm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},qm=Wn(N(`${rs}/add`),{withTypes:()=>qm}),Ex=N(`${rs}/removeAll`),jm=Wn(N(`${rs}/remove`),{withTypes:()=>jm}),Rx=(...e)=>{console.error(`${rs}/error`,...e)},Lm=(e={})=>{let t=new Map,r=new Map,n=g=>{let y=r.get(g)??0;r.set(g,y+1)},o=g=>{let y=r.get(g)??1;y===1?r.delete(g):r.set(g,y-1)},{extra:i,onError:a=Rx}=e;kl(a,"onError");let s=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),y=>{g.unsubscribe(),y?.cancelActive&&Tl(g)}),c=g=>{let y=Am(t,g)??Mm(g);return s(y)};Wn(c,{withTypes:()=>c});let u=g=>{let y=Am(t,g);return y&&(y.unsubscribe(),g.cancelActive&&Tl(y)),!!y};Wn(u,{withTypes:()=>u});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,y,x,C){let E=new l.AbortController,_=xx(c,E.signal),I=[];try{g.pending.add(E),n(g),yield Promise.resolve(g.effect(y,Wn({},x,{getOriginalState:C,condition:(k,T)=>_(k,T).then(Boolean),take:_,delay:Fm(E.signal),pause:Xa(E.signal),extra:i,signal:E.signal,fork:Ax(E.signal,I),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((k,T,D)=>{k!==E&&(k.abort(Il),D.delete(k))})},cancel:()=>{E.abort(Il),g.pending.delete(E)},throwIfCancelled:()=>{rn(E.signal)}})))}catch(k){k instanceof ts||xm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),E.abort(bx),o(g),g.pending.delete(E)}});return function h(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),S=Cx(t,r);return{middleware:g=>y=>x=>{if(!ui(x))return y(x);if(qm.match(x))return c(x.payload);if(Ex.match(x)){S();return}if(jm.match(x))return u(x.payload);let C=g.getState(),E=()=>{if(C===wm)throw new Error(pt(23));return C},_;try{if(_=y(x),t.size>0){let I=g.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(x,I,C)}catch(B){D=!1,xm(a,B,{raisedBy:"predicate"})}D&&h(T,x,g,E)}}}finally{C=wm}return _},startListening:c,stopListening:u,clearListeners:S}};function pt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();p();f();var J=new z({required:!0,emptyAllowed:!1}),tt=new z({required:!1,emptyAllowed:!1}),rt=new z({required:!0,emptyAllowed:!0}),ZD=new z({required:!1,emptyAllowed:!0}),ns=new he({each:J,required:!0}),Vm=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Um=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),eM=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),sr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Et=(e,t)=>{if("required"in t)return{payload:new gt({value:t}).validate({value:e}).value};let o=new re({options:{required:!0},values:t}).validate(e);if(o)throw new ni(o);return{payload:e}},$=(e,t)=>{try{return Et(e,t)}catch(r){return{payload:e,error:sr(r)}}},Bm=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Gm(e,t,r,o,"Controller initialization error")},$m=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Gm(e,t,r,o,"Controller initialization error")},Gm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();p();f();var Xn="3.49.0",Qm=["@coveo/atomic","@coveo/quantic"];var Ol=()=>tt,Hm=()=>J,xr=N("configuration/updateBasicConfiguration",e=>$(e,{accessToken:tt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:tt})),Ht=N("configuration/updateSearchConfiguration",e=>$(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:tt,timezone:tt,locale:tt,authenticationProviders:new he({required:!1,each:J})})),Ix={enabled:new fe({default:!0}),originContext:Ol(),originLevel2:Ol(),originLevel3:Ol(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new fe({default:!1}),deviceId:tt,userDisplayName:tt,documentLocation:tt,trackingId:Um,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new re({options:{required:!1},values:Qm.reduce((e,t)=>(e[t]=Vm,e),{})})},Jn=N("configuration/updateAnalyticsConfiguration",e=>$(e,Ix)),Zn=N("configuration/analytics/disable"),eo=N("configuration/analytics/enable"),os=N("configuration/analytics/originlevel2",e=>$(e,{originLevel2:Hm()})),is=N("configuration/analytics/originlevel3",e=>$(e,{originLevel3:Hm()})),zm=N("knowledge/setAgentId",e=>$(e,new z({required:!0})));m();d();p();f();m();d();p();f();m();d();p();f();var Wm={q:new z,enableQuerySyntax:new fe,aq:new z,cq:new z,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new z,f:new re,fExcluded:new re,cf:new re,nf:new re,mnf:new re,df:new re,debug:new fe,sf:new re,tab:new z,af:new re};var Cr=N("searchParameters/restore",e=>$(e,Wm)),Km=N("searchParameters/restoreTab",e=>$(e,J));m();d();p();f();var as=N("debug/enable"),ss=N("debug/disable");m();d();p();f();var cs=()=>!1;var us=Ve(cs(),e=>{e.addCase(as,()=>!0).addCase(ss,()=>!1).addCase(Cr,(t,r)=>r.payload.debug??t)});m();d();p();f();var to=N("pipeline/set",e=>$(e,new z({required:!0,emptyAllowed:!0})));m();d();p();f();m();d();p();f();var Tx=N("history/undo"),_x=N("history/redo"),zt=N("history/snapshot"),uq=Ee("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Tx()),yield t(yt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),lq=Ee("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(_x()),yield t(yt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),yt=Ee("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();p();f();var ro=()=>"";var no=Ve(ro(),e=>{e.addCase(to,(t,r)=>r.payload).addCase(yt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ht,(t,r)=>r.payload.pipeline||t)});m();d();p();f();m();d();p();f();var ls=N("app/setError");m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var oo=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?Pl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Pl(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Pl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();p();f();function kx(){return typeof navigator<"u"}function Ym(){try{return typeof localStorage<"u"}catch{return!1}}function Xm(){try{return typeof sessionStorage<"u"}catch{return!1}}function Jm(){return!!(kx()&&navigator.cookieEnabled)}var Zm=null;function eg(){return Zm||(Ym()?localStorage:Jm()?new Nl:Xm()?sessionStorage:new Fl)}var io=class io{getItem(t){return oo.get(`${io.prefix}${t}`)}removeItem(t){oo.erase(`${io.prefix}${t}`)}setItem(t,r,n){oo.set(`${io.prefix}${t}`,r,n)}};Ae(io,"prefix","coveo_");var Nl=io;var Fl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ds="__coveo.analytics.history",Ox=20,Px=1e3*60,Nx=75,an=class an{constructor(t){Ae(this,"store");this.store=t||eg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ds);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ds);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ds,JSON.stringify(t.slice(0,Ox)))}catch{}}clear(){try{this.store.removeItem(ds)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Nx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Px:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ae(an,"instance",null);var Dl=an,Rt=Dl;m();d();p();f();m();d();p();f();var ao=Le(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Xn}`));m();d();p();f();m();d();p();f();function cr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function V(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(S){a(S)}}function c(h){try{u(n.throw(h))}catch(S){a(S)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function jl(){return typeof window<"u"}function Xl(){return typeof navigator<"u"}function so(){return typeof document<"u"}function Ll(){try{return typeof localStorage<"u"}catch{return!1}}function Fx(){try{return typeof sessionStorage<"u"}catch{return!1}}function mg(){return Xl()&&navigator.cookieEnabled}var Dx=[ve.click,ve.custom,ve.search,ve.view],Mx=(e,t)=>Dx.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:Xl()?navigator.userAgent:"unknown"},t):t,_i=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?tg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],tg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function tg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function qx(){return Ll()?localStorage:mg()?new ki:Fx()?sessionStorage:new uo}var ki=class e{getItem(t){return _i.get(`${e.prefix}${t}`)}removeItem(t){_i.erase(`${e.prefix}${t}`)}setItem(t,r,n){_i.set(`${e.prefix}${t}`,r,n)}};ki.prefix="coveo_";var Vl=class{constructor(){this.cookieStorage=new ki}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fs="__coveo.analytics.history",jx=20,Lx=1e3*60,Vx=75,gs=class{constructor(t){this.store=t||qx()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fs,JSON.stringify(t.slice(0,jx)))}catch{}}clear(){try{this.store.removeItem(fs)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Vx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Lx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Ux=(e,t)=>V(void 0,void 0,void 0,function*(){return e===ve.view?(yield Bx(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Bx=e=>V(void 0,void 0,void 0,function*(){let t=new gs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),ps,$x=new Uint8Array(16);function Gx(){if(!ps&&(ps=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ps))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ps($x)}var Qx=/^(?:[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 hs(e){return typeof e=="string"&&Qx.test(e)}var nt=[];for(let e=0;e<256;++e)nt.push((e+256).toString(16).slice(1));function gg(e,t=0){return nt[e[t+0]]+nt[e[t+1]]+nt[e[t+2]]+nt[e[t+3]]+"-"+nt[e[t+4]]+nt[e[t+5]]+"-"+nt[e[t+6]]+nt[e[t+7]]+"-"+nt[e[t+8]]+nt[e[t+9]]+"-"+nt[e[t+10]]+nt[e[t+11]]+nt[e[t+12]]+nt[e[t+13]]+nt[e[t+14]]+nt[e[t+15]]}function Hx(e){if(!hs(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function zx(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Wx="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Kx="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Yx(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=zx(o)),typeof i=="string"&&(i=Hx(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return gg(u)}try{n.name=e}catch{}return n.DNS=Wx,n.URL=Kx,n}var Xx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rg={randomUUID:Xx};function sn(e,t,r){if(rg.randomUUID&&!t&&!e)return rg.randomUUID();e=e||{};let n=e.random||(e.rng||Gx)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return gg(n)}function Jx(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Ml(e,t){return e<<t|e>>>32-t}function Zx(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=Ml(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],S=r[3],v=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),x=Ml(c,5)+Jx(y,u,h,S)+v+t[y]+s[g]>>>0;v=S,S=h,h=Ml(u,30)>>>0,u=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+S>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var eC=Yx("v5",80,Zx),ng=eC,hg="2.30.54",og=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ti={pageview:"pageview",event:"event"},ys=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},Ul=class extends ys{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=og(window.location),this.lastReferrer=so()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction:null}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Ti.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ti.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ti.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ti.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return og(window.location)}},Er=class e{constructor(t,r){if(!hs(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return hs(i)?new e(i,Number.parseInt(o)*1e3):null}};Er.cvo_cid="cvo_cid";Er.expirationTime=120;var Bl=class extends ys{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Er.cvo_cid,new Er(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Bl.Id="link";var Tt=Object.keys;function ms(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ql=128,yg=192,ig=224,ag=240;function tC(e){return(e&248)===ag?4:(e&ag)===ig?3:(e&ig)===yg?2:1}function rC(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&ql)!=ql)break;if(r-=3,(n&yg)!=ql){t-r>=tC(n)*3&&(r=t);break}}return e.substring(0,r)}var $l={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"},nC=Tt($l).map(e=>$l[e]),oC=[...nC].join("|"),iC=new RegExp(`^(${oC}$)`),aC={svcAction:"svc_action",svcActionData:"svc_action_data"},sC=e=>Tt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=$l[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),cC=e=>iC.test(e),uC=[cC],sg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},cg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ct={action:"pa",list:"pal",listSource:"pls"},Ss={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},lC=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Gl={id:"quoteId",affiliation:"quoteAffiliation"},Ql={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},dC={add:ct,bookmark_add:ct,bookmark_remove:ct,click:ct,checkout:ct,checkout_option:ct,detail:ct,impression:ct,remove:ct,refund:Object.assign(Object.assign({},ct),Ss),purchase:Object.assign(Object.assign({},ct),Ss),quickview:ct,quote:Object.assign(Object.assign({},ct),Gl),review:Object.assign(Object.assign({},ct),Ql)},fC=Tt(sg).map(e=>sg[e]),pC=Tt(cg).map(e=>cg[e]),mC=Tt(ct).map(e=>ct[e]),gC=Tt(Ss).map(e=>Ss[e]),hC=Tt(Ql).map(e=>Ql[e]),yC=Tt(Gl).map(e=>Gl[e]),SC=[...fC,"custom"].join("|"),vC=[...pC,"custom"].join("|"),Sg="(pr[0-9]+)",vg="(il[0-9]+pi[0-9]+)",bC=new RegExp(`^${Sg}(${SC})$`),wC=new RegExp(`^(${vg}(${vC}))|(il[0-9]+nm)$`),AC=new RegExp(`^(${mC.join("|")})$`),xC=new RegExp(`^(${gC.join("|")})$`),CC=new RegExp(`^${Sg}custom$`),EC=new RegExp(`^${vg}custom$`),RC=new RegExp(`^(${[...lC,...hC,...yC].join("|")})$`),IC=e=>bC.test(e),TC=e=>wC.test(e),_C=e=>AC.test(e),kC=e=>xC.test(e),OC=e=>RC.test(e),PC=[TC,IC,_C,kC,OC],NC=[CC,EC],FC={anonymizeIp:"aip"},DC={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},MC={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},qC=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],jC=Object.assign(Object.assign(Object.assign(Object.assign({},FC),DC),MC),qC.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Hl=Object.assign(Object.assign({},jC),aC),LC=e=>{let t=!!e.action&&dC[e.action]||{};return Tt(e).reduce((r,n)=>{let o=t[n]||Hl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},VC=Tt(Hl).map(e=>Hl[e]),UC=e=>VC.indexOf(e)!==-1,BC=e=>e==="custom",$C=e=>[...PC,...uC,UC,BC].some(t=>t(e)),GC=e=>Tt(e).reduce((t,r)=>{let n=QC(r);return n?Object.assign(Object.assign({},t),HC(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),QC=e=>{let t;return[...NC].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},HC=(e,t)=>Tt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),zl=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Wl=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},ug=b.fetch,vs=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=cr(c,["url"]),S;try{S=yield ug(u,h)}catch(v){console.error("An error has occured when sending the event.",v);return}if(S.ok){let v=yield S.json();return v.visitorId&&o.setCurrentVisitorId(v.visitorId),v}else{try{S.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield ug(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Kl=class{constructor(t,r){Ll()&&mg()?this.storage=new Vl:Ll()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new vs(t),this.beaconClient=new zl(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Yl=class{constructor(t,r){this.storage=r||new uo,this.client=new vs(t)}getClientDependingOnEventType(t){return this.client}},bs=class{constructor(){this.storage=new uo,this.client=new Wl}getClientDependingOnEventType(t){return this.client}},zC="xx",WC=e=>e?.startsWith(zC)||!1,KC=`
26
+ `;return new ni(r)}var ni=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},gt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw kw(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&se(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Xe(e){return e===void 0}function Ow(e){return e===null}function se(e){return Xe(e)||Ow(e)}var fe=class{constructor(e={}){Ae(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(Pw(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Pw(e){return Xe(e)||Ap(e)}function Ap(e){return typeof e=="boolean"}var ne=class{constructor(e={}){Ae(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(Nw(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Nw(e){return Xe(e)||xp(e)}function xp(e){return typeof e=="number"&&!Number.isNaN(e)}var Fw=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){Ae(this,"value");Ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Xe(e))return null;if(!xa(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Fw.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function xa(e){return Object.prototype.toString.call(e)==="[object String]"}var re=class{constructor(e={}){Ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Cp(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Cp(e){return e!==void 0&&typeof e=="object"}var he=class{constructor(e={}){Ae(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&se(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ap(e)||xa(e)||xp(e)||Cp(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ep(e){return Array.isArray(e)}var el=class{constructor(e){Ae(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();p();f();function Rp(e){return Array.isArray(e)}function Ca(e){return e.trim()===""}var Dw=new Set(["1",1,"yes",!0]);function Ip(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>Dw.has(r))}function Tp(e){let t={};for(let[r,n]of e)t[r]=n;return t}function oi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ea(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function Mw(e){if(Ca(e.openingDelimiter)||Ca(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||Ca(e.content))return e.content;if(e.highlights.length===0)return Gn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Gn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Gn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Gn(e.content.slice(n))),r}function qw(e,t){return e=Gn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?tl(n,t.notMatchDelimiters):o?tl(o,t.exactMatchDelimiters):i?tl(i,t.correctionDelimiters):r)}function tl(e,t){return t?t.open+e+t.close:e}function Gn(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();p();f();var Vp=Dt(Mp(),1);m();d();p();f();var Bt=new Error("Failed to load reducers."),Qn=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},Yr=class extends Error{constructor(r,n){super();Ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();p();f();function qp(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function jp(e){return typeof e!="object"||!e?!1:Object.values(e).every(uA)}function uA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Lp(e){return e===429}var Mt=class e{static call(t){return _asyncToGenerator(function*(){let r=lA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield w(i,a);if(Lp(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,Vp.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&Lp(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Yr(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=oi(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function Je(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function vr(e,t="prod"){return`${Je(e,t)}/rest/search/v2`}function Ia(e,t="prod"){return`${Je(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function lA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=dA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function dA(e,t){return t==="application/x-www-form-urlencoded"?jp(e)?qp(e):"":JSON.stringify(e)}m();d();p();f();m();d();p();f();var Ta=e=>e;m();d();p();f();m();d();p();f();function _a(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function $t(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:_a(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:_a(),extendedResults:{},searchAction:void 0}}m();d();p();f();function br(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var wr=e=>{let{response:t}=e;return t.body?fA(e):pA(t)},fA=e=>gA(e)?hA(e):mA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},pA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function mA(e){return e.body.statusCode!==void 0}function gA(e){return e.body.exception!==void 0}var hA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();p();f();var Ar=class{constructor(){Ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();p();f();m();d();p();f();var si=class{constructor(t){Ae(this,"_basePath");Ae(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();p();f();function Up(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();p();f();var nr=(e,t,r,n)=>{let o=new si(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Bp=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Mt.call({...nr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:br(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Up(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return yA(a)?{success:a}:{error:wr({response:r,body:a})}});return function Bp(_x3,_x4){return _ref3.apply(this,arguments)}}();function yA(e){return typeof e=="string"}m();d();p();f();function SA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function vA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ka(e,t){if(t&&e.name==="AbortError")return{error:vA(e)};if(e instanceof Yr)return{error:SA(e)};throw e}var Oa=class{constructor(t){this.options=t;Ae(this,"apiCallsQueues",{unknown:new Ar,mainSearch:new Ar,facetValues:new Ar,foldingCollection:new Ar,instantResults:new Ar})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/plan"),requestParams:br(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return ka(r);let n=yield r.json();return wA(n)?{success:n}:{error:wr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:br(t),..._this3.options});if(r instanceof Error)return ka(r);let n=yield r.json(),o={response:r,body:n};return bA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:wr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>Mt.call({...nr(t,"POST","application/json",""),requestParams:br(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return ka(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return $p(i)?(a.body=Gp(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:wr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/facet"),requestParams:br(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json",""),requestParams:br(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if($p(n)){let o={response:r,body:n};return o.body=Gp(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:wr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Bp(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return AA(n)?{success:n}:{error:wr({response:r,body:n})}})()}},Pa=e=>e.success!==void 0,ht=e=>e.error!==void 0;function $p(e){return e.results!==void 0}function Gp(e){let t=_a();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function bA(e){return e.completions!==void 0}function wA(e){return e.preprocessingOutput!==void 0}function AA(e){return e.fields!==void 0}m();d();p();f();var Qp=e=>e,Hp=e=>e,zp=e=>e;m();d();p();f();m();d();p();f();m();d();p();f();function Ze(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var xA=typeof Symbol=="function"&&Symbol.observable||"@@observable",Wp=xA,dl=()=>Math.random().toString(36).substring(7).split("").join("."),CA={INIT:`@@redux/INIT${dl()}`,REPLACE:`@@redux/REPLACE${dl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${dl()}`},Na=CA;function Gt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function fl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(fl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((C,E)=>{a.set(E,C)}))}function h(){if(c)throw new Error(Ze(3));return o}function S(C){if(typeof C!="function")throw new Error(Ze(4));if(c)throw new Error(Ze(5));let E=!0;u();let _=s++;return a.set(_,C),function(){if(E){if(c)throw new Error(Ze(6));E=!1,u(),a.delete(_),i=null}}}function v(C){if(!Gt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(c)throw new Error(Ze(9));try{c=!0,o=n(o,C)}finally{c=!1}return(i=a).forEach(_=>{_()}),C}function g(C){if(typeof C!="function")throw new Error(Ze(10));n=C,v({type:Na.REPLACE})}function y(){let C=S;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ze(11));function _(){let k=E;k.next&&k.next(h())}return _(),{unsubscribe:C(_)}},[Wp](){return this}}}return v({type:Na.INIT}),{dispatch:v,subscribe:S,getState:h,replaceReducer:g,[Wp]:y}}function EA(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Na.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Na.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function Hn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{EA(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let S=0;S<n.length;S++){let v=n[S],g=r[v],y=s[v],x=g(y,c);if(typeof x>"u"){let C=c&&c.type;throw new Error(Ze(14))}h[v]=x,u=u||x!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function ci(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Kp(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=ci(...s)(o.dispatch),{...o,dispatch:i}}}function ui(e){return Gt(e)&&"type"in e&&typeof e.type=="string"}m();d();p();f();var wl=Symbol.for("immer-nothing"),li=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function et(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var At=Object,Jr=At.getPrototypeOf,fi="constructor",yi="prototype",gl="configurable",qa="enumerable",Da="writable",pi="value",dt=e=>!!e&&!!e[ze];function ft(e){return e?nm(e)||vi(e)||!!e[li]||!!e[fi]?.[li]||bi(e)||wi(e):!1}var RA=At[yi][fi].toString(),Yp=new WeakMap;function nm(e){if(!e||!zn(e))return!1;let t=Jr(e);if(t===null||t===At[yi])return!0;let r=At.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=Yp.get(r);return n===void 0&&(n=Function.toString.call(r),Yp.set(r,n)),n===RA}function om(e){return dt(e)||et(15,e),e[ze].base_}function Si(e,t,r=!0){Zr(e)===0?(r?Reflect.ownKeys(e):At.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Zr(e){let t=e[ze];return t?t.type_:vi(e)?1:bi(e)?2:wi(e)?3:0}var di=(e,t,r=Zr(e))=>r===2?e.has(t):At[yi].hasOwnProperty.call(e,t),or=(e,t,r=Zr(e))=>r===2?e.get(t):e[t],ja=(e,t,r,n=Zr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function IA(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var vi=Array.isArray,bi=e=>e instanceof Map,wi=e=>e instanceof Set,zn=e=>typeof e=="object",Xr=e=>typeof e=="function",pl=e=>typeof e=="boolean";function TA(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var _A=e=>zn(e)?e?.[ze]:null,ir=e=>e.copy_||e.base_;var Al=e=>e.modified_?e.copy_:e.base_;function hl(e,t){if(bi(e))return new Map(e);if(wi(e))return new Set(e);if(vi(e))return Array[yi].slice.call(e);let r=nm(e);if(t===!0||t==="class_only"&&!r){let n=At.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[Da]===!1&&(s[Da]=!0,s[gl]=!0),(s.get||s.set)&&(n[a]={[gl]:!0,[Da]:!0,[qa]:s[qa],[pi]:e[a]})}return At.create(Jr(e),n)}else{let n=Jr(e);if(n!==null&&r)return{...e};let o=At.create(n);return At.assign(o,e)}}function xl(e,t=!1){return Ga(e)||dt(e)||!ft(e)||(Zr(e)>1&&At.defineProperties(e,{set:Fa,add:Fa,clear:Fa,delete:Fa}),At.freeze(e),t&&Si(e,(r,n)=>{xl(n,!0)},!1)),e}function kA(){et(2)}var Fa={[pi]:kA};function Ga(e){return e===null||!zn(e)?!0:At.isFrozen(e)}var La="MapSet",Va="Patches",Xp="ArrayMethods",Ua={};function en(e){let t=Ua[e];return t||et(0,e),t}var Jp=e=>!!Ua[e];function OA(e,t){Ua[e]||(Ua[e]=t)}var mi,im=()=>mi,PA=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Jp(La)?en(La):void 0,arrayMethodsPlugin_:Jp(Xp)?en(Xp):void 0});function Zp(e,t){t&&(e.patchPlugin_=en(Va),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yl(e){Sl(e),e.drafts_.forEach(NA),e.drafts_=null}function Sl(e){e===mi&&(mi=e.parent_)}var em=e=>mi=PA(mi,e);function NA(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(yl(t),et(4)),ft(e)&&(e=rm(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=rm(t,r);return FA(t,e,!0),yl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wl?e:void 0}function rm(e,t){if(Ga(t))return t;let r=t[ze];if(!r)return Ba(t,e.handledSet_,e);if(!Qa(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);cm(r,e)}return r.copy_}function FA(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xl(t,r)}function am(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Qa=(e,t)=>e.scope_===t,DA=[];function sm(e,t,r,n){let o=ir(e),i=e.type_;if(n!==void 0&&or(o,n,i)===t){ja(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(c,u)=>{if(dt(u)){let h=s.get(u)||[];h.push(c),s.set(u,h)}})}let a=e.draftLocations_.get(t)??DA;for(let s of a)ja(o,s,r,i)}function MA(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Qa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Al(i);sm(e,i.draft_??i,a,r),cm(i,o)})}function cm(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}am(e)}}function qA(e,t,r){let{scope_:n}=e;if(dt(r)){let o=r[ze];Qa(o,n)&&o.callbacks_.push(function(){Ma(e);let a=Al(o);sm(e,r,a,t)})}else ft(r)&&e.callbacks_.push(function(){let i=ir(e);e.type_===3?i.has(r)&&Ba(r,n.handledSet_,n):or(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ba(or(e.copy_,t,e.type_),n.handledSet_,n)})}function Ba(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||dt(e)||t.has(e)||!ft(e)||Ga(e)||(t.add(e),Si(e,(n,o)=>{if(dt(o)){let i=o[ze];if(Qa(i,r)){let a=Al(i);ja(e,n,a,e.type_),am(i)}}else ft(o)&&Ba(o,t,r)})),e}function jA(e,t){let r=vi(e),n={type_:r?1:0,scope_:t?t.scope_:im(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=$a;r&&(o=[n],i=gi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var $a={get(e,t){if(t===ze)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=ir(e);if(!di(o,t,e.type_))return LA(e,o,t);let i=o[t];if(e.finalized_||!ft(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&TA(t))return i;if(i===ml(e.base_,t)){Ma(e);let a=e.type_===1?+t:t,s=bl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ir(e)},ownKeys(e){return Reflect.ownKeys(ir(e))},set(e,t,r){let n=um(ir(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ml(ir(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(IA(r,o)&&(r!==void 0||di(e.base_,t,e.type_)))return!0;Ma(e),vl(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),qA(e,t,r)),!0},deleteProperty(e,t){return Ma(e),ml(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ir(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Da]:!0,[gl]:e.type_!==1||t!=="length",[qa]:n[qa],[pi]:r[t]}},defineProperty(){et(11)},getPrototypeOf(e){return Jr(e.base_)},setPrototypeOf(){et(12)}},gi={};for(let e in $a){let t=$a[e];gi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}gi.deleteProperty=function(e,t){return gi.set.call(this,e,t,void 0)};gi.set=function(e,t,r){return $a.set.call(this,e[0],t,r,e[0])};function ml(e,t){let r=e[ze];return(r?ir(r):e)[t]}function LA(e,t,r){let n=um(t,r);return n?pi in n?n[pi]:n.get?.call(e.draft_):void 0}function um(e,t){if(!(t in e))return;let r=Jr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Jr(r)}}function vl(e){e.modified_||(e.modified_=!0,e.parent_&&vl(e.parent_))}function Ma(e){e.copy_||(e.assigned_=new Map,e.copy_=hl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VA=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}Xr(r)||et(6),n!==void 0&&!Xr(n)&&et(7);let o;if(ft(t)){let i=em(this),a=bl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?yl(i):Sl(i)}return Zp(i,n),tm(o,i)}else if(!t||!zn(t)){if(o=r(t),o===void 0&&(o=t),o===wl&&(o=void 0),this.autoFreeze_&&xl(o,!0),n){let i=[],a=[];en(Va).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else et(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},pl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),pl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),pl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ft(e)||et(8),dt(e)&&(e=Ha(e));let t=em(this),r=bl(t,e,void 0);return r[ze].isManual_=!0,Sl(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&et(9);let{scope_:n}=r;return Zp(n,t),tm(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=en(Va).applyPatches_;return dt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function bl(e,t,r,n){let[o,i]=bi(t)?en(La).proxyMap_(t,r):wi(t)?en(La).proxySet_(t,r):jA(t,r);return(r?.scope_??im()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?MA(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),o}function Ha(e){return dt(e)||et(10,e),lm(e)}function lm(e){if(!ft(e)||Ga(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=hl(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=hl(e,!0);return Si(r,(o,i)=>{ja(r,o,lm(i))},n),t&&(t.finalized_=!1),r}function dm(){function t(y,x=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,E=_A(or(C,y.key_)),_=or(C,y.key_);if(_===void 0||_!==y.draft_&&_!==y.base_&&_!==y.copy_||E!=null&&E.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let T=y.parent_;k=Array.from(T.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||di(C,k)))return null;x.push(k)}if(y.parent_)return t(y.parent_,x);x.reverse();try{r(y.copy_,x)}catch{return null}return x}function r(y,x){let C=y;for(let E=0;E<x.length-1;E++){let _=x[E];if(C=or(C,_),!zn(C)||C===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,x,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:E,inversePatches_:_}=C;switch(y.type_){case 0:case 2:return c(y,x,E,_);case 1:return s(y,x,E,_);case 3:return u(y,x,E,_)}}function s(y,x,C,E){let{base_:_,assigned_:I}=y,k=y.copy_;k.length<_.length&&([_,k]=[k,_],[C,E]=[E,C]);let T=y.allIndicesReassigned_===!0;for(let D=0;D<_.length;D++){let B=k[D],L=_[D];if((T||I?.get(D.toString()))&&B!==L){let U=B?.[ze];if(U&&U.modified_)continue;let q=x.concat([D]);C.push({op:n,path:q,value:g(B)}),E.push({op:n,path:q,value:g(L)})}}for(let D=_.length;D<k.length;D++){let B=x.concat([D]);C.push({op:o,path:B,value:g(k[D])})}for(let D=k.length-1;_.length<=D;--D){let B=x.concat([D]);E.push({op:i,path:B})}}function c(y,x,C,E){let{base_:_,copy_:I,type_:k}=y;Si(y.assigned_,(T,D)=>{let B=or(_,T,k),L=or(I,T,k),j=D?di(_,T)?n:o:i;if(B===L&&j===n)return;let U=x.concat(T);C.push(j===i?{op:j,path:U}:{op:j,path:U,value:g(L)}),E.push(j===o?{op:i,path:U}:j===i?{op:o,path:U,value:g(B)}:{op:n,path:U,value:g(B)})})}function u(y,x,C,E){let{base_:_,copy_:I}=y,k=0;_.forEach(T=>{if(!I.has(T)){let D=x.concat([k]);C.push({op:i,path:D,value:T}),E.unshift({op:o,path:D,value:T})}k++}),k=0,I.forEach(T=>{if(!_.has(T)){let D=x.concat([k]);C.push({op:o,path:D,value:T}),E.unshift({op:i,path:D,value:T})}k++})}function h(y,x,C){let{patches_:E,inversePatches_:_}=C;E.push({op:n,path:[],value:x===wl?void 0:x}),_.push({op:n,path:[],value:y})}function S(y,x){return x.forEach(C=>{let{path:E,op:_}=C,I=y;for(let B=0;B<E.length-1;B++){let L=Zr(I),j=E[B];typeof j!="string"&&typeof j!="number"&&(j=""+j),(L===0||L===1)&&(j==="__proto__"||j===fi)&&et(19),Xr(I)&&j===yi&&et(19),I=or(I,j),zn(I)||et(18,E.join("/"))}let k=Zr(I),T=v(C.value),D=E[E.length-1];switch(_){case n:switch(k){case 2:return I.set(D,T);case 3:et(16);default:return I[D]=T}case o:switch(k){case 1:return D==="-"?I.push(T):I.splice(D,0,T);case 2:return I.set(D,T);case 3:return I.add(T);default:return I[D]=T}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:et(17,_)}}),y}function v(y){if(!ft(y))return y;if(vi(y))return y.map(v);if(bi(y))return new Map(Array.from(y.entries()).map(([C,E])=>[C,v(E)]));if(wi(y))return new Set(Array.from(y).map(v));let x=Object.create(Jr(y));for(let C in y)x[C]=v(y[C]);return di(y,li)&&(x[li]=y[li]),x}function g(y){return dt(y)?v(y):y}OA(Va,{applyPatches_:S,generatePatches_:a,generateReplacementPatches_:h,getPath:t})}var hi=new VA,tn=hi.produce,Cl=hi.produceWithPatches.bind(hi);var El=hi.applyPatches.bind(hi);m();d();p();f();function UA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function BA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $A(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var fm=e=>Array.isArray(e)?e:[e];function GA(e){let t=Array.isArray(e[0])?e[0]:e;return $A(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function QA(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var wD=Object.getPrototypeOf({});var HA=class{constructor(e){this.value=e}deref(){return this.value}},zA=typeof WeakRef<"u"?WeakRef:HA,WA=0,pm=1;function za(){return{s:WA,v:void 0,o:null,p:null}}function Ai(e,t={}){let r=za(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let S=0,v=c;S<v;S++){let g=arguments[S];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let x=y.get(g);x===void 0?(s=za(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);let x=y.get(g);x===void 0?(s=za(),y.set(g,s)):s=x}}let u=s,h;if(s.s===pm)h=s.v;else if(h=e.apply(null,arguments),i++,n){let S=o?.deref?.()??o;S!=null&&n(S,h)&&(h=S,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new zA(h):h}return u.s=pm,u.v=h,h}return a.clearCache=()=>{r=za(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function KA(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),UA(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:S,memoizeOptions:v=[],argsMemoize:g=Ai,argsMemoizeOptions:y=[],devModeChecks:x={}}=h,C=fm(v),E=fm(y),_=GA(o),I=S(function(){return i++,u.apply(null,arguments)},...C),k=!0,T=g(function(){a++;let B=QA(_,arguments);return s=I.apply(null,B),s},...E);return Object.assign(T,{resultFunc:u,memoizedResultFunc:I,dependencies:_,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:S,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Le=KA(Ai),YA=Object.assign((e,t=Le)=>{BA(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>YA});m();d();p();f();function mm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var gm=mm(),hm=mm;var XA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ci:ci.apply(null,arguments)},LD=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},JA=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ui(n)&&n.type===e,r}var Cm=class xi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xi.prototype)}static get[Symbol.species](){return xi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xi(...t[0].concat(this)):new xi(...t.concat(this))}};function ym(e){return ft(e)?tn(e,()=>{}):e}function Wa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ZA(e){return typeof e=="boolean"}var ex=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Cm;return r&&(ZA(r)?a.push(gm):a.push(hm(r.extraArgument))),a},Ci="RTK_autoBatch",Yn=()=>e=>({payload:e,meta:{[Ci]:!0}}),Sm=e=>t=>{setTimeout(t,e)},tx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Sm(10):e.type==="callback"?e.queueNotification:Sm(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let S=()=>o&&h(),v=n.subscribe(S);return s.add(h),()=>{v(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Ci],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},rx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Cm(e);return n&&o.push(tx(typeof n=="object"?n:void 0)),o};function Em(e){let t=ex(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Gt(r))c=Hn(r);else throw new Error(pt(1));let u;typeof n=="function"?u=n(t):u=t();let h=ci;o&&(h=XA({trace:!1,...(typeof o=="object"&&o)}));let S=Kp(...u),v=rx(S),g=typeof s=="function"?s(v):v(),y=h(...g);return fl(c,a,y)}function Rm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function nx(e){return typeof e=="function"}function Ve(e,t){let[r,n,o]=Rm(t),i;if(nx(e))i=()=>ym(e());else{let s=ym(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,S)=>{if(S)if(dt(h)){let g=S(h,c);return g===void 0?h:g}else{if(ft(h))return tn(h,v=>S(v,c));{let v=S(h,c);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},s)}return a.getInitialState=i,a}var Im=(e,t)=>JA(e)?e.match(t):e(t);function Qt(...e){return t=>e.some(r=>Im(r,t))}function Kn(...e){return t=>e.every(r=>Im(r,t))}function Ja(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Ei(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Za(...e){return e.length===0?t=>Ja(t,["pending"]):Ei(e)?Qt(...e.map(t=>t.pending)):Za()(e[0])}function nn(...e){return e.length===0?t=>Ja(t,["rejected"]):Ei(e)?Qt(...e.map(t=>t.rejected)):nn()(e[0])}function Ri(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kn(nn(...e),t):Ei(e)?Kn(nn(...e),t):Ri()(e[0])}function ar(...e){return e.length===0?t=>Ja(t,["fulfilled"]):Ei(e)?Qt(...e.map(t=>t.fulfilled)):ar()(e[0])}function es(...e){return e.length===0?t=>Ja(t,["pending","fulfilled","rejected"]):Ei(e)?Qt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):es()(e[0])}var ox="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ii=(e=21)=>{let t="",r=e;for(;r--;)t+=ox[Math.random()*64|0];return t},ix=["name","message","stack","code"],Rl=class{constructor(e,t){Ae(this,"_type");this.payload=e,this.meta=t}},vm=class{constructor(e,t){Ae(this,"_type");this.payload=e,this.meta=t}},ax=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of ix)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},bm="External signal was aborted",Ee=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(c,u,h,S)=>({payload:c,meta:{...(S||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=N(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=N(t+"/rejected",(c,u,h,S,v)=>({payload:S,error:(n&&n.serializeError||ax)(c||"Rejected"),meta:{...(v||{}),arg:h,requestId:u,rejectedWithValue:!!S,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c,{signal:u}={}){return(h,S,v)=>{let g=n?.idGenerator?n.idGenerator(c):Ii(),y=new l.AbortController,x,C;function E(I){C=I,y.abort()}u&&(u.aborted?E(bm):u.addEventListener("abort",()=>E(bm),{once:!0}));let _=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(c,{getState:S,extra:v});if(cx(T)&&(T=yield T),T===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((B,L)=>{x=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",x,{once:!0})});h(i(g,c,n?.getPendingMeta?.({requestId:g,arg:c},{getState:S,extra:v}))),I=yield Promise.race([D,Promise.resolve(r(c,{dispatch:h,getState:S,extra:v,requestId:g,signal:y.signal,abort:E,rejectWithValue:(B,L)=>new Rl(B,L),fulfillWithValue:(B,L)=>new vm(B,L)})).then(B=>{if(B instanceof Rl)throw B;return B instanceof vm?o(B.payload,g,c,B.meta):o(B,g,c)})])}catch(T){I=T instanceof Rl?a(null,g,c,T.payload,T.meta):a(T,g,c)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||h(I),I})();return Object.assign(_,{abort:E,requestId:g,arg:c,unwrap(){return _.then(sx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Qt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function sx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function cx(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Tm=Symbol.for("rtk-slice-createasyncthunk"),UD={[Tm]:Ee};function ux(e,t){return`${e}/${t}`}function lx({creators:e}={}){let t=e?.asyncThunk?.[Tm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(fx()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,k){let T=typeof I=="string"?I:I.type;if(!T)throw new Error(pt(12));if(T in c.sliceCaseReducersByType)throw new Error(pt(13));return c.sliceCaseReducersByType[T]=k,u},addMatcher(I,k){return c.sliceMatchers.push({matcher:I,reducer:k}),u},exposeAction(I,k){return c.actionCreators[I]=k,u},exposeCaseReducer(I,k){return c.sliceCaseReducersByName[I]=k,u}};s.forEach(I=>{let k=a[I],T={reducerName:I,type:ux(o,I),createNotation:typeof n.reducers=="function"};mx(k)?hx(T,k,u,t):px(T,k,u)});function h(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?Rm(n.extraReducers):[n.extraReducers],D={...I,...c.sliceCaseReducersByType};return Ve(n.initialState,B=>{for(let L in D)B.addCase(L,D[L]);for(let L of c.sliceMatchers)B.addMatcher(L.matcher,L.reducer);for(let L of k)B.addMatcher(L.matcher,L.reducer);T&&B.addDefaultCase(T)})}let S=I=>I,v=new Map,g=new WeakMap,y;function x(I,k){return y||(y=h()),y(I,k)}function C(){return y||(y=h()),y.getInitialState()}function E(I,k=!1){function T(B){let L=B[I];return typeof L>"u"&&k&&(L=Wa(g,T,C)),L}function D(B=S){let L=Wa(v,k,()=>new WeakMap);return Wa(L,B,()=>{let j={};for(let[U,q]of Object.entries(n.selectors??{}))j[U]=dx(q,B,()=>Wa(g,B,C),k);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let _={name:o,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:C,...E(i),injectInto(I,{reducerPath:k,...T}={}){let D=k??i;return I.inject({reducerPath:D,reducer:x},T),{..._,...E(D,!0)}}};return _}}function dx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=lx();function fx(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function px({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!gx(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?N(e,a):N(e))}function mx(e){return e._reducerDefinitionType==="asyncThunk"}function gx(e){return e._reducerDefinitionType==="reducerWithPrepare"}function hx({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,S=o(e,i,h);n.exposeAction(t,S),a&&n.addCase(S.fulfilled,a),s&&n.addCase(S.pending,s),c&&n.addCase(S.rejected,c),u&&n.addMatcher(S.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ka,pending:s||Ka,rejected:c||Ka,settled:u||Ka})}function Ka(){}var yx="task",_m="listener",km="completed",_l="cancelled",Sx=`task-${_l}`,vx=`task-${km}`,Il=`${_m}-${_l}`,bx=`${_m}-${km}`,ts=class{constructor(e){Ae(this,"name","TaskAbortError");Ae(this,"message");this.code=e,this.message=`${yx} ${_l} (reason: ${e})`}},kl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ya=()=>{},Om=(e,t=Ya)=>(e.catch(t),e),Pm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new ts(e.reason)};function Nm(e,t){let r=Ya;return new Promise((n,o)=>{let i=()=>o(new ts(e.reason));if(e.aborted){i();return}r=Pm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ya})}var wx=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof ts?"cancelled":"rejected",error:r}}finally{t?.()}});return function wx(_x5,_x6){return _ref5.apply(this,arguments)}}(),Xa=e=>t=>Om(Nm(e,t).then(r=>(rn(e),r))),Fm=e=>{let t=Xa(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wn}=Object,wm={},rs="listenerMiddleware",Ax=(e,t)=>{let r=n=>Pm(e,()=>n.abort(e.reason));return(n,o)=>{kl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=wx(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:Xa(i.signal),delay:Fm(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(vx));return o?.autoJoin&&t.push(a.catch(Ya)),{result:Xa(e)(a),cancel(){i.abort(Sx)}}}},xx=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(S,v)=>{v.unsubscribe(),c([S,v.getState(),v.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield Nm(t,Promise.race(s));return rn(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>Om(r(n,o))},Dm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return kl(i,"options.listener"),{predicate:o,type:t,effect:i}},Mm=Wn(e=>{let{type:t,predicate:r,effect:n}=Dm(e);return{id:Ii(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>Mm}),Am=(e,t)=>{let{type:r,effect:n,predicate:o}=Dm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Tl=e=>{e.pending.forEach(t=>{t.abort(Il)})},Cx=(e,t)=>()=>{for(let r of t.keys())Tl(r);e.clear()},xm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},qm=Wn(N(`${rs}/add`),{withTypes:()=>qm}),Ex=N(`${rs}/removeAll`),jm=Wn(N(`${rs}/remove`),{withTypes:()=>jm}),Rx=(...e)=>{console.error(`${rs}/error`,...e)},Lm=(e={})=>{let t=new Map,r=new Map,n=g=>{let y=r.get(g)??0;r.set(g,y+1)},o=g=>{let y=r.get(g)??1;y===1?r.delete(g):r.set(g,y-1)},{extra:i,onError:a=Rx}=e;kl(a,"onError");let s=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),y=>{g.unsubscribe(),y?.cancelActive&&Tl(g)}),c=g=>{let y=Am(t,g)??Mm(g);return s(y)};Wn(c,{withTypes:()=>c});let u=g=>{let y=Am(t,g);return y&&(y.unsubscribe(),g.cancelActive&&Tl(y)),!!y};Wn(u,{withTypes:()=>u});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,y,x,C){let E=new l.AbortController,_=xx(c,E.signal),I=[];try{g.pending.add(E),n(g),yield Promise.resolve(g.effect(y,Wn({},x,{getOriginalState:C,condition:(k,T)=>_(k,T).then(Boolean),take:_,delay:Fm(E.signal),pause:Xa(E.signal),extra:i,signal:E.signal,fork:Ax(E.signal,I),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((k,T,D)=>{k!==E&&(k.abort(Il),D.delete(k))})},cancel:()=>{E.abort(Il),g.pending.delete(E)},throwIfCancelled:()=>{rn(E.signal)}})))}catch(k){k instanceof ts||xm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),E.abort(bx),o(g),g.pending.delete(E)}});return function h(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),S=Cx(t,r);return{middleware:g=>y=>x=>{if(!ui(x))return y(x);if(qm.match(x))return c(x.payload);if(Ex.match(x)){S();return}if(jm.match(x))return u(x.payload);let C=g.getState(),E=()=>{if(C===wm)throw new Error(pt(23));return C},_;try{if(_=y(x),t.size>0){let I=g.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(x,I,C)}catch(B){D=!1,xm(a,B,{raisedBy:"predicate"})}D&&h(T,x,g,E)}}}finally{C=wm}return _},startListening:c,stopListening:u,clearListeners:S}};function pt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();p();f();var J=new z({required:!0,emptyAllowed:!1}),tt=new z({required:!1,emptyAllowed:!1}),rt=new z({required:!0,emptyAllowed:!0}),ZD=new z({required:!1,emptyAllowed:!0}),ns=new he({each:J,required:!0}),Vm=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Um=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),eM=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),sr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Et=(e,t)=>{if("required"in t)return{payload:new gt({value:t}).validate({value:e}).value};let o=new re({options:{required:!0},values:t}).validate(e);if(o)throw new ni(o);return{payload:e}},$=(e,t)=>{try{return Et(e,t)}catch(r){return{payload:e,error:sr(r)}}},Bm=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Gm(e,t,r,o,"Controller initialization error")},$m=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Gm(e,t,r,o,"Controller initialization error")},Gm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();p();f();var Xn="3.49.1",Qm=["@coveo/atomic","@coveo/quantic"];var Ol=()=>tt,Hm=()=>J,xr=N("configuration/updateBasicConfiguration",e=>$(e,{accessToken:tt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:tt})),Ht=N("configuration/updateSearchConfiguration",e=>$(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:tt,timezone:tt,locale:tt,authenticationProviders:new he({required:!1,each:J})})),Ix={enabled:new fe({default:!0}),originContext:Ol(),originLevel2:Ol(),originLevel3:Ol(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new fe({default:!1}),deviceId:tt,userDisplayName:tt,documentLocation:tt,trackingId:Um,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new re({options:{required:!1},values:Qm.reduce((e,t)=>(e[t]=Vm,e),{})})},Jn=N("configuration/updateAnalyticsConfiguration",e=>$(e,Ix)),Zn=N("configuration/analytics/disable"),eo=N("configuration/analytics/enable"),os=N("configuration/analytics/originlevel2",e=>$(e,{originLevel2:Hm()})),is=N("configuration/analytics/originlevel3",e=>$(e,{originLevel3:Hm()})),zm=N("knowledge/setAgentId",e=>$(e,new z({required:!0})));m();d();p();f();m();d();p();f();m();d();p();f();var Wm={q:new z,enableQuerySyntax:new fe,aq:new z,cq:new z,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new z,f:new re,fExcluded:new re,cf:new re,nf:new re,mnf:new re,df:new re,debug:new fe,sf:new re,tab:new z,af:new re};var Cr=N("searchParameters/restore",e=>$(e,Wm)),Km=N("searchParameters/restoreTab",e=>$(e,J));m();d();p();f();var as=N("debug/enable"),ss=N("debug/disable");m();d();p();f();var cs=()=>!1;var us=Ve(cs(),e=>{e.addCase(as,()=>!0).addCase(ss,()=>!1).addCase(Cr,(t,r)=>r.payload.debug??t)});m();d();p();f();var to=N("pipeline/set",e=>$(e,new z({required:!0,emptyAllowed:!0})));m();d();p();f();m();d();p();f();var Tx=N("history/undo"),_x=N("history/redo"),zt=N("history/snapshot"),uq=Ee("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Tx()),yield t(yt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),lq=Ee("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(_x()),yield t(yt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),yt=Ee("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();p();f();var ro=()=>"";var no=Ve(ro(),e=>{e.addCase(to,(t,r)=>r.payload).addCase(yt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ht,(t,r)=>r.payload.pipeline||t)});m();d();p();f();m();d();p();f();var ls=N("app/setError");m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var oo=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?Pl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Pl(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Pl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();p();f();function kx(){return typeof navigator<"u"}function Ym(){try{return typeof localStorage<"u"}catch{return!1}}function Xm(){try{return typeof sessionStorage<"u"}catch{return!1}}function Jm(){return!!(kx()&&navigator.cookieEnabled)}var Zm=null;function eg(){return Zm||(Ym()?localStorage:Jm()?new Nl:Xm()?sessionStorage:new Fl)}var io=class io{getItem(t){return oo.get(`${io.prefix}${t}`)}removeItem(t){oo.erase(`${io.prefix}${t}`)}setItem(t,r,n){oo.set(`${io.prefix}${t}`,r,n)}};Ae(io,"prefix","coveo_");var Nl=io;var Fl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ds="__coveo.analytics.history",Ox=20,Px=1e3*60,Nx=75,an=class an{constructor(t){Ae(this,"store");this.store=t||eg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ds);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ds);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ds,JSON.stringify(t.slice(0,Ox)))}catch{}}clear(){try{this.store.removeItem(ds)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Nx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Px:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ae(an,"instance",null);var Dl=an,Rt=Dl;m();d();p();f();m();d();p();f();var ao=Le(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Xn}`));m();d();p();f();m();d();p();f();function cr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function V(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(S){a(S)}}function c(h){try{u(n.throw(h))}catch(S){a(S)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function jl(){return typeof window<"u"}function Xl(){return typeof navigator<"u"}function so(){return typeof document<"u"}function Ll(){try{return typeof localStorage<"u"}catch{return!1}}function Fx(){try{return typeof sessionStorage<"u"}catch{return!1}}function mg(){return Xl()&&navigator.cookieEnabled}var Dx=[ve.click,ve.custom,ve.search,ve.view],Mx=(e,t)=>Dx.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:Xl()?navigator.userAgent:"unknown"},t):t,_i=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?tg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],tg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function tg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function qx(){return Ll()?localStorage:mg()?new ki:Fx()?sessionStorage:new uo}var ki=class e{getItem(t){return _i.get(`${e.prefix}${t}`)}removeItem(t){_i.erase(`${e.prefix}${t}`)}setItem(t,r,n){_i.set(`${e.prefix}${t}`,r,n)}};ki.prefix="coveo_";var Vl=class{constructor(){this.cookieStorage=new ki}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fs="__coveo.analytics.history",jx=20,Lx=1e3*60,Vx=75,gs=class{constructor(t){this.store=t||qx()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fs,JSON.stringify(t.slice(0,jx)))}catch{}}clear(){try{this.store.removeItem(fs)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Vx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Lx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Ux=(e,t)=>V(void 0,void 0,void 0,function*(){return e===ve.view?(yield Bx(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Bx=e=>V(void 0,void 0,void 0,function*(){let t=new gs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),ps,$x=new Uint8Array(16);function Gx(){if(!ps&&(ps=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ps))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ps($x)}var Qx=/^(?:[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 hs(e){return typeof e=="string"&&Qx.test(e)}var nt=[];for(let e=0;e<256;++e)nt.push((e+256).toString(16).slice(1));function gg(e,t=0){return nt[e[t+0]]+nt[e[t+1]]+nt[e[t+2]]+nt[e[t+3]]+"-"+nt[e[t+4]]+nt[e[t+5]]+"-"+nt[e[t+6]]+nt[e[t+7]]+"-"+nt[e[t+8]]+nt[e[t+9]]+"-"+nt[e[t+10]]+nt[e[t+11]]+nt[e[t+12]]+nt[e[t+13]]+nt[e[t+14]]+nt[e[t+15]]}function Hx(e){if(!hs(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function zx(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Wx="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Kx="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Yx(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=zx(o)),typeof i=="string"&&(i=Hx(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return gg(u)}try{n.name=e}catch{}return n.DNS=Wx,n.URL=Kx,n}var Xx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rg={randomUUID:Xx};function sn(e,t,r){if(rg.randomUUID&&!t&&!e)return rg.randomUUID();e=e||{};let n=e.random||(e.rng||Gx)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return gg(n)}function Jx(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Ml(e,t){return e<<t|e>>>32-t}function Zx(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=Ml(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],S=r[3],v=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),x=Ml(c,5)+Jx(y,u,h,S)+v+t[y]+s[g]>>>0;v=S,S=h,h=Ml(u,30)>>>0,u=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+S>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var eC=Yx("v5",80,Zx),ng=eC,hg="2.30.54",og=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ti={pageview:"pageview",event:"event"},ys=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},Ul=class extends ys{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=og(window.location),this.lastReferrer=so()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction:null}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Ti.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ti.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ti.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ti.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return og(window.location)}},Er=class e{constructor(t,r){if(!hs(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return hs(i)?new e(i,Number.parseInt(o)*1e3):null}};Er.cvo_cid="cvo_cid";Er.expirationTime=120;var Bl=class extends ys{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Er.cvo_cid,new Er(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Bl.Id="link";var Tt=Object.keys;function ms(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ql=128,yg=192,ig=224,ag=240;function tC(e){return(e&248)===ag?4:(e&ag)===ig?3:(e&ig)===yg?2:1}function rC(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&ql)!=ql)break;if(r-=3,(n&yg)!=ql){t-r>=tC(n)*3&&(r=t);break}}return e.substring(0,r)}var $l={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"},nC=Tt($l).map(e=>$l[e]),oC=[...nC].join("|"),iC=new RegExp(`^(${oC}$)`),aC={svcAction:"svc_action",svcActionData:"svc_action_data"},sC=e=>Tt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=$l[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),cC=e=>iC.test(e),uC=[cC],sg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},cg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ct={action:"pa",list:"pal",listSource:"pls"},Ss={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},lC=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Gl={id:"quoteId",affiliation:"quoteAffiliation"},Ql={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},dC={add:ct,bookmark_add:ct,bookmark_remove:ct,click:ct,checkout:ct,checkout_option:ct,detail:ct,impression:ct,remove:ct,refund:Object.assign(Object.assign({},ct),Ss),purchase:Object.assign(Object.assign({},ct),Ss),quickview:ct,quote:Object.assign(Object.assign({},ct),Gl),review:Object.assign(Object.assign({},ct),Ql)},fC=Tt(sg).map(e=>sg[e]),pC=Tt(cg).map(e=>cg[e]),mC=Tt(ct).map(e=>ct[e]),gC=Tt(Ss).map(e=>Ss[e]),hC=Tt(Ql).map(e=>Ql[e]),yC=Tt(Gl).map(e=>Gl[e]),SC=[...fC,"custom"].join("|"),vC=[...pC,"custom"].join("|"),Sg="(pr[0-9]+)",vg="(il[0-9]+pi[0-9]+)",bC=new RegExp(`^${Sg}(${SC})$`),wC=new RegExp(`^(${vg}(${vC}))|(il[0-9]+nm)$`),AC=new RegExp(`^(${mC.join("|")})$`),xC=new RegExp(`^(${gC.join("|")})$`),CC=new RegExp(`^${Sg}custom$`),EC=new RegExp(`^${vg}custom$`),RC=new RegExp(`^(${[...lC,...hC,...yC].join("|")})$`),IC=e=>bC.test(e),TC=e=>wC.test(e),_C=e=>AC.test(e),kC=e=>xC.test(e),OC=e=>RC.test(e),PC=[TC,IC,_C,kC,OC],NC=[CC,EC],FC={anonymizeIp:"aip"},DC={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},MC={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},qC=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],jC=Object.assign(Object.assign(Object.assign(Object.assign({},FC),DC),MC),qC.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Hl=Object.assign(Object.assign({},jC),aC),LC=e=>{let t=!!e.action&&dC[e.action]||{};return Tt(e).reduce((r,n)=>{let o=t[n]||Hl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},VC=Tt(Hl).map(e=>Hl[e]),UC=e=>VC.indexOf(e)!==-1,BC=e=>e==="custom",$C=e=>[...PC,...uC,UC,BC].some(t=>t(e)),GC=e=>Tt(e).reduce((t,r)=>{let n=QC(r);return n?Object.assign(Object.assign({},t),HC(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),QC=e=>{let t;return[...NC].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},HC=(e,t)=>Tt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),zl=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Wl=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},ug=b.fetch,vs=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=cr(c,["url"]),S;try{S=yield ug(u,h)}catch(v){console.error("An error has occured when sending the event.",v);return}if(S.ok){let v=yield S.json();return v.visitorId&&o.setCurrentVisitorId(v.visitorId),v}else{try{S.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield ug(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Kl=class{constructor(t,r){Ll()&&mg()?this.storage=new Vl:Ll()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new vs(t),this.beaconClient=new zl(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Yl=class{constructor(t,r){this.storage=r||new uo,this.client=new vs(t)}getClientDependingOnEventType(t){return this.client}},bs=class{constructor(){this.storage=new uo,this.client=new Wl}getClientDependingOnEventType(t){return this.client}},zC="xx",WC=e=>e?.startsWith(zC)||!1,KC=`
27
27
  We've detected you're using React Native but have not provided the corresponding runtime,
28
28
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
29
29
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
@@ -71,4 +71,4 @@ fast-json-patch/module/duplex.mjs:
71
71
  *)
72
72
  */if(__exports!=exports)module.exports=exports;return module.exports});
73
73
 
74
- window.coveoQuanticVersion = '3.37.2';
74
+ window.coveoQuanticVersion = '3.37.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/quantic",
3
- "version": "3.37.2",
3
+ "version": "3.37.4",
4
4
  "description": "A Salesforce Lightning Web Component (LWC) library for building modern UIs interfacing with the Coveo platform",
5
5
  "author": "coveo.com",
6
6
  "homepage": "https://coveo.com",
@@ -15,7 +15,7 @@
15
15
  "dompurify": "3.3.1",
16
16
  "marked": "12.0.2",
17
17
  "@coveo/bueno": "1.1.9",
18
- "@coveo/headless": "3.49.0"
18
+ "@coveo/headless": "3.49.1"
19
19
  },
20
20
  "engines": {
21
21
  "node": "^20.9.0 || ^22.11.0 || ^24.11.0"
@@ -43,8 +43,7 @@
43
43
  "prettier-plugin-apex": "2.2.6",
44
44
  "ts-node": "10.9.2",
45
45
  "wait-on": "9.0.4",
46
- "xml2js": "0.6.2",
47
- "@coveo/ci": "1.0.0"
46
+ "xml2js": "0.6.2"
48
47
  },
49
48
  "files": [
50
49
  "force-app/main/default/classes/*",
@@ -87,10 +86,8 @@
87
86
  "publish:sfdx": "ts-node scripts/build/create-package.ts --remove-translations",
88
87
  "promote:sfdx": "pnpm run publish:sfdx -- --promote",
89
88
  "promote:sfdx:ci": "pnpm run publish:sfdx -- --promote --ci",
90
- "release:phase1": "pnpm --filter @coveo/ci bump",
91
89
  "preinstall": "node scripts/npm/check-sfdx-project.js",
92
90
  "postinstall": "node scripts/npm/setup-quantic.js",
93
- "babel:headless": "babel ./node_modules/@coveo/headless/dist/quantic --delete-dir-on-start --out-dir .tmp/quantic-compiled --extensions .js --minified",
94
- "npm:publish": "pnpm --filter @coveo/ci npm-publish"
91
+ "babel:headless": "babel ./node_modules/@coveo/headless/dist/quantic --delete-dir-on-start --out-dir .tmp/quantic-compiled --extensions .js --minified"
95
92
  }
96
93
  }