@coveo/headless 3.30.0 → 3.30.1-pre.0b6ca95bda
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/case-assist/headless.cjs +1 -1
- package/dist/cjs/case-assist/node.cjs.stats.json +1 -1
- package/dist/cjs/commerce/headless.cjs +1 -1
- package/dist/cjs/commerce/node.cjs.stats.json +1 -1
- package/dist/cjs/headless.cjs +1 -1
- package/dist/cjs/insight/headless.cjs +1 -1
- package/dist/cjs/insight/node.cjs.stats.json +1 -1
- package/dist/cjs/node.cjs.stats.json +1 -1
- package/dist/cjs/recommendation/headless.cjs +1 -1
- package/dist/cjs/recommendation/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr/headless.cjs +1 -1
- package/dist/cjs/ssr/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-commerce/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-commerce-next/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce-next/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-next/headless.cjs +1 -1
- package/dist/cjs/ssr-next/node.cjs.stats.json +1 -1
- package/dist/esm/utils/version.js +1 -1
- package/dist/quantic/browser.cjs.stats.json +1 -1
- package/dist/quantic/case-assist/browser.cjs.stats.json +1 -1
- package/dist/quantic/case-assist/headless.js +1 -1
- package/dist/quantic/case-assist/headless.js.map +1 -1
- package/dist/quantic/commerce/browser.cjs.stats.json +1 -1
- package/dist/quantic/commerce/headless.js +1 -1
- package/dist/quantic/commerce/headless.js.map +1 -1
- package/dist/quantic/headless.js +1 -1
- package/dist/quantic/headless.js.map +1 -1
- package/dist/quantic/insight/browser.cjs.stats.json +1 -1
- package/dist/quantic/insight/headless.js +1 -1
- package/dist/quantic/insight/headless.js.map +1 -1
- package/dist/quantic/recommendation/browser.cjs.stats.json +1 -1
- package/dist/quantic/recommendation/headless.js +1 -1
- package/dist/quantic/recommendation/headless.js.map +1 -1
- package/package.json +2 -2
|
@@ -24,7 +24,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24
24
|
`)}
|
|
25
25
|
|
|
26
26
|
${t}
|
|
27
|
-
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=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 Zf(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&&X(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 ve(e){return e===void 0}function em(e){return e===null}function X(e){return ve(e)||em(e)}var ne=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(tm(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function tm(e){return ve(e)||fc(e)}function fc(e){return typeof e=="boolean"}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(rm(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 rm(e){return ve(e)||mc(e)}function mc(e){return typeof e=="number"&&!Number.isNaN(e)}var nm=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(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(ve(e))return null;if(!Mn(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&&!(nm.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 Mn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!gc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(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 gc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(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&&X(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 fc(e)||Mn(e)||mc(e)||gc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function yc(e){return Array.isArray(e)}var Vi=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(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}};d();c();l();u();function hc(e){return Array.isArray(e)}function Nn(e){return e.trim()===""}var om=new Set(["1",1,"yes",!0]);function Sc(){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=>om.has(r))}function vc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Kr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function im(e){if(Nn(e.openingDelimiter)||Nn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Nn(e.content))return e.content;if(e.highlights.length===0)return Zt(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,m=a+i.length;if(m>t)break;r+=Zt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Zt(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=Zt(e.content.slice(n))),r}function am(e,t){return e=Zt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function Zt(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Oc=Qe(Ic(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),er=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."}},jt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function kc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Pc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Tm)}function Tm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Fc(e){return e===429}var Be=class e{static async call(t){let r=Dm(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=async()=>{let f=await A(i,a);if(Fc(f.status))throw f;return f};try{let f=await(0,Oc.backOff)(m,{retry:p=>{let y=p&&Fc(p.status);return y&&n.info("Platform retrying request"),y}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new er;case 404:throw new jt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new jt(i):f}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,p=Kr(f);try{let y=await o(t,n,a);return{...t,...y}}catch(y){i.error(y,"Platform request preprocessing failed. Returning default request options.")}return p}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function Vn(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Dm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=qm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...m&&{body:f},signal:a}}function qm(e,t){return t==="application/x-www-form-urlencoded"?Pc(e)?kc(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var Ln=e=>e;d();c();l();u();d();c();l();u();function Un(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Un(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Un(),extendedResults:{},searchAction:void 0}}d();c();l();u();function ft(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mt=e=>{let{response:t}=e;return t.body?jm(e):Mm(t)},jm=e=>_m(e)?Vm(e):Nm(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Mm=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Nm(e){return e.body.statusCode!==void 0}function _m(e){return e.body.exception!==void 0}var Vm=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var gt=class{constructor(){de(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController;this.currentAbortController=new s.AbortController;let o=this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};d();c();l();u();d();c();l();u();var Xr=class{constructor(t){de(this,"_basePath");de(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}};d();c();l();u();function Tc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rt=(e,t,r,n)=>{let o=new Xr(`${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 Dc=async(e,t)=>{let r=await Be.call({...rt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ft(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Tc(r),o=await r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Lm(a)?{success:a}:{error:mt({response:r,body:a})}};function Lm(e){return typeof e=="string"}d();c();l();u();function Um(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Qm(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Qn(e,t){if(t&&e.name==="AbortError")return{error:Qm(e)};if(e instanceof jt)return{error:Um(e)};throw e}var Bn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new gt,mainSearch:new gt,facetValues:new gt,foldingCollection:new gt,instantResults:new gt})}async plan(t){let r=await Be.call({...rt(t,"POST","application/json","/plan"),requestParams:ft(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Qn(r);let n=await r.json();return $m(n)?{success:n}:{error:mt({response:r,body:n})}}async querySuggest(t){let r=await Be.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ft(t),...this.options});if(r instanceof Error)return Qn(r);let n=await r.json(),o={response:r,body:n};return Bm(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mt(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(m=>Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:m??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Qn(o,r?.disableAbortWarning);let i=await o.json(),a={response:o,body:i};return qc(i)?(a.body=jc(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:mt(a)}}async facetSearch(t){let r=await Be.call({...rt(t,"POST","application/json","/facet"),requestParams:ft(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(qc(n)){let o={response:r,body:n};return o.body=jc(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mt({response:r,body:n})}}async html(t){return Dc(t,{...this.options})}async fieldDescriptions(t){let r=await Be.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return Hm(n)?{success:n}:{error:mt({response:r,body:n})}}},$n=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function qc(e){return e.results!==void 0}function jc(e){let t=Un();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Bm(e){return e.completions!==void 0}function $m(e){return e.preprocessingOutput!==void 0}function Hm(e){return e.fields!==void 0}d();c();l();u();var Mc=e=>e,Nc=e=>e,_c=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function be(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 zm=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vc=zm,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),Gm={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=Gm;function We(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 Ji(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function p(){a===i&&(a=new Map,i.forEach((k,R)=>{a.set(R,k)}))}function y(){if(f)throw new Error(be(3));return o}function h(k){if(typeof k!="function")throw new Error(be(4));if(f)throw new Error(be(5));let R=!0;p();let P=m++;return a.set(P,k),function(){if(R){if(f)throw new Error(be(6));R=!1,p(),a.delete(P),i=null}}}function S(k){if(!We(k))throw new Error(be(7));if(typeof k.type>"u")throw new Error(be(8));if(typeof k.type!="string")throw new Error(be(17));if(f)throw new Error(be(9));try{f=!0,o=n(o,k)}finally{f=!1}return(i=a).forEach(P=>{P()}),k}function g(k){if(typeof k!="function")throw new Error(be(10));n=k,S({type:Hn.REPLACE})}function v(){let k=h;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(be(11));function P(){let E=R;E.next&&E.next(y())}return P(),{unsubscribe:k(P)}},[Vc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[Vc]:v}}function Wm(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function tr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{Wm(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let p=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],g=r[S],v=m[S],x=g(v,f);if(typeof x>"u"){let k=f&&f.type;throw new Error(be(14))}y[S]=x,p=p||x!==v}return p=p||n.length!==Object.keys(m).length,p?y:m}}function rr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Lc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(be(15))},a={getState:o.getState,dispatch:(f,...p)=>i(f,...p)},m=e.map(f=>f(a));return i=rr(...m)(o.dispatch),{...o,dispatch:i}}}function zn(e){return We(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function Ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Nt=Object.getPrototypeOf;function Me(e){return!!e&&!!e[Te]}function De(e){return e?Hc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||nr(e)||an(e):!1}var Km=Object.prototype.constructor.toString();function Hc(e){if(!e||typeof e!="object")return!1;let t=Nt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Km}function ca(e){return Me(e)||Ae(15,e),e[Te].base_}function en(e,t){_t(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function _t(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:nr(e)?2:an(e)?3:0}function tn(e,t){return _t(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return _t(e)===2?e.get(t):e[t]}function zc(e,t,r){let n=_t(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ym(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nr(e){return e instanceof Map}function an(e){return e instanceof Set}function Mt(e){return e.copy_||e.base_}function ta(e,t){if(nr(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Hc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(Nt(e),n)}else{let n=Nt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Yn(e,t=!1){return Jn(e)||Me(e)||!De(e)||(_t(e)>1&&Object.defineProperties(e,{set:{value:Gn},add:{value:Gn},clear:{value:Gn},delete:{value:Gn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Yn(r,!0))),e}function Gn(){Ae(2)}function Jn(e){return Object.isFrozen(e)}var ra={};function Vt(e){let t=ra[e];return t||Ae(0,e),t}function Jm(e,t){ra[e]||(ra[e]=t)}var rn;function Gc(){return rn}function Xm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Uc(e,t){t&&(Vt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(Zm),e.drafts_=null}function oa(e){e===rn&&(rn=e.parent_)}function Qc(e){return rn=Xm(rn,e)}function Zm(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Bc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(na(t),Ae(4)),De(e)&&(e=Wn(t,e),t.parent_||Kn(t,e)),t.patches_&&Vt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=Wn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Wn(e,t,r){if(Jn(t))return t;let n=t[Te];if(!n)return en(t,(o,i)=>$c(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Kn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),en(i,(m,f)=>$c(e,n,o,m,f,r,a)),Kn(e,o,!1),r&&e.patches_&&Vt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function $c(e,t,r,n,o,i,a){if(Me(o)){let m=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,f=Wn(e,o,m);if(zc(r,n,f),Me(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Jn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Kn(e,o)}}function Kn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yn(t,r)}function eg(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Gc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=nn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var ua={get(e,t){if(t===Te)return e;let r=Mt(e);if(!tn(r,t))return tg(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Mt(e)},ownKeys(e){return Reflect.ownKeys(Mt(e))},set(e,t,r){let n=Wc(Mt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Mt(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ym(r,o)&&(r!==void 0||tn(e.base_,t)))return!0;ea(e),ia(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_[t]=!0),!0},deleteProperty(e,t){return Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Mt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ae(11)},getPrototypeOf(e){return Nt(e.base_)},setPrototypeOf(){Ae(12)}},nn={};en(ua,(e,t)=>{nn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nn.deleteProperty=function(e,t){return nn.set.call(this,e,t,void 0)};nn.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Te];return(r?Mt(r):e)[t]}function tg(e,t,r){let n=Wc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Wc(e,t){if(!(t in e))return;let r=Nt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Nt(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...p){return a.produce(f,y=>r.call(this,y,...p))}}typeof r!="function"&&Ae(6),n!==void 0&&typeof n!="function"&&Ae(7);let o;if(De(t)){let i=Qc(this),a=aa(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?na(i):oa(i)}return Uc(i,n),Bc(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Yn(o,!0),n){let i=[],a=[];Vt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ae(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||Ae(8),Me(e)&&(e=Kc(e));let t=Qc(this),r=aa(e,void 0);return r[Te].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&Ae(9);let{scope_:n}=r;return Uc(n,t),Bc(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}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=Vt("Patches").applyPatches_;return Me(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=nr(e)?Vt("MapSet").proxyMap_(e,t):an(e)?Vt("MapSet").proxySet_(e,t):eg(e,t);return(t?t.scope_:Gc()).drafts_.push(r),r}function Kc(e){return Me(e)||Ae(10,e),Yc(e)}function Yc(e){if(!De(e)||Jn(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return en(r,(n,o)=>{zc(r,n,Yc(o))}),t&&(t.finalized_=!1),r}function Jc(){let t="replace",r="add",n="remove";function o(S,g,v,x){switch(S.type_){case 0:case 2:return a(S,g,v,x);case 1:return i(S,g,v,x);case 3:return m(S,g,v,x)}}function i(S,g,v,x){let{base_:k,assigned_:R}=S,P=S.copy_;P.length<k.length&&([k,P]=[P,k],[v,x]=[x,v]);for(let w=0;w<k.length;w++)if(R[w]&&P[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(P[w])}),x.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<P.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(P[w])})}for(let w=P.length-1;k.length<=w;--w){let E=g.concat([w]);x.push({op:n,path:E})}}function a(S,g,v,x){let{base_:k,copy_:R}=S;en(S.assigned_,(P,w)=>{let E=Xi(k,P),M=Xi(R,P),O=w?tn(k,P)?t:r:n;if(E===M&&O===t)return;let I=g.concat(P);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:M}),x.push(O===r?{op:n,path:I}:O===n?{op:r,path:I,value:h(E)}:{op:t,path:I,value:h(E)})})}function m(S,g,v,x){let{base_:k,copy_:R}=S,P=0;k.forEach(w=>{if(!R.has(w)){let E=g.concat([P]);v.push({op:n,path:E,value:w}),x.unshift({op:r,path:E,value:w})}P++}),P=0,R.forEach(w=>{if(!k.has(w)){let E=g.concat([P]);v.push({op:r,path:E,value:w}),x.unshift({op:n,path:E,value:w})}P++})}function f(S,g,v,x){v.push({op:t,path:[],value:g===sa?void 0:g}),x.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:x,op:k}=v,R=S;for(let M=0;M<x.length-1;M++){let O=_t(R),I=x[M];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&Ae(19),typeof R=="function"&&I==="prototype"&&Ae(19),R=Xi(R,I),typeof R!="object"&&Ae(18,x.join("/"))}let P=_t(R),w=y(v.value),E=x[x.length-1];switch(k){case t:switch(P){case 2:return R.set(E,w);case 3:Ae(16);default:return R[E]=w}case r:switch(P){case 1:return E==="-"?R.push(w):R.splice(E,0,w);case 2:return R.set(E,w);case 3:return R.add(w);default:return R[E]=w}case n:switch(P){case 1:return R.splice(E,1);case 2:return R.delete(E);case 3:return R.delete(v.value);default:return delete R[E]}default:Ae(17,k)}}),S}function y(S){if(!De(S))return S;if(Array.isArray(S))return S.map(y);if(nr(S))return new Map(Array.from(S.entries()).map(([v,x])=>[v,y(x)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(Nt(S));for(let v in S)g[v]=y(S[v]);return tn(S,Zr)&&(g[Zr]=S[Zr]),g}function h(S){return Me(S)?y(S):S}Jm("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:f})}var on=new rg,nt=on.produce,Xn=on.produceWithPatches.bind(on);var la=on.applyPatches.bind(on);d();c();l();u();function ng(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function og(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ig(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 Xc=e=>Array.isArray(e)?e:[e];function ag(e){let t=Array.isArray(e[0])?e[0]:e;return ig(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function sg(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var WR=Symbol();var KR=Object.getPrototypeOf({});var cg=class{constructor(e){this.value=e}deref(){return this.value}},ug=typeof WeakRef<"u"?WeakRef:cg,lg=0,Zc=1;function Zn(){return{s:lg,v:void 0,o:null,p:null}}function or(e,t={}){let r=Zn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=m.o;v===null&&(m.o=v=new WeakMap);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}else{let v=m.p;v===null&&(m.p=v=new Map);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}}let p=m,y;if(m.s===Zc)y=m.v;else if(y=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,y)&&(y=h,i!==0&&i--),o=typeof y=="object"&&y!==null||typeof y=="function"?new ug(y):y}return p.s=Zc,p.v=y,y}return a.clearCache=()=>{r=Zn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function eu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},p=o.pop();typeof p=="object"&&(f=p,p=o.pop()),ng(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:g=or,argsMemoizeOptions:v=[],devModeChecks:x={}}=y,k=Xc(S),R=Xc(v),P=ag(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,M=g(function(){a++;let I=sg(P,arguments);return m=w.apply(null,I),m},...R);return Object.assign(M,{resultFunc:p,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=eu(or),dg=Object.assign((e,t=pe)=>{og(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,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>dg});d();c();l();u();function tu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var ru=tu(),nu=tu;var pg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rr:rr.apply(null,arguments)},fx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},fg=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($e(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=>zn(n)&&n.type===e,r}var cu=class sn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sn(...t[0].concat(this)):new sn(...t.concat(this))}};function ou(e){return De(e)?nt(e,()=>{}):e}function iu(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function mg(e){return typeof e=="boolean"}var gg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new cu;return r&&(mg(r)?a.push(ru):a.push(nu(r.extraArgument))),a},cn="RTK_autoBatch",ar=()=>e=>({payload:e,meta:{[cn]:!0}}),au=e=>t=>{setTimeout(t,e)},yg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:au(10):e.type==="callback"?e.queueNotification:au(e.timeout),p=()=>{a=!1,i&&(i=!1,m.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>o&&y(),S=n.subscribe(h);return m.add(y),()=>{S(),m.delete(y)}},dispatch(y){try{return o=!y?.meta?.[cn],i=!o,i&&(a||(a=!0,f(p))),n.dispatch(y)}finally{o=!0}}})},hg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new cu(e);return n&&o.push(yg(typeof n=="object"?n:void 0)),o};function uu(e){let t=gg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(We(r))m=tr(r);else throw new Error($e(1));let f;typeof n=="function"?f=n(t):f=t();let p=rr;o&&(p=pg({trace:!1,...typeof o=="object"&&o}));let y=Lc(...f),h=hg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return Ji(m,i,g)}function lu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error($e(28));if(m in t)throw new Error($e(29));return t[m]=a,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 Sg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=lu(t),i;if(Sg(e))i=()=>ou(e());else{let m=ou(e);i=()=>m}function a(m=i(),f){let p=[r[f.type],...n.filter(({matcher:y})=>y(f)).map(({reducer:y})=>y)];return p.filter(y=>!!y).length===0&&(p=[o]),p.reduce((y,h)=>{if(h)if(Me(y)){let g=h(y,f);return g===void 0?y:g}else{if(De(y))return nt(y,S=>h(S,f));{let S=h(y,f);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},m)}return a.getInitialState=i,a}var du=(e,t)=>fg(e)?e.match(t):e(t);function Ke(...e){return t=>e.some(r=>du(r,t))}function ir(...e){return t=>e.every(r=>du(r,t))}function to(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 un(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ro(...e){return e.length===0?t=>to(t,["pending"]):un(e)?Ke(...e.map(t=>t.pending)):ro()(e[0])}function Lt(...e){return e.length===0?t=>to(t,["rejected"]):un(e)?Ke(...e.map(t=>t.rejected)):Lt()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ir(Lt(...e),t):un(e)?ir(Lt(...e),t):ln()(e[0])}function ot(...e){return e.length===0?t=>to(t,["fulfilled"]):un(e)?Ke(...e.map(t=>t.fulfilled)):ot()(e[0])}function no(...e){return e.length===0?t=>to(t,["pending","fulfilled","rejected"]):un(e)?Ke(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):no()(e[0])}var vg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",oo=(e=21)=>{let t="",r=e;for(;r--;)t+=vg[Math.random()*64|0];return t},bg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},su=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},Ag=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of bg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,p,y,h)=>({payload:f,meta:{...h||{},arg:y,requestId:p,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,p,y)=>({payload:void 0,meta:{...y||{},arg:p,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,p,y,h,S)=>({payload:h,error:(n&&n.serializeError||Ag)(f||"Rejected"),meta:{...S||{},arg:y,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(p,y,h)=>{let S=n?.idGenerator?n.idGenerator(f):oo(),g=new s.AbortController,v,x;function k(P){x=P,g.abort()}let R=async function(){let P;try{let E=n?.condition?.(f,{getState:y,extra:h});if(wg(E)&&(E=await E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((O,I)=>{v=()=>{I({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:y,extra:h}))),P=await Promise.race([M,Promise.resolve(r(f,{dispatch:p,getState:y,extra:h,requestId:S,signal:g.signal,abort:k,rejectWithValue:(O,I)=>new da(O,I),fulfillWithValue:(O,I)=>new su(O,I)})).then(O=>{if(O instanceof da)throw O;return O instanceof su?o(O.payload,S,f,O.meta):o(O,S,f)})])}catch(E){P=E instanceof da?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P}();return Object.assign(R,{abort:k,requestId:S,arg:f,unwrap(){return R.then(Cg)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ke(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Cg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function wg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pu=Symbol.for("rtk-slice-createasyncthunk"),Sx={[pu]:ue};function Rg(e,t){return`${e}/${t}`}function xg({creators:e}={}){let t=e?.asyncThunk?.[pu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error($e(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Ig()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,w){let E=typeof P=="string"?P:P.type;if(!E)throw new Error($e(12));if(E in f.sliceCaseReducersByType)throw new Error($e(13));return f.sliceCaseReducersByType[E]=w,p},addMatcher(P,w){return f.sliceMatchers.push({matcher:P,reducer:w}),p},exposeAction(P,w){return f.actionCreators[P]=w,p},exposeCaseReducer(P,w){return f.sliceCaseReducersByName[P]=w,p}};m.forEach(P=>{let w=a[P],E={reducerName:P,type:Rg(o,P),createNotation:typeof n.reducers=="function"};Pg(w)?Og(E,w,p,t):kg(E,w,p)});function y(){let[P={},w=[],E=void 0]=typeof n.extraReducers=="function"?lu(n.extraReducers):[n.extraReducers],M={...P,...f.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let I in M)O.addCase(I,M[I]);for(let I of f.sliceMatchers)O.addMatcher(I.matcher,I.reducer);for(let I of w)O.addMatcher(I.matcher,I.reducer);E&&O.addDefaultCase(E)})}let h=P=>P,S=new Map,g;function v(P,w){return g||(g=y()),g(P,w)}function x(){return g||(g=y()),g.getInitialState()}function k(P,w=!1){function E(O){let I=O[P];return typeof I>"u"&&w&&(I=x()),I}function M(O=h){let I=iu(S,w,()=>new WeakMap);return iu(I,O,()=>{let F={};for(let[D,N]of Object.entries(n.selectors??{}))F[D]=Eg(N,O,x,w);return F})}return{reducerPath:P,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let R={name:o,reducer:v,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:x,...k(i),injectInto(P,{reducerPath:w,...E}={}){let M=w??i;return P.inject({reducerPath:M,reducer:v},E),{...R,...k(M,!0)}}};return R}}function Eg(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Ut=xg();function Ig(){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 kg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Fg(n))throw new Error($e(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function Pg(e){return e._reducerDefinitionType==="asyncThunk"}function Fg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Og({type:e,reducerName:t},r,n,o){if(!o)throw new Error($e(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:p,options:y}=r,h=o(e,i,y);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||eo,pending:m||eo,rejected:f||eo,settled:p||eo})}function eo(){}var fu="listener",mu="completed",gu="cancelled",vx=`task-${gu}`,bx=`task-${mu}`,Ax=`${fu}-${gu}`,Cx=`${fu}-${mu}`;var{assign:yu}=Object;var pa="listenerMiddleware";var Tg=yu(T(`${pa}/add`),{withTypes:()=>Tg}),wx=T(`${pa}/removeAll`),Dg=yu(T(`${pa}/remove`),{withTypes:()=>Dg});var Rx=Symbol.for("rtk-state-proxy-original");function $e(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. `}d();c();l();u();var W=new H({required:!0,emptyAllowed:!1}),Ce=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),jx=new H({required:!1,emptyAllowed:!0}),io=new ie({each:W,required:!0}),hu=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Su=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Mx=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),it=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ve=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Wr(o);return{payload:e}},Q=(e,t)=>{try{return Ve(e,t)}catch(r){return{payload:e,error:it(r)}}},vu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Au(e,t,r,o,"Controller initialization error")},bu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Au(e,t,r,o,"Controller initialization error")},Au=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var sr="3.30.0",Cu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ce,wu=()=>W,yt=T("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Ye=T("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new ie({required:!1,each:W})})),qg={enabled:new ne({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:Su,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:Cu.reduce((e,t)=>(e[t]=hu,e),{})})},cr=T("configuration/updateAnalyticsConfiguration",e=>Q(e,qg)),ur=T("configuration/analytics/disable"),lr=T("configuration/analytics/enable"),ao=T("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:wu()})),so=T("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:wu()}));d();c();l();u();d();c();l();u();d();c();l();u();var Ru={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ne,sf:new K,tab:new H,af:new K};var ht=T("searchParameters/restore",e=>Q(e,Ru)),xu=T("searchParameters/restoreTab",e=>Q(e,W));d();c();l();u();var co=T("debug/enable"),uo=T("debug/disable");d();c();l();u();var lo=()=>!1;var po=ge(lo(),e=>{e.addCase(co,()=>!0).addCase(uo,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var dr=T("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var jg=T("history/undo"),Mg=T("history/redo"),Je=T("history/snapshot"),HE=ue("history/back",async(e,{dispatch:t})=>{t(jg()),await t(qe())}),zE=ue("history/forward",async(e,{dispatch:t})=>{t(Mg()),await t(qe())}),qe=ue("history/change",async(e,{getState:t})=>t().history.present);d();c();l();u();var pr=()=>"";var fr=ge(pr(),e=>{e.addCase(dr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ye,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var fo=T("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var mr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||p.test(m)||m.indexOf(".")===-1?ma(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(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 ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Ng(){return typeof navigator<"u"}function Eu(){try{return typeof localStorage<"u"}catch{return!1}}function Iu(){try{return typeof sessionStorage<"u"}catch{return!1}}function ku(){return!!(Ng()&&navigator.cookieEnabled)}var Pu=null;function Fu(){return Pu||(Eu()?localStorage:ku()?new ga:Iu()?sessionStorage:new ya)}var gr=class gr{getItem(t){return mr.get(`${gr.prefix}${t}`)}removeItem(t){mr.erase(`${gr.prefix}${t}`)}setItem(t,r,n){mr.set(`${gr.prefix}${t}`,r,n)}};de(gr,"prefix","coveo_");var ga=gr;var ya=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var mo="__coveo.analytics.history",_g=20,Vg=1e3*60,Lg=75,Qt=class Qt{constructor(t){de(this,"store");this.store=t||Fu()}static getInstance(t){return Qt.instance||(Qt.instance=new Qt(t)),Qt.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])}async addElementAsync(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=await 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))}async getHistoryAsync(){let t=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryWithInternalTime(){try{let t=this.store.getItem(mo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}async getHistoryWithInternalTimeAsync(){try{let t=await this.store.getItem(mo);return t?JSON.parse(t):[]}catch{return[]}}setHistory(t){try{this.store.setItem(mo,JSON.stringify(t.slice(0,_g)))}catch{}}clear(){try{this.store.removeItem(mo)}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,Lg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Vg:!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))}};de(Qt,"instance",null);var ha=Qt,Xe=ha;d();c();l();u();d();c();l();u();var yr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${sr}`));d();c();l();u();d();c();l();u();function at(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 q(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 m(y){try{p(n.next(y))}catch(h){a(h)}}function f(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(m,f)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function ba(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function hr(){return typeof document<"u"}function Aa(){try{return typeof localStorage<"u"}catch{return!1}}function Ug(){try{return typeof sessionStorage<"u"}catch{return!1}}function $u(){return Da()&&navigator.cookieEnabled}var Qg=[ae.click,ae.custom,ae.search,ae.view],Bg=(e,t)=>Qg.indexOf(e)!==-1?Object.assign({language:hr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,pn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?Ou(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Ou(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 Ou(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function $g(){return Aa()?localStorage:$u()?new fn:Ug()?sessionStorage:new vr}var fn=class e{getItem(t){return pn.get(`${e.prefix}${t}`)}removeItem(t){pn.erase(`${e.prefix}${t}`)}setItem(t,r,n){pn.set(`${e.prefix}${t}`,r,n)}};fn.prefix="coveo_";var Ca=class{constructor(){this.cookieStorage=new fn}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)}},vr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},go="__coveo.analytics.history",Hg=20,zg=1e3*60,Gg=75,So=class{constructor(t){this.store=t||$g()}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 q(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 q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(go);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(go);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(go,JSON.stringify(t.slice(0,Hg)))}catch{}}clear(){try{this.store.removeItem(go)}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,Gg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>zg:!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 Wg=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Kg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Kg=e=>q(void 0,void 0,void 0,function*(){let t=new So,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),yo,Yg=new Uint8Array(16);function Jg(){if(!yo&&(yo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yo(Yg)}var Xg=/^(?:[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 vo(e){return typeof e=="string"&&Xg.test(e)}var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function Hu(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}function Zg(e){if(!vo(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 ey(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ty="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ry="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ny(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=ey(o)),typeof i=="string"&&(i=Zg(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){m=m||0;for(let y=0;y<16;++y)a[m+y]=p[y];return a}return Hu(p)}try{n.name=e}catch{}return n.DNS=ty,n.URL=ry,n}var oy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Tu={randomUUID:oy};function Bt(e,t,r){if(Tu.randomUUID&&!t&&!e)return Tu.randomUUID();e=e||{};let n=e.random||(e.rng||Jg)();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 Hu(n)}function iy(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 Sa(e,t){return e<<t|e>>>32-t}function ay(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 m=0;m<a.length;++m)e.push(a.charCodeAt(m))}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 m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}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 m=new Uint32Array(80);for(let g=0;g<16;++g)m[g]=i[a][g];for(let g=16;g<80;++g)m[g]=Sa(m[g-3]^m[g-8]^m[g-14]^m[g-16],1);let f=r[0],p=r[1],y=r[2],h=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),x=Sa(f,5)+iy(v,p,y,h)+S+t[v]+m[g]>>>0;S=h,h=y,y=Sa(p,30)>>>0,p=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>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 sy=ny("v5",80,ay),Du=sy,zu="2.30.45",qu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},bo=class{constructor({client:t,uuidGenerator:r=Bt}){this.client=t,this.uuidGenerator=r}},wa=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=qu(window.location),this.lastReferrer=hr()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return 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:hr()?document.title:"",encoding:hr()?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===dn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===dn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===dn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===dn.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 qu(window.location)}},St=class e{constructor(t,r){if(!vo(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 vo(i)?new e(i,Number.parseInt(o)*1e3):null}};St.cvo_cid="cvo_cid";St.expirationTime=120;var Ra=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){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 q(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(St.cvo_cid,new St(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ra.Id="link";var Ue=Object.keys;function ho(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Gu=192,ju=224,Mu=240;function cy(e){return(e&248)===Mu?4:(e&Mu)===ju?3:(e&ju)===Gu?2:1}function uy(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&va)!=va)break;if(r-=3,(n&Gu)!=va){t-r>=cy(n)*3&&(r=t);break}}return e.substring(0,r)}var xa={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"},ly=Ue(xa).map(e=>xa[e]),dy=[...ly].join("|"),py=new RegExp(`^(${dy}$)`),fy={svcAction:"svc_action",svcActionData:"svc_action_data"},my=e=>Ue(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=xa[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),gy=e=>py.test(e),yy=[gy],Nu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},_u={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},Ao={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},hy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Sy={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),Ao),purchase:Object.assign(Object.assign({},Ee),Ao),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},vy=Ue(Nu).map(e=>Nu[e]),by=Ue(_u).map(e=>_u[e]),Ay=Ue(Ee).map(e=>Ee[e]),Cy=Ue(Ao).map(e=>Ao[e]),wy=Ue(Ia).map(e=>Ia[e]),Ry=Ue(Ea).map(e=>Ea[e]),xy=[...vy,"custom"].join("|"),Ey=[...by,"custom"].join("|"),Wu="(pr[0-9]+)",Ku="(il[0-9]+pi[0-9]+)",Iy=new RegExp(`^${Wu}(${xy})$`),ky=new RegExp(`^(${Ku}(${Ey}))|(il[0-9]+nm)$`),Py=new RegExp(`^(${Ay.join("|")})$`),Fy=new RegExp(`^(${Cy.join("|")})$`),Oy=new RegExp(`^${Wu}custom$`),Ty=new RegExp(`^${Ku}custom$`),Dy=new RegExp(`^(${[...hy,...wy,...Ry].join("|")})$`),qy=e=>Iy.test(e),jy=e=>ky.test(e),My=e=>Py.test(e),Ny=e=>Fy.test(e),_y=e=>Dy.test(e),Vy=[jy,qy,My,Ny,_y],Ly=[Oy,Ty],Uy={anonymizeIp:"aip"},Qy={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},By={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},$y=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Hy=Object.assign(Object.assign(Object.assign(Object.assign({},Uy),Qy),By),$y.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ka=Object.assign(Object.assign({},Hy),fy),zy=e=>{let t=!!e.action&&Sy[e.action]||{};return Ue(e).reduce((r,n)=>{let o=t[n]||ka[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Gy=Ue(ka).map(e=>ka[e]),Wy=e=>Gy.indexOf(e)!==-1,Ky=e=>e==="custom",Yy=e=>[...Vy,...yy,Wy,Ky].some(t=>t(e)),Jy=e=>Ue(e).reduce((t,r)=>{let n=Xy(r);return n?Object.assign(Object.assign({},t),Zy(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Xy=e=>{let t;return[...Ly].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Zy=(e,t)=>Ue(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Pa=class{constructor(t){this.opts=t}sendEvent(t,r){return q(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:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),p=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(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:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}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 q(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[ae.click,ae.custom,ae.search,ae.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}},Fa=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},Vu=b.fetch,Co=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:p}=f,y=at(f,["url"]),h;try{h=yield Vu(p,y)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Vu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(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"})}},Oa=class{constructor(t,r){Aa()&&$u()?this.storage=new Ca:Aa()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new vr),this.client=new Co(t),this.beaconClient=new Pa(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}},Ta=class{constructor(t,r){this.storage=r||new vr,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},wo=class{constructor(){this.storage=new vr,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},eh="xx",th=e=>e?.startsWith(eh)||!1,rh=`
|
|
27
|
+
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=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 Zf(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&&X(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 ve(e){return e===void 0}function em(e){return e===null}function X(e){return ve(e)||em(e)}var ne=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(tm(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function tm(e){return ve(e)||fc(e)}function fc(e){return typeof e=="boolean"}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(rm(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 rm(e){return ve(e)||mc(e)}function mc(e){return typeof e=="number"&&!Number.isNaN(e)}var nm=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(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(ve(e))return null;if(!Mn(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&&!(nm.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 Mn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!gc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(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 gc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(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&&X(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 fc(e)||Mn(e)||mc(e)||gc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function yc(e){return Array.isArray(e)}var Vi=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(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}};d();c();l();u();function hc(e){return Array.isArray(e)}function Nn(e){return e.trim()===""}var om=new Set(["1",1,"yes",!0]);function Sc(){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=>om.has(r))}function vc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Kr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function im(e){if(Nn(e.openingDelimiter)||Nn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Nn(e.content))return e.content;if(e.highlights.length===0)return Zt(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,m=a+i.length;if(m>t)break;r+=Zt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Zt(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=Zt(e.content.slice(n))),r}function am(e,t){return e=Zt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function Zt(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Oc=Qe(Ic(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),er=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."}},jt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function kc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Pc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Tm)}function Tm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Fc(e){return e===429}var Be=class e{static async call(t){let r=Dm(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=async()=>{let f=await A(i,a);if(Fc(f.status))throw f;return f};try{let f=await(0,Oc.backOff)(m,{retry:p=>{let y=p&&Fc(p.status);return y&&n.info("Platform retrying request"),y}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new er;case 404:throw new jt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new jt(i):f}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,p=Kr(f);try{let y=await o(t,n,a);return{...t,...y}}catch(y){i.error(y,"Platform request preprocessing failed. Returning default request options.")}return p}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function Vn(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Dm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=qm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...m&&{body:f},signal:a}}function qm(e,t){return t==="application/x-www-form-urlencoded"?Pc(e)?kc(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var Ln=e=>e;d();c();l();u();d();c();l();u();function Un(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Un(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Un(),extendedResults:{},searchAction:void 0}}d();c();l();u();function ft(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mt=e=>{let{response:t}=e;return t.body?jm(e):Mm(t)},jm=e=>_m(e)?Vm(e):Nm(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Mm=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Nm(e){return e.body.statusCode!==void 0}function _m(e){return e.body.exception!==void 0}var Vm=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var gt=class{constructor(){de(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController;this.currentAbortController=new s.AbortController;let o=this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};d();c();l();u();d();c();l();u();var Xr=class{constructor(t){de(this,"_basePath");de(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}};d();c();l();u();function Tc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rt=(e,t,r,n)=>{let o=new Xr(`${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 Dc=async(e,t)=>{let r=await Be.call({...rt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ft(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Tc(r),o=await r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Lm(a)?{success:a}:{error:mt({response:r,body:a})}};function Lm(e){return typeof e=="string"}d();c();l();u();function Um(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Qm(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Qn(e,t){if(t&&e.name==="AbortError")return{error:Qm(e)};if(e instanceof jt)return{error:Um(e)};throw e}var Bn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new gt,mainSearch:new gt,facetValues:new gt,foldingCollection:new gt,instantResults:new gt})}async plan(t){let r=await Be.call({...rt(t,"POST","application/json","/plan"),requestParams:ft(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Qn(r);let n=await r.json();return $m(n)?{success:n}:{error:mt({response:r,body:n})}}async querySuggest(t){let r=await Be.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ft(t),...this.options});if(r instanceof Error)return Qn(r);let n=await r.json(),o={response:r,body:n};return Bm(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mt(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(m=>Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:m??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Qn(o,r?.disableAbortWarning);let i=await o.json(),a={response:o,body:i};return qc(i)?(a.body=jc(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:mt(a)}}async facetSearch(t){let r=await Be.call({...rt(t,"POST","application/json","/facet"),requestParams:ft(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(qc(n)){let o={response:r,body:n};return o.body=jc(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mt({response:r,body:n})}}async html(t){return Dc(t,{...this.options})}async fieldDescriptions(t){let r=await Be.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return Hm(n)?{success:n}:{error:mt({response:r,body:n})}}},$n=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function qc(e){return e.results!==void 0}function jc(e){let t=Un();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Bm(e){return e.completions!==void 0}function $m(e){return e.preprocessingOutput!==void 0}function Hm(e){return e.fields!==void 0}d();c();l();u();var Mc=e=>e,Nc=e=>e,_c=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function be(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 zm=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vc=zm,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),Gm={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=Gm;function We(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 Ji(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function p(){a===i&&(a=new Map,i.forEach((k,R)=>{a.set(R,k)}))}function y(){if(f)throw new Error(be(3));return o}function h(k){if(typeof k!="function")throw new Error(be(4));if(f)throw new Error(be(5));let R=!0;p();let P=m++;return a.set(P,k),function(){if(R){if(f)throw new Error(be(6));R=!1,p(),a.delete(P),i=null}}}function S(k){if(!We(k))throw new Error(be(7));if(typeof k.type>"u")throw new Error(be(8));if(typeof k.type!="string")throw new Error(be(17));if(f)throw new Error(be(9));try{f=!0,o=n(o,k)}finally{f=!1}return(i=a).forEach(P=>{P()}),k}function g(k){if(typeof k!="function")throw new Error(be(10));n=k,S({type:Hn.REPLACE})}function v(){let k=h;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(be(11));function P(){let E=R;E.next&&E.next(y())}return P(),{unsubscribe:k(P)}},[Vc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[Vc]:v}}function Wm(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function tr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{Wm(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let p=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],g=r[S],v=m[S],x=g(v,f);if(typeof x>"u"){let k=f&&f.type;throw new Error(be(14))}y[S]=x,p=p||x!==v}return p=p||n.length!==Object.keys(m).length,p?y:m}}function rr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Lc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(be(15))},a={getState:o.getState,dispatch:(f,...p)=>i(f,...p)},m=e.map(f=>f(a));return i=rr(...m)(o.dispatch),{...o,dispatch:i}}}function zn(e){return We(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function Ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Nt=Object.getPrototypeOf;function Me(e){return!!e&&!!e[Te]}function De(e){return e?Hc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||nr(e)||an(e):!1}var Km=Object.prototype.constructor.toString();function Hc(e){if(!e||typeof e!="object")return!1;let t=Nt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Km}function ca(e){return Me(e)||Ae(15,e),e[Te].base_}function en(e,t){_t(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function _t(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:nr(e)?2:an(e)?3:0}function tn(e,t){return _t(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return _t(e)===2?e.get(t):e[t]}function zc(e,t,r){let n=_t(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ym(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nr(e){return e instanceof Map}function an(e){return e instanceof Set}function Mt(e){return e.copy_||e.base_}function ta(e,t){if(nr(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Hc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(Nt(e),n)}else{let n=Nt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Yn(e,t=!1){return Jn(e)||Me(e)||!De(e)||(_t(e)>1&&Object.defineProperties(e,{set:{value:Gn},add:{value:Gn},clear:{value:Gn},delete:{value:Gn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Yn(r,!0))),e}function Gn(){Ae(2)}function Jn(e){return Object.isFrozen(e)}var ra={};function Vt(e){let t=ra[e];return t||Ae(0,e),t}function Jm(e,t){ra[e]||(ra[e]=t)}var rn;function Gc(){return rn}function Xm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Uc(e,t){t&&(Vt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(Zm),e.drafts_=null}function oa(e){e===rn&&(rn=e.parent_)}function Qc(e){return rn=Xm(rn,e)}function Zm(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Bc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(na(t),Ae(4)),De(e)&&(e=Wn(t,e),t.parent_||Kn(t,e)),t.patches_&&Vt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=Wn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Wn(e,t,r){if(Jn(t))return t;let n=t[Te];if(!n)return en(t,(o,i)=>$c(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Kn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),en(i,(m,f)=>$c(e,n,o,m,f,r,a)),Kn(e,o,!1),r&&e.patches_&&Vt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function $c(e,t,r,n,o,i,a){if(Me(o)){let m=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,f=Wn(e,o,m);if(zc(r,n,f),Me(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Jn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Kn(e,o)}}function Kn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yn(t,r)}function eg(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Gc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=nn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var ua={get(e,t){if(t===Te)return e;let r=Mt(e);if(!tn(r,t))return tg(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Mt(e)},ownKeys(e){return Reflect.ownKeys(Mt(e))},set(e,t,r){let n=Wc(Mt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Mt(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ym(r,o)&&(r!==void 0||tn(e.base_,t)))return!0;ea(e),ia(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_[t]=!0),!0},deleteProperty(e,t){return Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Mt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ae(11)},getPrototypeOf(e){return Nt(e.base_)},setPrototypeOf(){Ae(12)}},nn={};en(ua,(e,t)=>{nn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nn.deleteProperty=function(e,t){return nn.set.call(this,e,t,void 0)};nn.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Te];return(r?Mt(r):e)[t]}function tg(e,t,r){let n=Wc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Wc(e,t){if(!(t in e))return;let r=Nt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Nt(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...p){return a.produce(f,y=>r.call(this,y,...p))}}typeof r!="function"&&Ae(6),n!==void 0&&typeof n!="function"&&Ae(7);let o;if(De(t)){let i=Qc(this),a=aa(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?na(i):oa(i)}return Uc(i,n),Bc(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Yn(o,!0),n){let i=[],a=[];Vt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ae(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||Ae(8),Me(e)&&(e=Kc(e));let t=Qc(this),r=aa(e,void 0);return r[Te].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&Ae(9);let{scope_:n}=r;return Uc(n,t),Bc(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}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=Vt("Patches").applyPatches_;return Me(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=nr(e)?Vt("MapSet").proxyMap_(e,t):an(e)?Vt("MapSet").proxySet_(e,t):eg(e,t);return(t?t.scope_:Gc()).drafts_.push(r),r}function Kc(e){return Me(e)||Ae(10,e),Yc(e)}function Yc(e){if(!De(e)||Jn(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return en(r,(n,o)=>{zc(r,n,Yc(o))}),t&&(t.finalized_=!1),r}function Jc(){let t="replace",r="add",n="remove";function o(S,g,v,x){switch(S.type_){case 0:case 2:return a(S,g,v,x);case 1:return i(S,g,v,x);case 3:return m(S,g,v,x)}}function i(S,g,v,x){let{base_:k,assigned_:R}=S,P=S.copy_;P.length<k.length&&([k,P]=[P,k],[v,x]=[x,v]);for(let w=0;w<k.length;w++)if(R[w]&&P[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(P[w])}),x.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<P.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(P[w])})}for(let w=P.length-1;k.length<=w;--w){let E=g.concat([w]);x.push({op:n,path:E})}}function a(S,g,v,x){let{base_:k,copy_:R}=S;en(S.assigned_,(P,w)=>{let E=Xi(k,P),M=Xi(R,P),O=w?tn(k,P)?t:r:n;if(E===M&&O===t)return;let I=g.concat(P);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:M}),x.push(O===r?{op:n,path:I}:O===n?{op:r,path:I,value:h(E)}:{op:t,path:I,value:h(E)})})}function m(S,g,v,x){let{base_:k,copy_:R}=S,P=0;k.forEach(w=>{if(!R.has(w)){let E=g.concat([P]);v.push({op:n,path:E,value:w}),x.unshift({op:r,path:E,value:w})}P++}),P=0,R.forEach(w=>{if(!k.has(w)){let E=g.concat([P]);v.push({op:r,path:E,value:w}),x.unshift({op:n,path:E,value:w})}P++})}function f(S,g,v,x){v.push({op:t,path:[],value:g===sa?void 0:g}),x.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:x,op:k}=v,R=S;for(let M=0;M<x.length-1;M++){let O=_t(R),I=x[M];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&Ae(19),typeof R=="function"&&I==="prototype"&&Ae(19),R=Xi(R,I),typeof R!="object"&&Ae(18,x.join("/"))}let P=_t(R),w=y(v.value),E=x[x.length-1];switch(k){case t:switch(P){case 2:return R.set(E,w);case 3:Ae(16);default:return R[E]=w}case r:switch(P){case 1:return E==="-"?R.push(w):R.splice(E,0,w);case 2:return R.set(E,w);case 3:return R.add(w);default:return R[E]=w}case n:switch(P){case 1:return R.splice(E,1);case 2:return R.delete(E);case 3:return R.delete(v.value);default:return delete R[E]}default:Ae(17,k)}}),S}function y(S){if(!De(S))return S;if(Array.isArray(S))return S.map(y);if(nr(S))return new Map(Array.from(S.entries()).map(([v,x])=>[v,y(x)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(Nt(S));for(let v in S)g[v]=y(S[v]);return tn(S,Zr)&&(g[Zr]=S[Zr]),g}function h(S){return Me(S)?y(S):S}Jm("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:f})}var on=new rg,nt=on.produce,Xn=on.produceWithPatches.bind(on);var la=on.applyPatches.bind(on);d();c();l();u();function ng(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function og(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ig(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 Xc=e=>Array.isArray(e)?e:[e];function ag(e){let t=Array.isArray(e[0])?e[0]:e;return ig(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function sg(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var WR=Symbol();var KR=Object.getPrototypeOf({});var cg=class{constructor(e){this.value=e}deref(){return this.value}},ug=typeof WeakRef<"u"?WeakRef:cg,lg=0,Zc=1;function Zn(){return{s:lg,v:void 0,o:null,p:null}}function or(e,t={}){let r=Zn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=m.o;v===null&&(m.o=v=new WeakMap);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}else{let v=m.p;v===null&&(m.p=v=new Map);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}}let p=m,y;if(m.s===Zc)y=m.v;else if(y=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,y)&&(y=h,i!==0&&i--),o=typeof y=="object"&&y!==null||typeof y=="function"?new ug(y):y}return p.s=Zc,p.v=y,y}return a.clearCache=()=>{r=Zn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function eu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},p=o.pop();typeof p=="object"&&(f=p,p=o.pop()),ng(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:g=or,argsMemoizeOptions:v=[],devModeChecks:x={}}=y,k=Xc(S),R=Xc(v),P=ag(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,M=g(function(){a++;let I=sg(P,arguments);return m=w.apply(null,I),m},...R);return Object.assign(M,{resultFunc:p,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=eu(or),dg=Object.assign((e,t=pe)=>{og(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,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>dg});d();c();l();u();function tu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var ru=tu(),nu=tu;var pg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rr:rr.apply(null,arguments)},fx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},fg=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($e(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=>zn(n)&&n.type===e,r}var cu=class sn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sn(...t[0].concat(this)):new sn(...t.concat(this))}};function ou(e){return De(e)?nt(e,()=>{}):e}function iu(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function mg(e){return typeof e=="boolean"}var gg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new cu;return r&&(mg(r)?a.push(ru):a.push(nu(r.extraArgument))),a},cn="RTK_autoBatch",ar=()=>e=>({payload:e,meta:{[cn]:!0}}),au=e=>t=>{setTimeout(t,e)},yg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:au(10):e.type==="callback"?e.queueNotification:au(e.timeout),p=()=>{a=!1,i&&(i=!1,m.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>o&&y(),S=n.subscribe(h);return m.add(y),()=>{S(),m.delete(y)}},dispatch(y){try{return o=!y?.meta?.[cn],i=!o,i&&(a||(a=!0,f(p))),n.dispatch(y)}finally{o=!0}}})},hg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new cu(e);return n&&o.push(yg(typeof n=="object"?n:void 0)),o};function uu(e){let t=gg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(We(r))m=tr(r);else throw new Error($e(1));let f;typeof n=="function"?f=n(t):f=t();let p=rr;o&&(p=pg({trace:!1,...typeof o=="object"&&o}));let y=Lc(...f),h=hg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return Ji(m,i,g)}function lu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error($e(28));if(m in t)throw new Error($e(29));return t[m]=a,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 Sg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=lu(t),i;if(Sg(e))i=()=>ou(e());else{let m=ou(e);i=()=>m}function a(m=i(),f){let p=[r[f.type],...n.filter(({matcher:y})=>y(f)).map(({reducer:y})=>y)];return p.filter(y=>!!y).length===0&&(p=[o]),p.reduce((y,h)=>{if(h)if(Me(y)){let g=h(y,f);return g===void 0?y:g}else{if(De(y))return nt(y,S=>h(S,f));{let S=h(y,f);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},m)}return a.getInitialState=i,a}var du=(e,t)=>fg(e)?e.match(t):e(t);function Ke(...e){return t=>e.some(r=>du(r,t))}function ir(...e){return t=>e.every(r=>du(r,t))}function to(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 un(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ro(...e){return e.length===0?t=>to(t,["pending"]):un(e)?Ke(...e.map(t=>t.pending)):ro()(e[0])}function Lt(...e){return e.length===0?t=>to(t,["rejected"]):un(e)?Ke(...e.map(t=>t.rejected)):Lt()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ir(Lt(...e),t):un(e)?ir(Lt(...e),t):ln()(e[0])}function ot(...e){return e.length===0?t=>to(t,["fulfilled"]):un(e)?Ke(...e.map(t=>t.fulfilled)):ot()(e[0])}function no(...e){return e.length===0?t=>to(t,["pending","fulfilled","rejected"]):un(e)?Ke(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):no()(e[0])}var vg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",oo=(e=21)=>{let t="",r=e;for(;r--;)t+=vg[Math.random()*64|0];return t},bg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},su=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},Ag=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of bg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,p,y,h)=>({payload:f,meta:{...h||{},arg:y,requestId:p,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,p,y)=>({payload:void 0,meta:{...y||{},arg:p,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,p,y,h,S)=>({payload:h,error:(n&&n.serializeError||Ag)(f||"Rejected"),meta:{...S||{},arg:y,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(p,y,h)=>{let S=n?.idGenerator?n.idGenerator(f):oo(),g=new s.AbortController,v,x;function k(P){x=P,g.abort()}let R=async function(){let P;try{let E=n?.condition?.(f,{getState:y,extra:h});if(wg(E)&&(E=await E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((O,I)=>{v=()=>{I({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:y,extra:h}))),P=await Promise.race([M,Promise.resolve(r(f,{dispatch:p,getState:y,extra:h,requestId:S,signal:g.signal,abort:k,rejectWithValue:(O,I)=>new da(O,I),fulfillWithValue:(O,I)=>new su(O,I)})).then(O=>{if(O instanceof da)throw O;return O instanceof su?o(O.payload,S,f,O.meta):o(O,S,f)})])}catch(E){P=E instanceof da?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P}();return Object.assign(R,{abort:k,requestId:S,arg:f,unwrap(){return R.then(Cg)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ke(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Cg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function wg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pu=Symbol.for("rtk-slice-createasyncthunk"),Sx={[pu]:ue};function Rg(e,t){return`${e}/${t}`}function xg({creators:e}={}){let t=e?.asyncThunk?.[pu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error($e(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Ig()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,w){let E=typeof P=="string"?P:P.type;if(!E)throw new Error($e(12));if(E in f.sliceCaseReducersByType)throw new Error($e(13));return f.sliceCaseReducersByType[E]=w,p},addMatcher(P,w){return f.sliceMatchers.push({matcher:P,reducer:w}),p},exposeAction(P,w){return f.actionCreators[P]=w,p},exposeCaseReducer(P,w){return f.sliceCaseReducersByName[P]=w,p}};m.forEach(P=>{let w=a[P],E={reducerName:P,type:Rg(o,P),createNotation:typeof n.reducers=="function"};Pg(w)?Og(E,w,p,t):kg(E,w,p)});function y(){let[P={},w=[],E=void 0]=typeof n.extraReducers=="function"?lu(n.extraReducers):[n.extraReducers],M={...P,...f.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let I in M)O.addCase(I,M[I]);for(let I of f.sliceMatchers)O.addMatcher(I.matcher,I.reducer);for(let I of w)O.addMatcher(I.matcher,I.reducer);E&&O.addDefaultCase(E)})}let h=P=>P,S=new Map,g;function v(P,w){return g||(g=y()),g(P,w)}function x(){return g||(g=y()),g.getInitialState()}function k(P,w=!1){function E(O){let I=O[P];return typeof I>"u"&&w&&(I=x()),I}function M(O=h){let I=iu(S,w,()=>new WeakMap);return iu(I,O,()=>{let F={};for(let[D,N]of Object.entries(n.selectors??{}))F[D]=Eg(N,O,x,w);return F})}return{reducerPath:P,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let R={name:o,reducer:v,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:x,...k(i),injectInto(P,{reducerPath:w,...E}={}){let M=w??i;return P.inject({reducerPath:M,reducer:v},E),{...R,...k(M,!0)}}};return R}}function Eg(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Ut=xg();function Ig(){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 kg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Fg(n))throw new Error($e(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function Pg(e){return e._reducerDefinitionType==="asyncThunk"}function Fg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Og({type:e,reducerName:t},r,n,o){if(!o)throw new Error($e(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:p,options:y}=r,h=o(e,i,y);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||eo,pending:m||eo,rejected:f||eo,settled:p||eo})}function eo(){}var fu="listener",mu="completed",gu="cancelled",vx=`task-${gu}`,bx=`task-${mu}`,Ax=`${fu}-${gu}`,Cx=`${fu}-${mu}`;var{assign:yu}=Object;var pa="listenerMiddleware";var Tg=yu(T(`${pa}/add`),{withTypes:()=>Tg}),wx=T(`${pa}/removeAll`),Dg=yu(T(`${pa}/remove`),{withTypes:()=>Dg});var Rx=Symbol.for("rtk-state-proxy-original");function $e(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. `}d();c();l();u();var W=new H({required:!0,emptyAllowed:!1}),Ce=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),jx=new H({required:!1,emptyAllowed:!0}),io=new ie({each:W,required:!0}),hu=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Su=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Mx=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),it=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ve=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Wr(o);return{payload:e}},Q=(e,t)=>{try{return Ve(e,t)}catch(r){return{payload:e,error:it(r)}}},vu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Au(e,t,r,o,"Controller initialization error")},bu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Au(e,t,r,o,"Controller initialization error")},Au=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var sr="3.30.1-pre.0b6ca95bda",Cu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ce,wu=()=>W,yt=T("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Ye=T("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new ie({required:!1,each:W})})),qg={enabled:new ne({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:Su,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:Cu.reduce((e,t)=>(e[t]=hu,e),{})})},cr=T("configuration/updateAnalyticsConfiguration",e=>Q(e,qg)),ur=T("configuration/analytics/disable"),lr=T("configuration/analytics/enable"),ao=T("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:wu()})),so=T("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:wu()}));d();c();l();u();d();c();l();u();d();c();l();u();var Ru={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ne,sf:new K,tab:new H,af:new K};var ht=T("searchParameters/restore",e=>Q(e,Ru)),xu=T("searchParameters/restoreTab",e=>Q(e,W));d();c();l();u();var co=T("debug/enable"),uo=T("debug/disable");d();c();l();u();var lo=()=>!1;var po=ge(lo(),e=>{e.addCase(co,()=>!0).addCase(uo,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var dr=T("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var jg=T("history/undo"),Mg=T("history/redo"),Je=T("history/snapshot"),HE=ue("history/back",async(e,{dispatch:t})=>{t(jg()),await t(qe())}),zE=ue("history/forward",async(e,{dispatch:t})=>{t(Mg()),await t(qe())}),qe=ue("history/change",async(e,{getState:t})=>t().history.present);d();c();l();u();var pr=()=>"";var fr=ge(pr(),e=>{e.addCase(dr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ye,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var fo=T("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var mr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||p.test(m)||m.indexOf(".")===-1?ma(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(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 ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Ng(){return typeof navigator<"u"}function Eu(){try{return typeof localStorage<"u"}catch{return!1}}function Iu(){try{return typeof sessionStorage<"u"}catch{return!1}}function ku(){return!!(Ng()&&navigator.cookieEnabled)}var Pu=null;function Fu(){return Pu||(Eu()?localStorage:ku()?new ga:Iu()?sessionStorage:new ya)}var gr=class gr{getItem(t){return mr.get(`${gr.prefix}${t}`)}removeItem(t){mr.erase(`${gr.prefix}${t}`)}setItem(t,r,n){mr.set(`${gr.prefix}${t}`,r,n)}};de(gr,"prefix","coveo_");var ga=gr;var ya=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var mo="__coveo.analytics.history",_g=20,Vg=1e3*60,Lg=75,Qt=class Qt{constructor(t){de(this,"store");this.store=t||Fu()}static getInstance(t){return Qt.instance||(Qt.instance=new Qt(t)),Qt.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])}async addElementAsync(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=await 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))}async getHistoryAsync(){let t=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryWithInternalTime(){try{let t=this.store.getItem(mo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}async getHistoryWithInternalTimeAsync(){try{let t=await this.store.getItem(mo);return t?JSON.parse(t):[]}catch{return[]}}setHistory(t){try{this.store.setItem(mo,JSON.stringify(t.slice(0,_g)))}catch{}}clear(){try{this.store.removeItem(mo)}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,Lg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Vg:!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))}};de(Qt,"instance",null);var ha=Qt,Xe=ha;d();c();l();u();d();c();l();u();var yr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${sr}`));d();c();l();u();d();c();l();u();function at(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 q(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 m(y){try{p(n.next(y))}catch(h){a(h)}}function f(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(m,f)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function ba(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function hr(){return typeof document<"u"}function Aa(){try{return typeof localStorage<"u"}catch{return!1}}function Ug(){try{return typeof sessionStorage<"u"}catch{return!1}}function $u(){return Da()&&navigator.cookieEnabled}var Qg=[ae.click,ae.custom,ae.search,ae.view],Bg=(e,t)=>Qg.indexOf(e)!==-1?Object.assign({language:hr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,pn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?Ou(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Ou(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 Ou(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function $g(){return Aa()?localStorage:$u()?new fn:Ug()?sessionStorage:new vr}var fn=class e{getItem(t){return pn.get(`${e.prefix}${t}`)}removeItem(t){pn.erase(`${e.prefix}${t}`)}setItem(t,r,n){pn.set(`${e.prefix}${t}`,r,n)}};fn.prefix="coveo_";var Ca=class{constructor(){this.cookieStorage=new fn}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)}},vr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},go="__coveo.analytics.history",Hg=20,zg=1e3*60,Gg=75,So=class{constructor(t){this.store=t||$g()}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 q(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 q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(go);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(go);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(go,JSON.stringify(t.slice(0,Hg)))}catch{}}clear(){try{this.store.removeItem(go)}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,Gg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>zg:!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 Wg=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Kg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Kg=e=>q(void 0,void 0,void 0,function*(){let t=new So,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),yo,Yg=new Uint8Array(16);function Jg(){if(!yo&&(yo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yo(Yg)}var Xg=/^(?:[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 vo(e){return typeof e=="string"&&Xg.test(e)}var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function Hu(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}function Zg(e){if(!vo(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 ey(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ty="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ry="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ny(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=ey(o)),typeof i=="string"&&(i=Zg(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){m=m||0;for(let y=0;y<16;++y)a[m+y]=p[y];return a}return Hu(p)}try{n.name=e}catch{}return n.DNS=ty,n.URL=ry,n}var oy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Tu={randomUUID:oy};function Bt(e,t,r){if(Tu.randomUUID&&!t&&!e)return Tu.randomUUID();e=e||{};let n=e.random||(e.rng||Jg)();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 Hu(n)}function iy(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 Sa(e,t){return e<<t|e>>>32-t}function ay(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 m=0;m<a.length;++m)e.push(a.charCodeAt(m))}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 m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}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 m=new Uint32Array(80);for(let g=0;g<16;++g)m[g]=i[a][g];for(let g=16;g<80;++g)m[g]=Sa(m[g-3]^m[g-8]^m[g-14]^m[g-16],1);let f=r[0],p=r[1],y=r[2],h=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),x=Sa(f,5)+iy(v,p,y,h)+S+t[v]+m[g]>>>0;S=h,h=y,y=Sa(p,30)>>>0,p=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>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 sy=ny("v5",80,ay),Du=sy,zu="2.30.45",qu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},bo=class{constructor({client:t,uuidGenerator:r=Bt}){this.client=t,this.uuidGenerator=r}},wa=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=qu(window.location),this.lastReferrer=hr()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return 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:hr()?document.title:"",encoding:hr()?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===dn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===dn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===dn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===dn.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 qu(window.location)}},St=class e{constructor(t,r){if(!vo(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 vo(i)?new e(i,Number.parseInt(o)*1e3):null}};St.cvo_cid="cvo_cid";St.expirationTime=120;var Ra=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){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 q(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(St.cvo_cid,new St(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ra.Id="link";var Ue=Object.keys;function ho(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Gu=192,ju=224,Mu=240;function cy(e){return(e&248)===Mu?4:(e&Mu)===ju?3:(e&ju)===Gu?2:1}function uy(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&va)!=va)break;if(r-=3,(n&Gu)!=va){t-r>=cy(n)*3&&(r=t);break}}return e.substring(0,r)}var xa={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"},ly=Ue(xa).map(e=>xa[e]),dy=[...ly].join("|"),py=new RegExp(`^(${dy}$)`),fy={svcAction:"svc_action",svcActionData:"svc_action_data"},my=e=>Ue(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=xa[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),gy=e=>py.test(e),yy=[gy],Nu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},_u={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},Ao={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},hy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Sy={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),Ao),purchase:Object.assign(Object.assign({},Ee),Ao),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},vy=Ue(Nu).map(e=>Nu[e]),by=Ue(_u).map(e=>_u[e]),Ay=Ue(Ee).map(e=>Ee[e]),Cy=Ue(Ao).map(e=>Ao[e]),wy=Ue(Ia).map(e=>Ia[e]),Ry=Ue(Ea).map(e=>Ea[e]),xy=[...vy,"custom"].join("|"),Ey=[...by,"custom"].join("|"),Wu="(pr[0-9]+)",Ku="(il[0-9]+pi[0-9]+)",Iy=new RegExp(`^${Wu}(${xy})$`),ky=new RegExp(`^(${Ku}(${Ey}))|(il[0-9]+nm)$`),Py=new RegExp(`^(${Ay.join("|")})$`),Fy=new RegExp(`^(${Cy.join("|")})$`),Oy=new RegExp(`^${Wu}custom$`),Ty=new RegExp(`^${Ku}custom$`),Dy=new RegExp(`^(${[...hy,...wy,...Ry].join("|")})$`),qy=e=>Iy.test(e),jy=e=>ky.test(e),My=e=>Py.test(e),Ny=e=>Fy.test(e),_y=e=>Dy.test(e),Vy=[jy,qy,My,Ny,_y],Ly=[Oy,Ty],Uy={anonymizeIp:"aip"},Qy={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},By={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},$y=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Hy=Object.assign(Object.assign(Object.assign(Object.assign({},Uy),Qy),By),$y.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ka=Object.assign(Object.assign({},Hy),fy),zy=e=>{let t=!!e.action&&Sy[e.action]||{};return Ue(e).reduce((r,n)=>{let o=t[n]||ka[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Gy=Ue(ka).map(e=>ka[e]),Wy=e=>Gy.indexOf(e)!==-1,Ky=e=>e==="custom",Yy=e=>[...Vy,...yy,Wy,Ky].some(t=>t(e)),Jy=e=>Ue(e).reduce((t,r)=>{let n=Xy(r);return n?Object.assign(Object.assign({},t),Zy(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Xy=e=>{let t;return[...Ly].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Zy=(e,t)=>Ue(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Pa=class{constructor(t){this.opts=t}sendEvent(t,r){return q(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:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),p=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(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:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}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 q(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[ae.click,ae.custom,ae.search,ae.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}},Fa=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},Vu=b.fetch,Co=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:p}=f,y=at(f,["url"]),h;try{h=yield Vu(p,y)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Vu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(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"})}},Oa=class{constructor(t,r){Aa()&&$u()?this.storage=new Ca:Aa()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new vr),this.client=new Co(t),this.beaconClient=new Pa(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}},Ta=class{constructor(t,r){this.storage=r||new vr,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},wo=class{constructor(){this.storage=new vr,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},eh="xx",th=e=>e?.startsWith(eh)||!1,rh=`
|
|
28
28
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
29
29
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
30
30
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|