@coveo/quantic 3.34.0 → 3.34.1
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/force-app/main/default/staticresources/coveobueno/browser/bueno.js +1 -1
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-api-client.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-api-params.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-metadata.d.ts +7 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/product-enrichment/product-enrichment-request.d.ts +29 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/product-enrichment/product-enrichment-response.d.ts +17 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/search/date/date-format.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/interactive-spotlight-content/headless-core-interactive-spotlight-content.d.ts +38 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sub-controller/headless-sub-controller.d.ts +10 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-enrichment/headless-product-enrichment.d.ts +56 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +2 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions-loader.d.ts +28 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions.d.ts +27 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-slice.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-state.d.ts +17 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/spotlight-content/spotlight-content-actions-loaders.d.ts +29 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/spotlight-content/spotlight-content-actions.d.ts +29 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/commerce-app-state.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/state/state-sections.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-product-enrichment.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +12 -12
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +11 -11
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +9 -9
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}/**
|
|
2
2
|
* @license
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
4
|
+
* Copyright 2026 Coveo Solutions Inc.
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,24 +14,24 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,m=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){m=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(m)throw i}}}}function zi(){return zi=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Sm(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},zi.apply(null,arguments)}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sr(e)}function ym(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gi(e,t)}function fc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fc=function(){return!!e})()}function hm(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mm(e)}function Gi(e,t){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Gi(e,t)}function Sm(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=sr(e))!==null;);return e}function vm(e,t,r,n){var o=zi(sr(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Am(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cm(e){var t=Am(e,"string");return typeof t=="symbol"?t:t+""}function bm(e,t){if(e){if(typeof e=="string")return uc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uc(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function wm(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function xm(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var pc=function(){function e(){Wi(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Yi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var g=i[m];try{g.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},m=0,f=i.length;m<f;m++)a();return!r.defaultPrevented}}}])}(),Ki=function(e){function t(){var r;return Wi(this,t),r=gm(this,t),r.listeners||pc.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return ym(t,e),Yi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),vm(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Kn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new Kn;function i(){o.abort(this.reason),a()}function a(){var g=dc(n),h;try{for(g.s();!(h=g.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(y){g.e(y)}finally{g.f()}}var m=dc(n),f;try{for(m.s();!(f=m.n()).done;){var s=f.value;if(s.aborted){o.abort(s.reason);break}else s.addEventListener("abort",i)}}catch(g){m.e(g)}finally{m.f()}return o.signal}}])}(pc),Kn=function(){function e(){Wi(this,e),Object.defineProperty(this,"signal",{value:new Ki,writable:!0,configurable:!0})}return Yi(e,[{key:"abort",value:function(r){var n=xm(r),o=wm(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Kn.prototype[Symbol.toStringTag]="AbortController",Ki.prototype[Symbol.toStringTag]="AbortSignal");function Rm(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Em(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,m=a===void 0?!1:a;if(!Rm({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:m}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||m)&&(f=function(S,y){var b;y&&y.signal&&(b=y.signal,delete y.signal);var R=new o(S,y);return b&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),R},f.prototype=o.prototype);var s=r,g=function(S,y){var b=f&&f.prototype.isPrototypeOf(S)?S.signal:y?y.signal:void 0;if(b){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(b.aborted)return Promise.reject(R);var F=new Promise(function(x,I){b.addEventListener("abort",function(){return I(R)},{once:!0})});return y&&y.signal&&delete y.signal,Promise.race([F,s(S,y)])}return s(S,y)};return{fetch:g,Request:f}}nn.AbortController=Kn;nn.AbortSignal=Ki;nn.abortableFetch=Em});var mc,c,v,d=rn(()=>{"use strict";mc=Wn(Ji(),1),c=Wn(Ji(),1),{fetch:v}=(0,mc.abortableFetch)({fetch})});function on(e){if(Nm.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Xi(e){return e.replace(jm,"")}function an(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!_m(r))return!1}return!0}function _m(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function yc(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Im,Cc,Fm,bc,Pm,km,Om,Tm,Dm,qm,Mm,Nm,gc,jm,cr,Zi,hc,Sc,vc,Ac,C,xc=rn(()=>{"use strict";p();u();d();l();Im=Object.create,Cc=Object.defineProperty,Fm=Object.getOwnPropertyDescriptor,bc=Object.getOwnPropertyNames,Pm=Object.getPrototypeOf,km=Object.prototype.hasOwnProperty,Om=(e,t)=>function(){return t||(0,e[bc(e)[0]])((t={exports:{}}).exports,t),t.exports},Tm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bc(t))!km.call(e,o)&&o!==r&&Cc(e,o,{get:()=>t[o],enumerable:!(n=Fm(t,o))||n.enumerable});return e},Dm=(e,t,r)=>(r=e!=null?Im(Pm(e)):{},Tm(t||!e||!e.__esModule?Cc(r,"default",{value:e,enumerable:!0}):r,e)),qm=Om({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,s){var g=f.split(";").filter(n),h=g.shift(),S=i(h),y=S.name,b=S.value;s=s?Object.assign({},r,s):r;try{b=s.decodeValues?decodeURIComponent(b):b}catch(F){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+b+"'. Set options.decodeValues to false to disable this feature.",F)}var R={name:y,value:b};return g.forEach(function(F){var x=F.split("="),I=x.shift().trimLeft().toLowerCase(),w=x.join("=");I==="expires"?R.expires=new Date(w):I==="max-age"?R.maxAge=parseInt(w,10):I==="secure"?R.secure=!0:I==="httponly"?R.httpOnly=!0:I==="samesite"?R.sameSite=w:R[I]=w}),R}function i(f){var s="",g="",h=f.split("=");return h.length>1?(s=h.shift(),g=h.join("=")):g=f,{name:s,value:g}}function a(f,s){if(s=s?Object.assign({},r,s):r,!f)return s.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!s.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),s=s?Object.assign({},r,s):r,s.map){var h={};return f.filter(n).reduce(function(S,y){var b=o(y,s);return S[b.name]=b,S},h)}else return f.filter(n).map(function(S){return o(S,s)})}function m(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var s=[],g=0,h,S,y,b,R;function F(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function x(){return S=f.charAt(g),S!=="="&&S!==";"&&S!==","}for(;g<f.length;){for(h=g,R=!1;F();)if(S=f.charAt(g),S===","){for(y=g,g+=1,F(),b=g;g<f.length&&x();)g+=1;g<f.length&&f.charAt(g)==="="?(R=!0,g=b,s.push(f.substring(h,y)),h=g):g=y+1}else g+=1;(!R||g>=f.length)&&s.push(f.substring(h,f.length))}return s}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=m}}),Mm=Dm(qm()),Nm=/[^a-z0-9\-#$%&'*+.^_`|~]/i;gc=[`
|
|
19
|
-
`,"\r","\t"," "],jm=new RegExp(`(^[${gc.join("")}]|$[${gc.join("")}])`,"g");cr=Symbol("normalizedHeaders"),Zi=Symbol("rawHeaderNames"),hc=", ",C=class wc{constructor(t){this[Sc]={},this[vc]=new Map,this[Ac]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof wc||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(hc):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(hc):n)})}[(Sc=cr,vc=Zi,Ac=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[cr]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!an(t))throw new TypeError(`Invalid header name "${t}"`);return this[cr].hasOwnProperty(on(t))}get(t){if(!an(t))throw TypeError(`Invalid header name "${t}"`);return this[cr][on(t)]??null}set(t,r){if(!an(t)||!yc(r))return;let n=on(t),o=Xi(r);this[cr][n]=Xi(o),this[Zi].set(n,t)}append(t,r){if(!an(t)||!yc(r))return;let n=on(t),o=Xi(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!an(t)||!this.has(t))return;let r=on(t);delete this[cr][r],this[Zi].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,Mm.splitCookiesString)(t)}}});var p=rn(()=>{"use strict";xc()});var Tc=Ue(un=>{"use strict";p();u();d();l();var eo=un&&un.__assign||function(){return eo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},eo.apply(this,arguments)};Object.defineProperty(un,"__esModule",{value:!0});var Gm={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Wm(e){var t=eo(eo({},Gm),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}un.getSanitizedOptions=Wm});var Dc=Ue(na=>{"use strict";p();u();d();l();Object.defineProperty(na,"__esModule",{value:!0});function Ym(e){var t=Math.random()*e;return Math.round(t)}na.fullJitter=Ym});var qc=Ue(oa=>{"use strict";p();u();d();l();Object.defineProperty(oa,"__esModule",{value:!0});function Km(e){return e}oa.noJitter=Km});var Mc=Ue(ia=>{"use strict";p();u();d();l();Object.defineProperty(ia,"__esModule",{value:!0});var Jm=Dc(),Xm=qc();function Zm(e){switch(e.jitter){case"full":return Jm.fullJitter;case"none":default:return Xm.noJitter}}ia.JitterFactory=Zm});var sa=Ue(aa=>{"use strict";p();u();d();l();Object.defineProperty(aa,"__esModule",{value:!0});var eg=Mc(),tg=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=eg.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();aa.Delay=tg});var Nc=Ue(it=>{"use strict";p();u();d();l();var rg=it&&it.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ng=it&&it.__awaiter||function(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(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})},og=it&&it.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(s){return function(g){return f([s,g])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(g){s=[6,g],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(it,"__esModule",{value:!0});var ig=sa(),ag=function(e){rg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return ng(this,void 0,void 0,function(){return og(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(ig.Delay);it.SkipFirstDelay=ag});var jc=Ue(ln=>{"use strict";p();u();d();l();var sg=ln&&ln.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ln,"__esModule",{value:!0});var cg=sa(),ug=function(e){sg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(cg.Delay);ln.AlwaysDelay=ug});var _c=Ue(ca=>{"use strict";p();u();d();l();Object.defineProperty(ca,"__esModule",{value:!0});var lg=Nc(),dg=jc();function pg(e,t){var r=fg(e);return r.setAttemptNumber(t),r}ca.DelayFactory=pg;function fg(e){return e.delayFirstAttempt?new dg.AlwaysDelay(e):new lg.SkipFirstDelay(e)}});var Vc=Ue(Qt=>{"use strict";p();u();d();l();var ua=Qt&&Qt.__awaiter||function(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(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})},la=Qt&&Qt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(s){return function(g){return f([s,g])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(g){s=[6,g],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(Qt,"__esModule",{value:!0});var mg=Tc(),gg=_c();function yg(e,t){return t===void 0&&(t={}),ua(this,void 0,void 0,function(){var r,n;return la(this,function(o){switch(o.label){case 0:return r=mg.getSanitizedOptions(t),n=new hg(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Qt.backOff=yg;var hg=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ua(this,void 0,void 0,function(){var t,r;return la(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return ua(this,void 0,void 0,function(){var t;return la(this,function(r){switch(r.label){case 0:return t=gg.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Up=Ue((SQ,Lp)=>{"use strict";p();u();d();l();function iC(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Lp.exports=aC;function aC(e,t,r){var n=r&&r.stringify||iC,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var m=1;m<i;m++)a[m]=n(t[m]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var s="",g=1-o,h=-1,S=e&&e.length||0,y=0;y<S;){if(e.charCodeAt(y)===37&&y+1<S){switch(h=h>-1?h:0,e.charCodeAt(y+1)){case 100:case 102:if(g>=f||t[g]==null)break;h<y&&(s+=e.slice(h,y)),s+=Number(t[g]),h=y+2,y++;break;case 105:if(g>=f||t[g]==null)break;h<y&&(s+=e.slice(h,y)),s+=Math.floor(Number(t[g])),h=y+2,y++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;h<y&&(s+=e.slice(h,y));var b=typeof t[g];if(b==="string"){s+="'"+t[g]+"'",h=y+2,y++;break}if(b==="function"){s+=t[g].name||"<anonymous>",h=y+2,y++;break}s+=n(t[g]),h=y+2,y++;break;case 115:if(g>=f)break;h<y&&(s+=e.slice(h,y)),s+=String(t[g]),h=y+2,y++;break;case 37:h<y&&(s+=e.slice(h,y)),s+="%",h=y+2,y++,g--;break}++g}++y}return h===-1?e:(h<S&&(s+=e.slice(h)),s)}});var Gp=Ue((wQ,yi)=>{"use strict";p();u();d();l();var Qp=Up();yi.exports=mt;var Un=CC().console||{},sC={mapHttpRequest:gi,mapHttpResponse:gi,wrapRequestSerializer:Bs,wrapResponseSerializer:Bs,wrapErrorSerializer:Bs,req:gi,res:gi,err:$p,errWithCause:$p};function qt(e,t){return e==="silent"?1/0:t.levels.values[e]}var zs=Symbol("pino.logFuncs"),$s=Symbol("pino.hierarchy"),cC={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Bp(e,t){let r={logger:t,parent:e[$s]};t[$s]=r}function uC(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Un[o]||Un[cC[o]||"log"]||zr}),e[zs]=n}function lC(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function mt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Un;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=lC(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&m.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",s=Object.create(r);s.log||(s.log=zr),uC(s,m,r),Bp({},s),Object.defineProperty(s,"levelVal",{get:h}),Object.defineProperty(s,"level",{get:S,set:y});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:m,timestamp:SC(e),messageKey:e.messageKey||"msg",onChild:e.onChild||zr};s.levels=dC(e),s.level=f,s.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},s.setMaxListeners=s.getMaxListeners=s.emit=s.addListener=s.on=s.prependListener=s.once=s.prependOnceListener=s.removeListener=s.removeAllListeners=s.listeners=s.listenerCount=s.eventNames=s.write=s.flush=zr,s.serializers=n,s._serialize=o,s._stdErrSerialize=i,s.child=function(...R){return b.call(this,g,...R)},t&&(s._logEvent=Hs());function h(){return qt(this.level,this)}function S(){return this._level}function y(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,nr(this,g,s,"error"),nr(this,g,s,"fatal"),nr(this,g,s,"warn"),nr(this,g,s,"info"),nr(this,g,s,"debug"),nr(this,g,s,"trace"),a.forEach(F=>{nr(this,g,s,F)})}function b(R,F,x){if(!F)throw new Error("missing bindings for child Pino");x=x||{},o&&F.serializers&&(x.serializers=F.serializers);let I=x.serializers;if(o&&I){var w=Object.assign({},n,I),E=e.browser.serialize===!0?Object.keys(w):o;delete F.serializers,Gs([F],E,w,this._stdErrSerialize)}function M(P){this._childLevel=(P._childLevel|0)+1,this.bindings=F,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=Hs([].concat(P._logEvent.bindings,F)))}M.prototype=this;let k=new M(this);return Bp(this,k),k.child=function(...P){return b.call(this,R,...P)},k.level=x.level||this.level,R.onChild(k),k}return s}function dC(e){let t=e.customLevels||{},r=Object.assign({},mt.levels.values,t),n=Object.assign({},mt.levels.labels,pC(t));return{values:r,labels:n}}function pC(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}mt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};mt.stdSerializers=sC;mt.stdTimeFunctions=Object.assign({},{nullTime:Hp,epochTime:zp,unixTime:vC,isoTime:AC});function fC(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[$s];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function nr(e,t,r,n){if(Object.defineProperty(e,n,{value:qt(e.level,r)>qt(n,r)?zr:r[zs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===zr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=qt(i,r);if(qt(n,r)<a)return}e[n]=gC(e,t,r,n);let o=fC(e);o.length!==0&&(e[n]=mC(o,e[n]))}function mC(e,t){return function(){return t.apply(this,[...e,...arguments])}}function gC(e,t,r,n){return function(o){return function(){let a=t.timestamp(),m=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Un?Un:this;for(var s=0;s<m.length;s++)m[s]=arguments[s];var g=!1;if(t.serialize&&(Gs(m,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...yC(this,n,m,a,t)):o.apply(f,m),t.transmit){let h=t.transmit.level||e._level,S=qt(h,r),y=qt(n,r);if(y<S)return;hC(this,{ts:a,methodLevel:n,methodValue:y,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:qt(e._level,r)},m,g)}}}(e[zs][n])}function yC(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},m=r.slice(),f=m[0],s={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(s.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(s,h)}else s.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof m[0]=="object";)Object.assign(s,m.shift());return[a(s),...m]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof m[0]=="object";)Object.assign(s,m.shift());f=m.length?Qp(m.shift(),m):void 0}else typeof f=="string"&&(f=Qp(m.shift(),m));return f!==void 0&&(s[o.messageKey]=f),[a(s)]}}function Gs(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=mt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function hC(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,m=t.methodValue,f=t.val,s=e._logEvent.bindings;n||Gs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(g){return s.indexOf(g)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=m,o(a,e._logEvent,f),e._logEvent=Hs(s)}function Hs(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function $p(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function SC(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Hp:zp}function gi(){return{}}function Bs(e){return e}function zr(){}function Hp(){return!1}function zp(){return Date.now()}function vC(){return Math.round(Date.now()/1e3)}function AC(){return new Date(Date.now()).toISOString()}function CC(){function e(t){return typeof t<"u"&&t}try{return typeof A<"u"?A:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),A)}catch{return e(self)||e(window)||e(this)||{}}}yi.exports.default=mt;yi.exports.pino=mt});var Db={};sc(Db,{DefaultFieldsToInclude:()=>ic,EcommerceDefaultFieldsToInclude:()=>Jf,HighlightUtils:()=>ra,MinimumFieldsToInclude:()=>Qi,ResultTemplatesHelpers:()=>Kd,buildContext:()=>nf,buildController:()=>Mt,buildDictionaryFieldContext:()=>of,buildInteractiveResult:()=>Gf,buildRecommendationEngine:()=>ef,buildRecommendationList:()=>Hf,buildResultTemplatesManager:()=>em,getAnalyticsNextApiBaseUrl:()=>to,getOrganizationEndpoint:()=>Ie,getSampleRecommendationEngineConfiguration:()=>Ws,loadAdvancedSearchQueryActions:()=>Sb,loadClickAnalyticsActions:()=>Pb,loadConfigurationActions:()=>vb,loadContextActions:()=>Cb,loadDebugActions:()=>bb,loadDictionaryFieldContextActions:()=>wb,loadFieldActions:()=>Eb,loadPaginationActions:()=>oc,loadPipelineActions:()=>Ib,loadRecommendationActions:()=>Fb,loadSearchConfigurationActions:()=>Ab,loadSearchHubActions:()=>Tb});module.exports=um(Db);p();u();d();l();var ra={};sc(ra,{escapeHtml:()=>ur,getHighlightedSuggestion:()=>zm,highlightString:()=>Hm});p();u();d();l();p();u();d();l();function Vm(e,t){let r=`
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var Pf=Object.create;var Br=Object.defineProperty;var Ff=Object.getOwnPropertyDescriptor;var Of=Object.getOwnPropertyNames;var Tf=Object.getPrototypeOf,Df=Object.prototype.hasOwnProperty;var qf=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var $r=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ys=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})},Js=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Of(t))!Df.call(e,o)&&o!==r&&Br(e,o,{get:()=>t[o],enumerable:!(n=Ff(t,o))||n.enumerable});return e};var Be=(e,t,r)=>(r=e!=null?Pf(Tf(e)):{},Js(t||!e||!e.__esModule?Br(r,"default",{value:e,enumerable:!0}):r,e)),jf=e=>Js(Br({},"__esModule",{value:!0}),e);var de=(e,t,r)=>qf(e,typeof t!="symbol"?t+"":t,r);var A,c=$r(()=>{"use strict";A=typeof globalThis<"u"?globalThis:window});function Dn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Dn=function(t){return typeof t}:Dn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(e)}function _f(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Vf.bind(this))}function Vf(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),Mf(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):Nf(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var Mf,Nf,u=$r(()=>{"use strict";Mf=function(t){return typeof t=="string"},Nf=function(t){return t instanceof Blob};_f.call((typeof window>"u"?"undefined":Dn(window))==="object"?window:{})});var Mi=Se(Hr=>{"use strict";d();c();l();u();Object.defineProperty(Hr,"__esModule",{value:!0});function Xs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Lf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uf(e,t,r){return t=Jt(t),Bf(e,rc()?Reflect.construct(t,r||[],Jt(e).constructor):t.apply(e,r))}function Di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gf(n.key),n)}}function qi(e,t,r){return t&&Zs(e.prototype,t),r&&Zs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ec(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Wf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,m=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){m=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(m)throw i}}}}function Oi(){return Oi=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=$f(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Oi.apply(null,arguments)}function Jt(e){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(e)}function Qf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ti(e,t)}function rc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rc=function(){return!!e})()}function Bf(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lf(e)}function Ti(e,t){return Ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ti(e,t)}function $f(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Jt(e))!==null;);return e}function Hf(e,t,r,n){var o=Oi(Jt(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function zf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gf(e){var t=zf(e,"string");return typeof t=="symbol"?t:t+""}function Wf(e,t){if(e){if(typeof e=="string")return Xs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xs(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Kf(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function Yf(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var tc=function(){function e(){Di(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return qi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var y=i[m];try{y.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}y.options&&y.options.once&&n.removeEventListener(r.type,y.callback)},m=0,f=i.length;m<f;m++)a();return!r.defaultPrevented}}}])}(),ji=function(e){function t(){var r;return Di(this,t),r=Uf(this,t),r.listeners||tc.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return Qf(t,e),qi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),Hf(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new qn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new qn;function i(){o.abort(this.reason),a()}function a(){var y=ec(n),h;try{for(y.s();!(h=y.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(g){y.e(g)}finally{y.f()}}var m=ec(n),f;try{for(m.s();!(f=m.n()).done;){var p=f.value;if(p.aborted){o.abort(p.reason);break}else p.addEventListener("abort",i)}}catch(y){m.e(y)}finally{m.f()}return o.signal}}])}(tc),qn=function(){function e(){Di(this,e),Object.defineProperty(this,"signal",{value:new ji,writable:!0,configurable:!0})}return qi(e,[{key:"abort",value:function(r){var n=Yf(r),o=Kf(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(qn.prototype[Symbol.toStringTag]="AbortController",ji.prototype[Symbol.toStringTag]="AbortSignal");function Jf(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Xf(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,m=a===void 0?!1:a;if(!Jf({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:m}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||m)&&(f=function(S,g){var v;g&&g.signal&&(v=g.signal,delete g.signal);var R=new o(S,g);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},f.prototype=o.prototype);var p=r,y=function(S,g){var v=f&&f.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(v){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(v.aborted)return Promise.reject(R);var k=new Promise(function(x,F){v.addEventListener("abort",function(){return F(R)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([k,p(S,g)])}return p(S,g)};return{fetch:y,Request:f}}Hr.AbortController=qn;Hr.AbortSignal=ji;Hr.abortableFetch=Xf});var nc,s,b,l=$r(()=>{"use strict";nc=Be(Mi(),1),s=Be(Mi(),1),{fetch:b}=(0,nc.abortableFetch)({fetch})});function zr(e){if(cm.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Ni(e){return e.replace(um,"")}function Gr(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!lm(r))return!1}return!0}function lm(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function ic(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Zf,lc,em,dc,tm,rm,nm,om,im,am,sm,cm,oc,um,Xt,_i,ac,sc,cc,uc,C,fc=$r(()=>{"use strict";d();c();l();u();Zf=Object.create,lc=Object.defineProperty,em=Object.getOwnPropertyDescriptor,dc=Object.getOwnPropertyNames,tm=Object.getPrototypeOf,rm=Object.prototype.hasOwnProperty,nm=(e,t)=>function(){return t||(0,e[dc(e)[0]])((t={exports:{}}).exports,t),t.exports},om=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dc(t))!rm.call(e,o)&&o!==r&&lc(e,o,{get:()=>t[o],enumerable:!(n=em(t,o))||n.enumerable});return e},im=(e,t,r)=>(r=e!=null?Zf(tm(e)):{},om(t||!e||!e.__esModule?lc(r,"default",{value:e,enumerable:!0}):r,e)),am=nm({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,p){var y=f.split(";").filter(n),h=y.shift(),S=i(h),g=S.name,v=S.value;p=p?Object.assign({},r,p):r;try{v=p.decodeValues?decodeURIComponent(v):v}catch(k){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",k)}var R={name:g,value:v};return y.forEach(function(k){var x=k.split("="),F=x.shift().trimLeft().toLowerCase(),w=x.join("=");F==="expires"?R.expires=new Date(w):F==="max-age"?R.maxAge=parseInt(w,10):F==="secure"?R.secure=!0:F==="httponly"?R.httpOnly=!0:F==="samesite"?R.sameSite=w:R[F]=w}),R}function i(f){var p="",y="",h=f.split("=");return h.length>1?(p=h.shift(),y=h.join("=")):y=f,{name:p,value:y}}function a(f,p){if(p=p?Object.assign({},r,p):r,!f)return p.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var y=f.headers[Object.keys(f.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!y&&f.headers.cookie&&!p.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=y}if(Array.isArray(f)||(f=[f]),p=p?Object.assign({},r,p):r,p.map){var h={};return f.filter(n).reduce(function(S,g){var v=o(g,p);return S[v.name]=v,S},h)}else return f.filter(n).map(function(S){return o(S,p)})}function m(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var p=[],y=0,h,S,g,v,R;function k(){for(;y<f.length&&/\s/.test(f.charAt(y));)y+=1;return y<f.length}function x(){return S=f.charAt(y),S!=="="&&S!==";"&&S!==","}for(;y<f.length;){for(h=y,R=!1;k();)if(S=f.charAt(y),S===","){for(g=y,y+=1,k(),v=y;y<f.length&&x();)y+=1;y<f.length&&f.charAt(y)==="="?(R=!0,y=v,p.push(f.substring(h,g)),h=y):y=g+1}else y+=1;(!R||y>=f.length)&&p.push(f.substring(h,f.length))}return p}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=m}}),sm=im(am()),cm=/[^a-z0-9\-#$%&'*+.^_`|~]/i;oc=[`
|
|
19
|
+
`,"\r","\t"," "],um=new RegExp(`(^[${oc.join("")}]|$[${oc.join("")}])`,"g");Xt=Symbol("normalizedHeaders"),_i=Symbol("rawHeaderNames"),ac=", ",C=class pc{constructor(t){this[sc]={},this[cc]=new Map,this[uc]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof pc||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(ac):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ac):n)})}[(sc=Xt,cc=_i,uc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Xt]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Gr(t))throw new TypeError(`Invalid header name "${t}"`);return this[Xt].hasOwnProperty(zr(t))}get(t){if(!Gr(t))throw TypeError(`Invalid header name "${t}"`);return this[Xt][zr(t)]??null}set(t,r){if(!Gr(t)||!ic(r))return;let n=zr(t),o=Ni(r);this[Xt][n]=Ni(o),this[_i].set(n,t)}append(t,r){if(!Gr(t)||!ic(r))return;let n=zr(t),o=Ni(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Gr(t)||!this.has(t))return;let r=zr(t);delete this[Xt][r],this[_i].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,sm.splitCookiesString)(t)}}});var d=$r(()=>{"use strict";fc()});var bc=Se(Yr=>{"use strict";d();c();l();u();var _n=Yr&&Yr.__assign||function(){return _n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},_n.apply(this,arguments)};Object.defineProperty(Yr,"__esModule",{value:!0});var vm={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Am(e){var t=_n(_n({},vm),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Yr.getSanitizedOptions=Am});var Cc=Se(Qi=>{"use strict";d();c();l();u();Object.defineProperty(Qi,"__esModule",{value:!0});function bm(e){var t=Math.random()*e;return Math.round(t)}Qi.fullJitter=bm});var wc=Se(Bi=>{"use strict";d();c();l();u();Object.defineProperty(Bi,"__esModule",{value:!0});function Cm(e){return e}Bi.noJitter=Cm});var xc=Se($i=>{"use strict";d();c();l();u();Object.defineProperty($i,"__esModule",{value:!0});var wm=Cc(),xm=wc();function Rm(e){switch(e.jitter){case"full":return wm.fullJitter;case"none":default:return xm.noJitter}}$i.JitterFactory=Rm});var zi=Se(Hi=>{"use strict";d();c();l();u();Object.defineProperty(Hi,"__esModule",{value:!0});var Em=xc(),Im=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=Em.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Hi.Delay=Im});var Rc=Se(tt=>{"use strict";d();c();l();u();var km=tt&&tt.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pm=tt&&tt.__awaiter||function(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())})},Fm=tt&&tt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(p){return function(y){return f([p,y])}}function f(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(y){p=[6,y],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(tt,"__esModule",{value:!0});var Om=zi(),Tm=function(e){km(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return Pm(this,void 0,void 0,function(){return Fm(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(Om.Delay);tt.SkipFirstDelay=Tm});var Ec=Se(Jr=>{"use strict";d();c();l();u();var Dm=Jr&&Jr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jr,"__esModule",{value:!0});var qm=zi(),jm=function(e){Dm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(qm.Delay);Jr.AlwaysDelay=jm});var Ic=Se(Gi=>{"use strict";d();c();l();u();Object.defineProperty(Gi,"__esModule",{value:!0});var Mm=Rc(),Nm=Ec();function _m(e,t){var r=Vm(e);return r.setAttemptNumber(t),r}Gi.DelayFactory=_m;function Vm(e){return e.delayFirstAttempt?new Nm.AlwaysDelay(e):new Mm.SkipFirstDelay(e)}});var kc=Se(qt=>{"use strict";d();c();l();u();var Wi=qt&&qt.__awaiter||function(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())})},Ki=qt&&qt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(p){return function(y){return f([p,y])}}function f(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(y){p=[6,y],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(qt,"__esModule",{value:!0});var Lm=bc(),Um=Ic();function Qm(e,t){return t===void 0&&(t={}),Wi(this,void 0,void 0,function(){var r,n;return Ki(this,function(o){switch(o.label){case 0:return r=Lm.getSanitizedOptions(t),n=new Bm(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}qt.backOff=Qm;var Bm=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Wi(this,void 0,void 0,function(){var t,r;return Ki(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Wi(this,void 0,void 0,function(){var t;return Ki(this,function(r){switch(r.label){case 0:return t=Um.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Go=Se((is,as)=>{"use strict";d();c();l();u();(function(e,t){typeof is=="object"&&typeof as<"u"?as.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs=t()})(is,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",m="day",f="week",p="month",y="quarter",h="year",S="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(U){var V=["th","st","nd","rd"],_=U%100;return"["+U+(V[(_-20)%10]||V[_]||V[0])+"]"}},x=function(U,V,_){var B=String(U);return!B||B.length>=V?U:""+Array(V+1-B.length).join(_)+U},F={s:x,z:function(U){var V=-U.utcOffset(),_=Math.abs(V),B=Math.floor(_/60),L=_%60;return(V<=0?"+":"-")+x(B,2,"0")+":"+x(L,2,"0")},m:function U(V,_){if(V.date()<_.date())return-U(_,V);var B=12*(_.year()-V.year())+(_.month()-V.month()),L=V.clone().add(B,p),z=_-L<0,G=V.clone().add(B+(z?-1:1),p);return+(-(B+(_-L)/(z?L-G:G-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:p,y:h,w:f,d:m,D:S,h:a,m:i,s:o,ms:n,Q:y}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",E={};E[w]=k;var M="$isDayjsObject",O=function(U){return U instanceof N||!(!U||!U[M])},I=function U(V,_,B){var L;if(!V)return w;if(typeof V=="string"){var z=V.toLowerCase();E[z]&&(L=z),_&&(E[z]=_,L=z);var G=V.split("-");if(!L&&G.length>1)return U(G[0])}else{var Y=V.name;E[Y]=V,L=Y}return!B&&L&&(w=L),L||!B&&w},P=function(U,V){if(O(U))return U.clone();var _=typeof V=="object"?V:{};return _.date=U,_.args=arguments,new N(_)},D=F;D.l=I,D.i=O,D.w=function(U,V){return P(U,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var N=function(){function U(_){this.$L=I(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[M]=!0}var V=U.prototype;return V.parse=function(_){this.$d=function(B){var L=B.date,z=B.utc;if(L===null)return new Date(NaN);if(D.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var G=L.match(v);if(G){var Y=G[2]-1||0,te=(G[7]||"0").substring(0,3);return z?new Date(Date.UTC(G[1],Y,G[3]||1,G[4]||0,G[5]||0,G[6]||0,te)):new Date(G[1],Y,G[3]||1,G[4]||0,G[5]||0,G[6]||0,te)}}return new Date(L)}(_),this.init()},V.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},V.$utils=function(){return D},V.isValid=function(){return this.$d.toString()!==g},V.isSame=function(_,B){var L=P(_);return this.startOf(B)<=L&&L<=this.endOf(B)},V.isAfter=function(_,B){return P(_)<this.startOf(B)},V.isBefore=function(_,B){return this.endOf(B)<P(_)},V.$g=function(_,B,L){return D.u(_)?this[B]:this.set(L,_)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(_,B){var L=this,z=!!D.u(B)||B,G=D.p(_),Y=function(ce,fe){var he=D.w(L.$u?Date.UTC(L.$y,fe,ce):new Date(L.$y,fe,ce),L);return z?he:he.endOf(m)},te=function(ce,fe){return D.w(L.toDate()[ce].apply(L.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(fe)),L)},se=this.$W,ee=this.$M,re=this.$D,Z="set"+(this.$u?"UTC":"");switch(G){case h:return z?Y(1,0):Y(31,11);case p:return z?Y(1,ee):Y(0,ee+1);case f:var oe=this.$locale().weekStart||0,ge=(se<oe?se+7:se)-oe;return Y(z?re-ge:re+(6-ge),ee);case m:case S:return te(Z+"Hours",0);case a:return te(Z+"Minutes",1);case i:return te(Z+"Seconds",2);case o:return te(Z+"Milliseconds",3);default:return this.clone()}},V.endOf=function(_){return this.startOf(_,!1)},V.$set=function(_,B){var L,z=D.p(_),G="set"+(this.$u?"UTC":""),Y=(L={},L[m]=G+"Date",L[S]=G+"Date",L[p]=G+"Month",L[h]=G+"FullYear",L[a]=G+"Hours",L[i]=G+"Minutes",L[o]=G+"Seconds",L[n]=G+"Milliseconds",L)[z],te=z===m?this.$D+(B-this.$W):B;if(z===p||z===h){var se=this.clone().set(S,1);se.$d[Y](te),se.init(),this.$d=se.set(S,Math.min(this.$D,se.daysInMonth())).$d}else Y&&this.$d[Y](te);return this.init(),this},V.set=function(_,B){return this.clone().$set(_,B)},V.get=function(_){return this[D.p(_)]()},V.add=function(_,B){var L,z=this;_=Number(_);var G=D.p(B),Y=function(ee){var re=P(z);return D.w(re.date(re.date()+Math.round(ee*_)),z)};if(G===p)return this.set(p,this.$M+_);if(G===h)return this.set(h,this.$y+_);if(G===m)return Y(1);if(G===f)return Y(7);var te=(L={},L[i]=t,L[a]=r,L[o]=e,L)[G]||1,se=this.$d.getTime()+_*te;return D.w(se,this)},V.subtract=function(_,B){return this.add(-1*_,B)},V.format=function(_){var B=this,L=this.$locale();if(!this.isValid())return L.invalidDate||g;var z=_||"YYYY-MM-DDTHH:mm:ssZ",G=D.z(this),Y=this.$H,te=this.$m,se=this.$M,ee=L.weekdays,re=L.months,Z=L.meridiem,oe=function(fe,he,Fe,_e){return fe&&(fe[he]||fe(B,z))||Fe[he].slice(0,_e)},ge=function(fe){return D.s(Y%12||12,fe,"0")},ce=Z||function(fe,he,Fe){var _e=fe<12?"AM":"PM";return Fe?_e.toLowerCase():_e};return z.replace(R,function(fe,he){return he||function(Fe){switch(Fe){case"YY":return String(B.$y).slice(-2);case"YYYY":return D.s(B.$y,4,"0");case"M":return se+1;case"MM":return D.s(se+1,2,"0");case"MMM":return oe(L.monthsShort,se,re,3);case"MMMM":return oe(re,se);case"D":return B.$D;case"DD":return D.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return oe(L.weekdaysMin,B.$W,ee,2);case"ddd":return oe(L.weekdaysShort,B.$W,ee,3);case"dddd":return ee[B.$W];case"H":return String(Y);case"HH":return D.s(Y,2,"0");case"h":return ge(1);case"hh":return ge(2);case"a":return ce(Y,te,!0);case"A":return ce(Y,te,!1);case"m":return String(te);case"mm":return D.s(te,2,"0");case"s":return String(B.$s);case"ss":return D.s(B.$s,2,"0");case"SSS":return D.s(B.$ms,3,"0");case"Z":return G}return null}(fe)||G.replace(":","")})},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(_,B,L){var z,G=this,Y=D.p(B),te=P(_),se=(te.utcOffset()-this.utcOffset())*t,ee=this-te,re=function(){return D.m(G,te)};switch(Y){case h:z=re()/12;break;case p:z=re();break;case y:z=re()/3;break;case f:z=(ee-se)/6048e5;break;case m:z=(ee-se)/864e5;break;case a:z=ee/r;break;case i:z=ee/t;break;case o:z=ee/e;break;default:z=ee}return L?z:D.a(z)},V.daysInMonth=function(){return this.endOf(p).$D},V.$locale=function(){return E[this.$L]},V.locale=function(_,B){if(!_)return this.$L;var L=this.clone(),z=I(_,B,!0);return z&&(L.$L=z),L},V.clone=function(){return D.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},U}(),$=N.prototype;return P.prototype=$,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",m],["$M",p],["$y",h],["$D",S]].forEach(function(U){$[U[1]]=function(V){return this.$g(V,U[0],U[1])}}),P.extend=function(U,V){return U.$i||(U(V,N,P),U.$i=!0),P},P.locale=I,P.isDayjs=O,P.unix=function(U){return P(1e3*U)},P.en=E[w],P.Ls=E,P.p={},P})});var nd=Se((ss,cs)=>{"use strict";d();c();l();u();(function(e,t){typeof ss=="object"&&typeof cs<"u"?cs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_quarterOfYear=t()})(ss,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var i=o.add;o.add=function(m,f){return m=Number(m),this.$utils().p(f)===t?this.add(3*m,e):i.bind(this)(m,f)};var a=o.startOf;o.startOf=function(m,f){var p=this.$utils(),y=!!p.u(f)||f;if(p.p(m)===t){var h=this.quarter()-1;return y?this.month(3*h).startOf(e).startOf("day"):this.month(3*h+2).endOf(e).endOf("day")}return a.bind(this)(m,f)}}})});var od=Se((us,ls)=>{"use strict";d();c();l();u();(function(e,t){typeof us=="object"&&typeof ls<"u"?ls.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_customParseFormat=t()})(us,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},m=function(v){return(v=+v)+(v>68?1900:2e3)},f=function(v){return function(R){this[v]=+R}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var k=R.match(/([+-]|\d\d)/g),x=60*k[1]+(+k[2]||0);return x===0?0:k[0]==="+"?-x:x}(v)}],y=function(v){var R=a[v];return R&&(R.indexOf?R:R.s.concat(R.f))},h=function(v,R){var k,x=a.meridiem;if(x){for(var F=1;F<=24;F+=1)if(v.indexOf(x(F,0,R))>-1){k=F>12;break}}else k=v===(R?"pm":"PM");return k},S={A:[i,function(v){this.afternoon=h(v,!1)}],a:[i,function(v){this.afternoon=h(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[n,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[i,function(v){var R=a.ordinal,k=v.match(/\d+/);if(this.day=k[0],R)for(var x=1;x<=31;x+=1)R(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[i,function(v){var R=y("months"),k=(y("monthsShort")||R.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(k<1)throw new Error;this.month=k%12||k}],MMMM:[i,function(v){var R=y("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(v){this.year=m(v)}],YYYY:[/\d{4}/,f("year")],Z:p,ZZ:p};function g(v){var R,k;R=v,k=a&&a.formats;for(var x=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,D,N){var $=N&&N.toUpperCase();return D||k[N]||e[N]||k[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,V,_){return V||_.slice(1)})})).match(t),F=x.length,w=0;w<F;w+=1){var E=x[w],M=S[E],O=M&&M[0],I=M&&M[1];x[w]=I?{regex:O,parser:I}:E.replace(/^\[|\]$/g,"")}return function(P){for(var D={},N=0,$=0;N<F;N+=1){var U=x[N];if(typeof U=="string")$+=U.length;else{var V=U.regex,_=U.parser,B=P.slice($),L=V.exec(B)[0];_.call(D,L),P=P.replace(L,"")}}return function(z){var G=z.afternoon;if(G!==void 0){var Y=z.hours;G?Y<12&&(z.hours+=12):Y===12&&(z.hours=0),delete z.afternoon}}(D),D}}return function(v,R,k){k.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(m=v.parseTwoDigitYear);var x=R.prototype,F=x.parse;x.parse=function(w){var E=w.date,M=w.utc,O=w.args;this.$u=M;var I=O[1];if(typeof I=="string"){var P=O[2]===!0,D=O[3]===!0,N=P||D,$=O[2];D&&($=O[2]),a=this.$locale(),!P&&$&&(a=k.Ls[$]),this.$d=function(B,L,z,G){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*B);var Y=g(L)(B),te=Y.year,se=Y.month,ee=Y.day,re=Y.hours,Z=Y.minutes,oe=Y.seconds,ge=Y.milliseconds,ce=Y.zone,fe=Y.week,he=new Date,Fe=ee||(te||se?1:he.getDate()),_e=te||he.getFullYear(),dt=0;te&&!se||(dt=se>0?se-1:he.getMonth());var Kt,Yt=re||0,Qr=Z||0,Pi=oe||0,Fi=ge||0;return ce?new Date(Date.UTC(_e,dt,Fe,Yt,Qr,Pi,Fi+60*ce.offset*1e3)):z?new Date(Date.UTC(_e,dt,Fe,Yt,Qr,Pi,Fi)):(Kt=new Date(_e,dt,Fe,Yt,Qr,Pi,Fi),fe&&(Kt=G(Kt).week(fe).toDate()),Kt)}catch{return new Date("")}}(E,I,M,k),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),N&&E!=this.format(I)&&(this.$d=new Date("")),a={}}else if(I instanceof Array)for(var U=I.length,V=1;V<=U;V+=1){O[1]=I[V-1];var _=k.apply(this,O);if(_.isValid()){this.$d=_.$d,this.$L=_.$L,this.init();break}V===U&&(this.$d=new Date(""))}else F.call(this,w)}}})});var Zd=Se((Is,ks)=>{"use strict";d();c();l();u();(function(e,t){typeof Is=="object"&&typeof ks<"u"?ks.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_timezone=t()})(Is,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(y,h,S){S===void 0&&(S={});var g=new Date(y),v=function(R,k){k===void 0&&(k={});var x=k.timeZoneName||"short",F=R+"|"+x,w=t[F];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[F]=w),w}(h,S);return v.formatToParts(g)},m=function(y,h){for(var S=a(y,h),g=[],v=0;v<S.length;v+=1){var R=S[v],k=R.type,x=R.value,F=e[k];F>=0&&(g[F]=parseInt(x,10))}var w=g[3],E=w===24?0:w,M=g[0]+"-"+g[1]+"-"+g[2]+" "+E+":"+g[4]+":"+g[5]+":000",O=+y;return(o.utc(M).valueOf()-(O-=O%1e3))/6e4},f=n.prototype;f.tz=function(y,h){y===void 0&&(y=i);var S,g=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:y}),k=Math.round((v-new Date(R))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-k;if(!Number(x))S=this.utcOffset(0,h);else if(S=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),h){var F=S.utcOffset();S=S.add(g-F,"minute")}return S.$x.$timezone=y,S},f.offsetName=function(y){var h=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),h,{timeZoneName:y}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var p=f.startOf;f.startOf=function(y,h){if(!this.$x||!this.$x.$timezone)return p.call(this,y,h);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(S,y,h).tz(this.$x.$timezone,!0)},o.tz=function(y,h,S){var g=S&&h,v=S||h||i,R=m(+o(),v);if(typeof y!="string")return o(y).tz(v);var k=function(E,M,O){var I=E-60*M*1e3,P=m(I,O);if(M===P)return[I,M];var D=m(I-=60*(P-M)*1e3,O);return P===D?[I,P]:[E-60*Math.min(P,D)*1e3,Math.max(P,D)]}(o.utc(y,g).valueOf(),R,v),x=k[0],F=k[1],w=o(x).utcOffset(F);return w.$x.$timezone=v,w},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(y){i=y}}})});var ep=Se((Ps,Fs)=>{"use strict";d();c();l();u();(function(e,t){typeof Ps=="object"&&typeof Fs<"u"?Fs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_utc=t()})(Ps,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var v={date:g,utc:!0,args:arguments};return new o(v)},a.utc=function(g){var v=i(this.toDate(),{locale:this.$L,utc:!0});return g?v.add(this.utcOffset(),e):v},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var m=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),m.call(this,g)};var f=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else f.call(this)};var p=a.utcOffset;a.utcOffset=function(g,v){var R=this.$utils().u;if(R(g))return this.$u?0:R(this.$offset)?p.call(this):this.$offset;if(typeof g=="string"&&(g=function(w){w===void 0&&(w="");var E=w.match(t);if(!E)return null;var M=(""+E[0]).match(r)||["-",0,0],O=M[0],I=60*+M[1]+ +M[2];return I===0?0:O==="+"?I:-I}(g),g===null))return this;var k=Math.abs(g)<=16?60*g:g,x=this;if(v)return x.$offset=k,x.$u=g===0,x;if(g!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(k+F,e)).$offset=k,x.$x.$localOffset=F}else x=this.utc();return x};var y=a.format;a.format=function(g){var v=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,v)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var S=a.diff;a.diff=function(g,v,R){if(g&&this.$u===g.$u)return S.call(this,g,v,R);var k=this.local(),x=i(g).local();return S.call(k,x,v,R)}}})});var gp=Se((NL,mp)=>{"use strict";d();c();l();u();function aA(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}mp.exports=sA;function sA(e,t,r){var n=r&&r.stringify||aA,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var m=1;m<i;m++)a[m]=n(t[m]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var p="",y=1-o,h=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(h=h>-1?h:0,e.charCodeAt(g+1)){case 100:case 102:if(y>=f||t[y]==null)break;h<g&&(p+=e.slice(h,g)),p+=Number(t[y]),h=g+2,g++;break;case 105:if(y>=f||t[y]==null)break;h<g&&(p+=e.slice(h,g)),p+=Math.floor(Number(t[y])),h=g+2,g++;break;case 79:case 111:case 106:if(y>=f||t[y]===void 0)break;h<g&&(p+=e.slice(h,g));var v=typeof t[y];if(v==="string"){p+="'"+t[y]+"'",h=g+2,g++;break}if(v==="function"){p+=t[y].name||"<anonymous>",h=g+2,g++;break}p+=n(t[y]),h=g+2,g++;break;case 115:if(y>=f)break;h<g&&(p+=e.slice(h,g)),p+=String(t[y]),h=g+2,g++;break;case 37:h<g&&(p+=e.slice(h,g)),p+="%",h=g+2,g++,y--;break}++y}++g}return h===-1?e:(h<S&&(p+=e.slice(h)),p)}});var bp=Se((QL,ti)=>{"use strict";d();c();l();u();var yp=gp();ti.exports=lt;var In=CA().console||{},cA={mapHttpRequest:ei,mapHttpResponse:ei,wrapRequestSerializer:Ds,wrapResponseSerializer:Ds,wrapErrorSerializer:Ds,req:ei,res:ei,err:Sp,errWithCause:Sp};function Et(e,t){return e==="silent"?1/0:t.levels.values[e]}var Ms=Symbol("pino.logFuncs"),qs=Symbol("pino.hierarchy"),uA={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function hp(e,t){let r={logger:t,parent:e[qs]};t[qs]=r}function lA(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:In[o]||In[uA[o]||"log"]||qr}),e[Ms]=n}function dA(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function lt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||In;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=dA(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&m.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",p=Object.create(r);p.log||(p.log=qr),lA(p,m,r),hp({},p),Object.defineProperty(p,"levelVal",{get:h}),Object.defineProperty(p,"level",{get:S,set:g});let y={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:m,timestamp:vA(e),messageKey:e.messageKey||"msg",onChild:e.onChild||qr};p.levels=pA(e),p.level=f,p.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=qr,p.serializers=n,p._serialize=o,p._stdErrSerialize=i,p.child=function(...R){return v.call(this,y,...R)},t&&(p._logEvent=js());function h(){return Et(this.level,this)}function S(){return this._level}function g(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Ht(this,y,p,"error"),Ht(this,y,p,"fatal"),Ht(this,y,p,"warn"),Ht(this,y,p,"info"),Ht(this,y,p,"debug"),Ht(this,y,p,"trace"),a.forEach(k=>{Ht(this,y,p,k)})}function v(R,k,x){if(!k)throw new Error("missing bindings for child Pino");x=x||{},o&&k.serializers&&(x.serializers=k.serializers);let F=x.serializers;if(o&&F){var w=Object.assign({},n,F),E=e.browser.serialize===!0?Object.keys(w):o;delete k.serializers,Ns([k],E,w,this._stdErrSerialize)}function M(I){this._childLevel=(I._childLevel|0)+1,this.bindings=k,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=js([].concat(I._logEvent.bindings,k)))}M.prototype=this;let O=new M(this);return hp(this,O),O.child=function(...I){return v.call(this,R,...I)},O.level=x.level||this.level,R.onChild(O),O}return p}function pA(e){let t=e.customLevels||{},r=Object.assign({},lt.levels.values,t),n=Object.assign({},lt.levels.labels,fA(t));return{values:r,labels:n}}function fA(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}lt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};lt.stdSerializers=cA;lt.stdTimeFunctions=Object.assign({},{nullTime:vp,epochTime:Ap,unixTime:AA,isoTime:bA});function mA(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[qs];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Ht(e,t,r,n){if(Object.defineProperty(e,n,{value:Et(e.level,r)>Et(n,r)?qr:r[Ms][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===qr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Et(i,r);if(Et(n,r)<a)return}e[n]=yA(e,t,r,n);let o=mA(e);o.length!==0&&(e[n]=gA(o,e[n]))}function gA(e,t){return function(){return t.apply(this,[...e,...arguments])}}function yA(e,t,r,n){return function(o){return function(){let a=t.timestamp(),m=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===In?In:this;for(var p=0;p<m.length;p++)m[p]=arguments[p];var y=!1;if(t.serialize&&(Ns(m,this._serialize,this.serializers,this._stdErrSerialize),y=!0),t.asObject||t.formatters?o.call(f,...hA(this,n,m,a,t)):o.apply(f,m),t.transmit){let h=t.transmit.level||e._level,S=Et(h,r),g=Et(n,r);if(g<S)return;SA(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Et(e._level,r)},m,y)}}}(e[Ms][n])}function hA(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},m=r.slice(),f=m[0],p={},y=(e._childLevel|0)+1;if(y<1&&(y=1),n&&(p.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(p,h)}else p.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;y--&&typeof m[0]=="object";)Object.assign(p,m.shift());return[a(p),...m]}else{if(f!==null&&typeof f=="object"){for(;y--&&typeof m[0]=="object";)Object.assign(p,m.shift());f=m.length?yp(m.shift(),m):void 0}else typeof f=="string"&&(f=yp(m.shift(),m));return f!==void 0&&(p[o.messageKey]=f),[a(p)]}}function Ns(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=lt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function SA(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,m=t.methodValue,f=t.val,p=e._logEvent.bindings;n||Ns(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(y){return p.indexOf(y)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=m,o(a,e._logEvent,f),e._logEvent=js(p)}function js(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Sp(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function vA(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?vp:Ap}function ei(){return{}}function Ds(e){return e}function qr(){}function vp(){return!1}function Ap(){return Date.now()}function AA(){return Math.round(Date.now()/1e3)}function bA(){return new Date(Date.now()).toISOString()}function CA(){function e(t){return typeof t<"u"&&t}try{return typeof A<"u"?A:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),A)}catch{return e(self)||e(window)||e(this)||{}}}ti.exports.default=lt;ti.exports.pino=lt});var qb={};Ys(qb,{DefaultFieldsToInclude:()=>Ks,EcommerceDefaultFieldsToInclude:()=>Rf,HighlightUtils:()=>Ui,MinimumFieldsToInclude:()=>Ii,ResultTemplatesHelpers:()=>wd,buildContext:()=>Op,buildController:()=>It,buildDictionaryFieldContext:()=>Tp,buildInteractiveResult:()=>bf,buildRecommendationEngine:()=>kp,buildRecommendationList:()=>vf,buildResultTemplatesManager:()=>kf,getAnalyticsNextApiBaseUrl:()=>Vn,getOrganizationEndpoint:()=>ke,getSampleRecommendationEngineConfiguration:()=>_s,loadAdvancedSearchQueryActions:()=>vb,loadClickAnalyticsActions:()=>Fb,loadConfigurationActions:()=>Ab,loadContextActions:()=>Cb,loadDebugActions:()=>wb,loadDictionaryFieldContextActions:()=>xb,loadFieldActions:()=>Ib,loadPaginationActions:()=>Ws,loadPipelineActions:()=>kb,loadRecommendationActions:()=>Pb,loadSearchConfigurationActions:()=>bb,loadSearchHubActions:()=>Db});module.exports=jf(qb);d();c();l();u();var Ui={};Ys(Ui,{escapeHtml:()=>Zt,getHighlightedSuggestion:()=>Sm,highlightString:()=>hm});d();c();l();u();d();c();l();u();function dm(e,t){let r=`
|
|
20
20
|
The following properties are invalid:
|
|
21
21
|
|
|
22
22
|
${e.join(`
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new sn(r)}var sn=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ke=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 Vm(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}},ce=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&H(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 ge(e){return e===void 0}function Lm(e){return e===null}function H(e){return ge(e)||Lm(e)}var K=class{constructor(e={}){oe(this,"value");this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t||(Um(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Um(e){return ge(e)||Rc(e)}function Rc(e){return typeof e=="boolean"}var $=class{constructor(e={}){oe(this,"value");this.config=e,this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t||(Qm(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 Qm(e){return ge(e)||Ec(e)}function Ec(e){return typeof e=="number"&&!Number.isNaN(e)}var Bm=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,V=class{constructor(e={}){oe(this,"value");oe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new ce(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(ge(e))return null;if(!Jn(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&&!(Bm.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 Jn(e){return Object.prototype.toString.call(e)==="[object String]"}var Q=class{constructor(e={}){oe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ge(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ic(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&H(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 Ic(e){return e!==void 0&&typeof e=="object"}var J=class{constructor(e={}){oe(this,"value");this.config=e,this.value=new ce(this.config)}validate(e){if(!H(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(H(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&&H(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 Rc(e)||Jn(e)||Ec(e)||Ic(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Fc(e){return Array.isArray(e)}var ea=class{constructor(e){oe(this,"value");this.config=e,this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ge(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}};p();u();d();l();function Pc(e){return Array.isArray(e)}function Xn(e){return e.trim()===""}var $m=new Set(["1",1,"yes",!0]);function kc(){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=>$m.has(r))}function Oc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function cn(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Zn(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function Hm(e){if(Xn(e.openingDelimiter)||Xn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(H(e.content)||Xn(e.content))return e.content;if(e.highlights.length===0)return ur(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+=ur(e.content.slice(n,a)),r+=e.openingDelimiter,r+=ur(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=ur(e.content.slice(n))),r}function zm(e,t){return e=ur(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?ta(n,t.notMatchDelimiters):o?ta(o,t.exactMatchDelimiters):i?ta(i,t.correctionDelimiters):r)}function ta(e,t){return t?t.open+e+t.close:e}function ur(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}p();u();d();l();var Bc=Wn(Vc(),1);p();u();d();l();var Ke=new Error("Failed to load reducers."),lr=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."}},Bt=class extends Error{constructor(r,n){super();oe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};p();u();d();l();function Lc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Uc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Sg)}function Sg(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Qc(e){return e===429}var ze=class e{static call(t){return _asyncToGenerator(function*(){let r=vg(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(i,a);if(Qc(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Bc.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(s){let g=s&&Qc(s.status);return g&&(n.info("Platform retrying request"),yield new Promise(h=>setTimeout(h,1e3))),g});return function retry(_x){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new lr;case 404:throw new Bt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new Bt(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,s=cn(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return s})()}};function Ie(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function yt(e,t="prod"){return`${Ie(e,t)}/rest/search/v2`}function to(e,t="prod"){return`${Ie(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function vg(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=Ag(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function Ag(e,t){return t==="application/x-www-form-urlencoded"?Uc(e)?Lc(e):"":JSON.stringify(e)}p();u();d();l();p();u();d();l();var ro=e=>e;p();u();d();l();p();u();d();l();function no(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Je(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:no(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:no(),extendedResults:{},searchAction:void 0}}p();u();d();l();function ht(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var St=e=>{let{response:t}=e;return t.body?Cg(e):bg(t)},Cg=e=>xg(e)?Rg(e):wg(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},bg=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function wg(e){return e.body.statusCode!==void 0}function xg(e){return e.body.exception!==void 0}var Rg=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});p();u();d();l();var vt=class{constructor(){oe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new c.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};p();u();d();l();p();u();d();l();var dn=class{constructor(t){oe(this,"_basePath");oe(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}};p();u();d();l();function $c(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}p();u();d();l();var at=(e,t,r,n)=>{let o=new dn(`${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 Hc=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield ze.call({...at(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ht(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=$c(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Eg(a)?{success:a}:{error:St({response:r,body:a})}});return function Hc(_x2,_x3){return _ref3.apply(this,arguments)}}();function Eg(e){return typeof e=="string"}p();u();d();l();function Ig(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Fg(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function oo(e,t){if(t&&e.name==="AbortError")return{error:Fg(e)};if(e instanceof Bt)return{error:Ig(e)};throw e}var io=class{constructor(t){this.options=t;oe(this,"apiCallsQueues",{unknown:new vt,mainSearch:new vt,facetValues:new vt,foldingCollection:new vt,instantResults:new vt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/plan"),requestParams:ht(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return oo(r);let n=yield r.json();return kg(n)?{success:n}:{error:St({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ht(t),..._this3.options});if(r instanceof Error)return oo(r);let n=yield r.json(),o={response:r,body:n};return Pg(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:St(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return oo(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return zc(i)?(a.body=Gc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:St(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/facet"),requestParams:ht(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(zc(n)){let o={response:r,body:n};return o.body=Gc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:St({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Hc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Og(n)?{success:n}:{error:St({response:r,body:n})}})()}},ao=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function zc(e){return e.results!==void 0}function Gc(e){let t=no();return H(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Pg(e){return e.completions!==void 0}function kg(e){return e.preprocessingOutput!==void 0}function Og(e){return e.fields!==void 0}p();u();d();l();var Wc=e=>e,Yc=e=>e,Kc=e=>e;p();u();d();l();p();u();d();l();p();u();d();l();function ye(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 Tg=typeof Symbol=="function"&&Symbol.observable||"@@observable",Jc=Tg,da=()=>Math.random().toString(36).substring(7).split("").join("."),Dg={INIT:`@@redux/INIT${da()}`,REPLACE:`@@redux/REPLACE${da()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${da()}`},so=Dg;function Xe(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 pa(e,t,r){if(typeof e!="function")throw new Error(ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ye(1));return r(pa)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function s(){a===i&&(a=new Map,i.forEach((F,x)=>{a.set(x,F)}))}function g(){if(f)throw new Error(ye(3));return o}function h(F){if(typeof F!="function")throw new Error(ye(4));if(f)throw new Error(ye(5));let x=!0;s();let I=m++;return a.set(I,F),function(){if(x){if(f)throw new Error(ye(6));x=!1,s(),a.delete(I),i=null}}}function S(F){if(!Xe(F))throw new Error(ye(7));if(typeof F.type>"u")throw new Error(ye(8));if(typeof F.type!="string")throw new Error(ye(17));if(f)throw new Error(ye(9));try{f=!0,o=n(o,F)}finally{f=!1}return(i=a).forEach(I=>{I()}),F}function y(F){if(typeof F!="function")throw new Error(ye(10));n=F,S({type:so.REPLACE})}function b(){let F=h;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(ye(11));function I(){let E=x;E.next&&E.next(g())}return I(),{unsubscribe:F(I)}},[Jc](){return this}}}return S({type:so.INIT}),{dispatch:S,subscribe:h,getState:g,replaceReducer:y,[Jc]:b}}function qg(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:so.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:so.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function dr(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{qg(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let s=!1,g={};for(let h=0;h<n.length;h++){let S=n[h],y=r[S],b=m[S],R=y(b,f);if(typeof R>"u"){let F=f&&f.type;throw new Error(ye(14))}g[S]=R,s=s||R!==b}return s=s||n.length!==Object.keys(m).length,s?g:m}}function pr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Xc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(ye(15))},a={getState:o.getState,dispatch:(f,...s)=>i(f,...s)},m=e.map(f=>f(a));return i=pr(...m)(o.dispatch),{...o,dispatch:i}}}function co(e){return Xe(e)&&"type"in e&&typeof e.type=="string"}p();u();d();l();var ba=Symbol.for("immer-nothing"),pn=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function he(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fr=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Te]}function De(e){return e?ou(e)||Array.isArray(e)||!!e[pn]||!!e.constructor?.[pn]||mr(e)||Sn(e):!1}var Mg=Object.prototype.constructor.toString(),Zc=new WeakMap;function ou(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Zc.get(r);return n===void 0&&(n=Function.toString.call(r),Zc.set(r,n)),n===Mg}function wa(e){return Ne(e)||he(15,e),e[Te].base_}function fn(e,t,r=!0){Ht(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Ht(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:mr(e)?2:Sn(e)?3:0}function mn(e,t){return Ht(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fa(e,t){return Ht(e)===2?e.get(t):e[t]}function iu(e,t,r){let n=Ht(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ng(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mr(e){return e instanceof Map}function Sn(e){return e instanceof Set}function $t(e){return e.copy_||e.base_}function ya(e,t){if(mr(e))return new Map(e);if(Sn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=ou(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(fr(e),n)}else{let n=fr(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function fo(e,t=!1){return mo(e)||Ne(e)||!De(e)||(Ht(e)>1&&Object.defineProperties(e,{set:uo,add:uo,clear:uo,delete:uo}),Object.freeze(e),t&&Object.values(e).forEach(r=>fo(r,!0))),e}function jg(){he(2)}var uo={value:jg};function mo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ha={};function zt(e){let t=ha[e];return t||he(0,e),t}function _g(e,t){ha[e]||(ha[e]=t)}var gn;function au(){return gn}function Vg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function eu(e,t){t&&(zt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sa(e){va(e),e.drafts_.forEach(Lg),e.drafts_=null}function va(e){e===gn&&(gn=e.parent_)}function tu(e){return gn=Vg(gn,e)}function Lg(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ru(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(Sa(t),he(4)),De(e)&&(e=lo(t,e),t.parent_||po(t,e)),t.patches_&&zt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=lo(t,r,[]),Sa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ba?e:void 0}function lo(e,t,r){if(mo(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Te];if(!o)return fn(t,(i,a)=>nu(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return po(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,m=!1;o.type_===3&&(a=new Set(i),i.clear(),m=!0),fn(a,(f,s)=>nu(e,o,i,f,s,r,m),n),po(e,i,!1),r&&e.patches_&&zt("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function nu(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let m=mo(o);if(!(m&&!a)){if(Ne(o)){let f=i&&t&&t.type_!==3&&!mn(t.assigned_,n)?i.concat(n):void 0,s=lo(e,o,f);if(iu(r,n,s),Ne(s))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!m){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&m)return;lo(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(mr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&po(e,o)}}}function po(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fo(t,r)}function Ug(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:au(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=xa;r&&(o=[n],i=yn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var xa={get(e,t){if(t===Te)return e;let r=$t(e);if(!mn(r,t))return Qg(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===ma(e.base_,t)?(ga(e),e.copy_[t]=Ca(n,e)):n},has(e,t){return t in $t(e)},ownKeys(e){return Reflect.ownKeys($t(e))},set(e,t,r){let n=su($t(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ma($t(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ng(r,o)&&(r!==void 0||mn(e.base_,t)))return!0;ga(e),Aa(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 ma(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ga(e),Aa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$t(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){he(11)},getPrototypeOf(e){return fr(e.base_)},setPrototypeOf(){he(12)}},yn={};fn(xa,(e,t)=>{yn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});yn.deleteProperty=function(e,t){return yn.set.call(this,e,t,void 0)};yn.set=function(e,t,r){return xa.set.call(this,e[0],t,r,e[0])};function ma(e,t){let r=e[Te];return(r?$t(r):e)[t]}function Qg(e,t,r){let n=su(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function su(e,t){if(!(t in e))return;let r=fr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fr(r)}}function Aa(e){e.modified_||(e.modified_=!0,e.parent_&&Aa(e.parent_))}function ga(e){e.copy_||(e.copy_=ya(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...s){return a.produce(f,g=>r.call(this,g,...s))}}typeof r!="function"&&he(6),n!==void 0&&typeof n!="function"&&he(7);let o;if(De(t)){let i=tu(this),a=Ca(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?Sa(i):va(i)}return eu(i,n),ru(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ba&&(o=void 0),this.autoFreeze_&&fo(o,!0),n){let i=[],a=[];zt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else he(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),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){De(e)||he(8),Ne(e)&&(e=cu(e));let t=tu(this),r=Ca(e,void 0);return r[Te].isManual_=!0,va(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&he(9);let{scope_:n}=r;return eu(n,t),ru(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=zt("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Ca(e,t){let r=mr(e)?zt("MapSet").proxyMap_(e,t):Sn(e)?zt("MapSet").proxySet_(e,t):Ug(e,t);return(t?t.scope_:au()).drafts_.push(r),r}function cu(e){return Ne(e)||he(10,e),uu(e)}function uu(e){if(!De(e)||mo(e))return e;let t=e[Te],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ya(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ya(e,!0);return fn(r,(o,i)=>{iu(r,o,uu(i))},n),t&&(t.finalized_=!1),r}function lu(){let t="replace",r="add",n="remove";function o(S,y,b,R){switch(S.type_){case 0:case 2:return a(S,y,b,R);case 1:return i(S,y,b,R);case 3:return m(S,y,b,R)}}function i(S,y,b,R){let{base_:F,assigned_:x}=S,I=S.copy_;I.length<F.length&&([F,I]=[I,F],[b,R]=[R,b]);for(let w=0;w<F.length;w++)if(x[w]&&I[w]!==F[w]){let E=y.concat([w]);b.push({op:t,path:E,value:h(I[w])}),R.push({op:t,path:E,value:h(F[w])})}for(let w=F.length;w<I.length;w++){let E=y.concat([w]);b.push({op:r,path:E,value:h(I[w])})}for(let w=I.length-1;F.length<=w;--w){let E=y.concat([w]);R.push({op:n,path:E})}}function a(S,y,b,R){let{base_:F,copy_:x}=S;fn(S.assigned_,(I,w)=>{let E=fa(F,I),M=fa(x,I),k=w?mn(F,I)?t:r:n;if(E===M&&k===t)return;let P=y.concat(I);b.push(k===n?{op:k,path:P}:{op:k,path:P,value:M}),R.push(k===r?{op:n,path:P}:k===n?{op:r,path:P,value:h(E)}:{op:t,path:P,value:h(E)})})}function m(S,y,b,R){let{base_:F,copy_:x}=S,I=0;F.forEach(w=>{if(!x.has(w)){let E=y.concat([I]);b.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}I++}),I=0,x.forEach(w=>{if(!F.has(w)){let E=y.concat([I]);b.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}I++})}function f(S,y,b,R){b.push({op:t,path:[],value:y===ba?void 0:y}),R.push({op:t,path:[],value:S})}function s(S,y){return y.forEach(b=>{let{path:R,op:F}=b,x=S;for(let M=0;M<R.length-1;M++){let k=Ht(x),P=R[M];typeof P!="string"&&typeof P!="number"&&(P=""+P),(k===0||k===1)&&(P==="__proto__"||P==="constructor")&&he(19),typeof x=="function"&&P==="prototype"&&he(19),x=fa(x,P),typeof x!="object"&&he(18,R.join("/"))}let I=Ht(x),w=g(b.value),E=R[R.length-1];switch(F){case t:switch(I){case 2:return x.set(E,w);case 3:he(16);default:return x[E]=w}case r:switch(I){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(I){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(b.value);default:return delete x[E]}default:he(17,F)}}),S}function g(S){if(!De(S))return S;if(Array.isArray(S))return S.map(g);if(mr(S))return new Map(Array.from(S.entries()).map(([b,R])=>[b,g(R)]));if(Sn(S))return new Set(Array.from(S).map(g));let y=Object.create(fr(S));for(let b in S)y[b]=g(S[b]);return mn(S,pn)&&(y[pn]=S[pn]),y}function h(S){return Ne(S)?g(S):S}_g("Patches",{applyPatches_:s,generatePatches_:o,generateReplacementPatches_:f})}var hn=new Bg,st=hn.produce,go=hn.produceWithPatches.bind(hn);var Ra=hn.applyPatches.bind(hn);p();u();d();l();function $g(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Hg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function zg(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 du=e=>Array.isArray(e)?e:[e];function Gg(e){let t=Array.isArray(e[0])?e[0]:e;return zg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Wg(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var sE=Symbol();var cE=Object.getPrototypeOf({});var Yg=class{constructor(e){this.value=e}deref(){return this.value}},Kg=typeof WeakRef<"u"?WeakRef:Yg,Jg=0,pu=1;function yo(){return{s:Jg,v:void 0,o:null,p:null}}function gr(e,t={}){let r=yo(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let y=arguments[h];if(typeof y=="function"||typeof y=="object"&&y!==null){let b=m.o;b===null&&(m.o=b=new WeakMap);let R=b.get(y);R===void 0?(m=yo(),b.set(y,m)):m=R}else{let b=m.p;b===null&&(m.p=b=new Map);let R=b.get(y);R===void 0?(m=yo(),b.set(y,m)):m=R}}let s=m,g;if(m.s===pu)g=m.v;else if(g=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,g)&&(g=h,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Kg(g):g}return s.s=pu,s.v=g,g}return a.clearCache=()=>{r=yo(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function fu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},s=o.pop();typeof s=="object"&&(f=s,s=o.pop()),$g(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);let g={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:y=gr,argsMemoizeOptions:b=[],devModeChecks:R={}}=g,F=du(S),x=du(b),I=Gg(o),w=h(function(){return i++,s.apply(null,arguments)},...F),E=!0,M=y(function(){a++;let P=Wg(I,arguments);return m=w.apply(null,P),m},...x);return Object.assign(M,{resultFunc:s,memoizedResultFunc:w,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var de=fu(gr),Xg=Object.assign((e,t=de)=>{Hg(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:()=>Xg});p();u();d();l();function mu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var gu=mu(),yu=mu;var Zg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pr:pr.apply(null,arguments)},EE=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ey=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ge(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=>co(n)&&n.type===e,r}var Cu=class vn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,vn.prototype)}static get[Symbol.species](){return vn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new vn(...t[0].concat(this)):new vn(...t.concat(this))}};function hu(e){return De(e)?st(e,()=>{}):e}function Su(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ty(e){return typeof e=="boolean"}var ry=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Cu;return r&&(ty(r)?a.push(gu):a.push(yu(r.extraArgument))),a},An="RTK_autoBatch",hr=()=>e=>({payload:e,meta:{[An]:!0}}),vu=e=>t=>{setTimeout(t,e)},ny=(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:vu(10):e.type==="callback"?e.queueNotification:vu(e.timeout),s=()=>{a=!1,i&&(i=!1,m.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let h=()=>o&&g(),S=n.subscribe(h);return m.add(g),()=>{S(),m.delete(g)}},dispatch(g){try{return o=!g?.meta?.[An],i=!o,i&&(a||(a=!0,f(s))),n.dispatch(g)}finally{o=!0}}})},oy=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Cu(e);return n&&o.push(ny(typeof n=="object"?n:void 0)),o};function bu(e){let t=ry(),{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(Xe(r))m=dr(r);else throw new Error(Ge(1));let f;typeof n=="function"?f=n(t):f=t();let s=pr;o&&(s=Zg({trace:!1,...(typeof o=="object"&&o)}));let g=Xc(...f),h=oy(g),S=typeof a=="function"?a(h):h(),y=s(...S);return pa(m,i,y)}function wu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error(Ge(28));if(m in t)throw new Error(Ge(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 iy(e){return typeof e=="function"}function le(e,t){let[r,n,o]=wu(t),i;if(iy(e))i=()=>hu(e());else{let m=hu(e);i=()=>m}function a(m=i(),f){let s=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return s.filter(g=>!!g).length===0&&(s=[o]),s.reduce((g,h)=>{if(h)if(Ne(g)){let y=h(g,f);return y===void 0?g:y}else{if(De(g))return st(g,S=>h(S,f));{let S=h(g,f);if(S===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return g},m)}return a.getInitialState=i,a}var xu=(e,t)=>ey(e)?e.match(t):e(t);function Ze(...e){return t=>e.some(r=>xu(r,t))}function yr(...e){return t=>e.every(r=>xu(r,t))}function So(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 Cn(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function vo(...e){return e.length===0?t=>So(t,["pending"]):Cn(e)?Ze(...e.map(t=>t.pending)):vo()(e[0])}function Gt(...e){return e.length===0?t=>So(t,["rejected"]):Cn(e)?Ze(...e.map(t=>t.rejected)):Gt()(e[0])}function bn(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?yr(Gt(...e),t):Cn(e)?yr(Gt(...e),t):bn()(e[0])}function ct(...e){return e.length===0?t=>So(t,["fulfilled"]):Cn(e)?Ze(...e.map(t=>t.fulfilled)):ct()(e[0])}function Ao(...e){return e.length===0?t=>So(t,["pending","fulfilled","rejected"]):Cn(e)?Ze(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Ao()(e[0])}var ay="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Co=(e=21)=>{let t="",r=e;for(;r--;)t+=ay[Math.random()*64|0];return t},sy=["name","message","stack","code"],Ea=class{constructor(e,t){oe(this,"_type");this.payload=e,this.meta=t}},Au=class{constructor(e,t){oe(this,"_type");this.payload=e,this.meta=t}},cy=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of sy)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},re=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,s,g,h)=>({payload:f,meta:{...(h||{}),arg:g,requestId:s,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,s,g)=>({payload:void 0,meta:{...(g||{}),arg:s,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,s,g,h,S)=>({payload:h,error:(n&&n.serializeError||cy)(f||"Rejected"),meta:{...(S||{}),arg:g,requestId:s,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(s,g,h)=>{let S=n?.idGenerator?n.idGenerator(f):Co(),y=new c.AbortController,b,R;function F(I){R=I,y.abort()}let x=_asyncToGenerator(function*(){let I;try{let E=n?.condition?.(f,{getState:g,extra:h});if(ly(E)&&(E=yield E),E===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((k,P)=>{b=()=>{P({name:"AbortError",message:R||"Aborted"})},y.signal.addEventListener("abort",b)});s(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:g,extra:h}))),I=yield Promise.race([M,Promise.resolve(r(f,{dispatch:s,getState:g,extra:h,requestId:S,signal:y.signal,abort:F,rejectWithValue:(k,P)=>new Ea(k,P),fulfillWithValue:(k,P)=>new Au(k,P)})).then(k=>{if(k instanceof Ea)throw k;return k instanceof Au?o(k.payload,S,f,k.meta):o(k,S,f)})])}catch(E){I=E instanceof Ea?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{b&&y.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||s(I),I})();return Object.assign(x,{abort:F,requestId:S,arg:f,unwrap(){return x.then(uy)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ze(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function uy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function ly(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Ru=Symbol.for("rtk-slice-createasyncthunk"),OE={[Ru]:re};function dy(e,t){return`${e}/${t}`}function py({creators:e}={}){let t=e?.asyncThunk?.[Ru];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ge(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(my()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(I,w){let E=typeof I=="string"?I:I.type;if(!E)throw new Error(Ge(12));if(E in f.sliceCaseReducersByType)throw new Error(Ge(13));return f.sliceCaseReducersByType[E]=w,s},addMatcher(I,w){return f.sliceMatchers.push({matcher:I,reducer:w}),s},exposeAction(I,w){return f.actionCreators[I]=w,s},exposeCaseReducer(I,w){return f.sliceCaseReducersByName[I]=w,s}};m.forEach(I=>{let w=a[I],E={reducerName:I,type:dy(o,I),createNotation:typeof n.reducers=="function"};yy(w)?Sy(E,w,s,t):gy(E,w,s)});function g(){let[I={},w=[],E=void 0]=typeof n.extraReducers=="function"?wu(n.extraReducers):[n.extraReducers],M={...I,...f.sliceCaseReducersByType};return le(n.initialState,k=>{for(let P in M)k.addCase(P,M[P]);for(let P of f.sliceMatchers)k.addMatcher(P.matcher,P.reducer);for(let P of w)k.addMatcher(P.matcher,P.reducer);E&&k.addDefaultCase(E)})}let h=I=>I,S=new Map,y;function b(I,w){return y||(y=g()),y(I,w)}function R(){return y||(y=g()),y.getInitialState()}function F(I,w=!1){function E(k){let P=k[I];return typeof P>"u"&&w&&(P=R()),P}function M(k=h){let P=Su(S,w,()=>new WeakMap);return Su(P,k,()=>{let O={};for(let[j,_]of Object.entries(n.selectors??{}))O[j]=fy(_,k,R,w);return O})}return{reducerPath:I,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let x={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:R,...F(i),injectInto(I,{reducerPath:w,...E}={}){let M=w??i;return I.inject({reducerPath:M,reducer:b},E),{...x,...F(M,!0)}}};return x}}function fy(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 Wt=py();function my(){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 gy({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!hy(n))throw new Error(Ge(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 yy(e){return e._reducerDefinitionType==="asyncThunk"}function hy(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sy({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ge(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:s,options:g}=r,h=o(e,i,g);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),s&&n.addMatcher(h.settled,s),n.exposeCaseReducer(t,{fulfilled:a||ho,pending:m||ho,rejected:f||ho,settled:s||ho})}function ho(){}var Eu="listener",Iu="completed",Fu="cancelled",TE=`task-${Fu}`,DE=`task-${Iu}`,qE=`${Eu}-${Fu}`,ME=`${Eu}-${Iu}`;var{assign:Pu}=Object;var Ia="listenerMiddleware";var vy=Pu(T(`${Ia}/add`),{withTypes:()=>vy}),NE=T(`${Ia}/removeAll`),Ay=Pu(T(`${Ia}/remove`),{withTypes:()=>Ay});var jE=Symbol.for("rtk-state-proxy-original");function Ge(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. `}p();u();d();l();var U=new V({required:!0,emptyAllowed:!1}),Se=new V({required:!1,emptyAllowed:!1}),ve=new V({required:!0,emptyAllowed:!0}),WE=new V({required:!1,emptyAllowed:!0}),bo=new J({each:U,required:!0}),ku=new V({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Ou=new V({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),YE=new V({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ut=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Qe=(e,t)=>{if("required"in t)return{payload:new ke({value:t}).validate({value:e}).value};let o=new Q({options:{required:!0},values:t}).validate(e);if(o)throw new sn(o);return{payload:e}},N=(e,t)=>{try{return Qe(e,t)}catch(r){return{payload:e,error:ut(r)}}},Tu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return qu(e,t,r,o,"Controller initialization error")},Du=(e,t,r,n)=>{let o=`Check the options of ${n}`;return qu(e,t,r,o,"Controller initialization error")},qu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};p();u();d();l();var Sr="3.36.0",Mu=["@coveo/atomic","@coveo/quantic"];var Fa=()=>Se,Nu=()=>U,At=T("configuration/updateBasicConfiguration",e=>N(e,{accessToken:Se,environment:new V({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Se})),et=T("configuration/updateSearchConfiguration",e=>N(e,{proxyBaseUrl:new V({required:!1,url:!0}),pipeline:new V({required:!1,emptyAllowed:!0}),searchHub:Se,timezone:Se,locale:Se,authenticationProviders:new J({required:!1,each:U})})),Cy={enabled:new K({default:!0}),originContext:Fa(),originLevel2:Fa(),originLevel3:Fa(),proxyBaseUrl:new V({required:!1,url:!0}),runtimeEnvironment:new ce,anonymous:new K({default:!1}),deviceId:Se,userDisplayName:Se,documentLocation:Se,trackingId:Ou,analyticsMode:new V({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Q({options:{required:!1},values:Mu.reduce((e,t)=>(e[t]=ku,e),{})})},vr=T("configuration/updateAnalyticsConfiguration",e=>N(e,Cy)),Ar=T("configuration/analytics/disable"),Cr=T("configuration/analytics/enable"),wo=T("configuration/analytics/originlevel2",e=>N(e,{originLevel2:Nu()})),xo=T("configuration/analytics/originlevel3",e=>N(e,{originLevel3:Nu()}));p();u();d();l();p();u();d();l();p();u();d();l();var ju={q:new V,enableQuerySyntax:new K,aq:new V,cq:new V,firstResult:new $({min:0}),numberOfResults:new $({min:0}),sortCriteria:new V,f:new Q,fExcluded:new Q,cf:new Q,nf:new Q,mnf:new Q,df:new Q,debug:new K,sf:new Q,tab:new V,af:new Q};var Ct=T("searchParameters/restore",e=>N(e,ju)),_u=T("searchParameters/restoreTab",e=>N(e,U));p();u();d();l();var Ro=T("debug/enable"),Eo=T("debug/disable");p();u();d();l();var Io=()=>!1;var Fo=le(Io(),e=>{e.addCase(Ro,()=>!0).addCase(Eo,()=>!1).addCase(Ct,(t,r)=>r.payload.debug??t)});p();u();d();l();var br=T("pipeline/set",e=>N(e,new V({required:!0,emptyAllowed:!0})));p();u();d();l();p();u();d();l();var by=T("history/undo"),wy=T("history/redo"),tt=T("history/snapshot"),oF=re("history/back",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(by()),yield t(qe())});return function(_x4,_x5){return _ref5.apply(this,arguments)}}()),iF=re("history/forward",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{dispatch:t}){t(wy()),yield t(qe())});return function(_x6,_x7){return _ref6.apply(this,arguments)}}()),qe=re("history/change",/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x8,_x9){return _ref7.apply(this,arguments)}}());p();u();d();l();var wr=()=>"";var xr=le(wr(),e=>{e.addCase(br,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(et,(t,r)=>r.payload.pipeline||t)});p();u();d();l();p();u();d();l();var Po=T("app/setError");p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Rr=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}$/,s=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||s.test(m)||m.indexOf(".")===-1?Pa(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Pa(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 Pa(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}p();u();d();l();function xy(){return typeof navigator<"u"}function Vu(){try{return typeof localStorage<"u"}catch{return!1}}function Lu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Uu(){return!!(xy()&&navigator.cookieEnabled)}var Qu=null;function Bu(){return Qu||(Vu()?localStorage:Uu()?new ka:Lu()?sessionStorage:new Oa)}var Er=class Er{getItem(t){return Rr.get(`${Er.prefix}${t}`)}removeItem(t){Rr.erase(`${Er.prefix}${t}`)}setItem(t,r,n){Rr.set(`${Er.prefix}${t}`,r,n)}};oe(Er,"prefix","coveo_");var ka=Er;var Oa=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ko="__coveo.analytics.history",Ry=20,Ey=1e3*60,Iy=75,Yt=class Yt{constructor(t){oe(this,"store");this.store=t||Bu()}static getInstance(t){return Yt.instance||(Yt.instance=new Yt(t)),Yt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ko);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ko);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ko,JSON.stringify(t.slice(0,Ry)))}catch{}}clear(){try{this.store.removeItem(ko)}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,Iy)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Ey:!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))}};oe(Yt,"instance",null);var Ta=Yt,Be=Ta;p();u();d();l();p();u();d();l();var Ir=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Sr}`));p();u();d();l();p();u();d();l();function lt(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 D(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(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function Ma(){return typeof window<"u"}function Wa(){return typeof navigator<"u"}function Fr(){return typeof document<"u"}function Na(){try{return typeof localStorage<"u"}catch{return!1}}function Fy(){try{return typeof sessionStorage<"u"}catch{return!1}}function nl(){return Wa()&&navigator.cookieEnabled}var Py=[X.click,X.custom,X.search,X.view],ky=(e,t)=>Py.indexOf(e)!==-1?Object.assign({language:Fr()?document.documentElement.lang:"unknown",userAgent:Wa()?navigator.userAgent:"unknown"},t):t,xn=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?$u(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],$u(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 $u(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Oy(){return Na()?localStorage:nl()?new Rn:Fy()?sessionStorage:new kr}var Rn=class e{getItem(t){return xn.get(`${e.prefix}${t}`)}removeItem(t){xn.erase(`${e.prefix}${t}`)}setItem(t,r,n){xn.set(`${e.prefix}${t}`,r,n)}};Rn.prefix="coveo_";var ja=class{constructor(){this.cookieStorage=new Rn}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)}},kr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Oo="__coveo.analytics.history",Ty=20,Dy=1e3*60,qy=75,qo=class{constructor(t){this.store=t||Oy()}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 D(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 D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Oo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Oo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Oo,JSON.stringify(t.slice(0,Ty)))}catch{}}clear(){try{this.store.removeItem(Oo)}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,qy)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Dy:!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 My=(e,t)=>D(void 0,void 0,void 0,function*(){return e===X.view?(yield Ny(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Ny=e=>D(void 0,void 0,void 0,function*(){let t=new qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),To,jy=new Uint8Array(16);function _y(){if(!To&&(To=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!To))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return To(jy)}var Vy=/^(?:[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 Mo(e){return typeof e=="string"&&Vy.test(e)}var Ae=[];for(let e=0;e<256;++e)Ae.push((e+256).toString(16).slice(1));function ol(e,t=0){return Ae[e[t+0]]+Ae[e[t+1]]+Ae[e[t+2]]+Ae[e[t+3]]+"-"+Ae[e[t+4]]+Ae[e[t+5]]+"-"+Ae[e[t+6]]+Ae[e[t+7]]+"-"+Ae[e[t+8]]+Ae[e[t+9]]+"-"+Ae[e[t+10]]+Ae[e[t+11]]+Ae[e[t+12]]+Ae[e[t+13]]+Ae[e[t+14]]+Ae[e[t+15]]}function Ly(e){if(!Mo(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 Uy(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Qy="6ba7b810-9dad-11d1-80b4-00c04fd430c8",By="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function $y(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=Uy(o)),typeof i=="string"&&(i=Ly(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 s=new Uint8Array(16+o.length);if(s.set(i),s.set(o,i.length),s=r(s),s[6]=s[6]&15|t,s[8]=s[8]&63|128,a){m=m||0;for(let g=0;g<16;++g)a[m+g]=s[g];return a}return ol(s)}try{n.name=e}catch{}return n.DNS=Qy,n.URL=By,n}var Hy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Hu={randomUUID:Hy};function Kt(e,t,r){if(Hu.randomUUID&&!t&&!e)return Hu.randomUUID();e=e||{};let n=e.random||(e.rng||_y)();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 ol(n)}function zy(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 Da(e,t){return e<<t|e>>>32-t}function Gy(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 y=0;y<16;++y)m[y]=i[a][y];for(let y=16;y<80;++y)m[y]=Da(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let f=r[0],s=r[1],g=r[2],h=r[3],S=r[4];for(let y=0;y<80;++y){let b=Math.floor(y/20),R=Da(f,5)+zy(b,s,g,h)+S+t[b]+m[y]>>>0;S=h,h=g,g=Da(s,30)>>>0,s=f,f=R}r[0]=r[0]+f>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+g>>>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 Wy=$y("v5",80,Gy),zu=Wy,il="2.30.49",Gu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,wn={pageview:"pageview",event:"event"},No=class{constructor({client:t,uuidGenerator:r=Kt}){this.client=t,this.uuidGenerator=r}},_a=class extends No{constructor({client:t,uuidGenerator:r=Kt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Gu(window.location),this.lastReferrer=Fr()?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:Fr()?document.title:"",encoding:Fr()?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===wn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===wn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===wn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===wn.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 Gu(window.location)}},bt=class e{constructor(t,r){if(!Mo(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 Mo(i)?new e(i,Number.parseInt(o)*1e3):null}};bt.cvo_cid="cvo_cid";bt.expirationTime=120;var Va=class extends No{constructor({client:t,uuidGenerator:r=Kt}){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 D(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(bt.cvo_cid,new bt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Va.Id="link";var He=Object.keys;function Do(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qa=128,al=192,Wu=224,Yu=240;function Yy(e){return(e&248)===Yu?4:(e&Yu)===Wu?3:(e&Wu)===al?2:1}function Ky(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&qa)!=qa)break;if(r-=3,(n&al)!=qa){t-r>=Yy(n)*3&&(r=t);break}}return e.substring(0,r)}var La={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"},Jy=He(La).map(e=>La[e]),Xy=[...Jy].join("|"),Zy=new RegExp(`^(${Xy}$)`),eh={svcAction:"svc_action",svcActionData:"svc_action_data"},th=e=>He(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=La[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),rh=e=>Zy.test(e),nh=[rh],Ku={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Ju={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},xe={action:"pa",list:"pal",listSource:"pls"},jo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},oh=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ua={id:"quoteId",affiliation:"quoteAffiliation"},Qa={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ih={add:xe,bookmark_add:xe,bookmark_remove:xe,click:xe,checkout:xe,checkout_option:xe,detail:xe,impression:xe,remove:xe,refund:Object.assign(Object.assign({},xe),jo),purchase:Object.assign(Object.assign({},xe),jo),quickview:xe,quote:Object.assign(Object.assign({},xe),Ua),review:Object.assign(Object.assign({},xe),Qa)},ah=He(Ku).map(e=>Ku[e]),sh=He(Ju).map(e=>Ju[e]),ch=He(xe).map(e=>xe[e]),uh=He(jo).map(e=>jo[e]),lh=He(Qa).map(e=>Qa[e]),dh=He(Ua).map(e=>Ua[e]),ph=[...ah,"custom"].join("|"),fh=[...sh,"custom"].join("|"),sl="(pr[0-9]+)",cl="(il[0-9]+pi[0-9]+)",mh=new RegExp(`^${sl}(${ph})$`),gh=new RegExp(`^(${cl}(${fh}))|(il[0-9]+nm)$`),yh=new RegExp(`^(${ch.join("|")})$`),hh=new RegExp(`^(${uh.join("|")})$`),Sh=new RegExp(`^${sl}custom$`),vh=new RegExp(`^${cl}custom$`),Ah=new RegExp(`^(${[...oh,...lh,...dh].join("|")})$`),Ch=e=>mh.test(e),bh=e=>gh.test(e),wh=e=>yh.test(e),xh=e=>hh.test(e),Rh=e=>Ah.test(e),Eh=[bh,Ch,wh,xh,Rh],Ih=[Sh,vh],Fh={anonymizeIp:"aip"},Ph={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},kh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Oh=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Th=Object.assign(Object.assign(Object.assign(Object.assign({},Fh),Ph),kh),Oh.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Ba=Object.assign(Object.assign({},Th),eh),Dh=e=>{let t=!!e.action&&ih[e.action]||{};return He(e).reduce((r,n)=>{let o=t[n]||Ba[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},qh=He(Ba).map(e=>Ba[e]),Mh=e=>qh.indexOf(e)!==-1,Nh=e=>e==="custom",jh=e=>[...Eh,...nh,Mh,Nh].some(t=>t(e)),_h=e=>He(e).reduce((t,r)=>{let n=Vh(r);return n?Object.assign(Object.assign({},t),Lh(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Vh=e=>{let t;return[...Ih].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Lh=(e,t)=>He(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),$a=class{constructor(t){this.opts=t}sendEvent(t,r){return D(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),s=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,s)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(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(s){console.error("Unable to process the request body as a JSON string",s)}}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 D(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[X.click,X.custom,X.search,X.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}},Ha=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},Xu=A.fetch,_o=class{constructor(t){this.opts=t}sendEvent(t,r){return D(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:s}=f,g=lt(f,["url"]),h;try{h=yield Xu(s,g)}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 D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return D(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"})}},za=class{constructor(t,r){Na()&&nl()?this.storage=new ja:Na()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new kr),this.client=new _o(t),this.beaconClient=new $a(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}},Ga=class{constructor(t,r){this.storage=r||new kr,this.client=new _o(t)}getClientDependingOnEventType(t){return this.client}},Vo=class{constructor(){this.storage=new kr,this.client=new Ha}getClientDependingOnEventType(t){return this.client}},Uh="xx",Qh=e=>e?.startsWith(Uh)||!1,Bh=`
|
|
26
|
+
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Oe=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 dm(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}},pe=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 pm(e){return e===null}function X(e){return ve(e)||pm(e)}var ne=class{constructor(e={}){de(this,"value");this.value=new pe(e)}validate(e){let t=this.value.validate(e);return t||(fm(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function fm(e){return ve(e)||mc(e)}function mc(e){return typeof e=="boolean"}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new pe(e)}validate(e){let t=this.value.validate(e);return t||(mm(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 mm(e){return ve(e)||gc(e)}function gc(e){return typeof e=="number"&&!Number.isNaN(e)}var gm=/^\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 pe(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(!jn(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&&!(gm.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 jn(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(!yc(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 yc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new pe(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 mc(e)||jn(e)||gc(e)||yc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function hc(e){return Array.isArray(e)}var Vi=class{constructor(e){de(this,"value");this.config=e,this.value=new pe(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 Sc(e){return Array.isArray(e)}function Mn(e){return e.trim()===""}var ym=new Set(["1",1,"yes",!0]);function vc(){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=>ym.has(r))}function Ac(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 Nn(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function hm(e){if(Mn(e.openingDelimiter)||Mn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Mn(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 Sm(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 Tc=Be(kc(),1);d();c();l();u();var Ge=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 Pc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Fc(e){return typeof e!="object"||!e?!1:Object.values(e).every($m)}function $m(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Oc(e){return e===429}var $e=class e{static call(t){return _asyncToGenerator(function*(){let r=Hm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield b(i,a);if(Oc(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Tc.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(p){let y=p&&Oc(p.status);return y&&(n.info("Platform retrying request"),yield new Promise(h=>setTimeout(h,1e3))),y});return function retry(_x){return _ref2.apply(this,arguments)}}()});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 preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,p=Kr(f);try{let y=yield 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 Hm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=zm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function zm(e,t){return t==="application/x-www-form-urlencoded"?Fc(e)?Pc(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 We(){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?Gm(e):Wm(t)},Gm=e=>Ym(e)?Jm(e):Km(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Wm=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Km(e){return e.body.statusCode!==void 0}function Ym(e){return e.body.exception!==void 0}var Jm=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)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){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 yield 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 Dc(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 qc=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield $e.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=Dc(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Xm(a)?{success:a}:{error:mt({response:r,body:a})}});return function qc(_x2,_x3){return _ref3.apply(this,arguments)}}();function Xm(e){return typeof e=="string"}d();c();l();u();function Zm(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function eg(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Qn(e,t){if(t&&e.name==="AbortError")return{error:eg(e)};if(e instanceof jt)return{error:Zm(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})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield $e.call({...rt(t,"POST","application/json","/plan"),requestParams:ft(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Qn(r);let n=yield r.json();return rg(n)?{success:n}:{error:mt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield $e.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ft(t),..._this3.options});if(r instanceof Error)return Qn(r);let n=yield r.json(),o={response:r,body:n};return tg(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>$e.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Qn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return jc(i)?(a.body=Mc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield $e.call({...rt(t,"POST","application/json","/facet"),requestParams:ft(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield $e.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(jc(n)){let o={response:r,body:n};return o.body=Mc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return qc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield $e.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return ng(n)?{success:n}:{error:mt({response:r,body:n})}})()}},$n=e=>e.success!==void 0,Te=e=>e.error!==void 0;function jc(e){return e.results!==void 0}function Mc(e){let t=Un();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function tg(e){return e.completions!==void 0}function rg(e){return e.preprocessingOutput!==void 0}function ng(e){return e.fields!==void 0}d();c();l();u();var Nc=e=>e,_c=e=>e,Vc=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function Ae(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 og=typeof Symbol=="function"&&Symbol.observable||"@@observable",Lc=og,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),ig={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=ig;function Ke(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(Ae(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ae(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ae(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,x)=>{a.set(x,k)}))}function y(){if(f)throw new Error(Ae(3));return o}function h(k){if(typeof k!="function")throw new Error(Ae(4));if(f)throw new Error(Ae(5));let x=!0;p();let F=m++;return a.set(F,k),function(){if(x){if(f)throw new Error(Ae(6));x=!1,p(),a.delete(F),i=null}}}function S(k){if(!Ke(k))throw new Error(Ae(7));if(typeof k.type>"u")throw new Error(Ae(8));if(typeof k.type!="string")throw new Error(Ae(17));if(f)throw new Error(Ae(9));try{f=!0,o=n(o,k)}finally{f=!1}return(i=a).forEach(F=>{F()}),k}function g(k){if(typeof k!="function")throw new Error(Ae(10));n=k,S({type:Hn.REPLACE})}function v(){let k=h;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(Ae(11));function F(){let E=x;E.next&&E.next(y())}return F(),{unsubscribe:k(F)}},[Lc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[Lc]:v}}function ag(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(Ae(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ae(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{ag(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],R=g(v,f);if(typeof R>"u"){let k=f&&f.type;throw new Error(Ae(14))}y[S]=R,p=p||R!==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 Uc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ae(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 Ke(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),De=Symbol.for("immer-state");function be(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var nr=Object.getPrototypeOf;function Me(e){return!!e&&!!e[De]}function qe(e){return e?Gc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||or(e)||an(e):!1}var sg=Object.prototype.constructor.toString(),Qc=new WeakMap;function Gc(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Qc.get(r);return n===void 0&&(n=Function.toString.call(r),Qc.set(r,n)),n===sg}function ca(e){return Me(e)||be(15,e),e[De].base_}function en(e,t,r=!0){Nt(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Nt(e){let t=e[De];return t?t.type_:Array.isArray(e)?1:or(e)?2:an(e)?3:0}function tn(e,t){return Nt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return Nt(e)===2?e.get(t):e[t]}function Wc(e,t,r){let n=Nt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function cg(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function or(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(or(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Gc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[De];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(nr(e),n)}else{let n=nr(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)||!qe(e)||(Nt(e)>1&&Object.defineProperties(e,{set:Gn,add:Gn,clear:Gn,delete:Gn}),Object.freeze(e),t&&Object.values(e).forEach(r=>Yn(r,!0))),e}function ug(){be(2)}var Gn={value:ug};function Jn(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ra={};function _t(e){let t=ra[e];return t||be(0,e),t}function lg(e,t){ra[e]||(ra[e]=t)}var rn;function Kc(){return rn}function dg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Bc(e,t){t&&(_t("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(pg),e.drafts_=null}function oa(e){e===rn&&(rn=e.parent_)}function $c(e){return rn=dg(rn,e)}function pg(e){let t=e[De];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Hc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[De].modified_&&(na(t),be(4)),qe(e)&&(e=Wn(t,e),t.parent_||Kn(t,e)),t.patches_&&_t("Patches").generateReplacementPatches_(r[De].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=e.immer_.shouldUseStrictIteration(),o=t[De];if(!o)return en(t,(i,a)=>zc(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return Kn(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,m=!1;o.type_===3&&(a=new Set(i),i.clear(),m=!0),en(a,(f,p)=>zc(e,o,i,f,p,r,m),n),Kn(e,i,!1),r&&e.patches_&&_t("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function zc(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let m=Jn(o);if(!(m&&!a)){if(Me(o)){let f=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,p=Wn(e,o,f);if(Wc(r,n,p),Me(p))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(qe(o)&&!m){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&m)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(or(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 fg(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Kc(),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===De)return e;let r=Mt(e);if(!tn(r,t))return mg(e,r,t);let n=r[t];return e.finalized_||!qe(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=Yc(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?.[De];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(cg(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(){be(11)},getPrototypeOf(e){return nr(e.base_)},setPrototypeOf(){be(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[De];return(r?Mt(r):e)[t]}function mg(e,t,r){let n=Yc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Yc(e,t){if(!(t in e))return;let r=nr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=nr(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 gg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,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"&&be(6),n!==void 0&&typeof n!="function"&&be(7);let o;if(qe(t)){let i=$c(this),a=aa(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?na(i):oa(i)}return Bc(i,n),Hc(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=[];_t("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else be(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),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){qe(e)||be(8),Me(e)&&(e=Jc(e));let t=$c(this),r=aa(e,void 0);return r[De].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[De];(!r||!r.isManual_)&&be(9);let{scope_:n}=r;return Bc(n,t),Hc(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=_t("Patches").applyPatches_;return Me(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=or(e)?_t("MapSet").proxyMap_(e,t):an(e)?_t("MapSet").proxySet_(e,t):fg(e,t);return(t?t.scope_:Kc()).drafts_.push(r),r}function Jc(e){return Me(e)||be(10,e),Xc(e)}function Xc(e){if(!qe(e)||Jn(e))return e;let t=e[De],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ta(e,!0);return en(r,(o,i)=>{Wc(r,o,Xc(i))},n),t&&(t.finalized_=!1),r}function Zc(){let t="replace",r="add",n="remove";function o(S,g,v,R){switch(S.type_){case 0:case 2:return a(S,g,v,R);case 1:return i(S,g,v,R);case 3:return m(S,g,v,R)}}function i(S,g,v,R){let{base_:k,assigned_:x}=S,F=S.copy_;F.length<k.length&&([k,F]=[F,k],[v,R]=[R,v]);for(let w=0;w<k.length;w++)if(x[w]&&F[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(F[w])}),R.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<F.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(F[w])})}for(let w=F.length-1;k.length<=w;--w){let E=g.concat([w]);R.push({op:n,path:E})}}function a(S,g,v,R){let{base_:k,copy_:x}=S;en(S.assigned_,(F,w)=>{let E=Xi(k,F),M=Xi(x,F),O=w?tn(k,F)?t:r:n;if(E===M&&O===t)return;let I=g.concat(F);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:M}),R.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,R){let{base_:k,copy_:x}=S,F=0;k.forEach(w=>{if(!x.has(w)){let E=g.concat([F]);v.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}F++}),F=0,x.forEach(w=>{if(!k.has(w)){let E=g.concat([F]);v.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}F++})}function f(S,g,v,R){v.push({op:t,path:[],value:g===sa?void 0:g}),R.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:R,op:k}=v,x=S;for(let M=0;M<R.length-1;M++){let O=Nt(x),I=R[M];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&be(19),typeof x=="function"&&I==="prototype"&&be(19),x=Xi(x,I),typeof x!="object"&&be(18,R.join("/"))}let F=Nt(x),w=y(v.value),E=R[R.length-1];switch(k){case t:switch(F){case 2:return x.set(E,w);case 3:be(16);default:return x[E]=w}case r:switch(F){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(F){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(v.value);default:return delete x[E]}default:be(17,k)}}),S}function y(S){if(!qe(S))return S;if(Array.isArray(S))return S.map(y);if(or(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,y(R)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(nr(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}lg("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:f})}var on=new gg,nt=on.produce,Xn=on.produceWithPatches.bind(on);var la=on.applyPatches.bind(on);d();c();l();u();function yg(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Sg(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 eu=e=>Array.isArray(e)?e:[e];function vg(e){let t=Array.isArray(e[0])?e[0]:e;return Sg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ag(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var uR=Symbol();var lR=Object.getPrototypeOf({});var bg=class{constructor(e){this.value=e}deref(){return this.value}},Cg=typeof WeakRef<"u"?WeakRef:bg,wg=0,tu=1;function Zn(){return{s:wg,v:void 0,o:null,p:null}}function ir(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 R=v.get(g);R===void 0?(m=Zn(),v.set(g,m)):m=R}else{let v=m.p;v===null&&(m.p=v=new Map);let R=v.get(g);R===void 0?(m=Zn(),v.set(g,m)):m=R}}let p=m,y;if(m.s===tu)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 Cg(y):y}return p.s=tu,p.v=y,y}return a.clearCache=()=>{r=Zn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function ru(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()),yg(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:g=ir,argsMemoizeOptions:v=[],devModeChecks:R={}}=y,k=eu(S),x=eu(v),F=vg(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,M=g(function(){a++;let I=Ag(F,arguments);return m=w.apply(null,I),m},...x);return Object.assign(M,{resultFunc:p,memoizedResultFunc:w,dependencies:F,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var ye=ru(ir),xg=Object.assign((e,t=ye)=>{hg(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:()=>xg});d();c();l();u();function nu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var ou=nu(),iu=nu;var Rg=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)},kR=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Eg=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(He(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 lu=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 au(e){return qe(e)?nt(e,()=>{}):e}function su(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Ig(e){return typeof e=="boolean"}var kg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new lu;return r&&(Ig(r)?a.push(ou):a.push(iu(r.extraArgument))),a},cn="RTK_autoBatch",sr=()=>e=>({payload:e,meta:{[cn]:!0}}),cu=e=>t=>{setTimeout(t,e)},Pg=(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:cu(10):e.type==="callback"?e.queueNotification:cu(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}}})},Fg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new lu(e);return n&&o.push(Pg(typeof n=="object"?n:void 0)),o};function du(e){let t=kg(),{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(Ke(r))m=tr(r);else throw new Error(He(1));let f;typeof n=="function"?f=n(t):f=t();let p=rr;o&&(p=Rg({trace:!1,...(typeof o=="object"&&o)}));let y=Uc(...f),h=Fg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return Ji(m,i,g)}function pu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error(He(28));if(m in t)throw new Error(He(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 Og(e){return typeof e=="function"}function me(e,t){let[r,n,o]=pu(t),i;if(Og(e))i=()=>au(e());else{let m=au(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(qe(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 fu=(e,t)=>Eg(e)?e.match(t):e(t);function Ye(...e){return t=>e.some(r=>fu(r,t))}function ar(...e){return t=>e.every(r=>fu(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)?Ye(...e.map(t=>t.pending)):ro()(e[0])}function Vt(...e){return e.length===0?t=>to(t,["rejected"]):un(e)?Ye(...e.map(t=>t.rejected)):Vt()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ar(Vt(...e),t):un(e)?ar(Vt(...e),t):ln()(e[0])}function ot(...e){return e.length===0?t=>to(t,["fulfilled"]):un(e)?Ye(...e.map(t=>t.fulfilled)):ot()(e[0])}function no(...e){return e.length===0?t=>to(t,["pending","fulfilled","rejected"]):un(e)?Ye(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):no()(e[0])}var Tg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",oo=(e=21)=>{let t="",r=e;for(;r--;)t+=Tg[Math.random()*64|0];return t},Dg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},uu=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},qg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Dg)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||qg)(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,R;function k(F){R=F,g.abort()}let x=_asyncToGenerator(function*(){let F;try{let E=n?.condition?.(f,{getState:y,extra:h});if(Mg(E)&&(E=yield 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:R||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:y,extra:h}))),F=yield 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 uu(O,I)})).then(O=>{if(O instanceof da)throw O;return O instanceof uu?o(O.payload,S,f,O.meta):o(O,S,f)})])}catch(E){F=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(F)&&F.meta.condition||p(F),F})();return Object.assign(x,{abort:k,requestId:S,arg:f,unwrap(){return x.then(jg)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ye(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function jg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Mg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mu=Symbol.for("rtk-slice-createasyncthunk"),DR={[mu]:ue};function Ng(e,t){return`${e}/${t}`}function _g({creators:e}={}){let t=e?.asyncThunk?.[mu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(He(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Lg()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(F,w){let E=typeof F=="string"?F:F.type;if(!E)throw new Error(He(12));if(E in f.sliceCaseReducersByType)throw new Error(He(13));return f.sliceCaseReducersByType[E]=w,p},addMatcher(F,w){return f.sliceMatchers.push({matcher:F,reducer:w}),p},exposeAction(F,w){return f.actionCreators[F]=w,p},exposeCaseReducer(F,w){return f.sliceCaseReducersByName[F]=w,p}};m.forEach(F=>{let w=a[F],E={reducerName:F,type:Ng(o,F),createNotation:typeof n.reducers=="function"};Qg(w)?$g(E,w,p,t):Ug(E,w,p)});function y(){let[F={},w=[],E=void 0]=typeof n.extraReducers=="function"?pu(n.extraReducers):[n.extraReducers],M={...F,...f.sliceCaseReducersByType};return me(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=F=>F,S=new Map,g;function v(F,w){return g||(g=y()),g(F,w)}function R(){return g||(g=y()),g.getInitialState()}function k(F,w=!1){function E(O){let I=O[F];return typeof I>"u"&&w&&(I=R()),I}function M(O=h){let I=su(S,w,()=>new WeakMap);return su(I,O,()=>{let P={};for(let[D,N]of Object.entries(n.selectors??{}))P[D]=Vg(N,O,R,w);return P})}return{reducerPath:F,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let x={name:o,reducer:v,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:R,...k(i),injectInto(F,{reducerPath:w,...E}={}){let M=w??i;return F.inject({reducerPath:M,reducer:v},E),{...x,...k(M,!0)}}};return x}}function Vg(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 Lt=_g();function Lg(){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 Ug({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Bg(n))throw new Error(He(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 Qg(e){return e._reducerDefinitionType==="asyncThunk"}function Bg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function $g({type:e,reducerName:t},r,n,o){if(!o)throw new Error(He(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 gu="listener",yu="completed",hu="cancelled",qR=`task-${hu}`,jR=`task-${yu}`,MR=`${gu}-${hu}`,NR=`${gu}-${yu}`;var{assign:Su}=Object;var pa="listenerMiddleware";var Hg=Su(T(`${pa}/add`),{withTypes:()=>Hg}),_R=T(`${pa}/removeAll`),zg=Su(T(`${pa}/remove`),{withTypes:()=>zg});var VR=Symbol.for("rtk-state-proxy-original");function He(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}),YR=new H({required:!1,emptyAllowed:!0}),io=new ie({each:W,required:!0}),vu=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Au=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),JR=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 Oe({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)}}},bu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return wu(e,t,r,o,"Controller initialization error")},Cu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return wu(e,t,r,o,"Controller initialization error")},wu=(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 cr="3.38.0",xu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ce,Ru=()=>W,yt=T("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Je=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})})),Gg={enabled:new ne({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new pe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:Au,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:xu.reduce((e,t)=>(e[t]=vu,e),{})})},ur=T("configuration/updateAnalyticsConfiguration",e=>Q(e,Gg)),lr=T("configuration/analytics/disable"),dr=T("configuration/analytics/enable"),ao=T("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:Ru()})),so=T("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:Ru()}));d();c();l();u();d();c();l();u();d();c();l();u();var Eu={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,Eu)),Iu=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=me(lo(),e=>{e.addCase(co,()=>!0).addCase(uo,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var pr=T("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var Wg=T("history/undo"),Kg=T("history/redo"),Xe=T("history/snapshot"),aI=ue("history/back",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Wg()),yield t(je())});return function(_x4,_x5){return _ref5.apply(this,arguments)}}()),sI=ue("history/forward",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{dispatch:t}){t(Kg()),yield t(je())});return function(_x6,_x7){return _ref6.apply(this,arguments)}}()),je=ue("history/change",/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x8,_x9){return _ref7.apply(this,arguments)}}());d();c();l();u();var fr=()=>"";var mr=me(fr(),e=>{e.addCase(pr,(t,r)=>r.payload).addCase(je.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Je,(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 gr=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 Yg(){return typeof navigator<"u"}function ku(){try{return typeof localStorage<"u"}catch{return!1}}function Pu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fu(){return!!(Yg()&&navigator.cookieEnabled)}var Ou=null;function Tu(){return Ou||(ku()?localStorage:Fu()?new ga:Pu()?sessionStorage:new ya)}var yr=class yr{getItem(t){return gr.get(`${yr.prefix}${t}`)}removeItem(t){gr.erase(`${yr.prefix}${t}`)}setItem(t,r,n){gr.set(`${yr.prefix}${t}`,r,n)}};de(yr,"prefix","coveo_");var ga=yr;var ya=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var mo="__coveo.analytics.history",Jg=20,Xg=1e3*60,Zg=75,Ut=class Ut{constructor(t){de(this,"store");this.store=t||Tu()}static getInstance(t){return Ut.instance||(Ut.instance=new Ut(t)),Ut.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(mo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(mo);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(mo,JSON.stringify(t.slice(0,Jg)))}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,Zg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Xg:!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(Ut,"instance",null);var ha=Ut,Le=ha;d();c();l();u();d();c();l();u();var hr=ye(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${cr}`));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 Aa(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function Sr(){return typeof document<"u"}function ba(){try{return typeof localStorage<"u"}catch{return!1}}function ey(){try{return typeof sessionStorage<"u"}catch{return!1}}function zu(){return Da()&&navigator.cookieEnabled}var ty=[ae.click,ae.custom,ae.search,ae.view],ry=(e,t)=>ty.indexOf(e)!==-1?Object.assign({language:Sr()?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?Du(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Du(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 Du(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function ny(){return ba()?localStorage:zu()?new fn:ey()?sessionStorage:new Ar}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)}},Ar=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},go="__coveo.analytics.history",oy=20,iy=1e3*60,ay=75,So=class{constructor(t){this.store=t||ny()}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,oy)))}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,ay)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>iy:!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 sy=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield cy(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),cy=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,uy=new Uint8Array(16);function ly(){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(uy)}var dy=/^(?:[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"&&dy.test(e)}var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function Gu(e,t=0){return xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]}function py(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 fy(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var my="6ba7b810-9dad-11d1-80b4-00c04fd430c8",gy="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function yy(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=fy(o)),typeof i=="string"&&(i=py(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 Gu(p)}try{n.name=e}catch{}return n.DNS=my,n.URL=gy,n}var hy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qu={randomUUID:hy};function Qt(e,t,r){if(qu.randomUUID&&!t&&!e)return qu.randomUUID();e=e||{};let n=e.random||(e.rng||ly)();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 Gu(n)}function Sy(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 vy(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),R=Sa(f,5)+Sy(v,p,y,h)+S+t[v]+m[g]>>>0;S=h,h=y,y=Sa(p,30)>>>0,p=f,f=R}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 Ay=yy("v5",80,vy),ju=Ay,Wu="2.30.49",Mu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},Ao=class{constructor({client:t,uuidGenerator:r=Qt}){this.client=t,this.uuidGenerator=r}},wa=class extends Ao{constructor({client:t,uuidGenerator:r=Qt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Mu(window.location),this.lastReferrer=Sr()?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:Sr()?document.title:"",encoding:Sr()?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 Mu(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 xa=class extends Ao{constructor({client:t,uuidGenerator:r=Qt}){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)}};xa.Id="link";var Qe=Object.keys;function ho(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Ku=192,Nu=224,_u=240;function by(e){return(e&248)===_u?4:(e&_u)===Nu?3:(e&Nu)===Ku?2:1}function Cy(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&Ku)!=va){t-r>=by(n)*3&&(r=t);break}}return e.substring(0,r)}var Ra={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"},wy=Qe(Ra).map(e=>Ra[e]),xy=[...wy].join("|"),Ry=new RegExp(`^(${xy}$)`),Ey={svcAction:"svc_action",svcActionData:"svc_action_data"},Iy=e=>Qe(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ra[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),ky=e=>Ry.test(e),Py=[ky],Vu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Lu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},bo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Fy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Oy={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),bo),purchase:Object.assign(Object.assign({},Ee),bo),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},Ty=Qe(Vu).map(e=>Vu[e]),Dy=Qe(Lu).map(e=>Lu[e]),qy=Qe(Ee).map(e=>Ee[e]),jy=Qe(bo).map(e=>bo[e]),My=Qe(Ia).map(e=>Ia[e]),Ny=Qe(Ea).map(e=>Ea[e]),_y=[...Ty,"custom"].join("|"),Vy=[...Dy,"custom"].join("|"),Yu="(pr[0-9]+)",Ju="(il[0-9]+pi[0-9]+)",Ly=new RegExp(`^${Yu}(${_y})$`),Uy=new RegExp(`^(${Ju}(${Vy}))|(il[0-9]+nm)$`),Qy=new RegExp(`^(${qy.join("|")})$`),By=new RegExp(`^(${jy.join("|")})$`),$y=new RegExp(`^${Yu}custom$`),Hy=new RegExp(`^${Ju}custom$`),zy=new RegExp(`^(${[...Fy,...My,...Ny].join("|")})$`),Gy=e=>Ly.test(e),Wy=e=>Uy.test(e),Ky=e=>Qy.test(e),Yy=e=>By.test(e),Jy=e=>zy.test(e),Xy=[Wy,Gy,Ky,Yy,Jy],Zy=[$y,Hy],eh={anonymizeIp:"aip"},th={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},rh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},nh=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],oh=Object.assign(Object.assign(Object.assign(Object.assign({},eh),th),rh),nh.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ka=Object.assign(Object.assign({},oh),Ey),ih=e=>{let t=!!e.action&&Oy[e.action]||{};return Qe(e).reduce((r,n)=>{let o=t[n]||ka[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},ah=Qe(ka).map(e=>ka[e]),sh=e=>ah.indexOf(e)!==-1,ch=e=>e==="custom",uh=e=>[...Xy,...Py,sh,ch].some(t=>t(e)),lh=e=>Qe(e).reduce((t,r)=>{let n=dh(r);return n?Object.assign(Object.assign({},t),ph(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),dh=e=>{let t;return[...Zy].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},ph=(e,t)=>Qe(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()})}},Uu=A.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 Uu(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 Uu(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){ba()&&zu()?this.storage=new Ca:ba()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Ar),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 Ar,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},wo=class{constructor(){this.storage=new Ar,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},fh="xx",mh=e=>e?.startsWith(fh)||!1,gh=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
30
|
-
`;function $h(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Hh=["1",1,"yes",!0];function Lo(){let e=[];return Ma()&&e.push(window.doNotTrack),Wa()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Hh.indexOf(t)!==-1)}var ul="v15",ll={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function zh(e=ll.default,t=ul,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Gh="38824e1f-37f5-42d3-8372-a4b8fa9df946",rt=class{get defaultOptions(){return{endpoint:ll.default,isCustomEndpoint:!1,token:"",version:ul,beforeSendHooks:[],afterSendHooks:[]}}get version(){return il}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[My,ky].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Lo()?this.runtime=new Vo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(X.view,{newEventType:X.view,addClientIdParameter:!0}),this.addEventTypeMapping(X.click,{newEventType:X.click,addClientIdParameter:!0}),this.addEventTypeMapping(X.custom,{newEventType:X.custom,addClientIdParameter:!0}),this.addEventTypeMapping(X.search,{newEventType:X.search,addClientIdParameter:!0})}initRuntime(t){return Ma()&&Fr()?new za(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):($h()&&console.warn(Bh),new Ga(t))}get storage(){return this.runtime.storage}determineVisitorId(){return D(this,void 0,void 0,function*(){try{return Ma()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Kt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Kt()}})}getCurrentVisitorId(){return D(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return D(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return D(this,void 0,void 0,function*(){if(Mo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(zu(t,zu(r,Gh)))}})}getParameters(t,...r){return D(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return D(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Kt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Lo())return null;try{let r=new URL(t).searchParams.get(bt.cvo_cid);if(r==null)return null;let n=bt.fromString(r);return!n||!Fr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return D(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>D(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>D(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>i?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((b,R)=>D(this,void 0,void 0,function*(){let F=yield b;return yield R(t,F)}),y)].reduce((y,b)=>D(this,void 0,void 0,function*(){let R=yield y;return yield b(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return D(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Dh(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>D(this,void 0,void 0,function*(){let y=yield h;return yield S(y)}),Promise.resolve(r))})}makeEvent(t,...r){return D(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>D(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return D(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return D(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new qo().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.search,t)})}sendSearchEvent(t){return D(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lt(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.click,t)})}sendClickEvent(t){return D(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lt(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.custom,t)})}sendCustomEvent(t){return D(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=lt(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.view,t)})}sendViewEvent(t){return D(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return D(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return D(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[X.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(jh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=lt(t,["custom"]),o={};r&&Do(r)&&(o=this.lowercaseKeys(r));let i=_h(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=lt(t,["custom"]);if(r&&Do(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=lt(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==X.view||r==X.click||r==X.search||r==X.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==X.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=lt(t,["userId"]);return Qh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=lt(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Do(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Do(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?Ky(t,r):t}get baseUrl(){return zh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},dt;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(dt||(dt={}));var q;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(q||(q={}));var Zu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryErrorBack]:"errors",[q.queryErrorClear]:"errors",[q.queryErrorRetry]:"errors",[q.pagerNext]:"getMoreResults",[q.pagerPrevious]:"getMoreResults",[q.pagerNumber]:"getMoreResults",[q.pagerResize]:"getMoreResults",[q.pagerScrolling]:"getMoreResults",[q.facetSearch]:"facet",[q.facetShowLess]:"facet",[q.facetShowMore]:"facet",[q.recommendation]:"recommendation",[q.likeSmartSnippet]:"smartSnippet",[q.dislikeSmartSnippet]:"smartSnippet",[q.expandSmartSnippet]:"smartSnippet",[q.collapseSmartSnippet]:"smartSnippet",[q.openSmartSnippetFeedbackModal]:"smartSnippet",[q.closeSmartSnippetFeedbackModal]:"smartSnippet",[q.sendSmartSnippetReason]:"smartSnippet",[q.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.clearRecentQueries]:"recentQueries",[q.recentResultClick]:"recentlyClickedDocuments",[q.clearRecentResults]:"recentlyClickedDocuments",[q.showLessFoldedResults]:"folding",[q.caseDetach]:"case",[q.likeGeneratedAnswer]:"generatedAnswer",[q.dislikeGeneratedAnswer]:"generatedAnswer",[q.openGeneratedAnswerSource]:"generatedAnswer",[q.generatedAnswerStreamEnd]:"generatedAnswer",[q.generatedAnswerSourceHover]:"generatedAnswer",[q.generatedAnswerCopyToClipboard]:"generatedAnswer",[q.generatedAnswerHideAnswers]:"generatedAnswer",[q.generatedAnswerShowAnswers]:"generatedAnswer",[q.generatedAnswerExpand]:"generatedAnswer",[q.generatedAnswerCollapse]:"generatedAnswer",[q.generatedAnswerFeedbackSubmit]:"generatedAnswer",[q.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[dt.expandToFullUI]:"interface",[dt.openUserActions]:"User Actions",[dt.showPrecedingSessions]:"User Actions",[dt.showFollowingSessions]:"User Actions",[dt.clickViewedDocument]:"User Actions",[dt.clickPageView]:"User Actions",[dt.createArticle]:"createArticle"},Or=class{constructor(){this.runtime=new Vo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(X.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(X.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(X.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(X.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return il}};function Wh(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Yh(e){return e.map(t=>t.replace(/;/g,""))}function dl(e){let r=e.join(";");return r.length<=256?r:dl(e.slice(1))}var el=e=>{let t=Yh(e),r=Wh(t);return dl(r)};function tl(e){let t=typeof e.partialQueries=="string"?e.partialQueries:el(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:el(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Uo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Lo();this.coveoAnalyticsClient=n?new Or:new rt(t)}disable(){this.coveoAnalyticsClient=new Or}enable(){this.coveoAnalyticsClient=new rt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(q.interfaceLoad)}logInterfaceLoad(){return D(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(q.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(q.recommendation)}logRecommendation(){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(q.recommendationOpen,t,r)}logRecommendationOpen(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(q.staticFilterClearAll,t)}logStaticFilterClearAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(q.staticFilterSelect,t)}logStaticFilterSelect(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(q.staticFilterDeselect,t)}logStaticFilterDeselect(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(q.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return D(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(q.interfaceChange,t)}logInterfaceChange(t){return D(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(q.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return D(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(q.didyoumeanClick)}logDidYouMeanClick(){return D(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(q.resultsSort,t)}logResultsSort(t){return D(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(q.searchboxSubmit)}logSearchboxSubmit(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(q.searchboxClear)}logSearchboxClear(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(q.searchboxAsYouType)}logSearchboxAsYouType(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(q.breadcrumbFacet,t)}logBreadcrumbFacet(t){return D(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(q.breadcrumbResetAll)}logBreadcrumbResetAll(){return D(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(q.documentQuickview,t,r)}logDocumentQuickview(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(q.documentOpen,t,r)}logDocumentOpen(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(q.omniboxAnalytics,tl(t))}logOmniboxAnalytics(t){return D(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(q.omniboxFromLink,tl(t))}logOmniboxFromLink(t){return D(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(q.searchFromLink)}logSearchFromLink(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(q.triggerNotify,t)}logTriggerNotify(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(q.triggerExecute,t)}logTriggerExecute(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(q.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(q.undoTriggerQuery,t)}logUndoTriggerQuery(t){return D(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(q.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(q.pagerResize,t)}logPagerResize(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(q.pagerNumber,t)}logPagerNumber(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(q.pagerNext,t)}logPagerNext(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(q.pagerPrevious,t)}logPagerPrevious(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(q.pagerScrolling)}logPagerScrolling(){return D(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(q.facetClearAll,t)}logFacetClearAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(q.facetSearch,t)}logFacetSearch(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(q.facetSelect,t)}logFacetSelect(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(q.facetDeselect,t)}logFacetDeselect(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(q.facetExclude,t)}logFacetExclude(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(q.facetUnexclude,t)}logFacetUnexclude(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(q.facetSelectAll,t)}logFacetSelectAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(q.facetUpdateSort,t)}logFacetUpdateSort(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(q.facetShowMore,t)}logFacetShowMore(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(q.facetShowLess,t)}logFacetShowLess(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(q.queryError,t)}logQueryError(t){return D(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorBack);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorBack)})}})}logQueryErrorBack(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorRetry);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorRetry)})}})}logQueryErrorRetry(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorClear);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorClear)})}})}logQueryErrorClear(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(q.likeSmartSnippet)}logLikeSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(q.dislikeSmartSnippet)}logDislikeSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(q.expandSmartSnippet)}logExpandSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(q.collapseSmartSnippet)}logCollapseSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return D(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(q.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(q.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(q.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(q.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(q.copyToClipboard,t,r)}logCopyToClipboard(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(q.recentQueryClick)}logRecentQueryClick(){return D(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(q.clearRecentQueries)}logClearRecentQueries(){return D(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(q.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(q.clearRecentResults)}logClearRecentResults(){return D(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(q.noResultsBack)}logNoResultsBack(){return D(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(q.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(q.showLessFoldedResults)}logShowLessFoldedResults(){return D(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return D(this,arguments,void 0,function*(n,o,i=Zu[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),m=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(m);return{description:this.makeEventDescription(f,n),log:({searchUID:s})=>f.log({lastSearchQueryUid:s})}})}logCustomEvent(t,r){return D(this,arguments,void 0,function*(n,o,i=Zu[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return D(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return D(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return D(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof rt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(q.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(q.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(q.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return D(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(q.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(q.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(q.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(q.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(q.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(q.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(q.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(q.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(q.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return D(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(q.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Qo=Object.assign({},wn),rl=Object.keys(Qo).map(e=>Qo[e]),Pr=class extends _a{constructor({client:t,uuidGenerator:r=Kt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>rl.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(rl.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Qo.pageview,{newEventType:X.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Qo.event,{newEventType:X.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return th(this.ticket)}};Pr.Id="svc";var Bo;(function(e){e.click="click",e.flowStart="flowStart"})(Bo||(Bo={}));var $e;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})($e||($e={}));var $o;(function(e){e.quit="Quit",e.solved="Solved"})($o||($o={}));var Ho=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Lo();this.coveoAnalyticsClient=o?new rt(t):new Or,this.svc=new Pr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Or,this.svc=new Pr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new rt(this.options),this.svc=new Pr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction($e.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction($e.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction($e.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent($e.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent($e.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction($e.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction($e.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction($e.caseCancelled,{reason:$o.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction($e.caseSolved,{reason:$o.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction($e.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Bo.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Bo.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return D(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof rt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){var i,a;let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var pl=e=>new rt(e).getCurrentVisitorId(),En=(e,t)=>typeof t=="function"?(...r)=>{let n=cn(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,In=(e,t)=>(...r)=>{let n=cn(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();function zo(){return{desiredCount:5,numberOfValues:8,set:{}}}p();u();d();l();p();u();d();l();p();u();d();l();function fl(e){let{activeValue:t,ancestryMap:r}=Kh(e);return t?Jh(t,r):[]}function Kh(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function Jh(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var Xh=(e,t)=>e.categoryFacetSet[t]?.request;var Ja=(e,t)=>{let r=Xh(e,t);return fl(r?.currentValues??[])};p();u();d();l();function Go(){return{}}p();u();d();l();function Wo(){return{}}p();u();d();l();function Yo(){return{}}p();u();d();l();function Ko(){return{}}function Xa(e){return{facetSet:e.facetSet??Ko(),categoryFacetSet:e.categoryFacetSet??Go(),dateFacetSet:e.dateFacetSet??Wo(),numericFacetSet:e.numericFacetSet??Yo(),automaticFacetSet:e.automaticFacetSet??zo()}}var Za=e=>{let t=[];return tS(e).forEach((r,n)=>{let o=uS(e,r.facetId),i=sS(r,n+1);if(eS(r)){if(!!!Ja(e,r.facetId).length)return;t.push({...i,...iS(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=ml(a,m+1,o),s=Zh(r)?gl(a):nS(a);t.push({...i,...f,...s})})}),rS(e).forEach((r,n)=>{let o=aS(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=ml(i,a+1,"specific"),f=gl(i);t.push({...o,...m,...f})})}),t},Zh=e=>e.type==="specific",eS=e=>e.type==="hierarchical",tS=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),rS=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),ml=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),nS=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),gl=e=>({displayValue:e.value,value:e.value}),oS=(e,t)=>Ja(e,t).map(n=>n.value).join(";"),iS=(e,t)=>{let n=oS(e,t);return{value:n,valuePosition:1,displayValue:n}},aS=(e,t)=>({title:yl(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),sS=(e,t)=>({title:yl(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),yl=(e,t)=>`${e}_${t}`,cS=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,uS=(e,t)=>{let r=cS(e,t);return r?r.type:"specific"};p();u();d();l();var Jt=e=>{if(lS(e))return e.generatedAnswer?.answerId;if(dS(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},lS=e=>"answer"in e&&"generatedAnswer"in e&&!H(e.generatedAnswer?.answerConfigurationId),dS=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",hl=e=>e.generatedAnswer?.fieldsToIncludeInCitations,pS=de(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));p();u();d();l();var je=()=>({q:"",enableQuerySyntax:!1});p();u();d();l();p();u();d();l();var Sl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Sl||{}),vl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(vl||{}),es=e=>{if(Fc(e))return e.map(t=>es(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},Al=()=>({by:"relevancy"});var Uk=new Q({values:{by:new ea({enum:vl,required:!0}),order:new ea({enum:Sl}),field:new V}});function Jo(){return es(Al())}p();u();d();l();p();u();d();l();var Tr=()=>"default";var fS=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},pt=class{constructor(t){this.getState=t;oe(this,"state");this.state=t()}getLanguage(){return fS(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Tr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Fn=class Fn extends pt{constructor(){super(...arguments);oe(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Za(Xa(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Fn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Je().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Fn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Jt(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Jo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(s=>s.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||je().q}get responseTime(){return this.state.search?.duration||Je().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Je().response.totalCountFiltered}};oe(Fn,"fallbackPipelineName","default");var wt=Fn,Cl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Ie(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,s=i.configuration.analytics.enabled,g=new Uo({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:En(e,n),beforeSendHooks:[In(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return s||g.disable(),g},ts=()=>{let t=Be.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Xo=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield pl(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(ts()&&{pageId:ts()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Ir(e)})}}});return function Xo(_x0,_x1){return _ref8.apply(this,arguments)}}();p();u();d();l();p();u();d();l();p();u();d();l();var Dr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Pn=class extends pt{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:je().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||Dr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||Dr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||Dr().recommendations.length}};p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var bl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function mS(e){return typeof e=="string"&&bl.test(e)}var rs=mS;p();u();d();l();var Ce=[];for(let e=0;e<256;++e)Ce.push((e+256).toString(16).slice(1));function wl(e,t=0){return(Ce[e[t+0]]+Ce[e[t+1]]+Ce[e[t+2]]+Ce[e[t+3]]+"-"+Ce[e[t+4]]+Ce[e[t+5]]+"-"+Ce[e[t+6]]+Ce[e[t+7]]+"-"+Ce[e[t+8]]+Ce[e[t+9]]+"-"+Ce[e[t+10]]+Ce[e[t+11]]+Ce[e[t+12]]+Ce[e[t+13]]+Ce[e[t+14]]+Ce[e[t+15]]).toLowerCase()}p();u();d();l();var ns,gS=new Uint8Array(16);function os(){if(!ns){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ns=crypto.getRandomValues.bind(crypto)}return ns(gS)}p();u();d();l();p();u();d();l();var yS=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),is={randomUUID:yS};function hS(e,t,r){if(is.randomUUID&&!t&&!e)return is.randomUUID();e=e||{};let n=e.random??e.rng?.()??os();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return wl(n)}var as=hS;p();u();d();l();function xl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function SS({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var Rl="visitorId";function vS(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(Rl),o=n&&rs(n)?n:t.generateUUID();return r.setItem(Rl,o),o}}}var kl="1.2.7",ss=128,Ol=192,El=224,Il=240,AS=248;function CS(e){return(e&AS)===Il?4:(e&Il)===El?3:(e&El)===Ol?2:1}function bS(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&ss)!=ss)break;if(r-=3,(n&Ol)!=ss){t-r>=CS(n)*3&&(r=t);break}}return e.substring(0,r)}function wS(e){let{trackingId:t}=e;return{trackingId:t}}function xS(e){return(e.source||[]).concat([`relay@${kl}`])}function Tl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=wS(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:xS(t),clientId:f,userAgent:a(),referrer:Fl(o()),location:Fl(i())})}function Fl(e){return e!==null?bS(e,1024):null}function RS(e,t,r,n,o){return{...t,meta:Tl(e,r,n,o)}}var ES="*";function IS(){let e=[];function t({type:f,callback:s}){return e.findIndex(g=>g.type===f&&g.callback===s)}function r(f,s){return f.type==="*"||s===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(s=>{if(r(s,f.meta.type))try{s.callback(f)}catch(g){console.error(g)}})}function i(f){if(f===ES)e.length=0;else for(let s=e.length-1;s>=0;s--)e[s].type===f&&e.splice(s,1)}function a(f){let s=t(f);s>=0&&e.splice(s,1)}function m(f,s){s?a({type:f,callback:s}):i(f)}return{add:n,call:o,remove:m}}function Pl({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function FS(e){let t=Pl(e);return{get:()=>t,update:r=>{t=Pl({...t,...r})}}}var cs=PS();function PS(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function kS(){return{getItem(e){return cs.getItem(e)||localStorage.getItem(e)},removeItem(e){cs.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),cs.setItem(e,t,31556952e3)}}}function OS(){let e=document.referrer;return e===""?null:e}function us(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(xl().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>OS(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>as(),storage:kS()}}function TS(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function DS(){return{getItem(){return null},removeItem(){},setItem(){}}}function qS(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:DS()}}function MS(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=qS();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&NS()&&TS()?us():n}function NS(){try{return typeof window=="object"}catch{return!1}}function jS(e){return{get:()=>Object.freeze(MS(e))}}function Dl(e){let t=FS(e),r=IS(),n=jS(t),o=vS(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),s=RS(i,a,m,f,o);return SS({config:m,environment:f,event:s,listenerManager:r})},getMeta:i=>Tl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:kl}}p();u();d();l();function ql(){return typeof window<"u"&&typeof document<"u"}var kn=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Ir(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=VS(m);return Dl({mode:i?"emit":"disabled",url:o??to(e,t),token:r,trackingId:n??null,source:a,environment:f})}),_S={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},VS=e=>{if(!e)return;let t=e();return{...(ql()?us():_S),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};p();u();d();l();var On=class extends pt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Ml=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new On(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Ie(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,s=i.configuration.analytics.enabled,g=new Ho({enableAnalytics:s,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:En(e,n),beforeSendHooks:[In(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return s||g.disable(),g};p();u();d();l();p();u();d();l();function Nl(e,t){return{...new wt(t).getBaseMetadata(),actionCause:e,type:e}}function LS(e){return Object.assign(e,{instantlyCallable:!0})}function US(e,t){let r=i=>LS(re(e,i)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:s,logger:g}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:s,logger:g})).log({state:a(),extra:m})});return function(_x10,_x11){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:s,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:s,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(h,{getState:S,extra:y}){return yield g({state:S(),extra:y})});return function(_x13,_x14){return _ref1.apply(this,arguments)}}())}});return function prepare(_x12){return _ref0.apply(this,arguments)}}()}),n}var jl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return $S(i)}return n},QS=e=>e.configuration.analytics.analyticsMode==="legacy",BS=e=>e.configuration.analytics.analyticsMode==="next",$S=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),US(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:s,logger:g}){let h=[],S={log:function(){var _ref11=_asyncToGenerator(function*({state:x}){for(let I of h)yield I(x)});return function log(_x16){return _ref11.apply(this,arguments)}}()},y=m(),b=i({getState:m,logger:g,analyticsClientMiddleware:f,preprocessRequest:s,provider:r(m)}),R=yield t(b,m());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){QS(x)&&(yield HS(R,r,x,g,b.coveoAnalyticsClient))});return function(_x17){return _ref12.apply(this,arguments)}}());let{emit:F}=kn(y);return h.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(x){if(BS(x)&&o&&n){let I=n(x);yield XS(F,o,I)}});return function(_x18){return _ref13.apply(this,arguments)}}()),S});return function(_x15){return _ref10.apply(this,arguments)}}()));function HS(_x19,_x20,_x21,_x22,_x23){return _HS.apply(this,arguments)}function _HS(){_HS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _HS.apply(this,arguments)}var zS=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(i){r(n,o)});return function log(_x24){return _ref14.apply(this,arguments)}}()}),Fe=jl(e=>Cl({...e,provider:e.provider||new wt(e.getState)}),e=>e,wt),JD=jl(Ml,zS("caseAssist"),On);var ls=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return GS(e,r,t)};function GS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:KS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:JS(e),queryPipeline:r.pipeline||wr()}}var Zo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),_l={urihash:new V,sourcetype:new V,permanentid:new V},Vl={uniqueId:U,raw:new Q({values:_l}),title:U,uri:U,clickUri:U,rankingModifier:new V({required:!1,emptyAllowed:!0})};function WS(e){return Object.assign({},...Object.keys(_l).map(t=>({[t]:e[t]})))}function YS(e){return Object.assign({},...Object.keys(Vl).map(t=>({[t]:e[t]})),{raw:WS(e.raw)})}function KS(e){let t=e.raw.author;return H(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function JS(e){let t=e.raw.source;return H(t)?"unknown":t}var ds=e=>new ke(Vl).validate(YS(e));function XS(_x25,_x26,_x27){return _XS.apply(this,arguments)}function _XS(){_XS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _XS.apply(this,arguments)}p();u();d();l();var Ll=()=>Fe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Pn(e)),Ul=()=>({actionCause:"recommendationInterfaceLoad"}),ti=e=>Fe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(ds(e),t.makeRecommendationOpen(ls(e,r),Zo(e))),__legacy__provider:t=>new Pn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ls(e,t),n=Zo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var qr=T("recommendation/set",e=>N(e,{id:U})),xt=re("recommendation/get",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield ZS(o),m=yield n.recommendations(a),f=Date.now()-i;return Oe(m)?r(m.error):{recommendations:m.success.results,analyticsAction:Ll(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x28,_x29){return _ref15.apply(this,arguments)}}()),ZS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Be.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield ev(e,Ul()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function ZS(_x30){return _ref16.apply(this,arguments)}}(),ev=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Xo(e.configuration.analytics,r)});return function ev(_x31,_x32){return _ref17.apply(this,arguments)}}();var Mr=le(Dr(),e=>{e.addCase(qr,(t,r)=>{t.id=r.payload.id}).addCase(xt.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(xt.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(xt.pending,t=>{t.isLoading=!0}).addCase(Po,(t,r)=>{t.error=r.payload,t.isLoading=!1})});p();u();d();l();var Nr=T("searchHub/set",e=>N(e,new V({required:!0,emptyAllowed:!0})));p();u();d();l();var jr=le(Tr(),e=>{e.addCase(Nr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(et,(t,r)=>r.payload.searchHub||t)});p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();function Ql(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Bl=Xe;function td(e,t){if(e===t||!(Bl(e)&&Bl(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=td(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function _r(e){let t=0;for(let r in e)t++;return t}var $l=e=>[].concat(...e);function tv(e){return new RegExp("(^|:)//").test(e)}function rv(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function oi(e){return e!=null}function nv(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var ov=e=>e.replace(/\/$/,""),iv=e=>e.replace(/^\//,"");function av(e,t){if(!e)return t;if(!t)return e;if(tv(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=ov(e),t=iv(t),`${e}${r}${t}`}function sv(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Hl=(...e)=>v(...e),cv=e=>e.status>=200&&e.status<=299,uv=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function zl(e){if(!Xe(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function rd({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=Hl,paramsSerializer:n,isJsonContentType:o=uv,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:s,...g}={}){return typeof v>"u"&&r===Hl&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(S,y,b){let{getState:R,extra:F,endpoint:x,forced:I,type:w}=y,E,{url:M,headers:k=new C(g.headers),params:P=void 0,responseHandler:O=f??"json",validateStatus:j=s??cv,timeout:_=m,...L}=typeof S=="string"?{url:S}:S,B,z=y.signal;_&&(B=new c.AbortController,y.signal.addEventListener("abort",B.abort),z=B.signal);let W={...g,signal:z,...L};k=new C(zl(k)),W.headers=(yield t(k,{getState:R,arg:S,extra:F,endpoint:x,forced:I,type:w,extraOptions:b}))||k;let G=ee=>typeof ee=="object"&&(Xe(ee)||Array.isArray(ee)||typeof ee.toJSON=="function");if(!W.headers.has("content-type")&&G(W.body)&&W.headers.set("content-type",i),G(W.body)&&o(W.headers)&&(W.body=JSON.stringify(W.body,a)),P){let ee=~M.indexOf("?")?"&":"?",ie=n?n(P):new URLSearchParams(zl(P));M+=ee+ie}M=av(e,M);let Y=new Request(M,W);E={request:new Request(M,W)};let Z,fe=!1,we=B&&setTimeout(()=>{fe=!0,B.abort()},_);try{Z=yield r(Y)}catch(ee){return{error:{status:fe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ee)},meta:E}}finally{we&&clearTimeout(we),B?.signal.removeEventListener("abort",B.abort)}let Me=Z.clone();E.response=Me;let ue,se="";try{let ee;if(yield Promise.all([h(Z,O).then(ie=>ue=ie,ie=>ee=ie),Me.text().then(ie=>se=ie,()=>{})]),ee)throw ee}catch(ee){return{error:{status:"PARSING_ERROR",originalStatus:Z.status,data:se,error:String(ee)},meta:E}}return j(Z,ue)?{data:ue,meta:E}:{error:{status:Z.status,data:ue},meta:E}});return function(_x33,_x34,_x35){return _ref18.apply(this,arguments)}}());function h(_x36,_x37){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,y){if(typeof y=="function")return y(S);if(y==="content-type"&&(y=o(S.headers)?"json":"text"),y==="json"){let b=yield S.text();return b.length?JSON.parse(b):null}return S.text()});return _h2.apply(this,arguments)}}var Vr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function lv(){return _lv.apply(this,arguments)}function _lv(){_lv=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _lv.apply(this,arguments)}function dv(e,t){throw Object.assign(new Vr({error:e,meta:t}),{throwImmediately:!0})}var Gl={},pv=(e,t)=>(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Gl).maxRetries,(o||Gl).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:lv,retryCondition:(g,h,{attempt:S})=>S<=a,...t,...o},s=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new Vr(g);return g}catch(g){if(s++,g.throwImmediately){if(g instanceof Vr)return g.value;throw g}if(g instanceof Vr&&!f.retryCondition(g.value.error,r,{attempt:s,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(s,f.maxRetries)}});return function(_x38,_x39,_x40){return _ref19.apply(this,arguments)}}()),nd=Object.assign(pv,{fail:dv}),gs=T("__rtkq/focused"),od=T("__rtkq/unfocused"),ys=T("__rtkq/online"),id=T("__rtkq/offline");function hs(e){return e.type==="query"}function fv(e){return e.type==="mutation"}function Ss(e){return e.type==="infinitequery"}function vs(e,t,r,n,o,i){return mv(e)?e(t,r,n,o).filter(oi).map(ps).map(i):Array.isArray(e)?e.map(ps).map(i):[]}function mv(e){return typeof e=="function"}function ps(e){return typeof e=="string"?{type:e}:e}function gv(e,t){return e.catch(t)}var qn=Symbol("forceQueryFn"),fs=e=>typeof e[qn]=="function";function yv({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:s,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:I,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:y,getRunningMutationsThunk:b};function h(E,M){return k=>{let P=i.endpointDefinitions[E],O=e({queryArgs:M,endpointDefinition:P,endpointName:E});return a.get(k)?.[O]}}function S(E,M){return k=>m.get(k)?.[M]}function y(){return E=>Object.values(a.get(E)||{}).filter(oi)}function b(){return E=>Object.values(m.get(E)||{}).filter(oi)}function R(E){}function F(E,M){let k=(P,{subscribe:O=!0,forceRefetch:j,subscriptionOptions:_,[qn]:L,...B}={})=>(z,W)=>{let G=e({queryArgs:P,endpointDefinition:M,endpointName:E}),Y,te={...B,type:"query",subscribe:O,forceRefetch:j,subscriptionOptions:_,endpointName:E,originalArgs:P,queryCacheKey:G,[qn]:L};if(hs(M))Y=t(te);else{let{direction:pe,initialPageParam:en}=B;Y=r({...te,direction:pe,initialPageParam:en})}let Z=o.endpoints[E].select(P),fe=z(Y),we=Z(W());let{requestId:Me,abort:ue}=fe,se=we.requestId!==Me,ee=a.get(z)?.[G],ie=()=>Z(W()),Pe=Object.assign(L?fe.then(ie):se&&!ee?Promise.resolve(we):Promise.all([ee,fe]).then(ie),{arg:P,requestId:Me,subscriptionOptions:_,queryCacheKey:G,abort:ue,unwrap(){return _asyncToGenerator(function*(){let pe=yield Pe;if(pe.isError)throw pe.error;return pe.data})()},refetch:()=>z(k(P,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&z(f({queryCacheKey:G,requestId:Me}))},updateSubscriptionOptions(pe){Pe.subscriptionOptions=pe,z(g({endpointName:E,requestId:Me,queryCacheKey:G,options:pe}))}});if(!ee&&!se&&!L){let pe=sv(a,z,{});pe[G]=Pe,Pe.then(()=>{delete pe[G],_r(pe)||a.delete(z)})}return Pe};return k}function x(E,M){return F(E,M)}function I(E,M){return F(E,M)}function w(E){return(M,{track:k=!0,fixedCacheKey:P}={})=>(O,j)=>{let _=n({type:"mutation",endpointName:E,originalArgs:M,track:k,fixedCacheKey:P}),L=O(_);let{requestId:B,abort:z,unwrap:W}=L,G=gv(L.unwrap().then(fe=>({data:fe})),fe=>({error:fe})),Y=()=>{O(s({requestId:B,fixedCacheKey:P}))},te=Object.assign(G,{arg:L.arg,requestId:B,abort:z,unwrap:W,reset:Y}),Z=m.get(O)||{};return m.set(O,Z),Z[B]=te,te.then(()=>{delete Z[B],_r(Z)||m.delete(O)}),P&&(Z[P]=te,te.then(()=>{Z[P]===te&&(delete Z[P],_r(Z)||m.delete(O))})),te}}}function hv(e){return e}var ri=(e={})=>({...e,[An]:!0});function Sv({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(O,j,_,L)=>(B,z)=>{let W=r[O],G=n({queryArgs:j,endpointDefinition:W,endpointName:O});if(B(o.internalActions.queryResultPatched({queryCacheKey:G,patches:_})),!L)return;let Y=o.endpoints[O].select(j)(z()),te=vs(W.providesTags,Y.data,void 0,j,{},i);B(o.internalActions.updateProvidedBy({queryCacheKey:G,providedTags:te}))};function f(O,j,_=0){let L=[j,...O];return _&&L.length>_?L.slice(0,-1):L}function s(O,j,_=0){let L=[...O,j];return _&&L.length>_?L.slice(1):L}let g=(O,j,_,L=!0)=>(B,z)=>{let G=o.endpoints[O].select(j)(z()),Y={patches:[],inversePatches:[],undo:()=>B(o.util.patchQueryData(O,j,Y.inversePatches,L))};if(G.status==="uninitialized")return Y;let te;if("data"in G)if(De(G.data)){let[Z,fe,we]=go(G.data,_);Y.patches.push(...fe),Y.inversePatches.push(...we),te=Z}else te=_(G.data),Y.patches.push({op:"replace",path:[],value:te}),Y.inversePatches.push({op:"replace",path:[],value:G.data});return Y.patches.length===0||B(o.util.patchQueryData(O,j,Y.patches,L)),Y},h=(O,j,_)=>L=>L(o.endpoints[O].initiate(j,{subscribe:!1,forceRefetch:!0,[qn]:()=>({data:_})})),S=(O,j)=>O.query&&O[j]?O[j]:hv,y=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(O,{signal:j,abort:_,rejectWithValue:L,fulfillWithValue:B,dispatch:z,getState:W,extra:G}){let Y=r[O.endpointName];try{let te=S(Y,"transformResponse"),Z={signal:j,abort:_,dispatch:z,getState:W,extra:G,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?b(O,W()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},fe=O.type==="query"?O[qn]:void 0,we,Me=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(se,ee,ie,Pe){if(ee==null&&se.pages.length)return Promise.resolve({data:se});let pe={queryArg:O.originalArgs,pageParam:ee},en=yield ue(pe),gt=Pe?f:s;return{data:{pages:gt(se.pages,en.data,ie),pageParams:gt(se.pageParams,ee,ie)}}});return function Me(_x43,_x44,_x45,_x46){return _ref21.apply(this,arguments)}}();function ue(_x47){return _ue.apply(this,arguments)}function _ue(){_ue=_asyncToGenerator(function*(se){let ee,{extraOptions:ie}=Y;if(fe?ee=fe():Y.query?ee=yield t(Y.query(se),Z,ie):ee=yield Y.queryFn(se,Z,ie,pe=>t(pe,Z,ie)),typeof process<"u",ee.error)throw new Vr(ee.error,ee.meta);let Pe=yield te(ee.data,ee.meta,se);return{...ee,data:Pe}});return _ue.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in Y){let{infiniteQueryOptions:se}=Y,{maxPages:ee=1/0}=se,ie,Pe={pages:[],pageParams:[]},pe=a.selectQueryEntry(W(),O.queryCacheKey)?.data,gt=b(O,W())&&!O.direction||!pe?Pe:pe;if("direction"in O&&O.direction&>.pages.length){let Gn=O.direction==="backward",Hi=(Gn?ad:ms)(se,gt);ie=yield Me(gt,Hi,ee,Gn)}else{let{initialPageParam:Gn=se.initialPageParam}=O,$i=pe?.pageParams??[],Hi=$i[0]??Gn,tm=$i.length;ie=yield Me(gt,Hi,ee),fe&&(ie={data:ie.data.pages[0]});for(let ac=1;ac<tm;ac++){let rm=ms(se,ie.data);ie=yield Me(ie.data,rm,ee)}}we=ie}else we=yield ue(O.originalArgs);return B(we.data,ri({fulfilledTimeStamp:Date.now(),baseQueryMeta:we.meta}))}catch(te){let Z=te;if(Z instanceof Vr){let fe=S(Y,"transformErrorResponse");try{return L(yield fe(Z.value,Z.meta,O.originalArgs),ri({baseQueryMeta:Z.meta}))}catch(we){Z=we}}throw typeof process<"u",console.error(Z),Z}});return function y(_x41,_x42){return _ref20.apply(this,arguments)}}();function b(O,j){let _=a.selectQueryEntry(j,O.queryCacheKey),L=a.selectConfig(j).refetchOnMountOrArgChange,B=_?.fulfilledTimeStamp,z=O.forceRefetch??(O.subscribe&&L);return z?z===!0||(Number(new Date)-Number(B))/1e3>=z:!1}let R=()=>re(`${e}/executeQuery`,y,{getPendingMeta({arg:j}){let _=r[j.endpointName];return ri({startedTimeStamp:Date.now(),...(Ss(_)?{direction:j.direction}:{})})},condition(j,{getState:_}){let L=_(),B=a.selectQueryEntry(L,j.queryCacheKey),z=B?.fulfilledTimeStamp,W=j.originalArgs,G=B?.originalArgs,Y=r[j.endpointName],te=j.direction;return fs(j)?!0:B?.status==="pending"?!1:b(j,L)||hs(Y)&&Y?.forceRefetch?.({currentArg:W,previousArg:G,endpointState:B,state:L})?!0:!(z&&!te)},dispatchConditionRejection:!0}),F=R(),x=R(),I=re(`${e}/executeMutation`,y,{getPendingMeta(){return ri({startedTimeStamp:Date.now()})}}),w=O=>"force"in O,E=O=>"ifOlderThan"in O,M=(O,j,_)=>(L,B)=>{let z=w(_)&&_.force,W=E(_)&&_.ifOlderThan,G=(te=!0)=>{let Z={forceRefetch:te,isPrefetch:!0};return o.endpoints[O].initiate(j,Z)},Y=o.endpoints[O].select(j)(B());if(z)L(G());else if(W){let te=Y?.fulfilledTimeStamp;if(!te){L(G());return}(Number(new Date)-Number(new Date(te)))/1e3>=W&&L(G())}else L(G(!1))};function k(O){return j=>j?.meta?.arg?.endpointName===O}function P(O,j){return{matchPending:yr(vo(O),k(j)),matchFulfilled:yr(ct(O),k(j)),matchRejected:yr(Gt(O),k(j))}}return{queryThunk:F,mutationThunk:I,infiniteQueryThunk:x,prefetch:M,updateQueryData:g,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:P}}function ms(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function ad(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function sd(e,t,r,n){return vs(r[e.meta.arg.endpointName][t],ct(e)?e.payload:void 0,bn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function ni(e,t,r){let n=e[t];n&&r(n)}function Mn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Wl(e,t,r){let n=e[Mn(t)];n&&r(n)}var Tn={};function vv({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:s}){let g=T(`${e}/resetApiState`);function h(k,P,O,j){var _;k[_=P.queryCacheKey]??(k[_]={status:"uninitialized",endpointName:P.endpointName}),ni(k,P.queryCacheKey,L=>{L.status="pending",L.requestId=O&&L.requestId?L.requestId:j.requestId,P.originalArgs!==void 0&&(L.originalArgs=P.originalArgs),L.startedTimeStamp=j.startedTimeStamp;let B=o[j.arg.endpointName];Ss(B)&&"direction"in P&&(L.direction=P.direction)})}function S(k,P,O,j){ni(k,P.arg.queryCacheKey,_=>{if(_.requestId!==P.requestId&&!j)return;let{merge:L}=o[P.arg.endpointName];if(_.status="fulfilled",L){if(_.data!==void 0){let{fulfilledTimeStamp:B,arg:z,baseQueryMeta:W,requestId:G}=P,Y=st(_.data,te=>L(te,O,{arg:z.originalArgs,baseQueryMeta:W,fulfilledTimeStamp:B,requestId:G}));_.data=Y}else _.data=O;}else _.data=o[P.arg.endpointName].structuralSharing??!0?td(Ne(_.data)?wa(_.data):_.data,O):O;delete _.error,_.fulfilledTimeStamp=P.fulfilledTimeStamp})}let y=Wt({name:`${e}/queries`,initialState:Tn,reducers:{removeQueryResult:{reducer(k,{payload:{queryCacheKey:P}}){delete k[P]},prepare:hr()},cacheEntriesUpserted:{reducer(k,P){for(let O of P.payload){let{queryDescription:j,value:_}=O;h(k,j,!0,{arg:j,requestId:P.meta.requestId,startedTimeStamp:P.meta.timestamp}),S(k,{arg:j,requestId:P.meta.requestId,fulfilledTimeStamp:P.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:k=>({payload:k.map(j=>{let{endpointName:_,arg:L,value:B}=j,z=o[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:j.arg,queryCacheKey:n({queryArgs:L,endpointDefinition:z,endpointName:_})},value:B}}),meta:{[An]:!0,requestId:Co(),timestamp:Date.now()}})},queryResultPatched:{reducer(k,{payload:{queryCacheKey:P,patches:O}}){ni(k,P,j=>{j.data=Ra(j.data,O.concat())})},prepare:hr()}},extraReducers(k){k.addCase(t.pending,(P,{meta:O,meta:{arg:j}})=>{let _=fs(j);h(P,j,_,O)}).addCase(t.fulfilled,(P,{meta:O,payload:j})=>{let _=fs(O.arg);S(P,O,j,_)}).addCase(t.rejected,(P,{meta:{condition:O,arg:j,requestId:_},error:L,payload:B})=>{ni(P,j.queryCacheKey,z=>{if(!O){if(z.requestId!==_)return;z.status="rejected",z.error=B??L}})}).addMatcher(m,(P,O)=>{let{queries:j}=a(O);for(let[_,L]of Object.entries(j))(L?.status==="fulfilled"||L?.status==="rejected")&&(P[_]=L)})}}),b=Wt({name:`${e}/mutations`,initialState:Tn,reducers:{removeMutationResult:{reducer(k,{payload:P}){let O=Mn(P);O in k&&delete k[O]},prepare:hr()}},extraReducers(k){k.addCase(r.pending,(P,{meta:O,meta:{requestId:j,arg:_,startedTimeStamp:L}})=>{_.track&&(P[Mn(O)]={requestId:j,status:"pending",endpointName:_.endpointName,startedTimeStamp:L})}).addCase(r.fulfilled,(P,{payload:O,meta:j})=>{j.arg.track&&Wl(P,j,_=>{_.requestId===j.requestId&&(_.status="fulfilled",_.data=O,_.fulfilledTimeStamp=j.fulfilledTimeStamp)})}).addCase(r.rejected,(P,{payload:O,error:j,meta:_})=>{_.arg.track&&Wl(P,_,L=>{L.requestId===_.requestId&&(L.status="rejected",L.error=O??j)})}).addMatcher(m,(P,O)=>{let{mutations:j}=a(O);for(let[_,L]of Object.entries(j))(L?.status==="fulfilled"||L?.status==="rejected")&&_!==L?.requestId&&(P[_]=L)})}}),R=Wt({name:`${e}/invalidation`,initialState:Tn,reducers:{updateProvidedBy:{reducer(k,P){var _,L;let{queryCacheKey:O,providedTags:j}=P.payload;for(let B of Object.values(k))for(let z of Object.values(B)){let W=z.indexOf(O);W!==-1&&z.splice(W,1)}for(let{type:B,id:z}of j){let W=(_=k[B]??(k[B]={}))[L=z||"__internal_without_id"]??(_[L]=[]);W.includes(O)||W.push(O)}},prepare:hr()}},extraReducers(k){k.addCase(y.actions.removeQueryResult,(P,{payload:{queryCacheKey:O}})=>{for(let j of Object.values(P))for(let _ of Object.values(j)){let L=_.indexOf(O);L!==-1&&_.splice(L,1)}}).addMatcher(m,(P,O)=>{var _,L;let{provided:j}=a(O);for(let[B,z]of Object.entries(j))for(let[W,G]of Object.entries(z)){let Y=(_=P[B]??(P[B]={}))[L=W||"__internal_without_id"]??(_[L]=[]);for(let te of G)Y.includes(te)||Y.push(te)}}).addMatcher(Ze(ct(t),bn(t)),(P,O)=>{let j=sd(O,"providesTags",o,f),{queryCacheKey:_}=O.meta.arg;R.caseReducers.updateProvidedBy(P,R.actions.updateProvidedBy({queryCacheKey:_,providedTags:j}))})}}),F=Wt({name:`${e}/subscriptions`,initialState:Tn,reducers:{updateSubscriptionOptions(k,P){},unsubscribeQueryResult(k,P){},internal_getRTKQSubscriptions(){}}}),x=Wt({name:`${e}/internalSubscriptions`,initialState:Tn,reducers:{subscriptionsUpdated:{reducer(k,P){return Ra(k,P.payload)},prepare:hr()}}}),I=Wt({name:`${e}/config`,initialState:{online:nv(),focused:rv(),middlewareRegistered:!1,...s},reducers:{middlewareRegistered(k,{payload:P}){k.middlewareRegistered=k.middlewareRegistered==="conflict"||i!==P?"conflict":!0}},extraReducers:k=>{k.addCase(ys,P=>{P.online=!0}).addCase(id,P=>{P.online=!1}).addCase(gs,P=>{P.focused=!0}).addCase(od,P=>{P.focused=!1}).addMatcher(m,P=>({...P}))}}),w=dr({queries:y.reducer,mutations:b.reducer,provided:R.reducer,subscriptions:x.reducer,config:I.reducer}),E=(k,P)=>w(g.match(P)?void 0:k,P),M={...I.actions,...y.actions,...F.actions,...x.actions,...b.actions,...R.actions,resetApiState:g};return{reducer:E,actions:M}}var Dn=Symbol.for("RTKQ/skipToken"),cd={status:"uninitialized"},Yl=st(cd,()=>{}),Kl=st(cd,()=>{});function Av({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Yl,o=w=>Kl;return{buildQuerySelector:S,buildInfiniteQuerySelector:y,buildMutationSelector:b,selectInvalidatedBy:R,selectCachedArgsForQuery:F,selectApiState:a,selectQueries:m,selectMutations:s,selectQueryEntry:f,selectConfig:g};function i(w){return{...w,...Ql(w.status)}}function a(w){return w[t]}function m(w){return a(w)?.queries}function f(w,E){return m(w)?.[E]}function s(w){return a(w)?.mutations}function g(w){return a(w)?.config}function h(w,E,M){return k=>{if(k===Dn)return r(n,M);let P=e({queryArgs:k,endpointDefinition:E,endpointName:w});return r(j=>f(j,P)??Yl,M)}}function S(w,E){return h(w,E,i)}function y(w,E){let{infiniteQueryOptions:M}=E;function k(P){let O={...P,...Ql(P.status)},{isLoading:j,isError:_,direction:L}=O,B=L==="forward",z=L==="backward";return{...O,hasNextPage:x(M,O.data),hasPreviousPage:I(M,O.data),isFetchingNextPage:j&&B,isFetchingPreviousPage:j&&z,isFetchNextPageError:_&&B,isFetchPreviousPageError:_&&z}}return h(w,E,k)}function b(){return w=>{let E;return typeof w=="object"?E=Mn(w)??Dn:E=w,r(E===Dn?o:P=>a(P)?.mutations?.[E]??Kl,i)}}function R(w,E){let M=w[t],k=new Set;for(let P of E.filter(oi).map(ps)){let O=M.provided[P.type];if(!O)continue;let j=(P.id!==void 0?O[P.id]:$l(Object.values(O)))??[];for(let _ of j)k.add(_)}return $l(Array.from(k.values()).map(P=>{let O=M.queries[P];return O?[{queryCacheKey:P,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function F(w,E){return Object.values(m(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function x(w,E){return E?ms(w,E)!=null:!1}function I(w,E){return!E||!w.getPreviousPageParam?!1:ad(w,E)!=null}}var Jl=WeakMap?new WeakMap:void 0,Xl=({endpointName:e,queryArgs:t})=>{let r="",n=Jl?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Xe(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));Xe(t)&&Jl?.set(t,o),r=o}return`${e}(${r})`};function Cv(...e){return function(r){let n=gr(s=>r.extractRehydrationInfo?.(s,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(s){let g=Xl;if("serializeQueryArgs"in s.endpointDefinition){let h=s.endpointDefinition.serializeQueryArgs;g=S=>{let y=h(S);return typeof y=="string"?y:Xl({...S,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(s)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(s){s()},apiUid:Co(),extractRehydrationInfo:n,hasRehydrationInfo:gr(s=>n(s)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:s,endpoints:g}){if(s)for(let h of s)o.tagTypes.includes(h)||o.tagTypes.push(h);if(g)for(let[h,S]of Object.entries(g))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(s=>s.init(a,o,i));function f(s){let g=s.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(g)){if(s.overrideExisting!==!0&&h in i.endpointDefinitions){if(s.overrideExisting==="throw")throw new Error(Ge(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let y of m)y.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ft(e,...t){return Object.assign(e,...t)}var bv=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(y,b)=>{var F,x;if(a.match(b)){let{queryCacheKey:I,requestId:w,options:E}=b.payload;return y?.[I]?.[w]&&(y[I][w]=E),!0}if(m.match(b)){let{queryCacheKey:I,requestId:w}=b.payload;return y[I]&&delete y[I][w],!0}if(e.internalActions.removeQueryResult.match(b))return delete y[b.payload.queryCacheKey],!0;if(t.pending.match(b)){let{meta:{arg:I,requestId:w}}=b,E=y[F=I.queryCacheKey]??(y[F]={});return E[`${w}_running`]={},I.subscribe&&(E[w]=I.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(b)||t.rejected.match(b)){let I=y[b.meta.arg.queryCacheKey]||{},w=`${b.meta.requestId}_running`;R||(R=!!I[w]),delete I[w]}if(t.rejected.match(b)){let{meta:{condition:I,arg:w,requestId:E}}=b;if(I&&w.subscribe){let M=y[x=w.queryCacheKey]??(y[x]={});M[E]=w.subscriptionOptions??M[E]??{},R=!0}}return R},s=()=>r.currentSubscriptions,S={getSubscriptions:s,getSubscriptionCount:y=>{let R=s()[y]??{};return _r(R)},isRequestSubscribed:(y,b)=>!!s()?.[y]?.[b]};return(y,b)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(y))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(y))return[!1,S];let R=f(r.currentSubscriptions,y),F=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=go(o,()=>w);b.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof y.type=="string"&&!!y.type.startsWith(n),I=t.rejected.match(y)&&y.meta.condition&&!!y.meta.arg.subscribe;F=!x&&!I}return[F,!1]}};function wv(e){for(let t in e)return!1;return!0}var xv=2147483647/1e3-1,Rv=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:s}=t.internalActions,g=Ze(f.match,r.fulfilled,r.rejected,s.match);function h(F){let x=o.currentSubscriptions[F];return!!x&&!wv(x)}let S={},y=(F,x,I)=>{let w=x.getState(),E=a(w);if(g(F)){let M;if(s.match(F))M=F.payload.map(k=>k.queryDescription.queryCacheKey);else{let{queryCacheKey:k}=f.match(F)?F.payload:F.meta.arg;M=[k]}b(M,x,E)}if(t.util.resetApiState.match(F))for(let[M,k]of Object.entries(S))k&&clearTimeout(k),delete S[M];if(n.hasRehydrationInfo(F)){let{queries:M}=n.extractRehydrationInfo(F);b(Object.keys(M),x,E)}};function b(F,x,I){let w=x.getState();for(let E of F){let M=i(w,E);R(E,M?.endpointName,x,I)}}function R(F,x,I,w){let M=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let k=Math.max(0,Math.min(M,xv));if(!h(F)){let P=S[F];P&&clearTimeout(P),S[F]=setTimeout(()=>{h(F)||I.dispatch(m({queryCacheKey:F})),delete S[F]},k*1e3)}}return y},Zl=new Error("Promise never resolved before cacheEntryRemoved."),Ev=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=Ao(n),s=Ao(o),g=ct(n,o),h={};function S(x,I,w){let E=h[x];E?.valueResolved&&(E.valueResolved({data:I,meta:w}),delete E.valueResolved)}function y(x){let I=h[x];I&&(delete h[x],I.cacheEntryRemoved())}let b=(x,I,w)=>{let E=R(x);function M(k,P,O,j){let _=a(w,P),L=a(I.getState(),P);!_&&L&&F(k,j,P,I,O)}if(n.pending.match(x))M(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:k,value:P}of x.payload){let{endpointName:O,originalArgs:j,queryCacheKey:_}=k;M(O,_,x.meta.requestId,j),S(_,P,{})}else if(o.pending.match(x))I.getState()[t].mutations[E]&&F(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,I,x.meta.requestId);else if(g(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))y(E);else if(e.util.resetApiState.match(x))for(let k of Object.keys(h))y(k)};function R(x){return f(x)?x.meta.arg.queryCacheKey:s(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?Mn(x.payload):""}function F(x,I,w,E,M){let k=r.endpointDefinitions[x],P=k?.onCacheEntryAdded;if(!P)return;let O={},j=new Promise(G=>{O.cacheEntryRemoved=G}),_=Promise.race([new Promise(G=>{O.valueResolved=G}),j.then(()=>{throw Zl})]);_.catch(()=>{}),h[w]=O;let L=e.endpoints[x].select(k.type==="query"?I:w),B=E.dispatch((G,Y,te)=>te),z={...E,getCacheEntry:()=>L(E.getState()),requestId:M,extra:B,updateCachedData:k.type==="query"?G=>E.dispatch(e.util.updateQueryData(x,I,G)):void 0,cacheDataLoaded:_,cacheEntryRemoved:j},W=P(I,z);Promise.resolve(W).catch(G=>{if(G!==Zl)throw G})}return b},Iv=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Fv=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:s}=i.internalActions,g=Ze(ct(n),bn(n)),h=Ze(ct(n,o),Gt(n,o)),S=[],y=(F,x)=>{g(F)?R(sd(F,"invalidatesTags",r,a),x):h(F)?R([],x):i.util.invalidateTags.match(F)&&R(vs(F.payload,void 0,void 0,void 0,void 0,a),x)};function b(F){let{queries:x,mutations:I}=F;for(let w of[x,I])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(F,x){let I=x.getState(),w=I[e];if(S.push(...F),w.config.invalidationBehavior==="delayed"&&b(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(I,E);t.batch(()=>{let k=Array.from(M.values());for(let{queryCacheKey:P}of k){let O=w.queries[P],j=f.currentSubscriptions[P]??{};O&&(_r(j)===0?x.dispatch(s({queryCacheKey:P})):O.status!=="uninitialized"&&x.dispatch(m(O)))}})}return y},Pv=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(y,b)=>{(r.internalActions.updateSubscriptionOptions.match(y)||r.internalActions.unsubscribeQueryResult.match(y))&&s(y.payload,b),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&s(y.meta.arg,b),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&f(y.meta.arg,b),r.util.resetApiState.match(y)&&h()};function m(y,b){let F=b.getState()[e].queries[y],x=o.currentSubscriptions[y];if(!(!F||F.status==="uninitialized"))return x}function f({queryCacheKey:y},b){let R=b.getState()[e],F=R.queries[y],x=o.currentSubscriptions[y];if(!F||F.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(I))return;let E=i[y];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+I;i[y]={nextPollTimestamp:M,pollingInterval:I,timeout:setTimeout(()=>{(R.config.focused||!w)&&b.dispatch(n(F)),f({queryCacheKey:y},b)},I)}}function s({queryCacheKey:y},b){let F=b.getState()[e].queries[y],x=o.currentSubscriptions[y];if(!F||F.status==="uninitialized")return;let{lowestPollingInterval:I}=S(x);if(!Number.isFinite(I)){g(y);return}let w=i[y],E=Date.now()+I;(!w||E<w.nextPollTimestamp)&&f({queryCacheKey:y},b)}function g(y){let b=i[y];b?.timeout&&clearTimeout(b.timeout),delete i[y]}function h(){for(let y of Object.keys(i))g(y)}function S(y={}){let b=!1,R=Number.POSITIVE_INFINITY;for(let F in y)y[F].pollingInterval&&(R=Math.min(y[F].pollingInterval,R),b=y[F].skipPollingIfUnfocused||b);return{lowestPollingInterval:R,skipPollingIfUnfocused:b}}return a},kv=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=vo(r,n),i=Gt(r,n),a=ct(r,n),m={};return(s,g)=>{if(o(s)){let{requestId:h,arg:{endpointName:S,originalArgs:y}}=s.meta,b=t.endpointDefinitions[S],R=b?.onQueryStarted;if(R){let F={},x=new Promise((M,k)=>{F.resolve=M,F.reject=k});x.catch(()=>{}),m[h]=F;let I=e.endpoints[S].select(b.type==="query"?y:h),w=g.dispatch((M,k,P)=>P),E={...g,getCacheEntry:()=>I(g.getState()),requestId:h,extra:w,updateCachedData:b.type==="query"?M=>g.dispatch(e.util.updateQueryData(S,y,M)):void 0,queryFulfilled:x};R(y,E)}}else if(a(s)){let{requestId:h,baseQueryMeta:S}=s.meta;m[h]?.resolve({data:s.payload,meta:S}),delete m[h]}else if(i(s)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:y}=s.meta;m[h]?.reject({error:s.payload??s.error,isUnhandledError:!S,meta:y}),delete m[h]}}},Ov=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,s)=>{gs.match(f)&&m(s,"refetchOnFocus"),ys.match(f)&&m(s,"refetchOnReconnect")};function m(f,s){let g=f.getState()[e],h=g.queries,S=o.currentSubscriptions;t.batch(()=>{for(let y of Object.keys(S)){let b=h[y],R=S[y];if(!R||!b)continue;(Object.values(R).some(x=>x[s]===!0)||Object.values(R).every(x=>x[s]===void 0)&&g.config[s])&&(_r(R)===0?f.dispatch(i({queryCacheKey:y})):b.status!=="uninitialized"&&f.dispatch(n(b)))}})}return a};function Tv(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[Iv,Rv,Fv,Pv,Ev,kv];return{middleware:h=>{let S=!1,b={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:m},R=f.map(I=>I(b)),F=bv(b),x=Ov(b);return I=>w=>{if(!co(w))return I(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:I},M=h.getState(),[k,P]=F(w,E,M),O;if(k?O=I(w):O=P,h.getState()[t]&&(x(w,E,M),m(w)||o.hasRehydrationInfo(w)))for(let j of R)j(w,E,M);return O}},actions:a};function g(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var ed=Symbol(),Dv=({createSelector:e=de}={})=>({name:ed,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:s,invalidationBehavior:g},h){lu();let S=ue=>(typeof process<"u",ue);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ys,onOffline:id,onFocus:gs,onFocusLost:od},util:{}});let y=Av({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:b,selectCachedArgsForQuery:R,buildQuerySelector:F,buildInfiniteQuerySelector:x,buildMutationSelector:I}=y;ft(t.util,{selectInvalidatedBy:b,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:k,updateQueryData:P,upsertQueryData:O,prefetch:j,buildMatchThunkActions:_}=Sv({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:y}),{reducer:L,actions:B}=vv({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:s,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});ft(t.util,{patchQueryData:k,updateQueryData:P,upsertQueryData:O,prefetch:j,resetApiState:B.resetApiState,upsertQueryEntries:B.cacheEntriesUpserted}),ft(t.internalActions,B);let{middleware:z,actions:W}=Tv({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:y});ft(t.util,W),ft(t,{reducer:L,middleware:z});let{buildInitiateQuery:G,buildInitiateInfiniteQuery:Y,buildInitiateMutation:te,getRunningMutationThunk:Z,getRunningMutationsThunk:fe,getRunningQueriesThunk:we,getRunningQueryThunk:Me}=yv({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ft(t.util,{getRunningMutationThunk:Z,getRunningMutationsThunk:fe,getRunningQueryThunk:Me,getRunningQueriesThunk:we}),{name:ed,injectEndpoint(ue,se){var Pe;let ie=(Pe=t.endpoints)[ue]??(Pe[ue]={});hs(se)&&ft(ie,{name:ue,select:F(ue,se),initiate:G(ue,se)},_(w,ue)),fv(se)&&ft(ie,{name:ue,select:I(),initiate:te(ue)},_(M,ue)),Ss(se)&&ft(ie,{name:ue,select:x(ue,se),initiate:Y(ue,se)},_(w,ue))}}}}),ud=Cv(Dv());p();u();d();l();var ii=e=>e.query,ld=e=>e.query?.enableQuerySyntax;var Rq=de(e=>ii(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),qv=de(e=>e.generatedAnswer?.answerApiQueryParams,e=>e??Dn);p();u();d();l();p();u();d();l();var ai=e=>Fe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Jt(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Jt(t)??"",answerGenerated:e??!1})}),si=()=>Fe({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Jt(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});p();u();d();l();p();u();d();l();var dd=de(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});p();u();d();l();var ci=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:Ir(e)}});p();u();d();l();var pd=e=>e.context;p();u();d();l();var fd=e=>e.pipeline;p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var md=60,gd=md*60,yd=gd*24,Mv=yd*7,Xt=1e3,Lr=md*Xt,As=gd*Xt,hd=yd*Xt,Sd=Mv*Xt,Zt="millisecond",Rt="second",_e="minute",Et="hour",Ve="day",Ur="week",be="month",er="quarter",nt="year",It="date",vd="YYYY-MM-DDTHH:mm:ssZ",Cs="Invalid Date",Ad=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Cd=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;p();u();d();l();var wd={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var r=["th","st","nd","rd"],n=t%100;return"["+t+(r[(n-20)%10]||r[n]||r[0])+"]"}};p();u();d();l();var bs=function(t,r,n){var o=String(t);return!o||o.length>=r?t:""+Array(r+1-o.length).join(n)+t},Nv=function(t){var r=-t.utcOffset(),n=Math.abs(r),o=Math.floor(n/60),i=n%60;return(r<=0?"+":"-")+bs(o,2,"0")+":"+bs(i,2,"0")},jv=function e(t,r){if(t.date()<r.date())return-e(r,t);var n=(r.year()-t.year())*12+(r.month()-t.month()),o=t.clone().add(n,be),i=r-o<0,a=t.clone().add(n+(i?-1:1),be);return+(-(n+(r-o)/(i?o-a:a-o))||0)},_v=function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},Vv=function(t){var r={M:be,y:nt,w:Ur,d:Ve,D:It,h:Et,m:_e,s:Rt,ms:Zt,Q:er};return r[t]||String(t||"").toLowerCase().replace(/s$/,"")},Lv=function(t){return t===void 0},xd={s:bs,z:Nv,m:jv,a:_v,p:Vv,u:Lv};var Nn="en",tr={};tr[Nn]=wd;var Rd="$isDayjsObject",ws=function(t){return t instanceof li||!!(t&&t[Rd])},ui=function e(t,r,n){var o;if(!t)return Nn;if(typeof t=="string"){var i=t.toLowerCase();tr[i]&&(o=i),r&&(tr[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var m=t.name;tr[m]=t,o=m}return!n&&o&&(Nn=o),o||!n&&Nn},me=function(t,r){if(ws(t))return t.clone();var n=typeof r=="object"?r:{};return n.date=t,n.args=arguments,new li(n)},Uv=function(t,r){return me(t,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})},ae=xd;ae.l=ui;ae.i=ws;ae.w=Uv;var Qv=function(t){var r=t.date,n=t.utc;if(r===null)return new Date(NaN);if(ae.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var o=r.match(Ad);if(o){var i=o[2]-1||0,a=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)}}return new Date(r)},li=function(){function e(r){this.$L=ui(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[Rd]=!0}var t=e.prototype;return t.parse=function(n){this.$d=Qv(n),this.init()},t.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},t.$utils=function(){return ae},t.isValid=function(){return this.$d.toString()!==Cs},t.isSame=function(n,o){var i=me(n);return this.startOf(o)<=i&&i<=this.endOf(o)},t.isAfter=function(n,o){return me(n)<this.startOf(o)},t.isBefore=function(n,o){return this.endOf(o)<me(n)},t.$g=function(n,o,i){return ae.u(n)?this[o]:this.set(i,n)},t.unix=function(){return Math.floor(this.valueOf()/1e3)},t.valueOf=function(){return this.$d.getTime()},t.startOf=function(n,o){var i=this,a=ae.u(o)?!0:o,m=ae.p(n),f=function(x,I){var w=ae.w(i.$u?Date.UTC(i.$y,I,x):new Date(i.$y,I,x),i);return a?w:w.endOf(Ve)},s=function(x,I){var w=[0,0,0,0],E=[23,59,59,999];return ae.w(i.toDate()[x].apply(i.toDate("s"),(a?w:E).slice(I)),i)},g=this.$W,h=this.$M,S=this.$D,y="set"+(this.$u?"UTC":"");switch(m){case nt:return a?f(1,0):f(31,11);case be:return a?f(1,h):f(0,h+1);case Ur:{var b=this.$locale().weekStart||0,R=(g<b?g+7:g)-b;return f(a?S-R:S+(6-R),h)}case Ve:case It:return s(y+"Hours",0);case Et:return s(y+"Minutes",1);case _e:return s(y+"Seconds",2);case Rt:return s(y+"Milliseconds",3);default:return this.clone()}},t.endOf=function(n){return this.startOf(n,!1)},t.$set=function(n,o){var i,a=ae.p(n),m="set"+(this.$u?"UTC":""),f=(i={},i[Ve]=m+"Date",i[It]=m+"Date",i[be]=m+"Month",i[nt]=m+"FullYear",i[Et]=m+"Hours",i[_e]=m+"Minutes",i[Rt]=m+"Seconds",i[Zt]=m+"Milliseconds",i)[a],s=a===Ve?this.$D+(o-this.$W):o;if(a===be||a===nt){var g=this.clone().set(It,1);g.$d[f](s),g.init(),this.$d=g.set(It,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](s);return this.init(),this},t.set=function(n,o){return this.clone().$set(n,o)},t.get=function(n){return this[ae.p(n)]()},t.add=function(n,o){var i=this,a;n=Number(n);var m=ae.p(o),f=function(S){var y=me(i);return ae.w(y.date(y.date()+Math.round(S*n)),i)};if(m===be)return this.set(be,this.$M+n);if(m===nt)return this.set(nt,this.$y+n);if(m===Ve)return f(1);if(m===Ur)return f(7);var s=(a={},a[_e]=Lr,a[Et]=As,a[Rt]=Xt,a)[m]||1,g=this.$d.getTime()+n*s;return ae.w(g,this)},t.subtract=function(n,o){return this.add(n*-1,o)},t.format=function(n){var o=this,i=this.$locale();if(!this.isValid())return i.invalidDate||Cs;var a=n||vd,m=ae.z(this),f=this.$H,s=this.$m,g=this.$M,h=i.weekdays,S=i.months,y=i.meridiem,b=function(w,E,M,k){return w&&(w[E]||w(o,a))||M[E].slice(0,k)},R=function(w){return ae.s(f%12||12,w,"0")},F=y||function(I,w,E){var M=I<12?"AM":"PM";return E?M.toLowerCase():M},x=function(w){switch(w){case"YY":return String(o.$y).slice(-2);case"YYYY":return ae.s(o.$y,4,"0");case"M":return g+1;case"MM":return ae.s(g+1,2,"0");case"MMM":return b(i.monthsShort,g,S,3);case"MMMM":return b(S,g);case"D":return o.$D;case"DD":return ae.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return b(i.weekdaysMin,o.$W,h,2);case"ddd":return b(i.weekdaysShort,o.$W,h,3);case"dddd":return h[o.$W];case"H":return String(f);case"HH":return ae.s(f,2,"0");case"h":return R(1);case"hh":return R(2);case"a":return F(f,s,!0);case"A":return F(f,s,!1);case"m":return String(s);case"mm":return ae.s(s,2,"0");case"s":return String(o.$s);case"ss":return ae.s(o.$s,2,"0");case"SSS":return ae.s(o.$ms,3,"0");case"Z":return m;default:break}return null};return a.replace(Cd,function(I,w){return w||x(I)||m.replace(":","")})},t.utcOffset=function(){return-Math.round(this.$d.getTimezoneOffset()/15)*15},t.diff=function(n,o,i){var a=this,m=ae.p(o),f=me(n),s=(f.utcOffset()-this.utcOffset())*Lr,g=this-f,h=function(){return ae.m(a,f)},S;switch(m){case nt:S=h()/12;break;case be:S=h();break;case er:S=h()/3;break;case Ur:S=(g-s)/Sd;break;case Ve:S=(g-s)/hd;break;case Et:S=g/As;break;case _e:S=g/Lr;break;case Rt:S=g/Xt;break;default:S=g;break}return i?S:ae.a(S)},t.daysInMonth=function(){return this.endOf(be).$D},t.$locale=function(){return tr[this.$L]},t.locale=function(n,o){if(!n)return this.$L;var i=this.clone(),a=ui(n,o,!0);return a&&(i.$L=a),i},t.clone=function(){return ae.w(this.$d,this)},t.toDate=function(){return new Date(this.valueOf())},t.toJSON=function(){return this.isValid()?this.toISOString():null},t.toISOString=function(){return this.$d.toISOString()},t.toString=function(){return this.$d.toUTCString()},e}(),Ed=li.prototype;me.prototype=Ed;[["$ms",Zt],["$s",Rt],["$m",_e],["$H",Et],["$W",Ve],["$M",be],["$y",nt],["$D",It]].forEach(function(e){Ed[e[1]]=function(t){return this.$g(t,e[0],e[1])}});me.extend=function(e,t){return e.$i||(e(t,li,me),e.$i=!0),me};me.locale=ui;me.isDayjs=ws;me.unix=function(e){return me(e*1e3)};me.en=tr[Nn];me.Ls=tr;me.p={};var Le=me;p();u();d();l();var Id=function(e,t){var r=t.prototype;r.quarter=function(i){return this.$utils().u(i)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+(i-1)*3)};var n=r.add;r.add=function(i,a){i=Number(i);var m=this.$utils().p(a);return m===er?this.add(i*3,be):n.bind(this)(i,a)};var o=r.startOf;r.startOf=function(i,a){var m=this.$utils(),f=m.u(a)?!0:a,s=m.p(i);if(s===er){var g=this.quarter()-1;return f?this.month(g*3).startOf(be).startOf(Ve):this.month(g*3+2).endOf(be).endOf(Ve)}return o.bind(this)(i,a)}};p();u();d();l();p();u();d();l();p();u();d();l();var Bv=function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(r,n,o){return n||o.slice(1)})},$v={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Fd=function(t,r){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(n,o,i){var a=i&&i.toUpperCase();return o||r[i]||$v[i]||Bv(r[a])})};var Hv=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,Pd=/\d/,jn=/\d\d/,zv=/\d{3}/,Gv=/\d{4}/,We=/\d\d?/,Wv=/[+-]?\d+/,Yv=/[+-]\d\d:?(\d\d)?|Z/,_n=/\d*[^-_:/,()\s\d]+/,Ft={},Td=function(t){return t=+t,t+(t>68?1900:2e3)};function Kv(e){if(!e||e==="Z")return 0;var t=e.match(/([+-]|\d\d)/g),r=+(t[1]*60)+(+t[2]||0);return r===0?0:t[0]==="+"?-r:r}var Re=function(t){return function(r){this[t]=+r}},kd=[Yv,function(e){var t=this.zone||(this.zone={});t.offset=Kv(e)}],xs=function(t){var r=Ft[t];return r&&(r.indexOf?r:r.s.concat(r.f))},Od=function(t,r){var n,o=Ft,i=o.meridiem;if(!i)n=t===(r?"pm":"PM");else for(var a=1;a<=24;a+=1)if(t.indexOf(i(a,0,r))>-1){n=a>12;break}return n},Jv={A:[_n,function(e){this.afternoon=Od(e,!1)}],a:[_n,function(e){this.afternoon=Od(e,!0)}],Q:[Pd,function(e){this.month=(e-1)*3+1}],S:[Pd,function(e){this.milliseconds=+e*100}],SS:[jn,function(e){this.milliseconds=+e*10}],SSS:[zv,function(e){this.milliseconds=+e}],s:[We,Re("seconds")],ss:[We,Re("seconds")],m:[We,Re("minutes")],mm:[We,Re("minutes")],H:[We,Re("hours")],h:[We,Re("hours")],HH:[We,Re("hours")],hh:[We,Re("hours")],D:[We,Re("day")],DD:[jn,Re("day")],Do:[_n,function(e){var t=Ft,r=t.ordinal,n=e.match(/\d+/);if(this.day=n[0],!!r)for(var o=1;o<=31;o+=1)r(o).replace(/\[|\]/g,"")===e&&(this.day=o)}],w:[We,Re("week")],ww:[jn,Re("week")],M:[We,Re("month")],MM:[jn,Re("month")],MMM:[_n,function(e){var t=xs("months"),r=xs("monthsShort"),n=(r||t.map(function(o){return o.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[_n,function(e){var t=xs("months"),r=t.indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],Y:[Wv,Re("year")],YY:[jn,function(e){this.year=Td(e)}],YYYY:[Gv,Re("year")],Z:kd,ZZ:kd};function Xv(e){var t=e.afternoon;if(t!==void 0){var r=e.hours;t?r<12&&(e.hours+=12):r===12&&(e.hours=0),delete e.afternoon}}function Zv(e){e=Fd(e,Ft&&Ft.formats);for(var t=e.match(Hv),r=t.length,n=0;n<r;n+=1){var o=t[n],i=Jv[o],a=i&&i[0],m=i&&i[1];m?t[n]={regex:a,parser:m}:t[n]=o.replace(/^\[|\]$/g,"")}return function(f){for(var s={},g=0,h=0;g<r;g+=1){var S=t[g];if(typeof S=="string")h+=S.length;else{var y=S.regex,b=S.parser,R=f.slice(h),F=y.exec(R),x=F[0];b.call(s,x),f=f.replace(x,"")}}return Xv(s),s}}var eA=function(t,r,n,o){try{if(["x","X"].indexOf(r)>-1)return new Date((r==="X"?1e3:1)*t);var i=Zv(r),a=i(t),m=a.year,f=a.month,s=a.day,g=a.hours,h=a.minutes,S=a.seconds,y=a.milliseconds,b=a.zone,R=a.week,F=new Date,x=s||(!m&&!f?F.getDate():1),I=m||F.getFullYear(),w=0;m&&!f||(w=f>0?f-1:F.getMonth());var E=g||0,M=h||0,k=S||0,P=y||0;if(b)return new Date(Date.UTC(I,w,x,E,M,k,P+b.offset*60*1e3));if(n)return new Date(Date.UTC(I,w,x,E,M,k,P));var O;return O=new Date(I,w,x,E,M,k,P),R&&(O=o(O).week(R).toDate()),O}catch{return new Date("")}},Dd=function(e,t,r){r.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(Td=e.parseTwoDigitYear);var n=t.prototype,o=n.parse;n.parse=function(i){var a=i.date,m=i.utc,f=i.args;this.$u=m;var s=f[1];if(typeof s=="string"){var g=f[2]===!0,h=f[3]===!0,S=g||h,y=f[2];h&&(y=f[2]),Ft=this.$locale(),!g&&y&&(Ft=r.Ls[y]),this.$d=eA(a,s,m,r),this.init(),y&&y!==!0&&(this.$L=this.locale(y).$L),S&&a!=this.format(s)&&(this.$d=new Date("")),Ft={}}else if(s instanceof Array)for(var b=s.length,R=1;R<=b;R+=1){f[1]=s[R-1];var F=r.apply(this,f);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}R===b&&(this.$d=new Date(""))}else o.call(this,i)}};Le.extend(Dd);var qd="YYYY/MM/DD@HH:mm:ss",tA="1401-01-01";function Qr(e,t){let r=Le(e,t);return!r.isValid()&&!t?Le(e,qd):r}function di(e){return e.format(qd)}function Md(e,t){let r=Qr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}Rs(r)}function Rs(e){if(e.isBefore(tA))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Le.extend(Id);var Nd=["past","now","next"],jd=["minute","hour","day","week","month","quarter","year"],rA=e=>{let t=e==="now";return{amount:new $({required:!t,min:1}),unit:new V({required:!t,constrainTo:jd}),period:new V({required:!0,constrainTo:Nd})}};function Es(e){if(typeof e=="string"&&!Pt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Qd(e):e;new ke(rA(t.period)).validate(t);let r=Vd(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Rs(r)}function _d(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Vd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return Le().subtract(r,n);case"next":return Le().add(r,n);case"now":return Le()}}function Vn(e){return di(Vd(Qd(e)))}function Ld(e){return e.toLocaleLowerCase().split("-")}function Pt(e){let[t,r,n]=Ld(e);if(t==="now")return!0;if(!Nd.includes(t)||!jd.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Ud(e){return!!e&&typeof e=="object"&&"period"in e}function Qd(e){let[t,r,n]=Ld(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}p();u();d();l();function Bd(e){return e.type==="dateRange"}function $d(e){return`start${e}`}function Hd(e){return`end${e}`}var Is=()=>({dateFacetValueMap:{}});function nA(e,t,r){let n=e.start,o=e.end;return Pt(n)&&(n=Vn(n),r.dateFacetValueMap[t][$d(n)]=e.start),Pt(o)&&(o=Vn(o),r.dateFacetValueMap[t][Hd(o)]=e.end),{...e,start:n,end:o}}function Fs(e,t){if(Bd(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>nA(o,r,t))}}return e}function kt(e){let t=Is();return{request:{...e,facets:e.facets?.map(n=>Fs(n,t))},mappings:t}}function oA(e,t,r){return{...e,start:r.dateFacetValueMap[t][$d(e.start)]||e.start,end:r.dateFacetValueMap[t][Hd(e.end)]||e.end}}function iA(e,t){return e.facetId in t.dateFacetValueMap}function aA(e,t){return iA(e,t)?{...e,values:e.values.map(r=>oA(r,e.facetId,t))}:e}function pi(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>aA(n,t))}}:e}p();u();d();l();p();u();d();l();p();u();d();l();function Ot(e){return Object.values(e).map(t=>t.request)}function Ps(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function zd(e){return Ot(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ks={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function sA(e){return Ot(e).map(t=>{let r=ks[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function cA(e){return[...sA(e.facetSet??{}),...zd(e.numericFacetSet??{}),...zd(e.dateFacetSet??{}),...Ot(e.categoryFacetSet??{})]}function uA(e){return cA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function fi(e){return Ps(uA(e),e.facetOrder??[])}p();u();d();l();p();u();d();l();var Tt=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Be.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Xo(e.configuration.analytics,t))),...(e.excerptLength&&!H(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Tt(_x48,_x49){return _ref22.apply(this,arguments)}}();p();u();d();l();var Br=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&ci(e.configuration.analytics,t,r)),...(e.excerptLength&&!H(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});p();u();d();l();var Gd=de(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Dt=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=Ts(e),o=lA(e),i=dA(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Tt(e,r):Br(e,t,r);return kt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Os(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Dt(_x50,_x51,_x52){return _ref23.apply(this,arguments)}}();function Os(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function lA(e){return Ps(fA(e),e.facetOrder??[])}function dA(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(pA).filter(r=>r.currentValues.length>0):void 0}function pA(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function fA(e){return mA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function mA(e){return[...gA(e.facetSet??{}),...Wd(e.numericFacetSet??{}),...Wd(e.dateFacetSet??{}),...Ot(e.categoryFacetSet??{})]}function gA(e){return Ot(e).map(t=>{let r=ks[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Wd(e){return Ot(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Ts(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Gd(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}p();u();d();l();p();u();d();l();var Ln=(e,t)=>{let r=e;return H(r[t])?H(e.raw[t])?null:e.raw[t]:r[t]},yA=e=>t=>e.every(r=>!H(Ln(t,r))),hA=e=>t=>e.every(r=>H(Ln(t,r))),SA=(e,t)=>r=>{let n=Yd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},vA=(e,t)=>r=>{let n=Yd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Yd=(e,t)=>{let r=Ln(t,e);return Pc(r)?r:[r]},Kd={getResultProperty:Ln,fieldsMustBeDefined:yA,fieldsMustNotBeDefined:hA,fieldMustMatch:SA,fieldMustNotMatch:vA};var Jd=de(e=>e.search,e=>e?.searchAction?.actionCause||"");p();u();d();l();var Xd=e=>e.searchHub;p();u();d();l();var Ds=de(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),_j=de(e=>e,e=>{let t=Ds(e);return t&&e?e[t].expression:""});p();u();d();l();var Zd=e=>e.configuration.search.locale,ep=e=>e.configuration.search.timezone;p();u();d();l();var tp=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};p();u();d();l();var rp=e=>e.excerptLength?.length;p();u();d();l();var np=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};p();u();d();l();var op=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};p();u();d();l();var ip=e=>e.sortCriteria;var ap=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Ie(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ap(_x53){return _ref24.apply(this,arguments)}}(),sp=(e,t)=>{let r=ii(e)?.q,{aq:n,cq:o,dq:i,lq:a}=bA(e),m=pd(e),f=ci(e.configuration.analytics,t,{actionCause:Jd(e)}),s=Xd(e),g=fd(e),h=hl(e)??[],S=AA(e),y=Ds(e.tabSet)||"default",b=Zd(e),R=ep(e),F=t.referrer||"",x=np(e),I=ip(e),w=CA(e),E=rp(e),M=op(e),k=tp(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:ld(e)}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(s?.length&&{searchHub:s}),...(g?.length&&{pipeline:g}),...(S.length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Os(e),firstResult:e.pagination.firstResult}),tab:y,locale:b,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:F,...w,...(M??{}),...(E&&{excerptLength:E}),...(k&&{dictionaryFieldContext:k}),sortCriteria:I,...(x&&{facetOptions:x}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},AA=e=>fi(e)?.map(t=>Fs(t,Is())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),CA=e=>({actionsHistory:e.configuration.analytics.enabled?Be.getInstance().getHistory():[]}),bA=e=>{let t=dd(e),r=Ts(e);return{...t,...(r&&{cq:r})}};p();u();d();l();var cp=["text/plain","text/markdown"];var $r=new V({required:!0}),lp=new V,Hr=new K({required:!0}),wA={id:$r,title:$r,uri:$r,permanentid:$r,clickUri:lp},dp=new V({required:!0,constrainTo:cp}),nV=T("generatedAnswer/setIsVisible",e=>N(e,Hr)),pp=T("generatedAnswer/setAnswerId",e=>N(e,U)),oV=T("generatedAnswer/setAnswerGenerationMode",e=>N(e,new V({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),iV=T("generatedAnswer/setIsEnabled",e=>N(e,Hr)),Ms=T("generatedAnswer/updateMessage",e=>N(e,{textDelta:$r})),Ns=T("generatedAnswer/updateCitations",e=>N(e,{citations:new J({required:!0,each:new Q({values:wA})})})),xA=T("generatedAnswer/updateError",e=>N(e,{message:lp,code:new $({min:0})})),fp=T("generatedAnswer/resetAnswer"),aV=T("generatedAnswer/like"),sV=T("generatedAnswer/dislike"),cV=T("generatedAnswer/feedbackModal/open"),uV=T("generatedAnswer/expand"),lV=T("generatedAnswer/collapse"),dV=T("generatedAnswer/setId",e=>N(e,{id:new V({required:!0})})),pV=T("generatedAnswer/feedbackModal/close"),fV=T("generatedAnswer/sendFeedback"),qs=T("generatedAnswer/setIsLoading",e=>N(e,Hr)),up=T("generatedAnswer/setIsStreaming",e=>N(e,Hr)),js=T("generatedAnswer/setAnswerContentFormat",e=>N(e,dp)),mV=T("generatedAnswer/updateResponseFormat",e=>N(e,{contentFormat:new J({each:dp,default:["text/plain"]})})),gV=T("knowledge/updateAnswerConfigurationId",e=>N(e,$r)),yV=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>N(e,bo)),RA=T("generatedAnswer/setIsAnswerGenerated",e=>N(e,Hr)),_s=T("generatedAnswer/setCannotAnswer",e=>N(e,Hr)),EA=T("generatedAnswer/setAnswerApiQueryParams",e=>N(e,new Q({}))),hV=re("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,s=yield ap(r),g=(y,b)=>{switch(y){case"genqa.headerMessageType":{let R=JSON.parse(b);n(js(R.contentFormat));break}case"genqa.messageType":n(Ms(JSON.parse(b)));break;case"genqa.citationsType":n(Ns(JSON.parse(b)));break;case"genqa.endOfStreamType":{let R=JSON.parse(b).answerGenerated,F=m.length!==0&&!R;n(_s(F)),n(up(!1)),n(RA(R)),n(ai(R)),n(si());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(qs(!0));let h=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(s,{write:y=>{h(s)&&(n(qs(!1)),y.payload&&y.payloadType&&g(y.payloadType,y.payload))},abort:y=>{h(s)&&n(xA(y))},close:()=>{h(s)&&n(up(!1))},resetAnswer:()=>{h(s)&&n(fp())}});S?f(S):n(qs(!1))});return function(_x54,_x55){return _ref25.apply(this,arguments)}}()),SV=re("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(fp());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=sp(i,n);r(EA(a)),yield r(mp(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x56,_x57){return _ref26.apply(this,arguments)}}());p();u();d();l();p();u();d();l();function yp(_x58,_x59){return _yp.apply(this,arguments)}function _yp(){_yp=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _yp.apply(this,arguments)}function hp(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=FA(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let s=-1;for(;r<m&&s===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,s=r;break;case 10:s=r;break}if(s===-1)break;e(t.subarray(f,s),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Sp(e,t,r){let n=gp(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=gp();else if(m>0){let f=o.decode(a.subarray(0,m)),s=m+(a[m+1]===32?2:1),g=o.decode(a.subarray(s));switch(f){case"data":n.data=n.data?`${n.data}
|
|
31
|
-
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":IA(g,n,t);break}}}}function IA(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function FA(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function gp(){return{data:"",event:"",id:"",retry:void 0}}var Vs="text/event-stream",PA=1e3,vp="last-event-id";function Ap(){return typeof window<"u"}function Cp(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:m,fetch:f,...s}){return new Promise((g,h)=>{let S={...r};S.accept||(S.accept=Vs);let y;function b(){y?.abort(),document.hidden||E()}!m&&Ap()&&document.addEventListener("visibilitychange",b);let R=PA,F;function x(){Ap()&&document.removeEventListener("visibilitychange",b),clearTimeout(F),y?.abort()}t?.addEventListener("abort",()=>{x(),g()});let I=f??v,w=n??kA;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){y=c.AbortController?new c.AbortController:null;try{let M=yield I(e,{...s,headers:S,signal:y?.signal});yield w(M),yield yp(M.body,hp(Sp(k=>{k?S[vp]=k:delete S[vp]},k=>{R=k},o))),i?.(),x(),g()}catch(M){if(!y?.signal?.aborted)try{let k=a?.(M)??R;clearTimeout(F),F=setTimeout(E,k)}catch(k){x(),h(k)}}});return _E.apply(this,arguments)}E()})}function kA(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vs))throw new Error(`Expected content-type to be ${Vs}, Actual: ${t}`)}p();u();d();l();var OA=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,m=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let s=Ie(a,i);return{data:rd({baseUrl:`${s}/rest/organizations/${a}/answer/v1/configs/${m}`,fetchFn:function(){var _ref28=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,y={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(b=>{y[b]=h[b]}),y.duplex="half",y.body=yield h.text(),v(S,y)});return function fetchFn(_x63){return _ref28.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(s){return{error:s}}});return function OA(_x60,_x61,_x62){return _ref27.apply(this,arguments)}}(),bp=ud({reducerPath:"answer",baseQuery:nd(OA,{maxRetries:3}),endpoints:()=>({})});var TA=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},DA=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},qA=(e,t)=>{e.citations=t.citations},MA=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},NA=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},jA=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&NA(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(TA(t,o),r(js(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(DA(t,o),r(Ms({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(qA(t,o),r(Ns({citations:o.citations})));break;case"genqa.endOfStreamType":MA(t,o),r(ai(o.answerGenerated??!1)),r(si());break}},_A=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Ls=bp.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x64,_x65){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:m,insightConfiguration:f}=r(),{organizationId:s,environment:g,accessToken:h}=a,S=Ie(s,g),y=_A(S,s,m.answerConfigurationId,f?.insightId);yield Cp(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref29=_asyncToGenerator(function*(b){let R=b.headers.get("x-answer-id");R&&o(F=>{F.answerId=R,i(pp(R))})});return function onopen(_x66){return _ref29.apply(this,arguments)}}(),onmessage:b=>{o(R=>{jA(b,R,i)})},onerror:b=>{throw b},onclose:()=>{o(b=>{i(_s(!b.generated))})}})}).apply(this,arguments)}})})}),mp=e=>Ls.endpoints.getAnswer.initiate(e);p();u();d();l();var wp=le(Sr,e=>e);p();u();d();l();function VA(e){let t=e.payload?.analyticsAction;return xp(e)&&!H(t)}function xp(e){return"type"in e}var Rp=e=>t=>r=>{let n;VA(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return xp(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};p();u();d();l();p();u();d();l();p();u();d();l();var gL=T("tab/register",e=>{let t=new Q({values:{id:U,expression:ve}});return N(e,t)}),mi=T("tab/updateActiveTab",e=>N(e,U));p();u();d();l();p();u();d();l();var LA={year:0,month:1,day:2,hour:3,minute:4,second:5},Ep={},UA=function(t,r){r===void 0&&(r={});var n=r.timeZoneName||"short",o=t+"|"+n,i=Ep[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),Ep[o]=i),i},Ip=function(e,t,r){var n,o=function(g,h,S){S===void 0&&(S={});var y=new Date(g),b=UA(h,S);return b.formatToParts(y)},i=function(g,h){for(var S=o(g,h),y=[],b=0;b<S.length;b+=1){var R=S[b],F=R.type,x=R.value,I=LA[F];I>=0&&(y[I]=parseInt(x,10))}var w=y[3],E=w===24?0:w,M=y[0]+"-"+y[1]+"-"+y[2]+" "+E+":"+y[4]+":"+y[5]+":000",k=r.utc(M).valueOf(),P=+g,O=P%1e3;return P-=O,(k-P)/6e4},a=function(g,h,S){var y=g-h*60*1e3,b=i(y,S);if(h===b)return[y,h];y-=(b-h)*60*1e3;var R=i(y,S);return b===R?[y,b]:[g-Math.min(b,R)*60*1e3,Math.max(b,R)]},m=t.prototype;m.tz=function(s,g){s===void 0&&(s=n);var h=this.utcOffset(),S=this.toDate(),y=S.toLocaleString("en-US",{timeZone:s}),b=Math.round((S-new Date(y))/1e3/60),R=-Math.round(S.getTimezoneOffset()/15)*15-b,F=!Number(R),x;if(F)x=this.utcOffset(0,g);else if(x=r(y,{locale:this.$L}).$set(Zt,this.$ms).utcOffset(R,!0),g){var I=x.utcOffset();x=x.add(h-I,_e)}return x.$x.$timezone=s,x},m.offsetName=function(s){var g=this.$x.$timezone||r.tz.guess(),h=o(this.valueOf(),g,{timeZoneName:s}).find(function(S){return S.type.toLowerCase()==="timezonename"});return h&&h.value};var f=m.startOf;m.startOf=function(s,g){if(!this.$x||!this.$x.$timezone)return f.call(this,s,g);var h=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L}),S=f.call(h,s,g);return S.tz(this.$x.$timezone,!0)},r.tz=function(s,g,h){var S=h&&g,y=h||g||n,b=i(+r(),y);if(typeof s!="string")return r(s).tz(y);var R=r.utc(s,S).valueOf(),F=a(R,b,y),x=F[0],I=F[1],w=r(x).utcOffset(I);return w.$x.$timezone=y,w},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(s){n=s}};p();u();d();l();var QA=/[+-]\d\d(?::?\d\d)?/g,BA=/([+-]|\d\d)/g;function $A(e){e===void 0&&(e="");var t=e.match(QA);if(!t)return null;var r=(""+t[0]).match(BA)||["-",0,0],n=r[0],o=r[1],i=r[2],a=+o*60+ +i;return a===0?0:n==="+"?a:-a}var Fp=function(e,t,r){var n=t.prototype;r.utc=function(h){var S={date:h,utc:!0,args:arguments};return new t(S)},n.utc=function(h){var S=r(this.toDate(),{locale:this.$L,utc:!0});return h?S.add(this.utcOffset(),_e):S},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=n.parse;n.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),o.call(this,h)};var i=n.init;n.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else i.call(this)};var a=n.utcOffset;n.utcOffset=function(h,S){var y=this.$utils(),b=y.u;if(b(h))return this.$u?0:b(this.$offset)?a.call(this):this.$offset;if(typeof h=="string"&&(h=$A(h),h===null))return this;var R=Math.abs(h)<=16?h*60:h,F=this;if(S)return F.$offset=R,F.$u=h===0,F;if(h!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();F=this.local().add(R+x,_e),F.$offset=R,F.$x.$localOffset=x}else F=this.utc();return F};var m=n.format,f="YYYY-MM-DDTHH:mm:ss[Z]";n.format=function(h){var S=h||(this.$u?f:"");return m.call(this,S)},n.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-h*Lr},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var s=n.toDate;n.toDate=function(h){return h==="s"&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():s.call(this)};var g=n.diff;n.diff=function(h,S,y){if(h&&this.$u===h.$u)return g.call(this,h,S,y);var b=this.local(),R=r(h).local();return g.call(b,R,S,y)}};Le.extend(Fp);Le.extend(Ip);var Pp=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Le.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});p();u();d();l();var HA=/(^|; )Coveo-Pendragon=([^;]*)/;function Us(){return typeof window>"u"?!1:HA.exec(document.cookie)?.pop()||null}var kp=le(Pp(),e=>e.addCase(At,(t,r)=>{zA(t,r.payload)}).addCase(et,(t,r)=>{GA(t,r.payload)}).addCase(vr,(t,r)=>{WA(t,r.payload)}).addCase(Ar,t=>{t.analytics.enabled=!1}).addCase(Cr,t=>{t.analytics.enabled=!0}).addCase(wo,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(xo,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(mi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(_u,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Ct,(t,r)=>{H(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function zA(e,t){H(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",H(t.organizationId)||(e.organizationId=t.organizationId)}function GA(e,t){H(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),H(t.locale)||(e.search.locale=t.locale),H(t.timezone)||(e.search.timezone=t.timezone),H(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function WA(e,t){H(t.enabled)||(e.analytics.enabled=t.enabled),H(t.originContext)||(e.analytics.originContext=t.originContext),H(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),H(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),H(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),H(t.trackingId)||(e.analytics.trackingId=t.trackingId),H(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),H(t.source)||(e.analytics.source=t.source);try{let r=Us();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}H(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),H(t.anonymous)||(e.analytics.anonymous=t.anonymous),H(t.deviceId)||(e.analytics.deviceId=t.deviceId),H(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),H(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Ye=kp;p();u();d();l();function YA(e){return e.instantlyCallable}var Op=()=>e=>t=>e(YA(t)?t():t);p();u();d();l();var Tp=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},Dp=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));p();u();d();l();var Qs=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};p();u();d();l();function qp(e,t){let r={...e},n,o=i=>(a,m)=>{let f=i(a,m);return n?n(f,m):f};return{get combinedReducer(){let i=Oc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,m])=>[a,()=>m]));return o(dr({...i,...r}))},containsAll(i){return Object.keys(i).every(m=>m in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}p();u();d();l();p();u();d();l();function KA(e){if(!e||!JA(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Mp(e,t=60){if(!e)return!1;let r=KA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function JA(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function jp(e,t){let r=0,n=null,o=Zn(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(f,s=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){return s&&ZA(t),yield t()})().finally(()=>{n=null}));let h=yield n;return g&&h&&f.dispatch(At({accessToken:h})),h});return function i(_x67){return _ref30.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(f){let s=f.getState(),g=eC(s);if(!(!g||!Mp(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(h){e.warn(h,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x68){return _ref32.apply(this,arguments)}}(),m=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(f,s,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Np(f,s.error),s;r++,o(),yield i(f,!0),f.dispatch(g)});return function m(_x69,_x70,_x71){return _ref33.apply(this,arguments)}}();return f=>s=>(/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(g){let h=typeof g=="function",S=typeof t=="function";if(!h)return s(g);S&&(yield a(f));let y=yield s(g);return XA(y)?S?yield m(f,y,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Np(f,y.error),y):y});return function(_x72){return _ref34.apply(this,arguments)}}())}function XA(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new lr().name}function Np(e,t){e.dispatch(Po({status:401,statusCode:401,message:t.message,type:t.name}))}function ZA(_x73){return _ZA.apply(this,arguments)}function _ZA(){_ZA=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _ZA.apply(this,arguments)}function eC(e){return e.configuration.accessToken}p();u();d();l();function _p({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return bu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Dp(n.logger))})}function tC(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&kc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Vp(e,t){let r={...e.reducers,configuration:Ye,version:wp},n=rC({...e,reducers:r},t,Ye),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(At({accessToken:o,environment:i,organizationId:a}));let m=tC(e.configuration,n.logger);return m&&n.dispatch(vr(m)),n}function rC(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=qp({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,m={...t,get relay(){return kn(s.state,o)},get navigatorContext(){return Qs(this.relay,o)}},f=nC(e,m,i),s={addReducers(g){i.containsAll(g)||(i.add(g),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(Cr())},disableAnalytics(){f.dispatch(Ar())},get state(){return f.getState()},get relay(){return kn(this.state,o)},get navigatorContext(){return Qs(this.relay,o)},logger:a,store:f};return s}function nC(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=oC(e,t.logger);return _p({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function oC(e,t){let{renewAccessToken:r}=e.configuration,n=jp(t,r);return[Op,n,Tp(t),Rp].concat(Ls.middleware,e.middlewares||[])}p();u();d();l();var Wp=Wn(Gp(),1);function Yp(e){return(0,Wp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}p();u();d();l();function Kp(e,t){let r=bC(e),n=Qe,o=wC(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function bC(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function wC(e){return e.preprocessRequest||ro}p();u();d();l();p();u();d();l();var Jp={organizationId:U,accessToken:U,name:new V({required:!1,emptyAllowed:!1}),analytics:new Q({options:{required:!1},values:{enabled:new K({required:!1}),originContext:new V({required:!1}),originLevel2:new V({required:!1}),originLevel3:new V({required:!1}),analyticsMode:new V({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new V({required:!1,url:!0}),trackingId:new V({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new V({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Xp(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Zp=new ke({...Jp,pipeline:new V({required:!1,emptyAllowed:!0}),searchHub:Se,locale:Se,timezone:Se});function Ws(){return{...Xp(),searchHub:"default"}}var xC={debug:Fo,pipeline:xr,searchHub:jr,recommendation:Mr};function ef(e){let t=Yp(e.loggerOptions);RC(e.configuration,t);let r=EC(e.configuration,t),n={...Kp(e.configuration,t),apiClient:r},o={...e,reducers:xC},i=Vp(o,n),{pipeline:a,searchHub:m,timezone:f,locale:s,proxyBaseUrl:g}=e.configuration;return i.dispatch(et({timezone:f,locale:s,proxyBaseUrl:g})),H(a)||i.dispatch(br(a)),H(m)||i.dispatch(Nr(m)),{...i,get state(){return i.state}}}function RC(e,t){try{Zp.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function EC(e,t){return new io({logger:t,preprocessRequest:e.preprocessRequest||ro,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Wc,postprocessFacetSearchResponseMiddleware:Yc,postprocessQuerySuggestResponseMiddleware:Kc})}p();u();d();l();p();u();d();l();p();u();d();l();var IC=new J({each:U,required:!0}),tf=(e,t)=>(N(e,U),Jn(t)?N(t,U):N(t,IC),{payload:{contextKey:e,contextValue:t}}),or=T("context/set",e=>{for(let[t,r]of Object.entries(e))tf(t,r);return{payload:e}}),ir=T("context/add",e=>tf(e.contextKey,e.contextValue)),ar=T("context/remove",e=>N(e,U));p();u();d();l();p();u();d();l();function hi(){return{contextValues:{}}}var Si=le(hi(),e=>{e.addCase(or,(t,r)=>{t.contextValues=r.payload}).addCase(ir,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(ar,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});p();u();d();l();function Mt(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),m=t!==a;return t=a,m}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),m;return n()&&(t=JSON.stringify(this.state),m=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&m?.()}},get state(){return{}}}}p();u();d();l();var FC=["caseId","caseNumber"],PC={caseId:"caseContext",caseNumber:"caseContext"},Qn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${PC[t]} to set this value.}`)}};function Ys(e){return FC.includes(e)}var kC=new ke({values:new Q({options:{required:!1}})});function rf(e,t={}){if(!DC(e))throw Ke;let r=Mt(e),{dispatch:n}=e,o=()=>e.state,i=Tu(e,kC,t.initialState,"buildContext");return i.values&&n(or(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(or(a))},...(o().configuration.analytics.analyticsMode==="legacy"?OC(n):TC(n))}}var OC=e=>({add(t,r){e(ir({contextKey:t,contextValue:r}))},remove(t){e(ar(t))}}),TC=e=>({add(t,r){if(Ys(t))throw new Qn(t);e(ir({contextKey:t,contextValue:r}))},remove(t){if(Ys(t))throw new Qn(t);e(ar(t))}});function DC(e){return e.addReducers({context:Si}),!0}function nf(e,t){return rf(e,t)}p();u();d();l();p();u();d();l();var Gr=T("dictionaryFieldContext/set",e=>{let t=new Q({options:{required:!0}}),r=N(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new J({each:ve}),i=N(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Wr=T("dictionaryFieldContext/add",e=>{let t=new Q({options:{required:!0},values:{field:ve,key:ve}});return N(e,t)}),Yr=T("dictionaryFieldContext/remove",e=>N(e,ve));p();u();d();l();p();u();d();l();function vi(){return{contextValues:{}}}var Ai=le(vi(),e=>{e.addCase(Gr,(t,r)=>{t.contextValues=r.payload}).addCase(Wr,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Yr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function of(e){if(!qC(e))throw Ke;let t=Mt(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Gr(o))},add(o,i){r(Wr({field:o,key:i}))},remove(o){r(Yr(o))}}}function qC(e){return e.addReducers({dictionaryFieldContext:Ai}),!0}p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Ci=T("breadcrumb/deselectAll"),af=T("breadcrumb/deselectAllNonBreadcrumbs");p();u();d();l();p();u();d();l();var Bn={value:U,numberOfResults:new $({min:0}),state:U};p();u();d();l();var ne=U;var _C=new $({min:1,default:8,required:!1}),VC=new $({min:1,max:20,default:5,required:!1}),LC={desiredCount:VC,numberOfValues:_C},v$=T("automaticFacet/setOptions",e=>N(e,LC)),A$=T("automaticFacet/deselectAll",e=>N(e,ne)),UC=U,sf=T("automaticFacet/toggleSelectValue",e=>N(e,{field:UC,selection:new Q({values:Bn})}));p();u();d();l();p();u();d();l();var QC={state:new ce({required:!0}),numberOfResults:new $({required:!0,min:0}),value:new V({required:!0,emptyAllowed:!0}),path:new J({required:!0,each:U}),moreValuesAvailable:new K({required:!1})};function Ks(e){e.children.forEach(t=>{Ks(t)}),Qe({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},QC)}var Kr={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),delimitingCharacter:new V({required:!1,emptyAllowed:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),basePath:new J({required:!1,each:U}),filterByBasePath:new K({required:!1})};var _$=T("categoryFacet/register",e=>N(e,Kr)),cf=T("categoryFacet/toggleSelectValue",e=>{try{return Qe(e.facetId,U),Ks(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),uf=T("categoryFacet/deselectAll",e=>N(e,Kr.facetId)),V$=T("categoryFacet/updateNumberOfValues",e=>N(e,{facetId:Kr.facetId,numberOfValues:Kr.numberOfValues})),L$=T("categoryFacet/updateSortCriterion",e=>N(e,{facetId:Kr.facetId,criterion:new ce})),U$=T("categoryFacet/updateBasePath",e=>N(e,{facetId:Kr.facetId,basePath:new J({each:U})}));p();u();d();l();p();u();d();l();var $n={facetId:ne,captions:new Q({options:{required:!1}}),numberOfValues:new $({required:!1,min:1}),query:new V({required:!1,emptyAllowed:!0})};var BC={path:new J({required:!0,each:U}),displayValue:ve,rawValue:ve,count:new $({required:!0,min:0})},lf=T("categoryFacet/selectSearchResult",e=>N(e,{facetId:ne,value:new Q({values:BC})})),iH=T("categoryFacetSearch/register",e=>N(e,$n));p();u();d();l();var df={facetId:ne,value:new Q({values:{displayValue:ve,rawValue:ve,count:new $({required:!0,min:0})}})},yH=T("facetSearch/register",e=>N(e,$n)),hH=T("facetSearch/update",e=>N(e,$n)),pf=T("facetSearch/toggleSelectValue",e=>N(e,df)),ff=T("facetSearch/toggleExcludeValue",e=>N(e,df));p();u();d();l();p();u();d();l();var xH=new V({regex:/^[a-zA-Z0-9-_]+$/}),RH=new V({required:!0}),EH=new J({each:new V}),IH=new V,FH=new K,PH=new K,kH=new $({min:0}),$C=new $({min:1}),OH=new K({required:!0}),HC=new Q,zC=new V,GC={captions:HC,numberOfValues:$C,query:zC},TH=new Q({values:GC}),mf=new Q({options:{required:!1},values:{type:new V({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new J({required:!0,max:25,each:new V({emptyAllowed:!1,required:!0})})}}),DH=new K,gf=new J({min:1,max:25,required:!1,each:new V({emptyAllowed:!1,required:!0})});var WC={facetId:ne,field:new V({required:!0,emptyAllowed:!0}),tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),resultsMustMatch:new ce({required:!1}),allowedValues:mf,customSort:gf},HH=T("facet/register",e=>N(e,WC)),yf=T("facet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:Bn})})),hf=T("facet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:Bn})})),bi=T("facet/deselectAll",e=>N(e,ne)),zH=T("facet/updateSortCriterion",e=>N(e,{facetId:ne,criterion:new ce({required:!0})})),GH=T("facet/updateNumberOfValues",e=>N(e,{facetId:ne,numberOfValues:new $({required:!0,min:1})})),WH=T("facet/updateIsFieldExpanded",e=>N(e,{facetId:ne,isFieldExpanded:new K({required:!0})})),YH=T("facet/updateFreezeCurrentValues",e=>N(e,{facetId:ne,freezeCurrentValues:new K({required:!0})}));p();u();d();l();p();u();d();l();function vf(e){let t=Sf(e.start,e),r=Sf(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Sf(e,t){let{dateFormat:r}=t;return Ud(e)?(Es(e),_d(e)):typeof e=="string"&&Pt(e)?(Es(e),e):(Md(e,r),di(Qr(e,r)))}p();u();d();l();var Af=T("rangeFacet/updateSortCriterion",e=>N(e,{facetId:ne,criterion:new ce({required:!0})}));p();u();d();l();var wi={state:U,start:new $({required:!0}),end:new $({required:!0}),endInclusive:new K({required:!0}),numberOfResults:new $({required:!0,min:0})},xi={start:U,end:U,endInclusive:new K({required:!0}),state:U,numberOfResults:new $({required:!0,min:0})};var YC={start:U,end:U,endInclusive:new K({required:!0}),state:U},KC={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),currentValues:new J({required:!1,each:new Q({values:YC})}),generateAutomaticRanges:new K({required:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),rangeAlgorithm:new ce({required:!1})};function Cf(e){return Pt(e)?Vn(e):e}function bf(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=vf(t);if(Qr(Cf(r)).isAfter(Qr(Cf(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Mz=T("dateFacet/register",e=>{try{return Qe(e,KC),bf(e),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),wf=T("dateFacet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:xi})})),xf=T("dateFacet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:xi})})),Rf=T("dateFacet/updateFacetValues",e=>{try{return Qe(e,{facetId:ne,values:new J({each:new Q({values:xi})})}),bf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}});p();u();d();l();var JC={state:U,start:new $({required:!0}),end:new $({required:!0}),endInclusive:new K({required:!0})},XC={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),currentValues:new J({required:!1,each:new Q({values:JC})}),generateAutomaticRanges:new K({required:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),rangeAlgorithm:new ce({required:!1})};function Ef(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Wz=T("numericFacet/register",e=>{try{return N(e,XC),Ef(e),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),If=T("numericFacet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:wi})})),Ff=T("numericFacet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:wi})})),Pf=T("numericFacet/updateFacetValues",e=>{try{return Qe(e,{facetId:ne,values:new J({each:new Q({values:wi})})}),Ef({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}});p();u();d();l();p();u();d();l();var kf=T("facet/updateFacetAutoSelection",e=>N(e,{allow:new K({required:!0})}));p();u();d();l();p();u();d();l();var Ri=class extends wt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??je().q}get responseTime(){return this.activeInstantResultCache?.duration??Je().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Je().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Of=()=>Fe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ri(e)),Tf=()=>({actionCause:"searchboxAsYouType"});p();u();d();l();var Js={id:U},ZC={...Js,q:ve},I2=T("instantResults/register",e=>N(e,Js)),Ei=T("instantResults/updateQuery",e=>N(e,ZC)),F2=T("instantResults/clearExpired",e=>N(e,Js));p();u();d();l();var Ii=new $({required:!0,min:0}),Fi=T("pagination/registerNumberOfResults",e=>N(e,Ii)),Pi=T("pagination/updateNumberOfResults",e=>N(e,Ii)),ki=T("pagination/registerPage",e=>N(e,Ii)),Jr=T("pagination/updatePage",e=>N(e,Ii)),Oi=T("pagination/nextPage"),Ti=T("pagination/previousPage");p();u();d();l();var Xr=T("query/updateQuery",e=>N(e,{q:new V,enableQuerySyntax:new K}));p();u();d();l();p();u();d();l();p();u();d();l();var Nt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Xs=()=>Fe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),jt=e=>Fe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||je().q,aq:r.advancedSearchQueries?.aq||Nt().aq,cq:r.advancedSearchQueries?.cq||Nt().cq,dq:r.advancedSearchQueries?.dq||Nt().dq,errorType:e.type,errorMessage:e.message}));p();u();d();l();p();u();d();l();var pG=T("didYouMean/enable"),fG=T("didYouMean/disable"),mG=T("didYouMean/automaticCorrections/disable"),gG=T("didYouMean/automaticCorrections/enable"),Di=T("didYouMean/correction",e=>N(e,U)),yG=T("didYouMean/automaticCorrections/mode",e=>N(e,new V({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));p();u();d();l();var Zs=()=>Fe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Df=()=>({actionCause:"didYouMeanAutomatic"});p();u();d();l();p();u();d();l();function qf(){return{freezeFacetOrder:!1,facets:{}}}p();u();d();l();function Mf(){return[]}p();u();d();l();function Hn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}p();u();d();l();function Nf(){return{}}p();u();d();l();function jf(){return{}}p();u();d();l();function _f(){return{}}function ot(e){return{context:e.context||hi(),dictionaryFieldContext:e.dictionaryFieldContext||vi(),facetSet:e.facetSet||Ko(),numericFacetSet:e.numericFacetSet||Yo(),dateFacetSet:e.dateFacetSet||Wo(),categoryFacetSet:e.categoryFacetSet||Go(),automaticFacetSet:e.automaticFacetSet??zo(),pagination:e.pagination||Hn(),query:e.query||je(),tabSet:e.tabSet||_f(),advancedSearchQueries:e.advancedSearchQueries||Nt(),staticFilterSet:e.staticFilterSet||jf(),querySet:e.querySet||Nf(),sortCriteria:e.sortCriteria||Jo(),pipeline:e.pipeline||wr(),searchHub:e.searchHub||Tr(),facetOptions:e.facetOptions||qf(),facetOrder:e.facetOrder??Mf(),debug:e.debug??Io()}}p();u();d();l();var TW=new Q({values:{undoneQuery:ve},options:{required:!0}}),Vf=()=>Fe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);p();u();d();l();var qi=T("trigger/query/ignore",e=>N(e,new V({emptyAllowed:!0,required:!0}))),Mi=T("trigger/query/modification",e=>N(e,new Q({values:{originalQuery:Se,modification:Se}})));p();u();d();l();var _t=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=rb(e),n=fi(e),o=eb(e),i=yield Tt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return kt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function _t(_x74,_x75){return _ref35.apply(this,arguments)}}();function eb(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(tb).filter(r=>r.currentValues.length>0):void 0}function tb(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function rb(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=nb(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function nb(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Vt=class{constructor(t,r=n=>{this.dispatch(Xr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x76,_x77){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=pi(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(jt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let s=a.length===0&&m&&m.length!==0,g=!H(f)&&!H(f.correctedQuery);if(!s&&!g)return null;let S=s?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(tt(ot(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(jt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(tt(ot(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Zs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Zs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(qi("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(jt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(tt(ot(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Vf()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??je().enableQuerySyntax},search:{...Je(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(tt(ot(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return ao(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield _t(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Di(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Mi({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield _t(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var OY=re("search/executeSearch",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ni(r,t,e)});return function(_x78,_x79){return _ref36.apply(this,arguments)}}()),TY=re("search/fetchPage",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();return yield tc(r,t,e)});return function(_x80,_x81){return _ref37.apply(this,arguments)}}()),DY=re("search/fetchMoreResults",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();return yield rc(t,r)});return function(_x82,_x83){return _ref38.apply(this,arguments)}}()),qY=re("search/fetchFacetValues",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();return yield sb(t,e,r)});return function(_x84,_x85){return _ref39.apply(this,arguments)}}()),MY=re("search/fetchInstantResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){return ec(e,t)});return function(_x86,_x87){return _ref40.apply(this,arguments)}}()),ob=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=yield _t(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function ob(_x88,_x89){return _ref41.apply(this,arguments)}}(),ib=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e);return kt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function ib(_x90,_x91,_x92){return _ref42.apply(this,arguments)}}(),ab=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=yield _t(e,t);return r.request.numberOfResults=0,r});return function ab(_x93,_x94){return _ref43.apply(this,arguments)}}(),Lf=e=>{e.configuration.analytics.enabled&&Be.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function ec(_x95,_x96){return _ec.apply(this,arguments)}function _ec(){_ec=_asyncToGenerator(function*(e,t){N(e,{id:U,q:U,maxResultsPerQuery:new $({required:!0,min:1}),cacheTimeout:new $});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Vt({...t,analyticsAction:Of()},s=>{t.dispatch(Ei({q:s,id:e.id}))}),a=yield ib(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _ec.apply(this,arguments)}function tc(_x97,_x98,_x99){return _tc.apply(this,arguments)}function _tc(){_tc=_asyncToGenerator(function*(e,t,r){Lf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Vt({...t,analyticsAction:r}),f=yield _t(e,a),s=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(s)});return _tc.apply(this,arguments)}function rc(_x100,_x101){return _rc.apply(this,arguments)}function _rc(){_rc=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Xs().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Vt({...e,analyticsAction:Xs()}),m=yield ob(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _rc.apply(this,arguments)}function sb(_x102,_x103,_x104){return _sb.apply(this,arguments)}function _sb(){_sb=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Vt({...e,analyticsAction:t}),f=yield ab(r,a),s=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(s)});return _sb.apply(this,arguments)}function Ni(_x105,_x106,_x107){return _Ni.apply(this,arguments)}function _Ni(){_Ni=_asyncToGenerator(function*(e,t,r){Lf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=yield _t(e,a),f=new Vt({...t,analyticsAction:r}),s=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(s)});return _Ni.apply(this,arguments)}p();u();d();l();var Lt=class{constructor(t,r=n=>{this.dispatch(Xr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x108,_x109){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=pi(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(jt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let s=a.length===0&&m&&m.length!==0,g=!H(f)&&!H(f.correctedQuery);if(!s&&!g)return null;let S=s?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(tt(ot(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(jt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(tt(ot(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(qi("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(jt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(tt(ot(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(tt(ot(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return ao(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Df(),o=yield _this22.fetchFromAPI(yield Dt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Di(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Mi({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Dt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var AK=re("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;N(e,{q:new V,enableQuerySyntax:new K,clearFilters:new K}),e.clearFilters&&(r(Ci()),r(af())),r(kf({allow:!0})),r(Xr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Jr(1))}),CK=T("search/updateSearchAction"),Uf=re("search/executeSearch",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ni(r,t,e.legacy);Qf(r);let n=e.next?Bf(e.next):void 0,o=yield Dt(r,t.extra.navigatorContext,n),i=new Lt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x110,_x111){return _ref44.apply(this,arguments)}}()),bK=re("search/fetchPage",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=t.getState();if(Qf(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return tc(r,t,e.legacy);let n=new Lt({...t,analyticsAction:e.next}),o=yield Dt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x112,_x113){return _ref45.apply(this,arguments)}}()),wK=re("search/fetchMoreResults",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return rc(t,r);let n=Nl("browseResults",t.getState),o=new Lt({...t,analyticsAction:n}),i=yield cb(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x114,_x115){return _ref46.apply(this,arguments)}}()),xK=re("search/fetchFacetValues",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ni(r,t,e.legacy);let n=new Lt({...t,analyticsAction:{}}),o=yield lb(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x116,_x117){return _ref47.apply(this,arguments)}}()),RK=re("search/fetchInstantResults",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ec(e,t);N(e,{id:U,q:U,maxResultsPerQuery:new $({required:!0,min:1}),cacheTimeout:new $});let{q:n,maxResultsPerQuery:o}=e,i=Bf(Tf()),a=yield ub(r,t.extra.navigatorContext,n,o,i),m=new Lt({...t,analyticsAction:i},g=>{t.dispatch(Ei({q:g,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),s=yield m.process(f);return"response"in s?{results:s.response.results,searchUid:s.response.searchUid,totalCountFiltered:s.response.totalCountFiltered,duration:s.duration}:s});return function(_x118,_x119){return _ref48.apply(this,arguments)}}()),cb=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=yield Dt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function cb(_x120,_x121,_x122){return _ref49.apply(this,arguments)}}(),ub=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t,r,n,o){let i=Br(e,t,o);return kt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function ub(_x123,_x124,_x125,_x126,_x127){return _ref50.apply(this,arguments)}}(),lb=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t,r){let n=yield Dt(e,t,r);return n.request.numberOfResults=0,n});return function lb(_x128,_x129,_x130){return _ref51.apply(this,arguments)}}(),Qf=e=>{e.configuration.analytics.enabled&&Be.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Bf=e=>({actionCause:e.actionCause,type:e.actionCause});var $f=le(Hn(),e=>{e.addCase(Fi,(t,r)=>{let n=nc(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=zn(n,o)}).addCase(Pi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(mi,t=>{t.firstResult=0}).addCase(ki,(t,r)=>{let n=r.payload;t.firstResult=zn(n,t.numberOfResults)}).addCase(Jr,(t,r)=>{let n=r.payload;t.firstResult=zn(n,t.numberOfResults)}).addCase(Ti,t=>{let r=nc(t),n=Math.max(r-1,1);t.firstResult=zn(n,t.numberOfResults)}).addCase(Oi,t=>{let r=nc(t),n=pb(t),o=Math.min(r+1,n);t.firstResult=zn(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Ct,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Uf.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(bi,t=>{Ee(t)}).addCase(xf,t=>{Ee(t)}).addCase(hf,t=>{Ee(t)}).addCase(Ff,t=>{Ee(t)}).addCase(ff,t=>{Ee(t)}).addCase(yf,t=>{Ee(t)}).addCase(uf,t=>{Ee(t)}).addCase(cf,t=>{Ee(t)}).addCase(lf,t=>{Ee(t)}).addCase(wf,t=>{Ee(t)}).addCase(If,t=>{Ee(t)}).addCase(Ci,t=>{Ee(t)}).addCase(Rf,t=>{Ee(t)}).addCase(Pf,t=>{Ee(t)}).addCase(pf,t=>{Ee(t)}).addCase(sf,t=>{Ee(t)})});function Ee(e){e.firstResult=Hn().firstResult}function nc(e){let{firstResult:t,numberOfResults:r}=e;return fb(t,r)}function pb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return mb(t,r)}function zn(e,t){return(e-1)*t}function fb(e,t){return Math.round(e/t)+1}function mb(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function oc(e){return e.addReducers({pagination:$f}),{nextPage:Oi,previousPage:Ti,registerNumberOfResults:Fi,registerPage:ki,updateNumberOfResults:Pi,updatePage:Jr}}var gb=new ke({id:new V({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new $({min:0})});function Hf(e,t={}){if(!yb(e))throw Ke;let r=Mt(e),{dispatch:n}=e,o=()=>e.state,i=Du(e,gb,t.options,"buildRecommendationList");return i.id!==""&&n(qr({id:i.id})),i.numberOfRecommendations&&n(oc(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(xt())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function yb(e){return e.addReducers({recommendation:Mr,configuration:Ye}),!0}p();u();d();l();p();u();d();l();function zf(e,t,r){if(!hb(e))throw Ke;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Zn(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function hb(e){return e.addReducers({configuration:Ye}),!0}function Gf(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(ti(t.options.result)))};return zf(e,t,()=>{n()})}p();u();d();l();p();u();d();l();p();u();d();l();var Ut=()=>new V({required:!1,emptyAllowed:!0}),ji=T("advancedSearchQueries/update",e=>N(e,{aq:Ut(),cq:Ut(),lq:Ut(),dq:Ut()})),_i=T("advancedSearchQueries/register",e=>N(e,{aq:Ut(),cq:Ut(),lq:Ut(),dq:Ut()}));var Wf=le(Nt(),e=>{e.addCase(ji,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ge(n)||(t.aq=n,t.aqWasSet=!0),ge(o)||(t.cq=o,t.cqWasSet=!0),ge(i)||(t.lq=i,t.lqWasSet=!0),ge(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(_i,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ge(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ge(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ge(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ge(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Ct,(t,r)=>{let{aq:n,cq:o}=r.payload;ge(n)||(t.aq=n,t.aqWasSet=!0),ge(o)||(t.cq=o,t.cqWasSet=!0)})});function Sb(e){return e.addReducers({advancedSearchQueries:Wf}),{updateAdvancedSearchQueries:ji,registerAdvancedSearchQueries:_i}}p();u();d();l();function vb(e){return e.addReducers({configuration:Ye}),{disableAnalytics:Ar,enableAnalytics:Cr,setOriginLevel2:wo,setOriginLevel3:xo,updateAnalyticsConfiguration:vr,updateBasicConfiguration:At}}p();u();d();l();function Ab(e){return e.addReducers({configuration:Ye,pipeline:xr,searchHub:jr}),{updateSearchConfiguration:et}}p();u();d();l();function Cb(e){return e.addReducers({context:Si}),{addContext:ir,removeContext:ar,setContext:or}}p();u();d();l();function bb(e){return e.addReducers({debug:Fo}),{disableDebug:Eo,enableDebug:Ro}}p();u();d();l();function wb(e){return e.addReducers({dictionaryFieldContext:Ai}),{addContext:Wr,removeContext:Yr,setContext:Gr}}p();u();d();l();p();u();d();l();p();u();d();l();var xb={collectionField:new V({emptyAllowed:!1,required:!1}),parentField:new V({emptyAllowed:!1,required:!1}),childField:new V({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new $({min:0,required:!1})},Yf=T("folding/register",e=>N(e,xb)),W4=re("folding/loadCollection",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Tt(i):Br(i,o),m=yield n.search({...a,q:Rb(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Oe(m)?r(m.error):{collectionId:e,results:m.success.results,searchUid:m.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x131,_x132){return _ref52.apply(this,arguments)}}());function Rb(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}p();u();d();l();var Kf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});p();u();d();l();var Zr=T("fields/registerFieldsToInclude",e=>N(e,bo)),Vi=T("fields/fetchall/enable"),Li=T("fields/fetchall/disable"),Ui=re("fields/fetchDescription",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:m}=o.configuration,{apiBaseUrl:f}=o.configuration.search,s=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:m,url:f??yt(m,a)});return Oe(s)?n(s.error):s.success.fields});return function(_x133,_x134){return _ref53.apply(this,arguments)}}());p();u();d();l();var Qi=["author","language","urihash","objecttype","collection","source","permanentid"],ic=[...Qi,"date","filetype","parents"],Jf=[...ic,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],Xf=()=>({fieldsToInclude:Qi,fetchAllFields:!1,fieldsDescription:[]});var Bi=le(Xf(),e=>e.addCase(Zr,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Vi,t=>{t.fetchAllFields=!0}).addCase(Li,t=>{t.fetchAllFields=!1}).addCase(Ui.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Yf,(t,{payload:r})=>{let n=Kf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function Eb(e){return e.addReducers({fields:Bi}),{registerFieldsToInclude:Zr,enableFetchAllFields:Vi,disableFetchAllFields:Li,fetchFieldsDescription:Ui}}p();u();d();l();function Ib(e){return e.addReducers({pipeline:xr}),{setPipeline:br}}p();u();d();l();function Fb(e){return e.addReducers({recommendation:Mr}),{getRecommendations:xt,setRecommendationId:qr}}p();u();d();l();function Pb(e){return e.addReducers({}),{logRecommendationOpen:ti}}p();u();d();l();p();u();d();l();var kb=new ke({content:new ce({required:!0}),conditions:new ce({required:!0}),priority:new $({required:!1,default:0,min:0}),fields:new J({required:!1,each:U})});function Zf(){let e=[],t=r=>{let n=kb.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new sn("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function em(e){if(!Ob(e))throw Ke;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Zf();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Zr(i))},selectTemplate:r,selectLinkTemplate:n}}function Ob(e){return e.addReducers({fields:Bi}),!0}p();u();d();l();function Tb(e){return e.addReducers({searchHub:jr}),{setSearchHub:Nr}}/**
|
|
30
|
+
`;function yh(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var hh=["1",1,"yes",!0];function xo(){let e=[];return Aa()&&e.push(window.doNotTrack),Da()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>hh.indexOf(t)!==-1)}var Xu="v15",Zu={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function Sh(e=Zu.default,t=Xu,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var vh="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ze=class{get defaultOptions(){return{endpoint:Zu.default,isCustomEndpoint:!1,token:"",version:Xu,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Wu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[sy,ry].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};xo()?this.runtime=new wo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return Aa()&&Sr()?new Oa(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(yh()&&console.warn(gh),new Ta(t))}get storage(){return this.runtime.storage}determineVisitorId(){return q(this,void 0,void 0,function*(){try{return Aa()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Qt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Qt()}})}getCurrentVisitorId(){return q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return q(this,void 0,void 0,function*(){if(vo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(ju(t,ju(r,vh)))}})}getParameters(t,...r){return q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Qt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(xo())return null;try{let r=new URL(t).searchParams.get(St.cvo_cid);if(r==null)return null;let n=St.fromString(r);return!n||!Sr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>q(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,R)=>q(this,void 0,void 0,function*(){let k=yield v;return yield R(t,k)}),g)].reduce((g,v)=>q(this,void 0,void 0,function*(){let R=yield g;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?ih(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>q(this,void 0,void 0,function*(){let g=yield h;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new So().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){return q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){return q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){return q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=at(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return q(this,void 0,void 0,function*(){let r=yield(yield b(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return q(this,void 0,void 0,function*(){return yield(yield b(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(uh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=at(t,["custom"]),o={};r&&ho(r)&&(o=this.lowercaseKeys(r));let i=lh(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=at(t,["custom"]);if(r&&ho(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=at(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=at(t,["userId"]);return mh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=at(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ho(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ho(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?Cy(t,r):t}get baseUrl(){return Sh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},st;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(st||(st={}));var j;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(j||(j={}));var Qu={[j.triggerNotify]:"queryPipelineTriggers",[j.triggerExecute]:"queryPipelineTriggers",[j.triggerQuery]:"queryPipelineTriggers",[j.triggerRedirect]:"queryPipelineTriggers",[j.queryErrorBack]:"errors",[j.queryErrorClear]:"errors",[j.queryErrorRetry]:"errors",[j.pagerNext]:"getMoreResults",[j.pagerPrevious]:"getMoreResults",[j.pagerNumber]:"getMoreResults",[j.pagerResize]:"getMoreResults",[j.pagerScrolling]:"getMoreResults",[j.facetSearch]:"facet",[j.facetShowLess]:"facet",[j.facetShowMore]:"facet",[j.recommendation]:"recommendation",[j.likeSmartSnippet]:"smartSnippet",[j.dislikeSmartSnippet]:"smartSnippet",[j.expandSmartSnippet]:"smartSnippet",[j.collapseSmartSnippet]:"smartSnippet",[j.openSmartSnippetFeedbackModal]:"smartSnippet",[j.closeSmartSnippetFeedbackModal]:"smartSnippet",[j.sendSmartSnippetReason]:"smartSnippet",[j.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.clearRecentQueries]:"recentQueries",[j.recentResultClick]:"recentlyClickedDocuments",[j.clearRecentResults]:"recentlyClickedDocuments",[j.showLessFoldedResults]:"folding",[j.caseDetach]:"case",[j.likeGeneratedAnswer]:"generatedAnswer",[j.dislikeGeneratedAnswer]:"generatedAnswer",[j.openGeneratedAnswerSource]:"generatedAnswer",[j.generatedAnswerStreamEnd]:"generatedAnswer",[j.generatedAnswerSourceHover]:"generatedAnswer",[j.generatedAnswerCopyToClipboard]:"generatedAnswer",[j.generatedAnswerHideAnswers]:"generatedAnswer",[j.generatedAnswerShowAnswers]:"generatedAnswer",[j.generatedAnswerExpand]:"generatedAnswer",[j.generatedAnswerCollapse]:"generatedAnswer",[j.generatedAnswerFeedbackSubmit]:"generatedAnswer",[j.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[st.expandToFullUI]:"interface",[st.openUserActions]:"User Actions",[st.showPrecedingSessions]:"User Actions",[st.showFollowingSessions]:"User Actions",[st.clickViewedDocument]:"User Actions",[st.clickPageView]:"User Actions",[st.createArticle]:"createArticle"},br=class{constructor(){this.runtime=new wo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Wu}};function Ah(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function bh(e){return e.map(t=>t.replace(/;/g,""))}function el(e){let r=e.join(";");return r.length<=256?r:el(e.slice(1))}var Bu=e=>{let t=bh(e),r=Ah(t);return el(r)};function $u(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Bu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Bu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Ro=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||xo();this.coveoAnalyticsClient=n?new br:new Ze(t)}disable(){this.coveoAnalyticsClient=new br}enable(){this.coveoAnalyticsClient=new Ze(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(j.interfaceLoad)}logInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(j.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(j.recommendation)}logRecommendation(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(j.recommendationOpen,t,r)}logRecommendationOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(j.staticFilterClearAll,t)}logStaticFilterClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(j.staticFilterSelect,t)}logStaticFilterSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(j.staticFilterDeselect,t)}logStaticFilterDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(j.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(j.interfaceChange,t)}logInterfaceChange(t){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(j.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(j.didyoumeanClick)}logDidYouMeanClick(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(j.resultsSort,t)}logResultsSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(j.searchboxSubmit)}logSearchboxSubmit(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(j.searchboxClear)}logSearchboxClear(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(j.searchboxAsYouType)}logSearchboxAsYouType(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(j.breadcrumbFacet,t)}logBreadcrumbFacet(t){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(j.breadcrumbResetAll)}logBreadcrumbResetAll(){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(j.documentQuickview,t,r)}logDocumentQuickview(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(j.documentOpen,t,r)}logDocumentOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(j.omniboxAnalytics,$u(t))}logOmniboxAnalytics(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(j.omniboxFromLink,$u(t))}logOmniboxFromLink(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(j.searchFromLink)}logSearchFromLink(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(j.triggerNotify,t)}logTriggerNotify(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(j.triggerExecute,t)}logTriggerExecute(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(j.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(j.undoTriggerQuery,t)}logUndoTriggerQuery(t){return q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(j.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(j.pagerResize,t)}logPagerResize(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(j.pagerNumber,t)}logPagerNumber(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(j.pagerNext,t)}logPagerNext(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(j.pagerPrevious,t)}logPagerPrevious(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(j.pagerScrolling)}logPagerScrolling(){return q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(j.facetClearAll,t)}logFacetClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(j.facetSearch,t)}logFacetSearch(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(j.facetSelect,t)}logFacetSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(j.facetDeselect,t)}logFacetDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(j.facetExclude,t)}logFacetExclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(j.facetUnexclude,t)}logFacetUnexclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(j.facetSelectAll,t)}logFacetSelectAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(j.facetUpdateSort,t)}logFacetUpdateSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(j.facetShowMore,t)}logFacetShowMore(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(j.facetShowLess,t)}logFacetShowLess(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(j.queryError,t)}logQueryError(t){return q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorBack);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorBack)})}})}logQueryErrorBack(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorRetry);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorRetry)})}})}logQueryErrorRetry(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorClear);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorClear)})}})}logQueryErrorClear(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(j.likeSmartSnippet)}logLikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(j.dislikeSmartSnippet)}logDislikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(j.expandSmartSnippet)}logExpandSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(j.collapseSmartSnippet)}logCollapseSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(j.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(j.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(j.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(j.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(j.copyToClipboard,t,r)}logCopyToClipboard(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(j.recentQueryClick)}logRecentQueryClick(){return q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(j.clearRecentQueries)}logClearRecentQueries(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(j.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(j.clearRecentResults)}logClearRecentResults(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(j.noResultsBack)}logNoResultsBack(){return q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(j.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(j.showLessFoldedResults)}logShowLessFoldedResults(){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return q(this,arguments,void 0,function*(n,o,i=Qu[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),m=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(m);return{description:this.makeEventDescription(f,n),log:({searchUID:p})=>f.log({lastSearchQueryUid:p})}})}logCustomEvent(t,r){return q(this,arguments,void 0,function*(n,o,i=Qu[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(j.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(j.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(j.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(j.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(j.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(j.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(j.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(j.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(j.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(j.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(j.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(j.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(j.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Eo=Object.assign({},dn),Hu=Object.keys(Eo).map(e=>Eo[e]),vr=class extends wa{constructor({client:t,uuidGenerator:r=Qt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>Hu.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Hu.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Eo.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Eo.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return Iy(this.ticket)}};vr.Id="svc";var Io;(function(e){e.click="click",e.flowStart="flowStart"})(Io||(Io={}));var Ue;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Ue||(Ue={}));var ko;(function(e){e.quit="Quit",e.solved="Solved"})(ko||(ko={}));var Po=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!xo();this.coveoAnalyticsClient=o?new Ze(t):new br,this.svc=new vr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new br,this.svc=new vr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ze(this.options),this.svc=new vr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Ue.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Ue.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Ue.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Ue.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Ue.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Ue.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Ue.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Ue.caseCancelled,{reason:ko.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Ue.caseSolved,{reason:ko.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Ue.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Io.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Io.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){var i,a;let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var tl=e=>new Ze(e).getCurrentVisitorId(),mn=(e,t)=>typeof t=="function"?(...r)=>{let n=Kr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,gn=(e,t)=>(...r)=>{let n=Kr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Fo(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function rl(e){let{activeValue:t,ancestryMap:r}=Ch(e);return t?wh(t,r):[]}function Ch(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function wh(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var xh=(e,t)=>e.categoryFacetSet[t]?.request;var Ma=(e,t)=>{let r=xh(e,t);return rl(r?.currentValues??[])};d();c();l();u();function Oo(){return{}}d();c();l();u();function To(){return{}}d();c();l();u();function Do(){return{}}d();c();l();u();function qo(){return{}}function Na(e){return{facetSet:e.facetSet??qo(),categoryFacetSet:e.categoryFacetSet??Oo(),dateFacetSet:e.dateFacetSet??To(),numericFacetSet:e.numericFacetSet??Do(),automaticFacetSet:e.automaticFacetSet??Fo()}}var _a=e=>{let t=[];return Ih(e).forEach((r,n)=>{let o=jh(e,r.facetId),i=Dh(r,n+1);if(Eh(r)){if(!!!Ma(e,r.facetId).length)return;t.push({...i,...Oh(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=nl(a,m+1,o),p=Rh(r)?ol(a):Ph(a);t.push({...i,...f,...p})})}),kh(e).forEach((r,n)=>{let o=Th(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=nl(i,a+1,"specific"),f=ol(i);t.push({...o,...m,...f})})}),t},Rh=e=>e.type==="specific",Eh=e=>e.type==="hierarchical",Ih=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),kh=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),nl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Ph=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),ol=e=>({displayValue:e.value,value:e.value}),Fh=(e,t)=>Ma(e,t).map(n=>n.value).join(";"),Oh=(e,t)=>{let n=Fh(e,t);return{value:n,valuePosition:1,displayValue:n}},Th=(e,t)=>({title:il(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Dh=(e,t)=>({title:il(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),il=(e,t)=>`${e}_${t}`,qh=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,jh=(e,t)=>{let r=qh(e,t);return r?r.type:"specific"};d();c();l();u();var Bt=e=>{if(Mh(e))return e.generatedAnswer?.answerId;if(Nh(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},Mh=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),Nh=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",al=e=>e.generatedAnswer?.fieldsToIncludeInCitations,_h=ye(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var Ne=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var sl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(sl||{}),cl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(cl||{}),Va=e=>{if(hc(e))return e.map(t=>Va(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},ul=()=>({by:"relevancy"});var BP=new K({values:{by:new Vi({enum:cl,required:!0}),order:new Vi({enum:sl}),field:new H}});function jo(){return Va(ul())}d();c();l();u();d();c();l();u();var Cr=()=>"default";var Vh=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ct=class{constructor(t){this.getState=t;de(this,"state");this.state=t()}getLanguage(){return Vh(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=cr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Cr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends ct{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return _a(Na(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||We().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Bt(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??jo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ne().q}get responseTime(){return this.state.search?.duration||We().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||We().response.totalCountFiltered}};de(yn,"fallbackPipelineName","default");var vt=yn,ll=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new Ro({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||y.disable(),y},La=()=>{let t=Le.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Mo=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield tl(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(La()&&{pageId:La()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:hr(e)})}}});return function Mo(_x0,_x1){return _ref8.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var wr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var hn=class extends ct{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ne().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||wr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||wr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||wr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var dl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Lh(e){return typeof e=="string"&&dl.test(e)}var Ua=Lh;d();c();l();u();var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function pl(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()}d();c();l();u();var Qa,Uh=new Uint8Array(16);function Ba(){if(!Qa){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Qa=crypto.getRandomValues.bind(crypto)}return Qa(Uh)}d();c();l();u();d();c();l();u();var Qh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$a={randomUUID:Qh};function Bh(e,t,r){if($a.randomUUID&&!t&&!e)return $a.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ba();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return pl(n)}var Ha=Bh;d();c();l();u();function fl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function $h({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var ml="visitorId";function Hh(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(ml),o=n&&Ua(n)?n:t.generateUUID();return r.setItem(ml,o),o}}}var vl="1.2.7",za=128,Al=192,gl=224,yl=240,zh=248;function Gh(e){return(e&zh)===yl?4:(e&yl)===gl?3:(e&gl)===Al?2:1}function Wh(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&za)!=za)break;if(r-=3,(n&Al)!=za){t-r>=Gh(n)*3&&(r=t);break}}return e.substring(0,r)}function Kh(e){let{trackingId:t}=e;return{trackingId:t}}function Yh(e){return(e.source||[]).concat([`relay@${vl}`])}function bl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=Kh(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:Yh(t),clientId:f,userAgent:a(),referrer:hl(o()),location:hl(i())})}function hl(e){return e!==null?Wh(e,1024):null}function Jh(e,t,r,n,o){return{...t,meta:bl(e,r,n,o)}}var Xh="*";function Zh(){let e=[];function t({type:f,callback:p}){return e.findIndex(y=>y.type===f&&y.callback===p)}function r(f,p){return f.type==="*"||p===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(p=>{if(r(p,f.meta.type))try{p.callback(f)}catch(y){console.error(y)}})}function i(f){if(f===Xh)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===f&&e.splice(p,1)}function a(f){let p=t(f);p>=0&&e.splice(p,1)}function m(f,p){p?a({type:f,callback:p}):i(f)}return{add:n,call:o,remove:m}}function Sl({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function eS(e){let t=Sl(e);return{get:()=>t,update:r=>{t=Sl({...t,...r})}}}var Ga=tS();function tS(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function rS(){return{getItem(e){return Ga.getItem(e)||localStorage.getItem(e)},removeItem(e){Ga.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ga.setItem(e,t,31556952e3)}}}function nS(){let e=document.referrer;return e===""?null:e}function Wa(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(fl().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>nS(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Ha(),storage:rS()}}function oS(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function iS(){return{getItem(){return null},removeItem(){},setItem(){}}}function aS(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:iS()}}function sS(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=aS();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&cS()&&oS()?Wa():n}function cS(){try{return typeof window=="object"}catch{return!1}}function uS(e){return{get:()=>Object.freeze(sS(e))}}function Cl(e){let t=eS(e),r=Zh(),n=uS(t),o=Hh(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),p=Jh(i,a,m,f,o);return $h({config:m,environment:f,event:p,listenerManager:r})},getMeta:i=>bl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:vl}}d();c();l();u();function wl(){return typeof window<"u"&&typeof document<"u"}var Sn=ye(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>hr(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=dS(m);return Cl({mode:i?"emit":"disabled",url:o??Vn(e,t),token:r,trackingId:n??null,source:a,environment:f})}),lS={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},dS=e=>{if(!e)return;let t=e();return{...(wl()?Wa():lS),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();var vn=class extends ct{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},xl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new Po({enableAnalytics:p,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||y.disable(),y};d();c();l();u();d();c();l();u();function Rl(e,t){return{...new vt(t).getBaseMetadata(),actionCause:e,type:e}}function pS(e){return Object.assign(e,{instantlyCallable:!0})}function fS(e,t){let r=i=>pS(ue(e,i)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:p,logger:y}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:p,logger:y})).log({state:a(),extra:m})});return function(_x10,_x11){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:p,log:y}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:p,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(h,{getState:S,extra:g}){return yield y({state:S(),extra:g})});return function(_x13,_x14){return _ref1.apply(this,arguments)}}())}});return function prepare(_x12){return _ref0.apply(this,arguments)}}()}),n}var El=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return yS(i)}return n},mS=e=>e.configuration.analytics.analyticsMode==="legacy",gS=e=>e.configuration.analytics.analyticsMode==="next",yS=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),fS(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:p,logger:y}){let h=[],S={log:function(){var _ref11=_asyncToGenerator(function*({state:x}){for(let F of h)yield F(x)});return function log(_x16){return _ref11.apply(this,arguments)}}()},g=m(),v=i({getState:m,logger:y,analyticsClientMiddleware:f,preprocessRequest:p,provider:r(m)}),R=yield t(v,m());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){mS(x)&&(yield hS(R,r,x,y,v.coveoAnalyticsClient))});return function(_x17){return _ref12.apply(this,arguments)}}());let{emit:k}=Sn(g);return h.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(x){if(gS(x)&&o&&n){let F=n(x);yield xS(k,o,F)}});return function(_x18){return _ref13.apply(this,arguments)}}()),S});return function(_x15){return _ref10.apply(this,arguments)}}()));function hS(_x19,_x20,_x21,_x22,_x23){return _hS.apply(this,arguments)}function _hS(){_hS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _hS.apply(this,arguments)}var SS=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(i){r(n,o)});return function log(_x24){return _ref14.apply(this,arguments)}}()}),Pe=El(e=>ll({...e,provider:e.provider||new vt(e.getState)}),e=>e,vt),ZT=El(xl,SS("caseAssist"),vn);var Ka=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return vS(e,r,t)};function vS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:CS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:wS(e),queryPipeline:r.pipeline||fr()}}var No=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Il={urihash:new H,sourcetype:new H,permanentid:new H},kl={uniqueId:W,raw:new K({values:Il}),title:W,uri:W,clickUri:W,rankingModifier:new H({required:!1,emptyAllowed:!0})};function AS(e){return Object.assign({},...Object.keys(Il).map(t=>({[t]:e[t]})))}function bS(e){return Object.assign({},...Object.keys(kl).map(t=>({[t]:e[t]})),{raw:AS(e.raw)})}function CS(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function wS(e){let t=e.raw.source;return X(t)?"unknown":t}var Ya=e=>new Oe(kl).validate(bS(e));function xS(_x25,_x26,_x27){return _xS.apply(this,arguments)}function _xS(){_xS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _xS.apply(this,arguments)}d();c();l();u();var Pl=()=>Pe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new hn(e)),Fl=()=>({actionCause:"recommendationInterfaceLoad"}),Vo=e=>Pe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ya(e),t.makeRecommendationOpen(Ka(e,r),No(e))),__legacy__provider:t=>new hn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Ka(e,t),n=No(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var xr=T("recommendation/set",e=>Q(e,{id:W})),At=ue("recommendation/get",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield RS(o),m=yield n.recommendations(a),f=Date.now()-i;return Te(m)?r(m.error):{recommendations:m.success.results,analyticsAction:Pl(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x28,_x29){return _ref15.apply(this,arguments)}}()),RS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Le.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield ES(e,Fl()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function RS(_x30){return _ref16.apply(this,arguments)}}(),ES=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Mo(e.configuration.analytics,r)});return function ES(_x31,_x32){return _ref17.apply(this,arguments)}}();var Rr=me(wr(),e=>{e.addCase(xr,(t,r)=>{t.id=r.payload.id}).addCase(At.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(At.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(At.pending,t=>{t.isLoading=!0}).addCase(fo,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Er=T("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Ir=me(Cr(),e=>{e.addCase(Er,(t,r)=>r.payload).addCase(je.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Je,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ol(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Tl=Ke;function $l(e,t){if(e===t||!(Tl(e)&&Tl(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=$l(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function kr(e){let t=0;for(let r in e)t++;return t}var Dl=e=>[].concat(...e);function IS(e){return new RegExp("(^|:)//").test(e)}function kS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Qo(e){return e!=null}function PS(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var FS=e=>e.replace(/\/$/,""),OS=e=>e.replace(/^\//,"");function TS(e,t){if(!e)return t;if(!t)return e;if(IS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=FS(e),t=OS(t),`${e}${r}${t}`}function DS(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var ql=(...e)=>b(...e),qS=e=>e.status>=200&&e.status<=299,jS=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function jl(e){if(!Ke(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Hl({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=ql,paramsSerializer:n,isJsonContentType:o=jS,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:p,...y}={}){return typeof b>"u"&&r===ql&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(S,g,v){let{getState:R,extra:k,endpoint:x,forced:F,type:w}=g,E,{url:M,headers:O=new C(y.headers),params:I=void 0,responseHandler:P=f??"json",validateStatus:D=p??qS,timeout:N=m,...$}=typeof S=="string"?{url:S}:S,U,V=g.signal;N&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),V=U.signal);let _={...y,signal:V,...$};O=new C(jl(O)),_.headers=(yield t(O,{getState:R,arg:S,extra:k,endpoint:x,forced:F,type:w,extraOptions:v}))||O;let B=Z=>typeof Z=="object"&&(Ke(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!_.headers.has("content-type")&&B(_.body)&&_.headers.set("content-type",i),B(_.body)&&o(_.headers)&&(_.body=JSON.stringify(_.body,a)),I){let Z=~M.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(jl(I));M+=Z+oe}M=TS(e,M);let L=new Request(M,_);E={request:new Request(M,_)};let G,Y=!1,te=U&&setTimeout(()=>{Y=!0,U.abort()},N);try{G=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{te&&clearTimeout(te),U?.signal.removeEventListener("abort",U.abort)}let se=G.clone();E.response=se;let ee,re="";try{let Z;if(yield Promise.all([h(G,P).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>re=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:G.status,data:re,error:String(Z)},meta:E}}return D(G,ee)?{data:ee,meta:E}:{error:{status:G.status,data:ee},meta:E}});return function(_x33,_x34,_x35){return _ref18.apply(this,arguments)}}());function h(_x36,_x37){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var Pr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function MS(){return _MS.apply(this,arguments)}function _MS(){_MS=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _MS.apply(this,arguments)}function NS(e,t){throw Object.assign(new Pr({error:e,meta:t}),{throwImmediately:!0})}var Ml={},_S=(e,t)=>(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Ml).maxRetries,(o||Ml).maxRetries].filter(y=>y!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:MS,retryCondition:(y,h,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let y=yield e(r,n,o);if(y.error)throw new Pr(y);return y}catch(y){if(p++,y.throwImmediately){if(y instanceof Pr)return y.value;throw y}if(y instanceof Pr&&!f.retryCondition(y.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return y.value;yield f.backoff(p,f.maxRetries)}});return function(_x38,_x39,_x40){return _ref19.apply(this,arguments)}}()),zl=Object.assign(_S,{fail:NS}),es=T("__rtkq/focused"),Gl=T("__rtkq/unfocused"),ts=T("__rtkq/online"),Wl=T("__rtkq/offline");function rs(e){return e.type==="query"}function VS(e){return e.type==="mutation"}function ns(e){return e.type==="infinitequery"}function os(e,t,r,n,o,i){return LS(e)?e(t,r,n,o).filter(Qo).map(Ja).map(i):Array.isArray(e)?e.map(Ja).map(i):[]}function LS(e){return typeof e=="function"}function Ja(e){return typeof e=="string"?{type:e}:e}function US(e,t){return e.catch(t)}var Cn=Symbol("forceQueryFn"),Xa=e=>typeof e[Cn]=="function";function QS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:p,updateSubscriptionOptions:y}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:F,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function h(E,M){return O=>{let I=i.endpointDefinitions[E],P=e({queryArgs:M,endpointDefinition:I,endpointName:E});return a.get(O)?.[P]}}function S(E,M){return O=>m.get(O)?.[M]}function g(){return E=>Object.values(a.get(E)||{}).filter(Qo)}function v(){return E=>Object.values(m.get(E)||{}).filter(Qo)}function R(E){}function k(E,M){let O=(I,{subscribe:P=!0,forceRefetch:D,subscriptionOptions:N,[Cn]:$,...U}={})=>(V,_)=>{let B=e({queryArgs:I,endpointDefinition:M,endpointName:E}),L,z={...U,type:"query",subscribe:P,forceRefetch:D,subscriptionOptions:N,endpointName:E,originalArgs:I,queryCacheKey:B,[Cn]:$};if(rs(M))L=t(z);else{let{direction:ce,initialPageParam:fe}=U;L=r({...z,direction:ce,initialPageParam:fe})}let G=o.endpoints[E].select(I),Y=V(L),te=G(_());let{requestId:se,abort:ee}=Y,re=te.requestId!==se,Z=a.get(V)?.[B],oe=()=>G(_()),ge=Object.assign($?Y.then(oe):re&&!Z?Promise.resolve(te):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:N,queryCacheKey:B,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield ge;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>V(O(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){P&&V(f({queryCacheKey:B,requestId:se}))},updateSubscriptionOptions(ce){ge.subscriptionOptions=ce,V(y({endpointName:E,requestId:se,queryCacheKey:B,options:ce}))}});if(!Z&&!re&&!$){let ce=DS(a,V,{});ce[B]=ge,ge.then(()=>{delete ce[B],kr(ce)||a.delete(V)})}return ge};return O}function x(E,M){return k(E,M)}function F(E,M){return k(E,M)}function w(E){return(M,{track:O=!0,fixedCacheKey:I}={})=>(P,D)=>{let N=n({type:"mutation",endpointName:E,originalArgs:M,track:O,fixedCacheKey:I}),$=P(N);let{requestId:U,abort:V,unwrap:_}=$,B=US($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{P(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(B,{arg:$.arg,requestId:U,abort:V,unwrap:_,reset:L}),G=m.get(P)||{};return m.set(P,G),G[U]=z,z.then(()=>{delete G[U],kr(G)||m.delete(P)}),I&&(G[I]=z,z.then(()=>{G[I]===z&&(delete G[I],kr(G)||m.delete(P))})),z}}}function BS(e){return e}var Lo=(e={})=>({...e,[cn]:!0});function $S({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(P,D,N,$)=>(U,V)=>{let _=r[P],B=n({queryArgs:D,endpointDefinition:_,endpointName:P});if(U(o.internalActions.queryResultPatched({queryCacheKey:B,patches:N})),!$)return;let L=o.endpoints[P].select(D)(V()),z=os(_.providesTags,L.data,void 0,D,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:B,providedTags:z}))};function f(P,D,N=0){let $=[D,...P];return N&&$.length>N?$.slice(0,-1):$}function p(P,D,N=0){let $=[...P,D];return N&&$.length>N?$.slice(1):$}let y=(P,D,N,$=!0)=>(U,V)=>{let B=o.endpoints[P].select(D)(V()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(P,D,L.inversePatches,$))};if(B.status==="uninitialized")return L;let z;if("data"in B)if(qe(B.data)){let[G,Y,te]=Xn(B.data,N);L.patches.push(...Y),L.inversePatches.push(...te),z=G}else z=N(B.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:B.data});return L.patches.length===0||U(o.util.patchQueryData(P,D,L.patches,$)),L},h=(P,D,N)=>$=>$(o.endpoints[P].initiate(D,{subscribe:!1,forceRefetch:!0,[Cn]:()=>({data:N})})),S=(P,D)=>P.query&&P[D]?P[D]:BS,g=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(P,{signal:D,abort:N,rejectWithValue:$,fulfillWithValue:U,dispatch:V,getState:_,extra:B}){let L=r[P.endpointName];try{let z=S(L,"transformResponse"),G={signal:D,abort:N,dispatch:V,getState:_,extra:B,endpoint:P.endpointName,type:P.type,forced:P.type==="query"?v(P,_()):void 0,queryCacheKey:P.type==="query"?P.queryCacheKey:void 0},Y=P.type==="query"?P[Cn]:void 0,te,se=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(re,Z,oe,ge){if(Z==null&&re.pages.length)return Promise.resolve({data:re});let ce={queryArg:P.originalArgs,pageParam:Z},fe=yield ee(ce),he=ge?f:p;return{data:{pages:he(re.pages,fe.data,oe),pageParams:he(re.pageParams,Z,oe)}}});return function se(_x43,_x44,_x45,_x46){return _ref21.apply(this,arguments)}}();function ee(_x47){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(re){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(re),G,oe):Z=yield L.queryFn(re,G,oe,ce=>t(ce,G,oe)),typeof process<"u",Z.error)throw new Pr(Z.error,Z.meta);let ge=yield z(Z.data,Z.meta,re);return{...Z,data:ge}});return _ee.apply(this,arguments)}if(P.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:re}=L,{maxPages:Z=1/0}=re,oe,ge={pages:[],pageParams:[]},ce=a.selectQueryEntry(_(),P.queryCacheKey)?.data,he=v(P,_())&&!P.direction||!ce?ge:ce;if("direction"in P&&P.direction&&he.pages.length){let Fe=P.direction==="backward",dt=(Fe?Kl:Za)(re,he);oe=yield se(he,dt,Z,Fe)}else{let{initialPageParam:Fe=re.initialPageParam}=P,_e=ce?.pageParams??[],dt=_e[0]??Fe,Kt=_e.length;oe=yield se(he,dt,Z),Y&&(oe={data:oe.data.pages[0]});for(let Yt=1;Yt<Kt;Yt++){let Qr=Za(re,oe.data);oe=yield se(oe.data,Qr,Z)}}te=oe}else te=yield ee(P.originalArgs);return U(te.data,Lo({fulfilledTimeStamp:Date.now(),baseQueryMeta:te.meta}))}catch(z){let G=z;if(G instanceof Pr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(G.value,G.meta,P.originalArgs),Lo({baseQueryMeta:G.meta}))}catch(te){G=te}}throw typeof process<"u",console.error(G),G}});return function g(_x41,_x42){return _ref20.apply(this,arguments)}}();function v(P,D){let N=a.selectQueryEntry(D,P.queryCacheKey),$=a.selectConfig(D).refetchOnMountOrArgChange,U=N?.fulfilledTimeStamp,V=P.forceRefetch??(P.subscribe&&$);return V?V===!0||(Number(new Date)-Number(U))/1e3>=V:!1}let R=()=>ue(`${e}/executeQuery`,g,{getPendingMeta({arg:D}){let N=r[D.endpointName];return Lo({startedTimeStamp:Date.now(),...(ns(N)?{direction:D.direction}:{})})},condition(D,{getState:N}){let $=N(),U=a.selectQueryEntry($,D.queryCacheKey),V=U?.fulfilledTimeStamp,_=D.originalArgs,B=U?.originalArgs,L=r[D.endpointName],z=D.direction;return Xa(D)?!0:U?.status==="pending"?!1:v(D,$)||rs(L)&&L?.forceRefetch?.({currentArg:_,previousArg:B,endpointState:U,state:$})?!0:!(V&&!z)},dispatchConditionRejection:!0}),k=R(),x=R(),F=ue(`${e}/executeMutation`,g,{getPendingMeta(){return Lo({startedTimeStamp:Date.now()})}}),w=P=>"force"in P,E=P=>"ifOlderThan"in P,M=(P,D,N)=>($,U)=>{let V=w(N)&&N.force,_=E(N)&&N.ifOlderThan,B=(z=!0)=>{let G={forceRefetch:z,isPrefetch:!0};return o.endpoints[P].initiate(D,G)},L=o.endpoints[P].select(D)(U());if(V)$(B());else if(_){let z=L?.fulfilledTimeStamp;if(!z){$(B());return}(Number(new Date)-Number(new Date(z)))/1e3>=_&&$(B())}else $(B(!1))};function O(P){return D=>D?.meta?.arg?.endpointName===P}function I(P,D){return{matchPending:ar(ro(P),O(D)),matchFulfilled:ar(ot(P),O(D)),matchRejected:ar(Vt(P),O(D))}}return{queryThunk:k,mutationThunk:F,infiniteQueryThunk:x,prefetch:M,updateQueryData:y,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:I}}function Za(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Kl(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Yl(e,t,r,n){return os(r[e.meta.arg.endpointName][t],ot(e)?e.payload:void 0,ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Uo(e,t,r){let n=e[t];n&&r(n)}function wn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Nl(e,t,r){let n=e[wn(t)];n&&r(n)}var An={};function HS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:p}){let y=T(`${e}/resetApiState`);function h(O,I,P,D){var N;O[N=I.queryCacheKey]??(O[N]={status:"uninitialized",endpointName:I.endpointName}),Uo(O,I.queryCacheKey,$=>{$.status="pending",$.requestId=P&&$.requestId?$.requestId:D.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=D.startedTimeStamp;let U=o[D.arg.endpointName];ns(U)&&"direction"in I&&($.direction=I.direction)})}function S(O,I,P,D){Uo(O,I.arg.queryCacheKey,N=>{if(N.requestId!==I.requestId&&!D)return;let{merge:$}=o[I.arg.endpointName];if(N.status="fulfilled",$){if(N.data!==void 0){let{fulfilledTimeStamp:U,arg:V,baseQueryMeta:_,requestId:B}=I,L=nt(N.data,z=>$(z,P,{arg:V.originalArgs,baseQueryMeta:_,fulfilledTimeStamp:U,requestId:B}));N.data=L}else N.data=P;}else N.data=o[I.arg.endpointName].structuralSharing??!0?$l(Me(N.data)?ca(N.data):N.data,P):P;delete N.error,N.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Lt({name:`${e}/queries`,initialState:An,reducers:{removeQueryResult:{reducer(O,{payload:{queryCacheKey:I}}){delete O[I]},prepare:sr()},cacheEntriesUpserted:{reducer(O,I){for(let P of I.payload){let{queryDescription:D,value:N}=P;h(O,D,!0,{arg:D,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(O,{arg:D,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:O=>({payload:O.map(D=>{let{endpointName:N,arg:$,value:U}=D,V=o[N];return{queryDescription:{type:"query",endpointName:N,originalArgs:D.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:V,endpointName:N})},value:U}}),meta:{[cn]:!0,requestId:oo(),timestamp:Date.now()}})},queryResultPatched:{reducer(O,{payload:{queryCacheKey:I,patches:P}}){Uo(O,I,D=>{D.data=la(D.data,P.concat())})},prepare:sr()}},extraReducers(O){O.addCase(t.pending,(I,{meta:P,meta:{arg:D}})=>{let N=Xa(D);h(I,D,N,P)}).addCase(t.fulfilled,(I,{meta:P,payload:D})=>{let N=Xa(P.arg);S(I,P,D,N)}).addCase(t.rejected,(I,{meta:{condition:P,arg:D,requestId:N},error:$,payload:U})=>{Uo(I,D.queryCacheKey,V=>{if(!P){if(V.requestId!==N)return;V.status="rejected",V.error=U??$}})}).addMatcher(m,(I,P)=>{let{queries:D}=a(P);for(let[N,$]of Object.entries(D))($?.status==="fulfilled"||$?.status==="rejected")&&(I[N]=$)})}}),v=Lt({name:`${e}/mutations`,initialState:An,reducers:{removeMutationResult:{reducer(O,{payload:I}){let P=wn(I);P in O&&delete O[P]},prepare:sr()}},extraReducers(O){O.addCase(r.pending,(I,{meta:P,meta:{requestId:D,arg:N,startedTimeStamp:$}})=>{N.track&&(I[wn(P)]={requestId:D,status:"pending",endpointName:N.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:P,meta:D})=>{D.arg.track&&Nl(I,D,N=>{N.requestId===D.requestId&&(N.status="fulfilled",N.data=P,N.fulfilledTimeStamp=D.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:P,error:D,meta:N})=>{N.arg.track&&Nl(I,N,$=>{$.requestId===N.requestId&&($.status="rejected",$.error=P??D)})}).addMatcher(m,(I,P)=>{let{mutations:D}=a(P);for(let[N,$]of Object.entries(D))($?.status==="fulfilled"||$?.status==="rejected")&&N!==$?.requestId&&(I[N]=$)})}}),R=Lt({name:`${e}/invalidation`,initialState:An,reducers:{updateProvidedBy:{reducer(O,I){var N,$;let{queryCacheKey:P,providedTags:D}=I.payload;for(let U of Object.values(O))for(let V of Object.values(U)){let _=V.indexOf(P);_!==-1&&V.splice(_,1)}for(let{type:U,id:V}of D){let _=(N=O[U]??(O[U]={}))[$=V||"__internal_without_id"]??(N[$]=[]);_.includes(P)||_.push(P)}},prepare:sr()}},extraReducers(O){O.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:P}})=>{for(let D of Object.values(I))for(let N of Object.values(D)){let $=N.indexOf(P);$!==-1&&N.splice($,1)}}).addMatcher(m,(I,P)=>{var N,$;let{provided:D}=a(P);for(let[U,V]of Object.entries(D))for(let[_,B]of Object.entries(V)){let L=(N=I[U]??(I[U]={}))[$=_||"__internal_without_id"]??(N[$]=[]);for(let z of B)L.includes(z)||L.push(z)}}).addMatcher(Ye(ot(t),ln(t)),(I,P)=>{let D=Yl(P,"providesTags",o,f),{queryCacheKey:N}=P.meta.arg;R.caseReducers.updateProvidedBy(I,R.actions.updateProvidedBy({queryCacheKey:N,providedTags:D}))})}}),k=Lt({name:`${e}/subscriptions`,initialState:An,reducers:{updateSubscriptionOptions(O,I){},unsubscribeQueryResult(O,I){},internal_getRTKQSubscriptions(){}}}),x=Lt({name:`${e}/internalSubscriptions`,initialState:An,reducers:{subscriptionsUpdated:{reducer(O,I){return la(O,I.payload)},prepare:sr()}}}),F=Lt({name:`${e}/config`,initialState:{online:PS(),focused:kS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(O,{payload:I}){O.middlewareRegistered=O.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:O=>{O.addCase(ts,I=>{I.online=!0}).addCase(Wl,I=>{I.online=!1}).addCase(es,I=>{I.focused=!0}).addCase(Gl,I=>{I.focused=!1}).addMatcher(m,I=>({...I}))}}),w=tr({queries:g.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:x.reducer,config:F.reducer}),E=(O,I)=>w(y.match(I)?void 0:O,I),M={...F.actions,...g.actions,...k.actions,...x.actions,...v.actions,...R.actions,resetApiState:y};return{reducer:E,actions:M}}var bn=Symbol.for("RTKQ/skipToken"),Jl={status:"uninitialized"},_l=nt(Jl,()=>{}),Vl=nt(Jl,()=>{});function zS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>_l,o=w=>Vl;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:k,selectApiState:a,selectQueries:m,selectMutations:p,selectQueryEntry:f,selectConfig:y};function i(w){return{...w,...Ol(w.status)}}function a(w){return w[t]}function m(w){return a(w)?.queries}function f(w,E){return m(w)?.[E]}function p(w){return a(w)?.mutations}function y(w){return a(w)?.config}function h(w,E,M){return O=>{if(O===bn)return r(n,M);let I=e({queryArgs:O,endpointDefinition:E,endpointName:w});return r(D=>f(D,I)??_l,M)}}function S(w,E){return h(w,E,i)}function g(w,E){let{infiniteQueryOptions:M}=E;function O(I){let P={...I,...Ol(I.status)},{isLoading:D,isError:N,direction:$}=P,U=$==="forward",V=$==="backward";return{...P,hasNextPage:x(M,P.data),hasPreviousPage:F(M,P.data),isFetchingNextPage:D&&U,isFetchingPreviousPage:D&&V,isFetchNextPageError:N&&U,isFetchPreviousPageError:N&&V}}return h(w,E,O)}function v(){return w=>{let E;return typeof w=="object"?E=wn(w)??bn:E=w,r(E===bn?o:I=>a(I)?.mutations?.[E]??Vl,i)}}function R(w,E){let M=w[t],O=new Set;for(let I of E.filter(Qo).map(Ja)){let P=M.provided[I.type];if(!P)continue;let D=(I.id!==void 0?P[I.id]:Dl(Object.values(P)))??[];for(let N of D)O.add(N)}return Dl(Array.from(O.values()).map(I=>{let P=M.queries[I];return P?[{queryCacheKey:I,endpointName:P.endpointName,originalArgs:P.originalArgs}]:[]}))}function k(w,E){return Object.values(m(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function x(w,E){return E?Za(w,E)!=null:!1}function F(w,E){return!E||!w.getPreviousPageParam?!1:Kl(w,E)!=null}}var Ll=WeakMap?new WeakMap:void 0,Ul=({endpointName:e,queryArgs:t})=>{let r="",n=Ll?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ke(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));Ke(t)&&Ll?.set(t,o),r=o}return`${e}(${r})`};function GS(...e){return function(r){let n=ir(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let y=Ul;if("serializeQueryArgs"in p.endpointDefinition){let h=p.endpointDefinition.serializeQueryArgs;y=S=>{let g=h(S);return typeof g=="string"?g:Ul({...S,queryArgs:g})}}else r.serializeQueryArgs&&(y=r.serializeQueryArgs);return y(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:oo(),extractRehydrationInfo:n,hasRehydrationInfo:ir(p=>n(p)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:p,endpoints:y}){if(p)for(let h of p)o.tagTypes.includes(h)||o.tagTypes.push(h);if(y)for(let[h,S]of Object.entries(y))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(p=>p.init(a,o,i));function f(p){let y=p.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(y)){if(p.overrideExisting!==!0&&h in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error(He(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let g of m)g.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ut(e,...t){return Object.assign(e,...t)}var WS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(g,v)=>{var k,x;if(a.match(v)){let{queryCacheKey:F,requestId:w,options:E}=v.payload;return g?.[F]?.[w]&&(g[F][w]=E),!0}if(m.match(v)){let{queryCacheKey:F,requestId:w}=v.payload;return g[F]&&delete g[F][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:F,requestId:w}}=v,E=g[k=F.queryCacheKey]??(g[k]={});return E[`${w}_running`]={},F.subscribe&&(E[w]=F.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let F=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!F[w]),delete F[w]}if(t.rejected.match(v)){let{meta:{condition:F,arg:w,requestId:E}}=v;if(F&&w.subscribe){let M=g[x=w.queryCacheKey]??(g[x]={});M[E]=w.subscriptionOptions??M[E]??{},R=!0}}return R},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let R=p()[g]??{};return kr(R)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let R=f(r.currentSubscriptions,g),k=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Xn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof g.type=="string"&&!!g.type.startsWith(n),F=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;k=!x&&!F}return[k,!1]}};function KS(e){for(let t in e)return!1;return!0}var YS=2147483647/1e3-1,JS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:p}=t.internalActions,y=Ye(f.match,r.fulfilled,r.rejected,p.match);function h(k){let x=o.currentSubscriptions[k];return!!x&&!KS(x)}let S={},g=(k,x,F)=>{let w=x.getState(),E=a(w);if(y(k)){let M;if(p.match(k))M=k.payload.map(O=>O.queryDescription.queryCacheKey);else{let{queryCacheKey:O}=f.match(k)?k.payload:k.meta.arg;M=[O]}v(M,x,E)}if(t.util.resetApiState.match(k))for(let[M,O]of Object.entries(S))O&&clearTimeout(O),delete S[M];if(n.hasRehydrationInfo(k)){let{queries:M}=n.extractRehydrationInfo(k);v(Object.keys(M),x,E)}};function v(k,x,F){let w=x.getState();for(let E of k){let M=i(w,E);R(E,M?.endpointName,x,F)}}function R(k,x,F,w){let M=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let O=Math.max(0,Math.min(M,YS));if(!h(k)){let I=S[k];I&&clearTimeout(I),S[k]=setTimeout(()=>{h(k)||F.dispatch(m({queryCacheKey:k})),delete S[k]},O*1e3)}}return g},Ql=new Error("Promise never resolved before cacheEntryRemoved."),XS=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=no(n),p=no(o),y=ot(n,o),h={};function S(x,F,w){let E=h[x];E?.valueResolved&&(E.valueResolved({data:F,meta:w}),delete E.valueResolved)}function g(x){let F=h[x];F&&(delete h[x],F.cacheEntryRemoved())}let v=(x,F,w)=>{let E=R(x);function M(O,I,P,D){let N=a(w,I),$=a(F.getState(),I);!N&&$&&k(O,D,I,F,P)}if(n.pending.match(x))M(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:O,value:I}of x.payload){let{endpointName:P,originalArgs:D,queryCacheKey:N}=O;M(P,N,x.meta.requestId,D),S(N,I,{})}else if(o.pending.match(x))F.getState()[t].mutations[E]&&k(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,F,x.meta.requestId);else if(y(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))g(E);else if(e.util.resetApiState.match(x))for(let O of Object.keys(h))g(O)};function R(x){return f(x)?x.meta.arg.queryCacheKey:p(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?wn(x.payload):""}function k(x,F,w,E,M){let O=r.endpointDefinitions[x],I=O?.onCacheEntryAdded;if(!I)return;let P={},D=new Promise(B=>{P.cacheEntryRemoved=B}),N=Promise.race([new Promise(B=>{P.valueResolved=B}),D.then(()=>{throw Ql})]);N.catch(()=>{}),h[w]=P;let $=e.endpoints[x].select(O.type==="query"?F:w),U=E.dispatch((B,L,z)=>z),V={...E,getCacheEntry:()=>$(E.getState()),requestId:M,extra:U,updateCachedData:O.type==="query"?B=>E.dispatch(e.util.updateQueryData(x,F,B)):void 0,cacheDataLoaded:N,cacheEntryRemoved:D},_=I(F,V);Promise.resolve(_).catch(B=>{if(B!==Ql)throw B})}return v},ZS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},ev=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:p}=i.internalActions,y=Ye(ot(n),ln(n)),h=Ye(ot(n,o),Vt(n,o)),S=[],g=(k,x)=>{y(k)?R(Yl(k,"invalidatesTags",r,a),x):h(k)?R([],x):i.util.invalidateTags.match(k)&&R(os(k.payload,void 0,void 0,void 0,void 0,a),x)};function v(k){let{queries:x,mutations:F}=k;for(let w of[x,F])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(k,x){let F=x.getState(),w=F[e];if(S.push(...k),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(F,E);t.batch(()=>{let O=Array.from(M.values());for(let{queryCacheKey:I}of O){let P=w.queries[I],D=f.currentSubscriptions[I]??{};P&&(kr(D)===0?x.dispatch(p({queryCacheKey:I})):P.status!=="uninitialized"&&x.dispatch(m(P)))}})}return g},tv=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&f(g.meta.arg,v),r.util.resetApiState.match(g)&&h()};function m(g,v){let k=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!(!k||k.status==="uninitialized"))return x}function f({queryCacheKey:g},v){let R=v.getState()[e],k=R.queries[g],x=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:F,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(F))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+F;i[g]={nextPollTimestamp:M,pollingInterval:F,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(k)),f({queryCacheKey:g},v)},F)}}function p({queryCacheKey:g},v){let k=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:F}=S(x);if(!Number.isFinite(F)){y(g);return}let w=i[g],E=Date.now()+F;(!w||E<w.nextPollTimestamp)&&f({queryCacheKey:g},v)}function y(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function h(){for(let g of Object.keys(i))y(g)}function S(g={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let k in g)g[k].pollingInterval&&(R=Math.min(g[k].pollingInterval,R),v=g[k].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return a},rv=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=ro(r,n),i=Vt(r,n),a=ot(r,n),m={};return(p,y)=>{if(o(p)){let{requestId:h,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let k={},x=new Promise((M,O)=>{k.resolve=M,k.reject=O});x.catch(()=>{}),m[h]=k;let F=e.endpoints[S].select(v.type==="query"?g:h),w=y.dispatch((M,O,I)=>I),E={...y,getCacheEntry:()=>F(y.getState()),requestId:h,extra:w,updateCachedData:v.type==="query"?M=>y.dispatch(e.util.updateQueryData(S,g,M)):void 0,queryFulfilled:x};R(g,E)}}else if(a(p)){let{requestId:h,baseQueryMeta:S}=p.meta;m[h]?.resolve({data:p.payload,meta:S}),delete m[h]}else if(i(p)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:g}=p.meta;m[h]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete m[h]}}},nv=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,p)=>{es.match(f)&&m(p,"refetchOnFocus"),ts.match(f)&&m(p,"refetchOnReconnect")};function m(f,p){let y=f.getState()[e],h=y.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=h[g],R=S[g];if(!R||!v)continue;(Object.values(R).some(x=>x[p]===!0)||Object.values(R).every(x=>x[p]===void 0)&&y.config[p])&&(kr(R)===0?f.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&f.dispatch(n(v)))}})}return a};function ov(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[ZS,JS,ev,tv,XS,rv];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:m},R=f.map(F=>F(v)),k=WS(v),x=nv(v);return F=>w=>{if(!zn(w))return F(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:F},M=h.getState(),[O,I]=k(w,E,M),P;if(O?P=F(w):P=I,h.getState()[t]&&(x(w,E,M),m(w)||o.hasRehydrationInfo(w)))for(let D of R)D(w,E,M);return P}},actions:a};function y(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Bl=Symbol(),iv=({createSelector:e=ye}={})=>({name:Bl,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:p,invalidationBehavior:y},h){Zc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ts,onOffline:Wl,onFocus:es,onFocusLost:Gl},util:{}});let g=zS({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:k,buildInfiniteQuerySelector:x,buildMutationSelector:F}=g;ut(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:O,updateQueryData:I,upsertQueryData:P,prefetch:D,buildMatchThunkActions:N}=$S({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=HS({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:p,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:y}});ut(t.util,{patchQueryData:O,updateQueryData:I,upsertQueryData:P,prefetch:D,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),ut(t.internalActions,U);let{middleware:V,actions:_}=ov({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});ut(t.util,_),ut(t,{reducer:$,middleware:V});let{buildInitiateQuery:B,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueriesThunk:te,getRunningQueryThunk:se}=QS({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ut(t.util,{getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:te}),{name:Bl,injectEndpoint(ee,re){var ge;let oe=(ge=t.endpoints)[ee]??(ge[ee]={});rs(re)&&ut(oe,{name:ee,select:k(ee,re),initiate:B(ee,re)},N(w,ee)),VS(re)&&ut(oe,{name:ee,select:F(),initiate:z(ee)},N(M,ee)),ns(re)&&ut(oe,{name:ee,select:x(ee,re),initiate:L(ee,re)},N(w,ee))}}}}),Xl=GS(iv());d();c();l();u();var Bo=e=>e.query,Zl=e=>e.query?.enableQuerySyntax;var I0=ye(e=>Bo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),av=ye(e=>e.generatedAnswer?.answerApiQueryParams,e=>e??bn);d();c();l();u();d();c();l();u();var $o=e=>Pe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Bt(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Bt(t)??"",answerGenerated:e??!1})}),Ho=()=>Pe({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Bt(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});d();c();l();u();d();c();l();u();var ed=ye(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var zo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:hr(e)}});d();c();l();u();var td=e=>e.context;d();c();l();u();var rd=e=>e.pipeline;d();c();l();u();d();c();l();u();var xn=Be(Go(),1),cd=Be(nd(),1);d();c();l();u();var Wo=Be(Go(),1),id=Be(od(),1);Wo.default.extend(id.default);var ad="YYYY/MM/DD@HH:mm:ss",sv="1401-01-01";function Fr(e,t){let r=(0,Wo.default)(e,t);return!r.isValid()&&!t?(0,Wo.default)(e,ad):r}function Ko(e){return e.format(ad)}function sd(e,t){let r=Fr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}ds(r)}function ds(e){if(e.isBefore(sv))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}xn.default.extend(cd.default);var ud=["past","now","next"],ld=["minute","hour","day","week","month","quarter","year"],cv=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:ld}),period:new H({required:!0,constrainTo:ud})}};function ps(e){if(typeof e=="string"&&!bt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?gd(e):e;new Oe(cv(t.period)).validate(t);let r=pd(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);ds(r)}function dd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function pd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,xn.default)().subtract(r,n);case"next":return(0,xn.default)().add(r,n);case"now":return(0,xn.default)()}}function Rn(e){return Ko(pd(gd(e)))}function fd(e){return e.toLocaleLowerCase().split("-")}function bt(e){let[t,r,n]=fd(e);if(t==="now")return!0;if(!ud.includes(t)||!ld.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function md(e){return!!e&&typeof e=="object"&&"period"in e}function gd(e){let[t,r,n]=fd(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function yd(e){return e.type==="dateRange"}function hd(e){return`start${e}`}function Sd(e){return`end${e}`}var fs=()=>({dateFacetValueMap:{}});function uv(e,t,r){let n=e.start,o=e.end;return bt(n)&&(n=Rn(n),r.dateFacetValueMap[t][hd(n)]=e.start),bt(o)&&(o=Rn(o),r.dateFacetValueMap[t][Sd(o)]=e.end),{...e,start:n,end:o}}function ms(e,t){if(yd(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>uv(o,r,t))}}return e}function Ct(e){let t=fs();return{request:{...e,facets:e.facets?.map(n=>ms(n,t))},mappings:t}}function lv(e,t,r){return{...e,start:r.dateFacetValueMap[t][hd(e.start)]||e.start,end:r.dateFacetValueMap[t][Sd(e.end)]||e.end}}function dv(e,t){return e.facetId in t.dateFacetValueMap}function pv(e,t){return dv(e,t)?{...e,values:e.values.map(r=>lv(r,e.facetId,t))}:e}function Yo(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>pv(n,t))}}:e}d();c();l();u();d();c();l();u();d();c();l();u();function wt(e){return Object.values(e).map(t=>t.request)}function gs(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function vd(e){return wt(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ys={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function fv(e){return wt(e).map(t=>{let r=ys[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function mv(e){return[...fv(e.facetSet??{}),...vd(e.numericFacetSet??{}),...vd(e.dateFacetSet??{}),...wt(e.categoryFacetSet??{})]}function gv(e){return mv(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Jo(e){return gs(gv(e),e.facetOrder??[])}d();c();l();u();d();c();l();u();var xt=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Le.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Mo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function xt(_x48,_x49){return _ref22.apply(this,arguments)}}();d();c();l();u();var Or=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&zo(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();var Ad=ye(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Rt=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=Ss(e),o=yv(e),i=hv(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield xt(e,r):Or(e,t,r);return Ct({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:hs(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Rt(_x50,_x51,_x52){return _ref23.apply(this,arguments)}}();function hs(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function yv(e){return gs(vv(e),e.facetOrder??[])}function hv(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Sv).filter(r=>r.currentValues.length>0):void 0}function Sv(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function vv(e){return Av(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Av(e){return[...bv(e.facetSet??{}),...bd(e.numericFacetSet??{}),...bd(e.dateFacetSet??{}),...wt(e.categoryFacetSet??{})]}function bv(e){return wt(e).map(t=>{let r=ys[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function bd(e){return wt(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Ss(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Ad(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}d();c();l();u();d();c();l();u();var En=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},Cv=e=>t=>e.every(r=>!X(En(t,r))),wv=e=>t=>e.every(r=>X(En(t,r))),xv=(e,t)=>r=>{let n=Cd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},Rv=(e,t)=>r=>{let n=Cd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Cd=(e,t)=>{let r=En(t,e);return Sc(r)?r:[r]},wd={getResultProperty:En,fieldsMustBeDefined:Cv,fieldsMustNotBeDefined:wv,fieldMustMatch:xv,fieldMustNotMatch:Rv};var xd=ye(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var Rd=e=>e.searchHub;d();c();l();u();var vs=ye(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),lM=ye(e=>e,e=>{let t=vs(e);return t&&e?e[t].expression:""});d();c();l();u();var Ed=e=>e.configuration.search.locale,Id=e=>e.configuration.search.timezone;d();c();l();u();var kd=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var Pd=e=>e.excerptLength?.length;d();c();l();u();var Fd=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var Od=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var Td=e=>e.sortCriteria;var Dd=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ke(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Dd(_x53){return _ref24.apply(this,arguments)}}(),qd=(e,t)=>{let r=Bo(e)?.q,{aq:n,cq:o,dq:i,lq:a}=kv(e),m=td(e),f=zo(e.configuration.analytics,t,{actionCause:xd(e)}),p=Rd(e),y=rd(e),h=al(e)??[],S=Ev(e),g=vs(e.tabSet)||"default",v=Ed(e),R=Id(e),k=t.referrer||"",x=Fd(e),F=Td(e),w=Iv(e),E=Pd(e),M=Od(e),O=kd(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:Zl(e)}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(p?.length&&{searchHub:p}),...(y?.length&&{pipeline:y}),...(S.length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:hs(e),firstResult:e.pagination.firstResult}),tab:g,locale:v,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:k,...w,...(M??{}),...(E&&{excerptLength:E}),...(O&&{dictionaryFieldContext:O}),sortCriteria:F,...(x&&{facetOptions:x}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Ev=e=>Jo(e)?.map(t=>ms(t,fs())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),Iv=e=>({actionsHistory:e.configuration.analytics.enabled?Le.getInstance().getHistory():[]}),kv=e=>{let t=ed(e),r=Ss(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var jd=["text/plain","text/markdown"];var Tr=new H({required:!0}),Nd=new H,Dr=new ne({required:!0}),Pv={id:Tr,title:Tr,uri:Tr,permanentid:Tr,clickUri:Nd},_d=new H({required:!0,constrainTo:jd}),PN=T("generatedAnswer/setIsVisible",e=>Q(e,Dr)),Vd=T("generatedAnswer/setAnswerId",e=>Q(e,W)),FN=T("generatedAnswer/setAnswerGenerationMode",e=>Q(e,new H({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),ON=T("generatedAnswer/setIsEnabled",e=>Q(e,Dr)),bs=T("generatedAnswer/updateMessage",e=>Q(e,{textDelta:Tr})),Cs=T("generatedAnswer/updateCitations",e=>Q(e,{citations:new ie({required:!0,each:new K({values:Pv})})})),Fv=T("generatedAnswer/updateError",e=>Q(e,{message:Nd,code:new J({min:0})})),Ld=T("generatedAnswer/resetAnswer"),TN=T("generatedAnswer/like"),DN=T("generatedAnswer/dislike"),qN=T("generatedAnswer/feedbackModal/open"),jN=T("generatedAnswer/expand"),MN=T("generatedAnswer/collapse"),NN=T("generatedAnswer/setId",e=>Q(e,{id:new H({required:!0})})),_N=T("generatedAnswer/feedbackModal/close"),VN=T("generatedAnswer/sendFeedback"),As=T("generatedAnswer/setIsLoading",e=>Q(e,Dr)),Md=T("generatedAnswer/setIsStreaming",e=>Q(e,Dr)),ws=T("generatedAnswer/setAnswerContentFormat",e=>Q(e,_d)),LN=T("generatedAnswer/updateResponseFormat",e=>Q(e,{contentFormat:new ie({each:_d,default:["text/plain"]})})),UN=T("knowledge/updateAnswerConfigurationId",e=>Q(e,Tr)),QN=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>Q(e,io)),Ov=T("generatedAnswer/setIsAnswerGenerated",e=>Q(e,Dr)),xs=T("generatedAnswer/setCannotAnswer",e=>Q(e,Dr)),Tv=T("generatedAnswer/setAnswerApiQueryParams",e=>Q(e,new K({}))),BN=ue("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,p=yield Dd(r),y=(g,v)=>{switch(g){case"genqa.headerMessageType":{let R=JSON.parse(v);n(ws(R.contentFormat));break}case"genqa.messageType":n(bs(JSON.parse(v)));break;case"genqa.citationsType":n(Cs(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,k=m.length!==0&&!R;n(xs(k)),n(Md(!1)),n(Ov(R)),n($o(R)),n(Ho());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(As(!0));let h=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{h(p)&&(n(As(!1)),g.payload&&g.payloadType&&y(g.payloadType,g.payload))},abort:g=>{h(p)&&n(Fv(g))},close:()=>{h(p)&&n(Md(!1))},resetAnswer:()=>{h(p)&&n(Ld())}});S?f(S):n(As(!1))});return function(_x54,_x55){return _ref25.apply(this,arguments)}}()),$N=ue("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(Ld());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=qd(i,n);r(Tv(a)),yield r(Ud(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x56,_x57){return _ref26.apply(this,arguments)}}());d();c();l();u();d();c();l();u();function Bd(_x58,_x59){return _Bd.apply(this,arguments)}function _Bd(){_Bd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Bd.apply(this,arguments)}function $d(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=qv(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let p=-1;for(;r<m&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(f,p),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Hd(e,t,r){let n=Qd(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=Qd();else if(m>0){let f=o.decode(a.subarray(0,m)),p=m+(a[m+1]===32?2:1),y=o.decode(a.subarray(p));switch(f){case"data":n.data=n.data?`${n.data}
|
|
31
|
+
${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":Dv(y,n,t);break}}}}function Dv(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function qv(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Qd(){return{data:"",event:"",id:"",retry:void 0}}var Rs="text/event-stream",jv=1e3,zd="last-event-id";function Gd(){return typeof window<"u"}function Wd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:m,fetch:f,...p}){return new Promise((y,h)=>{let S={...r};S.accept||(S.accept=Rs);let g;function v(){g?.abort(),document.hidden||E()}!m&&Gd()&&document.addEventListener("visibilitychange",v);let R=jv,k;function x(){Gd()&&document.removeEventListener("visibilitychange",v),clearTimeout(k),g?.abort()}t?.addEventListener("abort",()=>{x(),y()});let F=f??b,w=n??Mv;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let M=yield F(e,{...p,headers:S,signal:g?.signal});yield w(M),yield Bd(M.body,$d(Hd(O=>{O?S[zd]=O:delete S[zd]},O=>{R=O},o))),i?.(),x(),y()}catch(M){if(!g?.signal?.aborted)try{let O=a?.(M)??R;clearTimeout(k),k=setTimeout(E,O)}catch(O){x(),h(O)}}});return _E.apply(this,arguments)}E()})}function Mv(e){let t=e.headers.get("content-type");if(!t?.startsWith(Rs))throw new Error(`Expected content-type to be ${Rs}, Actual: ${t}`)}d();c();l();u();var Nv=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,m=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=ke(a,i);return{data:Hl({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${m}`,fetchFn:function(){var _ref28=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{g[v]=h[v]}),g.duplex="half",g.body=yield h.text(),b(S,g)});return function fetchFn(_x63){return _ref28.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(p){return{error:p}}});return function Nv(_x60,_x61,_x62){return _ref27.apply(this,arguments)}}(),Kd=Xl({reducerPath:"answer",baseQuery:zl(Nv,{maxRetries:3}),endpoints:()=>({})});var _v=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Vv=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},Lv=(e,t)=>{e.citations=t.citations},Uv=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},Qv=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},Bv=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&Qv(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(_v(t,o),r(ws(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(Vv(t,o),r(bs({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(Lv(t,o),r(Cs({citations:o.citations})));break;case"genqa.endOfStreamType":Uv(t,o),r($o(o.answerGenerated??!1)),r(Ho());break}},$v=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Es=Kd.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x64,_x65){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:m,insightConfiguration:f}=r(),{organizationId:p,environment:y,accessToken:h}=a,S=ke(p,y),g=$v(S,p,m.answerConfigurationId,f?.insightId);yield Wd(g,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:b,onopen:function(){var _ref29=_asyncToGenerator(function*(v){let R=v.headers.get("x-answer-id");R&&o(k=>{k.answerId=R,i(Vd(R))})});return function onopen(_x66){return _ref29.apply(this,arguments)}}(),onmessage:v=>{o(R=>{Bv(v,R,i)})},onerror:v=>{throw v},onclose:()=>{o(v=>{i(xs(!v.generated))})}})}).apply(this,arguments)}})})}),Ud=e=>Es.endpoints.getAnswer.initiate(e);d();c();l();u();var Yd=me(cr,e=>e);d();c();l();u();function Hv(e){let t=e.payload?.analyticsAction;return Jd(e)&&!X(t)}function Jd(e){return"type"in e}var Xd=e=>t=>r=>{let n;Hv(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Jd(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var U_=T("tab/register",e=>{let t=new K({values:{id:W,expression:we}});return Q(e,t)}),Xo=T("tab/updateActiveTab",e=>Q(e,W));d();c();l();u();var Zo=Be(Go(),1),tp=Be(Zd(),1),rp=Be(ep(),1);Zo.default.extend(rp.default);Zo.default.extend(tp.default);var np=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Zo.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});d();c();l();u();var zv=/(^|; )Coveo-Pendragon=([^;]*)/;function Os(){return typeof window>"u"?!1:zv.exec(document.cookie)?.pop()||null}var op=me(np(),e=>e.addCase(yt,(t,r)=>{Gv(t,r.payload)}).addCase(Je,(t,r)=>{Wv(t,r.payload)}).addCase(ur,(t,r)=>{Kv(t,r.payload)}).addCase(lr,t=>{t.analytics.enabled=!1}).addCase(dr,t=>{t.analytics.enabled=!0}).addCase(ao,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(so,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Xo,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Iu,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ht,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function Gv(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function Wv(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Kv(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=Os();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ze=op;d();c();l();u();function Yv(e){return e.instantlyCallable}var ip=()=>e=>t=>e(Yv(t)?t():t);d();c();l();u();var ap=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},sp=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var Ts=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();function cp(e,t){let r={...e},n,o=i=>(a,m)=>{let f=i(a,m);return n?n(f,m):f};return{get combinedReducer(){let i=Ac(Object.entries(t).filter(([a])=>!(a in r)).map(([a,m])=>[a,()=>m]));return o(tr({...i,...r}))},containsAll(i){return Object.keys(i).every(m=>m in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function Jv(e){if(!e||!Xv(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function up(e,t=60){if(!e)return!1;let r=Jv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Xv(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function dp(e,t){let r=0,n=null,o=Nn(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(f,p=!1){let y=!n;y&&t&&(n=_asyncToGenerator(function*(){return p&&eA(t),yield t()})().finally(()=>{n=null}));let h=yield n;return y&&h&&f.dispatch(yt({accessToken:h})),h});return function i(_x67){return _ref30.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(f){let p=f.getState(),y=tA(p);if(!(!y||!up(y))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(h){e.warn(h,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x68){return _ref32.apply(this,arguments)}}(),m=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(f,p,y){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),lp(f,p.error),p;r++,o(),yield i(f,!0),f.dispatch(y)});return function m(_x69,_x70,_x71){return _ref33.apply(this,arguments)}}();return f=>p=>(/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(y){let h=typeof y=="function",S=typeof t=="function";if(!h)return p(y);S&&(yield a(f));let g=yield p(y);return Zv(g)?S?yield m(f,g,y):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),lp(f,g.error),g):g});return function(_x72){return _ref34.apply(this,arguments)}}())}function Zv(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new er().name}function lp(e,t){e.dispatch(fo({status:401,statusCode:401,message:t.message,type:t.name}))}function eA(_x73){return _eA.apply(this,arguments)}function _eA(){_eA=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _eA.apply(this,arguments)}function tA(e){return e.configuration.accessToken}d();c();l();u();function pp({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return du({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(sp(n.logger))})}function rA(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&vc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function fp(e,t){let r={...e.reducers,configuration:ze,version:Yd},n=nA({...e,reducers:r},t,ze),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(yt({accessToken:o,environment:i,organizationId:a}));let m=rA(e.configuration,n.logger);return m&&n.dispatch(ur(m)),n}function nA(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=cp({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,m={...t,get relay(){return Sn(p.state,o)},get navigatorContext(){return Ts(this.relay,o)}},f=oA(e,m,i),p={addReducers(y){i.containsAll(y)||(i.add(y),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(dr())},disableAnalytics(){f.dispatch(lr())},get state(){return f.getState()},get relay(){return Sn(this.state,o)},get navigatorContext(){return Ts(this.relay,o)},logger:a,store:f};return p}function oA(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=iA(e,t.logger);return pp({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function iA(e,t){let{renewAccessToken:r}=e.configuration,n=dp(t,r);return[ip,n,ap(t),Xd].concat(Es.middleware,e.middlewares||[])}d();c();l();u();var Cp=Be(bp(),1);function wp(e){return(0,Cp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function xp(e,t){let r=wA(e),n=Ve,o=xA(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function wA(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function xA(e){return e.preprocessRequest||Ln}d();c();l();u();d();c();l();u();var Rp={organizationId:W,accessToken:W,name:new H({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new ne({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Ep(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Ip=new Oe({...Rp,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,locale:Ce,timezone:Ce});function _s(){return{...Ep(),searchHub:"default"}}var RA={debug:po,pipeline:mr,searchHub:Ir,recommendation:Rr};function kp(e){let t=wp(e.loggerOptions);EA(e.configuration,t);let r=IA(e.configuration,t),n={...xp(e.configuration,t),apiClient:r},o={...e,reducers:RA},i=fp(o,n),{pipeline:a,searchHub:m,timezone:f,locale:p,proxyBaseUrl:y}=e.configuration;return i.dispatch(Je({timezone:f,locale:p,proxyBaseUrl:y})),X(a)||i.dispatch(pr(a)),X(m)||i.dispatch(Er(m)),{...i,get state(){return i.state}}}function EA(e,t){try{Ip.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function IA(e,t){return new Bn({logger:t,preprocessRequest:e.preprocessRequest||Ln,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Nc,postprocessFacetSearchResponseMiddleware:_c,postprocessQuerySuggestResponseMiddleware:Vc})}d();c();l();u();d();c();l();u();d();c();l();u();var kA=new ie({each:W,required:!0}),Pp=(e,t)=>(Q(e,W),jn(t)?Q(t,W):Q(t,kA),{payload:{contextKey:e,contextValue:t}}),zt=T("context/set",e=>{for(let[t,r]of Object.entries(e))Pp(t,r);return{payload:e}}),Gt=T("context/add",e=>Pp(e.contextKey,e.contextValue)),Wt=T("context/remove",e=>Q(e,W));d();c();l();u();d();c();l();u();function ri(){return{contextValues:{}}}var ni=me(ri(),e=>{e.addCase(zt,(t,r)=>{t.contextValues=r.payload}).addCase(Gt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Wt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(je.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();function It(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),m=t!==a;return t=a,m}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),m;return n()&&(t=JSON.stringify(this.state),m=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&m?.()}},get state(){return{}}}}d();c();l();u();var PA=["caseId","caseNumber"],FA={caseId:"caseContext",caseNumber:"caseContext"},kn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${FA[t]} to set this value.}`)}};function Vs(e){return PA.includes(e)}var OA=new Oe({values:new K({options:{required:!1}})});function Fp(e,t={}){if(!qA(e))throw Ge;let r=It(e),{dispatch:n}=e,o=()=>e.state,i=bu(e,OA,t.initialState,"buildContext");return i.values&&n(zt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(zt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?TA(n):DA(n))}}var TA=e=>({add(t,r){e(Gt({contextKey:t,contextValue:r}))},remove(t){e(Wt(t))}}),DA=e=>({add(t,r){if(Vs(t))throw new kn(t);e(Gt({contextKey:t,contextValue:r}))},remove(t){if(Vs(t))throw new kn(t);e(Wt(t))}});function qA(e){return e.addReducers({context:ni}),!0}function Op(e,t){return Fp(e,t)}d();c();l();u();d();c();l();u();var jr=T("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=Q(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:we}),i=Q(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Mr=T("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:we,key:we}});return Q(e,t)}),Nr=T("dictionaryFieldContext/remove",e=>Q(e,we));d();c();l();u();d();c();l();u();function oi(){return{contextValues:{}}}var ii=me(oi(),e=>{e.addCase(jr,(t,r)=>{t.contextValues=r.payload}).addCase(Mr,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Nr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(je.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function Tp(e){if(!jA(e))throw Ge;let t=It(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(jr(o))},add(o,i){r(Mr({field:o,key:i}))},remove(o){r(Nr(o))}}}function jA(e){return e.addReducers({dictionaryFieldContext:ii}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ai=T("breadcrumb/deselectAll"),Dp=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();d();c();l();u();var Pn={value:W,numberOfResults:new J({min:0}),state:W};d();c();l();u();var le=W;var VA=new J({min:1,default:8,required:!1}),LA=new J({min:1,max:20,default:5,required:!1}),UA={desiredCount:LA,numberOfValues:VA},_1=T("automaticFacet/setOptions",e=>Q(e,UA)),V1=T("automaticFacet/deselectAll",e=>Q(e,le)),QA=W,qp=T("automaticFacet/toggleSelectValue",e=>Q(e,{field:QA,selection:new K({values:Pn})}));d();c();l();u();d();c();l();u();var BA={state:new pe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:W}),moreValuesAvailable:new ne({required:!1})};function Ls(e){e.children.forEach(t=>{Ls(t)}),Ve({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},BA)}var _r={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),basePath:new ie({required:!1,each:W}),filterByBasePath:new ne({required:!1})};var nB=T("categoryFacet/register",e=>Q(e,_r)),jp=T("categoryFacet/toggleSelectValue",e=>{try{return Ve(e.facetId,W),Ls(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),Mp=T("categoryFacet/deselectAll",e=>Q(e,_r.facetId)),oB=T("categoryFacet/updateNumberOfValues",e=>Q(e,{facetId:_r.facetId,numberOfValues:_r.numberOfValues})),iB=T("categoryFacet/updateSortCriterion",e=>Q(e,{facetId:_r.facetId,criterion:new pe})),aB=T("categoryFacet/updateBasePath",e=>Q(e,{facetId:_r.facetId,basePath:new ie({each:W})}));d();c();l();u();d();c();l();u();var Fn={facetId:le,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var $A={path:new ie({required:!0,each:W}),displayValue:we,rawValue:we,count:new J({required:!0,min:0})},Np=T("categoryFacet/selectSearchResult",e=>Q(e,{facetId:le,value:new K({values:$A})})),xB=T("categoryFacetSearch/register",e=>Q(e,Fn));d();c();l();u();var _p={facetId:le,value:new K({values:{displayValue:we,rawValue:we,count:new J({required:!0,min:0})}})},jB=T("facetSearch/register",e=>Q(e,Fn)),MB=T("facetSearch/update",e=>Q(e,Fn)),Vp=T("facetSearch/toggleSelectValue",e=>Q(e,_p)),Lp=T("facetSearch/toggleExcludeValue",e=>Q(e,_p));d();c();l();u();d();c();l();u();var BB=new H({regex:/^[a-zA-Z0-9-_]+$/}),$B=new H({required:!0}),HB=new ie({each:new H}),zB=new H,GB=new ne,WB=new ne,KB=new J({min:0}),HA=new J({min:1}),YB=new ne({required:!0}),zA=new K,GA=new H,WA={captions:zA,numberOfValues:HA,query:GA},JB=new K({values:WA}),Up=new K({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),XB=new ne,Qp=new ie({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var KA={facetId:le,field:new H({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),resultsMustMatch:new pe({required:!1}),allowedValues:Up,customSort:Qp},l$=T("facet/register",e=>Q(e,KA)),Bp=T("facet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:Pn})})),$p=T("facet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:Pn})})),si=T("facet/deselectAll",e=>Q(e,le)),d$=T("facet/updateSortCriterion",e=>Q(e,{facetId:le,criterion:new pe({required:!0})})),p$=T("facet/updateNumberOfValues",e=>Q(e,{facetId:le,numberOfValues:new J({required:!0,min:1})})),f$=T("facet/updateIsFieldExpanded",e=>Q(e,{facetId:le,isFieldExpanded:new ne({required:!0})})),m$=T("facet/updateFreezeCurrentValues",e=>Q(e,{facetId:le,freezeCurrentValues:new ne({required:!0})}));d();c();l();u();d();c();l();u();function zp(e){let t=Hp(e.start,e),r=Hp(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Hp(e,t){let{dateFormat:r}=t;return md(e)?(ps(e),dd(e)):typeof e=="string"&&bt(e)?(ps(e),e):(sd(e,r),Ko(Fr(e,r)))}d();c();l();u();var Gp=T("rangeFacet/updateSortCriterion",e=>Q(e,{facetId:le,criterion:new pe({required:!0})}));d();c();l();u();var ci={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0}),numberOfResults:new J({required:!0,min:0})},ui={start:W,end:W,endInclusive:new ne({required:!0}),state:W,numberOfResults:new J({required:!0,min:0})};var YA={start:W,end:W,endInclusive:new ne({required:!0}),state:W},JA={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:YA})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),rangeAlgorithm:new pe({required:!1})};function Wp(e){return bt(e)?Rn(e):e}function Kp(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=zp(t);if(Fr(Wp(r)).isAfter(Fr(Wp(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var eH=T("dateFacet/register",e=>{try{return Ve(e,JA),Kp(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),Yp=T("dateFacet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:ui})})),Jp=T("dateFacet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:ui})})),Xp=T("dateFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:le,values:new ie({each:new K({values:ui})})}),Kp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});d();c();l();u();var XA={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0})},ZA={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:XA})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),rangeAlgorithm:new pe({required:!1})};function Zp(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var fH=T("numericFacet/register",e=>{try{return Q(e,ZA),Zp(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),ef=T("numericFacet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:ci})})),tf=T("numericFacet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:ci})})),rf=T("numericFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:le,values:new ie({each:new K({values:ci})})}),Zp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});d();c();l();u();d();c();l();u();var nf=T("facet/updateFacetAutoSelection",e=>Q(e,{allow:new ne({required:!0})}));d();c();l();u();d();c();l();u();var li=class extends vt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ne().q}get responseTime(){return this.activeInstantResultCache?.duration??We().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??We().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var of=()=>Pe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new li(e)),af=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var Us={id:W},eb={...Us,q:we},zH=T("instantResults/register",e=>Q(e,Us)),di=T("instantResults/updateQuery",e=>Q(e,eb)),GH=T("instantResults/clearExpired",e=>Q(e,Us));d();c();l();u();var pi=new J({required:!0,min:0}),fi=T("pagination/registerNumberOfResults",e=>Q(e,pi)),mi=T("pagination/updateNumberOfResults",e=>Q(e,pi)),gi=T("pagination/registerPage",e=>Q(e,pi)),Vr=T("pagination/updatePage",e=>Q(e,pi)),yi=T("pagination/nextPage"),hi=T("pagination/previousPage");d();c();l();u();var Lr=T("query/updateQuery",e=>Q(e,{q:new H,enableQuerySyntax:new ne}));d();c();l();u();d();c();l();u();d();c();l();u();var kt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Qs=()=>Pe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Pt=e=>Pe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ne().q,aq:r.advancedSearchQueries?.aq||kt().aq,cq:r.advancedSearchQueries?.cq||kt().cq,dq:r.advancedSearchQueries?.dq||kt().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var Oz=T("didYouMean/enable"),Tz=T("didYouMean/disable"),Dz=T("didYouMean/automaticCorrections/disable"),qz=T("didYouMean/automaticCorrections/enable"),Si=T("didYouMean/correction",e=>Q(e,W)),jz=T("didYouMean/automaticCorrections/mode",e=>Q(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Bs=()=>Pe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var sf=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function cf(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function uf(){return[]}d();c();l();u();function On(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function lf(){return{}}d();c();l();u();function df(){return{}}d();c();l();u();function pf(){return{}}function et(e){return{context:e.context||ri(),dictionaryFieldContext:e.dictionaryFieldContext||oi(),facetSet:e.facetSet||qo(),numericFacetSet:e.numericFacetSet||Do(),dateFacetSet:e.dateFacetSet||To(),categoryFacetSet:e.categoryFacetSet||Oo(),automaticFacetSet:e.automaticFacetSet??Fo(),pagination:e.pagination||On(),query:e.query||Ne(),tabSet:e.tabSet||pf(),advancedSearchQueries:e.advancedSearchQueries||kt(),staticFilterSet:e.staticFilterSet||df(),querySet:e.querySet||lf(),sortCriteria:e.sortCriteria||jo(),pipeline:e.pipeline||fr(),searchHub:e.searchHub||Cr(),facetOptions:e.facetOptions||cf(),facetOrder:e.facetOrder??uf(),debug:e.debug??lo()}}d();c();l();u();var J2=new K({values:{undoneQuery:we},options:{required:!0}}),ff=()=>Pe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var vi=T("trigger/query/ignore",e=>Q(e,new H({emptyAllowed:!0,required:!0}))),Ai=T("trigger/query/modification",e=>Q(e,new K({values:{originalQuery:Ce,modification:Ce}})));d();c();l();u();var Ft=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=nb(e),n=Jo(e),o=tb(e),i=yield xt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ct({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ft(_x74,_x75){return _ref35.apply(this,arguments)}}();function tb(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(rb).filter(r=>r.currentValues.length>0):void 0}function rb(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function nb(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ob(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function ob(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Ot=class{constructor(t,r=n=>{this.dispatch(Lr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x76,_x77){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Yo(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Te(t.response)?(this.dispatch(Pt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,y=!X(f)&&!X(f.correctedQuery);if(!p&&!y)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Xe(et(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Te(i.response)?(_this13.dispatch(Pt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Xe(et(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Bs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Bs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(vi("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Te(a.response)?(_this14.dispatch(Pt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Xe(et(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:ff()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ne().enableQuerySyntax},search:{...We(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Xe(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Ft(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Si(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ai({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Ft(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var YG=ue("search/executeSearch",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();return yield bi(r,t,e)});return function(_x78,_x79){return _ref36.apply(this,arguments)}}()),JG=ue("search/fetchPage",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Hs(r,t,e)});return function(_x80,_x81){return _ref37.apply(this,arguments)}}()),XG=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();return yield zs(t,r)});return function(_x82,_x83){return _ref38.apply(this,arguments)}}()),ZG=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();return yield cb(t,e,r)});return function(_x84,_x85){return _ref39.apply(this,arguments)}}()),eW=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){return $s(e,t)});return function(_x86,_x87){return _ref40.apply(this,arguments)}}()),ib=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=yield Ft(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function ib(_x88,_x89){return _ref41.apply(this,arguments)}}(),ab=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t,r){let n=yield xt(e);return Ct({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function ab(_x90,_x91,_x92){return _ref42.apply(this,arguments)}}(),sb=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=yield Ft(e,t);return r.request.numberOfResults=0,r});return function sb(_x93,_x94){return _ref43.apply(this,arguments)}}(),mf=e=>{e.configuration.analytics.enabled&&Le.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function $s(_x95,_x96){return _$s.apply(this,arguments)}function _$s(){_$s=_asyncToGenerator(function*(e,t){Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Ot({...t,analyticsAction:of()},p=>{t.dispatch(di({q:p,id:e.id}))}),a=yield ab(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _$s.apply(this,arguments)}function Hs(_x97,_x98,_x99){return _Hs.apply(this,arguments)}function _Hs(){_Hs=_asyncToGenerator(function*(e,t,r){mf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Ot({...t,analyticsAction:r}),f=yield Ft(e,a),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _Hs.apply(this,arguments)}function zs(_x100,_x101){return _zs.apply(this,arguments)}function _zs(){_zs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Qs().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Ot({...e,analyticsAction:Qs()}),m=yield ib(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _zs.apply(this,arguments)}function cb(_x102,_x103,_x104){return _cb.apply(this,arguments)}function _cb(){_cb=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Ot({...e,analyticsAction:t}),f=yield sb(r,a),p=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(p)});return _cb.apply(this,arguments)}function bi(_x105,_x106,_x107){return _bi.apply(this,arguments)}function _bi(){_bi=_asyncToGenerator(function*(e,t,r){mf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=yield Ft(e,a),f=new Ot({...t,analyticsAction:r}),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _bi.apply(this,arguments)}d();c();l();u();var Tt=class{constructor(t,r=n=>{this.dispatch(Lr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x108,_x109){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Yo(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Te(t.response)?(this.dispatch(Pt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,y=!X(f)&&!X(f.correctedQuery);if(!p&&!y)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Xe(et(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Te(i.response)?(_this20.dispatch(Pt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Xe(et(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(vi("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Te(a.response)?(_this21.dispatch(Pt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Xe(et(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Xe(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=sf(),o=yield _this22.fetchFromAPI(yield Rt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Si(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ai({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Rt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var VW=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;Q(e,{q:new H,enableQuerySyntax:new ne,clearFilters:new ne}),e.clearFilters&&(r(ai()),r(Dp())),r(nf({allow:!0})),r(Lr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Vr(1))}),LW=T("search/updateSearchAction"),gf=ue("search/executeSearch",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return bi(r,t,e.legacy);yf(r);let n=e.next?hf(e.next):void 0,o=yield Rt(r,t.extra.navigatorContext,n),i=new Tt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x110,_x111){return _ref44.apply(this,arguments)}}()),UW=ue("search/fetchPage",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=t.getState();if(yf(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Hs(r,t,e.legacy);let n=new Tt({...t,analyticsAction:e.next}),o=yield Rt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x112,_x113){return _ref45.apply(this,arguments)}}()),QW=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return zs(t,r);let n=Rl("browseResults",t.getState),o=new Tt({...t,analyticsAction:n}),i=yield ub(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x114,_x115){return _ref46.apply(this,arguments)}}()),BW=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return bi(r,t,e.legacy);let n=new Tt({...t,analyticsAction:{}}),o=yield db(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x116,_x117){return _ref47.apply(this,arguments)}}()),$W=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return $s(e,t);Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=hf(af()),a=yield lb(r,t.extra.navigatorContext,n,o,i),m=new Tt({...t,analyticsAction:i},y=>{t.dispatch(di({q:y,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield m.process(f);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x118,_x119){return _ref48.apply(this,arguments)}}()),ub=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=yield Rt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function ub(_x120,_x121,_x122){return _ref49.apply(this,arguments)}}(),lb=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t,r,n,o){let i=Or(e,t,o);return Ct({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function lb(_x123,_x124,_x125,_x126,_x127){return _ref50.apply(this,arguments)}}(),db=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t,r){let n=yield Rt(e,t,r);return n.request.numberOfResults=0,n});return function db(_x128,_x129,_x130){return _ref51.apply(this,arguments)}}(),yf=e=>{e.configuration.analytics.enabled&&Le.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},hf=e=>({actionCause:e.actionCause,type:e.actionCause});var Sf=me(On(),e=>{e.addCase(fi,(t,r)=>{let n=Gs(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Tn(n,o)}).addCase(mi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Xo,t=>{t.firstResult=0}).addCase(gi,(t,r)=>{let n=r.payload;t.firstResult=Tn(n,t.numberOfResults)}).addCase(Vr,(t,r)=>{let n=r.payload;t.firstResult=Tn(n,t.numberOfResults)}).addCase(hi,t=>{let r=Gs(t),n=Math.max(r-1,1);t.firstResult=Tn(n,t.numberOfResults)}).addCase(yi,t=>{let r=Gs(t),n=fb(t),o=Math.min(r+1,n);t.firstResult=Tn(o,t.numberOfResults)}).addCase(je.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(ht,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(gf.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(si,t=>{Ie(t)}).addCase(Jp,t=>{Ie(t)}).addCase($p,t=>{Ie(t)}).addCase(tf,t=>{Ie(t)}).addCase(Lp,t=>{Ie(t)}).addCase(Bp,t=>{Ie(t)}).addCase(Mp,t=>{Ie(t)}).addCase(jp,t=>{Ie(t)}).addCase(Np,t=>{Ie(t)}).addCase(Yp,t=>{Ie(t)}).addCase(ef,t=>{Ie(t)}).addCase(ai,t=>{Ie(t)}).addCase(Xp,t=>{Ie(t)}).addCase(rf,t=>{Ie(t)}).addCase(Vp,t=>{Ie(t)}).addCase(qp,t=>{Ie(t)})});function Ie(e){e.firstResult=On().firstResult}function Gs(e){let{firstResult:t,numberOfResults:r}=e;return mb(t,r)}function fb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return gb(t,r)}function Tn(e,t){return(e-1)*t}function mb(e,t){return Math.round(e/t)+1}function gb(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Ws(e){return e.addReducers({pagination:Sf}),{nextPage:yi,previousPage:hi,registerNumberOfResults:fi,registerPage:gi,updateNumberOfResults:mi,updatePage:Vr}}var yb=new Oe({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function vf(e,t={}){if(!hb(e))throw Ge;let r=It(e),{dispatch:n}=e,o=()=>e.state,i=Cu(e,yb,t.options,"buildRecommendationList");return i.id!==""&&n(xr({id:i.id})),i.numberOfRecommendations&&n(Ws(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(At())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function hb(e){return e.addReducers({recommendation:Rr,configuration:ze}),!0}d();c();l();u();d();c();l();u();function Af(e,t,r){if(!Sb(e))throw Ge;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Nn(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function Sb(e){return e.addReducers({configuration:ze}),!0}function bf(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Vo(t.options.result)))};return Af(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var Dt=()=>new H({required:!1,emptyAllowed:!0}),Ci=T("advancedSearchQueries/update",e=>Q(e,{aq:Dt(),cq:Dt(),lq:Dt(),dq:Dt()})),wi=T("advancedSearchQueries/register",e=>Q(e,{aq:Dt(),cq:Dt(),lq:Dt(),dq:Dt()}));var Cf=me(kt(),e=>{e.addCase(Ci,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0),ve(i)||(t.lq=i,t.lqWasSet=!0),ve(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(wi,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ve(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ve(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ve(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(je.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(ht,(t,r)=>{let{aq:n,cq:o}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0)})});function vb(e){return e.addReducers({advancedSearchQueries:Cf}),{updateAdvancedSearchQueries:Ci,registerAdvancedSearchQueries:wi}}d();c();l();u();function Ab(e){return e.addReducers({configuration:ze}),{disableAnalytics:lr,enableAnalytics:dr,setOriginLevel2:ao,setOriginLevel3:so,updateAnalyticsConfiguration:ur,updateBasicConfiguration:yt}}d();c();l();u();function bb(e){return e.addReducers({configuration:ze,pipeline:mr,searchHub:Ir}),{updateSearchConfiguration:Je}}d();c();l();u();function Cb(e){return e.addReducers({context:ni}),{addContext:Gt,removeContext:Wt,setContext:zt}}d();c();l();u();function wb(e){return e.addReducers({debug:po}),{disableDebug:uo,enableDebug:co}}d();c();l();u();function xb(e){return e.addReducers({dictionaryFieldContext:ii}),{addContext:Mr,removeContext:Nr,setContext:jr}}d();c();l();u();d();c();l();u();d();c();l();u();var Rb={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},wf=T("folding/register",e=>Q(e,Rb)),fY=ue("folding/loadCollection",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield xt(i):Or(i,o),m=yield n.search({...a,q:Eb(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Te(m)?r(m.error):{collectionId:e,results:m.success.results,searchUid:m.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x131,_x132){return _ref52.apply(this,arguments)}}());function Eb(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var xf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Ur=T("fields/registerFieldsToInclude",e=>Q(e,io)),xi=T("fields/fetchall/enable"),Ri=T("fields/fetchall/disable"),Ei=ue("fields/fetchDescription",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:m}=o.configuration,{apiBaseUrl:f}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:m,url:f??pt(m,a)});return Te(p)?n(p.error):p.success.fields});return function(_x133,_x134){return _ref53.apply(this,arguments)}}());d();c();l();u();var Ii=["author","language","urihash","objecttype","collection","source","permanentid"],Ks=[...Ii,"date","filetype","parents"],Rf=[...Ks,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],Ef=()=>({fieldsToInclude:Ii,fetchAllFields:!1,fieldsDescription:[]});var ki=me(Ef(),e=>e.addCase(Ur,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(xi,t=>{t.fetchAllFields=!0}).addCase(Ri,t=>{t.fetchAllFields=!1}).addCase(Ei.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(wf,(t,{payload:r})=>{let n=xf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function Ib(e){return e.addReducers({fields:ki}),{registerFieldsToInclude:Ur,enableFetchAllFields:xi,disableFetchAllFields:Ri,fetchFieldsDescription:Ei}}d();c();l();u();function kb(e){return e.addReducers({pipeline:mr}),{setPipeline:pr}}d();c();l();u();function Pb(e){return e.addReducers({recommendation:Rr}),{getRecommendations:At,setRecommendationId:xr}}d();c();l();u();function Fb(e){return e.addReducers({}),{logRecommendationOpen:Vo}}d();c();l();u();d();c();l();u();var Ob=new Oe({content:new pe({required:!0}),conditions:new pe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new ie({required:!1,each:W})});function If(){let e=[],t=r=>{let n=Ob.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Wr("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function kf(e){if(!Tb(e))throw Ge;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=If();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Ur(i))},selectTemplate:r,selectLinkTemplate:n}}function Tb(e){return e.addReducers({fields:ki}),!0}d();c();l();u();function Db(e){return e.addReducers({searchHub:Ir}),{setSearchHub:Er}}/**
|
|
32
32
|
* @license
|
|
33
33
|
*
|
|
34
|
-
* Copyright
|
|
34
|
+
* Copyright 2026 Coveo Solutions Inc.
|
|
35
35
|
*
|
|
36
36
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
37
37
|
* you may not use this file except in compliance with the License.
|
|
@@ -46,4 +46,4 @@ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":I
|
|
|
46
46
|
* limitations under the License.
|
|
47
47
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
48
48
|
|
|
49
|
-
window.coveoQuanticVersion = '3.34.
|
|
49
|
+
window.coveoQuanticVersion = '3.34.1';
|