@coveo/quantic 3.30.0-pre.7fbcdbbb29 → 3.30.0-pre.8a67bd16aa

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.
Files changed (48) hide show
  1. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +8 -8
  2. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/build.d.ts +5 -3
  3. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +3 -0
  4. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/kind.d.ts +3 -0
  5. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/build.d.ts +7 -0
  6. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +9 -10
  7. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controller-utils.d.ts +7 -6
  8. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/breadcrumb-manager/headless-core-breadcrumb-manager.ssr.d.ts +3 -2
  9. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/cart/headless-cart.ssr.d.ts +1 -2
  10. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/context/headless-context.ssr.d.ts +2 -3
  11. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.d.ts +2 -1
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -2
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +3 -2
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -2
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +3 -2
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +3 -13
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-list/headless-product-list.ssr.d.ts +3 -2
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-view/headless-product-view.ssr.d.ts +1 -3
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -2
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recommendations/headless-recommendations.ssr.d.ts +4 -8
  21. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -2
  22. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/sort/headless-core-commerce-sort.ssr.d.ts +3 -2
  23. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -2
  24. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/summary/headless-core-summary.ssr.d.ts +3 -2
  25. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-notify-trigger.ssr.d.ts +1 -2
  26. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-query-trigger.ssr.d.ts +1 -2
  27. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-redirection-trigger.ssr.d.ts +1 -2
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/build-factory.d.ts +5 -3
  29. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/hydrated-state-factory.d.ts +5 -2
  30. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/recommendation-hydrated-state-factory.d.ts +3 -1
  31. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/recommendation-static-state-factory.d.ts +12 -2
  32. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/static-state-factory.d.ts +7 -2
  33. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/build.d.ts +2 -8
  34. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-definitions.d.ts +4 -53
  35. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-scopes.d.ts +0 -6
  36. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +6 -12
  37. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/utils/recommendation-filter.d.ts +1 -1
  38. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/builders/static-controller-builder.d.ts +1 -6
  39. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/errors.d.ts +0 -3
  40. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/types/utilities.d.ts +0 -1
  41. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/build.d.ts +2 -6
  42. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/engine.d.ts +1 -1
  43. package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-ssr-controller-definitions.d.ts +0 -3
  44. package/force-app/main/default/staticresources/coveoheadless/headless.js +11 -11
  45. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
  46. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
  47. package/package.json +2 -2
  48. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/kind.d.ts +0 -9
@@ -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("CoveoHeadlessCaseAssist",["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["CoveoHeadlessCaseAssist"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var dp=Object.create;var br=Object.defineProperty;var pp=Object.getOwnPropertyDescriptor;var fp=Object.getOwnPropertyNames;var gp=Object.getPrototypeOf,mp=Object.prototype.hasOwnProperty;var yp=(e,t,r)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var wr=(e,t)=>()=>(e&&(t=e(e=0)),t);var me=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hp=(e,t)=>{for(var r in t)br(e,r,{get:t[r],enumerable:!0})},ra=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fp(t))!mp.call(e,i)&&i!==r&&br(e,i,{get:()=>t[i],enumerable:!(n=pp(t,i))||n.enumerable});return e};var _e=(e,t,r)=>(r=e!=null?dp(gp(e)):{},ra(t||!e||!e.__esModule?br(r,"default",{value:e,enumerable:!0}):r,e)),Sp=e=>ra(br({},"__esModule",{value:!0}),e);var se=(e,t,r)=>yp(e,typeof t!="symbol"?t+"":t,r);var A,d=wr(()=>{"use strict";A=typeof globalThis<"u"?globalThis:window});function on(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?on=function(t){return typeof t}:on=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},on(e)}function Cp(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=bp.bind(this))}function bp(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",i="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");i.open("POST",e,!n),i.withCredentials=!0,i.setRequestHeader("Accept","*/*"),vp(t)?(i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),i.responseType="text"):Ap(t)&&t.type&&i.setRequestHeader("Content-Type",t.type);try{i.send(t)}catch{return!1}return!0}var vp,Ap,p=wr(()=>{"use strict";vp=function(t){return typeof t=="string"},Ap=function(t){return t instanceof Blob};Cp.call((typeof window>"u"?"undefined":on(window))==="object"?window:{})});var Ui=me(Rr=>{"use strict";g();d();f();p();Object.defineProperty(Rr,"__esModule",{value:!0});function na(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 wp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rp(e,t,r){return t=Ut(t),Ep(e,aa()?Reflect.construct(t,r||[],Ut(e).constructor):t.apply(e,r))}function Ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ia(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,Op(n.key),n)}}function _i(e,t,r){return t&&ia(e.prototype,t),r&&ia(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Fp(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(c){throw c},f:i}}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 o,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return s=c.done,c},e:function(c){u=!0,o=c},f:function(){try{s||r.return==null||r.return()}finally{if(u)throw o}}}}function ji(){return ji=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Ip(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},ji.apply(null,arguments)}function Ut(e){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ut(e)}function xp(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&&Mi(e,t)}function aa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aa=function(){return!!e})()}function Ep(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 wp(e)}function Mi(e,t){return Mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Mi(e,t)}function Ip(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ut(e))!==null;);return e}function kp(e,t,r,n){var i=ji(Ut(1&n?e.prototype:e),t,r);return 2&n&&typeof i=="function"?function(o){return i.apply(r,o)}:i}function Pp(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 Op(e){var t=Pp(e,"string");return typeof t=="symbol"?t:t+""}function Fp(e,t){if(e){if(typeof e=="string")return na(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)?na(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Tp(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 Dp(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 sa=function(){function e(){Ni(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return _i(e,[{key:"addEventListener",value:function(r,n,i){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:i})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var i=this.listeners[r],o=0,s=i.length;o<s;o++)if(i[o].callback===n){i.splice(o,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var i=this.listeners[r.type],o=i.slice(),s=function(){var y=o[u];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)},u=0,c=o.length;u<c;u++)s();return!r.defaultPrevented}}}])}(),Li=function(e){function t(){var r;return Ni(this,t),r=Rp(this,t),r.listeners||sa.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 xp(t,e),_i(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)),kp(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,i=this.reason,o=i===void 0?"Aborted":i;if(n)throw o}}],[{key:"timeout",value:function(n){var i=new sn;return setTimeout(function(){return i.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),i.signal}},{key:"any",value:function(n){var i=new sn;function o(){i.abort(this.reason),s()}function s(){var y=oa(n),h;try{for(y.s();!(h=y.n()).done;){var S=h.value;S.removeEventListener("abort",o)}}catch(m){y.e(m)}finally{y.f()}}var u=oa(n),c;try{for(u.s();!(c=u.n()).done;){var a=c.value;if(a.aborted){i.abort(a.reason);break}else a.addEventListener("abort",o)}}catch(y){u.e(y)}finally{u.f()}return i.signal}}])}(sa),sn=function(){function e(){Ni(this,e),Object.defineProperty(this,"signal",{value:new Li,writable:!0,configurable:!0})}return _i(e,[{key:"abort",value:function(r){var n=Dp(r),i=Tp(n);this.signal.reason=n,this.signal.dispatchEvent(i)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(sn.prototype[Symbol.toStringTag]="AbortController",Li.prototype[Symbol.toStringTag]="AbortSignal");function qp(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 jp(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,i=n===void 0?r.Request:n,o=t.AbortController,s=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,u=s===void 0?!1:s;if(!qp({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:u}))return{fetch:r,Request:c};var c=i;(c&&!c.prototype.hasOwnProperty("signal")||u)&&(c=function(S,m){var v;m&&m.signal&&(v=m.signal,delete m.signal);var R=new i(S,m);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},c.prototype=i.prototype);var a=r,y=function(S,m){var v=c&&c.prototype.isPrototypeOf(S)?S.signal:m?m.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 E=new Promise(function(b,P){v.addEventListener("abort",function(){return P(R)},{once:!0})});return m&&m.signal&&delete m.signal,Promise.race([E,a(S,m)])}return a(S,m)};return{fetch:y,Request:c}}Rr.AbortController=sn;Rr.AbortSignal=Li;Rr.abortableFetch=jp});var ca,l,C,f=wr(()=>{"use strict";ca=_e(Ui(),1),l=_e(Ui(),1),{fetch:C}=(0,ca.abortableFetch)({fetch})});function xr(e){if(Hp.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Vi(e){return e.replace(zp,"")}function Er(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||!Gp(r))return!1}return!0}function Gp(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function la(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 Mp,ma,Np,ya,_p,Lp,Up,Vp,Qp,Bp,$p,Hp,ua,zp,Vt,Qi,da,pa,fa,ga,x,Sa=wr(()=>{"use strict";g();d();f();p();Mp=Object.create,ma=Object.defineProperty,Np=Object.getOwnPropertyDescriptor,ya=Object.getOwnPropertyNames,_p=Object.getPrototypeOf,Lp=Object.prototype.hasOwnProperty,Up=(e,t)=>function(){return t||(0,e[ya(e)[0]])((t={exports:{}}).exports,t),t.exports},Vp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ya(t))!Lp.call(e,i)&&i!==r&&ma(e,i,{get:()=>t[i],enumerable:!(n=Np(t,i))||n.enumerable});return e},Qp=(e,t,r)=>(r=e!=null?Mp(_p(e)):{},Vp(t||!e||!e.__esModule?ma(r,"default",{value:e,enumerable:!0}):r,e)),Bp=Up({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(c){return typeof c=="string"&&!!c.trim()}function i(c,a){var y=c.split(";").filter(n),h=y.shift(),S=o(h),m=S.name,v=S.value;a=a?Object.assign({},r,a):r;try{v=a.decodeValues?decodeURIComponent(v):v}catch(E){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",E)}var R={name:m,value:v};return y.forEach(function(E){var b=E.split("="),P=b.shift().trimLeft().toLowerCase(),w=b.join("=");P==="expires"?R.expires=new Date(w):P==="max-age"?R.maxAge=parseInt(w,10):P==="secure"?R.secure=!0:P==="httponly"?R.httpOnly=!0:P==="samesite"?R.sameSite=w:R[P]=w}),R}function o(c){var a="",y="",h=c.split("=");return h.length>1?(a=h.shift(),y=h.join("=")):y=c,{name:a,value:y}}function s(c,a){if(a=a?Object.assign({},r,a):r,!c)return a.map?{}:[];if(c.headers)if(typeof c.headers.getSetCookie=="function")c=c.headers.getSetCookie();else if(c.headers["set-cookie"])c=c.headers["set-cookie"];else{var y=c.headers[Object.keys(c.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!y&&c.headers.cookie&&!a.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."),c=y}if(Array.isArray(c)||(c=[c]),a=a?Object.assign({},r,a):r,a.map){var h={};return c.filter(n).reduce(function(S,m){var v=i(m,a);return S[v.name]=v,S},h)}else return c.filter(n).map(function(S){return i(S,a)})}function u(c){if(Array.isArray(c))return c;if(typeof c!="string")return[];var a=[],y=0,h,S,m,v,R;function E(){for(;y<c.length&&/\s/.test(c.charAt(y));)y+=1;return y<c.length}function b(){return S=c.charAt(y),S!=="="&&S!==";"&&S!==","}for(;y<c.length;){for(h=y,R=!1;E();)if(S=c.charAt(y),S===","){for(m=y,y+=1,E(),v=y;y<c.length&&b();)y+=1;y<c.length&&c.charAt(y)==="="?(R=!0,y=v,a.push(c.substring(h,m)),h=y):y=m+1}else y+=1;(!R||y>=c.length)&&a.push(c.substring(h,c.length))}return a}t.exports=s,t.exports.parse=s,t.exports.parseString=i,t.exports.splitCookiesString=u}}),$p=Qp(Bp()),Hp=/[^a-z0-9\-#$%&'*+.^_`|~]/i;ua=[`
19
- `,"\r","\t"," "],zp=new RegExp(`(^[${ua.join("")}]|$[${ua.join("")}])`,"g");Vt=Symbol("normalizedHeaders"),Qi=Symbol("rawHeaderNames"),da=", ",x=class ha{constructor(t){this[pa]={},this[fa]=new Map,this[ga]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof ha||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,i)=>{this.append(i,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(da):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(da):n)})}[(pa=Vt,fa=Qi,ga=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[Vt]).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(!Er(t))throw new TypeError(`Invalid header name "${t}"`);return this[Vt].hasOwnProperty(xr(t))}get(t){if(!Er(t))throw TypeError(`Invalid header name "${t}"`);return this[Vt][xr(t)]??null}set(t,r){if(!Er(t)||!la(r))return;let n=xr(t),i=Vi(r);this[Vt][n]=Vi(i),this[Qi].set(n,t)}append(t,r){if(!Er(t)||!la(r))return;let n=xr(t),i=Vi(r),o=this.has(n)?`${this.get(n)}, ${i}`:i;this.set(t,o)}delete(t){if(!Er(t)||!this.has(t))return;let r=xr(t);delete this[Vt][r],this[Qi].delete(r)}forEach(t,r){for(let[n,i]of this.entries())t.call(r,i,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,$p.splitCookiesString)(t)}}});var g=wr(()=>{"use strict";Sa()});var va=me(Ir=>{"use strict";g();d();f();p();var an=Ir&&Ir.__assign||function(){return an=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},an.apply(this,arguments)};Object.defineProperty(Ir,"__esModule",{value:!0});var Wp={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Yp(e){var t=an(an({},Wp),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Ir.getSanitizedOptions=Yp});var Aa=me(Bi=>{"use strict";g();d();f();p();Object.defineProperty(Bi,"__esModule",{value:!0});function Kp(e){var t=Math.random()*e;return Math.round(t)}Bi.fullJitter=Kp});var Ca=me($i=>{"use strict";g();d();f();p();Object.defineProperty($i,"__esModule",{value:!0});function Jp(e){return e}$i.noJitter=Jp});var ba=me(Hi=>{"use strict";g();d();f();p();Object.defineProperty(Hi,"__esModule",{value:!0});var Xp=Aa(),Zp=Ca();function ef(e){switch(e.jitter){case"full":return Xp.fullJitter;case"none":default:return Zp.noJitter}}Hi.JitterFactory=ef});var Gi=me(zi=>{"use strict";g();d();f();p();Object.defineProperty(zi,"__esModule",{value:!0});var tf=ba(),rf=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=tf.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,i=t*Math.pow(r,n);return Math.min(i,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();zi.Delay=rf});var wa=me(Xe=>{"use strict";g();d();f();p();var nf=Xe&&Xe.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},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)}}(),of=Xe&&Xe.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(y){try{a(n.next(y))}catch(h){s(h)}}function c(y){try{a(n.throw(y))}catch(h){s(h)}}function a(y){y.done?o(y.value):i(y.value).then(u,c)}a((n=n.apply(e,t||[])).next())})},sf=Xe&&Xe.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(y){return c([a,y])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(y){a=[6,y],i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Xe,"__esModule",{value:!0});var af=Gi(),cf=function(e){nf(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return of(this,void 0,void 0,function(){return sf(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}(af.Delay);Xe.SkipFirstDelay=cf});var Ra=me(kr=>{"use strict";g();d();f();p();var uf=kr&&kr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},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(kr,"__esModule",{value:!0});var lf=Gi(),df=function(e){uf(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(lf.Delay);kr.AlwaysDelay=df});var xa=me(Wi=>{"use strict";g();d();f();p();Object.defineProperty(Wi,"__esModule",{value:!0});var pf=wa(),ff=Ra();function gf(e,t){var r=mf(e);return r.setAttemptNumber(t),r}Wi.DelayFactory=gf;function mf(e){return e.delayFirstAttempt?new ff.AlwaysDelay(e):new pf.SkipFirstDelay(e)}});var Ea=me(wt=>{"use strict";g();d();f();p();var Yi=wt&&wt.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(y){try{a(n.next(y))}catch(h){s(h)}}function c(y){try{a(n.throw(y))}catch(h){s(h)}}function a(y){y.done?o(y.value):i(y.value).then(u,c)}a((n=n.apply(e,t||[])).next())})},Ki=wt&&wt.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(y){return c([a,y])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(y){a=[6,y],i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(wt,"__esModule",{value:!0});var yf=va(),hf=xa();function Sf(e,t){return t===void 0&&(t={}),Yi(this,void 0,void 0,function(){var r,n;return Ki(this,function(i){switch(i.label){case 0:return r=yf.getSanitizedOptions(t),n=new vf(e,r),[4,n.execute()];case 1:return[2,i.sent()]}})})}wt.backOff=Sf;var vf=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Yi(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 Yi(this,void 0,void 0,function(){var t;return Ki(this,function(r){switch(r.label){case 0:return t=hf.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var ci=me((ds,ps)=>{"use strict";g();d();f();p();(function(e,t){typeof ds=="object"&&typeof ps<"u"?ps.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs=t()})(ds,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",o="minute",s="hour",u="day",c="week",a="month",y="quarter",h="year",S="date",m="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,E={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 _=["th","st","nd","rd"],N=U%100;return"["+U+(_[(N-20)%10]||_[N]||_[0])+"]"}},b=function(U,_,N){var V=String(U);return!V||V.length>=_?U:""+Array(_+1-V.length).join(N)+U},P={s:b,z:function(U){var _=-U.utcOffset(),N=Math.abs(_),V=Math.floor(N/60),L=N%60;return(_<=0?"+":"-")+b(V,2,"0")+":"+b(L,2,"0")},m:function U(_,N){if(_.date()<N.date())return-U(N,_);var V=12*(N.year()-_.year())+(N.month()-_.month()),L=_.clone().add(V,a),$=N-L<0,H=_.clone().add(V+($?-1:1),a);return+(-(V+(N-L)/($?L-H:H-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:a,y:h,w:c,d:u,D:S,h:s,m:o,s:i,ms:n,Q:y}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",I={};I[w]=E;var j="$isDayjsObject",F=function(U){return U instanceof M||!(!U||!U[j])},k=function U(_,N,V){var L;if(!_)return w;if(typeof _=="string"){var $=_.toLowerCase();I[$]&&(L=$),N&&(I[$]=N,L=$);var H=_.split("-");if(!L&&H.length>1)return U(H[0])}else{var G=_.name;I[G]=_,L=G}return!V&&L&&(w=L),L||!V&&w},O=function(U,_){if(F(U))return U.clone();var N=typeof _=="object"?_:{};return N.date=U,N.args=arguments,new M(N)},T=P;T.l=k,T.i=F,T.w=function(U,_){return O(U,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var M=function(){function U(N){this.$L=k(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[j]=!0}var _=U.prototype;return _.parse=function(N){this.$d=function(V){var L=V.date,$=V.utc;if(L===null)return new Date(NaN);if(T.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var H=L.match(v);if(H){var G=H[2]-1||0,X=(H[7]||"0").substring(0,3);return $?new Date(Date.UTC(H[1],G,H[3]||1,H[4]||0,H[5]||0,H[6]||0,X)):new Date(H[1],G,H[3]||1,H[4]||0,H[5]||0,H[6]||0,X)}}return new Date(L)}(N),this.init()},_.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()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==m},_.isSame=function(N,V){var L=O(N);return this.startOf(V)<=L&&L<=this.endOf(V)},_.isAfter=function(N,V){return O(N)<this.startOf(V)},_.isBefore=function(N,V){return this.endOf(V)<O(N)},_.$g=function(N,V,L){return T.u(N)?this[V]:this.set(L,N)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(N,V){var L=this,$=!!T.u(V)||V,H=T.p(N),G=function(ie,ue){var de=T.w(L.$u?Date.UTC(L.$y,ue,ie):new Date(L.$y,ue,ie),L);return $?de:de.endOf(u)},X=function(ie,ue){return T.w(L.toDate()[ie].apply(L.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(ue)),L)},ne=this.$W,J=this.$M,Z=this.$D,K="set"+(this.$u?"UTC":"");switch(H){case h:return $?G(1,0):G(31,11);case a:return $?G(1,J):G(0,J+1);case c:var te=this.$locale().weekStart||0,le=(ne<te?ne+7:ne)-te;return G($?Z-le:Z+(6-le),J);case u:case S:return X(K+"Hours",0);case s:return X(K+"Minutes",1);case o:return X(K+"Seconds",2);case i:return X(K+"Milliseconds",3);default:return this.clone()}},_.endOf=function(N){return this.startOf(N,!1)},_.$set=function(N,V){var L,$=T.p(N),H="set"+(this.$u?"UTC":""),G=(L={},L[u]=H+"Date",L[S]=H+"Date",L[a]=H+"Month",L[h]=H+"FullYear",L[s]=H+"Hours",L[o]=H+"Minutes",L[i]=H+"Seconds",L[n]=H+"Milliseconds",L)[$],X=$===u?this.$D+(V-this.$W):V;if($===a||$===h){var ne=this.clone().set(S,1);ne.$d[G](X),ne.init(),this.$d=ne.set(S,Math.min(this.$D,ne.daysInMonth())).$d}else G&&this.$d[G](X);return this.init(),this},_.set=function(N,V){return this.clone().$set(N,V)},_.get=function(N){return this[T.p(N)]()},_.add=function(N,V){var L,$=this;N=Number(N);var H=T.p(V),G=function(J){var Z=O($);return T.w(Z.date(Z.date()+Math.round(J*N)),$)};if(H===a)return this.set(a,this.$M+N);if(H===h)return this.set(h,this.$y+N);if(H===u)return G(1);if(H===c)return G(7);var X=(L={},L[o]=t,L[s]=r,L[i]=e,L)[H]||1,ne=this.$d.getTime()+N*X;return T.w(ne,this)},_.subtract=function(N,V){return this.add(-1*N,V)},_.format=function(N){var V=this,L=this.$locale();if(!this.isValid())return L.invalidDate||m;var $=N||"YYYY-MM-DDTHH:mm:ssZ",H=T.z(this),G=this.$H,X=this.$m,ne=this.$M,J=L.weekdays,Z=L.months,K=L.meridiem,te=function(ue,de,we,De){return ue&&(ue[de]||ue(V,$))||we[de].slice(0,De)},le=function(ue){return T.s(G%12||12,ue,"0")},ie=K||function(ue,de,we){var De=ue<12?"AM":"PM";return we?De.toLowerCase():De};return $.replace(R,function(ue,de){return de||function(we){switch(we){case"YY":return String(V.$y).slice(-2);case"YYYY":return T.s(V.$y,4,"0");case"M":return ne+1;case"MM":return T.s(ne+1,2,"0");case"MMM":return te(L.monthsShort,ne,Z,3);case"MMMM":return te(Z,ne);case"D":return V.$D;case"DD":return T.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return te(L.weekdaysMin,V.$W,J,2);case"ddd":return te(L.weekdaysShort,V.$W,J,3);case"dddd":return J[V.$W];case"H":return String(G);case"HH":return T.s(G,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return ie(G,X,!0);case"A":return ie(G,X,!1);case"m":return String(X);case"mm":return T.s(X,2,"0");case"s":return String(V.$s);case"ss":return T.s(V.$s,2,"0");case"SSS":return T.s(V.$ms,3,"0");case"Z":return H}return null}(ue)||H.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(N,V,L){var $,H=this,G=T.p(V),X=O(N),ne=(X.utcOffset()-this.utcOffset())*t,J=this-X,Z=function(){return T.m(H,X)};switch(G){case h:$=Z()/12;break;case a:$=Z();break;case y:$=Z()/3;break;case c:$=(J-ne)/6048e5;break;case u:$=(J-ne)/864e5;break;case s:$=J/r;break;case o:$=J/t;break;case i:$=J/e;break;default:$=J}return L?$:T.a($)},_.daysInMonth=function(){return this.endOf(a).$D},_.$locale=function(){return I[this.$L]},_.locale=function(N,V){if(!N)return this.$L;var L=this.clone(),$=k(N,V,!0);return $&&(L.$L=$),L},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},U}(),B=M.prototype;return O.prototype=B,[["$ms",n],["$s",i],["$m",o],["$H",s],["$W",u],["$M",a],["$y",h],["$D",S]].forEach(function(U){B[U[1]]=function(_){return this.$g(_,U[0],U[1])}}),O.extend=function(U,_){return U.$i||(U(_,M,O),U.$i=!0),O},O.locale=k,O.isDayjs=F,O.unix=function(U){return O(1e3*U)},O.en=I[w],O.Ls=I,O.p={},O})});var Bu=me((fs,gs)=>{"use strict";g();d();f();p();(function(e,t){typeof fs=="object"&&typeof gs<"u"?gs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_quarterOfYear=t()})(fs,function(){"use strict";var e="month",t="quarter";return function(r,n){var i=n.prototype;i.quarter=function(u){return this.$utils().u(u)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(u-1))};var o=i.add;i.add=function(u,c){return u=Number(u),this.$utils().p(c)===t?this.add(3*u,e):o.bind(this)(u,c)};var s=i.startOf;i.startOf=function(u,c){var a=this.$utils(),y=!!a.u(c)||c;if(a.p(u)===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 s.bind(this)(u,c)}}})});var $u=me((ms,ys)=>{"use strict";g();d();f();p();(function(e,t){typeof ms=="object"&&typeof ys<"u"?ys.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_customParseFormat=t()})(ms,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/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},u=function(v){return(v=+v)+(v>68?1900:2e3)},c=function(v){return function(R){this[v]=+R}},a=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var E=R.match(/([+-]|\d\d)/g),b=60*E[1]+(+E[2]||0);return b===0?0:E[0]==="+"?-b:b}(v)}],y=function(v){var R=s[v];return R&&(R.indexOf?R:R.s.concat(R.f))},h=function(v,R){var E,b=s.meridiem;if(b){for(var P=1;P<=24;P+=1)if(v.indexOf(b(P,0,R))>-1){E=P>12;break}}else E=v===(R?"pm":"PM");return E},S={A:[o,function(v){this.afternoon=h(v,!1)}],a:[o,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:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[n,c("day")],Do:[o,function(v){var R=s.ordinal,E=v.match(/\d+/);if(this.day=E[0],R)for(var b=1;b<=31;b+=1)R(b).replace(/\[|\]/g,"")===v&&(this.day=b)}],w:[i,c("week")],ww:[n,c("week")],M:[i,c("month")],MM:[n,c("month")],MMM:[o,function(v){var R=y("months"),E=(y("monthsShort")||R.map(function(b){return b.slice(0,3)})).indexOf(v)+1;if(E<1)throw new Error;this.month=E%12||E}],MMMM:[o,function(v){var R=y("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(v){this.year=u(v)}],YYYY:[/\d{4}/,c("year")],Z:a,ZZ:a};function m(v){var R,E;R=v,E=s&&s.formats;for(var b=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(O,T,M){var B=M&&M.toUpperCase();return T||E[M]||e[M]||E[B].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,_,N){return _||N.slice(1)})})).match(t),P=b.length,w=0;w<P;w+=1){var I=b[w],j=S[I],F=j&&j[0],k=j&&j[1];b[w]=k?{regex:F,parser:k}:I.replace(/^\[|\]$/g,"")}return function(O){for(var T={},M=0,B=0;M<P;M+=1){var U=b[M];if(typeof U=="string")B+=U.length;else{var _=U.regex,N=U.parser,V=O.slice(B),L=_.exec(V)[0];N.call(T,L),O=O.replace(L,"")}}return function($){var H=$.afternoon;if(H!==void 0){var G=$.hours;H?G<12&&($.hours+=12):G===12&&($.hours=0),delete $.afternoon}}(T),T}}return function(v,R,E){E.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(u=v.parseTwoDigitYear);var b=R.prototype,P=b.parse;b.parse=function(w){var I=w.date,j=w.utc,F=w.args;this.$u=j;var k=F[1];if(typeof k=="string"){var O=F[2]===!0,T=F[3]===!0,M=O||T,B=F[2];T&&(B=F[2]),s=this.$locale(),!O&&B&&(s=E.Ls[B]),this.$d=function(V,L,$,H){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*V);var G=m(L)(V),X=G.year,ne=G.month,J=G.day,Z=G.hours,K=G.minutes,te=G.seconds,le=G.milliseconds,ie=G.zone,ue=G.week,de=new Date,we=J||(X||ne?1:de.getDate()),De=X||de.getFullYear(),at=0;X&&!ne||(at=ne>0?ne-1:de.getMonth());var _t,Lt=Z||0,Cr=K||0,Di=te||0,qi=le||0;return ie?new Date(Date.UTC(De,at,we,Lt,Cr,Di,qi+60*ie.offset*1e3)):$?new Date(Date.UTC(De,at,we,Lt,Cr,Di,qi)):(_t=new Date(De,at,we,Lt,Cr,Di,qi),ue&&(_t=H(_t).week(ue).toDate()),_t)}catch{return new Date("")}}(I,k,j,E),this.init(),B&&B!==!0&&(this.$L=this.locale(B).$L),M&&I!=this.format(k)&&(this.$d=new Date("")),s={}}else if(k instanceof Array)for(var U=k.length,_=1;_<=U;_+=1){F[1]=k[_-1];var N=E.apply(this,F);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}_===U&&(this.$d=new Date(""))}else P.call(this,w)}}})});var Ul=me((Ds,qs)=>{"use strict";g();d();f();p();(function(e,t){typeof Ds=="object"&&typeof qs<"u"?qs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_timezone=t()})(Ds,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var o,s=function(y,h,S){S===void 0&&(S={});var m=new Date(y),v=function(R,E){E===void 0&&(E={});var b=E.timeZoneName||"short",P=R+"|"+b,w=t[P];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:b}),t[P]=w),w}(h,S);return v.formatToParts(m)},u=function(y,h){for(var S=s(y,h),m=[],v=0;v<S.length;v+=1){var R=S[v],E=R.type,b=R.value,P=e[E];P>=0&&(m[P]=parseInt(b,10))}var w=m[3],I=w===24?0:w,j=m[0]+"-"+m[1]+"-"+m[2]+" "+I+":"+m[4]+":"+m[5]+":000",F=+y;return(i.utc(j).valueOf()-(F-=F%1e3))/6e4},c=n.prototype;c.tz=function(y,h){y===void 0&&(y=o);var S,m=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:y}),E=Math.round((v-new Date(R))/1e3/60),b=15*-Math.round(v.getTimezoneOffset()/15)-E;if(!Number(b))S=this.utcOffset(0,h);else if(S=i(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),h){var P=S.utcOffset();S=S.add(m-P,"minute")}return S.$x.$timezone=y,S},c.offsetName=function(y){var h=this.$x.$timezone||i.tz.guess(),S=s(this.valueOf(),h,{timeZoneName:y}).find(function(m){return m.type.toLowerCase()==="timezonename"});return S&&S.value};var a=c.startOf;c.startOf=function(y,h){if(!this.$x||!this.$x.$timezone)return a.call(this,y,h);var S=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return a.call(S,y,h).tz(this.$x.$timezone,!0)},i.tz=function(y,h,S){var m=S&&h,v=S||h||o,R=u(+i(),v);if(typeof y!="string")return i(y).tz(v);var E=function(I,j,F){var k=I-60*j*1e3,O=u(k,F);if(j===O)return[k,j];var T=u(k-=60*(O-j)*1e3,F);return O===T?[k,O]:[I-60*Math.min(O,T)*1e3,Math.max(O,T)]}(i.utc(y,m).valueOf(),R,v),b=E[0],P=E[1],w=i(b).utcOffset(P);return w.$x.$timezone=v,w},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(y){o=y}}})});var Vl=me((js,Ms)=>{"use strict";g();d();f();p();(function(e,t){typeof js=="object"&&typeof Ms<"u"?Ms.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_utc=t()})(js,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var s=i.prototype;o.utc=function(m){var v={date:m,utc:!0,args:arguments};return new i(v)},s.utc=function(m){var v=o(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),e):v},s.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var u=s.parse;s.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var c=s.init;s.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else c.call(this)};var a=s.utcOffset;s.utcOffset=function(m,v){var R=this.$utils().u;if(R(m))return this.$u?0:R(this.$offset)?a.call(this):this.$offset;if(typeof m=="string"&&(m=function(w){w===void 0&&(w="");var I=w.match(t);if(!I)return null;var j=(""+I[0]).match(r)||["-",0,0],F=j[0],k=60*+j[1]+ +j[2];return k===0?0:F==="+"?k:-k}(m),m===null))return this;var E=Math.abs(m)<=16?60*m:m,b=this;if(v)return b.$offset=E,b.$u=m===0,b;if(m!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(E+P,e)).$offset=E,b.$x.$localOffset=P}else b=this.utc();return b};var y=s.format;s.format=function(m){var v=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,v)},s.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var h=s.toDate;s.toDate=function(m){return m==="s"&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var S=s.diff;s.diff=function(m,v,R){if(m&&this.$u===m.$u)return S.call(this,m,v,R);var E=this.local(),b=o(m).local();return S.call(E,b,v,R)}}})});var nd=me((QM,rd)=>{"use strict";g();d();f();p();function HS(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}rd.exports=zS;function zS(e,t,r){var n=r&&r.stringify||HS,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var s=new Array(o);s[0]=n(e);for(var u=1;u<o;u++)s[u]=n(t[u]);return s.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var a="",y=1-i,h=-1,S=e&&e.length||0,m=0;m<S;){if(e.charCodeAt(m)===37&&m+1<S){switch(h=h>-1?h:0,e.charCodeAt(m+1)){case 100:case 102:if(y>=c||t[y]==null)break;h<m&&(a+=e.slice(h,m)),a+=Number(t[y]),h=m+2,m++;break;case 105:if(y>=c||t[y]==null)break;h<m&&(a+=e.slice(h,m)),a+=Math.floor(Number(t[y])),h=m+2,m++;break;case 79:case 111:case 106:if(y>=c||t[y]===void 0)break;h<m&&(a+=e.slice(h,m));var v=typeof t[y];if(v==="string"){a+="'"+t[y]+"'",h=m+2,m++;break}if(v==="function"){a+=t[y].name||"<anonymous>",h=m+2,m++;break}a+=n(t[y]),h=m+2,m++;break;case 115:if(y>=c)break;h<m&&(a+=e.slice(h,m)),a+=String(t[y]),h=m+2,m++;break;case 37:h<m&&(a+=e.slice(h,m)),a+="%",h=m+2,m++,y--;break}++y}++m}return h===-1?e:(h<S&&(a+=e.slice(h)),a)}});var ud=me((GM,yi)=>{"use strict";g();d();f();p();var id=nd();yi.exports=ot;var rn=av().console||{},GS={mapHttpRequest:mi,mapHttpResponse:mi,wrapRequestSerializer:_s,wrapResponseSerializer:_s,wrapErrorSerializer:_s,req:mi,res:mi,err:sd,errWithCause:sd};function mt(e,t){return e==="silent"?1/0:t.levels.values[e]}var Vs=Symbol("pino.logFuncs"),Ls=Symbol("pino.hierarchy"),WS={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function od(e,t){let r={logger:t,parent:e[Ls]};t[Ls]=r}function YS(e,t,r){let n={};t.forEach(i=>{n[i]=r[i]?r[i]:rn[i]||rn[WS[i]||"log"]||gr}),e[Vs]=n}function KS(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ot(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||rn;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},i=KS(e.browser.serialize,n),o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);let s=Object.keys(e.customLevels||{}),u=["error","fatal","warn","info","debug","trace"].concat(s);typeof r=="function"&&u.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",a=Object.create(r);a.log||(a.log=gr),YS(a,u,r),od({},a),Object.defineProperty(a,"levelVal",{get:h}),Object.defineProperty(a,"level",{get:S,set:m});let y={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:u,timestamp:iv(e),messageKey:e.messageKey||"msg",onChild:e.onChild||gr};a.levels=JS(e),a.level=c,a.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},a.setMaxListeners=a.getMaxListeners=a.emit=a.addListener=a.on=a.prependListener=a.once=a.prependOnceListener=a.removeListener=a.removeAllListeners=a.listeners=a.listenerCount=a.eventNames=a.write=a.flush=gr,a.serializers=n,a._serialize=i,a._stdErrSerialize=o,a.child=function(...R){return v.call(this,y,...R)},t&&(a._logEvent=Us());function h(){return mt(this.level,this)}function S(){return this._level}function m(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Mt(this,y,a,"error"),Mt(this,y,a,"fatal"),Mt(this,y,a,"warn"),Mt(this,y,a,"info"),Mt(this,y,a,"debug"),Mt(this,y,a,"trace"),s.forEach(E=>{Mt(this,y,a,E)})}function v(R,E,b){if(!E)throw new Error("missing bindings for child Pino");b=b||{},i&&E.serializers&&(b.serializers=E.serializers);let P=b.serializers;if(i&&P){var w=Object.assign({},n,P),I=e.browser.serialize===!0?Object.keys(w):i;delete E.serializers,Qs([E],I,w,this._stdErrSerialize)}function j(k){this._childLevel=(k._childLevel|0)+1,this.bindings=E,w&&(this.serializers=w,this._serialize=I),t&&(this._logEvent=Us([].concat(k._logEvent.bindings,E)))}j.prototype=this;let F=new j(this);return od(this,F),F.child=function(...k){return v.call(this,R,...k)},F.level=b.level||this.level,R.onChild(F),F}return a}function JS(e){let t=e.customLevels||{},r=Object.assign({},ot.levels.values,t),n=Object.assign({},ot.levels.labels,XS(t));return{values:r,labels:n}}function XS(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}ot.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"}};ot.stdSerializers=GS;ot.stdTimeFunctions=Object.assign({},{nullTime:ad,epochTime:cd,unixTime:ov,isoTime:sv});function ZS(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Ls];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Mt(e,t,r,n){if(Object.defineProperty(e,n,{value:mt(e.level,r)>mt(n,r)?gr:r[Vs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===gr){if(!t.transmit)return;let o=t.transmit.level||e.level,s=mt(o,r);if(mt(n,r)<s)return}e[n]=tv(e,t,r,n);let i=ZS(e);i.length!==0&&(e[n]=ev(i,e[n]))}function ev(e,t){return function(){return t.apply(this,[...e,...arguments])}}function tv(e,t,r,n){return function(i){return function(){let s=t.timestamp(),u=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===rn?rn:this;for(var a=0;a<u.length;a++)u[a]=arguments[a];var y=!1;if(t.serialize&&(Qs(u,this._serialize,this.serializers,this._stdErrSerialize),y=!0),t.asObject||t.formatters?i.call(c,...rv(this,n,u,s,t)):i.apply(c,u),t.transmit){let h=t.transmit.level||e._level,S=mt(h,r),m=mt(n,r);if(m<S)return;nv(this,{ts:s,methodLevel:n,methodValue:m,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:mt(e._level,r)},u,y)}}}(e[Vs][n])}function rv(e,t,r,n,i){let{level:o,log:s=h=>h}=i.formatters||{},u=r.slice(),c=u[0],a={},y=(e._childLevel|0)+1;if(y<1&&(y=1),n&&(a.time=n),o){let h=o(t,e.levels.values[t]);Object.assign(a,h)}else a.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;y--&&typeof u[0]=="object";)Object.assign(a,u.shift());return[s(a),...u]}else{if(c!==null&&typeof c=="object"){for(;y--&&typeof u[0]=="object";)Object.assign(a,u.shift());c=u.length?id(u.shift(),u):void 0}else typeof c=="string"&&(c=id(u.shift(),u));return c!==void 0&&(a[i.messageKey]=c),[s(a)]}}function Qs(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=ot.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i])&&t)for(let o in e[i])t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function nv(e,t,r,n=!1){let i=t.send,o=t.ts,s=t.methodLevel,u=t.methodValue,c=t.val,a=e._logEvent.bindings;n||Qs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=r.filter(function(y){return a.indexOf(y)===-1}),e._logEvent.level.label=s,e._logEvent.level.value=u,i(s,e._logEvent,c),e._logEvent=Us(a)}function Us(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function sd(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 iv(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?ad:cd}function mi(){return{}}function _s(e){return e}function gr(){}function ad(){return!1}function cd(){return Date.now()}function ov(){return Math.round(Date.now()/1e3)}function sv(){return new Date(Date.now()).toISOString()}function av(){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=ot;yi.exports.pino=ot});var Jv={};hp(Jv,{ResultTemplatesHelpers:()=>rl,buildCaseAssistEngine:()=>md,buildCaseField:()=>Od,buildCaseInput:()=>Fd,buildController:()=>Ke,buildDocumentSuggestion:()=>$s,buildDocumentSuggestionList:()=>$s,buildInteractiveResult:()=>Dd,buildQuickview:()=>ap,getAnalyticsNextApiBaseUrl:()=>cn,getOrganizationEndpoint:()=>pe,loadCaseAssistAnalyticsActions:()=>Gv,loadCaseFieldActions:()=>Wv,loadCaseInputActions:()=>Yv,loadDocumentSuggestionActions:()=>Kv,loadGenericAnalyticsActions:()=>zv});module.exports=Sp(Jv);g();d();f();p();g();d();f();p();var qa=_e(Ea(),1);g();d();f();p();var qe=new Error("Failed to load reducers."),Qt=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."}},Rt=class extends Error{constructor(r,n){super();se(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};g();d();f();p();function Ia(e){return Array.isArray(e)}function ka(e,t){return[...e.reduce((r,n)=>{let i=t(n);return r.has(i)||r.set(i,n),r},new Map).values()]}var Af=new Set(["1",1,"yes",!0]);function Pa(){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=>Af.has(r))}function Oa(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Pr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}g();d();f();p();function Fa(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}function Ta(e){return typeof e!="object"||!e?!1:Object.values(e).every(Cf)}function Cf(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Da(e){return e===429}var ct=class e{static call(t){return _asyncToGenerator(function*(){let r=bf(t),{logger:n}=t,i=yield e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:o,...s}=i,u=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield C(o,s);if(Da(c.status))throw c;return c});return function u(){return _ref.apply(this,arguments)}}();try{let c=yield(0,qa.backOff)(u,{retry:a=>{let y=a&&Da(a.status);return y&&n.info("Platform retrying request"),y}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Qt;case 404:throw new Rt(o,c.status);default:return n.info({response:c,requestInfo:i},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Rt(o):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:i,logger:o,requestMetadata:s}=r,{signal:u,...c}=t,a=Pr(c);try{let y=yield i(t,n,s);return{...t,...y}}catch(y){o.error(y,"Platform request preprocessing failed. Returning default request options.")}return a})()}};function pe(e,t="prod",r="platform"){let n=t==="prod"?"":t,i=r==="platform"?"":`.${r}`;return`https://${e}${i}.org${n}.coveo.com`}function Bt(e,t="prod"){return`${pe(e,t)}/rest/search/v2`}function cn(e,t="prod"){return`${pe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function bf(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:o,signal:s}=e,u=e.method==="POST"||e.method==="PUT",c=wf(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${o}`,...e.headers},...(u&&{body:c}),signal:s}}function wf(e,t){return t==="application/x-www-form-urlencoded"?Ta(e)?Fa(e):"":JSON.stringify(e)}g();d();f();p();g();d();f();p();function Rf(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("CoveoHeadlessCaseAssist",["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["CoveoHeadlessCaseAssist"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var pp=Object.create;var br=Object.defineProperty;var fp=Object.getOwnPropertyDescriptor;var gp=Object.getOwnPropertyNames;var mp=Object.getPrototypeOf,hp=Object.prototype.hasOwnProperty;var yp=(e,t,r)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var wr=(e,t)=>()=>(e&&(t=e(e=0)),t);var me=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sp=(e,t)=>{for(var r in t)br(e,r,{get:t[r],enumerable:!0})},na=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gp(t))!hp.call(e,i)&&i!==r&&br(e,i,{get:()=>t[i],enumerable:!(n=fp(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?pp(mp(e)):{},na(t||!e||!e.__esModule?br(r,"default",{value:e,enumerable:!0}):r,e)),vp=e=>na(br({},"__esModule",{value:!0}),e);var se=(e,t,r)=>yp(e,typeof t!="symbol"?t+"":t,r);var A,d=wr(()=>{"use strict";A=typeof globalThis<"u"?globalThis:window});function on(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?on=function(t){return typeof t}:on=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},on(e)}function bp(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=wp.bind(this))}function wp(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",i="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");i.open("POST",e,!n),i.withCredentials=!0,i.setRequestHeader("Accept","*/*"),Ap(t)?(i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),i.responseType="text"):Cp(t)&&t.type&&i.setRequestHeader("Content-Type",t.type);try{i.send(t)}catch{return!1}return!0}var Ap,Cp,p=wr(()=>{"use strict";Ap=function(t){return typeof t=="string"},Cp=function(t){return t instanceof Blob};bp.call((typeof window>"u"?"undefined":on(window))==="object"?window:{})});var Vi=me(Rr=>{"use strict";g();d();f();p();Object.defineProperty(Rr,"__esModule",{value:!0});function ia(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 Rp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xp(e,t,r){return t=Lt(t),Ip(e,ca()?Reflect.construct(t,r||[],Lt(e).constructor):t.apply(e,r))}function _i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oa(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,Fp(n.key),n)}}function Li(e,t,r){return t&&oa(e.prototype,t),r&&oa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Tp(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(c){throw c},f:i}}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 o,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return s=c.done,c},e:function(c){u=!0,o=c},f:function(){try{s||r.return==null||r.return()}finally{if(u)throw o}}}}function Mi(){return Mi=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=kp(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Mi.apply(null,arguments)}function Lt(e){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(e)}function Ep(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&&Ni(e,t)}function ca(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ca=function(){return!!e})()}function Ip(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 Rp(e)}function Ni(e,t){return Ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ni(e,t)}function kp(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Lt(e))!==null;);return e}function Pp(e,t,r,n){var i=Mi(Lt(1&n?e.prototype:e),t,r);return 2&n&&typeof i=="function"?function(o){return i.apply(r,o)}:i}function Op(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 Fp(e){var t=Op(e,"string");return typeof t=="symbol"?t:t+""}function Tp(e,t){if(e){if(typeof e=="string")return ia(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)?ia(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Dp(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 qp(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 aa=function(){function e(){_i(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Li(e,[{key:"addEventListener",value:function(r,n,i){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:i})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var i=this.listeners[r],o=0,s=i.length;o<s;o++)if(i[o].callback===n){i.splice(o,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var i=this.listeners[r.type],o=i.slice(),s=function(){var h=o[u];try{h.callback.call(n,r)}catch(y){Promise.resolve().then(function(){throw y})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},u=0,c=o.length;u<c;u++)s();return!r.defaultPrevented}}}])}(),Ui=function(e){function t(){var r;return _i(this,t),r=xp(this,t),r.listeners||aa.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 Ep(t,e),Li(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)),Pp(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,i=this.reason,o=i===void 0?"Aborted":i;if(n)throw o}}],[{key:"timeout",value:function(n){var i=new sn;return setTimeout(function(){return i.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),i.signal}},{key:"any",value:function(n){var i=new sn;function o(){i.abort(this.reason),s()}function s(){var h=sa(n),y;try{for(h.s();!(y=h.n()).done;){var S=y.value;S.removeEventListener("abort",o)}}catch(m){h.e(m)}finally{h.f()}}var u=sa(n),c;try{for(u.s();!(c=u.n()).done;){var a=c.value;if(a.aborted){i.abort(a.reason);break}else a.addEventListener("abort",o)}}catch(h){u.e(h)}finally{u.f()}return i.signal}}])}(aa),sn=function(){function e(){_i(this,e),Object.defineProperty(this,"signal",{value:new Ui,writable:!0,configurable:!0})}return Li(e,[{key:"abort",value:function(r){var n=qp(r),i=Dp(n);this.signal.reason=n,this.signal.dispatchEvent(i)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(sn.prototype[Symbol.toStringTag]="AbortController",Ui.prototype[Symbol.toStringTag]="AbortSignal");function jp(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 Mp(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,i=n===void 0?r.Request:n,o=t.AbortController,s=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,u=s===void 0?!1:s;if(!jp({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:u}))return{fetch:r,Request:c};var c=i;(c&&!c.prototype.hasOwnProperty("signal")||u)&&(c=function(S,m){var v;m&&m.signal&&(v=m.signal,delete m.signal);var R=new i(S,m);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},c.prototype=i.prototype);var a=r,h=function(S,m){var v=c&&c.prototype.isPrototypeOf(S)?S.signal:m?m.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 E=new Promise(function(b,P){v.addEventListener("abort",function(){return P(R)},{once:!0})});return m&&m.signal&&delete m.signal,Promise.race([E,a(S,m)])}return a(S,m)};return{fetch:h,Request:c}}Rr.AbortController=sn;Rr.AbortSignal=Ui;Rr.abortableFetch=Mp});var ua,l,C,f=wr(()=>{"use strict";ua=Ne(Vi(),1),l=Ne(Vi(),1),{fetch:C}=(0,ua.abortableFetch)({fetch})});function xr(e){if(zp.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Qi(e){return e.replace(Gp,"")}function Er(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||!Wp(r))return!1}return!0}function Wp(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function da(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 Np,ha,_p,ya,Lp,Up,Vp,Qp,Bp,$p,Hp,zp,la,Gp,Ut,Bi,pa,fa,ga,ma,x,va=wr(()=>{"use strict";g();d();f();p();Np=Object.create,ha=Object.defineProperty,_p=Object.getOwnPropertyDescriptor,ya=Object.getOwnPropertyNames,Lp=Object.getPrototypeOf,Up=Object.prototype.hasOwnProperty,Vp=(e,t)=>function(){return t||(0,e[ya(e)[0]])((t={exports:{}}).exports,t),t.exports},Qp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ya(t))!Up.call(e,i)&&i!==r&&ha(e,i,{get:()=>t[i],enumerable:!(n=_p(t,i))||n.enumerable});return e},Bp=(e,t,r)=>(r=e!=null?Np(Lp(e)):{},Qp(t||!e||!e.__esModule?ha(r,"default",{value:e,enumerable:!0}):r,e)),$p=Vp({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(c){return typeof c=="string"&&!!c.trim()}function i(c,a){var h=c.split(";").filter(n),y=h.shift(),S=o(y),m=S.name,v=S.value;a=a?Object.assign({},r,a):r;try{v=a.decodeValues?decodeURIComponent(v):v}catch(E){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",E)}var R={name:m,value:v};return h.forEach(function(E){var b=E.split("="),P=b.shift().trimLeft().toLowerCase(),w=b.join("=");P==="expires"?R.expires=new Date(w):P==="max-age"?R.maxAge=parseInt(w,10):P==="secure"?R.secure=!0:P==="httponly"?R.httpOnly=!0:P==="samesite"?R.sameSite=w:R[P]=w}),R}function o(c){var a="",h="",y=c.split("=");return y.length>1?(a=y.shift(),h=y.join("=")):h=c,{name:a,value:h}}function s(c,a){if(a=a?Object.assign({},r,a):r,!c)return a.map?{}:[];if(c.headers)if(typeof c.headers.getSetCookie=="function")c=c.headers.getSetCookie();else if(c.headers["set-cookie"])c=c.headers["set-cookie"];else{var h=c.headers[Object.keys(c.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!h&&c.headers.cookie&&!a.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."),c=h}if(Array.isArray(c)||(c=[c]),a=a?Object.assign({},r,a):r,a.map){var y={};return c.filter(n).reduce(function(S,m){var v=i(m,a);return S[v.name]=v,S},y)}else return c.filter(n).map(function(S){return i(S,a)})}function u(c){if(Array.isArray(c))return c;if(typeof c!="string")return[];var a=[],h=0,y,S,m,v,R;function E(){for(;h<c.length&&/\s/.test(c.charAt(h));)h+=1;return h<c.length}function b(){return S=c.charAt(h),S!=="="&&S!==";"&&S!==","}for(;h<c.length;){for(y=h,R=!1;E();)if(S=c.charAt(h),S===","){for(m=h,h+=1,E(),v=h;h<c.length&&b();)h+=1;h<c.length&&c.charAt(h)==="="?(R=!0,h=v,a.push(c.substring(y,m)),y=h):h=m+1}else h+=1;(!R||h>=c.length)&&a.push(c.substring(y,c.length))}return a}t.exports=s,t.exports.parse=s,t.exports.parseString=i,t.exports.splitCookiesString=u}}),Hp=Bp($p()),zp=/[^a-z0-9\-#$%&'*+.^_`|~]/i;la=[`
19
+ `,"\r","\t"," "],Gp=new RegExp(`(^[${la.join("")}]|$[${la.join("")}])`,"g");Ut=Symbol("normalizedHeaders"),Bi=Symbol("rawHeaderNames"),pa=", ",x=class Sa{constructor(t){this[fa]={},this[ga]=new Map,this[ma]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof Sa||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,i)=>{this.append(i,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(pa):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(pa):n)})}[(fa=Ut,ga=Bi,ma=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[Ut]).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(!Er(t))throw new TypeError(`Invalid header name "${t}"`);return this[Ut].hasOwnProperty(xr(t))}get(t){if(!Er(t))throw TypeError(`Invalid header name "${t}"`);return this[Ut][xr(t)]??null}set(t,r){if(!Er(t)||!da(r))return;let n=xr(t),i=Qi(r);this[Ut][n]=Qi(i),this[Bi].set(n,t)}append(t,r){if(!Er(t)||!da(r))return;let n=xr(t),i=Qi(r),o=this.has(n)?`${this.get(n)}, ${i}`:i;this.set(t,o)}delete(t){if(!Er(t)||!this.has(t))return;let r=xr(t);delete this[Ut][r],this[Bi].delete(r)}forEach(t,r){for(let[n,i]of this.entries())t.call(r,i,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,Hp.splitCookiesString)(t)}}});var g=wr(()=>{"use strict";va()});var Aa=me(Ir=>{"use strict";g();d();f();p();var an=Ir&&Ir.__assign||function(){return an=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},an.apply(this,arguments)};Object.defineProperty(Ir,"__esModule",{value:!0});var Yp={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Kp(e){var t=an(an({},Yp),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Ir.getSanitizedOptions=Kp});var Ca=me($i=>{"use strict";g();d();f();p();Object.defineProperty($i,"__esModule",{value:!0});function Jp(e){var t=Math.random()*e;return Math.round(t)}$i.fullJitter=Jp});var ba=me(Hi=>{"use strict";g();d();f();p();Object.defineProperty(Hi,"__esModule",{value:!0});function Xp(e){return e}Hi.noJitter=Xp});var wa=me(zi=>{"use strict";g();d();f();p();Object.defineProperty(zi,"__esModule",{value:!0});var Zp=Ca(),ef=ba();function tf(e){switch(e.jitter){case"full":return Zp.fullJitter;case"none":default:return ef.noJitter}}zi.JitterFactory=tf});var Wi=me(Gi=>{"use strict";g();d();f();p();Object.defineProperty(Gi,"__esModule",{value:!0});var rf=wa(),nf=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=rf.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,i=t*Math.pow(r,n);return Math.min(i,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Gi.Delay=nf});var Ra=me(Je=>{"use strict";g();d();f();p();var of=Je&&Je.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},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)}}(),sf=Je&&Je.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(h){try{a(n.next(h))}catch(y){s(y)}}function c(h){try{a(n.throw(h))}catch(y){s(y)}}function a(h){h.done?o(h.value):i(h.value).then(u,c)}a((n=n.apply(e,t||[])).next())})},af=Je&&Je.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(h){return c([a,h])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Je,"__esModule",{value:!0});var cf=Wi(),uf=function(e){of(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return sf(this,void 0,void 0,function(){return af(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}(cf.Delay);Je.SkipFirstDelay=uf});var xa=me(kr=>{"use strict";g();d();f();p();var lf=kr&&kr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},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(kr,"__esModule",{value:!0});var df=Wi(),pf=function(e){lf(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(df.Delay);kr.AlwaysDelay=pf});var Ea=me(Yi=>{"use strict";g();d();f();p();Object.defineProperty(Yi,"__esModule",{value:!0});var ff=Ra(),gf=xa();function mf(e,t){var r=hf(e);return r.setAttemptNumber(t),r}Yi.DelayFactory=mf;function hf(e){return e.delayFirstAttempt?new gf.AlwaysDelay(e):new ff.SkipFirstDelay(e)}});var Ia=me(bt=>{"use strict";g();d();f();p();var Ki=bt&&bt.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(h){try{a(n.next(h))}catch(y){s(y)}}function c(h){try{a(n.throw(h))}catch(y){s(y)}}function a(h){h.done?o(h.value):i(h.value).then(u,c)}a((n=n.apply(e,t||[])).next())})},Ji=bt&&bt.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(h){return c([a,h])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(bt,"__esModule",{value:!0});var yf=Aa(),Sf=Ea();function vf(e,t){return t===void 0&&(t={}),Ki(this,void 0,void 0,function(){var r,n;return Ji(this,function(i){switch(i.label){case 0:return r=yf.getSanitizedOptions(t),n=new Af(e,r),[4,n.execute()];case 1:return[2,i.sent()]}})})}bt.backOff=vf;var Af=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Ki(this,void 0,void 0,function(){var t,r;return Ji(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 Ki(this,void 0,void 0,function(){var t;return Ji(this,function(r){switch(r.label){case 0:return t=Sf.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var ui=me((ps,fs)=>{"use strict";g();d();f();p();(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=t()})(ps,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",o="minute",s="hour",u="day",c="week",a="month",h="quarter",y="year",S="date",m="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,E={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 _=["th","st","nd","rd"],N=U%100;return"["+U+(_[(N-20)%10]||_[N]||_[0])+"]"}},b=function(U,_,N){var V=String(U);return!V||V.length>=_?U:""+Array(_+1-V.length).join(N)+U},P={s:b,z:function(U){var _=-U.utcOffset(),N=Math.abs(_),V=Math.floor(N/60),L=N%60;return(_<=0?"+":"-")+b(V,2,"0")+":"+b(L,2,"0")},m:function U(_,N){if(_.date()<N.date())return-U(N,_);var V=12*(N.year()-_.year())+(N.month()-_.month()),L=_.clone().add(V,a),$=N-L<0,H=_.clone().add(V+($?-1:1),a);return+(-(V+(N-L)/($?L-H:H-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:a,y,w:c,d:u,D:S,h:s,m:o,s:i,ms:n,Q:h}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",I={};I[w]=E;var j="$isDayjsObject",F=function(U){return U instanceof M||!(!U||!U[j])},k=function U(_,N,V){var L;if(!_)return w;if(typeof _=="string"){var $=_.toLowerCase();I[$]&&(L=$),N&&(I[$]=N,L=$);var H=_.split("-");if(!L&&H.length>1)return U(H[0])}else{var G=_.name;I[G]=_,L=G}return!V&&L&&(w=L),L||!V&&w},O=function(U,_){if(F(U))return U.clone();var N=typeof _=="object"?_:{};return N.date=U,N.args=arguments,new M(N)},T=P;T.l=k,T.i=F,T.w=function(U,_){return O(U,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var M=function(){function U(N){this.$L=k(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[j]=!0}var _=U.prototype;return _.parse=function(N){this.$d=function(V){var L=V.date,$=V.utc;if(L===null)return new Date(NaN);if(T.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var H=L.match(v);if(H){var G=H[2]-1||0,X=(H[7]||"0").substring(0,3);return $?new Date(Date.UTC(H[1],G,H[3]||1,H[4]||0,H[5]||0,H[6]||0,X)):new Date(H[1],G,H[3]||1,H[4]||0,H[5]||0,H[6]||0,X)}}return new Date(L)}(N),this.init()},_.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()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==m},_.isSame=function(N,V){var L=O(N);return this.startOf(V)<=L&&L<=this.endOf(V)},_.isAfter=function(N,V){return O(N)<this.startOf(V)},_.isBefore=function(N,V){return this.endOf(V)<O(N)},_.$g=function(N,V,L){return T.u(N)?this[V]:this.set(L,N)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(N,V){var L=this,$=!!T.u(V)||V,H=T.p(N),G=function(ie,ue){var de=T.w(L.$u?Date.UTC(L.$y,ue,ie):new Date(L.$y,ue,ie),L);return $?de:de.endOf(u)},X=function(ie,ue){return T.w(L.toDate()[ie].apply(L.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(ue)),L)},ne=this.$W,J=this.$M,Z=this.$D,K="set"+(this.$u?"UTC":"");switch(H){case y:return $?G(1,0):G(31,11);case a:return $?G(1,J):G(0,J+1);case c:var te=this.$locale().weekStart||0,le=(ne<te?ne+7:ne)-te;return G($?Z-le:Z+(6-le),J);case u:case S:return X(K+"Hours",0);case s:return X(K+"Minutes",1);case o:return X(K+"Seconds",2);case i:return X(K+"Milliseconds",3);default:return this.clone()}},_.endOf=function(N){return this.startOf(N,!1)},_.$set=function(N,V){var L,$=T.p(N),H="set"+(this.$u?"UTC":""),G=(L={},L[u]=H+"Date",L[S]=H+"Date",L[a]=H+"Month",L[y]=H+"FullYear",L[s]=H+"Hours",L[o]=H+"Minutes",L[i]=H+"Seconds",L[n]=H+"Milliseconds",L)[$],X=$===u?this.$D+(V-this.$W):V;if($===a||$===y){var ne=this.clone().set(S,1);ne.$d[G](X),ne.init(),this.$d=ne.set(S,Math.min(this.$D,ne.daysInMonth())).$d}else G&&this.$d[G](X);return this.init(),this},_.set=function(N,V){return this.clone().$set(N,V)},_.get=function(N){return this[T.p(N)]()},_.add=function(N,V){var L,$=this;N=Number(N);var H=T.p(V),G=function(J){var Z=O($);return T.w(Z.date(Z.date()+Math.round(J*N)),$)};if(H===a)return this.set(a,this.$M+N);if(H===y)return this.set(y,this.$y+N);if(H===u)return G(1);if(H===c)return G(7);var X=(L={},L[o]=t,L[s]=r,L[i]=e,L)[H]||1,ne=this.$d.getTime()+N*X;return T.w(ne,this)},_.subtract=function(N,V){return this.add(-1*N,V)},_.format=function(N){var V=this,L=this.$locale();if(!this.isValid())return L.invalidDate||m;var $=N||"YYYY-MM-DDTHH:mm:ssZ",H=T.z(this),G=this.$H,X=this.$m,ne=this.$M,J=L.weekdays,Z=L.months,K=L.meridiem,te=function(ue,de,we,Te){return ue&&(ue[de]||ue(V,$))||we[de].slice(0,Te)},le=function(ue){return T.s(G%12||12,ue,"0")},ie=K||function(ue,de,we){var Te=ue<12?"AM":"PM";return we?Te.toLowerCase():Te};return $.replace(R,function(ue,de){return de||function(we){switch(we){case"YY":return String(V.$y).slice(-2);case"YYYY":return T.s(V.$y,4,"0");case"M":return ne+1;case"MM":return T.s(ne+1,2,"0");case"MMM":return te(L.monthsShort,ne,Z,3);case"MMMM":return te(Z,ne);case"D":return V.$D;case"DD":return T.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return te(L.weekdaysMin,V.$W,J,2);case"ddd":return te(L.weekdaysShort,V.$W,J,3);case"dddd":return J[V.$W];case"H":return String(G);case"HH":return T.s(G,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return ie(G,X,!0);case"A":return ie(G,X,!1);case"m":return String(X);case"mm":return T.s(X,2,"0");case"s":return String(V.$s);case"ss":return T.s(V.$s,2,"0");case"SSS":return T.s(V.$ms,3,"0");case"Z":return H}return null}(ue)||H.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(N,V,L){var $,H=this,G=T.p(V),X=O(N),ne=(X.utcOffset()-this.utcOffset())*t,J=this-X,Z=function(){return T.m(H,X)};switch(G){case y:$=Z()/12;break;case a:$=Z();break;case h:$=Z()/3;break;case c:$=(J-ne)/6048e5;break;case u:$=(J-ne)/864e5;break;case s:$=J/r;break;case o:$=J/t;break;case i:$=J/e;break;default:$=J}return L?$:T.a($)},_.daysInMonth=function(){return this.endOf(a).$D},_.$locale=function(){return I[this.$L]},_.locale=function(N,V){if(!N)return this.$L;var L=this.clone(),$=k(N,V,!0);return $&&(L.$L=$),L},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},U}(),B=M.prototype;return O.prototype=B,[["$ms",n],["$s",i],["$m",o],["$H",s],["$W",u],["$M",a],["$y",y],["$D",S]].forEach(function(U){B[U[1]]=function(_){return this.$g(_,U[0],U[1])}}),O.extend=function(U,_){return U.$i||(U(_,M,O),U.$i=!0),O},O.locale=k,O.isDayjs=F,O.unix=function(U){return O(1e3*U)},O.en=I[w],O.Ls=I,O.p={},O})});var $u=me((gs,ms)=>{"use strict";g();d();f();p();(function(e,t){typeof gs=="object"&&typeof ms<"u"?ms.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_quarterOfYear=t()})(gs,function(){"use strict";var e="month",t="quarter";return function(r,n){var i=n.prototype;i.quarter=function(u){return this.$utils().u(u)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(u-1))};var o=i.add;i.add=function(u,c){return u=Number(u),this.$utils().p(c)===t?this.add(3*u,e):o.bind(this)(u,c)};var s=i.startOf;i.startOf=function(u,c){var a=this.$utils(),h=!!a.u(c)||c;if(a.p(u)===t){var y=this.quarter()-1;return h?this.month(3*y).startOf(e).startOf("day"):this.month(3*y+2).endOf(e).endOf("day")}return s.bind(this)(u,c)}}})});var Hu=me((hs,ys)=>{"use strict";g();d();f();p();(function(e,t){typeof hs=="object"&&typeof ys<"u"?ys.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_customParseFormat=t()})(hs,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/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},u=function(v){return(v=+v)+(v>68?1900:2e3)},c=function(v){return function(R){this[v]=+R}},a=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var E=R.match(/([+-]|\d\d)/g),b=60*E[1]+(+E[2]||0);return b===0?0:E[0]==="+"?-b:b}(v)}],h=function(v){var R=s[v];return R&&(R.indexOf?R:R.s.concat(R.f))},y=function(v,R){var E,b=s.meridiem;if(b){for(var P=1;P<=24;P+=1)if(v.indexOf(b(P,0,R))>-1){E=P>12;break}}else E=v===(R?"pm":"PM");return E},S={A:[o,function(v){this.afternoon=y(v,!1)}],a:[o,function(v){this.afternoon=y(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:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[n,c("day")],Do:[o,function(v){var R=s.ordinal,E=v.match(/\d+/);if(this.day=E[0],R)for(var b=1;b<=31;b+=1)R(b).replace(/\[|\]/g,"")===v&&(this.day=b)}],w:[i,c("week")],ww:[n,c("week")],M:[i,c("month")],MM:[n,c("month")],MMM:[o,function(v){var R=h("months"),E=(h("monthsShort")||R.map(function(b){return b.slice(0,3)})).indexOf(v)+1;if(E<1)throw new Error;this.month=E%12||E}],MMMM:[o,function(v){var R=h("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(v){this.year=u(v)}],YYYY:[/\d{4}/,c("year")],Z:a,ZZ:a};function m(v){var R,E;R=v,E=s&&s.formats;for(var b=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(O,T,M){var B=M&&M.toUpperCase();return T||E[M]||e[M]||E[B].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,_,N){return _||N.slice(1)})})).match(t),P=b.length,w=0;w<P;w+=1){var I=b[w],j=S[I],F=j&&j[0],k=j&&j[1];b[w]=k?{regex:F,parser:k}:I.replace(/^\[|\]$/g,"")}return function(O){for(var T={},M=0,B=0;M<P;M+=1){var U=b[M];if(typeof U=="string")B+=U.length;else{var _=U.regex,N=U.parser,V=O.slice(B),L=_.exec(V)[0];N.call(T,L),O=O.replace(L,"")}}return function($){var H=$.afternoon;if(H!==void 0){var G=$.hours;H?G<12&&($.hours+=12):G===12&&($.hours=0),delete $.afternoon}}(T),T}}return function(v,R,E){E.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(u=v.parseTwoDigitYear);var b=R.prototype,P=b.parse;b.parse=function(w){var I=w.date,j=w.utc,F=w.args;this.$u=j;var k=F[1];if(typeof k=="string"){var O=F[2]===!0,T=F[3]===!0,M=O||T,B=F[2];T&&(B=F[2]),s=this.$locale(),!O&&B&&(s=E.Ls[B]),this.$d=function(V,L,$,H){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*V);var G=m(L)(V),X=G.year,ne=G.month,J=G.day,Z=G.hours,K=G.minutes,te=G.seconds,le=G.milliseconds,ie=G.zone,ue=G.week,de=new Date,we=J||(X||ne?1:de.getDate()),Te=X||de.getFullYear(),st=0;X&&!ne||(st=ne>0?ne-1:de.getMonth());var Nt,_t=Z||0,Cr=K||0,qi=te||0,ji=le||0;return ie?new Date(Date.UTC(Te,st,we,_t,Cr,qi,ji+60*ie.offset*1e3)):$?new Date(Date.UTC(Te,st,we,_t,Cr,qi,ji)):(Nt=new Date(Te,st,we,_t,Cr,qi,ji),ue&&(Nt=H(Nt).week(ue).toDate()),Nt)}catch{return new Date("")}}(I,k,j,E),this.init(),B&&B!==!0&&(this.$L=this.locale(B).$L),M&&I!=this.format(k)&&(this.$d=new Date("")),s={}}else if(k instanceof Array)for(var U=k.length,_=1;_<=U;_+=1){F[1]=k[_-1];var N=E.apply(this,F);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}_===U&&(this.$d=new Date(""))}else P.call(this,w)}}})});var Vl=me((qs,js)=>{"use strict";g();d();f();p();(function(e,t){typeof qs=="object"&&typeof js<"u"?js.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_timezone=t()})(qs,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var o,s=function(h,y,S){S===void 0&&(S={});var m=new Date(h),v=function(R,E){E===void 0&&(E={});var b=E.timeZoneName||"short",P=R+"|"+b,w=t[P];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:b}),t[P]=w),w}(y,S);return v.formatToParts(m)},u=function(h,y){for(var S=s(h,y),m=[],v=0;v<S.length;v+=1){var R=S[v],E=R.type,b=R.value,P=e[E];P>=0&&(m[P]=parseInt(b,10))}var w=m[3],I=w===24?0:w,j=m[0]+"-"+m[1]+"-"+m[2]+" "+I+":"+m[4]+":"+m[5]+":000",F=+h;return(i.utc(j).valueOf()-(F-=F%1e3))/6e4},c=n.prototype;c.tz=function(h,y){h===void 0&&(h=o);var S,m=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:h}),E=Math.round((v-new Date(R))/1e3/60),b=15*-Math.round(v.getTimezoneOffset()/15)-E;if(!Number(b))S=this.utcOffset(0,y);else if(S=i(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),y){var P=S.utcOffset();S=S.add(m-P,"minute")}return S.$x.$timezone=h,S},c.offsetName=function(h){var y=this.$x.$timezone||i.tz.guess(),S=s(this.valueOf(),y,{timeZoneName:h}).find(function(m){return m.type.toLowerCase()==="timezonename"});return S&&S.value};var a=c.startOf;c.startOf=function(h,y){if(!this.$x||!this.$x.$timezone)return a.call(this,h,y);var S=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return a.call(S,h,y).tz(this.$x.$timezone,!0)},i.tz=function(h,y,S){var m=S&&y,v=S||y||o,R=u(+i(),v);if(typeof h!="string")return i(h).tz(v);var E=function(I,j,F){var k=I-60*j*1e3,O=u(k,F);if(j===O)return[k,j];var T=u(k-=60*(O-j)*1e3,F);return O===T?[k,O]:[I-60*Math.min(O,T)*1e3,Math.max(O,T)]}(i.utc(h,m).valueOf(),R,v),b=E[0],P=E[1],w=i(b).utcOffset(P);return w.$x.$timezone=v,w},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(h){o=h}}})});var Ql=me((Ms,Ns)=>{"use strict";g();d();f();p();(function(e,t){typeof Ms=="object"&&typeof Ns<"u"?Ns.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_utc=t()})(Ms,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var s=i.prototype;o.utc=function(m){var v={date:m,utc:!0,args:arguments};return new i(v)},s.utc=function(m){var v=o(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),e):v},s.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var u=s.parse;s.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var c=s.init;s.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else c.call(this)};var a=s.utcOffset;s.utcOffset=function(m,v){var R=this.$utils().u;if(R(m))return this.$u?0:R(this.$offset)?a.call(this):this.$offset;if(typeof m=="string"&&(m=function(w){w===void 0&&(w="");var I=w.match(t);if(!I)return null;var j=(""+I[0]).match(r)||["-",0,0],F=j[0],k=60*+j[1]+ +j[2];return k===0?0:F==="+"?k:-k}(m),m===null))return this;var E=Math.abs(m)<=16?60*m:m,b=this;if(v)return b.$offset=E,b.$u=m===0,b;if(m!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(E+P,e)).$offset=E,b.$x.$localOffset=P}else b=this.utc();return b};var h=s.format;s.format=function(m){var v=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},s.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var y=s.toDate;s.toDate=function(m){return m==="s"&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var S=s.diff;s.diff=function(m,v,R){if(m&&this.$u===m.$u)return S.call(this,m,v,R);var E=this.local(),b=o(m).local();return S.call(E,b,v,R)}}})});var id=me((_M,nd)=>{"use strict";g();d();f();p();function HS(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}nd.exports=zS;function zS(e,t,r){var n=r&&r.stringify||HS,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var s=new Array(o);s[0]=n(e);for(var u=1;u<o;u++)s[u]=n(t[u]);return s.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var a="",h=1-i,y=-1,S=e&&e.length||0,m=0;m<S;){if(e.charCodeAt(m)===37&&m+1<S){switch(y=y>-1?y:0,e.charCodeAt(m+1)){case 100:case 102:if(h>=c||t[h]==null)break;y<m&&(a+=e.slice(y,m)),a+=Number(t[h]),y=m+2,m++;break;case 105:if(h>=c||t[h]==null)break;y<m&&(a+=e.slice(y,m)),a+=Math.floor(Number(t[h])),y=m+2,m++;break;case 79:case 111:case 106:if(h>=c||t[h]===void 0)break;y<m&&(a+=e.slice(y,m));var v=typeof t[h];if(v==="string"){a+="'"+t[h]+"'",y=m+2,m++;break}if(v==="function"){a+=t[h].name||"<anonymous>",y=m+2,m++;break}a+=n(t[h]),y=m+2,m++;break;case 115:if(h>=c)break;y<m&&(a+=e.slice(y,m)),a+=String(t[h]),y=m+2,m++;break;case 37:y<m&&(a+=e.slice(y,m)),a+="%",y=m+2,m++,h--;break}++h}++m}return y===-1?e:(y<S&&(a+=e.slice(y)),a)}});var ld=me((BM,yi)=>{"use strict";g();d();f();p();var od=id();yi.exports=it;var rn=av().console||{},GS={mapHttpRequest:hi,mapHttpResponse:hi,wrapRequestSerializer:Ls,wrapResponseSerializer:Ls,wrapErrorSerializer:Ls,req:hi,res:hi,err:ad,errWithCause:ad};function gt(e,t){return e==="silent"?1/0:t.levels.values[e]}var Qs=Symbol("pino.logFuncs"),Us=Symbol("pino.hierarchy"),WS={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function sd(e,t){let r={logger:t,parent:e[Us]};t[Us]=r}function YS(e,t,r){let n={};t.forEach(i=>{n[i]=r[i]?r[i]:rn[i]||rn[WS[i]||"log"]||gr}),e[Qs]=n}function KS(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function it(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||rn;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},i=KS(e.browser.serialize,n),o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);let s=Object.keys(e.customLevels||{}),u=["error","fatal","warn","info","debug","trace"].concat(s);typeof r=="function"&&u.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",a=Object.create(r);a.log||(a.log=gr),YS(a,u,r),sd({},a),Object.defineProperty(a,"levelVal",{get:y}),Object.defineProperty(a,"level",{get:S,set:m});let h={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:u,timestamp:iv(e),messageKey:e.messageKey||"msg",onChild:e.onChild||gr};a.levels=JS(e),a.level=c,a.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},a.setMaxListeners=a.getMaxListeners=a.emit=a.addListener=a.on=a.prependListener=a.once=a.prependOnceListener=a.removeListener=a.removeAllListeners=a.listeners=a.listenerCount=a.eventNames=a.write=a.flush=gr,a.serializers=n,a._serialize=i,a._stdErrSerialize=o,a.child=function(...R){return v.call(this,h,...R)},t&&(a._logEvent=Vs());function y(){return gt(this.level,this)}function S(){return this._level}function m(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,jt(this,h,a,"error"),jt(this,h,a,"fatal"),jt(this,h,a,"warn"),jt(this,h,a,"info"),jt(this,h,a,"debug"),jt(this,h,a,"trace"),s.forEach(E=>{jt(this,h,a,E)})}function v(R,E,b){if(!E)throw new Error("missing bindings for child Pino");b=b||{},i&&E.serializers&&(b.serializers=E.serializers);let P=b.serializers;if(i&&P){var w=Object.assign({},n,P),I=e.browser.serialize===!0?Object.keys(w):i;delete E.serializers,Bs([E],I,w,this._stdErrSerialize)}function j(k){this._childLevel=(k._childLevel|0)+1,this.bindings=E,w&&(this.serializers=w,this._serialize=I),t&&(this._logEvent=Vs([].concat(k._logEvent.bindings,E)))}j.prototype=this;let F=new j(this);return sd(this,F),F.child=function(...k){return v.call(this,R,...k)},F.level=b.level||this.level,R.onChild(F),F}return a}function JS(e){let t=e.customLevels||{},r=Object.assign({},it.levels.values,t),n=Object.assign({},it.levels.labels,XS(t));return{values:r,labels:n}}function XS(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}it.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"}};it.stdSerializers=GS;it.stdTimeFunctions=Object.assign({},{nullTime:cd,epochTime:ud,unixTime:ov,isoTime:sv});function ZS(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Us];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function jt(e,t,r,n){if(Object.defineProperty(e,n,{value:gt(e.level,r)>gt(n,r)?gr:r[Qs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===gr){if(!t.transmit)return;let o=t.transmit.level||e.level,s=gt(o,r);if(gt(n,r)<s)return}e[n]=tv(e,t,r,n);let i=ZS(e);i.length!==0&&(e[n]=ev(i,e[n]))}function ev(e,t){return function(){return t.apply(this,[...e,...arguments])}}function tv(e,t,r,n){return function(i){return function(){let s=t.timestamp(),u=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===rn?rn:this;for(var a=0;a<u.length;a++)u[a]=arguments[a];var h=!1;if(t.serialize&&(Bs(u,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?i.call(c,...rv(this,n,u,s,t)):i.apply(c,u),t.transmit){let y=t.transmit.level||e._level,S=gt(y,r),m=gt(n,r);if(m<S)return;nv(this,{ts:s,methodLevel:n,methodValue:m,transmitLevel:y,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:gt(e._level,r)},u,h)}}}(e[Qs][n])}function rv(e,t,r,n,i){let{level:o,log:s=y=>y}=i.formatters||{},u=r.slice(),c=u[0],a={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(a.time=n),o){let y=o(t,e.levels.values[t]);Object.assign(a,y)}else a.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;h--&&typeof u[0]=="object";)Object.assign(a,u.shift());return[s(a),...u]}else{if(c!==null&&typeof c=="object"){for(;h--&&typeof u[0]=="object";)Object.assign(a,u.shift());c=u.length?od(u.shift(),u):void 0}else typeof c=="string"&&(c=od(u.shift(),u));return c!==void 0&&(a[i.messageKey]=c),[s(a)]}}function Bs(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=it.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i])&&t)for(let o in e[i])t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function nv(e,t,r,n=!1){let i=t.send,o=t.ts,s=t.methodLevel,u=t.methodValue,c=t.val,a=e._logEvent.bindings;n||Bs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=r.filter(function(h){return a.indexOf(h)===-1}),e._logEvent.level.label=s,e._logEvent.level.value=u,i(s,e._logEvent,c),e._logEvent=Vs(a)}function Vs(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function ad(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 iv(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?cd:ud}function hi(){return{}}function Ls(e){return e}function gr(){}function cd(){return!1}function ud(){return Date.now()}function ov(){return Math.round(Date.now()/1e3)}function sv(){return new Date(Date.now()).toISOString()}function av(){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=it;yi.exports.pino=it});var Jv={};Sp(Jv,{ResultTemplatesHelpers:()=>nl,buildCaseAssistEngine:()=>hd,buildCaseField:()=>Fd,buildCaseInput:()=>Td,buildController:()=>Ye,buildDocumentSuggestion:()=>Hs,buildDocumentSuggestionList:()=>Hs,buildInteractiveResult:()=>qd,buildQuickview:()=>cp,getAnalyticsNextApiBaseUrl:()=>cn,getOrganizationEndpoint:()=>pe,loadCaseAssistAnalyticsActions:()=>Gv,loadCaseFieldActions:()=>Wv,loadCaseInputActions:()=>Yv,loadDocumentSuggestionActions:()=>Kv,loadGenericAnalyticsActions:()=>zv});module.exports=vp(Jv);g();d();f();p();g();d();f();p();var ja=Ne(Ia(),1);g();d();f();p();var De=new Error("Failed to load reducers."),Vt=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."}},wt=class extends Error{constructor(r,n){super();se(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};g();d();f();p();function ka(e){return Array.isArray(e)}function Pa(e,t){return[...e.reduce((r,n)=>{let i=t(n);return r.has(i)||r.set(i,n),r},new Map).values()]}var Cf=new Set(["1",1,"yes",!0]);function Oa(){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=>Cf.has(r))}function Fa(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Pr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}g();d();f();p();function Ta(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}function Da(e){return typeof e!="object"||!e?!1:Object.values(e).every(bf)}function bf(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function qa(e){return e===429}var at=class e{static call(t){return _asyncToGenerator(function*(){let r=wf(t),{logger:n}=t,i=yield e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:o,...s}=i,u=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield C(o,s);if(qa(c.status))throw c;return c});return function u(){return _ref.apply(this,arguments)}}();try{let c=yield(0,ja.backOff)(u,{retry:a=>{let h=a&&qa(a.status);return h&&n.info("Platform retrying request"),h}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Vt;case 404:throw new wt(o,c.status);default:return n.info({response:c,requestInfo:i},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new wt(o):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:i,logger:o,requestMetadata:s}=r,{signal:u,...c}=t,a=Pr(c);try{let h=yield i(t,n,s);return{...t,...h}}catch(h){o.error(h,"Platform request preprocessing failed. Returning default request options.")}return a})()}};function pe(e,t="prod",r="platform"){let n=t==="prod"?"":t,i=r==="platform"?"":`.${r}`;return`https://${e}${i}.org${n}.coveo.com`}function Qt(e,t="prod"){return`${pe(e,t)}/rest/search/v2`}function cn(e,t="prod"){return`${pe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function wf(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:o,signal:s}=e,u=e.method==="POST"||e.method==="PUT",c=Rf(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${o}`,...e.headers},...(u&&{body:c}),signal:s}}function Rf(e,t){return t==="application/x-www-form-urlencoded"?Da(e)?Ta(e):"":JSON.stringify(e)}g();d();f();p();g();d();f();p();function xf(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 Ji(r)}var Ji=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Le=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let i in this.definition){let o=this.definition[i].validate(r[i]);o&&n.push(`${i}: ${o}`)}if(n.length)throw Rf(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}},xt=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&Y(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 $t(e){return e===void 0}function xf(e){return e===null}function Y(e){return $t(e)||xf(e)}var ye=class{constructor(e={}){se(this,"value");this.value=new xt(e)}validate(e){let t=this.value.validate(e);return t||(Ef(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Ef(e){return $t(e)||ja(e)}function ja(e){return typeof e=="boolean"}var Re=class{constructor(e={}){se(this,"value");this.config=e,this.value=new xt(e)}validate(e){let t=this.value.validate(e);return t||(If(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 If(e){return $t(e)||Ma(e)}function Ma(e){return typeof e=="number"&&!Number.isNaN(e)}var kf=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,W=class{constructor(e={}){se(this,"value");se(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new xt(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:o}=this.config,s=this.value.validate(e);if(s)return s;if($t(e))return null;if(!Na(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}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:o&&!(kf.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 Na(e){return Object.prototype.toString.call(e)==="[object String]"}var ce=class{constructor(e={}){se(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if($t(e))return this.config.options.required?"value is required and is currently undefined":null;if(!_a(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&Y(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],o=n.validate(i);o!==null&&(t+=` ${o}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function _a(e){return e!==void 0&&typeof e=="object"}var Ze=class{constructor(e={}){se(this,"value");this.config=e,this.value=new xt(this.config)}validate(e){if(!Y(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(Y(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&&Y(n)&&(r=`value is null or undefined: ${e.join(",")}`);let i=this.validatePrimitiveValue(n,this.config.each);i!==null&&(r+=` ${i}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return ja(e)||Na(e)||Ma(e)||_a(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function La(e){return Array.isArray(e)}var Xi=class{constructor(e){se(this,"value");this.config=e,this.value=new xt(e)}validate(e){let t=this.value.validate(e);return t!==null?t:$t(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}};g();d();f();p();var un=e=>e;g();d();f();p();g();d();f();p();g();d();f();p();var Ht=class{constructor(t){se(this,"_basePath");se(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}};g();d();f();p();function Zi(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...o}=e;return o}var eo=e=>{let{response:t}=e;return t.body?Pf(e):Of(t)},Pf=e=>Tf(e)?Df(e):Ff(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Of=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Ff(e){return e.body.statusCode!==void 0}function Tf(e){return e.body.exception!==void 0}var Df=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});g();d();f();p();function Ua(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}g();d();f();p();var to=(e,t,r,n)=>{let i=new Ht(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};var Va=(e,t)=>{let r=new Ht(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},ro=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield ct.call({...to(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Zi(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Ua(r),i=yield r.arrayBuffer(),s=new TextDecoder(n).decode(i);return qf(s)?{success:s}:{error:eo({response:r,body:s})}});return function ro(_x,_x2){return _ref2.apply(this,arguments)}}();function qf(e){return typeof e=="string"}g();d();f();p();function jf(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Mf(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ln(e,t){if(t&&e.name==="AbortError")return{error:Mf(e)};if(e instanceof Rt)return{error:jf(e)};throw e}g();d();f();p();g();d();f();p();var dn=(e,t,r,n,i={})=>{Nf(e);let o=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=_f(i),u=s?`${o}?${s}`:o;return{accessToken:e.accessToken,method:t,contentType:r,url:u,origin:"caseAssistApiFetch"}},pn=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>(t[r]=e[r],t),{}),fn=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>(t[r]=e[r].value,t),{}),Nf=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},_f=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var Qa=e=>{let t=e.debug?{debug:"1"}:{};return{...dn(e,"POST","application/json","/classify",t),requestParams:Lf(e)}},Lf=e=>({clientId:e.clientId,locale:e.locale,fields:pn(e.fields)});g();d();f();p();var Ba=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...dn(e,"POST","application/json","/documents/suggest",t),requestParams:Uf(e)}},Uf=e=>({clientId:e.clientId,locale:e.locale,fields:pn(e.fields),context:e.context,analytics:e.analytics});var gn=class{constructor(t){this.options=t}getCaseClassifications(t){var _this=this;return _asyncToGenerator(function*(){let r=yield ct.call({...Qa(t),..._this.options});if(r instanceof Error)return ln(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}getDocumentSuggestions(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield ct.call({...Ba(t),..._this2.options});if(r instanceof Error)return ln(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this3=this;return _asyncToGenerator(function*(){return ro(t,_this3.options)})()}};g();d();f();p();g();d();f();p();g();d();f();p();function he(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 Vf=typeof Symbol=="function"&&Symbol.observable||"@@observable",$a=Vf,no=()=>Math.random().toString(36).substring(7).split("").join("."),Qf={INIT:`@@redux/INIT${no()}`,REPLACE:`@@redux/REPLACE${no()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${no()}`},mn=Qf;function Be(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 io(e,t,r){if(typeof e!="function")throw new Error(he(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(he(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(he(1));return r(io)(e,t)}let n=e,i=t,o=new Map,s=o,u=0,c=!1;function a(){s===o&&(s=new Map,o.forEach((E,b)=>{s.set(b,E)}))}function y(){if(c)throw new Error(he(3));return i}function h(E){if(typeof E!="function")throw new Error(he(4));if(c)throw new Error(he(5));let b=!0;a();let P=u++;return s.set(P,E),function(){if(b){if(c)throw new Error(he(6));b=!1,a(),s.delete(P),o=null}}}function S(E){if(!Be(E))throw new Error(he(7));if(typeof E.type>"u")throw new Error(he(8));if(typeof E.type!="string")throw new Error(he(17));if(c)throw new Error(he(9));try{c=!0,i=n(i,E)}finally{c=!1}return(o=s).forEach(P=>{P()}),E}function m(E){if(typeof E!="function")throw new Error(he(10));n=E,S({type:mn.REPLACE})}function v(){let E=h;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(he(11));function P(){let I=b;I.next&&I.next(y())}return P(),{unsubscribe:E(P)}},[$a](){return this}}}return S({type:mn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:m,[$a]:v}}function Bf(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:mn.INIT})>"u")throw new Error(he(12));if(typeof r(void 0,{type:mn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(he(13))})}function zt(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let u=t[s];typeof e[u]=="function"&&(r[u]=e[u])}let n=Object.keys(r),i,o;try{Bf(r)}catch(s){o=s}return function(u={},c){if(o)throw o;let a=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],m=r[S],v=u[S],R=m(v,c);if(typeof R>"u"){let E=c&&c.type;throw new Error(he(14))}y[S]=R,a=a||R!==v}return a=a||n.length!==Object.keys(u).length,a?y:u}}function Gt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Ha(...e){return t=>(r,n)=>{let i=t(r,n),o=()=>{throw new Error(he(15))},s={getState:i.getState,dispatch:(c,...a)=>o(c,...a)},u=e.map(c=>c(s));return o=Gt(...u)(i.dispatch),{...i,dispatch:o}}}function yn(e){return Be(e)&&"type"in e&&typeof e.type=="string"}g();d();f();p();var mo=Symbol.for("immer-nothing"),Or=Symbol.for("immer-draftable"),xe=Symbol.for("immer-state");function Se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var It=Object.getPrototypeOf;function Pe(e){return!!e&&!!e[xe]}function Ee(e){return e?Ka(e)||Array.isArray(e)||!!e[Or]||!!e.constructor?.[Or]||jr(e)||Mr(e):!1}var $f=Object.prototype.constructor.toString();function Ka(e){if(!e||typeof e!="object")return!1;let t=It(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===$f}function yo(e){return Pe(e)||Se(15,e),e[xe].base_}function Fr(e,t){kt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function kt(e){let t=e[xe];return t?t.type_:Array.isArray(e)?1:jr(e)?2:Mr(e)?3:0}function Tr(e,t){return kt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function oo(e,t){return kt(e)===2?e.get(t):e[t]}function Ja(e,t,r){let n=kt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Hf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function jr(e){return e instanceof Map}function Mr(e){return e instanceof Set}function Et(e){return e.copy_||e.base_}function co(e,t){if(jr(e))return new Map(e);if(Mr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ka(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[xe];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){let s=i[o],u=n[s];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[s]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[s]})}return Object.create(It(e),n)}else{let n=It(e);if(n!==null&&r)return{...e};let i=Object.create(n);return Object.assign(i,e)}}function vn(e,t=!1){return An(e)||Pe(e)||!Ee(e)||(kt(e)>1&&(e.set=e.add=e.clear=e.delete=zf),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>vn(n,!0))),e}function zf(){Se(2)}function An(e){return Object.isFrozen(e)}var uo={};function Pt(e){let t=uo[e];return t||Se(0,e),t}function Gf(e,t){uo[e]||(uo[e]=t)}var Dr;function Xa(){return Dr}function Wf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function za(e,t){t&&(Pt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lo(e){po(e),e.drafts_.forEach(Yf),e.drafts_=null}function po(e){e===Dr&&(Dr=e.parent_)}function Ga(e){return Dr=Wf(Dr,e)}function Yf(e){let t=e[xe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Wa(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[xe].modified_&&(lo(t),Se(4)),Ee(e)&&(e=hn(t,e),t.parent_||Sn(t,e)),t.patches_&&Pt("Patches").generateReplacementPatches_(r[xe].base_,e,t.patches_,t.inversePatches_)):e=hn(t,r,[]),lo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mo?e:void 0}function hn(e,t,r){if(An(t))return t;let n=t[xe];if(!n)return Fr(t,(i,o)=>Ya(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Sn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let i=n.copy_,o=i,s=!1;n.type_===3&&(o=new Set(i),i.clear(),s=!0),Fr(o,(u,c)=>Ya(e,n,i,u,c,r,s)),Sn(e,i,!1),r&&e.patches_&&Pt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Ya(e,t,r,n,i,o,s){if(Pe(i)){let u=o&&t&&t.type_!==3&&!Tr(t.assigned_,n)?o.concat(n):void 0,c=hn(e,i,u);if(Ja(r,n,c),Pe(c))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(Ee(i)&&!An(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;hn(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Sn(e,i)}}function Sn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vn(t,r)}function Kf(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Xa(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=ho;r&&(i=[n],o=qr);let{revoke:s,proxy:u}=Proxy.revocable(i,o);return n.draft_=u,n.revoke_=s,u}var ho={get(e,t){if(t===xe)return e;let r=Et(e);if(!Tr(r,t))return Jf(e,r,t);let n=r[t];return e.finalized_||!Ee(n)?n:n===so(e.base_,t)?(ao(e),e.copy_[t]=go(n,e)):n},has(e,t){return t in Et(e)},ownKeys(e){return Reflect.ownKeys(Et(e))},set(e,t,r){let n=Za(Et(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let i=so(Et(e),t),o=i?.[xe];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Hf(r,i)&&(r!==void 0||Tr(e.base_,t)))return!0;ao(e),fo(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 so(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ao(e),fo(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Et(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Se(11)},getPrototypeOf(e){return It(e.base_)},setPrototypeOf(){Se(12)}},qr={};Fr(ho,(e,t)=>{qr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qr.deleteProperty=function(e,t){return qr.set.call(this,e,t,void 0)};qr.set=function(e,t,r){return ho.set.call(this,e[0],t,r,e[0])};function so(e,t){let r=e[xe];return(r?Et(r):e)[t]}function Jf(e,t,r){let n=Za(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Za(e,t){if(!(t in e))return;let r=It(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=It(r)}}function fo(e){e.modified_||(e.modified_=!0,e.parent_&&fo(e.parent_))}function ao(e){e.copy_||(e.copy_=co(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let s=this;return function(c=o,...a){return s.produce(c,y=>r.call(this,y,...a))}}typeof r!="function"&&Se(6),n!==void 0&&typeof n!="function"&&Se(7);let i;if(Ee(t)){let o=Ga(this),s=go(t,void 0),u=!0;try{i=r(s),u=!1}finally{u?lo(o):po(o)}return za(o,n),Wa(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===mo&&(i=void 0),this.autoFreeze_&&vn(i,!0),n){let o=[],s=[];Pt("Patches").generateReplacementPatches_(t,i,o,s),n(o,s)}return i}else Se(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...u)=>this.produceWithPatches(s,c=>t(c,...u));let n,i;return[this.produce(t,r,(s,u)=>{n=s,i=u}),n,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ee(e)||Se(8),Pe(e)&&(e=ec(e));let t=Ga(this),r=go(e,void 0);return r[xe].isManual_=!0,po(t),r}finishDraft(e,t){let r=e&&e[xe];(!r||!r.isManual_)&&Se(9);let{scope_:n}=r;return za(n,t),Wa(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let n=Pt("Patches").applyPatches_;return Pe(e)?n(e,t):this.produce(e,i=>n(i,t))}};function go(e,t){let r=jr(e)?Pt("MapSet").proxyMap_(e,t):Mr(e)?Pt("MapSet").proxySet_(e,t):Kf(e,t);return(t?t.scope_:Xa()).drafts_.push(r),r}function ec(e){return Pe(e)||Se(10,e),tc(e)}function tc(e){if(!Ee(e)||An(e))return e;let t=e[xe],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=co(e,t.scope_.immer_.useStrictShallowCopy_)}else r=co(e,!0);return Fr(r,(n,i)=>{Ja(r,n,tc(i))}),t&&(t.finalized_=!1),r}function rc(){let t="replace",r="add",n="remove";function i(S,m,v,R){switch(S.type_){case 0:case 2:return s(S,m,v,R);case 1:return o(S,m,v,R);case 3:return u(S,m,v,R)}}function o(S,m,v,R){let{base_:E,assigned_:b}=S,P=S.copy_;P.length<E.length&&([E,P]=[P,E],[v,R]=[R,v]);for(let w=0;w<E.length;w++)if(b[w]&&P[w]!==E[w]){let I=m.concat([w]);v.push({op:t,path:I,value:h(P[w])}),R.push({op:t,path:I,value:h(E[w])})}for(let w=E.length;w<P.length;w++){let I=m.concat([w]);v.push({op:r,path:I,value:h(P[w])})}for(let w=P.length-1;E.length<=w;--w){let I=m.concat([w]);R.push({op:n,path:I})}}function s(S,m,v,R){let{base_:E,copy_:b}=S;Fr(S.assigned_,(P,w)=>{let I=oo(E,P),j=oo(b,P),F=w?Tr(E,P)?t:r:n;if(I===j&&F===t)return;let k=m.concat(P);v.push(F===n?{op:F,path:k}:{op:F,path:k,value:j}),R.push(F===r?{op:n,path:k}:F===n?{op:r,path:k,value:h(I)}:{op:t,path:k,value:h(I)})})}function u(S,m,v,R){let{base_:E,copy_:b}=S,P=0;E.forEach(w=>{if(!b.has(w)){let I=m.concat([P]);v.push({op:n,path:I,value:w}),R.unshift({op:r,path:I,value:w})}P++}),P=0,b.forEach(w=>{if(!E.has(w)){let I=m.concat([P]);v.push({op:r,path:I,value:w}),R.unshift({op:n,path:I,value:w})}P++})}function c(S,m,v,R){v.push({op:t,path:[],value:m===mo?void 0:m}),R.push({op:t,path:[],value:S})}function a(S,m){return m.forEach(v=>{let{path:R,op:E}=v,b=S;for(let j=0;j<R.length-1;j++){let F=kt(b),k=R[j];typeof k!="string"&&typeof k!="number"&&(k=""+k),(F===0||F===1)&&(k==="__proto__"||k==="constructor")&&Se(19),typeof b=="function"&&k==="prototype"&&Se(19),b=oo(b,k),typeof b!="object"&&Se(18,R.join("/"))}let P=kt(b),w=y(v.value),I=R[R.length-1];switch(E){case t:switch(P){case 2:return b.set(I,w);case 3:Se(16);default:return b[I]=w}case r:switch(P){case 1:return I==="-"?b.push(w):b.splice(I,0,w);case 2:return b.set(I,w);case 3:return b.add(w);default:return b[I]=w}case n:switch(P){case 1:return b.splice(I,1);case 2:return b.delete(I);case 3:return b.delete(v.value);default:return delete b[I]}default:Se(17,E)}}),S}function y(S){if(!Ee(S))return S;if(Array.isArray(S))return S.map(y);if(jr(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,y(R)]));if(Mr(S))return new Set(Array.from(S).map(y));let m=Object.create(It(S));for(let v in S)m[v]=y(S[v]);return Tr(S,Or)&&(m[Or]=S[Or]),m}function h(S){return Pe(S)?y(S):S}Gf("Patches",{applyPatches_:a,generatePatches_:i,generateReplacementPatches_:c})}var Oe=new Xf,et=Oe.produce,Cn=Oe.produceWithPatches.bind(Oe),dw=Oe.setAutoFreeze.bind(Oe),pw=Oe.setUseStrictShallowCopy.bind(Oe),So=Oe.applyPatches.bind(Oe),fw=Oe.createDraft.bind(Oe),gw=Oe.finishDraft.bind(Oe);g();d();f();p();function Zf(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tg(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 nc=e=>Array.isArray(e)?e:[e];function rg(e){let t=Array.isArray(e[0])?e[0]:e;return tg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ng(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var Cw=Symbol();var bw=Object.getPrototypeOf({});var ig=class{constructor(e){this.value=e}deref(){return this.value}},og=typeof WeakRef<"u"?WeakRef:ig,sg=0,ic=1;function bn(){return{s:sg,v:void 0,o:null,p:null}}function Wt(e,t={}){let r=bn(),{resultEqualityCheck:n}=t,i,o=0;function s(){let u=r,{length:c}=arguments;for(let h=0,S=c;h<S;h++){let m=arguments[h];if(typeof m=="function"||typeof m=="object"&&m!==null){let v=u.o;v===null&&(u.o=v=new WeakMap);let R=v.get(m);R===void 0?(u=bn(),v.set(m,u)):u=R}else{let v=u.p;v===null&&(u.p=v=new Map);let R=v.get(m);R===void 0?(u=bn(),v.set(m,u)):u=R}}let a=u,y;if(u.s===ic)y=u.v;else if(y=e.apply(null,arguments),o++,n){let h=i?.deref?.()??i;h!=null&&n(h,y)&&(y=h,o!==0&&o--),i=typeof y=="object"&&y!==null||typeof y=="function"?new og(y):y}return a.s=ic,a.v=y,y}return s.clearCache=()=>{r=bn(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function oc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,s=0,u,c={},a=i.pop();typeof a=="object"&&(c=a,a=i.pop()),Zf(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let y={...r,...c},{memoize:h,memoizeOptions:S=[],argsMemoize:m=Wt,argsMemoizeOptions:v=[],devModeChecks:R={}}=y,E=nc(S),b=nc(v),P=rg(i),w=h(function(){return o++,a.apply(null,arguments)},...E),I=!0,j=m(function(){s++;let k=ng(P,arguments);return u=w.apply(null,k),u},...b);return Object.assign(j,{resultFunc:a,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var ae=oc(Wt),ag=Object.assign((e,t=ae)=>{eg(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(o=>e[o]);return t(n,(...o)=>o.reduce((s,u,c)=>(s[r[c]]=u,s),{}))},{withTypes:()=>ag});g();d();f();p();function sc(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var ac=sc(),cc=sc;var cg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Gt:Gt.apply(null,arguments)},Uw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ug=e=>e&&typeof e.match=="function";function Q(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Ue(0));return{type:e,payload:i.payload,...("meta"in i&&{meta:i.meta}),...("error"in i&&{error:i.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>yn(n)&&n.type===e,r}var fc=class Nr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Nr.prototype)}static get[Symbol.species](){return Nr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Nr(...t[0].concat(this)):new Nr(...t.concat(this))}};function uc(e){return Ee(e)?et(e,()=>{}):e}function lc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function lg(e){return typeof e=="boolean"}var dg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{},s=new fc;return r&&(lg(r)?s.push(ac):s.push(cc(r.extraArgument))),s},_r="RTK_autoBatch",Kt=()=>e=>({payload:e,meta:{[_r]:!0}}),dc=e=>t=>{setTimeout(t,e)},pg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,o=!1,s=!1,u=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:dc(10):e.type==="callback"?e.queueNotification:dc(e.timeout),a=()=>{s=!1,o&&(o=!1,u.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>i&&y(),S=n.subscribe(h);return u.add(y),()=>{S(),u.delete(y)}},dispatch(y){try{return i=!y?.meta?.[_r],o=!i,o&&(s||(s=!0,c(a))),n.dispatch(y)}finally{i=!0}}})},fg=e=>function(r){let{autoBatch:n=!0}=r??{},i=new fc(e);return n&&i.push(pg(typeof n=="object"?n:void 0)),i};function gc(e){let t=dg(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Be(r))u=zt(r);else throw new Error(Ue(1));let c;typeof n=="function"?c=n(t):c=t();let a=Gt;i&&(a=cg({trace:!1,...(typeof i=="object"&&i)}));let y=Ha(...c),h=fg(y),S=typeof s=="function"?s(h):h(),m=a(...S);return io(u,o,m)}function mc(e){let t={},r=[],n,i={addCase(o,s){let u=typeof o=="string"?o:o.type;if(!u)throw new Error(Ue(28));if(u in t)throw new Error(Ue(29));return t[u]=s,i},addMatcher(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function gg(e){return typeof e=="function"}function fe(e,t){let[r,n,i]=mc(t),o;if(gg(e))o=()=>uc(e());else{let u=uc(e);o=()=>u}function s(u=o(),c){let a=[r[c.type],...n.filter(({matcher:y})=>y(c)).map(({reducer:y})=>y)];return a.filter(y=>!!y).length===0&&(a=[i]),a.reduce((y,h)=>{if(h)if(Pe(y)){let m=h(y,c);return m===void 0?y:m}else{if(Ee(y))return et(y,S=>h(S,c));{let S=h(y,c);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},u)}return s.getInitialState=o,s}var yc=(e,t)=>ug(e)?e.match(t):e(t);function $e(...e){return t=>e.some(r=>yc(r,t))}function Yt(...e){return t=>e.every(r=>yc(r,t))}function Rn(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 Lr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function xn(...e){return e.length===0?t=>Rn(t,["pending"]):Lr(e)?$e(...e.map(t=>t.pending)):xn()(e[0])}function Ot(...e){return e.length===0?t=>Rn(t,["rejected"]):Lr(e)?$e(...e.map(t=>t.rejected)):Ot()(e[0])}function Ur(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Yt(Ot(...e),t):Lr(e)?Yt(Ot(...e),t):Ur()(e[0])}function tt(...e){return e.length===0?t=>Rn(t,["fulfilled"]):Lr(e)?$e(...e.map(t=>t.fulfilled)):tt()(e[0])}function En(...e){return e.length===0?t=>Rn(t,["pending","fulfilled","rejected"]):Lr(e)?$e(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):En()(e[0])}var mg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",In=(e=21)=>{let t="",r=e;for(;r--;)t+=mg[Math.random()*64|0];return t},yg=["name","message","stack","code"],vo=class{constructor(e,t){se(this,"_type");this.payload=e,this.meta=t}},pc=class{constructor(e,t){se(this,"_type");this.payload=e,this.meta=t}},hg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of yg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},oe=(()=>{function e(t,r,n){let i=Q(t+"/fulfilled",(c,a,y,h)=>({payload:c,meta:{...(h||{}),arg:y,requestId:a,requestStatus:"fulfilled"}})),o=Q(t+"/pending",(c,a,y)=>({payload:void 0,meta:{...(y||{}),arg:a,requestId:c,requestStatus:"pending"}})),s=Q(t+"/rejected",(c,a,y,h,S)=>({payload:h,error:(n&&n.serializeError||hg)(c||"Rejected"),meta:{...(S||{}),arg:y,requestId:a,rejectedWithValue:!!h,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function u(c){return(a,y,h)=>{let S=n?.idGenerator?n.idGenerator(c):In(),m=new l.AbortController,v,R;function E(P){R=P,m.abort()}let b=_asyncToGenerator(function*(){let P;try{let I=n?.condition?.(c,{getState:y,extra:h});if(vg(I)&&(I=yield I),I===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let j=new Promise((F,k)=>{v=()=>{k({name:"AbortError",message:R||"Aborted"})},m.signal.addEventListener("abort",v)});a(o(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:y,extra:h}))),P=yield Promise.race([j,Promise.resolve(r(c,{dispatch:a,getState:y,extra:h,requestId:S,signal:m.signal,abort:E,rejectWithValue:(F,k)=>new vo(F,k),fulfillWithValue:(F,k)=>new pc(F,k)})).then(F=>{if(F instanceof vo)throw F;return F instanceof pc?i(F.payload,S,c,F.meta):i(F,S,c)})])}catch(I){P=I instanceof vo?s(null,S,c,I.payload,I.meta):s(I,S,c)}finally{v&&m.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&s.match(P)&&P.meta.condition||a(P),P})();return Object.assign(b,{abort:E,requestId:S,arg:c,unwrap(){return b.then(Sg)}})}}return Object.assign(u,{pending:o,rejected:s,fulfilled:i,settled:$e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function Sg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var hc=Symbol.for("rtk-slice-createasyncthunk"),Hw={[hc]:oe};function Ag(e,t){return`${e}/${t}`}function Cg({creators:e}={}){let t=e?.asyncThunk?.[hc];return function(n){let{name:i,reducerPath:o=i}=n;if(!i)throw new Error(Ue(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(wg()):n.reducers)||{},u=Object.keys(s),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(P,w){let I=typeof P=="string"?P:P.type;if(!I)throw new Error(Ue(12));if(I in c.sliceCaseReducersByType)throw new Error(Ue(13));return c.sliceCaseReducersByType[I]=w,a},addMatcher(P,w){return c.sliceMatchers.push({matcher:P,reducer:w}),a},exposeAction(P,w){return c.actionCreators[P]=w,a},exposeCaseReducer(P,w){return c.sliceCaseReducersByName[P]=w,a}};u.forEach(P=>{let w=s[P],I={reducerName:P,type:Ag(i,P),createNotation:typeof n.reducers=="function"};xg(w)?Ig(I,w,a,t):Rg(I,w,a)});function y(){let[P={},w=[],I=void 0]=typeof n.extraReducers=="function"?mc(n.extraReducers):[n.extraReducers],j={...P,...c.sliceCaseReducersByType};return fe(n.initialState,F=>{for(let k in j)F.addCase(k,j[k]);for(let k of c.sliceMatchers)F.addMatcher(k.matcher,k.reducer);for(let k of w)F.addMatcher(k.matcher,k.reducer);I&&F.addDefaultCase(I)})}let h=P=>P,S=new Map,m;function v(P,w){return m||(m=y()),m(P,w)}function R(){return m||(m=y()),m.getInitialState()}function E(P,w=!1){function I(F){let k=F[P];return typeof k>"u"&&w&&(k=R()),k}function j(F=h){let k=lc(S,w,()=>new WeakMap);return lc(k,F,()=>{let O={};for(let[T,M]of Object.entries(n.selectors??{}))O[T]=bg(M,F,R,w);return O})}return{reducerPath:P,getSelectors:j,get selectors(){return j(I)},selectSlice:I}}let b={name:i,reducer:v,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:R,...E(o),injectInto(P,{reducerPath:w,...I}={}){let j=w??o;return P.inject({reducerPath:j,reducer:v},I),{...b,...E(j,!0)}}};return b}}function bg(e,t,r,n){function i(o,...s){let u=t(o);return typeof u>"u"&&n&&(u=r()),e(u,...s)}return i.unwrapped=e,i}var Ft=Cg();function wg(){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 Rg({type:e,reducerName:t,createNotation:r},n,i){let o,s;if("reducer"in n){if(r&&!Eg(n))throw new Error(Ue(17));o=n.reducer,s=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?Q(e,s):Q(e))}function xg(e){return e._reducerDefinitionType==="asyncThunk"}function Eg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Ig({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Ue(18));let{payloadCreator:o,fulfilled:s,pending:u,rejected:c,settled:a,options:y}=r,h=i(e,o,y);n.exposeAction(t,h),s&&n.addCase(h.fulfilled,s),u&&n.addCase(h.pending,u),c&&n.addCase(h.rejected,c),a&&n.addMatcher(h.settled,a),n.exposeCaseReducer(t,{fulfilled:s||wn,pending:u||wn,rejected:c||wn,settled:a||wn})}function wn(){}var Sc="listener",vc="completed",Ac="cancelled",zw=`task-${Ac}`,Gw=`task-${vc}`,Ww=`${Sc}-${Ac}`,Yw=`${Sc}-${vc}`;var{assign:Cc}=Object;var Ao="listenerMiddleware";var kg=Cc(Q(`${Ao}/add`),{withTypes:()=>kg}),Kw=Q(`${Ao}/removeAll`),Pg=Cc(Q(`${Ao}/remove`),{withTypes:()=>Pg});var Jw=Symbol.for("rtk-state-proxy-original");function Ue(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. `}g();d();f();p();var ee=new W({required:!0,emptyAllowed:!1}),ge=new W({required:!1,emptyAllowed:!1}),Ve=new W({required:!0,emptyAllowed:!0}),cR=new W({required:!1,emptyAllowed:!0}),bc=new Ze({each:ee,required:!0}),wc=new W({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Rc=new W({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),uR=new W({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Og=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Co=(e,t)=>{if("required"in t)return{payload:new Le({value:t}).validate({value:e}).value};let i=new ce({options:{required:!0},values:t}).validate(e);if(i)throw new Ji(i);return{payload:e}},z=(e,t)=>{try{return Co(e,t)}catch(r){return{payload:e,error:Og(r)}}};var kn=(e,t,r,n)=>{let i=`Check the options of ${n}`;return Fg(e,t,r,i,"Controller initialization error")},Fg=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,i),o}};var Pn=Q("caseAssistConfiguration/set",e=>z(e,{caseAssistId:ee,locale:ge,proxyBaseUrl:new W({required:!1,url:!0})}));g();d();f();p();g();d();f();p();var xc=()=>({caseAssistId:"",locale:"en-US"});var ut=fe(xc(),e=>{e.addCase(Pn,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});g();d();f();p();g();d();f();p();g();d();f();p();var Ec={q:new W,enableQuerySyntax:new ye,aq:new W,cq:new W,firstResult:new Re({min:0}),numberOfResults:new Re({min:0}),sortCriteria:new W,f:new ce,fExcluded:new ce,cf:new ce,nf:new ce,mnf:new ce,df:new ce,debug:new ye,sf:new ce,tab:new W,af:new ce};var On=Q("searchParameters/restore",e=>z(e,Ec)),Ic=Q("searchParameters/restoreTab",e=>z(e,ee));g();d();f();p();var kc=Q("debug/enable"),Pc=Q("debug/disable");g();d();f();p();var Fn=()=>!1;var Oc=fe(Fn(),e=>{e.addCase(kc,()=>!0).addCase(Pc,()=>!1).addCase(On,(t,r)=>r.payload.debug??t)});g();d();f();p();var Tn=Q("searchHub/set",e=>z(e,new W({required:!0,emptyAllowed:!0})));g();d();f();p();g();d();f();p();g();d();f();p();var Jt="3.29.2-pre.7fbcdbbb29",Fc=["@coveo/atomic","@coveo/quantic"];var bo=()=>ge,Tc=()=>ee,Tt=Q("configuration/updateBasicConfiguration",e=>z(e,{accessToken:ge,environment:new W({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:ge})),Dn=Q("configuration/updateSearchConfiguration",e=>z(e,{proxyBaseUrl:new W({required:!1,url:!0}),pipeline:new W({required:!1,emptyAllowed:!0}),searchHub:ge,timezone:ge,locale:ge,authenticationProviders:new Ze({required:!1,each:ee})})),Tg={enabled:new ye({default:!0}),originContext:bo(),originLevel2:bo(),originLevel3:bo(),proxyBaseUrl:new W({required:!1,url:!0}),runtimeEnvironment:new xt,anonymous:new ye({default:!1}),deviceId:ge,userDisplayName:ge,documentLocation:ge,trackingId:Rc,analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ce({options:{required:!1},values:Fc.reduce((e,t)=>(e[t]=wc,e),{})})},qn=Q("configuration/updateAnalyticsConfiguration",e=>z(e,Tg)),jn=Q("configuration/analytics/disable"),Mn=Q("configuration/analytics/enable"),Dc=Q("configuration/analytics/originlevel2",e=>z(e,{originLevel2:Tc()})),qc=Q("configuration/analytics/originlevel3",e=>z(e,{originLevel3:Tc()}));g();d();f();p();var Dg=Q("history/undo"),qg=Q("history/redo"),He=Q("history/snapshot"),Lx=oe("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Dg()),yield t(Nn())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),Ux=oe("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(qg()),yield t(Nn())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Nn=oe("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());g();d();f();p();var Xt=()=>"default";var jc=fe(Xt(),e=>{e.addCase(Tn,(t,r)=>r.payload).addCase(Nn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Dn,(t,r)=>r.payload.searchHub||t)});g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();var Mc=/^(?:[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 jg(e){return typeof e=="string"&&Mc.test(e)}var wo=jg;g();d();f();p();var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function Nc(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}g();d();f();p();var Ro,Mg=new Uint8Array(16);function xo(){if(!Ro){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ro=crypto.getRandomValues.bind(crypto)}return Ro(Mg)}g();d();f();p();g();d();f();p();var Ng=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Eo={randomUUID:Ng};function _g(e,t,r){if(Eo.randomUUID&&!t&&!e)return Eo.randomUUID();e=e||{};let n=e.random??e.rng?.()??xo();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 i=0;i<16;++i)t[r+i]=n[i];return t}return Nc(n)}var Io=_g;g();d();f();p();function _c(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Lg({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:o,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(i,o,r))}var Lc="visitorId";function Ug(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(Lc),i=n&&wo(n)?n:t.generateUUID();return r.setItem(Lc,i),i}}}var $c="1.2.6",ko=128,Hc=192,Uc=224,Vc=240,Vg=248;function Qg(e){return(e&Vg)===Vc?4:(e&Vc)===Uc?3:(e&Uc)===Hc?2:1}function Bg(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&ko)!=ko)break;if(r-=3,(n&Hc)!=ko){t-r>=Qg(n)*3&&(r=t);break}}return e.substring(0,r)}function $g(e){let{trackingId:t}=e;return{trackingId:t}}function Hg(e){return(e.source||[]).concat([`relay@${$c}`])}function zc(e,t,r,n){let{getReferrer:i,getLocation:o,getUserAgent:s}=r,u=$g(t),c=n.getClientId();return Object.freeze({type:e,config:u,ts:Date.now(),source:Hg(t),clientId:c,userAgent:s(),referrer:Qc(i()),location:Qc(o())})}function Qc(e){return e!==null?Bg(e,1024):null}function zg(e,t,r,n,i){return{...t,meta:zc(e,r,n,i)}}var Gg="*";function Wg(){let e=[];function t({type:c,callback:a}){return e.findIndex(y=>y.type===c&&y.callback===a)}function r(c,a){return c.type==="*"||a===c.type}function n(c){return t(c)<0&&e.push(c),()=>u(c.type,c.callback)}function i(c){e.forEach(a=>{if(r(a,c.meta.type))try{a.callback(c)}catch(y){console.error(y)}})}function o(c){if(c===Gg)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===c&&e.splice(a,1)}function s(c){let a=t(c);a>=0&&e.splice(a,1)}function u(c,a){a?s({type:c,callback:a}):o(c)}return{add:n,call:i,remove:u}}function Bc({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 Yg(e){let t=Bc(e);return{get:()=>t,update:r=>{t=Bc({...t,...r})}}}var Po=Kg();function Kg(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,i=document.cookie.split(";");for(let o of i){let s=o.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,i){let o=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+i).toUTCString()}`,u=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${s}${u};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Jg(){return{getItem(e){return Po.getItem(e)||localStorage.getItem(e)},removeItem(e){Po.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Po.setItem(e,t,31556952e3)}}}function Xg(){let e=document.referrer;return e===""?null:e}function Zg(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(_c().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:()=>Xg(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Io(),storage:Jg()}}function em(){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 tm(){return{getItem(){return null},removeItem(){},setItem(){}}}function rm(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:tm()}}function nm(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=rm();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&im()&&em()?Zg():n}function im(){try{return typeof window=="object"}catch{return!1}}function om(e){return{get:()=>Object.freeze(nm(e))}}function Gc(e){let t=Yg(e),r=Wg(),n=om(t),i=Ug(n);return{emit:(o,s)=>{let u=t.get(),c=n.get(),a=zg(o,s,u,c,i);return Lg({config:u,environment:c,event:a,listenerManager:r})},getMeta:o=>zc(o,t.get(),n.get(),i),on:(o,s)=>r.add({type:o,callback:s}),off:(o,s)=>r.remove(o,s),updateConfig:o=>t.update(o),version:$c}}g();d();f();p();var Zt=ae(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Jt}`));var Vr=ae(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Zt(e.configuration.analytics),(e,t)=>sm(t),(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:o},s,u)=>Gc({mode:o?"emit":"disabled",url:i??cn(e,t),token:r,trackingId:n??null,source:s,environment:u})),sm=e=>{if(!e)return;let t=e();return{getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent,generateUUID:()=>t.clientId}};g();d();f();p();g();d();f();p();var Oo=(e,t)=>{let{referrer:r,userAgent:n,location:i,clientId:o}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:i,clientId:o}};g();d();f();p();var am=ae(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:i}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(i&&{lq:i})}});g();d();f();p();var Qr=(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:Zt(e)}});g();d();f();p();var cm=ae(e=>e.context,e=>e);g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();function rt(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 i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function D(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(y){try{a(n.next(y))}catch(h){s(h)}}function c(y){try{a(n.throw(y))}catch(h){s(h)}}function a(y){y.done?o(y.value):i(y.value).then(u,c)}a((n=n.apply(e,t||[])).next())})}var re;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(re||(re={}));function Do(){return typeof window<"u"}function zo(){return typeof navigator<"u"}function er(){return typeof document<"u"}function qo(){try{return typeof localStorage<"u"}catch{return!1}}function um(){try{return typeof sessionStorage<"u"}catch{return!1}}function au(){return zo()&&navigator.cookieEnabled}var lm=[re.click,re.custom,re.search,re.view],dm=(e,t)=>lm.indexOf(e)!==-1?Object.assign({language:er()?document.documentElement.lang:"unknown",userAgent:zo()?navigator.userAgent:"unknown"},t):t,$r=class e{static set(t,r,n){var i,o,s,u;n&&(o=new Date,o.setTime(o.getTime()+n)),u=window.location.hostname,u.indexOf(".")===-1?Wc(t,r,o):(s=u.split("."),i=s[s.length-2]+"."+s[s.length-1],Wc(t,r,o,i))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){var o=n[i];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function Wc(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function pm(){return qo()?localStorage:au()?new Hr:um()?sessionStorage:new rr}var Hr=class e{getItem(t){return $r.get(`${e.prefix}${t}`)}removeItem(t){$r.erase(`${e.prefix}${t}`)}setItem(t,r,n){$r.set(`${e.prefix}${t}`,r,n)}};Hr.prefix="coveo_";var jo=class{constructor(){this.cookieStorage=new Hr}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)}},rr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},_n="__coveo.analytics.history",fm=20,gm=1e3*60,mm=75,Vn=class{constructor(t){this.store=t||pm()}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(_n);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(_n);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(_n,JSON.stringify(t.slice(0,fm)))}catch{}}clear(){try{this.store.removeItem(_n)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,i)=>(i.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,mm)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>gm:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:i,value:o}=r;return{name:n,time:i,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:i}=t;return r&&typeof i=="string"&&r.toLowerCase()==="query"&&i.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var ym=(e,t)=>D(void 0,void 0,void 0,function*(){return e===re.view?(yield hm(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),hm=e=>D(void 0,void 0,void 0,function*(){let t=new Vn,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Ln,Sm=new Uint8Array(16);function vm(){if(!Ln&&(Ln=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ln))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ln(Sm)}var Am=/^(?:[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 Qn(e){return typeof e=="string"&&Am.test(e)}var Ae=[];for(let e=0;e<256;++e)Ae.push((e+256).toString(16).slice(1));function cu(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]]).toLowerCase()}function Cm(e){if(!Qn(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 bm(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var wm="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Rm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function xm(e,t,r){function n(i,o,s,u){var c;if(typeof i=="string"&&(i=bm(i)),typeof o=="string"&&(o=Cm(o)),((c=o)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(o),a.set(i,o.length),a=r(a),a[6]=a[6]&15|t,a[8]=a[8]&63|128,s){u=u||0;for(let y=0;y<16;++y)s[u+y]=a[y];return s}return cu(a)}try{n.name=e}catch{}return n.DNS=wm,n.URL=Rm,n}var Em=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Yc={randomUUID:Em};function Dt(e,t,r){if(Yc.randomUUID&&!t&&!e)return Yc.randomUUID();e=e||{};let n=e.random||(e.rng||vm)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return cu(n)}function Im(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 Fo(e,t){return e<<t|e>>>32-t}function km(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let s=unescape(encodeURIComponent(e));e=[];for(let u=0;u<s.length;++u)e.push(s.charCodeAt(u))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,i=Math.ceil(n/16),o=new Array(i);for(let s=0;s<i;++s){let u=new Uint32Array(16);for(let c=0;c<16;++c)u[c]=e[s*64+c*4]<<24|e[s*64+c*4+1]<<16|e[s*64+c*4+2]<<8|e[s*64+c*4+3];o[s]=u}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let u=new Uint32Array(80);for(let m=0;m<16;++m)u[m]=o[s][m];for(let m=16;m<80;++m)u[m]=Fo(u[m-3]^u[m-8]^u[m-14]^u[m-16],1);let c=r[0],a=r[1],y=r[2],h=r[3],S=r[4];for(let m=0;m<80;++m){let v=Math.floor(m/20),R=Fo(c,5)+Im(v,a,y,h)+S+t[v]+u[m]>>>0;S=h,h=y,y=Fo(a,30)>>>0,a=c,c=R}r[0]=r[0]+c>>>0,r[1]=r[1]+a>>>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 Pm=xm("v5",80,km),Kc=Pm,uu="2.30.45",Jc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Br={pageview:"pageview",event:"event"},Bn=class{constructor({client:t,uuidGenerator:r=Dt}){this.client=t,this.uuidGenerator=r}},Mo=class extends Bn{constructor({client:t,uuidGenerator:r=Dt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Jc(window.location),this.lastReferrer=er()?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:er()?document.title:"",encoding:er()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},i={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),i),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:i,location:o}=this.getNextValues(t,r);this.lastReferrer=i,this.pageViewId=n,this.currentLocation=o,t===Br.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Br.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Br.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Br.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=i=>i.replace(/^\/?(.*)$/,"/$1");return`${(i=>i.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Jc(window.location)}},lt=class e{constructor(t,r){if(!Qn(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(i=>new RegExp(i.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,i]=r;if(n.length!==32||isNaN(parseInt(i)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Qn(o)?new e(o,Number.parseInt(i)*1e3):null}};lt.cvo_cid="cvo_cid";lt.expirationTime=120;var No=class extends Bn{constructor({client:t,uuidGenerator:r=Dt}){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(lt.cvo_cid,new lt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};No.Id="link";var Me=Object.keys;function Un(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var To=128,lu=192,Xc=224,Zc=240;function Om(e){return(e&248)===Zc?4:(e&Zc)===Xc?3:(e&Xc)===lu?2:1}function Fm(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&To)!=To)break;if(r-=3,(n&lu)!=To){t-r>=Om(n)*3&&(r=t);break}}return e.substring(0,r)}var _o={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"},Tm=Me(_o).map(e=>_o[e]),Dm=[...Tm].join("|"),qm=new RegExp(`^(${Dm}$)`),jm={svcAction:"svc_action",svcActionData:"svc_action_data"},Mm=e=>Me(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=_o[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Nm=e=>qm.test(e),_m=[Nm],eu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},tu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ce={action:"pa",list:"pal",listSource:"pls"},$n={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Lm=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Lo={id:"quoteId",affiliation:"quoteAffiliation"},Uo={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Um={add:Ce,bookmark_add:Ce,bookmark_remove:Ce,click:Ce,checkout:Ce,checkout_option:Ce,detail:Ce,impression:Ce,remove:Ce,refund:Object.assign(Object.assign({},Ce),$n),purchase:Object.assign(Object.assign({},Ce),$n),quickview:Ce,quote:Object.assign(Object.assign({},Ce),Lo),review:Object.assign(Object.assign({},Ce),Uo)},Vm=Me(eu).map(e=>eu[e]),Qm=Me(tu).map(e=>tu[e]),Bm=Me(Ce).map(e=>Ce[e]),$m=Me($n).map(e=>$n[e]),Hm=Me(Uo).map(e=>Uo[e]),zm=Me(Lo).map(e=>Lo[e]),Gm=[...Vm,"custom"].join("|"),Wm=[...Qm,"custom"].join("|"),du="(pr[0-9]+)",pu="(il[0-9]+pi[0-9]+)",Ym=new RegExp(`^${du}(${Gm})$`),Km=new RegExp(`^(${pu}(${Wm}))|(il[0-9]+nm)$`),Jm=new RegExp(`^(${Bm.join("|")})$`),Xm=new RegExp(`^(${$m.join("|")})$`),Zm=new RegExp(`^${du}custom$`),ey=new RegExp(`^${pu}custom$`),ty=new RegExp(`^(${[...Lm,...Hm,...zm].join("|")})$`),ry=e=>Ym.test(e),ny=e=>Km.test(e),iy=e=>Jm.test(e),oy=e=>Xm.test(e),sy=e=>ty.test(e),ay=[ny,ry,iy,oy,sy],cy=[Zm,ey],uy={anonymizeIp:"aip"},ly={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},dy={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},py=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],fy=Object.assign(Object.assign(Object.assign(Object.assign({},uy),ly),dy),py.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Vo=Object.assign(Object.assign({},fy),jm),gy=e=>{let t=!!e.action&&Um[e.action]||{};return Me(e).reduce((r,n)=>{let i=t[n]||Vo[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})},{})},my=Me(Vo).map(e=>Vo[e]),yy=e=>my.indexOf(e)!==-1,hy=e=>e==="custom",Sy=e=>[...ay,..._m,yy,hy].some(t=>t(e)),vy=e=>Me(e).reduce((t,r)=>{let n=Ay(r);return n?Object.assign(Object.assign({},t),Cy(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Ay=e=>{let t;return[...cy].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Cy=(e,t)=>Me(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Qo=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:i}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:s,payload:u}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,i),c=this.encodeForEventType(t,u),a=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(s,a)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let i=t,o=r;if(n){let s=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:u,body:c}=s;i=u||t;try{o=JSON.parse(c)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:o,url:i}})}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,i=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",i?`visitorId=${i}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[re.click,re.custom,re.search,re.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let i=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(i=`access_token=${encodeURIComponent(n)}&${i}`),i}},Bo=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()})}},ru=A.fetch,Hn=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:i,preprocessRequest:o}=this.opts,s=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",u={url:`${n}/analytics/${t}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},u),o?yield o(u,"analyticsFetch"):{}),{url:a}=c,y=rt(c,["url"]),h;try{h=yield ru(a,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&&i.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 ru(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[re.click,re.custom,re.search,re.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"})}},$o=class{constructor(t,r){qo()&&au()?this.storage=new jo:qo()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new rr),this.client=new Hn(t),this.beaconClient=new Qo(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:i,payload:o}of n)this.beaconClient.sendEvent(i,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ho=class{constructor(t,r){this.storage=r||new rr,this.client=new Hn(t)}getClientDependingOnEventType(t){return this.client}},zn=class{constructor(){this.storage=new rr,this.client=new Bo}getClientDependingOnEventType(t){return this.client}},by="xx",wy=e=>e?.startsWith(by)||!1,Ry=`
26
+ `;return new Xi(r)}var Xi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},_e=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let i in this.definition){let o=this.definition[i].validate(r[i]);o&&n.push(`${i}: ${o}`)}if(n.length)throw xf(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}},Rt=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&Y(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 Bt(e){return e===void 0}function Ef(e){return e===null}function Y(e){return Bt(e)||Ef(e)}var he=class{constructor(e={}){se(this,"value");this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t||(If(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function If(e){return Bt(e)||Ma(e)}function Ma(e){return typeof e=="boolean"}var Re=class{constructor(e={}){se(this,"value");this.config=e,this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t||(kf(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 kf(e){return Bt(e)||Na(e)}function Na(e){return typeof e=="number"&&!Number.isNaN(e)}var Pf=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,W=class{constructor(e={}){se(this,"value");se(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Rt(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:o}=this.config,s=this.value.validate(e);if(s)return s;if(Bt(e))return null;if(!_a(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}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:o&&!(Pf.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 _a(e){return Object.prototype.toString.call(e)==="[object String]"}var ce=class{constructor(e={}){se(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Bt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!La(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&Y(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],o=n.validate(i);o!==null&&(t+=` ${o}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function La(e){return e!==void 0&&typeof e=="object"}var Xe=class{constructor(e={}){se(this,"value");this.config=e,this.value=new Rt(this.config)}validate(e){if(!Y(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(Y(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&&Y(n)&&(r=`value is null or undefined: ${e.join(",")}`);let i=this.validatePrimitiveValue(n,this.config.each);i!==null&&(r+=` ${i}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ma(e)||_a(e)||Na(e)||La(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ua(e){return Array.isArray(e)}var Zi=class{constructor(e){se(this,"value");this.config=e,this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Bt(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}};g();d();f();p();var un=e=>e;g();d();f();p();g();d();f();p();g();d();f();p();var $t=class{constructor(t){se(this,"_basePath");se(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}};g();d();f();p();function eo(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...o}=e;return o}var to=e=>{let{response:t}=e;return t.body?Of(e):Ff(t)},Of=e=>Df(e)?qf(e):Tf(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Ff=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Tf(e){return e.body.statusCode!==void 0}function Df(e){return e.body.exception!==void 0}var qf=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});g();d();f();p();function Va(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}g();d();f();p();var ro=(e,t,r,n)=>{let i=new $t(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};var Qa=(e,t)=>{let r=new $t(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},no=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield at.call({...ro(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:eo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Va(r),i=yield r.arrayBuffer(),s=new TextDecoder(n).decode(i);return jf(s)?{success:s}:{error:to({response:r,body:s})}});return function no(_x,_x2){return _ref2.apply(this,arguments)}}();function jf(e){return typeof e=="string"}g();d();f();p();function Mf(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Nf(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ln(e,t){if(t&&e.name==="AbortError")return{error:Nf(e)};if(e instanceof wt)return{error:Mf(e)};throw e}g();d();f();p();g();d();f();p();var dn=(e,t,r,n,i={})=>{_f(e);let o=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=Lf(i),u=s?`${o}?${s}`:o;return{accessToken:e.accessToken,method:t,contentType:r,url:u,origin:"caseAssistApiFetch"}},pn=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>(t[r]=e[r],t),{}),fn=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>(t[r]=e[r].value,t),{}),_f=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},Lf=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var Ba=e=>{let t=e.debug?{debug:"1"}:{};return{...dn(e,"POST","application/json","/classify",t),requestParams:Uf(e)}},Uf=e=>({clientId:e.clientId,locale:e.locale,fields:pn(e.fields)});g();d();f();p();var $a=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...dn(e,"POST","application/json","/documents/suggest",t),requestParams:Vf(e)}},Vf=e=>({clientId:e.clientId,locale:e.locale,fields:pn(e.fields),context:e.context,analytics:e.analytics});var gn=class{constructor(t){this.options=t}getCaseClassifications(t){var _this=this;return _asyncToGenerator(function*(){let r=yield at.call({...Ba(t),..._this.options});if(r instanceof Error)return ln(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}getDocumentSuggestions(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield at.call({...$a(t),..._this2.options});if(r instanceof Error)return ln(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this3=this;return _asyncToGenerator(function*(){return no(t,_this3.options)})()}};g();d();f();p();g();d();f();p();g();d();f();p();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 Qf=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ha=Qf,io=()=>Math.random().toString(36).substring(7).split("").join("."),Bf={INIT:`@@redux/INIT${io()}`,REPLACE:`@@redux/REPLACE${io()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${io()}`},mn=Bf;function Qe(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 oo(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(oo)(e,t)}let n=e,i=t,o=new Map,s=o,u=0,c=!1;function a(){s===o&&(s=new Map,o.forEach((E,b)=>{s.set(b,E)}))}function h(){if(c)throw new Error(ye(3));return i}function y(E){if(typeof E!="function")throw new Error(ye(4));if(c)throw new Error(ye(5));let b=!0;a();let P=u++;return s.set(P,E),function(){if(b){if(c)throw new Error(ye(6));b=!1,a(),s.delete(P),o=null}}}function S(E){if(!Qe(E))throw new Error(ye(7));if(typeof E.type>"u")throw new Error(ye(8));if(typeof E.type!="string")throw new Error(ye(17));if(c)throw new Error(ye(9));try{c=!0,i=n(i,E)}finally{c=!1}return(o=s).forEach(P=>{P()}),E}function m(E){if(typeof E!="function")throw new Error(ye(10));n=E,S({type:mn.REPLACE})}function v(){let E=y;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(ye(11));function P(){let I=b;I.next&&I.next(h())}return P(),{unsubscribe:E(P)}},[Ha](){return this}}}return S({type:mn.INIT}),{dispatch:S,subscribe:y,getState:h,replaceReducer:m,[Ha]:v}}function $f(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:mn.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:mn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function Ht(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let u=t[s];typeof e[u]=="function"&&(r[u]=e[u])}let n=Object.keys(r),i,o;try{$f(r)}catch(s){o=s}return function(u={},c){if(o)throw o;let a=!1,h={};for(let y=0;y<n.length;y++){let S=n[y],m=r[S],v=u[S],R=m(v,c);if(typeof R>"u"){let E=c&&c.type;throw new Error(ye(14))}h[S]=R,a=a||R!==v}return a=a||n.length!==Object.keys(u).length,a?h:u}}function zt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function za(...e){return t=>(r,n)=>{let i=t(r,n),o=()=>{throw new Error(ye(15))},s={getState:i.getState,dispatch:(c,...a)=>o(c,...a)},u=e.map(c=>c(s));return o=zt(...u)(i.dispatch),{...i,dispatch:o}}}function hn(e){return Qe(e)&&"type"in e&&typeof e.type=="string"}g();d();f();p();var ho=Symbol.for("immer-nothing"),Or=Symbol.for("immer-draftable"),xe=Symbol.for("immer-state");function Se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Et=Object.getPrototypeOf;function Pe(e){return!!e&&!!e[xe]}function Ee(e){return e?Ja(e)||Array.isArray(e)||!!e[Or]||!!e.constructor?.[Or]||Gt(e)||Mr(e):!1}var Hf=Object.prototype.constructor.toString();function Ja(e){if(!e||typeof e!="object")return!1;let t=Et(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Hf}function yo(e){return Pe(e)||Se(15,e),e[xe].base_}function Fr(e,t){It(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function It(e){let t=e[xe];return t?t.type_:Array.isArray(e)?1:Gt(e)?2:Mr(e)?3:0}function Tr(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function so(e,t){return It(e)===2?e.get(t):e[t]}function Xa(e,t,r){let n=It(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function zf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Gt(e){return e instanceof Map}function Mr(e){return e instanceof Set}function xt(e){return e.copy_||e.base_}function uo(e,t){if(Gt(e))return new Map(e);if(Mr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ja(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[xe];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){let s=i[o],u=n[s];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[s]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[s]})}return Object.create(Et(e),n)}else{let n=Et(e);if(n!==null&&r)return{...e};let i=Object.create(n);return Object.assign(i,e)}}function An(e,t=!1){return Cn(e)||Pe(e)||!Ee(e)||(It(e)>1&&Object.defineProperties(e,{set:{value:yn},add:{value:yn},clear:{value:yn},delete:{value:yn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>An(r,!0))),e}function yn(){Se(2)}function Cn(e){return Object.isFrozen(e)}var lo={};function kt(e){let t=lo[e];return t||Se(0,e),t}function Gf(e,t){lo[e]||(lo[e]=t)}var Dr;function Za(){return Dr}function Wf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ga(e,t){t&&(kt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function po(e){fo(e),e.drafts_.forEach(Yf),e.drafts_=null}function fo(e){e===Dr&&(Dr=e.parent_)}function Wa(e){return Dr=Wf(Dr,e)}function Yf(e){let t=e[xe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ya(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[xe].modified_&&(po(t),Se(4)),Ee(e)&&(e=Sn(t,e),t.parent_||vn(t,e)),t.patches_&&kt("Patches").generateReplacementPatches_(r[xe].base_,e,t.patches_,t.inversePatches_)):e=Sn(t,r,[]),po(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ho?e:void 0}function Sn(e,t,r){if(Cn(t))return t;let n=t[xe];if(!n)return Fr(t,(i,o)=>Ka(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return vn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let i=n.copy_,o=i,s=!1;n.type_===3&&(o=new Set(i),i.clear(),s=!0),Fr(o,(u,c)=>Ka(e,n,i,u,c,r,s)),vn(e,i,!1),r&&e.patches_&&kt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Ka(e,t,r,n,i,o,s){if(Pe(i)){let u=o&&t&&t.type_!==3&&!Tr(t.assigned_,n)?o.concat(n):void 0,c=Sn(e,i,u);if(Xa(r,n,c),Pe(c))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(Ee(i)&&!Cn(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Sn(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Gt(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&vn(e,i)}}function vn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&An(t,r)}function Kf(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Za(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=So;r&&(i=[n],o=qr);let{revoke:s,proxy:u}=Proxy.revocable(i,o);return n.draft_=u,n.revoke_=s,u}var So={get(e,t){if(t===xe)return e;let r=xt(e);if(!Tr(r,t))return Jf(e,r,t);let n=r[t];return e.finalized_||!Ee(n)?n:n===ao(e.base_,t)?(co(e),e.copy_[t]=mo(n,e)):n},has(e,t){return t in xt(e)},ownKeys(e){return Reflect.ownKeys(xt(e))},set(e,t,r){let n=ec(xt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let i=ao(xt(e),t),o=i?.[xe];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(zf(r,i)&&(r!==void 0||Tr(e.base_,t)))return!0;co(e),go(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 ao(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,co(e),go(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=xt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Se(11)},getPrototypeOf(e){return Et(e.base_)},setPrototypeOf(){Se(12)}},qr={};Fr(So,(e,t)=>{qr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qr.deleteProperty=function(e,t){return qr.set.call(this,e,t,void 0)};qr.set=function(e,t,r){return So.set.call(this,e[0],t,r,e[0])};function ao(e,t){let r=e[xe];return(r?xt(r):e)[t]}function Jf(e,t,r){let n=ec(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function ec(e,t){if(!(t in e))return;let r=Et(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Et(r)}}function go(e){e.modified_||(e.modified_=!0,e.parent_&&go(e.parent_))}function co(e){e.copy_||(e.copy_=uo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let s=this;return function(c=o,...a){return s.produce(c,h=>r.call(this,h,...a))}}typeof r!="function"&&Se(6),n!==void 0&&typeof n!="function"&&Se(7);let i;if(Ee(t)){let o=Wa(this),s=mo(t,void 0),u=!0;try{i=r(s),u=!1}finally{u?po(o):fo(o)}return Ga(o,n),Ya(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===ho&&(i=void 0),this.autoFreeze_&&An(i,!0),n){let o=[],s=[];kt("Patches").generateReplacementPatches_(t,i,o,s),n(o,s)}return i}else Se(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...u)=>this.produceWithPatches(s,c=>t(c,...u));let n,i;return[this.produce(t,r,(s,u)=>{n=s,i=u}),n,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ee(e)||Se(8),Pe(e)&&(e=tc(e));let t=Wa(this),r=mo(e,void 0);return r[xe].isManual_=!0,fo(t),r}finishDraft(e,t){let r=e&&e[xe];(!r||!r.isManual_)&&Se(9);let{scope_:n}=r;return Ga(n,t),Ya(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let n=kt("Patches").applyPatches_;return Pe(e)?n(e,t):this.produce(e,i=>n(i,t))}};function mo(e,t){let r=Gt(e)?kt("MapSet").proxyMap_(e,t):Mr(e)?kt("MapSet").proxySet_(e,t):Kf(e,t);return(t?t.scope_:Za()).drafts_.push(r),r}function tc(e){return Pe(e)||Se(10,e),rc(e)}function rc(e){if(!Ee(e)||Cn(e))return e;let t=e[xe],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=uo(e,t.scope_.immer_.useStrictShallowCopy_)}else r=uo(e,!0);return Fr(r,(n,i)=>{Xa(r,n,rc(i))}),t&&(t.finalized_=!1),r}function nc(){let t="replace",r="add",n="remove";function i(S,m,v,R){switch(S.type_){case 0:case 2:return s(S,m,v,R);case 1:return o(S,m,v,R);case 3:return u(S,m,v,R)}}function o(S,m,v,R){let{base_:E,assigned_:b}=S,P=S.copy_;P.length<E.length&&([E,P]=[P,E],[v,R]=[R,v]);for(let w=0;w<E.length;w++)if(b[w]&&P[w]!==E[w]){let I=m.concat([w]);v.push({op:t,path:I,value:y(P[w])}),R.push({op:t,path:I,value:y(E[w])})}for(let w=E.length;w<P.length;w++){let I=m.concat([w]);v.push({op:r,path:I,value:y(P[w])})}for(let w=P.length-1;E.length<=w;--w){let I=m.concat([w]);R.push({op:n,path:I})}}function s(S,m,v,R){let{base_:E,copy_:b}=S;Fr(S.assigned_,(P,w)=>{let I=so(E,P),j=so(b,P),F=w?Tr(E,P)?t:r:n;if(I===j&&F===t)return;let k=m.concat(P);v.push(F===n?{op:F,path:k}:{op:F,path:k,value:j}),R.push(F===r?{op:n,path:k}:F===n?{op:r,path:k,value:y(I)}:{op:t,path:k,value:y(I)})})}function u(S,m,v,R){let{base_:E,copy_:b}=S,P=0;E.forEach(w=>{if(!b.has(w)){let I=m.concat([P]);v.push({op:n,path:I,value:w}),R.unshift({op:r,path:I,value:w})}P++}),P=0,b.forEach(w=>{if(!E.has(w)){let I=m.concat([P]);v.push({op:r,path:I,value:w}),R.unshift({op:n,path:I,value:w})}P++})}function c(S,m,v,R){v.push({op:t,path:[],value:m===ho?void 0:m}),R.push({op:t,path:[],value:S})}function a(S,m){return m.forEach(v=>{let{path:R,op:E}=v,b=S;for(let j=0;j<R.length-1;j++){let F=It(b),k=R[j];typeof k!="string"&&typeof k!="number"&&(k=""+k),(F===0||F===1)&&(k==="__proto__"||k==="constructor")&&Se(19),typeof b=="function"&&k==="prototype"&&Se(19),b=so(b,k),typeof b!="object"&&Se(18,R.join("/"))}let P=It(b),w=h(v.value),I=R[R.length-1];switch(E){case t:switch(P){case 2:return b.set(I,w);case 3:Se(16);default:return b[I]=w}case r:switch(P){case 1:return I==="-"?b.push(w):b.splice(I,0,w);case 2:return b.set(I,w);case 3:return b.add(w);default:return b[I]=w}case n:switch(P){case 1:return b.splice(I,1);case 2:return b.delete(I);case 3:return b.delete(v.value);default:return delete b[I]}default:Se(17,E)}}),S}function h(S){if(!Ee(S))return S;if(Array.isArray(S))return S.map(h);if(Gt(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,h(R)]));if(Mr(S))return new Set(Array.from(S).map(h));let m=Object.create(Et(S));for(let v in S)m[v]=h(S[v]);return Tr(S,Or)&&(m[Or]=S[Or]),m}function y(S){return Pe(S)?h(S):S}Gf("Patches",{applyPatches_:a,generatePatches_:i,generateReplacementPatches_:c})}var jr=new Xf,Ze=jr.produce,bn=jr.produceWithPatches.bind(jr);var vo=jr.applyPatches.bind(jr);g();d();f();p();function Zf(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tg(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 ic=e=>Array.isArray(e)?e:[e];function rg(e){let t=Array.isArray(e[0])?e[0]:e;return tg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ng(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var yw=Symbol();var Sw=Object.getPrototypeOf({});var ig=class{constructor(e){this.value=e}deref(){return this.value}},og=typeof WeakRef<"u"?WeakRef:ig,sg=0,oc=1;function wn(){return{s:sg,v:void 0,o:null,p:null}}function Wt(e,t={}){let r=wn(),{resultEqualityCheck:n}=t,i,o=0;function s(){let u=r,{length:c}=arguments;for(let y=0,S=c;y<S;y++){let m=arguments[y];if(typeof m=="function"||typeof m=="object"&&m!==null){let v=u.o;v===null&&(u.o=v=new WeakMap);let R=v.get(m);R===void 0?(u=wn(),v.set(m,u)):u=R}else{let v=u.p;v===null&&(u.p=v=new Map);let R=v.get(m);R===void 0?(u=wn(),v.set(m,u)):u=R}}let a=u,h;if(u.s===oc)h=u.v;else if(h=e.apply(null,arguments),o++,n){let y=i?.deref?.()??i;y!=null&&n(y,h)&&(h=y,o!==0&&o--),i=typeof h=="object"&&h!==null||typeof h=="function"?new og(h):h}return a.s=oc,a.v=h,h}return s.clearCache=()=>{r=wn(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function sc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,s=0,u,c={},a=i.pop();typeof a=="object"&&(c=a,a=i.pop()),Zf(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let h={...r,...c},{memoize:y,memoizeOptions:S=[],argsMemoize:m=Wt,argsMemoizeOptions:v=[],devModeChecks:R={}}=h,E=ic(S),b=ic(v),P=rg(i),w=y(function(){return o++,a.apply(null,arguments)},...E),I=!0,j=m(function(){s++;let k=ng(P,arguments);return u=w.apply(null,k),u},...b);return Object.assign(j,{resultFunc:a,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:y,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var ae=sc(Wt),ag=Object.assign((e,t=ae)=>{eg(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(o=>e[o]);return t(n,(...o)=>o.reduce((s,u,c)=>(s[r[c]]=u,s),{}))},{withTypes:()=>ag});g();d();f();p();function ac(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var cc=ac(),uc=ac;var cg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zt:zt.apply(null,arguments)},Mw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ug=e=>e&&typeof e.match=="function";function Q(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Le(0));return{type:e,payload:i.payload,...("meta"in i&&{meta:i.meta}),...("error"in i&&{error:i.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>hn(n)&&n.type===e,r}var gc=class Nr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Nr.prototype)}static get[Symbol.species](){return Nr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Nr(...t[0].concat(this)):new Nr(...t.concat(this))}};function lc(e){return Ee(e)?Ze(e,()=>{}):e}function dc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function lg(e){return typeof e=="boolean"}var dg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{},s=new gc;return r&&(lg(r)?s.push(cc):s.push(uc(r.extraArgument))),s},_r="RTK_autoBatch",Kt=()=>e=>({payload:e,meta:{[_r]:!0}}),pc=e=>t=>{setTimeout(t,e)},pg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,o=!1,s=!1,u=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:pc(10):e.type==="callback"?e.queueNotification:pc(e.timeout),a=()=>{s=!1,o&&(o=!1,u.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let y=()=>i&&h(),S=n.subscribe(y);return u.add(h),()=>{S(),u.delete(h)}},dispatch(h){try{return i=!h?.meta?.[_r],o=!i,o&&(s||(s=!0,c(a))),n.dispatch(h)}finally{i=!0}}})},fg=e=>function(r){let{autoBatch:n=!0}=r??{},i=new gc(e);return n&&i.push(pg(typeof n=="object"?n:void 0)),i};function mc(e){let t=dg(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Qe(r))u=Ht(r);else throw new Error(Le(1));let c;typeof n=="function"?c=n(t):c=t();let a=zt;i&&(a=cg({trace:!1,...(typeof i=="object"&&i)}));let h=za(...c),y=fg(h),S=typeof s=="function"?s(y):y(),m=a(...S);return oo(u,o,m)}function hc(e){let t={},r=[],n,i={addCase(o,s){let u=typeof o=="string"?o:o.type;if(!u)throw new Error(Le(28));if(u in t)throw new Error(Le(29));return t[u]=s,i},addMatcher(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function gg(e){return typeof e=="function"}function fe(e,t){let[r,n,i]=hc(t),o;if(gg(e))o=()=>lc(e());else{let u=lc(e);o=()=>u}function s(u=o(),c){let a=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return a.filter(h=>!!h).length===0&&(a=[i]),a.reduce((h,y)=>{if(y)if(Pe(h)){let m=y(h,c);return m===void 0?h:m}else{if(Ee(h))return Ze(h,S=>y(S,c));{let S=y(h,c);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},u)}return s.getInitialState=o,s}var yc=(e,t)=>ug(e)?e.match(t):e(t);function Be(...e){return t=>e.some(r=>yc(r,t))}function Yt(...e){return t=>e.every(r=>yc(r,t))}function xn(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 Lr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function En(...e){return e.length===0?t=>xn(t,["pending"]):Lr(e)?Be(...e.map(t=>t.pending)):En()(e[0])}function Pt(...e){return e.length===0?t=>xn(t,["rejected"]):Lr(e)?Be(...e.map(t=>t.rejected)):Pt()(e[0])}function Ur(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Yt(Pt(...e),t):Lr(e)?Yt(Pt(...e),t):Ur()(e[0])}function et(...e){return e.length===0?t=>xn(t,["fulfilled"]):Lr(e)?Be(...e.map(t=>t.fulfilled)):et()(e[0])}function In(...e){return e.length===0?t=>xn(t,["pending","fulfilled","rejected"]):Lr(e)?Be(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):In()(e[0])}var mg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",kn=(e=21)=>{let t="",r=e;for(;r--;)t+=mg[Math.random()*64|0];return t},hg=["name","message","stack","code"],Ao=class{constructor(e,t){se(this,"_type");this.payload=e,this.meta=t}},fc=class{constructor(e,t){se(this,"_type");this.payload=e,this.meta=t}},yg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of hg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},oe=(()=>{function e(t,r,n){let i=Q(t+"/fulfilled",(c,a,h,y)=>({payload:c,meta:{...(y||{}),arg:h,requestId:a,requestStatus:"fulfilled"}})),o=Q(t+"/pending",(c,a,h)=>({payload:void 0,meta:{...(h||{}),arg:a,requestId:c,requestStatus:"pending"}})),s=Q(t+"/rejected",(c,a,h,y,S)=>({payload:y,error:(n&&n.serializeError||yg)(c||"Rejected"),meta:{...(S||{}),arg:h,requestId:a,rejectedWithValue:!!y,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function u(c){return(a,h,y)=>{let S=n?.idGenerator?n.idGenerator(c):kn(),m=new l.AbortController,v,R;function E(P){R=P,m.abort()}let b=_asyncToGenerator(function*(){let P;try{let I=n?.condition?.(c,{getState:h,extra:y});if(vg(I)&&(I=yield I),I===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let j=new Promise((F,k)=>{v=()=>{k({name:"AbortError",message:R||"Aborted"})},m.signal.addEventListener("abort",v)});a(o(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:y}))),P=yield Promise.race([j,Promise.resolve(r(c,{dispatch:a,getState:h,extra:y,requestId:S,signal:m.signal,abort:E,rejectWithValue:(F,k)=>new Ao(F,k),fulfillWithValue:(F,k)=>new fc(F,k)})).then(F=>{if(F instanceof Ao)throw F;return F instanceof fc?i(F.payload,S,c,F.meta):i(F,S,c)})])}catch(I){P=I instanceof Ao?s(null,S,c,I.payload,I.meta):s(I,S,c)}finally{v&&m.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&s.match(P)&&P.meta.condition||a(P),P})();return Object.assign(b,{abort:E,requestId:S,arg:c,unwrap(){return b.then(Sg)}})}}return Object.assign(u,{pending:o,rejected:s,fulfilled:i,settled:Be(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function Sg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Sc=Symbol.for("rtk-slice-createasyncthunk"),Vw={[Sc]:oe};function Ag(e,t){return`${e}/${t}`}function Cg({creators:e}={}){let t=e?.asyncThunk?.[Sc];return function(n){let{name:i,reducerPath:o=i}=n;if(!i)throw new Error(Le(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(wg()):n.reducers)||{},u=Object.keys(s),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(P,w){let I=typeof P=="string"?P:P.type;if(!I)throw new Error(Le(12));if(I in c.sliceCaseReducersByType)throw new Error(Le(13));return c.sliceCaseReducersByType[I]=w,a},addMatcher(P,w){return c.sliceMatchers.push({matcher:P,reducer:w}),a},exposeAction(P,w){return c.actionCreators[P]=w,a},exposeCaseReducer(P,w){return c.sliceCaseReducersByName[P]=w,a}};u.forEach(P=>{let w=s[P],I={reducerName:P,type:Ag(i,P),createNotation:typeof n.reducers=="function"};xg(w)?Ig(I,w,a,t):Rg(I,w,a)});function h(){let[P={},w=[],I=void 0]=typeof n.extraReducers=="function"?hc(n.extraReducers):[n.extraReducers],j={...P,...c.sliceCaseReducersByType};return fe(n.initialState,F=>{for(let k in j)F.addCase(k,j[k]);for(let k of c.sliceMatchers)F.addMatcher(k.matcher,k.reducer);for(let k of w)F.addMatcher(k.matcher,k.reducer);I&&F.addDefaultCase(I)})}let y=P=>P,S=new Map,m;function v(P,w){return m||(m=h()),m(P,w)}function R(){return m||(m=h()),m.getInitialState()}function E(P,w=!1){function I(F){let k=F[P];return typeof k>"u"&&w&&(k=R()),k}function j(F=y){let k=dc(S,w,()=>new WeakMap);return dc(k,F,()=>{let O={};for(let[T,M]of Object.entries(n.selectors??{}))O[T]=bg(M,F,R,w);return O})}return{reducerPath:P,getSelectors:j,get selectors(){return j(I)},selectSlice:I}}let b={name:i,reducer:v,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:R,...E(o),injectInto(P,{reducerPath:w,...I}={}){let j=w??o;return P.inject({reducerPath:j,reducer:v},I),{...b,...E(j,!0)}}};return b}}function bg(e,t,r,n){function i(o,...s){let u=t(o);return typeof u>"u"&&n&&(u=r()),e(u,...s)}return i.unwrapped=e,i}var Ot=Cg();function wg(){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 Rg({type:e,reducerName:t,createNotation:r},n,i){let o,s;if("reducer"in n){if(r&&!Eg(n))throw new Error(Le(17));o=n.reducer,s=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?Q(e,s):Q(e))}function xg(e){return e._reducerDefinitionType==="asyncThunk"}function Eg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Ig({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Le(18));let{payloadCreator:o,fulfilled:s,pending:u,rejected:c,settled:a,options:h}=r,y=i(e,o,h);n.exposeAction(t,y),s&&n.addCase(y.fulfilled,s),u&&n.addCase(y.pending,u),c&&n.addCase(y.rejected,c),a&&n.addMatcher(y.settled,a),n.exposeCaseReducer(t,{fulfilled:s||Rn,pending:u||Rn,rejected:c||Rn,settled:a||Rn})}function Rn(){}var vc="listener",Ac="completed",Cc="cancelled",Qw=`task-${Cc}`,Bw=`task-${Ac}`,$w=`${vc}-${Cc}`,Hw=`${vc}-${Ac}`;var{assign:bc}=Object;var Co="listenerMiddleware";var kg=bc(Q(`${Co}/add`),{withTypes:()=>kg}),zw=Q(`${Co}/removeAll`),Pg=bc(Q(`${Co}/remove`),{withTypes:()=>Pg});var Gw=Symbol.for("rtk-state-proxy-original");function Le(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. `}g();d();f();p();var ee=new W({required:!0,emptyAllowed:!1}),ge=new W({required:!1,emptyAllowed:!1}),Ue=new W({required:!0,emptyAllowed:!0}),iR=new W({required:!1,emptyAllowed:!0}),wc=new Xe({each:ee,required:!0}),Rc=new W({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),xc=new W({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),oR=new W({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Og=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),bo=(e,t)=>{if("required"in t)return{payload:new _e({value:t}).validate({value:e}).value};let i=new ce({options:{required:!0},values:t}).validate(e);if(i)throw new Xi(i);return{payload:e}},z=(e,t)=>{try{return bo(e,t)}catch(r){return{payload:e,error:Og(r)}}};var Pn=(e,t,r,n)=>{let i=`Check the options of ${n}`;return Fg(e,t,r,i,"Controller initialization error")},Fg=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,i),o}};var On=Q("caseAssistConfiguration/set",e=>z(e,{caseAssistId:ee,locale:ge,proxyBaseUrl:new W({required:!1,url:!0})}));g();d();f();p();g();d();f();p();var Ec=()=>({caseAssistId:"",locale:"en-US"});var ct=fe(Ec(),e=>{e.addCase(On,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});g();d();f();p();g();d();f();p();g();d();f();p();var Ic={q:new W,enableQuerySyntax:new he,aq:new W,cq:new W,firstResult:new Re({min:0}),numberOfResults:new Re({min:0}),sortCriteria:new W,f:new ce,fExcluded:new ce,cf:new ce,nf:new ce,mnf:new ce,df:new ce,debug:new he,sf:new ce,tab:new W,af:new ce};var Fn=Q("searchParameters/restore",e=>z(e,Ic)),kc=Q("searchParameters/restoreTab",e=>z(e,ee));g();d();f();p();var Pc=Q("debug/enable"),Oc=Q("debug/disable");g();d();f();p();var Tn=()=>!1;var Fc=fe(Tn(),e=>{e.addCase(Pc,()=>!0).addCase(Oc,()=>!1).addCase(Fn,(t,r)=>r.payload.debug??t)});g();d();f();p();var Dn=Q("searchHub/set",e=>z(e,new W({required:!0,emptyAllowed:!0})));g();d();f();p();g();d();f();p();g();d();f();p();var Jt="3.29.3-pre.8a67bd16aa",Tc=["@coveo/atomic","@coveo/quantic"];var wo=()=>ge,Dc=()=>ee,Ft=Q("configuration/updateBasicConfiguration",e=>z(e,{accessToken:ge,environment:new W({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:ge})),qn=Q("configuration/updateSearchConfiguration",e=>z(e,{proxyBaseUrl:new W({required:!1,url:!0}),pipeline:new W({required:!1,emptyAllowed:!0}),searchHub:ge,timezone:ge,locale:ge,authenticationProviders:new Xe({required:!1,each:ee})})),Tg={enabled:new he({default:!0}),originContext:wo(),originLevel2:wo(),originLevel3:wo(),proxyBaseUrl:new W({required:!1,url:!0}),runtimeEnvironment:new Rt,anonymous:new he({default:!1}),deviceId:ge,userDisplayName:ge,documentLocation:ge,trackingId:xc,analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ce({options:{required:!1},values:Tc.reduce((e,t)=>(e[t]=Rc,e),{})})},jn=Q("configuration/updateAnalyticsConfiguration",e=>z(e,Tg)),Mn=Q("configuration/analytics/disable"),Nn=Q("configuration/analytics/enable"),qc=Q("configuration/analytics/originlevel2",e=>z(e,{originLevel2:Dc()})),jc=Q("configuration/analytics/originlevel3",e=>z(e,{originLevel3:Dc()}));g();d();f();p();var Dg=Q("history/undo"),qg=Q("history/redo"),$e=Q("history/snapshot"),jx=oe("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Dg()),yield t(_n())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),Mx=oe("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(qg()),yield t(_n())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),_n=oe("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());g();d();f();p();var Xt=()=>"default";var Mc=fe(Xt(),e=>{e.addCase(Dn,(t,r)=>r.payload).addCase(_n.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(qn,(t,r)=>r.payload.searchHub||t)});g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();var Nc=/^(?:[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 jg(e){return typeof e=="string"&&Nc.test(e)}var Ro=jg;g();d();f();p();var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function _c(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}g();d();f();p();var xo,Mg=new Uint8Array(16);function Eo(){if(!xo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xo=crypto.getRandomValues.bind(crypto)}return xo(Mg)}g();d();f();p();g();d();f();p();var Ng=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Io={randomUUID:Ng};function _g(e,t,r){if(Io.randomUUID&&!t&&!e)return Io.randomUUID();e=e||{};let n=e.random??e.rng?.()??Eo();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 i=0;i<16;++i)t[r+i]=n[i];return t}return _c(n)}var ko=_g;g();d();f();p();function Lc(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Lg({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:o,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(i,o,r))}var Uc="visitorId";function Ug(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(Uc),i=n&&Ro(n)?n:t.generateUUID();return r.setItem(Uc,i),i}}}var Hc="1.2.6",Po=128,zc=192,Vc=224,Qc=240,Vg=248;function Qg(e){return(e&Vg)===Qc?4:(e&Qc)===Vc?3:(e&Vc)===zc?2:1}function Bg(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&Po)!=Po)break;if(r-=3,(n&zc)!=Po){t-r>=Qg(n)*3&&(r=t);break}}return e.substring(0,r)}function $g(e){let{trackingId:t}=e;return{trackingId:t}}function Hg(e){return(e.source||[]).concat([`relay@${Hc}`])}function Gc(e,t,r,n){let{getReferrer:i,getLocation:o,getUserAgent:s}=r,u=$g(t),c=n.getClientId();return Object.freeze({type:e,config:u,ts:Date.now(),source:Hg(t),clientId:c,userAgent:s(),referrer:Bc(i()),location:Bc(o())})}function Bc(e){return e!==null?Bg(e,1024):null}function zg(e,t,r,n,i){return{...t,meta:Gc(e,r,n,i)}}var Gg="*";function Wg(){let e=[];function t({type:c,callback:a}){return e.findIndex(h=>h.type===c&&h.callback===a)}function r(c,a){return c.type==="*"||a===c.type}function n(c){return t(c)<0&&e.push(c),()=>u(c.type,c.callback)}function i(c){e.forEach(a=>{if(r(a,c.meta.type))try{a.callback(c)}catch(h){console.error(h)}})}function o(c){if(c===Gg)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===c&&e.splice(a,1)}function s(c){let a=t(c);a>=0&&e.splice(a,1)}function u(c,a){a?s({type:c,callback:a}):o(c)}return{add:n,call:i,remove:u}}function $c({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 Yg(e){let t=$c(e);return{get:()=>t,update:r=>{t=$c({...t,...r})}}}var Oo=Kg();function Kg(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,i=document.cookie.split(";");for(let o of i){let s=o.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,i){let o=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+i).toUTCString()}`,u=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${s}${u};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Jg(){return{getItem(e){return Oo.getItem(e)||localStorage.getItem(e)},removeItem(e){Oo.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Oo.setItem(e,t,31556952e3)}}}function Xg(){let e=document.referrer;return e===""?null:e}function Zg(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Lc().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:()=>Xg(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>ko(),storage:Jg()}}function em(){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 tm(){return{getItem(){return null},removeItem(){},setItem(){}}}function rm(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:tm()}}function nm(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=rm();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&im()&&em()?Zg():n}function im(){try{return typeof window=="object"}catch{return!1}}function om(e){return{get:()=>Object.freeze(nm(e))}}function Wc(e){let t=Yg(e),r=Wg(),n=om(t),i=Ug(n);return{emit:(o,s)=>{let u=t.get(),c=n.get(),a=zg(o,s,u,c,i);return Lg({config:u,environment:c,event:a,listenerManager:r})},getMeta:o=>Gc(o,t.get(),n.get(),i),on:(o,s)=>r.add({type:o,callback:s}),off:(o,s)=>r.remove(o,s),updateConfig:o=>t.update(o),version:Hc}}g();d();f();p();var Zt=ae(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Jt}`));var Vr=ae(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Zt(e.configuration.analytics),(e,t)=>sm(t),(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:o},s,u)=>Wc({mode:o?"emit":"disabled",url:i??cn(e,t),token:r,trackingId:n??null,source:s,environment:u})),sm=e=>{if(!e)return;let t=e();return{getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent,generateUUID:()=>t.clientId}};g();d();f();p();g();d();f();p();var Fo=(e,t)=>{let{referrer:r,userAgent:n,location:i,clientId:o}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:i,clientId:o}};g();d();f();p();var am=ae(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:i}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(i&&{lq:i})}});g();d();f();p();var Qr=(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:Zt(e)}});g();d();f();p();var cm=ae(e=>e.context,e=>e);g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();function tt(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 i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function D(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(h){try{a(n.next(h))}catch(y){s(y)}}function c(h){try{a(n.throw(h))}catch(y){s(y)}}function a(h){h.done?o(h.value):i(h.value).then(u,c)}a((n=n.apply(e,t||[])).next())})}var re;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(re||(re={}));function qo(){return typeof window<"u"}function Go(){return typeof navigator<"u"}function er(){return typeof document<"u"}function jo(){try{return typeof localStorage<"u"}catch{return!1}}function um(){try{return typeof sessionStorage<"u"}catch{return!1}}function cu(){return Go()&&navigator.cookieEnabled}var lm=[re.click,re.custom,re.search,re.view],dm=(e,t)=>lm.indexOf(e)!==-1?Object.assign({language:er()?document.documentElement.lang:"unknown",userAgent:Go()?navigator.userAgent:"unknown"},t):t,$r=class e{static set(t,r,n){var i,o,s,u;n&&(o=new Date,o.setTime(o.getTime()+n)),u=window.location.hostname,u.indexOf(".")===-1?Yc(t,r,o):(s=u.split("."),i=s[s.length-2]+"."+s[s.length-1],Yc(t,r,o,i))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){var o=n[i];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function Yc(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function pm(){return jo()?localStorage:cu()?new Hr:um()?sessionStorage:new rr}var Hr=class e{getItem(t){return $r.get(`${e.prefix}${t}`)}removeItem(t){$r.erase(`${e.prefix}${t}`)}setItem(t,r,n){$r.set(`${e.prefix}${t}`,r,n)}};Hr.prefix="coveo_";var Mo=class{constructor(){this.cookieStorage=new Hr}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)}},rr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Ln="__coveo.analytics.history",fm=20,gm=1e3*60,mm=75,Qn=class{constructor(t){this.store=t||pm()}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(Ln);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(Ln);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Ln,JSON.stringify(t.slice(0,fm)))}catch{}}clear(){try{this.store.removeItem(Ln)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,i)=>(i.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,mm)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>gm:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:i,value:o}=r;return{name:n,time:i,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:i}=t;return r&&typeof i=="string"&&r.toLowerCase()==="query"&&i.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var hm=(e,t)=>D(void 0,void 0,void 0,function*(){return e===re.view?(yield ym(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),ym=e=>D(void 0,void 0,void 0,function*(){let t=new Qn,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Un,Sm=new Uint8Array(16);function vm(){if(!Un&&(Un=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Un))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Un(Sm)}var Am=/^(?:[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 Bn(e){return typeof e=="string"&&Am.test(e)}var Ae=[];for(let e=0;e<256;++e)Ae.push((e+256).toString(16).slice(1));function uu(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]]).toLowerCase()}function Cm(e){if(!Bn(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 bm(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var wm="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Rm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function xm(e,t,r){function n(i,o,s,u){var c;if(typeof i=="string"&&(i=bm(i)),typeof o=="string"&&(o=Cm(o)),((c=o)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(o),a.set(i,o.length),a=r(a),a[6]=a[6]&15|t,a[8]=a[8]&63|128,s){u=u||0;for(let h=0;h<16;++h)s[u+h]=a[h];return s}return uu(a)}try{n.name=e}catch{}return n.DNS=wm,n.URL=Rm,n}var Em=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Kc={randomUUID:Em};function Tt(e,t,r){if(Kc.randomUUID&&!t&&!e)return Kc.randomUUID();e=e||{};let n=e.random||(e.rng||vm)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return uu(n)}function Im(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 To(e,t){return e<<t|e>>>32-t}function km(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let s=unescape(encodeURIComponent(e));e=[];for(let u=0;u<s.length;++u)e.push(s.charCodeAt(u))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,i=Math.ceil(n/16),o=new Array(i);for(let s=0;s<i;++s){let u=new Uint32Array(16);for(let c=0;c<16;++c)u[c]=e[s*64+c*4]<<24|e[s*64+c*4+1]<<16|e[s*64+c*4+2]<<8|e[s*64+c*4+3];o[s]=u}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let u=new Uint32Array(80);for(let m=0;m<16;++m)u[m]=o[s][m];for(let m=16;m<80;++m)u[m]=To(u[m-3]^u[m-8]^u[m-14]^u[m-16],1);let c=r[0],a=r[1],h=r[2],y=r[3],S=r[4];for(let m=0;m<80;++m){let v=Math.floor(m/20),R=To(c,5)+Im(v,a,h,y)+S+t[v]+u[m]>>>0;S=y,y=h,h=To(a,30)>>>0,a=c,c=R}r[0]=r[0]+c>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+y>>>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 Pm=xm("v5",80,km),Jc=Pm,lu="2.30.45",Xc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Br={pageview:"pageview",event:"event"},$n=class{constructor({client:t,uuidGenerator:r=Tt}){this.client=t,this.uuidGenerator=r}},No=class extends $n{constructor({client:t,uuidGenerator:r=Tt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Xc(window.location),this.lastReferrer=er()?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:er()?document.title:"",encoding:er()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},i={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),i),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:i,location:o}=this.getNextValues(t,r);this.lastReferrer=i,this.pageViewId=n,this.currentLocation=o,t===Br.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Br.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Br.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Br.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=i=>i.replace(/^\/?(.*)$/,"/$1");return`${(i=>i.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Xc(window.location)}},ut=class e{constructor(t,r){if(!Bn(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(i=>new RegExp(i.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,i]=r;if(n.length!==32||isNaN(parseInt(i)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Bn(o)?new e(o,Number.parseInt(i)*1e3):null}};ut.cvo_cid="cvo_cid";ut.expirationTime=120;var _o=class extends $n{constructor({client:t,uuidGenerator:r=Tt}){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(ut.cvo_cid,new ut(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};_o.Id="link";var je=Object.keys;function Vn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Do=128,du=192,Zc=224,eu=240;function Om(e){return(e&248)===eu?4:(e&eu)===Zc?3:(e&Zc)===du?2:1}function Fm(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&Do)!=Do)break;if(r-=3,(n&du)!=Do){t-r>=Om(n)*3&&(r=t);break}}return e.substring(0,r)}var Lo={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"},Tm=je(Lo).map(e=>Lo[e]),Dm=[...Tm].join("|"),qm=new RegExp(`^(${Dm}$)`),jm={svcAction:"svc_action",svcActionData:"svc_action_data"},Mm=e=>je(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Lo[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Nm=e=>qm.test(e),_m=[Nm],tu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ru={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ce={action:"pa",list:"pal",listSource:"pls"},Hn={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Lm=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Uo={id:"quoteId",affiliation:"quoteAffiliation"},Vo={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Um={add:Ce,bookmark_add:Ce,bookmark_remove:Ce,click:Ce,checkout:Ce,checkout_option:Ce,detail:Ce,impression:Ce,remove:Ce,refund:Object.assign(Object.assign({},Ce),Hn),purchase:Object.assign(Object.assign({},Ce),Hn),quickview:Ce,quote:Object.assign(Object.assign({},Ce),Uo),review:Object.assign(Object.assign({},Ce),Vo)},Vm=je(tu).map(e=>tu[e]),Qm=je(ru).map(e=>ru[e]),Bm=je(Ce).map(e=>Ce[e]),$m=je(Hn).map(e=>Hn[e]),Hm=je(Vo).map(e=>Vo[e]),zm=je(Uo).map(e=>Uo[e]),Gm=[...Vm,"custom"].join("|"),Wm=[...Qm,"custom"].join("|"),pu="(pr[0-9]+)",fu="(il[0-9]+pi[0-9]+)",Ym=new RegExp(`^${pu}(${Gm})$`),Km=new RegExp(`^(${fu}(${Wm}))|(il[0-9]+nm)$`),Jm=new RegExp(`^(${Bm.join("|")})$`),Xm=new RegExp(`^(${$m.join("|")})$`),Zm=new RegExp(`^${pu}custom$`),eh=new RegExp(`^${fu}custom$`),th=new RegExp(`^(${[...Lm,...Hm,...zm].join("|")})$`),rh=e=>Ym.test(e),nh=e=>Km.test(e),ih=e=>Jm.test(e),oh=e=>Xm.test(e),sh=e=>th.test(e),ah=[nh,rh,ih,oh,sh],ch=[Zm,eh],uh={anonymizeIp:"aip"},lh={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},dh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},ph=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],fh=Object.assign(Object.assign(Object.assign(Object.assign({},uh),lh),dh),ph.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Qo=Object.assign(Object.assign({},fh),jm),gh=e=>{let t=!!e.action&&Um[e.action]||{};return je(e).reduce((r,n)=>{let i=t[n]||Qo[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})},{})},mh=je(Qo).map(e=>Qo[e]),hh=e=>mh.indexOf(e)!==-1,yh=e=>e==="custom",Sh=e=>[...ah,..._m,hh,yh].some(t=>t(e)),vh=e=>je(e).reduce((t,r)=>{let n=Ah(r);return n?Object.assign(Object.assign({},t),Ch(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Ah=e=>{let t;return[...ch].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Ch=(e,t)=>je(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Bo=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:i}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:s,payload:u}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,i),c=this.encodeForEventType(t,u),a=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(s,a)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let i=t,o=r;if(n){let s=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:u,body:c}=s;i=u||t;try{o=JSON.parse(c)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:o,url:i}})}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,i=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",i?`visitorId=${i}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[re.click,re.custom,re.search,re.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let i=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(i=`access_token=${encodeURIComponent(n)}&${i}`),i}},$o=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()})}},nu=A.fetch,zn=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:i,preprocessRequest:o}=this.opts,s=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",u={url:`${n}/analytics/${t}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},u),o?yield o(u,"analyticsFetch"):{}),{url:a}=c,h=tt(c,["url"]),y;try{y=yield nu(a,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(y.ok){let S=yield y.json();return S.visitorId&&i.setCurrentVisitorId(S.visitorId),S}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,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 nu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[re.click,re.custom,re.search,re.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"})}},Ho=class{constructor(t,r){jo()&&cu()?this.storage=new Mo:jo()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new rr),this.client=new zn(t),this.beaconClient=new Bo(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:i,payload:o}of n)this.beaconClient.sendEvent(i,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},zo=class{constructor(t,r){this.storage=r||new rr,this.client=new zn(t)}getClientDependingOnEventType(t){return this.client}},Gn=class{constructor(){this.storage=new rr,this.client=new $o}getClientDependingOnEventType(t){return this.client}},bh="xx",wh=e=>e?.startsWith(bh)||!1,Rh=`
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 xy(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Ey=["1",1,"yes",!0];function Gn(){let e=[];return Do()&&e.push(window.doNotTrack),zo()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Ey.indexOf(t)!==-1)}var fu="v15",gu={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 Iy(e=gu.default,t=fu,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 ky="38824e1f-37f5-42d3-8372-a4b8fa9df946",ze=class{get defaultOptions(){return{endpoint:gu.default,isCustomEndpoint:!1,token:"",version:fu,beforeSendHooks:[],afterSendHooks:[]}}get version(){return uu}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=[ym,dm].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};Gn()?this.runtime=new zn:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(re.view,{newEventType:re.view,addClientIdParameter:!0}),this.addEventTypeMapping(re.click,{newEventType:re.click,addClientIdParameter:!0}),this.addEventTypeMapping(re.custom,{newEventType:re.custom,addClientIdParameter:!0}),this.addEventTypeMapping(re.search,{newEventType:re.search,addClientIdParameter:!0})}initRuntime(t){return Do()&&er()?new $o(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(xy()&&console.warn(Ry),new Ho(t))}get storage(){return this.runtime.storage}determineVisitorId(){return D(this,void 0,void 0,function*(){try{return Do()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Dt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Dt()}})}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(Qn(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Kc(t,Kc(r,ky)))}})}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(Dt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Gn())return null;try{let r=new URL(t).searchParams.get(lt.cvo_cid);if(r==null)return null;let n=lt.fromString(r);return!n||!er()||!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:i=!1,usesMeasurementProtocol:o=!1,addClientIdParameter:s=!1}=this.eventTypeMapping[t]||{};return yield[m=>n.length>0?this.parseVariableArgumentsPayload(n,m):m[0],m=>D(this,void 0,void 0,function*(){return Object.assign(Object.assign({},m),{visitorId:i?yield this.getCurrentVisitorId():""})}),m=>D(this,void 0,void 0,function*(){return s?Object.assign(Object.assign({},m),{clientId:yield this.getCurrentVisitorId()}):m}),m=>o?this.ensureAnonymousUserWhenUsingApiKey(m):m,m=>this.beforeSendHooks.reduce((v,R)=>D(this,void 0,void 0,function*(){let E=yield v;return yield R(t,E)}),m)].reduce((m,v)=>D(this,void 0,void 0,function*(){let R=yield m;return yield v(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?gy(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 m=yield h;return yield S(m)}),Promise.resolve(r))})}makeEvent(t,...r){return D(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},i=yield this.resolveParameters(t,...r),o=yield this.resolvePayloadForParameters(t,i);return{eventType:n,payload:o,log:s=>D(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},o),s)}),yield Promise.all(this.afterSendHooks.map(u=>u(t,Object.assign(Object.assign({},i),s)))),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 Vn().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=rt(t,["searchQueryUid"]);return D(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=rt(t,["searchQueryUid"]);return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=rt(t,["lastSearchQueryUid"]);return D(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.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 C(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return D(this,void 0,void 0,function*(){return yield(yield C(`${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 i=0,o=r.length;i<o;i++){let s=r[i];if(typeof s=="string")n[t[i]]=s;else if(typeof s=="object")return Object.assign(Object.assign({},n),s)}return n}isKeyAllowedEmpty(t,r){return({[re.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=i=>typeof i<"u"&&i!==null&&i!=="";return Object.keys(t).filter(i=>this.isKeyAllowedEmpty(r,i)||n(t[i])).reduce((i,o)=>Object.assign(Object.assign({},i),{[o]:t[o]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Sy(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,i)=>Object.assign(Object.assign({},n),{[i]:t[i]}),{})}processCustomParameters(t){let{custom:r}=t,n=rt(t,["custom"]),i={};r&&Un(r)&&(i=this.lowercaseKeys(r));let o=vy(n);return Object.assign(Object.assign({},i),o)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=rt(t,["custom"]);if(r&&Un(r)){let i=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},i),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(i=>{n[i.toLowerCase()]=t[i]}),n}validateParams(t,r){let{anonymizeIp:n}=t,i=rt(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(i.anonymizeIp=1),(r==re.view||r==re.click||r==re.search||r==re.custom)&&(i.originLevel3=this.limit(i.originLevel3,1024)),r==re.view&&(i.location=this.limit(i.location,1024)),(r=="pageview"||r=="event")&&(i.referrer=this.limit(i.referrer,2048),i.location=this.limit(i.location,2048),i.page=this.limit(i.page,2048)),i}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=rt(t,["userId"]);return wy(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=rt(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Un(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Un(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"?Fm(t,r):t}get baseUrl(){return Iy(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},nt;(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"})(nt||(nt={}));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 nu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryError]:"errors",[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",[nt.expandToFullUI]:"interface",[nt.openUserActions]:"User Actions",[nt.showPrecedingSessions]:"User Actions",[nt.showFollowingSessions]:"User Actions",[nt.clickViewedDocument]:"User Actions",[nt.clickPageView]:"User Actions",[nt.createArticle]:"createArticle"},nr=class{constructor(){this.runtime=new zn,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(re.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(re.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(re.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(re.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return uu}};function Py(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Oy(e){return e.map(t=>t.replace(/;/g,""))}function mu(e){let r=e.join(";");return r.length<=256?r:mu(e.slice(1))}var iu=e=>{let t=Oy(e),r=Py(t);return mu(r)};function ou(e){let t=typeof e.partialQueries=="string"?e.partialQueries:iu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:iu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Wn=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Gn();this.coveoAnalyticsClient=n?new nr:new ze(t)}disable(){this.coveoAnalyticsClient=new nr}enable(){this.coveoAnalyticsClient=new ze(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,ou(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,ou(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,n=nu[t]){return D(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),o=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:n,eventValue:t}),s=yield this.coveoAnalyticsClient.makeCustomEvent(o);return{description:this.makeEventDescription(s,t),log:({searchUID:u})=>s.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r,n=nu[t]){return D(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),o=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:r,eventValue:t}),s=yield this.coveoAnalyticsClient.makeCustomEvent(o);return{description:this.makeEventDescription(s,t),log:({searchUID:u})=>s.log({lastSearchQueryUid:u})}})}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),i=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(i,t),log:({searchUID:o})=>i.log({searchQueryUid:o})}})}makeClickEvent(t,r,n,i){return D(this,void 0,void 0,function*(){let o=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),i))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),s=yield this.coveoAnalyticsClient.makeClickEvent(o);return{description:this.makeEventDescription(s,t),log:({searchUID:u})=>s.log({searchQueryUid:u})}})}logClickEvent(t,r,n,i){return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,i)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,i;return D(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(i=(n=this.provider).getGeneratedAnswerMetadata)===null||i===void 0?void 0:i.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 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(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()})})}},Yn=Object.assign({},Br),su=Object.keys(Yn).map(e=>Yn[e]),tr=class extends Mo{constructor({client:t,uuidGenerator:r=Dt}){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])=>su.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(su.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Yn.pageview,{newEventType:re.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Yn.event,{newEventType:re.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let i=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}:{}),o=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},o),i),r)}getTicketPayload(){return Mm(this.ticket)}};tr.Id="svc";var Kn;(function(e){e.click="click",e.flowStart="flowStart"})(Kn||(Kn={}));var je;(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"})(je||(je={}));var Jn;(function(e){e.quit="Quit",e.solved="Solved"})(Jn||(Jn={}));var Xn=class{constructor(t,r){var n;this.options=t,this.provider=r;let i=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Gn();this.coveoAnalyticsClient=i?new ze(t):new nr,this.svc=new tr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new nr,this.svc=new tr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new ze(this.options),this.svc=new tr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(je.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(je.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(je.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(je.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(je.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(je.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(je.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(je.caseCancelled,{reason:Jn.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(je.caseSolved,{reason:Jn.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(je.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Kn.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Kn.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return D(this,void 0,void 0,function*(){let i=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:i,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,i,o;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:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel2(),originLevel3:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel3()}}logClickEvent(t,r,n,i){var o,s;return D(this,void 0,void 0,function*(){let u=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),i))),{searchQueryUid:(s=(o=this.provider)===null||o===void 0?void 0:o.getSearchUID())!==null&&s!==void 0?s:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(u)})}};g();d();f();p();var Fy=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},qt=class{constructor(t){this.getState=t;se(this,"state");this.state=t()}getLanguage(){return Fy(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},i={};for(let[o,s]of Object.entries(n)){let u=`context_${o}`;i[u]=s}return r.analytics.analyticsMode==="legacy"&&(i.coveoHeadlessVersion=Jt),i}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Xt()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};g();d();f();p();var ir=e=>new ze(e).getCurrentVisitorId(),zr=(e,t)=>typeof t=="function"?(...r)=>{let n=Pr(r[0]);try{return t.apply(t,r)}catch(i){return e.error(i,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Gr=(e,t)=>(...r)=>{let n=Pr(r[1]);try{return t.apply(t,r)}catch(i){return e.error(i,"Error in analytics hook. Returning original request."),n}};var Wr=class extends qt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},yu=({logger:e,getState:t,analyticsClientMiddleware:r=(o,s)=>s,preprocessRequest:n,provider:i=new Wr(t)})=>{let o=t(),s=o.configuration.accessToken,u=o.configuration.analytics.apiBaseUrl??pe(o.configuration.organizationId,o.configuration.environment,"analytics"),c=o.configuration.analytics.runtimeEnvironment,a=o.configuration.analytics.enabled,y=new Xn({enableAnalytics:a,token:s,endpoint:u,runtimeEnvironment:c,preprocessRequest:zr(e,n),beforeSendHooks:[Gr(e,r),(h,S)=>(e.info({...S,type:h,endpoint:u,token:s},"Analytics request"),S)]},i);return a||y.disable(),y};g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();function Zn(){return{desiredCount:5,numberOfValues:8,set:{}}}g();d();f();p();g();d();f();p();g();d();f();p();function hu(e){let{activeValue:t,ancestryMap:r}=qy(e);return t?jy(t,r):[]}function qy(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 i of n.children)r.set(i,n);t.unshift(...n.children)}return{}}function jy(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var My=(e,t)=>e.categoryFacetSet[t]?.request;var Go=(e,t)=>{let r=My(e,t);return hu(r?.currentValues??[])};g();d();f();p();function ei(){return{}}g();d();f();p();function ti(){return{}}g();d();f();p();function ri(){return{}}g();d();f();p();function ni(){return{}}function Wo(e){return{facetSet:e.facetSet??ni(),categoryFacetSet:e.categoryFacetSet??ei(),dateFacetSet:e.dateFacetSet??ti(),numericFacetSet:e.numericFacetSet??ri(),automaticFacetSet:e.automaticFacetSet??Zn()}}var Yo=e=>{let t=[];return Ly(e).forEach((r,n)=>{let i=Gy(e,r.facetId),o=Hy(r,n+1);if(_y(r)){if(!!!Go(e,r.facetId).length)return;t.push({...o,...By(e,r.facetId),facetType:i,state:"selected"});return}r.currentValues.forEach((s,u)=>{if(s.state==="idle")return;let c=Su(s,u+1,i),a=Ny(r)?vu(s):Vy(s);t.push({...o,...c,...a})})}),Uy(e).forEach((r,n)=>{let i=$y(r,n+1);r.values.forEach((o,s)=>{if(o.state==="idle")return;let u=Su(o,s+1,"specific"),c=vu(o);t.push({...i,...u,...c})})}),t},Ny=e=>e.type==="specific",_y=e=>e.type==="hierarchical",Ly=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),Uy=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Su=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Vy=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),vu=e=>({displayValue:e.value,value:e.value}),Qy=(e,t)=>Go(e,t).map(n=>n.value).join(";"),By=(e,t)=>{let n=Qy(e,t);return{value:n,valuePosition:1,displayValue:n}},$y=(e,t)=>({title:Au(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Hy=(e,t)=>({title:Au(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Au=(e,t)=>`${e}_${t}`,zy=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Gy=(e,t)=>{let r=zy(e,t);return r?r.type:"specific"};g();d();f();p();var or=e=>{if(Wy(e)){let t=Object.values(e.answer.queries).pop()?.data;return typeof t=="object"&&t!==null&&"answerId"in t?t.answerId:void 0}if(Yy(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},Wy=e=>"answer"in e&&"generatedAnswer"in e&&!Y(e.generatedAnswer?.answerConfigurationId),Yy=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object";var Ky=ae(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));g();d();f();p();var Qe=()=>({q:"",enableQuerySyntax:!1});g();d();f();p();function Ko(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ko(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ko(),extendedResults:{},searchAction:void 0}}g();d();f();p();g();d();f();p();g();d();f();p();var Cu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Cu||{}),bu=(o=>(o.Relevancy="relevancy",o.QRE="qre",o.Date="date",o.Field="field",o.NoSort="nosort",o))(bu||{}),Jo=e=>{if(La(e))return e.map(t=>Jo(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""}},wu=()=>({by:"relevancy"});var iO=new ce({values:{by:new Xi({enum:bu,required:!0}),order:new Xi({enum:Cu}),field:new W}});function ii(){return Jo(wu())}g();d();f();p();g();d();f();p();g();d();f();p();var sr=class e{static set(t,r,n){let i,o,s;n&&(o=new Date,o.setTime(o.getTime()+n));let u=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,a=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(u)||a.test(u)||u.indexOf(".")===-1?Xo(t,r,o):(s=u.split("."),i=s[s.length-2]+"."+s[s.length-1],Xo(t,r,o,i))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let o=n[i];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function Xo(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}g();d();f();p();function Jy(){return typeof navigator<"u"}function Ru(){try{return typeof localStorage<"u"}catch{return!1}}function xu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Eu(){return!!(Jy()&&navigator.cookieEnabled)}var Iu=null;function ku(){return Iu||(Ru()?localStorage:Eu()?new Zo:xu()?sessionStorage:new es)}var ar=class ar{getItem(t){return sr.get(`${ar.prefix}${t}`)}removeItem(t){sr.erase(`${ar.prefix}${t}`)}setItem(t,r,n){sr.set(`${ar.prefix}${t}`,r,n)}};se(ar,"prefix","coveo_");var Zo=ar;var es=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var oi="__coveo.analytics.history",Xy=20,Zy=1e3*60,eh=75,jt=class jt{constructor(t){se(this,"store");this.store=t||ku()}static getInstance(t){return jt.instance||(jt.instance=new jt(t)),jt.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 _this4=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this4.cropQueryElement(_this4.stripEmptyQuery(t));let r=yield _this4.getHistoryWithInternalTimeAsync();r!==null?_this4.isValidEntry(t)&&_this4.setHistory([t].concat(r)):_this4.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this5=this;return _asyncToGenerator(function*(){let t=yield _this5.getHistoryWithInternalTimeAsync();return _this5.stripEmptyQueries(_this5.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(oi);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this6=this;return _asyncToGenerator(function*(){try{let t=yield _this6.store.getItem(oi);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(oi,JSON.stringify(t.slice(0,Xy)))}catch{}}clear(){try{this.store.removeItem(oi)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,i)=>(i.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,eh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Zy:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:i,value:o}=r;return{name:n,time:i,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:i}=t;return r&&typeof i=="string"&&r.toLowerCase()==="query"&&i.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};se(jt,"instance",null);var ts=jt,dt=ts;var Yr=class Yr extends qt{constructor(){super(...arguments);se(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 Yo(Wo(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Yr.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||Ge().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Yr.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),i=or(r);return i&&(n.generativeQuestionAnsweringId=i),n}getFacetMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetValue:n,facetTitle:`${o}_${r}`}}getFacetClearAllMetadata(r){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetTitle:`${i}_${r}`}}getFacetUpdateSortMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,criteria:n,facetTitle:`${o}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${o}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ii()}}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 o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:o,categoryFacetPath:n,categoryFacetTitle:`${o}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let i=this.state.querySuggest?.[r],o=i.completions.map(a=>a.expression),s=i.partialQueries.length-1,u=i.partialQueries[s]||"",c=i.responseId;return{...this.getBaseMetadata(),suggestionRanking:o.indexOf(n),partialQuery:u,partialQueries:i.partialQueries.length>0?i.partialQueries:"",suggestions:o.length>0?o:"",querySuggestResponseId:c}}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||Qe().q}get responseTime(){return this.state.search?.duration||Ge().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Ge().response.totalCountFiltered}};se(Yr,"fallbackPipelineName","default");var pt=Yr,Pu=({logger:e,getState:t,analyticsClientMiddleware:r=(o,s)=>s,preprocessRequest:n,provider:i})=>{let o=t(),s=o.configuration.accessToken,u=o.configuration.analytics.apiBaseUrl??pe(o.configuration.organizationId,o.configuration.environment,"analytics"),c=o.configuration.analytics.runtimeEnvironment,a=o.configuration.analytics.enabled,y=new Wn({token:s,endpoint:u,runtimeEnvironment:c,preprocessRequest:zr(e,n),beforeSendHooks:[Gr(e,r),(h,S)=>(e.info({...S,type:h,endpoint:u,token:s},"Analytics request"),S)]},i);return a||y.disable(),y},rs=()=>{let t=dt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};g();d();f();p();function Ou(e){let t=Fu(e),r=[e,...t].filter(i=>i.parentResult).map(i=>i.parentResult);return ka([e,...t,...r],i=>i.uniqueId)}function Fu(e){return e.childResults?e.childResults.flatMap(t=>[t,...Fu(t)]):[]}g();d();f();p();var si=()=>"";function Tu(e,t){return{...new pt(t).getBaseMetadata(),actionCause:e,type:e}}function th(e){return Object.assign(e,{instantlyCallable:!0})}function rh(e,t){let r=o=>th(oe(e,o)),n=r(/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(o,{getState:s,extra:u}){let{analyticsClientMiddleware:c,preprocessRequest:a,logger:y}=u;return yield(yield t({getState:s,analyticsClientMiddleware:c,preprocessRequest:a,logger:y})).log({state:s(),extra:u})});return function(_x9,_x0){return _ref7.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref8=_asyncToGenerator(function*({getState:o,analyticsClientMiddleware:s,preprocessRequest:u,logger:c}){let{description:a,log:y}=yield t({getState:o,analyticsClientMiddleware:s,preprocessRequest:u,logger:c});return{description:a,action:r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(h,{getState:S,extra:m}){return yield y({state:S(),extra:m})});return function(_x10,_x11){return _ref9.apply(this,arguments)}}())}});return function prepare(_x1){return _ref8.apply(this,arguments)}}()}),n}var Du=(e,t,r)=>{function n(...i){let o=i.length===1?{...i[0],__legacy__getBuilder:t(i[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:i[0],__legacy__getBuilder:t(i[1]),__legacy__provider:i[2],analyticsConfigurator:e,providerClass:r};return oh(o)}return n},nh=e=>e.configuration.analytics.analyticsMode==="legacy",ih=e=>e.configuration.analytics.analyticsMode==="next",oh=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:i,analyticsConfigurator:o,providerClass:s})=>(r??(r=u=>new s(u)),rh(e,/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*({getState:u,analyticsClientMiddleware:c,preprocessRequest:a,logger:y}){let h=[],S={log:function(){var _ref1=_asyncToGenerator(function*({state:b}){for(let P of h)yield P(b)});return function log(_x13){return _ref1.apply(this,arguments)}}()},m=u(),v=o({getState:u,logger:y,analyticsClientMiddleware:c,preprocessRequest:a,provider:r(u)}),R=yield t(v,u());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(b){nh(b)&&(yield sh(R,r,b,y,v.coveoAnalyticsClient))});return function(_x14){return _ref10.apply(this,arguments)}}());let{emit:E}=Vr(m);return h.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(b){if(ih(b)&&i&&n){let P=n(b);yield gh(E,i,P)}});return function(_x15){return _ref11.apply(this,arguments)}}()),S});return function(_x12){return _ref0.apply(this,arguments)}}()));function sh(_x16,_x17,_x18,_x19,_x20){return _sh.apply(this,arguments)}function _sh(){_sh=_asyncToGenerator(function*(e,t,r,n,i){t(()=>r);let o=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:i,response:o},"Analytics response")});return _sh.apply(this,arguments)}var ah=e=>r=>(n,i)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref12=_asyncToGenerator(function*(o){r(n,i)});return function log(_x21){return _ref12.apply(this,arguments)}}()}),be=Du(e=>Pu({...e,provider:e.provider||new pt(e.getState)}),e=>e,pt),Fe=Du(yu,ah("caseAssist"),Wr);var ns=(e,t)=>{let r=o=>o+(t.pagination?.firstResult??0),n=-1,i=t.search?.results;return n=Mu(e,i),n<0&&(n=fh(e,i)),n<0&&(n=0),ch(e,r(n),t)};function ch(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:dh(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:ph(e),queryPipeline:r.pipeline||si()}}var is=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||""}),qu={urihash:new W,sourcetype:new W,permanentid:new W},ju={uniqueId:ee,raw:new ce({values:qu}),title:ee,uri:ee,clickUri:ee,rankingModifier:new W({required:!1,emptyAllowed:!0})};function uh(e){return Object.assign({},...Object.keys(qu).map(t=>({[t]:e[t]})))}function lh(e){return Object.assign({},...Object.keys(ju).map(t=>({[t]:e[t]})),{raw:uh(e.raw)})}function dh(e){let t=e.raw.author;return Y(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function ph(e){let t=e.raw.source;return Y(t)?"unknown":t}var os=e=>new Le(ju).validate(lh(e));function fh(e,t){for(let[r,n]of t.entries()){let i=Ou(n);if(Mu(e,i)!==-1)return r}return-1}function Mu(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function gh(_x22,_x23,_x24){return _gh.apply(this,arguments)}function _gh(){_gh=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _gh.apply(this,arguments)}g();d();f();p();var ai=e=>be({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=or(r),i=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:i}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:or(t)??"",answerGenerated:e??!1})});g();d();f();p();var Nu=/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:pe(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Nu(_x25){return _ref13.apply(this,arguments)}}();g();d();f();p();var _u=["text/plain","text/markdown"];var cr=new W({required:!0}),Uu=new W,ur=new ye({required:!0}),mh={id:cr,title:cr,uri:cr,permanentid:cr,clickUri:Uu},Vu=new W({required:!0,constrainTo:_u}),cT=Q("generatedAnswer/setIsVisible",e=>z(e,ur)),uT=Q("generatedAnswer/setIsEnabled",e=>z(e,ur)),as=Q("generatedAnswer/updateMessage",e=>z(e,{textDelta:cr})),cs=Q("generatedAnswer/updateCitations",e=>z(e,{citations:new Ze({required:!0,each:new ce({values:mh})})})),yh=Q("generatedAnswer/updateError",e=>z(e,{message:Uu,code:new Re({min:0})})),hh=Q("generatedAnswer/resetAnswer"),lT=Q("generatedAnswer/like"),dT=Q("generatedAnswer/dislike"),pT=Q("generatedAnswer/feedbackModal/open"),fT=Q("generatedAnswer/expand"),gT=Q("generatedAnswer/collapse"),mT=Q("generatedAnswer/setId",e=>z(e,{id:new W({required:!0})})),yT=Q("generatedAnswer/feedbackModal/close"),hT=Q("generatedAnswer/sendFeedback"),ss=Q("generatedAnswer/setIsLoading",e=>z(e,ur)),Lu=Q("generatedAnswer/setIsStreaming",e=>z(e,ur)),us=Q("generatedAnswer/setAnswerContentFormat",e=>z(e,Vu)),ST=Q("generatedAnswer/updateResponseFormat",e=>z(e,{contentFormat:new Ze({each:Vu,default:["text/plain"]})})),vT=Q("knowledge/updateAnswerConfigurationId",e=>z(e,cr)),AT=Q("generatedAnswer/registerFieldsToIncludeInCitations",e=>z(e,bc)),Sh=Q("generatedAnswer/setIsAnswerGenerated",e=>z(e,ur)),ls=Q("generatedAnswer/setCannotAnswer",e=>z(e,ur)),CT=oe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:i,getState:o}=t,{search:s}=o(),{queryExecuted:u}=s,{setAbortControllerRef:c}=e,a=yield Nu(r),y=(m,v)=>{switch(m){case"genqa.headerMessageType":{let R=JSON.parse(v);n(us(R.contentFormat));break}case"genqa.messageType":n(as(JSON.parse(v)));break;case"genqa.citationsType":n(cs(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,E=u.length!==0&&!R;n(ls(E)),n(Lu(!1)),n(Sh(R)),n(ai(R));break}default:r.debug&&i.logger.warn(`Unknown payloadType: "${m}"`)}};n(ss(!0));let h=m=>m.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=i.streamingClient?.streamGeneratedAnswer(a,{write:m=>{h(a)&&(n(ss(!1)),m.payload&&m.payloadType&&y(m.payloadType,m.payload))},abort:m=>{h(a)&&n(yh(m))},close:()=>{h(a)&&n(Lu(!1))},resetAnswer:()=>{h(a)&&n(hh())}});S?c(S):n(ss(!1))});return function(_x26,_x27){return _ref14.apply(this,arguments)}}());g();d();f();p();g();d();f();p();var vh=ae(e=>e.pipeline,e=>e);g();d();f();p();var Qu=ae(e=>e.query,e=>e);g();d();f();p();g();d();f();p();var Jr=_e(ci(),1),Wu=_e(Bu(),1);g();d();f();p();var Hu=_e(ci(),1),zu=_e($u(),1);Hu.default.extend(zu.default);var Ah="YYYY/MM/DD@HH:mm:ss";function Gu(e){return e.format(Ah)}Jr.default.extend(Wu.default);var Ch=["past","now","next"],bh=["minute","hour","day","week","month","quarter","year"];function wh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Jr.default)().subtract(r,n);case"next":return(0,Jr.default)().add(r,n);case"now":return(0,Jr.default)()}}function hs(e){return Gu(wh(Rh(e)))}function Yu(e){return e.toLocaleLowerCase().split("-")}function Ss(e){let[t,r,n]=Yu(e);if(t==="now")return!0;if(!Ch.includes(t)||!bh.includes(n))return!1;let i=parseInt(r);return!(Number.isNaN(i)||i<=0)}function Rh(e){let[t,r,n]=Yu(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}g();d();f();p();function Ku(e){return e.type==="dateRange"}function Ju(e){return`start${e}`}function Xu(e){return`end${e}`}var Zu=()=>({dateFacetValueMap:{}});function xh(e,t,r){let n=e.start,i=e.end;return Ss(n)&&(n=hs(n),r.dateFacetValueMap[t][Ju(n)]=e.start),Ss(i)&&(i=hs(i),r.dateFacetValueMap[t][Xu(i)]=e.end),{...e,start:n,end:i}}function el(e,t){if(Ku(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(i=>xh(i,r,t))}}return e}function ft(e){let t=Zu();return{request:{...e,facets:e.facets?.map(n=>el(n,t))},mappings:t}}function Eh(e,t,r){return{...e,start:r.dateFacetValueMap[t][Ju(e.start)]||e.start,end:r.dateFacetValueMap[t][Xu(e.end)]||e.end}}function Ih(e,t){return e.facetId in t.dateFacetValueMap}function kh(e,t){return Ih(e,t)?{...e,values:e.values.map(r=>Eh(r,e.facetId,t))}:e}function ui(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>kh(n,t))}}:e}g();d();f();p();g();d();f();p();var Xr=(e,t)=>{let r=e;return Y(r[t])?Y(e.raw[t])?null:e.raw[t]:r[t]},Ph=e=>t=>e.every(r=>!Y(Xr(t,r))),Oh=e=>t=>e.every(r=>Y(Xr(t,r))),Fh=(e,t)=>r=>{let n=tl(e,r);return t.some(i=>n.some(o=>`${o}`.toLowerCase()===i.toLowerCase()))},Th=(e,t)=>r=>{let n=tl(e,r);return t.every(i=>n.every(o=>`${o}`.toLowerCase()!==i.toLowerCase()))},tl=(e,t)=>{let r=Xr(t,e);return Ia(r)?r:[r]},rl={getResultProperty:Xr,fieldsMustBeDefined:Ph,fieldsMustNotBeDefined:Oh,fieldMustMatch:Fh,fieldMustNotMatch:Th};var Dh=ae(e=>e.search,e=>e?.searchAction?.actionCause||"");g();d();f();p();var qh=ae(e=>e.searchHub,e=>e);g();d();f();p();var vs=ae(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(o=>o.state==="selected"&&!!o.expression.trim()),i=n.map(o=>o.expression).join(" OR ");return n.length>1?`(${i})`:i}));g();d();f();p();var nl=ae(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),jh=ae(e=>e,e=>{let t=nl(e);return t&&e?e[t].expression:""});g();d();f();p();g();d();f();p();function gt(e){return Object.values(e).map(t=>t.request)}function As(e,t){let r={};e.forEach(o=>{r[o.facetId]=o});let n=[];t.forEach(o=>{o in r&&(n.push(r[o]),delete r[o])});let i=Object.values(r);return[...n,...i]}function il(e){return gt(e).map(t=>{let n=t.currentValues.some(({state:i})=>i!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Cs={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function Mh(e){return gt(e).map(t=>{let r=Cs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Nh(e){return[...Mh(e.facetSet??{}),...il(e.numericFacetSet??{}),...il(e.dateFacetSet??{}),...gt(e.categoryFacetSet??{})]}function _h(e){return Nh(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function bs(e){return As(_h(e),e.facetOrder??[])}g();d();f();p();g();d();f();p();function sl(_x28,_x29){return _sl.apply(this,arguments)}function _sl(){_sl=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _sl.apply(this,arguments)}function al(e){let t,r,n,i=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=Uh(t,s);let u=t.length,c=0;for(;r<u;){i&&(t[r]===10&&(c=++r),i=!1);let a=-1;for(;r<u&&a===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:i=!0,a=r;break;case 10:a=r;break}if(a===-1)break;e(t.subarray(c,a),n),c=r,n=-1}c===u?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function cl(e,t,r){let n=ol(),i=new TextDecoder;return function(s,u){if(s.length===0)r?.(n),n=ol();else if(u>0){let c=i.decode(s.subarray(0,u)),a=u+(s[u+1]===32?2:1),y=i.decode(s.subarray(a));switch(c){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":Lh(y,n,t);break}}}}function Lh(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function Uh(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function ol(){return{data:"",event:"",id:"",retry:void 0}}var ws="text/event-stream",Vh=1e3,ul="last-event-id";function ll(){return typeof window<"u"}function dl(e,{signal:t,headers:r,onopen:n,onmessage:i,onclose:o,onerror:s,openWhenHidden:u,fetch:c,...a}){return new Promise((y,h)=>{let S={...r};S.accept||(S.accept=ws);let m;function v(){m?.abort(),document.hidden||I()}!u&&ll()&&document.addEventListener("visibilitychange",v);let R=Vh,E;function b(){ll()&&document.removeEventListener("visibilitychange",v),clearTimeout(E),m?.abort()}t?.addEventListener("abort",()=>{b(),y()});let P=c??C,w=n??Qh;function I(){return _I.apply(this,arguments)}function _I(){_I=_asyncToGenerator(function*(){m=l.AbortController?new l.AbortController:null;try{let j=yield P(e,{...a,headers:S,signal:m?.signal});yield w(j),yield sl(j.body,al(cl(F=>{F?S[ul]=F:delete S[ul]},F=>{R=F},i))),o?.(),b(),y()}catch(j){if(!m?.signal?.aborted)try{let F=s?.(j)??R;clearTimeout(E),E=setTimeout(I,F)}catch(F){b(),h(F)}}});return _I.apply(this,arguments)}I()})}function Qh(e){let t=e.headers.get("content-type");if(!t?.startsWith(ws))throw new Error(`Expected content-type to be ${ws}, Actual: ${t}`)}g();d();f();p();g();d();f();p();function pl(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var fl=Be;function xl(e,t){if(e===t||!(fl(e)&&fl(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),i=r.length===n.length,o=Array.isArray(t)?[]:{};for(let s of r)o[s]=xl(e[s],t[s]),i&&(i=e[s]===o[s]);return i?e:o}function lr(e){let t=0;for(let r in e)t++;return t}var gl=e=>[].concat(...e);function Bh(e){return new RegExp("(^|:)//").test(e)}function $h(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function pi(e){return e!=null}function Hh(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var zh=e=>e.replace(/\/$/,""),Gh=e=>e.replace(/^\//,"");function Wh(e,t){if(!e)return t;if(!t)return e;if(Bh(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=zh(e),t=Gh(t),`${e}${r}${t}`}function Yh(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var ml=(...e)=>C(...e),Kh=e=>e.status>=200&&e.status<=299,Jh=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function yl(e){if(!Be(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function El({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=ml,paramsSerializer:n,isJsonContentType:i=Jh,jsonContentType:o="application/json",jsonReplacer:s,timeout:u,responseHandler:c,validateStatus:a,...y}={}){return typeof C>"u"&&r===ml&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(S,m,v){let{getState:R,extra:E,endpoint:b,forced:P,type:w}=m,I,{url:j,headers:F=new x(y.headers),params:k=void 0,responseHandler:O=c??"json",validateStatus:T=a??Kh,timeout:M=u,...B}=typeof S=="string"?{url:S}:S,U,_=m.signal;M&&(U=new l.AbortController,m.signal.addEventListener("abort",U.abort),_=U.signal);let N={...y,signal:_,...B};F=new x(yl(F)),N.headers=(yield t(F,{getState:R,arg:S,extra:E,endpoint:b,forced:P,type:w,extraOptions:v}))||F;let V=K=>typeof K=="object"&&(Be(K)||Array.isArray(K)||typeof K.toJSON=="function");if(!N.headers.has("content-type")&&V(N.body)&&N.headers.set("content-type",o),V(N.body)&&i(N.headers)&&(N.body=JSON.stringify(N.body,s)),k){let K=~j.indexOf("?")?"&":"?",te=n?n(k):new URLSearchParams(yl(k));j+=K+te}j=Wh(e,j);let L=new Request(j,N);I={request:new Request(j,N)};let H,G=!1,X=U&&setTimeout(()=>{G=!0,U.abort()},M);try{H=yield r(L)}catch(K){return{error:{status:G?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(K)},meta:I}}finally{X&&clearTimeout(X),U?.signal.removeEventListener("abort",U.abort)}let ne=H.clone();I.response=ne;let J,Z="";try{let K;if(yield Promise.all([h(H,O).then(te=>J=te,te=>K=te),ne.text().then(te=>Z=te,()=>{})]),K)throw K}catch(K){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(K)},meta:I}}return T(H,J)?{data:J,meta:I}:{error:{status:H.status,data:J},meta:I}});return function(_x30,_x31,_x32){return _ref15.apply(this,arguments)}}());function h(_x33,_x34){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,m){if(typeof m=="function")return m(S);if(m==="content-type"&&(m=i(S.headers)?"json":"text"),m==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var dr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Xh(){return _Xh.apply(this,arguments)}function _Xh(){_Xh=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(i=>setTimeout(o=>i(o),n))});return _Xh.apply(this,arguments)}function Zh(e,t){throw Object.assign(new dr({error:e,meta:t}),{throwImmediately:!0})}var hl={},eS=(e,t)=>(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(r,n,i){let o=[5,(t||hl).maxRetries,(i||hl).maxRetries].filter(y=>y!==void 0),[s]=o.slice(-1),c={maxRetries:s,backoff:Xh,retryCondition:(y,h,{attempt:S})=>S<=s,...t,...i},a=0;for(;;)try{let y=yield e(r,n,i);if(y.error)throw new dr(y);return y}catch(y){if(a++,y.throwImmediately){if(y instanceof dr)return y.value;throw y}if(y instanceof dr&&!c.retryCondition(y.value.error,r,{attempt:a,baseQueryApi:n,extraOptions:i}))return y.value;yield c.backoff(a,c.maxRetries)}});return function(_x35,_x36,_x37){return _ref16.apply(this,arguments)}}()),Il=Object.assign(eS,{fail:Zh}),ks=Q("__rtkq/focused"),kl=Q("__rtkq/unfocused"),Ps=Q("__rtkq/online"),Pl=Q("__rtkq/offline");function Os(e){return e.type==="query"}function tS(e){return e.type==="mutation"}function Fs(e){return e.type==="infinitequery"}function Ts(e,t,r,n,i,o){return rS(e)?e(t,r,n,i).filter(pi).map(xs).map(o):Array.isArray(e)?e.map(xs).map(o):[]}function rS(e){return typeof e=="function"}function xs(e){return typeof e=="string"?{type:e}:e}function nS(e,t){return e.catch(t)}var en=Symbol("forceQueryFn"),Es=e=>typeof e[en]=="function";function iS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:i,context:o}){let s=new Map,u=new Map,{unsubscribeQueryResult:c,removeMutationResult:a,updateSubscriptionOptions:y}=i.internalActions;return{buildInitiateQuery:b,buildInitiateInfiniteQuery:P,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:m,getRunningMutationsThunk:v};function h(I,j){return F=>{let k=o.endpointDefinitions[I],O=e({queryArgs:j,endpointDefinition:k,endpointName:I});return s.get(F)?.[O]}}function S(I,j){return F=>u.get(F)?.[j]}function m(){return I=>Object.values(s.get(I)||{}).filter(pi)}function v(){return I=>Object.values(u.get(I)||{}).filter(pi)}function R(I){}function E(I,j){let F=(k,{subscribe:O=!0,forceRefetch:T,subscriptionOptions:M,[en]:B,...U}={})=>(_,N)=>{let V=e({queryArgs:k,endpointDefinition:j,endpointName:I}),L,$={...U,type:"query",subscribe:O,forceRefetch:T,subscriptionOptions:M,endpointName:I,originalArgs:k,queryCacheKey:V,[en]:B};if(Os(j))L=t($);else{let{direction:ie,initialPageParam:ue}=U;L=r({...$,direction:ie,initialPageParam:ue})}let H=i.endpoints[I].select(k),G=_(L),X=H(N());let{requestId:ne,abort:J}=G,Z=X.requestId!==ne,K=s.get(_)?.[V],te=()=>H(N()),le=Object.assign(B?G.then(te):Z&&!K?Promise.resolve(X):Promise.all([K,G]).then(te),{arg:k,requestId:ne,subscriptionOptions:M,queryCacheKey:V,abort:J,unwrap(){return _asyncToGenerator(function*(){let ie=yield le;if(ie.isError)throw ie.error;return ie.data})()},refetch:()=>_(F(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&_(c({queryCacheKey:V,requestId:ne}))},updateSubscriptionOptions(ie){le.subscriptionOptions=ie,_(y({endpointName:I,requestId:ne,queryCacheKey:V,options:ie}))}});if(!K&&!Z&&!B){let ie=Yh(s,_,{});ie[V]=le,le.then(()=>{delete ie[V],lr(ie)||s.delete(_)})}return le};return F}function b(I,j){return E(I,j)}function P(I,j){return E(I,j)}function w(I){return(j,{track:F=!0,fixedCacheKey:k}={})=>(O,T)=>{let M=n({type:"mutation",endpointName:I,originalArgs:j,track:F,fixedCacheKey:k}),B=O(M);let{requestId:U,abort:_,unwrap:N}=B,V=nS(B.unwrap().then(G=>({data:G})),G=>({error:G})),L=()=>{O(a({requestId:U,fixedCacheKey:k}))},$=Object.assign(V,{arg:B.arg,requestId:U,abort:_,unwrap:N,reset:L}),H=u.get(O)||{};return u.set(O,H),H[U]=$,$.then(()=>{delete H[U],lr(H)||u.delete(O)}),k&&(H[k]=$,$.then(()=>{H[k]===$&&(delete H[k],lr(H)||u.delete(O))})),$}}}function oS(e){return e}var li=(e={})=>({...e,[_r]:!0});function sS({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:o,selectors:s}){let u=(O,T,M,B)=>(U,_)=>{let N=r[O],V=n({queryArgs:T,endpointDefinition:N,endpointName:O});if(U(i.internalActions.queryResultPatched({queryCacheKey:V,patches:M})),!B)return;let L=i.endpoints[O].select(T)(_()),$=Ts(N.providesTags,L.data,void 0,T,{},o);U(i.internalActions.updateProvidedBy({queryCacheKey:V,providedTags:$}))};function c(O,T,M=0){let B=[T,...O];return M&&B.length>M?B.slice(0,-1):B}function a(O,T,M=0){let B=[...O,T];return M&&B.length>M?B.slice(1):B}let y=(O,T,M,B=!0)=>(U,_)=>{let V=i.endpoints[O].select(T)(_()),L={patches:[],inversePatches:[],undo:()=>U(i.util.patchQueryData(O,T,L.inversePatches,B))};if(V.status==="uninitialized")return L;let $;if("data"in V)if(Ee(V.data)){let[H,G,X]=Cn(V.data,M);L.patches.push(...G),L.inversePatches.push(...X),$=H}else $=M(V.data),L.patches.push({op:"replace",path:[],value:$}),L.inversePatches.push({op:"replace",path:[],value:V.data});return L.patches.length===0||U(i.util.patchQueryData(O,T,L.patches,B)),L},h=(O,T,M)=>B=>B(i.endpoints[O].initiate(T,{subscribe:!1,forceRefetch:!0,[en]:()=>({data:M})})),S=(O,T)=>O.query&&O[T]?O[T]:oS,m=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(O,{signal:T,abort:M,rejectWithValue:B,fulfillWithValue:U,dispatch:_,getState:N,extra:V}){let L=r[O.endpointName];try{let $=S(L,"transformResponse"),H={signal:T,abort:M,dispatch:_,getState:N,extra:V,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?v(O,N()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},G=O.type==="query"?O[en]:void 0,X,ne=/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(Z,K,te,le){if(K==null&&Z.pages.length)return Promise.resolve({data:Z});let ie={queryArg:O.originalArgs,pageParam:K},ue=yield J(ie),de=le?c:a;return{data:{pages:de(Z.pages,ue.data,te),pageParams:de(Z.pageParams,K,te)}}});return function ne(_x40,_x41,_x42,_x43){return _ref18.apply(this,arguments)}}();function J(_x44){return _J.apply(this,arguments)}function _J(){_J=_asyncToGenerator(function*(Z){let K,{extraOptions:te}=L;if(G?K=G():L.query?K=yield t(L.query(Z),H,te):K=yield L.queryFn(Z,H,te,ie=>t(ie,H,te)),typeof process<"u",K.error)throw new dr(K.error,K.meta);let le=yield $(K.data,K.meta,Z);return{...K,data:le}});return _J.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:Z}=L,{maxPages:K=1/0}=Z,te,le={pages:[],pageParams:[]},ie=s.selectQueryEntry(N(),O.queryCacheKey)?.data,de=v(O,N())&&!O.direction||!ie?le:ie;if("direction"in O&&O.direction&&de.pages.length){let we=O.direction==="backward",at=(we?Ol:Is)(Z,de);te=yield ne(de,at,K,we)}else{let{initialPageParam:we=Z.initialPageParam}=O,De=ie?.pageParams??[],at=De[0]??we,_t=De.length;te=yield ne(de,at,K),G&&(te={data:te.data.pages[0]});for(let Lt=1;Lt<_t;Lt++){let Cr=Is(Z,te.data);te=yield ne(te.data,Cr,K)}}X=te}else X=yield J(O.originalArgs);return U(X.data,li({fulfilledTimeStamp:Date.now(),baseQueryMeta:X.meta}))}catch($){let H=$;if(H instanceof dr){let G=S(L,"transformErrorResponse");try{return B(yield G(H.value,H.meta,O.originalArgs),li({baseQueryMeta:H.meta}))}catch(X){H=X}}throw typeof process<"u",console.error(H),H}});return function m(_x38,_x39){return _ref17.apply(this,arguments)}}();function v(O,T){let M=s.selectQueryEntry(T,O.queryCacheKey),B=s.selectConfig(T).refetchOnMountOrArgChange,U=M?.fulfilledTimeStamp,_=O.forceRefetch??(O.subscribe&&B);return _?_===!0||(Number(new Date)-Number(U))/1e3>=_:!1}let R=()=>oe(`${e}/executeQuery`,m,{getPendingMeta({arg:T}){let M=r[T.endpointName];return li({startedTimeStamp:Date.now(),...(Fs(M)?{direction:T.direction}:{})})},condition(T,{getState:M}){let B=M(),U=s.selectQueryEntry(B,T.queryCacheKey),_=U?.fulfilledTimeStamp,N=T.originalArgs,V=U?.originalArgs,L=r[T.endpointName],$=T.direction;return Es(T)?!0:U?.status==="pending"?!1:v(T,B)||Os(L)&&L?.forceRefetch?.({currentArg:N,previousArg:V,endpointState:U,state:B})?!0:!(_&&!$)},dispatchConditionRejection:!0}),E=R(),b=R(),P=oe(`${e}/executeMutation`,m,{getPendingMeta(){return li({startedTimeStamp:Date.now()})}}),w=O=>"force"in O,I=O=>"ifOlderThan"in O,j=(O,T,M)=>(B,U)=>{let _=w(M)&&M.force,N=I(M)&&M.ifOlderThan,V=($=!0)=>{let H={forceRefetch:$,isPrefetch:!0};return i.endpoints[O].initiate(T,H)},L=i.endpoints[O].select(T)(U());if(_)B(V());else if(N){let $=L?.fulfilledTimeStamp;if(!$){B(V());return}(Number(new Date)-Number(new Date($)))/1e3>=N&&B(V())}else B(V(!1))};function F(O){return T=>T?.meta?.arg?.endpointName===O}function k(O,T){return{matchPending:Yt(xn(O),F(T)),matchFulfilled:Yt(tt(O),F(T)),matchRejected:Yt(Ot(O),F(T))}}return{queryThunk:E,mutationThunk:P,infiniteQueryThunk:b,prefetch:j,updateQueryData:y,upsertQueryData:h,patchQueryData:u,buildMatchThunkActions:k}}function Is(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Ol(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Fl(e,t,r,n){return Ts(r[e.meta.arg.endpointName][t],tt(e)?e.payload:void 0,Ur(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function di(e,t,r){let n=e[t];n&&r(n)}function tn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Sl(e,t,r){let n=e[tn(t)];n&&r(n)}var Zr={};function aS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:s,hasRehydrationInfo:u},assertTagType:c,config:a}){let y=Q(`${e}/resetApiState`);function h(F,k,O,T){var M;F[M=k.queryCacheKey]??(F[M]={status:"uninitialized",endpointName:k.endpointName}),di(F,k.queryCacheKey,B=>{B.status="pending",B.requestId=O&&B.requestId?B.requestId:T.requestId,k.originalArgs!==void 0&&(B.originalArgs=k.originalArgs),B.startedTimeStamp=T.startedTimeStamp;let U=i[T.arg.endpointName];Fs(U)&&"direction"in k&&(B.direction=k.direction)})}function S(F,k,O,T){di(F,k.arg.queryCacheKey,M=>{if(M.requestId!==k.requestId&&!T)return;let{merge:B}=i[k.arg.endpointName];if(M.status="fulfilled",B){if(M.data!==void 0){let{fulfilledTimeStamp:U,arg:_,baseQueryMeta:N,requestId:V}=k,L=et(M.data,$=>B($,O,{arg:_.originalArgs,baseQueryMeta:N,fulfilledTimeStamp:U,requestId:V}));M.data=L}else M.data=O;}else M.data=i[k.arg.endpointName].structuralSharing??!0?xl(Pe(M.data)?yo(M.data):M.data,O):O;delete M.error,M.fulfilledTimeStamp=k.fulfilledTimeStamp})}let m=Ft({name:`${e}/queries`,initialState:Zr,reducers:{removeQueryResult:{reducer(F,{payload:{queryCacheKey:k}}){delete F[k]},prepare:Kt()},cacheEntriesUpserted:{reducer(F,k){for(let O of k.payload){let{queryDescription:T,value:M}=O;h(F,T,!0,{arg:T,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),S(F,{arg:T,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},M,!0)}},prepare:F=>({payload:F.map(T=>{let{endpointName:M,arg:B,value:U}=T,_=i[M];return{queryDescription:{type:"query",endpointName:M,originalArgs:T.arg,queryCacheKey:n({queryArgs:B,endpointDefinition:_,endpointName:M})},value:U}}),meta:{[_r]:!0,requestId:In(),timestamp:Date.now()}})},queryResultPatched:{reducer(F,{payload:{queryCacheKey:k,patches:O}}){di(F,k,T=>{T.data=So(T.data,O.concat())})},prepare:Kt()}},extraReducers(F){F.addCase(t.pending,(k,{meta:O,meta:{arg:T}})=>{let M=Es(T);h(k,T,M,O)}).addCase(t.fulfilled,(k,{meta:O,payload:T})=>{let M=Es(O.arg);S(k,O,T,M)}).addCase(t.rejected,(k,{meta:{condition:O,arg:T,requestId:M},error:B,payload:U})=>{di(k,T.queryCacheKey,_=>{if(!O){if(_.requestId!==M)return;_.status="rejected",_.error=U??B}})}).addMatcher(u,(k,O)=>{let{queries:T}=s(O);for(let[M,B]of Object.entries(T))(B?.status==="fulfilled"||B?.status==="rejected")&&(k[M]=B)})}}),v=Ft({name:`${e}/mutations`,initialState:Zr,reducers:{removeMutationResult:{reducer(F,{payload:k}){let O=tn(k);O in F&&delete F[O]},prepare:Kt()}},extraReducers(F){F.addCase(r.pending,(k,{meta:O,meta:{requestId:T,arg:M,startedTimeStamp:B}})=>{M.track&&(k[tn(O)]={requestId:T,status:"pending",endpointName:M.endpointName,startedTimeStamp:B})}).addCase(r.fulfilled,(k,{payload:O,meta:T})=>{T.arg.track&&Sl(k,T,M=>{M.requestId===T.requestId&&(M.status="fulfilled",M.data=O,M.fulfilledTimeStamp=T.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:O,error:T,meta:M})=>{M.arg.track&&Sl(k,M,B=>{B.requestId===M.requestId&&(B.status="rejected",B.error=O??T)})}).addMatcher(u,(k,O)=>{let{mutations:T}=s(O);for(let[M,B]of Object.entries(T))(B?.status==="fulfilled"||B?.status==="rejected")&&M!==B?.requestId&&(k[M]=B)})}}),R=Ft({name:`${e}/invalidation`,initialState:Zr,reducers:{updateProvidedBy:{reducer(F,k){var M,B;let{queryCacheKey:O,providedTags:T}=k.payload;for(let U of Object.values(F))for(let _ of Object.values(U)){let N=_.indexOf(O);N!==-1&&_.splice(N,1)}for(let{type:U,id:_}of T){let N=(M=F[U]??(F[U]={}))[B=_||"__internal_without_id"]??(M[B]=[]);N.includes(O)||N.push(O)}},prepare:Kt()}},extraReducers(F){F.addCase(m.actions.removeQueryResult,(k,{payload:{queryCacheKey:O}})=>{for(let T of Object.values(k))for(let M of Object.values(T)){let B=M.indexOf(O);B!==-1&&M.splice(B,1)}}).addMatcher(u,(k,O)=>{var M,B;let{provided:T}=s(O);for(let[U,_]of Object.entries(T))for(let[N,V]of Object.entries(_)){let L=(M=k[U]??(k[U]={}))[B=N||"__internal_without_id"]??(M[B]=[]);for(let $ of V)L.includes($)||L.push($)}}).addMatcher($e(tt(t),Ur(t)),(k,O)=>{let T=Fl(O,"providesTags",i,c),{queryCacheKey:M}=O.meta.arg;R.caseReducers.updateProvidedBy(k,R.actions.updateProvidedBy({queryCacheKey:M,providedTags:T}))})}}),E=Ft({name:`${e}/subscriptions`,initialState:Zr,reducers:{updateSubscriptionOptions(F,k){},unsubscribeQueryResult(F,k){},internal_getRTKQSubscriptions(){}}}),b=Ft({name:`${e}/internalSubscriptions`,initialState:Zr,reducers:{subscriptionsUpdated:{reducer(F,k){return So(F,k.payload)},prepare:Kt()}}}),P=Ft({name:`${e}/config`,initialState:{online:Hh(),focused:$h(),middlewareRegistered:!1,...a},reducers:{middlewareRegistered(F,{payload:k}){F.middlewareRegistered=F.middlewareRegistered==="conflict"||o!==k?"conflict":!0}},extraReducers:F=>{F.addCase(Ps,k=>{k.online=!0}).addCase(Pl,k=>{k.online=!1}).addCase(ks,k=>{k.focused=!0}).addCase(kl,k=>{k.focused=!1}).addMatcher(u,k=>({...k}))}}),w=zt({queries:m.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:b.reducer,config:P.reducer}),I=(F,k)=>w(y.match(k)?void 0:F,k),j={...P.actions,...m.actions,...E.actions,...b.actions,...v.actions,...R.actions,resetApiState:y};return{reducer:I,actions:j}}var Rs=Symbol.for("RTKQ/skipToken"),Tl={status:"uninitialized"},vl=et(Tl,()=>{}),Al=et(Tl,()=>{});function cS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>vl,i=w=>Al;return{buildQuerySelector:S,buildInfiniteQuerySelector:m,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:E,selectApiState:s,selectQueries:u,selectMutations:a,selectQueryEntry:c,selectConfig:y};function o(w){return{...w,...pl(w.status)}}function s(w){return w[t]}function u(w){return s(w)?.queries}function c(w,I){return u(w)?.[I]}function a(w){return s(w)?.mutations}function y(w){return s(w)?.config}function h(w,I,j){return F=>{if(F===Rs)return r(n,j);let k=e({queryArgs:F,endpointDefinition:I,endpointName:w});return r(T=>c(T,k)??vl,j)}}function S(w,I){return h(w,I,o)}function m(w,I){let{infiniteQueryOptions:j}=I;function F(k){let O={...k,...pl(k.status)},{isLoading:T,isError:M,direction:B}=O,U=B==="forward",_=B==="backward";return{...O,hasNextPage:b(j,O.data),hasPreviousPage:P(j,O.data),isFetchingNextPage:T&&U,isFetchingPreviousPage:T&&_,isFetchNextPageError:M&&U,isFetchPreviousPageError:M&&_}}return h(w,I,F)}function v(){return w=>{let I;return typeof w=="object"?I=tn(w)??Rs:I=w,r(I===Rs?i:k=>s(k)?.mutations?.[I]??Al,o)}}function R(w,I){let j=w[t],F=new Set;for(let k of I.filter(pi).map(xs)){let O=j.provided[k.type];if(!O)continue;let T=(k.id!==void 0?O[k.id]:gl(Object.values(O)))??[];for(let M of T)F.add(M)}return gl(Array.from(F.values()).map(k=>{let O=j.queries[k];return O?[{queryCacheKey:k,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function E(w,I){return Object.values(u(w)).filter(j=>j?.endpointName===I&&j.status!=="uninitialized").map(j=>j.originalArgs)}function b(w,I){return I?Is(w,I)!=null:!1}function P(w,I){return!I||!w.getPreviousPageParam?!1:Ol(w,I)!=null}}var Cl=WeakMap?new WeakMap:void 0,bl=({endpointName:e,queryArgs:t})=>{let r="",n=Cl?.get(t);if(typeof n=="string")r=n;else{let i=JSON.stringify(t,(o,s)=>(s=typeof s=="bigint"?{$bigint:s.toString()}:s,s=Be(s)?Object.keys(s).sort().reduce((u,c)=>(u[c]=s[c],u),{}):s,s));Be(t)&&Cl?.set(t,i),r=i}return`${e}(${r})`};function uS(...e){return function(r){let n=Wt(a=>r.extractRehydrationInfo?.(a,{reducerPath:r.reducerPath??"api"})),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(a){let y=bl;if("serializeQueryArgs"in a.endpointDefinition){let h=a.endpointDefinition.serializeQueryArgs;y=S=>{let m=h(S);return typeof m=="string"?m:bl({...S,queryArgs:m})}}else r.serializeQueryArgs&&(y=r.serializeQueryArgs);return y(a)},tagTypes:[...(r.tagTypes||[])]},o={endpointDefinitions:{},batch(a){a()},apiUid:In(),extractRehydrationInfo:n,hasRehydrationInfo:Wt(a=>n(a)!=null)},s={injectEndpoints:c,enhanceEndpoints({addTagTypes:a,endpoints:y}){if(a)for(let h of a)i.tagTypes.includes(h)||i.tagTypes.push(h);if(y)for(let[h,S]of Object.entries(y))typeof S=="function"?S(o.endpointDefinitions[h]):Object.assign(o.endpointDefinitions[h]||{},S);return s}},u=e.map(a=>a.init(s,i,o));function c(a){let y=a.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(a.overrideExisting!==!0&&h in o.endpointDefinitions){if(a.overrideExisting==="throw")throw new Error(Ue(39));typeof process<"u";continue}typeof process<"u",o.endpointDefinitions[h]=S;for(let m of u)m.injectEndpoint(h,S)}return s}return s.injectEndpoints({endpoints:r.endpoints})}}function it(e,...t){return Object.assign(e,...t)}var lS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,i=null,o=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:u}=e.internalActions,c=(m,v)=>{var E,b;if(s.match(v)){let{queryCacheKey:P,requestId:w,options:I}=v.payload;return m?.[P]?.[w]&&(m[P][w]=I),!0}if(u.match(v)){let{queryCacheKey:P,requestId:w}=v.payload;return m[P]&&delete m[P][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete m[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:w}}=v,I=m[E=P.queryCacheKey]??(m[E]={});return I[`${w}_running`]={},P.subscribe&&(I[w]=P.subscriptionOptions??I[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=m[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!P[w]),delete P[w]}if(t.rejected.match(v)){let{meta:{condition:P,arg:w,requestId:I}}=v;if(P&&w.subscribe){let j=m[b=w.queryCacheKey]??(m[b]={});j[I]=w.subscriptionOptions??j[I]??{},R=!0}}return R},a=()=>r.currentSubscriptions,S={getSubscriptions:a,getSubscriptionCount:m=>{let R=a()[m]??{};return lr(R)},isRequestSubscribed:(m,v)=>!!a()?.[m]?.[v]};return(m,v)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(m))return i=r.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(m))return[!1,S];let R=c(r.currentSubscriptions,m),E=!0;if(R){o||(o=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,I]=Cn(i,()=>w);v.next(e.internalActions.subscriptionsUpdated(I)),i=w,o=null},500));let b=typeof m.type=="string"&&!!m.type.startsWith(n),P=t.rejected.match(m)&&m.meta.condition&&!!m.meta.arg.subscribe;E=!b&&!P}return[E,!1]}};function dS(e){for(let t in e)return!1;return!0}var pS=2147483647/1e3-1,fS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i,selectors:{selectQueryEntry:o,selectConfig:s}})=>{let{removeQueryResult:u,unsubscribeQueryResult:c,cacheEntriesUpserted:a}=t.internalActions,y=$e(c.match,r.fulfilled,r.rejected,a.match);function h(E){let b=i.currentSubscriptions[E];return!!b&&!dS(b)}let S={},m=(E,b,P)=>{let w=b.getState(),I=s(w);if(y(E)){let j;if(a.match(E))j=E.payload.map(F=>F.queryDescription.queryCacheKey);else{let{queryCacheKey:F}=c.match(E)?E.payload:E.meta.arg;j=[F]}v(j,b,I)}if(t.util.resetApiState.match(E))for(let[j,F]of Object.entries(S))F&&clearTimeout(F),delete S[j];if(n.hasRehydrationInfo(E)){let{queries:j}=n.extractRehydrationInfo(E);v(Object.keys(j),b,I)}};function v(E,b,P){let w=b.getState();for(let I of E){let j=o(w,I);R(I,j?.endpointName,b,P)}}function R(E,b,P,w){let j=n.endpointDefinitions[b]?.keepUnusedDataFor??w.keepUnusedDataFor;if(j===1/0)return;let F=Math.max(0,Math.min(j,pS));if(!h(E)){let k=S[E];k&&clearTimeout(k),S[E]=setTimeout(()=>{h(E)||P.dispatch(u({queryCacheKey:E})),delete S[E]},F*1e3)}}return m},wl=new Error("Promise never resolved before cacheEntryRemoved."),gS=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:s,selectApiState:u}})=>{let c=En(n),a=En(i),y=tt(n,i),h={};function S(b,P,w){let I=h[b];I?.valueResolved&&(I.valueResolved({data:P,meta:w}),delete I.valueResolved)}function m(b){let P=h[b];P&&(delete h[b],P.cacheEntryRemoved())}let v=(b,P,w)=>{let I=R(b);function j(F,k,O,T){let M=s(w,k),B=s(P.getState(),k);!M&&B&&E(F,T,k,P,O)}if(n.pending.match(b))j(b.meta.arg.endpointName,I,b.meta.requestId,b.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(b))for(let{queryDescription:F,value:k}of b.payload){let{endpointName:O,originalArgs:T,queryCacheKey:M}=F;j(O,M,b.meta.requestId,T),S(M,k,{})}else if(i.pending.match(b))P.getState()[t].mutations[I]&&E(b.meta.arg.endpointName,b.meta.arg.originalArgs,I,P,b.meta.requestId);else if(y(b))S(I,b.payload,b.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(b)||e.internalActions.removeMutationResult.match(b))m(I);else if(e.util.resetApiState.match(b))for(let F of Object.keys(h))m(F)};function R(b){return c(b)?b.meta.arg.queryCacheKey:a(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:e.internalActions.removeQueryResult.match(b)?b.payload.queryCacheKey:e.internalActions.removeMutationResult.match(b)?tn(b.payload):""}function E(b,P,w,I,j){let F=r.endpointDefinitions[b],k=F?.onCacheEntryAdded;if(!k)return;let O={},T=new Promise(V=>{O.cacheEntryRemoved=V}),M=Promise.race([new Promise(V=>{O.valueResolved=V}),T.then(()=>{throw wl})]);M.catch(()=>{}),h[w]=O;let B=e.endpoints[b].select(F.type==="query"?P:w),U=I.dispatch((V,L,$)=>$),_={...I,getCacheEntry:()=>B(I.getState()),requestId:j,extra:U,updateCachedData:F.type==="query"?V=>I.dispatch(e.util.updateQueryData(b,P,V)):void 0,cacheDataLoaded:M,cacheEntryRemoved:T},N=k(P,_);Promise.resolve(N).catch(V=>{if(V!==wl)throw V})}return v},mS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,i)=>{e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},yS=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:o,assertTagType:s,refetchQuery:u,internalState:c})=>{let{removeQueryResult:a}=o.internalActions,y=$e(tt(n),Ur(n)),h=$e(tt(n,i),Ot(n,i)),S=[],m=(E,b)=>{y(E)?R(Fl(E,"invalidatesTags",r,s),b):h(E)?R([],b):o.util.invalidateTags.match(E)&&R(Ts(E.payload,void 0,void 0,void 0,void 0,s),b)};function v(E){let{queries:b,mutations:P}=E;for(let w of[b,P])for(let I in w)if(w[I]?.status==="pending")return!0;return!1}function R(E,b){let P=b.getState(),w=P[e];if(S.push(...E),w.config.invalidationBehavior==="delayed"&&v(w))return;let I=S;if(S=[],I.length===0)return;let j=o.util.selectInvalidatedBy(P,I);t.batch(()=>{let F=Array.from(j.values());for(let{queryCacheKey:k}of F){let O=w.queries[k],T=c.currentSubscriptions[k]??{};O&&(lr(T)===0?b.dispatch(a({queryCacheKey:k})):O.status!=="uninitialized"&&b.dispatch(u(O)))}})}return m},hS=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{let o={},s=(m,v)=>{(r.internalActions.updateSubscriptionOptions.match(m)||r.internalActions.unsubscribeQueryResult.match(m))&&a(m.payload,v),(t.pending.match(m)||t.rejected.match(m)&&m.meta.condition)&&a(m.meta.arg,v),(t.fulfilled.match(m)||t.rejected.match(m)&&!m.meta.condition)&&c(m.meta.arg,v),r.util.resetApiState.match(m)&&h()};function u(m,v){let E=v.getState()[e].queries[m],b=i.currentSubscriptions[m];if(!(!E||E.status==="uninitialized"))return b}function c({queryCacheKey:m},v){let R=v.getState()[e],E=R.queries[m],b=i.currentSubscriptions[m];if(!E||E.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:w}=S(b);if(!Number.isFinite(P))return;let I=o[m];I?.timeout&&(clearTimeout(I.timeout),I.timeout=void 0);let j=Date.now()+P;o[m]={nextPollTimestamp:j,pollingInterval:P,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(E)),c({queryCacheKey:m},v)},P)}}function a({queryCacheKey:m},v){let E=v.getState()[e].queries[m],b=i.currentSubscriptions[m];if(!E||E.status==="uninitialized")return;let{lowestPollingInterval:P}=S(b);if(!Number.isFinite(P)){y(m);return}let w=o[m],I=Date.now()+P;(!w||I<w.nextPollTimestamp)&&c({queryCacheKey:m},v)}function y(m){let v=o[m];v?.timeout&&clearTimeout(v.timeout),delete o[m]}function h(){for(let m of Object.keys(o))y(m)}function S(m={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let E in m)m[E].pollingInterval&&(R=Math.min(m[E].pollingInterval,R),v=m[E].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return s},SS=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let i=xn(r,n),o=Ot(r,n),s=tt(r,n),u={};return(a,y)=>{if(i(a)){let{requestId:h,arg:{endpointName:S,originalArgs:m}}=a.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let E={},b=new Promise((j,F)=>{E.resolve=j,E.reject=F});b.catch(()=>{}),u[h]=E;let P=e.endpoints[S].select(v.type==="query"?m:h),w=y.dispatch((j,F,k)=>k),I={...y,getCacheEntry:()=>P(y.getState()),requestId:h,extra:w,updateCachedData:v.type==="query"?j=>y.dispatch(e.util.updateQueryData(S,m,j)):void 0,queryFulfilled:b};R(m,I)}}else if(s(a)){let{requestId:h,baseQueryMeta:S}=a.meta;u[h]?.resolve({data:a.payload,meta:S}),delete u[h]}else if(o(a)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:m}=a.meta;u[h]?.reject({error:a.payload??a.error,isUnhandledError:!S,meta:m}),delete u[h]}}},vS=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{let{removeQueryResult:o}=r.internalActions,s=(c,a)=>{ks.match(c)&&u(a,"refetchOnFocus"),Ps.match(c)&&u(a,"refetchOnReconnect")};function u(c,a){let y=c.getState()[e],h=y.queries,S=i.currentSubscriptions;t.batch(()=>{for(let m of Object.keys(S)){let v=h[m],R=S[m];if(!R||!v)continue;(Object.values(R).some(b=>b[a]===!0)||Object.values(R).every(b=>b[a]===void 0)&&y.config[a])&&(lr(R)===0?c.dispatch(o({queryCacheKey:m})):v.status!=="uninitialized"&&c.dispatch(n(v)))}})}return s};function AS(e){let{reducerPath:t,queryThunk:r,api:n,context:i}=e,{apiUid:o}=i,s={invalidateTags:Q(`${t}/invalidateTags`)},u=h=>h.type.startsWith(`${t}/`),c=[mS,fS,yS,hS,gS,SS];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:u},R=c.map(P=>P(v)),E=lS(v),b=vS(v);return P=>w=>{if(!yn(w))return P(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(o)));let I={...h,next:P},j=h.getState(),[F,k]=E(w,I,j),O;if(F?O=P(w):O=k,h.getState()[t]&&(b(w,I,j),u(w)||i.hasRehydrationInfo(w)))for(let T of R)T(w,I,j);return O}},actions:s};function y(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Rl=Symbol(),CS=({createSelector:e=ae}={})=>({name:Rl,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:s,refetchOnMountOrArgChange:u,refetchOnFocus:c,refetchOnReconnect:a,invalidationBehavior:y},h){rc();let S=J=>(typeof process<"u",J);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Ps,onOffline:Pl,onFocus:ks,onFocusLost:kl},util:{}});let m=cS({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:E,buildInfiniteQuerySelector:b,buildMutationSelector:P}=m;it(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:I,mutationThunk:j,patchQueryData:F,updateQueryData:k,upsertQueryData:O,prefetch:T,buildMatchThunkActions:M}=sS({baseQuery:r,reducerPath:i,context:h,api:t,serializeQueryArgs:o,assertTagType:S,selectors:m}),{reducer:B,actions:U}=aS({context:h,queryThunk:w,infiniteQueryThunk:I,mutationThunk:j,serializeQueryArgs:o,reducerPath:i,assertTagType:S,config:{refetchOnFocus:c,refetchOnReconnect:a,refetchOnMountOrArgChange:u,keepUnusedDataFor:s,reducerPath:i,invalidationBehavior:y}});it(t.util,{patchQueryData:F,updateQueryData:k,upsertQueryData:O,prefetch:T,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),it(t.internalActions,U);let{middleware:_,actions:N}=AS({reducerPath:i,context:h,queryThunk:w,mutationThunk:j,infiniteQueryThunk:I,api:t,assertTagType:S,selectors:m});it(t.util,N),it(t,{reducer:B,middleware:_});let{buildInitiateQuery:V,buildInitiateInfiniteQuery:L,buildInitiateMutation:$,getRunningMutationThunk:H,getRunningMutationsThunk:G,getRunningQueriesThunk:X,getRunningQueryThunk:ne}=iS({queryThunk:w,mutationThunk:j,infiniteQueryThunk:I,api:t,serializeQueryArgs:o,context:h});return it(t.util,{getRunningMutationThunk:H,getRunningMutationsThunk:G,getRunningQueryThunk:ne,getRunningQueriesThunk:X}),{name:Rl,injectEndpoint(J,Z){var le;let te=(le=t.endpoints)[J]??(le[J]={});Os(Z)&&it(te,{name:J,select:E(J,Z),initiate:V(J,Z)},M(w,J)),tS(Z)&&it(te,{name:J,select:P(),initiate:$(J)},M(j,J)),Fs(Z)&&it(te,{name:J,select:b(J,Z),initiate:L(J,Z)},M(w,J))}}}}),Dl=uS(CS());var bS=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:i,environment:o,organizationId:s}=n.configuration,u=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${i}`}};try{let a=pe(s,o);return{data:El({baseUrl:`${a}/rest/organizations/${s}/answer/v1/configs/${u}`,fetchFn:function(){var _ref20=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,m={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{m[v]=h[v]}),m.duplex="half",m.body=yield h.text(),C(S,m)});return function fetchFn(_x48){return _ref20.apply(this,arguments)}}()})(c,{...t,signal:null},r)}}catch(a){return{error:a}}});return function bS(_x45,_x46,_x47){return _ref19.apply(this,arguments)}}(),ql=Dl({reducerPath:"answer",baseQuery:Il(bS,{maxRetries:3}),endpoints:()=>({})});var wS=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},RS=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},xS=(e,t)=>{e.citations=t.citations},ES=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},IS=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},kS=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&IS(t,n);let i=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":i.contentFormat&&(wS(t,i),r(us(i.contentFormat)));break;case"genqa.messageType":i.textDelta&&(RS(t,i),r(as({textDelta:i.textDelta})));break;case"genqa.citationsType":i.citations&&(xS(t,i),r(cs({citations:i.citations})));break;case"genqa.endOfStreamType":ES(t,i),r(ai(i.answerGenerated??!1));break}},jl=ql.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,...i}=r;return`${t}(${JSON.stringify(i)})`},onCacheEntryAdded(_x49,_x50){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:i,dispatch:o}){yield n;let{configuration:s,generatedAnswer:u,insightConfiguration:c}=r(),{organizationId:a,environment:y,accessToken:h}=s,S=pe(a,y),m=`${S}/rest/organizations/${a}/insight/v1/configs/${c?.insightId}/answer/${u.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${a}/answer/v1/configs/${u.answerConfigurationId}/generate`;yield dl(c?m:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:C,onopen:function(){var _ref21=_asyncToGenerator(function*(R){let E=R.headers.get("x-answer-id");E&&i(b=>{b.answerId=E})});return function onopen(_x51){return _ref21.apply(this,arguments)}}(),onmessage:R=>{i(E=>{kS(R,E,o)})},onerror:R=>{throw R},onclose:()=>{i(R=>{o(ls(!R.generated))})}})}).apply(this,arguments)}})})}),Sq=ae(e=>Qu(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,i)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:i}));g();d();f();p();var Ml=fe(Jt,e=>e);g();d();f();p();function PS(e){let t=e.payload?.analyticsAction;return Nl(e)&&!Y(t)}function Nl(e){return"type"in e}var _l=e=>t=>r=>{let n;PS(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let i=t(r);return Nl(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),i};g();d();f();p();g();d();f();p();g();d();f();p();var Uq=Q("tab/register",e=>{let t=new ce({values:{id:ee,expression:Ve}});return z(e,t)}),Ll=Q("tab/updateActiveTab",e=>z(e,ee));g();d();f();p();var fi=_e(ci(),1),Ql=_e(Ul(),1),Bl=_e(Vl(),1);fi.default.extend(Bl.default);fi.default.extend(Ql.default);var $l=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:fi.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"});g();d();f();p();var OS=/(^|; )Coveo-Pendragon=([^;]*)/;function Ns(){return typeof window>"u"?!1:OS.exec(document.cookie)?.pop()||null}var Hl=fe($l(),e=>e.addCase(Tt,(t,r)=>{FS(t,r.payload)}).addCase(Dn,(t,r)=>{TS(t,r.payload)}).addCase(qn,(t,r)=>{DS(t,r.payload)}).addCase(jn,t=>{t.analytics.enabled=!1}).addCase(Mn,t=>{t.analytics.enabled=!0}).addCase(Dc,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(qc,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Ll,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Ic,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(On,(t,r)=>{Y(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function FS(e,t){Y(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",Y(t.organizationId)||(e.organizationId=t.organizationId)}function TS(e,t){Y(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),Y(t.locale)||(e.search.locale=t.locale),Y(t.timezone)||(e.search.timezone=t.timezone),Y(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function DS(e,t){Y(t.enabled)||(e.analytics.enabled=t.enabled),Y(t.originContext)||(e.analytics.originContext=t.originContext),Y(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),Y(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),Y(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),Y(t.trackingId)||(e.analytics.trackingId=t.trackingId),Y(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),Y(t.source)||(e.analytics.source=t.source);try{let r=Ns();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}Y(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),Y(t.anonymous)||(e.analytics.anonymous=t.anonymous),Y(t.deviceId)||(e.analytics.deviceId=t.deviceId),Y(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),Y(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Te=Hl;g();d();f();p();function qS(e){return e.instantlyCallable}var zl=()=>e=>t=>e(qS(t)?t():t);g();d();f();p();var Gl=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let i=n.error,o=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(o||i.stack||i.message||i.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},Wl=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));g();d();f();p();function Yl(e,t){let r={...e},n,i=o=>(s,u)=>{let c=o(s,u);return n?n(c,u):c};return{get combinedReducer(){let o=Oa(Object.entries(t).filter(([s])=>!(s in r)).map(([s,u])=>[s,()=>u]));return i(zt({...o,...r}))},containsAll(o){return Object.keys(o).every(u=>u in r)},add(o){Object.keys(o).filter(s=>!(s in r)).forEach(s=>{r[s]=o[s]})},addCrossReducer(o){n=o}}}g();d();f();p();g();d();f();p();function gi(e,t,r){var n,i,o;t===void 0&&(t=50),r===void 0&&(r={});var s=(n=r.isImmediate)!=null&&n,u=(i=r.callback)!=null&&i,c=r.maxWait,a=Date.now(),y=[];function h(){if(c!==void 0){var m=Date.now()-a;if(m+t>=c)return c-m}return t}var S=function(){var m=[].slice.call(arguments),v=this;return new Promise(function(R,E){var b=s&&o===void 0;if(o!==void 0&&clearTimeout(o),o=setTimeout(function(){if(o=void 0,a=Date.now(),!s){var w=e.apply(v,m);u&&u(w),y.forEach(function(I){return(0,I.resolve)(w)}),y=[]}},h()),b){var P=e.apply(v,m);return u&&u(P),R(P)}y.push({resolve:R,reject:E})})};return S.cancel=function(m){o!==void 0&&clearTimeout(o),y.forEach(function(v){return(0,v.reject)(m)}),y=[]},S}g();d();f();p();var fr=Q("app/setError");g();d();f();p();function jS(e){if(!e||!MS(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),i=decodeURIComponent(n.split("").map(o=>`%${`00${o.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(i)}catch{return null}}function Kl(e,t=60){if(!e)return!1;let r=jS(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function MS(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Xl(e,t){let r=0,n=gi(()=>{r=0},500);return i=>o=>(/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(s){if(!(typeof s=="function"))return o(s);let c=typeof t=="function";if(c){let h=i.getState(),S=LS(h);if(S&&Kl(S)){e.debug("Access token is expired or about to expire, attempting renewal.");try{let m=yield t();m?(i.dispatch(Tt({accessToken:m})),e.debug("Access token was renewed.")):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(m){e.warn(m,"Access token renewal failed. A retry will occur if necessary.")}}}let a=yield o(s);if(!NS(a))return a;if(!c)return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Jl(i,a.error),a;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Jl(i,a.error),a;r++,n();let y=yield _S(t);i.dispatch(Tt({accessToken:y})),i.dispatch(s)});return function(_x52){return _ref22.apply(this,arguments)}}())}function NS(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Qt().name}function Jl(e,t){e.dispatch(fr({status:401,statusCode:401,message:t.message,type:t.name}))}function _S(_x53){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _S2.apply(this,arguments)}function LS(e){return e.configuration.accessToken}g();d();f();p();function Zl({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:i}){return gc({reducer:e,preloadedState:t,devTools:{stateSanitizer:o=>o.history?{...o,history:"<<OMIT>>"}:o,name:i,shouldHotReload:!1},middleware:o=>o({thunk:{extraArgument:n}}).prepend(...r).concat(Wl(n.logger))})}function US(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...i}=r??{},o={...i,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return o.analyticsMode!=="next"&&Pa()?(t.info("Analytics disabled since doNotTrack is active."),{...o,enabled:!1}):o}function ed(e,t){let r={...e.reducers,configuration:Te,version:Ml},n=VS({...e,reducers:r},t,Te),{accessToken:i,environment:o,organizationId:s}=e.configuration;n.dispatch(Tt({accessToken:i,environment:o,organizationId:s}));let u=US(e.configuration,n.logger);return u&&n.dispatch(qn(u)),n}function VS(e,t,r){let{reducers:n,navigatorContextProvider:i}=e,o=Yl({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&o.addCrossReducer(e.crossReducer);let s=t.logger,u={...t,get relay(){return Vr(a.state,i)},get navigatorContext(){return Oo(this.relay,i)}},c=QS(e,u,o),a={addReducers(y){o.containsAll(y)||(o.add(y),c.replaceReducer(o.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(Mn())},disableAnalytics(){c.dispatch(jn())},get state(){return c.getState()},get relay(){return Vr(this.state,i)},get navigatorContext(){return Oo(this.relay,i)},logger:s,store:c};return a}function QS(e,t,r){let{preloadedState:n,configuration:i}=e,o=i.name||"coveo-headless",s=BS(e,t.logger);return Zl({preloadedState:n,reducer:r.combinedReducer,middlewares:s,thunkExtraArguments:t,name:o})}function BS(e,t){let{renewAccessToken:r}=e.configuration,n=Xl(t,r);return[zl,n,Gl(t),_l].concat(jl.middleware,e.middlewares||[])}var $S=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
30
+ `;function xh(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Eh=["1",1,"yes",!0];function Wn(){let e=[];return qo()&&e.push(window.doNotTrack),Go()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Eh.indexOf(t)!==-1)}var gu="v15",mu={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 Ih(e=mu.default,t=gu,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 kh="38824e1f-37f5-42d3-8372-a4b8fa9df946",He=class{get defaultOptions(){return{endpoint:mu.default,isCustomEndpoint:!1,token:"",version:gu,beforeSendHooks:[],afterSendHooks:[]}}get version(){return lu}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=[hm,dm].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};Wn()?this.runtime=new Gn:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(re.view,{newEventType:re.view,addClientIdParameter:!0}),this.addEventTypeMapping(re.click,{newEventType:re.click,addClientIdParameter:!0}),this.addEventTypeMapping(re.custom,{newEventType:re.custom,addClientIdParameter:!0}),this.addEventTypeMapping(re.search,{newEventType:re.search,addClientIdParameter:!0})}initRuntime(t){return qo()&&er()?new Ho(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(xh()&&console.warn(Rh),new zo(t))}get storage(){return this.runtime.storage}determineVisitorId(){return D(this,void 0,void 0,function*(){try{return qo()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Tt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Tt()}})}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(Bn(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Jc(t,Jc(r,kh)))}})}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(Tt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Wn())return null;try{let r=new URL(t).searchParams.get(ut.cvo_cid);if(r==null)return null;let n=ut.fromString(r);return!n||!er()||!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:i=!1,usesMeasurementProtocol:o=!1,addClientIdParameter:s=!1}=this.eventTypeMapping[t]||{};return yield[m=>n.length>0?this.parseVariableArgumentsPayload(n,m):m[0],m=>D(this,void 0,void 0,function*(){return Object.assign(Object.assign({},m),{visitorId:i?yield this.getCurrentVisitorId():""})}),m=>D(this,void 0,void 0,function*(){return s?Object.assign(Object.assign({},m),{clientId:yield this.getCurrentVisitorId()}):m}),m=>o?this.ensureAnonymousUserWhenUsingApiKey(m):m,m=>this.beforeSendHooks.reduce((v,R)=>D(this,void 0,void 0,function*(){let E=yield v;return yield R(t,E)}),m)].reduce((m,v)=>D(this,void 0,void 0,function*(){let R=yield m;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return D(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[y=>this.setTrackingIdIfTrackingIdNotPresent(y),y=>this.removeEmptyPayloadValues(y,t),y=>this.validateParams(y,t),y=>n?gh(y):y,y=>n?this.removeUnknownParameters(y):y,y=>n?this.processCustomParameters(y):this.mapCustomParametersToCustomData(y)].reduce((y,S)=>D(this,void 0,void 0,function*(){let m=yield y;return yield S(m)}),Promise.resolve(r))})}makeEvent(t,...r){return D(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},i=yield this.resolveParameters(t,...r),o=yield this.resolvePayloadForParameters(t,i);return{eventType:n,payload:o,log:s=>D(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},o),s)}),yield Promise.all(this.afterSendHooks.map(u=>u(t,Object.assign(Object.assign({},i),s)))),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 Qn().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=tt(t,["searchQueryUid"]);return D(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=tt(t,["searchQueryUid"]);return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=tt(t,["lastSearchQueryUid"]);return D(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(re.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 C(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return D(this,void 0,void 0,function*(){return yield(yield C(`${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 i=0,o=r.length;i<o;i++){let s=r[i];if(typeof s=="string")n[t[i]]=s;else if(typeof s=="object")return Object.assign(Object.assign({},n),s)}return n}isKeyAllowedEmpty(t,r){return({[re.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=i=>typeof i<"u"&&i!==null&&i!=="";return Object.keys(t).filter(i=>this.isKeyAllowedEmpty(r,i)||n(t[i])).reduce((i,o)=>Object.assign(Object.assign({},i),{[o]:t[o]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Sh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,i)=>Object.assign(Object.assign({},n),{[i]:t[i]}),{})}processCustomParameters(t){let{custom:r}=t,n=tt(t,["custom"]),i={};r&&Vn(r)&&(i=this.lowercaseKeys(r));let o=vh(n);return Object.assign(Object.assign({},i),o)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=tt(t,["custom"]);if(r&&Vn(r)){let i=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},i),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(i=>{n[i.toLowerCase()]=t[i]}),n}validateParams(t,r){let{anonymizeIp:n}=t,i=tt(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(i.anonymizeIp=1),(r==re.view||r==re.click||r==re.search||r==re.custom)&&(i.originLevel3=this.limit(i.originLevel3,1024)),r==re.view&&(i.location=this.limit(i.location,1024)),(r=="pageview"||r=="event")&&(i.referrer=this.limit(i.referrer,2048),i.location=this.limit(i.location,2048),i.page=this.limit(i.page,2048)),i}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=tt(t,["userId"]);return wh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=tt(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Vn(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Vn(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"?Fm(t,r):t}get baseUrl(){return Ih(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},rt;(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"})(rt||(rt={}));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 iu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryError]:"errors",[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",[rt.expandToFullUI]:"interface",[rt.openUserActions]:"User Actions",[rt.showPrecedingSessions]:"User Actions",[rt.showFollowingSessions]:"User Actions",[rt.clickViewedDocument]:"User Actions",[rt.clickPageView]:"User Actions",[rt.createArticle]:"createArticle"},nr=class{constructor(){this.runtime=new Gn,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(re.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(re.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(re.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(re.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return lu}};function Ph(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Oh(e){return e.map(t=>t.replace(/;/g,""))}function hu(e){let r=e.join(";");return r.length<=256?r:hu(e.slice(1))}var ou=e=>{let t=Oh(e),r=Ph(t);return hu(r)};function su(e){let t=typeof e.partialQueries=="string"?e.partialQueries:ou(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:ou(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Yn=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Wn();this.coveoAnalyticsClient=n?new nr:new He(t)}disable(){this.coveoAnalyticsClient=new nr}enable(){this.coveoAnalyticsClient=new He(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,su(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,su(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,n=iu[t]){return D(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),o=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:n,eventValue:t}),s=yield this.coveoAnalyticsClient.makeCustomEvent(o);return{description:this.makeEventDescription(s,t),log:({searchUID:u})=>s.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r,n=iu[t]){return D(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),o=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:r,eventValue:t}),s=yield this.coveoAnalyticsClient.makeCustomEvent(o);return{description:this.makeEventDescription(s,t),log:({searchUID:u})=>s.log({lastSearchQueryUid:u})}})}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),i=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(i,t),log:({searchUID:o})=>i.log({searchQueryUid:o})}})}makeClickEvent(t,r,n,i){return D(this,void 0,void 0,function*(){let o=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),i))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),s=yield this.coveoAnalyticsClient.makeClickEvent(o);return{description:this.makeEventDescription(s,t),log:({searchUID:u})=>s.log({searchQueryUid:u})}})}logClickEvent(t,r,n,i){return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,i)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,i;return D(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(i=(n=this.provider).getGeneratedAnswerMetadata)===null||i===void 0?void 0:i.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 He?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()})})}},Kn=Object.assign({},Br),au=Object.keys(Kn).map(e=>Kn[e]),tr=class extends No{constructor({client:t,uuidGenerator:r=Tt}){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])=>au.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(au.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Kn.pageview,{newEventType:re.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Kn.event,{newEventType:re.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let i=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}:{}),o=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},o),i),r)}getTicketPayload(){return Mm(this.ticket)}};tr.Id="svc";var Jn;(function(e){e.click="click",e.flowStart="flowStart"})(Jn||(Jn={}));var qe;(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"})(qe||(qe={}));var Xn;(function(e){e.quit="Quit",e.solved="Solved"})(Xn||(Xn={}));var Zn=class{constructor(t,r){var n;this.options=t,this.provider=r;let i=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Wn();this.coveoAnalyticsClient=i?new He(t):new nr,this.svc=new tr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new nr,this.svc=new tr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new He(this.options),this.svc=new tr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(qe.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(qe.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(qe.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(qe.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(qe.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(qe.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(qe.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(qe.caseCancelled,{reason:Xn.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(qe.caseSolved,{reason:Xn.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(qe.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Jn.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Jn.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return D(this,void 0,void 0,function*(){let i=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:i,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 He?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,i,o;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:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel2(),originLevel3:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel3()}}logClickEvent(t,r,n,i){var o,s;return D(this,void 0,void 0,function*(){let u=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),i))),{searchQueryUid:(s=(o=this.provider)===null||o===void 0?void 0:o.getSearchUID())!==null&&s!==void 0?s:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(u)})}};g();d();f();p();var Fh=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Dt=class{constructor(t){this.getState=t;se(this,"state");this.state=t()}getLanguage(){return Fh(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},i={};for(let[o,s]of Object.entries(n)){let u=`context_${o}`;i[u]=s}return r.analytics.analyticsMode==="legacy"&&(i.coveoHeadlessVersion=Jt),i}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Xt()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};g();d();f();p();var ir=e=>new He(e).getCurrentVisitorId(),zr=(e,t)=>typeof t=="function"?(...r)=>{let n=Pr(r[0]);try{return t.apply(t,r)}catch(i){return e.error(i,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Gr=(e,t)=>(...r)=>{let n=Pr(r[1]);try{return t.apply(t,r)}catch(i){return e.error(i,"Error in analytics hook. Returning original request."),n}};var Wr=class extends Dt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},yu=({logger:e,getState:t,analyticsClientMiddleware:r=(o,s)=>s,preprocessRequest:n,provider:i=new Wr(t)})=>{let o=t(),s=o.configuration.accessToken,u=o.configuration.analytics.apiBaseUrl??pe(o.configuration.organizationId,o.configuration.environment,"analytics"),c=o.configuration.analytics.runtimeEnvironment,a=o.configuration.analytics.enabled,h=new Zn({enableAnalytics:a,token:s,endpoint:u,runtimeEnvironment:c,preprocessRequest:zr(e,n),beforeSendHooks:[Gr(e,r),(y,S)=>(e.info({...S,type:y,endpoint:u,token:s},"Analytics request"),S)]},i);return a||h.disable(),h};g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();function ei(){return{desiredCount:5,numberOfValues:8,set:{}}}g();d();f();p();g();d();f();p();g();d();f();p();function Su(e){let{activeValue:t,ancestryMap:r}=qh(e);return t?jh(t,r):[]}function qh(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 i of n.children)r.set(i,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 Mh=(e,t)=>e.categoryFacetSet[t]?.request;var Wo=(e,t)=>{let r=Mh(e,t);return Su(r?.currentValues??[])};g();d();f();p();function ti(){return{}}g();d();f();p();function ri(){return{}}g();d();f();p();function ni(){return{}}g();d();f();p();function ii(){return{}}function Yo(e){return{facetSet:e.facetSet??ii(),categoryFacetSet:e.categoryFacetSet??ti(),dateFacetSet:e.dateFacetSet??ri(),numericFacetSet:e.numericFacetSet??ni(),automaticFacetSet:e.automaticFacetSet??ei()}}var Ko=e=>{let t=[];return Lh(e).forEach((r,n)=>{let i=Gh(e,r.facetId),o=Hh(r,n+1);if(_h(r)){if(!!!Wo(e,r.facetId).length)return;t.push({...o,...Bh(e,r.facetId),facetType:i,state:"selected"});return}r.currentValues.forEach((s,u)=>{if(s.state==="idle")return;let c=vu(s,u+1,i),a=Nh(r)?Au(s):Vh(s);t.push({...o,...c,...a})})}),Uh(e).forEach((r,n)=>{let i=$h(r,n+1);r.values.forEach((o,s)=>{if(o.state==="idle")return;let u=vu(o,s+1,"specific"),c=Au(o);t.push({...i,...u,...c})})}),t},Nh=e=>e.type==="specific",_h=e=>e.type==="hierarchical",Lh=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),Uh=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),vu=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Vh=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Au=e=>({displayValue:e.value,value:e.value}),Qh=(e,t)=>Wo(e,t).map(n=>n.value).join(";"),Bh=(e,t)=>{let n=Qh(e,t);return{value:n,valuePosition:1,displayValue:n}},$h=(e,t)=>({title:Cu(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Hh=(e,t)=>({title:Cu(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Cu=(e,t)=>`${e}_${t}`,zh=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Gh=(e,t)=>{let r=zh(e,t);return r?r.type:"specific"};g();d();f();p();var or=e=>{if(Wh(e)){let t=Object.values(e.answer.queries).pop()?.data;return typeof t=="object"&&t!==null&&"answerId"in t?t.answerId:void 0}if(Yh(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},Wh=e=>"answer"in e&&"generatedAnswer"in e&&!Y(e.generatedAnswer?.answerConfigurationId),Yh=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object";var Kh=ae(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));g();d();f();p();var Ve=()=>({q:"",enableQuerySyntax:!1});g();d();f();p();function Jo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ze(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Jo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Jo(),extendedResults:{},searchAction:void 0}}g();d();f();p();g();d();f();p();g();d();f();p();var bu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(bu||{}),wu=(o=>(o.Relevancy="relevancy",o.QRE="qre",o.Date="date",o.Field="field",o.NoSort="nosort",o))(wu||{}),Xo=e=>{if(Ua(e))return e.map(t=>Xo(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""}},Ru=()=>({by:"relevancy"});var eO=new ce({values:{by:new Zi({enum:wu,required:!0}),order:new Zi({enum:bu}),field:new W}});function oi(){return Xo(Ru())}g();d();f();p();g();d();f();p();g();d();f();p();var sr=class e{static set(t,r,n){let i,o,s;n&&(o=new Date,o.setTime(o.getTime()+n));let u=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,a=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(u)||a.test(u)||u.indexOf(".")===-1?Zo(t,r,o):(s=u.split("."),i=s[s.length-2]+"."+s[s.length-1],Zo(t,r,o,i))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let o=n[i];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function Zo(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}g();d();f();p();function Jh(){return typeof navigator<"u"}function xu(){try{return typeof localStorage<"u"}catch{return!1}}function Eu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Iu(){return!!(Jh()&&navigator.cookieEnabled)}var ku=null;function Pu(){return ku||(xu()?localStorage:Iu()?new es:Eu()?sessionStorage:new ts)}var ar=class ar{getItem(t){return sr.get(`${ar.prefix}${t}`)}removeItem(t){sr.erase(`${ar.prefix}${t}`)}setItem(t,r,n){sr.set(`${ar.prefix}${t}`,r,n)}};se(ar,"prefix","coveo_");var es=ar;var ts=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var si="__coveo.analytics.history",Xh=20,Zh=1e3*60,ey=75,qt=class qt{constructor(t){se(this,"store");this.store=t||Pu()}static getInstance(t){return qt.instance||(qt.instance=new qt(t)),qt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this4=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this4.cropQueryElement(_this4.stripEmptyQuery(t));let r=yield _this4.getHistoryWithInternalTimeAsync();r!==null?_this4.isValidEntry(t)&&_this4.setHistory([t].concat(r)):_this4.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this5=this;return _asyncToGenerator(function*(){let t=yield _this5.getHistoryWithInternalTimeAsync();return _this5.stripEmptyQueries(_this5.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(si);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this6=this;return _asyncToGenerator(function*(){try{let t=yield _this6.store.getItem(si);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(si,JSON.stringify(t.slice(0,Xh)))}catch{}}clear(){try{this.store.removeItem(si)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,i)=>(i.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,ey)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Zh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:i,value:o}=r;return{name:n,time:i,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:i}=t;return r&&typeof i=="string"&&r.toLowerCase()==="query"&&i.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};se(qt,"instance",null);var rs=qt,lt=rs;var Yr=class Yr extends Dt{constructor(){super(...arguments);se(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 Ko(Yo(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Yr.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||ze().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Yr.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),i=or(r);return i&&(n.generativeQuestionAnsweringId=i),n}getFacetMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetValue:n,facetTitle:`${o}_${r}`}}getFacetClearAllMetadata(r){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetTitle:`${i}_${r}`}}getFacetUpdateSortMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,criteria:n,facetTitle:`${o}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${o}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??oi()}}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 o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:o,categoryFacetPath:n,categoryFacetTitle:`${o}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let i=this.state.querySuggest?.[r],o=i.completions.map(a=>a.expression),s=i.partialQueries.length-1,u=i.partialQueries[s]||"",c=i.responseId;return{...this.getBaseMetadata(),suggestionRanking:o.indexOf(n),partialQuery:u,partialQueries:i.partialQueries.length>0?i.partialQueries:"",suggestions:o.length>0?o:"",querySuggestResponseId:c}}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||Ve().q}get responseTime(){return this.state.search?.duration||ze().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ze().response.totalCountFiltered}};se(Yr,"fallbackPipelineName","default");var dt=Yr,Ou=({logger:e,getState:t,analyticsClientMiddleware:r=(o,s)=>s,preprocessRequest:n,provider:i})=>{let o=t(),s=o.configuration.accessToken,u=o.configuration.analytics.apiBaseUrl??pe(o.configuration.organizationId,o.configuration.environment,"analytics"),c=o.configuration.analytics.runtimeEnvironment,a=o.configuration.analytics.enabled,h=new Yn({token:s,endpoint:u,runtimeEnvironment:c,preprocessRequest:zr(e,n),beforeSendHooks:[Gr(e,r),(y,S)=>(e.info({...S,type:y,endpoint:u,token:s},"Analytics request"),S)]},i);return a||h.disable(),h},ns=()=>{let t=lt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};g();d();f();p();function Fu(e){let t=Tu(e),r=[e,...t].filter(i=>i.parentResult).map(i=>i.parentResult);return Pa([e,...t,...r],i=>i.uniqueId)}function Tu(e){return e.childResults?e.childResults.flatMap(t=>[t,...Tu(t)]):[]}g();d();f();p();var ai=()=>"";function Du(e,t){return{...new dt(t).getBaseMetadata(),actionCause:e,type:e}}function ty(e){return Object.assign(e,{instantlyCallable:!0})}function ry(e,t){let r=o=>ty(oe(e,o)),n=r(/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(o,{getState:s,extra:u}){let{analyticsClientMiddleware:c,preprocessRequest:a,logger:h}=u;return yield(yield t({getState:s,analyticsClientMiddleware:c,preprocessRequest:a,logger:h})).log({state:s(),extra:u})});return function(_x9,_x0){return _ref7.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref8=_asyncToGenerator(function*({getState:o,analyticsClientMiddleware:s,preprocessRequest:u,logger:c}){let{description:a,log:h}=yield t({getState:o,analyticsClientMiddleware:s,preprocessRequest:u,logger:c});return{description:a,action:r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(y,{getState:S,extra:m}){return yield h({state:S(),extra:m})});return function(_x10,_x11){return _ref9.apply(this,arguments)}}())}});return function prepare(_x1){return _ref8.apply(this,arguments)}}()}),n}var qu=(e,t,r)=>{function n(...i){let o=i.length===1?{...i[0],__legacy__getBuilder:t(i[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:i[0],__legacy__getBuilder:t(i[1]),__legacy__provider:i[2],analyticsConfigurator:e,providerClass:r};return oy(o)}return n},ny=e=>e.configuration.analytics.analyticsMode==="legacy",iy=e=>e.configuration.analytics.analyticsMode==="next",oy=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:i,analyticsConfigurator:o,providerClass:s})=>(r??(r=u=>new s(u)),ry(e,/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*({getState:u,analyticsClientMiddleware:c,preprocessRequest:a,logger:h}){let y=[],S={log:function(){var _ref1=_asyncToGenerator(function*({state:b}){for(let P of y)yield P(b)});return function log(_x13){return _ref1.apply(this,arguments)}}()},m=u(),v=o({getState:u,logger:h,analyticsClientMiddleware:c,preprocessRequest:a,provider:r(u)}),R=yield t(v,u());S.description=R?.description,y.push(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(b){ny(b)&&(yield sy(R,r,b,h,v.coveoAnalyticsClient))});return function(_x14){return _ref10.apply(this,arguments)}}());let{emit:E}=Vr(m);return y.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(b){if(iy(b)&&i&&n){let P=n(b);yield gy(E,i,P)}});return function(_x15){return _ref11.apply(this,arguments)}}()),S});return function(_x12){return _ref0.apply(this,arguments)}}()));function sy(_x16,_x17,_x18,_x19,_x20){return _sy.apply(this,arguments)}function _sy(){_sy=_asyncToGenerator(function*(e,t,r,n,i){t(()=>r);let o=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:i,response:o},"Analytics response")});return _sy.apply(this,arguments)}var ay=e=>r=>(n,i)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref12=_asyncToGenerator(function*(o){r(n,i)});return function log(_x21){return _ref12.apply(this,arguments)}}()}),be=qu(e=>Ou({...e,provider:e.provider||new dt(e.getState)}),e=>e,dt),Oe=qu(yu,ay("caseAssist"),Wr);var is=(e,t)=>{let r=o=>o+(t.pagination?.firstResult??0),n=-1,i=t.search?.results;return n=Nu(e,i),n<0&&(n=fy(e,i)),n<0&&(n=0),cy(e,r(n),t)};function cy(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:dy(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:py(e),queryPipeline:r.pipeline||ai()}}var os=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||""}),ju={urihash:new W,sourcetype:new W,permanentid:new W},Mu={uniqueId:ee,raw:new ce({values:ju}),title:ee,uri:ee,clickUri:ee,rankingModifier:new W({required:!1,emptyAllowed:!0})};function uy(e){return Object.assign({},...Object.keys(ju).map(t=>({[t]:e[t]})))}function ly(e){return Object.assign({},...Object.keys(Mu).map(t=>({[t]:e[t]})),{raw:uy(e.raw)})}function dy(e){let t=e.raw.author;return Y(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function py(e){let t=e.raw.source;return Y(t)?"unknown":t}var ss=e=>new _e(Mu).validate(ly(e));function fy(e,t){for(let[r,n]of t.entries()){let i=Fu(n);if(Nu(e,i)!==-1)return r}return-1}function Nu(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function gy(_x22,_x23,_x24){return _gy.apply(this,arguments)}function _gy(){_gy=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _gy.apply(this,arguments)}g();d();f();p();var ci=e=>be({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=or(r),i=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:i}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:or(t)??"",answerGenerated:e??!1})});g();d();f();p();var _u=/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:pe(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function _u(_x25){return _ref13.apply(this,arguments)}}();g();d();f();p();var Lu=["text/plain","text/markdown"];var cr=new W({required:!0}),Vu=new W,ur=new he({required:!0}),my={id:cr,title:cr,uri:cr,permanentid:cr,clickUri:Vu},Qu=new W({required:!0,constrainTo:Lu}),iT=Q("generatedAnswer/setIsVisible",e=>z(e,ur)),oT=Q("generatedAnswer/setIsEnabled",e=>z(e,ur)),cs=Q("generatedAnswer/updateMessage",e=>z(e,{textDelta:cr})),us=Q("generatedAnswer/updateCitations",e=>z(e,{citations:new Xe({required:!0,each:new ce({values:my})})})),hy=Q("generatedAnswer/updateError",e=>z(e,{message:Vu,code:new Re({min:0})})),yy=Q("generatedAnswer/resetAnswer"),sT=Q("generatedAnswer/like"),aT=Q("generatedAnswer/dislike"),cT=Q("generatedAnswer/feedbackModal/open"),uT=Q("generatedAnswer/expand"),lT=Q("generatedAnswer/collapse"),dT=Q("generatedAnswer/setId",e=>z(e,{id:new W({required:!0})})),pT=Q("generatedAnswer/feedbackModal/close"),fT=Q("generatedAnswer/sendFeedback"),as=Q("generatedAnswer/setIsLoading",e=>z(e,ur)),Uu=Q("generatedAnswer/setIsStreaming",e=>z(e,ur)),ls=Q("generatedAnswer/setAnswerContentFormat",e=>z(e,Qu)),gT=Q("generatedAnswer/updateResponseFormat",e=>z(e,{contentFormat:new Xe({each:Qu,default:["text/plain"]})})),mT=Q("knowledge/updateAnswerConfigurationId",e=>z(e,cr)),hT=Q("generatedAnswer/registerFieldsToIncludeInCitations",e=>z(e,wc)),Sy=Q("generatedAnswer/setIsAnswerGenerated",e=>z(e,ur)),ds=Q("generatedAnswer/setCannotAnswer",e=>z(e,ur)),yT=oe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:i,getState:o}=t,{search:s}=o(),{queryExecuted:u}=s,{setAbortControllerRef:c}=e,a=yield _u(r),h=(m,v)=>{switch(m){case"genqa.headerMessageType":{let R=JSON.parse(v);n(ls(R.contentFormat));break}case"genqa.messageType":n(cs(JSON.parse(v)));break;case"genqa.citationsType":n(us(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,E=u.length!==0&&!R;n(ds(E)),n(Uu(!1)),n(Sy(R)),n(ci(R));break}default:r.debug&&i.logger.warn(`Unknown payloadType: "${m}"`)}};n(as(!0));let y=m=>m.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=i.streamingClient?.streamGeneratedAnswer(a,{write:m=>{y(a)&&(n(as(!1)),m.payload&&m.payloadType&&h(m.payloadType,m.payload))},abort:m=>{y(a)&&n(hy(m))},close:()=>{y(a)&&n(Uu(!1))},resetAnswer:()=>{y(a)&&n(yy())}});S?c(S):n(as(!1))});return function(_x26,_x27){return _ref14.apply(this,arguments)}}());g();d();f();p();g();d();f();p();var vy=ae(e=>e.pipeline,e=>e);g();d();f();p();var Bu=ae(e=>e.query,e=>e);g();d();f();p();g();d();f();p();var Jr=Ne(ui(),1),Yu=Ne($u(),1);g();d();f();p();var zu=Ne(ui(),1),Gu=Ne(Hu(),1);zu.default.extend(Gu.default);var Ay="YYYY/MM/DD@HH:mm:ss";function Wu(e){return e.format(Ay)}Jr.default.extend(Yu.default);var Cy=["past","now","next"],by=["minute","hour","day","week","month","quarter","year"];function wy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Jr.default)().subtract(r,n);case"next":return(0,Jr.default)().add(r,n);case"now":return(0,Jr.default)()}}function Ss(e){return Wu(wy(Ry(e)))}function Ku(e){return e.toLocaleLowerCase().split("-")}function vs(e){let[t,r,n]=Ku(e);if(t==="now")return!0;if(!Cy.includes(t)||!by.includes(n))return!1;let i=parseInt(r);return!(Number.isNaN(i)||i<=0)}function Ry(e){let[t,r,n]=Ku(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}g();d();f();p();function Ju(e){return e.type==="dateRange"}function Xu(e){return`start${e}`}function Zu(e){return`end${e}`}var el=()=>({dateFacetValueMap:{}});function xy(e,t,r){let n=e.start,i=e.end;return vs(n)&&(n=Ss(n),r.dateFacetValueMap[t][Xu(n)]=e.start),vs(i)&&(i=Ss(i),r.dateFacetValueMap[t][Zu(i)]=e.end),{...e,start:n,end:i}}function tl(e,t){if(Ju(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(i=>xy(i,r,t))}}return e}function pt(e){let t=el();return{request:{...e,facets:e.facets?.map(n=>tl(n,t))},mappings:t}}function Ey(e,t,r){return{...e,start:r.dateFacetValueMap[t][Xu(e.start)]||e.start,end:r.dateFacetValueMap[t][Zu(e.end)]||e.end}}function Iy(e,t){return e.facetId in t.dateFacetValueMap}function ky(e,t){return Iy(e,t)?{...e,values:e.values.map(r=>Ey(r,e.facetId,t))}:e}function li(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>ky(n,t))}}:e}g();d();f();p();g();d();f();p();var Xr=(e,t)=>{let r=e;return Y(r[t])?Y(e.raw[t])?null:e.raw[t]:r[t]},Py=e=>t=>e.every(r=>!Y(Xr(t,r))),Oy=e=>t=>e.every(r=>Y(Xr(t,r))),Fy=(e,t)=>r=>{let n=rl(e,r);return t.some(i=>n.some(o=>`${o}`.toLowerCase()===i.toLowerCase()))},Ty=(e,t)=>r=>{let n=rl(e,r);return t.every(i=>n.every(o=>`${o}`.toLowerCase()!==i.toLowerCase()))},rl=(e,t)=>{let r=Xr(t,e);return ka(r)?r:[r]},nl={getResultProperty:Xr,fieldsMustBeDefined:Py,fieldsMustNotBeDefined:Oy,fieldMustMatch:Fy,fieldMustNotMatch:Ty};var Dy=ae(e=>e.search,e=>e?.searchAction?.actionCause||"");g();d();f();p();var qy=ae(e=>e.searchHub,e=>e);g();d();f();p();var As=ae(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(o=>o.state==="selected"&&!!o.expression.trim()),i=n.map(o=>o.expression).join(" OR ");return n.length>1?`(${i})`:i}));g();d();f();p();var il=ae(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),jy=ae(e=>e,e=>{let t=il(e);return t&&e?e[t].expression:""});g();d();f();p();g();d();f();p();function ft(e){return Object.values(e).map(t=>t.request)}function Cs(e,t){let r={};e.forEach(o=>{r[o.facetId]=o});let n=[];t.forEach(o=>{o in r&&(n.push(r[o]),delete r[o])});let i=Object.values(r);return[...n,...i]}function ol(e){return ft(e).map(t=>{let n=t.currentValues.some(({state:i})=>i!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var bs={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function My(e){return ft(e).map(t=>{let r=bs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Ny(e){return[...My(e.facetSet??{}),...ol(e.numericFacetSet??{}),...ol(e.dateFacetSet??{}),...ft(e.categoryFacetSet??{})]}function _y(e){return Ny(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function ws(e){return Cs(_y(e),e.facetOrder??[])}g();d();f();p();g();d();f();p();function al(_x28,_x29){return _al.apply(this,arguments)}function _al(){_al=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _al.apply(this,arguments)}function cl(e){let t,r,n,i=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=Uy(t,s);let u=t.length,c=0;for(;r<u;){i&&(t[r]===10&&(c=++r),i=!1);let a=-1;for(;r<u&&a===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:i=!0,a=r;break;case 10:a=r;break}if(a===-1)break;e(t.subarray(c,a),n),c=r,n=-1}c===u?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function ul(e,t,r){let n=sl(),i=new TextDecoder;return function(s,u){if(s.length===0)r?.(n),n=sl();else if(u>0){let c=i.decode(s.subarray(0,u)),a=u+(s[u+1]===32?2:1),h=i.decode(s.subarray(a));switch(c){case"data":n.data=n.data?`${n.data}
31
+ ${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":Ly(h,n,t);break}}}}function Ly(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function Uy(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function sl(){return{data:"",event:"",id:"",retry:void 0}}var Rs="text/event-stream",Vy=1e3,ll="last-event-id";function dl(){return typeof window<"u"}function pl(e,{signal:t,headers:r,onopen:n,onmessage:i,onclose:o,onerror:s,openWhenHidden:u,fetch:c,...a}){return new Promise((h,y)=>{let S={...r};S.accept||(S.accept=Rs);let m;function v(){m?.abort(),document.hidden||I()}!u&&dl()&&document.addEventListener("visibilitychange",v);let R=Vy,E;function b(){dl()&&document.removeEventListener("visibilitychange",v),clearTimeout(E),m?.abort()}t?.addEventListener("abort",()=>{b(),h()});let P=c??C,w=n??Qy;function I(){return _I.apply(this,arguments)}function _I(){_I=_asyncToGenerator(function*(){m=l.AbortController?new l.AbortController:null;try{let j=yield P(e,{...a,headers:S,signal:m?.signal});yield w(j),yield al(j.body,cl(ul(F=>{F?S[ll]=F:delete S[ll]},F=>{R=F},i))),o?.(),b(),h()}catch(j){if(!m?.signal?.aborted)try{let F=s?.(j)??R;clearTimeout(E),E=setTimeout(I,F)}catch(F){b(),y(F)}}});return _I.apply(this,arguments)}I()})}function Qy(e){let t=e.headers.get("content-type");if(!t?.startsWith(Rs))throw new Error(`Expected content-type to be ${Rs}, Actual: ${t}`)}g();d();f();p();g();d();f();p();function fl(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var gl=Qe;function El(e,t){if(e===t||!(gl(e)&&gl(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),i=r.length===n.length,o=Array.isArray(t)?[]:{};for(let s of r)o[s]=El(e[s],t[s]),i&&(i=e[s]===o[s]);return i?e:o}function lr(e){let t=0;for(let r in e)t++;return t}var ml=e=>[].concat(...e);function By(e){return new RegExp("(^|:)//").test(e)}function $y(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function fi(e){return e!=null}function Hy(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var zy=e=>e.replace(/\/$/,""),Gy=e=>e.replace(/^\//,"");function Wy(e,t){if(!e)return t;if(!t)return e;if(By(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=zy(e),t=Gy(t),`${e}${r}${t}`}function Yy(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var hl=(...e)=>C(...e),Ky=e=>e.status>=200&&e.status<=299,Jy=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function yl(e){if(!Qe(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Il({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:r=hl,paramsSerializer:n,isJsonContentType:i=Jy,jsonContentType:o="application/json",jsonReplacer:s,timeout:u,responseHandler:c,validateStatus:a,...h}={}){return typeof C>"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 _ref15=_asyncToGenerator(function*(S,m,v){let{getState:R,extra:E,endpoint:b,forced:P,type:w}=m,I,{url:j,headers:F=new x(h.headers),params:k=void 0,responseHandler:O=c??"json",validateStatus:T=a??Ky,timeout:M=u,...B}=typeof S=="string"?{url:S}:S,U,_=m.signal;M&&(U=new l.AbortController,m.signal.addEventListener("abort",U.abort),_=U.signal);let N={...h,signal:_,...B};F=new x(yl(F)),N.headers=(yield t(F,{getState:R,arg:S,extra:E,endpoint:b,forced:P,type:w,extraOptions:v}))||F;let V=K=>typeof K=="object"&&(Qe(K)||Array.isArray(K)||typeof K.toJSON=="function");if(!N.headers.has("content-type")&&V(N.body)&&N.headers.set("content-type",o),V(N.body)&&i(N.headers)&&(N.body=JSON.stringify(N.body,s)),k){let K=~j.indexOf("?")?"&":"?",te=n?n(k):new URLSearchParams(yl(k));j+=K+te}j=Wy(e,j);let L=new Request(j,N);I={request:new Request(j,N)};let H,G=!1,X=U&&setTimeout(()=>{G=!0,U.abort()},M);try{H=yield r(L)}catch(K){return{error:{status:G?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(K)},meta:I}}finally{X&&clearTimeout(X),U?.signal.removeEventListener("abort",U.abort)}let ne=H.clone();I.response=ne;let J,Z="";try{let K;if(yield Promise.all([y(H,O).then(te=>J=te,te=>K=te),ne.text().then(te=>Z=te,()=>{})]),K)throw K}catch(K){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(K)},meta:I}}return T(H,J)?{data:J,meta:I}:{error:{status:H.status,data:J},meta:I}});return function(_x30,_x31,_x32){return _ref15.apply(this,arguments)}}());function y(_x33,_x34){return _y2.apply(this,arguments)}function _y2(){_y2=_asyncToGenerator(function*(S,m){if(typeof m=="function")return m(S);if(m==="content-type"&&(m=i(S.headers)?"json":"text"),m==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _y2.apply(this,arguments)}}var dr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Xy(){return _Xy.apply(this,arguments)}function _Xy(){_Xy=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(i=>setTimeout(o=>i(o),n))});return _Xy.apply(this,arguments)}function Zy(e,t){throw Object.assign(new dr({error:e,meta:t}),{throwImmediately:!0})}var Sl={},eS=(e,t)=>(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(r,n,i){let o=[5,(t||Sl).maxRetries,(i||Sl).maxRetries].filter(h=>h!==void 0),[s]=o.slice(-1),c={maxRetries:s,backoff:Xy,retryCondition:(h,y,{attempt:S})=>S<=s,...t,...i},a=0;for(;;)try{let h=yield e(r,n,i);if(h.error)throw new dr(h);return h}catch(h){if(a++,h.throwImmediately){if(h instanceof dr)return h.value;throw h}if(h instanceof dr&&!c.retryCondition(h.value.error,r,{attempt:a,baseQueryApi:n,extraOptions:i}))return h.value;yield c.backoff(a,c.maxRetries)}});return function(_x35,_x36,_x37){return _ref16.apply(this,arguments)}}()),kl=Object.assign(eS,{fail:Zy}),Ps=Q("__rtkq/focused"),Pl=Q("__rtkq/unfocused"),Os=Q("__rtkq/online"),Ol=Q("__rtkq/offline");function Fs(e){return e.type==="query"}function tS(e){return e.type==="mutation"}function Ts(e){return e.type==="infinitequery"}function Ds(e,t,r,n,i,o){return rS(e)?e(t,r,n,i).filter(fi).map(Es).map(o):Array.isArray(e)?e.map(Es).map(o):[]}function rS(e){return typeof e=="function"}function Es(e){return typeof e=="string"?{type:e}:e}function nS(e,t){return e.catch(t)}var en=Symbol("forceQueryFn"),Is=e=>typeof e[en]=="function";function iS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:i,context:o}){let s=new Map,u=new Map,{unsubscribeQueryResult:c,removeMutationResult:a,updateSubscriptionOptions:h}=i.internalActions;return{buildInitiateQuery:b,buildInitiateInfiniteQuery:P,buildInitiateMutation:w,getRunningQueryThunk:y,getRunningMutationThunk:S,getRunningQueriesThunk:m,getRunningMutationsThunk:v};function y(I,j){return F=>{let k=o.endpointDefinitions[I],O=e({queryArgs:j,endpointDefinition:k,endpointName:I});return s.get(F)?.[O]}}function S(I,j){return F=>u.get(F)?.[j]}function m(){return I=>Object.values(s.get(I)||{}).filter(fi)}function v(){return I=>Object.values(u.get(I)||{}).filter(fi)}function R(I){}function E(I,j){let F=(k,{subscribe:O=!0,forceRefetch:T,subscriptionOptions:M,[en]:B,...U}={})=>(_,N)=>{let V=e({queryArgs:k,endpointDefinition:j,endpointName:I}),L,$={...U,type:"query",subscribe:O,forceRefetch:T,subscriptionOptions:M,endpointName:I,originalArgs:k,queryCacheKey:V,[en]:B};if(Fs(j))L=t($);else{let{direction:ie,initialPageParam:ue}=U;L=r({...$,direction:ie,initialPageParam:ue})}let H=i.endpoints[I].select(k),G=_(L),X=H(N());let{requestId:ne,abort:J}=G,Z=X.requestId!==ne,K=s.get(_)?.[V],te=()=>H(N()),le=Object.assign(B?G.then(te):Z&&!K?Promise.resolve(X):Promise.all([K,G]).then(te),{arg:k,requestId:ne,subscriptionOptions:M,queryCacheKey:V,abort:J,unwrap(){return _asyncToGenerator(function*(){let ie=yield le;if(ie.isError)throw ie.error;return ie.data})()},refetch:()=>_(F(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&_(c({queryCacheKey:V,requestId:ne}))},updateSubscriptionOptions(ie){le.subscriptionOptions=ie,_(h({endpointName:I,requestId:ne,queryCacheKey:V,options:ie}))}});if(!K&&!Z&&!B){let ie=Yy(s,_,{});ie[V]=le,le.then(()=>{delete ie[V],lr(ie)||s.delete(_)})}return le};return F}function b(I,j){return E(I,j)}function P(I,j){return E(I,j)}function w(I){return(j,{track:F=!0,fixedCacheKey:k}={})=>(O,T)=>{let M=n({type:"mutation",endpointName:I,originalArgs:j,track:F,fixedCacheKey:k}),B=O(M);let{requestId:U,abort:_,unwrap:N}=B,V=nS(B.unwrap().then(G=>({data:G})),G=>({error:G})),L=()=>{O(a({requestId:U,fixedCacheKey:k}))},$=Object.assign(V,{arg:B.arg,requestId:U,abort:_,unwrap:N,reset:L}),H=u.get(O)||{};return u.set(O,H),H[U]=$,$.then(()=>{delete H[U],lr(H)||u.delete(O)}),k&&(H[k]=$,$.then(()=>{H[k]===$&&(delete H[k],lr(H)||u.delete(O))})),$}}}function oS(e){return e}var di=(e={})=>({...e,[_r]:!0});function sS({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:o,selectors:s}){let u=(O,T,M,B)=>(U,_)=>{let N=r[O],V=n({queryArgs:T,endpointDefinition:N,endpointName:O});if(U(i.internalActions.queryResultPatched({queryCacheKey:V,patches:M})),!B)return;let L=i.endpoints[O].select(T)(_()),$=Ds(N.providesTags,L.data,void 0,T,{},o);U(i.internalActions.updateProvidedBy({queryCacheKey:V,providedTags:$}))};function c(O,T,M=0){let B=[T,...O];return M&&B.length>M?B.slice(0,-1):B}function a(O,T,M=0){let B=[...O,T];return M&&B.length>M?B.slice(1):B}let h=(O,T,M,B=!0)=>(U,_)=>{let V=i.endpoints[O].select(T)(_()),L={patches:[],inversePatches:[],undo:()=>U(i.util.patchQueryData(O,T,L.inversePatches,B))};if(V.status==="uninitialized")return L;let $;if("data"in V)if(Ee(V.data)){let[H,G,X]=bn(V.data,M);L.patches.push(...G),L.inversePatches.push(...X),$=H}else $=M(V.data),L.patches.push({op:"replace",path:[],value:$}),L.inversePatches.push({op:"replace",path:[],value:V.data});return L.patches.length===0||U(i.util.patchQueryData(O,T,L.patches,B)),L},y=(O,T,M)=>B=>B(i.endpoints[O].initiate(T,{subscribe:!1,forceRefetch:!0,[en]:()=>({data:M})})),S=(O,T)=>O.query&&O[T]?O[T]:oS,m=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(O,{signal:T,abort:M,rejectWithValue:B,fulfillWithValue:U,dispatch:_,getState:N,extra:V}){let L=r[O.endpointName];try{let $=S(L,"transformResponse"),H={signal:T,abort:M,dispatch:_,getState:N,extra:V,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?v(O,N()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},G=O.type==="query"?O[en]:void 0,X,ne=/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(Z,K,te,le){if(K==null&&Z.pages.length)return Promise.resolve({data:Z});let ie={queryArg:O.originalArgs,pageParam:K},ue=yield J(ie),de=le?c:a;return{data:{pages:de(Z.pages,ue.data,te),pageParams:de(Z.pageParams,K,te)}}});return function ne(_x40,_x41,_x42,_x43){return _ref18.apply(this,arguments)}}();function J(_x44){return _J.apply(this,arguments)}function _J(){_J=_asyncToGenerator(function*(Z){let K,{extraOptions:te}=L;if(G?K=G():L.query?K=yield t(L.query(Z),H,te):K=yield L.queryFn(Z,H,te,ie=>t(ie,H,te)),typeof process<"u",K.error)throw new dr(K.error,K.meta);let le=yield $(K.data,K.meta,Z);return{...K,data:le}});return _J.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:Z}=L,{maxPages:K=1/0}=Z,te,le={pages:[],pageParams:[]},ie=s.selectQueryEntry(N(),O.queryCacheKey)?.data,de=v(O,N())&&!O.direction||!ie?le:ie;if("direction"in O&&O.direction&&de.pages.length){let we=O.direction==="backward",st=(we?Fl:ks)(Z,de);te=yield ne(de,st,K,we)}else{let{initialPageParam:we=Z.initialPageParam}=O,Te=ie?.pageParams??[],st=Te[0]??we,Nt=Te.length;te=yield ne(de,st,K),G&&(te={data:te.data.pages[0]});for(let _t=1;_t<Nt;_t++){let Cr=ks(Z,te.data);te=yield ne(te.data,Cr,K)}}X=te}else X=yield J(O.originalArgs);return U(X.data,di({fulfilledTimeStamp:Date.now(),baseQueryMeta:X.meta}))}catch($){let H=$;if(H instanceof dr){let G=S(L,"transformErrorResponse");try{return B(yield G(H.value,H.meta,O.originalArgs),di({baseQueryMeta:H.meta}))}catch(X){H=X}}throw typeof process<"u",console.error(H),H}});return function m(_x38,_x39){return _ref17.apply(this,arguments)}}();function v(O,T){let M=s.selectQueryEntry(T,O.queryCacheKey),B=s.selectConfig(T).refetchOnMountOrArgChange,U=M?.fulfilledTimeStamp,_=O.forceRefetch??(O.subscribe&&B);return _?_===!0||(Number(new Date)-Number(U))/1e3>=_:!1}let R=()=>oe(`${e}/executeQuery`,m,{getPendingMeta({arg:T}){let M=r[T.endpointName];return di({startedTimeStamp:Date.now(),...(Ts(M)?{direction:T.direction}:{})})},condition(T,{getState:M}){let B=M(),U=s.selectQueryEntry(B,T.queryCacheKey),_=U?.fulfilledTimeStamp,N=T.originalArgs,V=U?.originalArgs,L=r[T.endpointName],$=T.direction;return Is(T)?!0:U?.status==="pending"?!1:v(T,B)||Fs(L)&&L?.forceRefetch?.({currentArg:N,previousArg:V,endpointState:U,state:B})?!0:!(_&&!$)},dispatchConditionRejection:!0}),E=R(),b=R(),P=oe(`${e}/executeMutation`,m,{getPendingMeta(){return di({startedTimeStamp:Date.now()})}}),w=O=>"force"in O,I=O=>"ifOlderThan"in O,j=(O,T,M)=>(B,U)=>{let _=w(M)&&M.force,N=I(M)&&M.ifOlderThan,V=($=!0)=>{let H={forceRefetch:$,isPrefetch:!0};return i.endpoints[O].initiate(T,H)},L=i.endpoints[O].select(T)(U());if(_)B(V());else if(N){let $=L?.fulfilledTimeStamp;if(!$){B(V());return}(Number(new Date)-Number(new Date($)))/1e3>=N&&B(V())}else B(V(!1))};function F(O){return T=>T?.meta?.arg?.endpointName===O}function k(O,T){return{matchPending:Yt(En(O),F(T)),matchFulfilled:Yt(et(O),F(T)),matchRejected:Yt(Pt(O),F(T))}}return{queryThunk:E,mutationThunk:P,infiniteQueryThunk:b,prefetch:j,updateQueryData:h,upsertQueryData:y,patchQueryData:u,buildMatchThunkActions:k}}function ks(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Fl(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Tl(e,t,r,n){return Ds(r[e.meta.arg.endpointName][t],et(e)?e.payload:void 0,Ur(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function pi(e,t,r){let n=e[t];n&&r(n)}function tn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function vl(e,t,r){let n=e[tn(t)];n&&r(n)}var Zr={};function aS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:s,hasRehydrationInfo:u},assertTagType:c,config:a}){let h=Q(`${e}/resetApiState`);function y(F,k,O,T){var M;F[M=k.queryCacheKey]??(F[M]={status:"uninitialized",endpointName:k.endpointName}),pi(F,k.queryCacheKey,B=>{B.status="pending",B.requestId=O&&B.requestId?B.requestId:T.requestId,k.originalArgs!==void 0&&(B.originalArgs=k.originalArgs),B.startedTimeStamp=T.startedTimeStamp;let U=i[T.arg.endpointName];Ts(U)&&"direction"in k&&(B.direction=k.direction)})}function S(F,k,O,T){pi(F,k.arg.queryCacheKey,M=>{if(M.requestId!==k.requestId&&!T)return;let{merge:B}=i[k.arg.endpointName];if(M.status="fulfilled",B){if(M.data!==void 0){let{fulfilledTimeStamp:U,arg:_,baseQueryMeta:N,requestId:V}=k,L=Ze(M.data,$=>B($,O,{arg:_.originalArgs,baseQueryMeta:N,fulfilledTimeStamp:U,requestId:V}));M.data=L}else M.data=O;}else M.data=i[k.arg.endpointName].structuralSharing??!0?El(Pe(M.data)?yo(M.data):M.data,O):O;delete M.error,M.fulfilledTimeStamp=k.fulfilledTimeStamp})}let m=Ot({name:`${e}/queries`,initialState:Zr,reducers:{removeQueryResult:{reducer(F,{payload:{queryCacheKey:k}}){delete F[k]},prepare:Kt()},cacheEntriesUpserted:{reducer(F,k){for(let O of k.payload){let{queryDescription:T,value:M}=O;y(F,T,!0,{arg:T,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),S(F,{arg:T,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},M,!0)}},prepare:F=>({payload:F.map(T=>{let{endpointName:M,arg:B,value:U}=T,_=i[M];return{queryDescription:{type:"query",endpointName:M,originalArgs:T.arg,queryCacheKey:n({queryArgs:B,endpointDefinition:_,endpointName:M})},value:U}}),meta:{[_r]:!0,requestId:kn(),timestamp:Date.now()}})},queryResultPatched:{reducer(F,{payload:{queryCacheKey:k,patches:O}}){pi(F,k,T=>{T.data=vo(T.data,O.concat())})},prepare:Kt()}},extraReducers(F){F.addCase(t.pending,(k,{meta:O,meta:{arg:T}})=>{let M=Is(T);y(k,T,M,O)}).addCase(t.fulfilled,(k,{meta:O,payload:T})=>{let M=Is(O.arg);S(k,O,T,M)}).addCase(t.rejected,(k,{meta:{condition:O,arg:T,requestId:M},error:B,payload:U})=>{pi(k,T.queryCacheKey,_=>{if(!O){if(_.requestId!==M)return;_.status="rejected",_.error=U??B}})}).addMatcher(u,(k,O)=>{let{queries:T}=s(O);for(let[M,B]of Object.entries(T))(B?.status==="fulfilled"||B?.status==="rejected")&&(k[M]=B)})}}),v=Ot({name:`${e}/mutations`,initialState:Zr,reducers:{removeMutationResult:{reducer(F,{payload:k}){let O=tn(k);O in F&&delete F[O]},prepare:Kt()}},extraReducers(F){F.addCase(r.pending,(k,{meta:O,meta:{requestId:T,arg:M,startedTimeStamp:B}})=>{M.track&&(k[tn(O)]={requestId:T,status:"pending",endpointName:M.endpointName,startedTimeStamp:B})}).addCase(r.fulfilled,(k,{payload:O,meta:T})=>{T.arg.track&&vl(k,T,M=>{M.requestId===T.requestId&&(M.status="fulfilled",M.data=O,M.fulfilledTimeStamp=T.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:O,error:T,meta:M})=>{M.arg.track&&vl(k,M,B=>{B.requestId===M.requestId&&(B.status="rejected",B.error=O??T)})}).addMatcher(u,(k,O)=>{let{mutations:T}=s(O);for(let[M,B]of Object.entries(T))(B?.status==="fulfilled"||B?.status==="rejected")&&M!==B?.requestId&&(k[M]=B)})}}),R=Ot({name:`${e}/invalidation`,initialState:Zr,reducers:{updateProvidedBy:{reducer(F,k){var M,B;let{queryCacheKey:O,providedTags:T}=k.payload;for(let U of Object.values(F))for(let _ of Object.values(U)){let N=_.indexOf(O);N!==-1&&_.splice(N,1)}for(let{type:U,id:_}of T){let N=(M=F[U]??(F[U]={}))[B=_||"__internal_without_id"]??(M[B]=[]);N.includes(O)||N.push(O)}},prepare:Kt()}},extraReducers(F){F.addCase(m.actions.removeQueryResult,(k,{payload:{queryCacheKey:O}})=>{for(let T of Object.values(k))for(let M of Object.values(T)){let B=M.indexOf(O);B!==-1&&M.splice(B,1)}}).addMatcher(u,(k,O)=>{var M,B;let{provided:T}=s(O);for(let[U,_]of Object.entries(T))for(let[N,V]of Object.entries(_)){let L=(M=k[U]??(k[U]={}))[B=N||"__internal_without_id"]??(M[B]=[]);for(let $ of V)L.includes($)||L.push($)}}).addMatcher(Be(et(t),Ur(t)),(k,O)=>{let T=Tl(O,"providesTags",i,c),{queryCacheKey:M}=O.meta.arg;R.caseReducers.updateProvidedBy(k,R.actions.updateProvidedBy({queryCacheKey:M,providedTags:T}))})}}),E=Ot({name:`${e}/subscriptions`,initialState:Zr,reducers:{updateSubscriptionOptions(F,k){},unsubscribeQueryResult(F,k){},internal_getRTKQSubscriptions(){}}}),b=Ot({name:`${e}/internalSubscriptions`,initialState:Zr,reducers:{subscriptionsUpdated:{reducer(F,k){return vo(F,k.payload)},prepare:Kt()}}}),P=Ot({name:`${e}/config`,initialState:{online:Hy(),focused:$y(),middlewareRegistered:!1,...a},reducers:{middlewareRegistered(F,{payload:k}){F.middlewareRegistered=F.middlewareRegistered==="conflict"||o!==k?"conflict":!0}},extraReducers:F=>{F.addCase(Os,k=>{k.online=!0}).addCase(Ol,k=>{k.online=!1}).addCase(Ps,k=>{k.focused=!0}).addCase(Pl,k=>{k.focused=!1}).addMatcher(u,k=>({...k}))}}),w=Ht({queries:m.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:b.reducer,config:P.reducer}),I=(F,k)=>w(h.match(k)?void 0:F,k),j={...P.actions,...m.actions,...E.actions,...b.actions,...v.actions,...R.actions,resetApiState:h};return{reducer:I,actions:j}}var xs=Symbol.for("RTKQ/skipToken"),Dl={status:"uninitialized"},Al=Ze(Dl,()=>{}),Cl=Ze(Dl,()=>{});function cS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Al,i=w=>Cl;return{buildQuerySelector:S,buildInfiniteQuerySelector:m,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:E,selectApiState:s,selectQueries:u,selectMutations:a,selectQueryEntry:c,selectConfig:h};function o(w){return{...w,...fl(w.status)}}function s(w){return w[t]}function u(w){return s(w)?.queries}function c(w,I){return u(w)?.[I]}function a(w){return s(w)?.mutations}function h(w){return s(w)?.config}function y(w,I,j){return F=>{if(F===xs)return r(n,j);let k=e({queryArgs:F,endpointDefinition:I,endpointName:w});return r(T=>c(T,k)??Al,j)}}function S(w,I){return y(w,I,o)}function m(w,I){let{infiniteQueryOptions:j}=I;function F(k){let O={...k,...fl(k.status)},{isLoading:T,isError:M,direction:B}=O,U=B==="forward",_=B==="backward";return{...O,hasNextPage:b(j,O.data),hasPreviousPage:P(j,O.data),isFetchingNextPage:T&&U,isFetchingPreviousPage:T&&_,isFetchNextPageError:M&&U,isFetchPreviousPageError:M&&_}}return y(w,I,F)}function v(){return w=>{let I;return typeof w=="object"?I=tn(w)??xs:I=w,r(I===xs?i:k=>s(k)?.mutations?.[I]??Cl,o)}}function R(w,I){let j=w[t],F=new Set;for(let k of I.filter(fi).map(Es)){let O=j.provided[k.type];if(!O)continue;let T=(k.id!==void 0?O[k.id]:ml(Object.values(O)))??[];for(let M of T)F.add(M)}return ml(Array.from(F.values()).map(k=>{let O=j.queries[k];return O?[{queryCacheKey:k,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function E(w,I){return Object.values(u(w)).filter(j=>j?.endpointName===I&&j.status!=="uninitialized").map(j=>j.originalArgs)}function b(w,I){return I?ks(w,I)!=null:!1}function P(w,I){return!I||!w.getPreviousPageParam?!1:Fl(w,I)!=null}}var bl=WeakMap?new WeakMap:void 0,wl=({endpointName:e,queryArgs:t})=>{let r="",n=bl?.get(t);if(typeof n=="string")r=n;else{let i=JSON.stringify(t,(o,s)=>(s=typeof s=="bigint"?{$bigint:s.toString()}:s,s=Qe(s)?Object.keys(s).sort().reduce((u,c)=>(u[c]=s[c],u),{}):s,s));Qe(t)&&bl?.set(t,i),r=i}return`${e}(${r})`};function uS(...e){return function(r){let n=Wt(a=>r.extractRehydrationInfo?.(a,{reducerPath:r.reducerPath??"api"})),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(a){let h=wl;if("serializeQueryArgs"in a.endpointDefinition){let y=a.endpointDefinition.serializeQueryArgs;h=S=>{let m=y(S);return typeof m=="string"?m:wl({...S,queryArgs:m})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(a)},tagTypes:[...(r.tagTypes||[])]},o={endpointDefinitions:{},batch(a){a()},apiUid:kn(),extractRehydrationInfo:n,hasRehydrationInfo:Wt(a=>n(a)!=null)},s={injectEndpoints:c,enhanceEndpoints({addTagTypes:a,endpoints:h}){if(a)for(let y of a)i.tagTypes.includes(y)||i.tagTypes.push(y);if(h)for(let[y,S]of Object.entries(h))typeof S=="function"?S(o.endpointDefinitions[y]):Object.assign(o.endpointDefinitions[y]||{},S);return s}},u=e.map(a=>a.init(s,i,o));function c(a){let h=a.endpoints({query:y=>({...y,type:"query"}),mutation:y=>({...y,type:"mutation"}),infiniteQuery:y=>({...y,type:"infinitequery"})});for(let[y,S]of Object.entries(h)){if(a.overrideExisting!==!0&&y in o.endpointDefinitions){if(a.overrideExisting==="throw")throw new Error(Le(39));typeof process<"u";continue}typeof process<"u",o.endpointDefinitions[y]=S;for(let m of u)m.injectEndpoint(y,S)}return s}return s.injectEndpoints({endpoints:r.endpoints})}}function nt(e,...t){return Object.assign(e,...t)}var lS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,i=null,o=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:u}=e.internalActions,c=(m,v)=>{var E,b;if(s.match(v)){let{queryCacheKey:P,requestId:w,options:I}=v.payload;return m?.[P]?.[w]&&(m[P][w]=I),!0}if(u.match(v)){let{queryCacheKey:P,requestId:w}=v.payload;return m[P]&&delete m[P][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete m[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:w}}=v,I=m[E=P.queryCacheKey]??(m[E]={});return I[`${w}_running`]={},P.subscribe&&(I[w]=P.subscriptionOptions??I[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=m[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!P[w]),delete P[w]}if(t.rejected.match(v)){let{meta:{condition:P,arg:w,requestId:I}}=v;if(P&&w.subscribe){let j=m[b=w.queryCacheKey]??(m[b]={});j[I]=w.subscriptionOptions??j[I]??{},R=!0}}return R},a=()=>r.currentSubscriptions,S={getSubscriptions:a,getSubscriptionCount:m=>{let R=a()[m]??{};return lr(R)},isRequestSubscribed:(m,v)=>!!a()?.[m]?.[v]};return(m,v)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(m))return i=r.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(m))return[!1,S];let R=c(r.currentSubscriptions,m),E=!0;if(R){o||(o=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,I]=bn(i,()=>w);v.next(e.internalActions.subscriptionsUpdated(I)),i=w,o=null},500));let b=typeof m.type=="string"&&!!m.type.startsWith(n),P=t.rejected.match(m)&&m.meta.condition&&!!m.meta.arg.subscribe;E=!b&&!P}return[E,!1]}};function dS(e){for(let t in e)return!1;return!0}var pS=2147483647/1e3-1,fS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i,selectors:{selectQueryEntry:o,selectConfig:s}})=>{let{removeQueryResult:u,unsubscribeQueryResult:c,cacheEntriesUpserted:a}=t.internalActions,h=Be(c.match,r.fulfilled,r.rejected,a.match);function y(E){let b=i.currentSubscriptions[E];return!!b&&!dS(b)}let S={},m=(E,b,P)=>{let w=b.getState(),I=s(w);if(h(E)){let j;if(a.match(E))j=E.payload.map(F=>F.queryDescription.queryCacheKey);else{let{queryCacheKey:F}=c.match(E)?E.payload:E.meta.arg;j=[F]}v(j,b,I)}if(t.util.resetApiState.match(E))for(let[j,F]of Object.entries(S))F&&clearTimeout(F),delete S[j];if(n.hasRehydrationInfo(E)){let{queries:j}=n.extractRehydrationInfo(E);v(Object.keys(j),b,I)}};function v(E,b,P){let w=b.getState();for(let I of E){let j=o(w,I);R(I,j?.endpointName,b,P)}}function R(E,b,P,w){let j=n.endpointDefinitions[b]?.keepUnusedDataFor??w.keepUnusedDataFor;if(j===1/0)return;let F=Math.max(0,Math.min(j,pS));if(!y(E)){let k=S[E];k&&clearTimeout(k),S[E]=setTimeout(()=>{y(E)||P.dispatch(u({queryCacheKey:E})),delete S[E]},F*1e3)}}return m},Rl=new Error("Promise never resolved before cacheEntryRemoved."),gS=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:s,selectApiState:u}})=>{let c=In(n),a=In(i),h=et(n,i),y={};function S(b,P,w){let I=y[b];I?.valueResolved&&(I.valueResolved({data:P,meta:w}),delete I.valueResolved)}function m(b){let P=y[b];P&&(delete y[b],P.cacheEntryRemoved())}let v=(b,P,w)=>{let I=R(b);function j(F,k,O,T){let M=s(w,k),B=s(P.getState(),k);!M&&B&&E(F,T,k,P,O)}if(n.pending.match(b))j(b.meta.arg.endpointName,I,b.meta.requestId,b.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(b))for(let{queryDescription:F,value:k}of b.payload){let{endpointName:O,originalArgs:T,queryCacheKey:M}=F;j(O,M,b.meta.requestId,T),S(M,k,{})}else if(i.pending.match(b))P.getState()[t].mutations[I]&&E(b.meta.arg.endpointName,b.meta.arg.originalArgs,I,P,b.meta.requestId);else if(h(b))S(I,b.payload,b.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(b)||e.internalActions.removeMutationResult.match(b))m(I);else if(e.util.resetApiState.match(b))for(let F of Object.keys(y))m(F)};function R(b){return c(b)?b.meta.arg.queryCacheKey:a(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:e.internalActions.removeQueryResult.match(b)?b.payload.queryCacheKey:e.internalActions.removeMutationResult.match(b)?tn(b.payload):""}function E(b,P,w,I,j){let F=r.endpointDefinitions[b],k=F?.onCacheEntryAdded;if(!k)return;let O={},T=new Promise(V=>{O.cacheEntryRemoved=V}),M=Promise.race([new Promise(V=>{O.valueResolved=V}),T.then(()=>{throw Rl})]);M.catch(()=>{}),y[w]=O;let B=e.endpoints[b].select(F.type==="query"?P:w),U=I.dispatch((V,L,$)=>$),_={...I,getCacheEntry:()=>B(I.getState()),requestId:j,extra:U,updateCachedData:F.type==="query"?V=>I.dispatch(e.util.updateQueryData(b,P,V)):void 0,cacheDataLoaded:M,cacheEntryRemoved:T},N=k(P,_);Promise.resolve(N).catch(V=>{if(V!==Rl)throw V})}return v},mS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,i)=>{e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},hS=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:o,assertTagType:s,refetchQuery:u,internalState:c})=>{let{removeQueryResult:a}=o.internalActions,h=Be(et(n),Ur(n)),y=Be(et(n,i),Pt(n,i)),S=[],m=(E,b)=>{h(E)?R(Tl(E,"invalidatesTags",r,s),b):y(E)?R([],b):o.util.invalidateTags.match(E)&&R(Ds(E.payload,void 0,void 0,void 0,void 0,s),b)};function v(E){let{queries:b,mutations:P}=E;for(let w of[b,P])for(let I in w)if(w[I]?.status==="pending")return!0;return!1}function R(E,b){let P=b.getState(),w=P[e];if(S.push(...E),w.config.invalidationBehavior==="delayed"&&v(w))return;let I=S;if(S=[],I.length===0)return;let j=o.util.selectInvalidatedBy(P,I);t.batch(()=>{let F=Array.from(j.values());for(let{queryCacheKey:k}of F){let O=w.queries[k],T=c.currentSubscriptions[k]??{};O&&(lr(T)===0?b.dispatch(a({queryCacheKey:k})):O.status!=="uninitialized"&&b.dispatch(u(O)))}})}return m},yS=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{let o={},s=(m,v)=>{(r.internalActions.updateSubscriptionOptions.match(m)||r.internalActions.unsubscribeQueryResult.match(m))&&a(m.payload,v),(t.pending.match(m)||t.rejected.match(m)&&m.meta.condition)&&a(m.meta.arg,v),(t.fulfilled.match(m)||t.rejected.match(m)&&!m.meta.condition)&&c(m.meta.arg,v),r.util.resetApiState.match(m)&&y()};function u(m,v){let E=v.getState()[e].queries[m],b=i.currentSubscriptions[m];if(!(!E||E.status==="uninitialized"))return b}function c({queryCacheKey:m},v){let R=v.getState()[e],E=R.queries[m],b=i.currentSubscriptions[m];if(!E||E.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:w}=S(b);if(!Number.isFinite(P))return;let I=o[m];I?.timeout&&(clearTimeout(I.timeout),I.timeout=void 0);let j=Date.now()+P;o[m]={nextPollTimestamp:j,pollingInterval:P,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(E)),c({queryCacheKey:m},v)},P)}}function a({queryCacheKey:m},v){let E=v.getState()[e].queries[m],b=i.currentSubscriptions[m];if(!E||E.status==="uninitialized")return;let{lowestPollingInterval:P}=S(b);if(!Number.isFinite(P)){h(m);return}let w=o[m],I=Date.now()+P;(!w||I<w.nextPollTimestamp)&&c({queryCacheKey:m},v)}function h(m){let v=o[m];v?.timeout&&clearTimeout(v.timeout),delete o[m]}function y(){for(let m of Object.keys(o))h(m)}function S(m={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let E in m)m[E].pollingInterval&&(R=Math.min(m[E].pollingInterval,R),v=m[E].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return s},SS=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let i=En(r,n),o=Pt(r,n),s=et(r,n),u={};return(a,h)=>{if(i(a)){let{requestId:y,arg:{endpointName:S,originalArgs:m}}=a.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let E={},b=new Promise((j,F)=>{E.resolve=j,E.reject=F});b.catch(()=>{}),u[y]=E;let P=e.endpoints[S].select(v.type==="query"?m:y),w=h.dispatch((j,F,k)=>k),I={...h,getCacheEntry:()=>P(h.getState()),requestId:y,extra:w,updateCachedData:v.type==="query"?j=>h.dispatch(e.util.updateQueryData(S,m,j)):void 0,queryFulfilled:b};R(m,I)}}else if(s(a)){let{requestId:y,baseQueryMeta:S}=a.meta;u[y]?.resolve({data:a.payload,meta:S}),delete u[y]}else if(o(a)){let{requestId:y,rejectedWithValue:S,baseQueryMeta:m}=a.meta;u[y]?.reject({error:a.payload??a.error,isUnhandledError:!S,meta:m}),delete u[y]}}},vS=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{let{removeQueryResult:o}=r.internalActions,s=(c,a)=>{Ps.match(c)&&u(a,"refetchOnFocus"),Os.match(c)&&u(a,"refetchOnReconnect")};function u(c,a){let h=c.getState()[e],y=h.queries,S=i.currentSubscriptions;t.batch(()=>{for(let m of Object.keys(S)){let v=y[m],R=S[m];if(!R||!v)continue;(Object.values(R).some(b=>b[a]===!0)||Object.values(R).every(b=>b[a]===void 0)&&h.config[a])&&(lr(R)===0?c.dispatch(o({queryCacheKey:m})):v.status!=="uninitialized"&&c.dispatch(n(v)))}})}return s};function AS(e){let{reducerPath:t,queryThunk:r,api:n,context:i}=e,{apiUid:o}=i,s={invalidateTags:Q(`${t}/invalidateTags`)},u=y=>y.type.startsWith(`${t}/`),c=[mS,fS,hS,yS,gS,SS];return{middleware:y=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:u},R=c.map(P=>P(v)),E=lS(v),b=vS(v);return P=>w=>{if(!hn(w))return P(w);S||(S=!0,y.dispatch(n.internalActions.middlewareRegistered(o)));let I={...y,next:P},j=y.getState(),[F,k]=E(w,I,j),O;if(F?O=P(w):O=k,y.getState()[t]&&(b(w,I,j),u(w)||i.hasRehydrationInfo(w)))for(let T of R)T(w,I,j);return O}},actions:s};function h(y){return e.api.endpoints[y.endpointName].initiate(y.originalArgs,{subscribe:!1,forceRefetch:!0})}}var xl=Symbol(),CS=({createSelector:e=ae}={})=>({name:xl,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:s,refetchOnMountOrArgChange:u,refetchOnFocus:c,refetchOnReconnect:a,invalidationBehavior:h},y){nc();let S=J=>(typeof process<"u",J);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Os,onOffline:Ol,onFocus:Ps,onFocusLost:Pl},util:{}});let m=cS({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:E,buildInfiniteQuerySelector:b,buildMutationSelector:P}=m;nt(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:I,mutationThunk:j,patchQueryData:F,updateQueryData:k,upsertQueryData:O,prefetch:T,buildMatchThunkActions:M}=sS({baseQuery:r,reducerPath:i,context:y,api:t,serializeQueryArgs:o,assertTagType:S,selectors:m}),{reducer:B,actions:U}=aS({context:y,queryThunk:w,infiniteQueryThunk:I,mutationThunk:j,serializeQueryArgs:o,reducerPath:i,assertTagType:S,config:{refetchOnFocus:c,refetchOnReconnect:a,refetchOnMountOrArgChange:u,keepUnusedDataFor:s,reducerPath:i,invalidationBehavior:h}});nt(t.util,{patchQueryData:F,updateQueryData:k,upsertQueryData:O,prefetch:T,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),nt(t.internalActions,U);let{middleware:_,actions:N}=AS({reducerPath:i,context:y,queryThunk:w,mutationThunk:j,infiniteQueryThunk:I,api:t,assertTagType:S,selectors:m});nt(t.util,N),nt(t,{reducer:B,middleware:_});let{buildInitiateQuery:V,buildInitiateInfiniteQuery:L,buildInitiateMutation:$,getRunningMutationThunk:H,getRunningMutationsThunk:G,getRunningQueriesThunk:X,getRunningQueryThunk:ne}=iS({queryThunk:w,mutationThunk:j,infiniteQueryThunk:I,api:t,serializeQueryArgs:o,context:y});return nt(t.util,{getRunningMutationThunk:H,getRunningMutationsThunk:G,getRunningQueryThunk:ne,getRunningQueriesThunk:X}),{name:xl,injectEndpoint(J,Z){var le;let te=(le=t.endpoints)[J]??(le[J]={});Fs(Z)&&nt(te,{name:J,select:E(J,Z),initiate:V(J,Z)},M(w,J)),tS(Z)&&nt(te,{name:J,select:P(),initiate:$(J)},M(j,J)),Ts(Z)&&nt(te,{name:J,select:b(J,Z),initiate:L(J,Z)},M(w,J))}}}}),ql=uS(CS());var bS=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:i,environment:o,organizationId:s}=n.configuration,u=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${i}`}};try{let a=pe(s,o);return{data:Il({baseUrl:`${a}/rest/organizations/${s}/answer/v1/configs/${u}`,fetchFn:function(){var _ref20=_asyncToGenerator(function*(y){if(y instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=y.url,m={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{m[v]=y[v]}),m.duplex="half",m.body=yield y.text(),C(S,m)});return function fetchFn(_x48){return _ref20.apply(this,arguments)}}()})(c,{...t,signal:null},r)}}catch(a){return{error:a}}});return function bS(_x45,_x46,_x47){return _ref19.apply(this,arguments)}}(),jl=ql({reducerPath:"answer",baseQuery:kl(bS,{maxRetries:3}),endpoints:()=>({})});var wS=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},RS=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},xS=(e,t)=>{e.citations=t.citations},ES=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},IS=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},kS=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&IS(t,n);let i=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":i.contentFormat&&(wS(t,i),r(ls(i.contentFormat)));break;case"genqa.messageType":i.textDelta&&(RS(t,i),r(cs({textDelta:i.textDelta})));break;case"genqa.citationsType":i.citations&&(xS(t,i),r(us({citations:i.citations})));break;case"genqa.endOfStreamType":ES(t,i),r(ci(i.answerGenerated??!1));break}},Ml=jl.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,...i}=r;return`${t}(${JSON.stringify(i)})`},onCacheEntryAdded(_x49,_x50){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:i,dispatch:o}){yield n;let{configuration:s,generatedAnswer:u,insightConfiguration:c}=r(),{organizationId:a,environment:h,accessToken:y}=s,S=pe(a,h),m=`${S}/rest/organizations/${a}/insight/v1/configs/${c?.insightId}/answer/${u.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${a}/answer/v1/configs/${u.answerConfigurationId}/generate`;yield pl(c?m:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${y}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:C,onopen:function(){var _ref21=_asyncToGenerator(function*(R){let E=R.headers.get("x-answer-id");E&&i(b=>{b.answerId=E})});return function onopen(_x51){return _ref21.apply(this,arguments)}}(),onmessage:R=>{i(E=>{kS(R,E,o)})},onerror:R=>{throw R},onclose:()=>{i(R=>{o(ds(!R.generated))})}})}).apply(this,arguments)}})})}),gq=ae(e=>Bu(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,i)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:i}));g();d();f();p();var Nl=fe(Jt,e=>e);g();d();f();p();function PS(e){let t=e.payload?.analyticsAction;return _l(e)&&!Y(t)}function _l(e){return"type"in e}var Ll=e=>t=>r=>{let n;PS(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let i=t(r);return _l(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),i};g();d();f();p();g();d();f();p();g();d();f();p();var Mq=Q("tab/register",e=>{let t=new ce({values:{id:ee,expression:Ue}});return z(e,t)}),Ul=Q("tab/updateActiveTab",e=>z(e,ee));g();d();f();p();var gi=Ne(ui(),1),Bl=Ne(Vl(),1),$l=Ne(Ql(),1);gi.default.extend($l.default);gi.default.extend(Bl.default);var Hl=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:gi.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"});g();d();f();p();var OS=/(^|; )Coveo-Pendragon=([^;]*)/;function _s(){return typeof window>"u"?!1:OS.exec(document.cookie)?.pop()||null}var zl=fe(Hl(),e=>e.addCase(Ft,(t,r)=>{FS(t,r.payload)}).addCase(qn,(t,r)=>{TS(t,r.payload)}).addCase(jn,(t,r)=>{DS(t,r.payload)}).addCase(Mn,t=>{t.analytics.enabled=!1}).addCase(Nn,t=>{t.analytics.enabled=!0}).addCase(qc,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(jc,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Ul,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(kc,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Fn,(t,r)=>{Y(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function FS(e,t){Y(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",Y(t.organizationId)||(e.organizationId=t.organizationId)}function TS(e,t){Y(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),Y(t.locale)||(e.search.locale=t.locale),Y(t.timezone)||(e.search.timezone=t.timezone),Y(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function DS(e,t){Y(t.enabled)||(e.analytics.enabled=t.enabled),Y(t.originContext)||(e.analytics.originContext=t.originContext),Y(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),Y(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),Y(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),Y(t.trackingId)||(e.analytics.trackingId=t.trackingId),Y(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),Y(t.source)||(e.analytics.source=t.source);try{let r=_s();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}Y(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),Y(t.anonymous)||(e.analytics.anonymous=t.anonymous),Y(t.deviceId)||(e.analytics.deviceId=t.deviceId),Y(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),Y(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Fe=zl;g();d();f();p();function qS(e){return e.instantlyCallable}var Gl=()=>e=>t=>e(qS(t)?t():t);g();d();f();p();var Wl=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let i=n.error,o=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(o||i.stack||i.message||i.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},Yl=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));g();d();f();p();function Kl(e,t){let r={...e},n,i=o=>(s,u)=>{let c=o(s,u);return n?n(c,u):c};return{get combinedReducer(){let o=Fa(Object.entries(t).filter(([s])=>!(s in r)).map(([s,u])=>[s,()=>u]));return i(Ht({...o,...r}))},containsAll(o){return Object.keys(o).every(u=>u in r)},add(o){Object.keys(o).filter(s=>!(s in r)).forEach(s=>{r[s]=o[s]})},addCrossReducer(o){n=o}}}g();d();f();p();g();d();f();p();function mi(e,t,r){var n,i,o;t===void 0&&(t=50),r===void 0&&(r={});var s=(n=r.isImmediate)!=null&&n,u=(i=r.callback)!=null&&i,c=r.maxWait,a=Date.now(),h=[];function y(){if(c!==void 0){var m=Date.now()-a;if(m+t>=c)return c-m}return t}var S=function(){var m=[].slice.call(arguments),v=this;return new Promise(function(R,E){var b=s&&o===void 0;if(o!==void 0&&clearTimeout(o),o=setTimeout(function(){if(o=void 0,a=Date.now(),!s){var w=e.apply(v,m);u&&u(w),h.forEach(function(I){return(0,I.resolve)(w)}),h=[]}},y()),b){var P=e.apply(v,m);return u&&u(P),R(P)}h.push({resolve:R,reject:E})})};return S.cancel=function(m){o!==void 0&&clearTimeout(o),h.forEach(function(v){return(0,v.reject)(m)}),h=[]},S}g();d();f();p();var fr=Q("app/setError");g();d();f();p();function jS(e){if(!e||!MS(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),i=decodeURIComponent(n.split("").map(o=>`%${`00${o.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(i)}catch{return null}}function Jl(e,t=60){if(!e)return!1;let r=jS(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function MS(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Zl(e,t){let r=0,n=mi(()=>{r=0},500);return i=>o=>(/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(s){if(!(typeof s=="function"))return o(s);let c=typeof t=="function";if(c){let y=i.getState(),S=LS(y);if(S&&Jl(S)){e.debug("Access token is expired or about to expire, attempting renewal.");try{let m=yield t();m?(i.dispatch(Ft({accessToken:m})),e.debug("Access token was renewed.")):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(m){e.warn(m,"Access token renewal failed. A retry will occur if necessary.")}}}let a=yield o(s);if(!NS(a))return a;if(!c)return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Xl(i,a.error),a;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Xl(i,a.error),a;r++,n();let h=yield _S(t);i.dispatch(Ft({accessToken:h})),i.dispatch(s)});return function(_x52){return _ref22.apply(this,arguments)}}())}function NS(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Vt().name}function Xl(e,t){e.dispatch(fr({status:401,statusCode:401,message:t.message,type:t.name}))}function _S(_x53){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _S2.apply(this,arguments)}function LS(e){return e.configuration.accessToken}g();d();f();p();function ed({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:i}){return mc({reducer:e,preloadedState:t,devTools:{stateSanitizer:o=>o.history?{...o,history:"<<OMIT>>"}:o,name:i,shouldHotReload:!1},middleware:o=>o({thunk:{extraArgument:n}}).prepend(...r).concat(Yl(n.logger))})}function US(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...i}=r??{},o={...i,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return o.analyticsMode!=="next"&&Oa()?(t.info("Analytics disabled since doNotTrack is active."),{...o,enabled:!1}):o}function td(e,t){let r={...e.reducers,configuration:Fe,version:Nl},n=VS({...e,reducers:r},t,Fe),{accessToken:i,environment:o,organizationId:s}=e.configuration;n.dispatch(Ft({accessToken:i,environment:o,organizationId:s}));let u=US(e.configuration,n.logger);return u&&n.dispatch(jn(u)),n}function VS(e,t,r){let{reducers:n,navigatorContextProvider:i}=e,o=Kl({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&o.addCrossReducer(e.crossReducer);let s=t.logger,u={...t,get relay(){return Vr(a.state,i)},get navigatorContext(){return Fo(this.relay,i)}},c=QS(e,u,o),a={addReducers(h){o.containsAll(h)||(o.add(h),c.replaceReducer(o.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(Nn())},disableAnalytics(){c.dispatch(Mn())},get state(){return c.getState()},get relay(){return Vr(this.state,i)},get navigatorContext(){return Fo(this.relay,i)},logger:s,store:c};return a}function QS(e,t,r){let{preloadedState:n,configuration:i}=e,o=i.name||"coveo-headless",s=BS(e,t.logger);return ed({preloadedState:n,reducer:r.combinedReducer,middlewares:s,thunkExtraArguments:t,name:o})}function BS(e,t){let{renewAccessToken:r}=e.configuration,n=Zl(t,r);return[Gl,n,Wl(t),Ll].concat(Ml.middleware,e.middlewares||[])}var $S=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
32
32
  However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
33
33
  Please switch back to the "legacy" analytics mode to ensure proper functionality.
34
- For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function td(e){e==="next"&&console.warn($S)}g();d();f();p();var ld=_e(ud(),1);function dd(e){return(0,ld.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}g();d();f();p();function pd(e,t){let r=cv(e),n=Co,i=uv(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:i,logger:t}}function cv(e){let{analytics:t}=e,r=(n,i)=>i;return t?.analyticsClientMiddleware||r}function uv(e){return e.preprocessRequest||un}g();d();f();p();g();d();f();p();var fd={organizationId:ee,accessToken:ee,name:new W({required:!1,emptyAllowed:!1}),analytics:new ce({options:{required:!1},values:{enabled:new ye({required:!1}),originContext:new W({required:!1}),originLevel2:new W({required:!1}),originLevel3:new W({required:!1}),analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new W({required:!1,url:!0}),trackingId:new W({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new W({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};var gd=new Le({...fd,caseAssistId:ee,locale:ge});var lv={debug:Oc,caseAssistConfiguration:ut,searchHub:jc};function md(e){let t=dd(e.loggerOptions);dv(e.configuration,t);let r=pv(e.configuration,t),n={...pd(e.configuration,t),apiClient:r},i={...e,reducers:lv},o=ed(i,n);td(o.state.configuration.analytics.analyticsMode);let{caseAssistId:s,locale:u,searchHub:c,proxyBaseUrl:a}=e.configuration;return o.dispatch(Pn({caseAssistId:s,locale:u,proxyBaseUrl:a})),Y(c)||o.dispatch(Tn(c)),{...o,get state(){return o.state}}}function dv(e,t){try{gd.validate(e)}catch(r){throw t.error(r,"Case Assist engine configuration error"),r}}function pv(e,t){return new gn({logger:t,preprocessRequest:e.preprocessRequest||un})}g();d();f();p();g();d();f();p();g();d();f();p();var yd=(o=>(o.id="id",o.subject="subject",o.description="description",o.category="category",o.productId="productId",o))(yd||{}),hd=e=>!Object.values(yd).includes(e),Ie=e=>{let t=r=>fv(e,r)??mv(e,r);return{id:t("id"),subject:t("subject"),description:t("description"),category:t("category"),productId:t("productId"),custom:{...gv(e),...yv(e)}}},fv=(e,t)=>e?.caseInput?.[t]?.value,gv=e=>Object.keys(e?.caseInput??[]).reduce((t,r)=>{if(hd(r)){let n=e?.caseInput?.[r]?.value;if(n)return{...t,[r]:n}}return t},{}),mv=(e,t)=>e?.caseField?.fields[t]?.value,yv=e=>Object.keys(e?.caseField?.fields??[]).reduce((t,r)=>{if(hd(r)){let n=e?.caseField?.fields?.[r]?.value;if(n)return{...t,[r]:n}}return t},{}),Bs=(e,t,r=!1)=>{let n=Object.keys(e?.caseField?.fields??{}).find(u=>e?.caseField?.fields[u].suggestions.some(c=>c.id===t));if(!n)throw new Error(`Classification with ID '${t}' could not be found.`);let o=e?.caseField?.fields[n]?.suggestions.find(u=>u.id===t),s={classificationId:o?.id??"",responseId:e.caseField?.status.lastResponseId??"",fieldName:n,classification:{value:o?.value??"",confidence:o?.confidence??0}};return r?{...s,autoSelection:r}:s},st=(e,t,r=!1,n=!1)=>{let i,o=e.documentSuggestion?.documents.find((u,c)=>{let a=u.uniqueId===t;return a&&(i=c+1),a});if(!o)throw new Error(`Document Suggestion with ID '${t}' could not be found.`);let s={suggestionId:o.uniqueId,permanentId:o.fields.permanentid,responseId:e.documentSuggestion?.status.lastResponseId??"",suggestion:{documentUri:o.fields.uri,documentUriHash:o.fields.urihash,documentTitle:o.title,documentUrl:o.clickUri,documentPosition:i??0,sourceName:o.fields.source}};return r?{...s,fromQuickview:r}:n?{...s,openDocument:n}:s};var Sd=()=>Fe({prefix:"analytics/caseAssist/case/start",__legacy__getBuilder:(e,t)=>e.logEnterInterface({ticket:Ie(t)}),analyticsType:"CaseAssist.Start",analyticsPayloadBuilder:()=>({})}),vd=e=>Fe("analytics/caseAssist/case/nextStage",(t,r)=>t.logMoveToNextCaseStep({ticket:Ie(r),stage:e?.stageName})),Ad=()=>Fe({prefix:"analytics/caseAssist/case/create",__legacy__getBuilder:(e,t)=>e.logCaseCreated({ticket:Ie(t)}),analyticsType:"CaseAssist.CreateTicket",analyticsPayloadBuilder:e=>{let{id:t,category:r,subject:n,description:i,productId:o}=Ie(e);return{ticket:{id:t,category:r,subject:n,description:i,system:o}}}}),Cd=()=>Fe({prefix:"analytics/caseAssist/case/solve",__legacy__getBuilder:(e,t)=>e.logCaseSolved({ticket:Ie(t)}),analyticsType:"CaseAssist.Cancel",analyticsPayloadBuilder:()=>({reason:"solved"})}),bd=()=>Fe({prefix:"analytics/caseAssist/case/abandon",__legacy__getBuilder:(e,t)=>e.logCaseCancelled({ticket:Ie(t)}),analyticsType:"CaseAssist.Cancel",analyticsPayloadBuilder:()=>({reason:"quit"})}),mr=e=>Fe({prefix:"analytics/caseAssist/case/field/update",__legacy__getBuilder:(t,r)=>t.logUpdateCaseField({fieldName:e,ticket:Ie(r)}),analyticsType:"CaseAssist.UpdateField",analyticsPayloadBuilder:t=>{let r=t.caseField?.fields?.[e]?.value||t.caseInput?.[e]?.value||"";return{fieldName:e,fieldValue:r}}}),wd=e=>Fe({prefix:"analytics/caseAssist/classification/click",__legacy__getBuilder:(t,r)=>t.logSelectFieldSuggestion({suggestion:Bs(r,e,!0),ticket:Ie(r)}),analyticsType:"CaseAssist.SelectFieldClassification",analyticsPayloadBuilder:t=>{let r=t.caseField?.status?.lastResponseId;if(r)return{autoselected:!0,classificationId:e,responseId:r}}}),hi=e=>Fe({prefix:"analytics/caseAssist/classification/click",__legacy__getBuilder:(t,r)=>t.logSelectFieldSuggestion({suggestion:Bs(r,e),ticket:Ie(r)}),analyticsType:"CaseAssist.SelectFieldClassification",analyticsPayloadBuilder:t=>{let r=t.caseField?.status?.lastResponseId;if(r)return{autoselected:!1,classificationId:e,responseId:r}}}),Rd=e=>Fe({prefix:"analytics/caseAssist/documentSuggestion/click",__legacy__getBuilder:(t,r)=>t.logSelectDocumentSuggestion({suggestion:st(r,e),ticket:Ie(r)}),analyticsType:"CaseAssist.DocumentSuggestionClick",analyticsPayloadBuilder:t=>{let r=t.documentSuggestion?.status?.lastResponseId,n=st(t,e);if(r)return{responseId:r,position:n.suggestion.documentPosition,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:n.suggestionId,url:n.suggestion.documentUri,title:n.suggestion.documentTitle}}}}),Si=e=>Fe({prefix:"analytics/caseAssist/documentSuggestion/click",__legacy__getBuilder:(t,r)=>t.logQuickviewDocumentSuggestion({suggestion:st(r,e),ticket:Ie(r)}),analyticsType:"CaseAssist.DocumentSuggestionClick",analyticsPayloadBuilder:t=>{let r=t.documentSuggestion?.status?.lastResponseId,n=st(t,e);if(r)return{responseId:r,position:n.suggestion.documentPosition,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:n.suggestionId,url:n.suggestion.documentUri,title:n.suggestion.documentTitle}}}}),xd=e=>Fe({prefix:"analytics/caseAssist/documentSuggestion/click",__legacy__getBuilder:(t,r)=>t.logSelectDocumentSuggestion({suggestion:st(r,e,!1,!0),ticket:Ie(r)}),analyticsType:"CaseAssist.DocumentSuggestionClick",analyticsPayloadBuilder:t=>{let r=t.documentSuggestion?.status?.lastResponseId,n=st(t,e);if(r)return{responseId:r,position:n.suggestion.documentPosition,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:n.suggestionId,url:n.suggestion.documentUri,title:n.suggestion.documentTitle}}}}),Ed=(e,t)=>Fe({prefix:"analytics/caseAssist/documentSuggestion/rate",__legacy__getBuilder:(r,n)=>r.logRateDocumentSuggestion({rating:t,suggestion:st(n,e),ticket:Ie(n)}),analyticsType:"CaseAssist.DocumentSuggestionFeedback",analyticsPayloadBuilder:r=>{let n=r.documentSuggestion?.status?.lastResponseId,i=st(r,e);if(n)return{responseId:n,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:i.suggestionId,url:i.suggestion.documentUri,title:i.suggestion.documentTitle},liked:!!t}}});g();d();f();p();g();d();f();p();g();d();f();p();var vi=e=>e.success!==void 0,ke=e=>e.error!==void 0;var yr=Q("caseAssist/caseField/register",e=>z(e,{fieldName:ee,fieldValue:Ve})),hr=Q("caseAssist/caseField/update",e=>z(e,{fieldName:ee,fieldValue:Ve})),We=oe("caseAssist/classifications/fetch",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let i=t(),o=yield n.getCaseClassifications(yield hv(i));return ke(o)?r(o.error):{response:o.success}});return function(_x54,_x55){return _ref23.apply(this,arguments)}}()),hv=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.caseAssistConfiguration.apiBaseUrl??pe(e.configuration.organizationId,e.configuration.environment),caseAssistId:e.caseAssistConfiguration.caseAssistId,...(e.configuration.analytics.enabled&&{clientId:yield ir(e.configuration.analytics)}),fields:e.caseInput,context:e.caseField?fn(e.caseField.fields):void 0,locale:e.caseAssistConfiguration.locale,debug:e.debug}});return function hv(_x56){return _ref24.apply(this,arguments)}}();g();d();f();p();g();d();f();p();var Id=()=>({status:{loading:!1,error:null,lastResponseId:""},fields:{}});var yt=fe(Id(),e=>{e.addCase(yr,(t,r)=>{let{fieldName:n,fieldValue:i}=r.payload;t.fields[n]={value:i,suggestions:[]}}).addCase(hr,(t,r)=>{let{fieldName:n,fieldValue:i}=r.payload;t.fields[n].value=i}).addCase(We.rejected,(t,r)=>{t.status.error=r.payload??null,t.status.loading=!1}).addCase(We.fulfilled,(t,r)=>{let n={value:"",suggestions:[]};Object.entries(r.payload.response.fields).forEach(([i,o])=>{t.fields[i]||(t.fields[i]={...n}),t.fields[i].suggestions=o.predictions}),t.status.lastResponseId=r.payload.response.responseId,t.status.error=null,t.status.loading=!1}).addCase(We.pending,t=>{t.status.loading=!0}).addCase(fr,(t,r)=>{t.status.error=r.payload,t.status.loading=!1})});g();d();f();p();g();d();f();p();var Nt=Q("caseAssist/caseInput/update",e=>z(e,{fieldName:ee,fieldValue:Ve}));g();d();f();p();var kd=()=>({});var ht=fe(kd(),e=>{e.addCase(Nt,(t,r)=>{t[r.payload.fieldName]={value:r.payload.fieldValue}})});g();d();f();p();var Ne=oe("caseAssist/documentSuggestions/fetch",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:i}}){let o=t(),s=yield n.getDocumentSuggestions(yield Sv(o,i));return ke(s)?r(s.error):{response:s.success}});return function(_x57,_x58){return _ref25.apply(this,arguments)}}()),Sv=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.caseAssistConfiguration.apiBaseUrl??pe(e.configuration.organizationId,e.configuration.environment),caseAssistId:e.caseAssistConfiguration.caseAssistId,...(e.configuration.analytics.enabled&&{clientId:yield ir(e.configuration.analytics)}),...(e.configuration.analytics.enabled&&Qr(e.configuration.analytics,t,{actionCause:"documentSuggestion"})),fields:e.caseInput,context:e.caseField?fn(e.caseField.fields):void 0,locale:e.caseAssistConfiguration.locale,debug:e.debug}});return function Sv(_x59,_x60){return _ref26.apply(this,arguments)}}();g();d();f();p();g();d();f();p();var Pd=()=>({status:{loading:!1,error:null,lastResponseId:""},documents:[]});var Ye=fe(Pd(),e=>{e.addCase(Ne.rejected,(t,r)=>{t.status.error=r.payload??null,t.status.loading=!1}).addCase(Ne.fulfilled,(t,r)=>{t.documents=r.payload.response.documents,t.status.lastResponseId=r.payload.response.responseId,t.status.error=null,t.status.loading=!1}).addCase(Ne.pending,t=>{t.status.loading=!0}).addCase(fr,(t,r)=>{t.status.error=r.payload,t.status.loading=!1})});g();d();f();p();function Ke(e){let t,r=new Map,n=()=>r.size===0,i=o=>{try{let s=JSON.stringify(o),u=t!==s;return t=s,u}catch(s){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",s),!0}};return{subscribe(o){o();let s=Symbol(),u;return n()&&(t=JSON.stringify(this.state),u=e.subscribe(()=>{i(this.state)&&r.forEach(c=>c())})),r.set(s,o),()=>{r.delete(s),n()&&u?.()}},get state(){return{}}}}var vv=new Le({field:ee});function Od(e,t={}){if(!Av(e))throw qe;let r=Ke(e),{dispatch:n}=e,i=kn(e,vv,t.options,"buildCaseField"),o=()=>e.state;return o().caseField?.fields?.[i.field]||n(yr({fieldName:i.field,fieldValue:""})),{...r,get state(){let u=o().caseField?.status?.loading??!1,c=o().caseField?.status?.error??null,a=o().caseField?.fields?.[i.field],y=a?.value??"",h=a?.suggestions??[];return{loading:u,error:c,value:y,suggestions:h}},update(u,c,a){let y=o().caseField?.fields?.[i.field]?.suggestions?.find(h=>h.value===u)?.id;y&&n(a?wd(y):hi(y)),n(hr({fieldName:i.field,fieldValue:u})),!a&&n(mr(i.field)),c?.caseClassifications&&n(We()),c?.documentSuggestions&&n(Ne())}}}function Av(e){return e.addReducers({configuration:Te,caseAssistConfiguration:ut,caseInput:ht,caseField:yt,documentSuggestion:Ye}),!0}g();d();f();p();function Cv(e,t){let r=new Le({field:ee});kn(e,r,t,"buildCaseInput")}function Fd(e,t){if(!bv(e))throw qe;let r=Ke(e),{dispatch:n}=e,i=()=>e.state;Cv(e,t.options);let o=t.options.field;return i().caseInput?.[o]||n(Nt({fieldName:o,fieldValue:""})),{...r,update(u,c){n(Nt({fieldName:o,fieldValue:u})),n(mr(o)),c?.caseClassifications&&n(We()),c?.documentSuggestions&&n(Ne())},get state(){return i().caseInput[o]}}}function bv(e){return e.addReducers({configuration:Te,caseAssistConfiguration:ut,caseInput:ht,caseField:yt,documentSuggestion:Ye}),!0}g();d();f();p();g();d();f();p();function Td(e,t,r){if(!wv(e))throw qe;let n=1e3,i={selectionDelay:n,debounceWait:n,...t.options},o;return{select:gi(r,i.debounceWait,{isImmediate:!0}),beginDelayedSelect(){o=setTimeout(r,i.selectionDelay)},cancelPendingSelect(){o&&clearTimeout(o)}}}function wv(e){return e.addReducers({configuration:Te}),!0}function Dd(e,t){let r=!1;return Td(e,t,()=>{r||(r=!0,e.dispatch(xd(t.options.result.uniqueId)))})}g();d();f();p();function $s(e){if(!Rv(e))throw qe;let t=Ke(e),{dispatch:r}=e,n=()=>e.state;return{...t,fetch(){r(Ne())},get state(){let i=n().documentSuggestion;return{loading:i.status.loading,error:i.status.error,documents:i.documents}}}}function Rv(e){return e.addReducers({configuration:Te,caseAssistConfiguration:ut,caseInput:ht,caseField:yt,documentSuggestion:Ye}),!0}g();d();f();p();g();d();f();p();g();d();f();p();function Ai(_x61,_x62){return _Ai.apply(this,arguments)}function _Ai(){_Ai=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:i}=e.configuration,o=e.query?.q||"";return{url:r.apiBaseUrl??Bt(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:i,enableNavigation:!1,q:o,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Ai.apply(this,arguments)}var nn=oe("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let i=r(),o=yield Ai(i,e),s=yield t.apiClient.html(o);return ke(s)?n(s.error):{content:s.success,uniqueId:e.uniqueId}});return function(_x63,_x64){return _ref27.apply(this,arguments)}}()),Ci=Q("resultPreview/next"),bi=Q("resultPreview/previous"),wi=Q("resultPreview/prepare",e=>z(e,{results:new Ze({required:!0})})),qd=2048,Ri=oe("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),i=Va(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return i?.length>qd&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${qd} characters.`),{contentURL:i}});return function(_x65,_x66){return _ref28.apply(this,arguments)}}());g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();var jd=Q("breadcrumb/deselectAll"),Md=Q("breadcrumb/deselectAllNonBreadcrumbs");g();d();f();p();var Nd=Q("facet/updateFacetAutoSelection",e=>z(e,{allow:new ye({required:!0})}));g();d();f();p();g();d();f();p();var xi=class extends pt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let i in r[n].cache)if(r[n].cache[i].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let i in r[n].cache)if(r[n].cache[i].isActive)return r[n].cache[i];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Qe().q}get responseTime(){return this.activeInstantResultCache?.duration??Ge().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Ge().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var _d=()=>be("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new xi(e)),Ld=()=>({actionCause:"searchboxAsYouType"});g();d();f();p();var Hs={id:ee},xv={...Hs,q:Ve},GV=Q("instantResults/register",e=>z(e,Hs)),Ei=Q("instantResults/updateQuery",e=>z(e,xv)),WV=Q("instantResults/clearExpired",e=>z(e,Hs));g();d();f();p();var Ii=new Re({required:!0,min:0}),n1=Q("pagination/registerNumberOfResults",e=>z(e,Ii)),i1=Q("pagination/updateNumberOfResults",e=>z(e,Ii)),o1=Q("pagination/registerPage",e=>z(e,Ii)),Ud=Q("pagination/updatePage",e=>z(e,Ii)),s1=Q("pagination/nextPage"),a1=Q("pagination/previousPage");g();d();f();p();var Sr=Q("query/updateQuery",e=>z(e,{q:new W,enableQuerySyntax:new ye}));g();d();f();p();var ki=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Bt(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&&Qr(e.configuration.analytics,t,r)),...(e.excerptLength&&!Y(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});g();d();f();p();g();d();f();p();g();d();f();p();var Vd=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield ir(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}),...(rs()&&{pageId:rs()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Zt(e)})}}});return function Vd(_x67,_x68){return _ref29.apply(this,arguments)}}();var vr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Bt(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:dt.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 Vd(e.configuration.analytics,t))),...(e.excerptLength&&!Y(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function vr(_x69,_x70){return _ref30.apply(this,arguments)}}();g();d();f();p();g();d();f();p();var Ar=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var zs=()=>be("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),St=e=>be("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Qe().q,aq:r.advancedSearchQueries?.aq||Ar().aq,cq:r.advancedSearchQueries?.cq||Ar().cq,dq:r.advancedSearchQueries?.dq||Ar().dq,errorType:e.type,errorMessage:e.message}));g();d();f();p();g();d();f();p();var cQ=Q("didYouMean/enable"),uQ=Q("didYouMean/disable"),lQ=Q("didYouMean/automaticCorrections/disable"),dQ=Q("didYouMean/automaticCorrections/enable"),Pi=Q("didYouMean/correction",e=>z(e,ee)),pQ=Q("didYouMean/automaticCorrections/mode",e=>z(e,new W({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));g();d();f();p();var Gs=()=>be("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Qd=()=>({actionCause:"didYouMeanAutomatic"});g();d();f();p();g();d();f();p();function Bd(){return{contextValues:{}}}g();d();f();p();function $d(){return{contextValues:{}}}g();d();f();p();function Hd(){return{freezeFacetOrder:!1,facets:{}}}g();d();f();p();function zd(){return[]}g();d();f();p();function Gd(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}g();d();f();p();function Wd(){return{}}g();d();f();p();function Yd(){return{}}g();d();f();p();function Kd(){return{}}function Je(e){return{context:e.context||Bd(),dictionaryFieldContext:e.dictionaryFieldContext||$d(),facetSet:e.facetSet||ni(),numericFacetSet:e.numericFacetSet||ri(),dateFacetSet:e.dateFacetSet||ti(),categoryFacetSet:e.categoryFacetSet||ei(),automaticFacetSet:e.automaticFacetSet??Zn(),pagination:e.pagination||Gd(),query:e.query||Qe(),tabSet:e.tabSet||Kd(),advancedSearchQueries:e.advancedSearchQueries||Ar(),staticFilterSet:e.staticFilterSet||Yd(),querySet:e.querySet||Wd(),sortCriteria:e.sortCriteria||ii(),pipeline:e.pipeline||si(),searchHub:e.searchHub||Xt(),facetOptions:e.facetOptions||Hd(),facetOrder:e.facetOrder??zd(),debug:e.debug??Fn()}}g();d();f();p();var _B=new ce({values:{undoneQuery:Ve},options:{required:!0}}),Jd=()=>be("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);g();d();f();p();var Oi=Q("trigger/query/ignore",e=>z(e,new W({emptyAllowed:!0,required:!0}))),Fi=Q("trigger/query/modification",e=>z(e,new ce({values:{originalQuery:ge,modification:ge}})));g();d();f();p();var vt=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=kv(e),n=bs(e),i=Ev(e),o=yield vr(e,t),s=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return ft({...o,...(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:s(),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 vt(_x71,_x72){return _ref31.apply(this,arguments)}}();function Ev(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Iv).filter(r=>r.currentValues.length>0):void 0}function Iv(e){let{field:t,label:r,values:n}=e,i=n.filter(o=>o.state==="selected");return{field:t,label:r,currentValues:i}}function kv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(o=>o.isActive)?.expression.trim()||"",i=Pv(e);return[t,n,...i].filter(o=>!!o).join(" AND ")}function Pv(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(o=>o.state==="selected"&&!!o.expression.trim()),i=n.map(o=>o.expression).join(" OR ");return n.length>1?`(${i})`:i})}var At=class{constructor(t,r=n=>{this.dispatch(Sr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x73,_x74){var _this7=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let i=Date.now(),o=ui(yield _this7.extra.apiClient.search(r,n),t),s=Date.now()-i,u=_this7.getState().query?.q||"";return{response:o,duration:s,queryExecuted:u,requestExecuted:r}}).apply(this,arguments)}process(t){var _this8=this;return _asyncToGenerator(function*(){return _this8.processQueryErrorOrContinue(t)??(yield _this8.processQueryCorrectionsOrContinue(t))??(yield _this8.processQueryTriggersOrContinue(t))??_this8.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(St(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this9=this;return _asyncToGenerator(function*(){let r=_this9.getState(),n=_this9.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:i,automaticallyCorrectQuery:o}=r.didYouMean,{results:s,queryCorrections:u,queryCorrection:c}=n;if(!i||!o)return null;let a=s.length===0&&u&&u.length!==0,y=!Y(c)&&!Y(c.correctedQuery);if(!a&&!y)return null;let S=a?yield _this9.processLegacyDidYouMeanAutoCorrection(t):_this9.processModernDidYouMeanAutoCorrection(t);return _this9.dispatch(He(Je(_this9.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this0=this;return _asyncToGenerator(function*(){let r=_this0.getCurrentQuery(),n=_this0.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:i}=n.queryCorrections[0],o=yield _this0.automaticallyRetryQueryWithCorrection(i);return ke(o.response)?(_this0.dispatch(St(o.response.error)),_this0.rejectWithValue(o.response.error)):(_this0.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this0.dispatch(He(Je(_this0.getState()))),{...o,response:{...o.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Gs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:i}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:i,analyticsAction:Gs()}}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 _this1=this;return _asyncToGenerator(function*(){let r=_this1.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(u=>u.type==="query")?.content||"";if(!n)return null;if(_this1.getState().triggers?.queryModification.queryToIgnore===n)return _this1.dispatch(Oi("")),null;_this1.analyticsAction&&(yield _this1.dispatch(_this1.analyticsAction));let o=_this1.getCurrentQuery(),s=yield _this1.automaticallyRetryQueryWithTriggerModification(n);return ke(s.response)?(_this1.dispatch(St(s.response.error)),_this1.rejectWithValue(s.response.error)):(_this1.dispatch(He(Je(_this1.getState()))),{...s,response:{...s.response.success},automaticallyCorrected:!1,originalQuery:o,analyticsAction:Jd()})})()}getStateAfterResponse(t,r,n,i){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Qe().enableQuerySyntax},search:{...Ge(),duration:r,response:i,results:i.results}}}processSuccessResponse(t){return this.dispatch(He(Je(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return vi(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this10=this;return _asyncToGenerator(function*(){_this10.onUpdateQueryForCorrection(t);let r=yield _this10.fetchFromAPI(yield vt(_this10.getState()),{origin:"mainSearch"});return _this10.dispatch(Pi(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.dispatch(Fi({newQuery:t,originalQuery:_this11.getCurrentQuery()})),_this11.onUpdateQueryForCorrection(t),yield _this11.fetchFromAPI(yield vt(_this11.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 _$=oe("search/executeSearch",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ti(r,t,e)});return function(_x75,_x76){return _ref32.apply(this,arguments)}}()),L$=oe("search/fetchPage",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ys(r,t,e)});return function(_x77,_x78){return _ref33.apply(this,arguments)}}()),U$=oe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ks(t,r)});return function(_x79,_x80){return _ref34.apply(this,arguments)}}()),V$=oe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Dv(t,e,r)});return function(_x81,_x82){return _ref35.apply(this,arguments)}}()),Q$=oe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){return Ws(e,t)});return function(_x83,_x84){return _ref36.apply(this,arguments)}}()),Ov=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=yield vt(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function Ov(_x85,_x86){return _ref37.apply(this,arguments)}}(),Fv=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield vr(e);return ft({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function Fv(_x87,_x88,_x89){return _ref38.apply(this,arguments)}}(),Tv=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=yield vt(e,t);return r.request.numberOfResults=0,r});return function Tv(_x90,_x91){return _ref39.apply(this,arguments)}}(),Xd=e=>{e.configuration.analytics.enabled&&dt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Ws(_x92,_x93){return _Ws.apply(this,arguments)}function _Ws(){_Ws=_asyncToGenerator(function*(e,t){z(e,{id:ee,q:ee,maxResultsPerQuery:new Re({required:!0,min:1}),cacheTimeout:new Re});let{q:r,maxResultsPerQuery:n}=e,i=t.getState(),o=new At({...t,analyticsAction:_d()},a=>{t.dispatch(Ei({q:a,id:e.id}))}),s=yield Fv(i,r,n),u=yield o.fetchFromAPI(s,{origin:"instantResults",disableAbortWarning:!0}),c=yield o.process(u);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _Ws.apply(this,arguments)}function Ys(_x94,_x95,_x96){return _Ys.apply(this,arguments)}function _Ys(){_Ys=_asyncToGenerator(function*(e,t,r){Xd(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:o}=t.extra,{description:s}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:o}),u=new At({...t,analyticsAction:r}),c=yield vt(e,s),a=yield u.fetchFromAPI(c,{origin:"mainSearch"});return yield u.process(a)});return _Ys.apply(this,arguments)}function Ks(_x97,_x98){return _Ks.apply(this,arguments)}function _Ks(){_Ks=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:i}=e.extra,{description:o}=yield zs().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:i}),s=new At({...e,analyticsAction:zs()}),u=yield Ov(t,o),c=yield s.fetchFromAPI(u,{origin:"mainSearch"});return yield s.process(c)});return _Ks.apply(this,arguments)}function Dv(_x99,_x100,_x101){return _Dv.apply(this,arguments)}function _Dv(){_Dv=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:i,logger:o}=e.extra,{description:s}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:o}),u=new At({...e,analyticsAction:t}),c=yield Tv(r,s),a=yield u.fetchFromAPI(c,{origin:"facetValues"});return yield u.process(a)});return _Dv.apply(this,arguments)}function Ti(_x102,_x103,_x104){return _Ti.apply(this,arguments)}function _Ti(){_Ti=_asyncToGenerator(function*(e,t,r){Xd(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:o}=t.extra,{description:s}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:o});s?.actionCause&&t.dispatch(Js({actionCause:s.actionCause}));let u=yield vt(e,s),c=new At({...t,analyticsAction:r}),a=yield c.fetchFromAPI(u,{origin:"mainSearch"});return yield c.process(a)});return _Ti.apply(this,arguments)}g();d();f();p();g();d();f();p();var Ct=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=Uv(e),i=qv(e),o=jv(e),s=e.configuration.analytics.analyticsMode==="legacy"?yield vr(e,r):ki(e,t,r),u=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return ft({...s,...(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}),...(i.length&&{facets:i}),...(e.pagination&&{numberOfResults:u(),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 Ct(_x105,_x106,_x107){return _ref40.apply(this,arguments)}}();function qv(e){return As(Nv(e),e.facetOrder??[])}function jv(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Mv).filter(r=>r.currentValues.length>0):void 0}function Mv(e){let{field:t,label:r,values:n}=e,i=n.filter(o=>o.state==="selected");return{field:t,label:r,currentValues:i}}function Nv(e){return _v(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function _v(e){return[...Lv(e.facetSet??{}),...Zd(e.numericFacetSet??{}),...Zd(e.dateFacetSet??{}),...gt(e.categoryFacetSet??{})]}function Lv(e){return gt(e).map(t=>{let r=Cs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Zd(e){return gt(e).map(t=>{let r=t.currentValues,n=r.some(({state:o})=>o!=="idle"),i=r.some(o=>o.previousState);return t.generateAutomaticRanges&&!n&&!i?{...t,currentValues:[]}:t})}function Uv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(o=>o.isActive)?.expression.trim()||"",i=vs(e);return[t,n,...i].filter(o=>!!o).join(" AND ")}var bt=class{constructor(t,r=n=>{this.dispatch(Sr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x108,_x109){var _this12=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let i=Date.now(),o=ui(yield _this12.extra.apiClient.search(r,n),t),s=Date.now()-i,u=_this12.getState().query?.q||"";return{response:o,duration:s,queryExecuted:u,requestExecuted:r}}).apply(this,arguments)}process(t){var _this13=this;return _asyncToGenerator(function*(){return _this13.processQueryErrorOrContinue(t)??(yield _this13.processQueryCorrectionsOrContinue(t))??(yield _this13.processQueryTriggersOrContinue(t))??_this13.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(St(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getState(),n=_this14.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:i,automaticallyCorrectQuery:o}=r.didYouMean,{results:s,queryCorrections:u,queryCorrection:c}=n;if(!i||!o)return null;let a=s.length===0&&u&&u.length!==0,y=!Y(c)&&!Y(c.correctedQuery);if(!a&&!y)return null;let S=a?yield _this14.processLegacyDidYouMeanAutoCorrection(t):_this14.processModernDidYouMeanAutoCorrection(t);return _this14.dispatch(He(Je(_this14.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this15=this;return _asyncToGenerator(function*(){let r=_this15.getCurrentQuery(),n=_this15.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:i}=n.queryCorrections[0],o=yield _this15.automaticallyRetryQueryWithCorrection(i);return ke(o.response)?(_this15.dispatch(St(o.response.error)),_this15.rejectWithValue(o.response.error)):(_this15.dispatch(He(Je(_this15.getState()))),{...o,response:{...o.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:i}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:i}}processQueryTriggersOrContinue(t){var _this16=this;return _asyncToGenerator(function*(){let r=_this16.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(u=>u.type==="query")?.content||"";if(!n)return null;if(_this16.getState().triggers?.queryModification.queryToIgnore===n)return _this16.dispatch(Oi("")),null;let o=_this16.getCurrentQuery(),s=yield _this16.automaticallyRetryQueryWithTriggerModification(n);return ke(s.response)?(_this16.dispatch(St(s.response.error)),_this16.rejectWithValue(s.response.error)):(_this16.dispatch(He(Je(_this16.getState()))),{...s,response:{...s.response.success},automaticallyCorrected:!1,originalQuery:o})})()}processSuccessResponse(t){return this.dispatch(He(Je(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return vi(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this17=this;return _asyncToGenerator(function*(){_this17.onUpdateQueryForCorrection(t);let r=_this17.getState(),{actionCause:n}=Qd(),i=yield _this17.fetchFromAPI(yield Ct(r,_this17.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this17.dispatch(Pi(t)),i})()}automaticallyRetryQueryWithTriggerModification(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.dispatch(Fi({newQuery:t,originalQuery:_this18.getCurrentQuery()})),_this18.onUpdateQueryForCorrection(t),yield _this18.fetchFromAPI(yield Ct(_this18.getState(),_this18.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 LH=oe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;z(e,{q:new W,enableQuerySyntax:new ye,clearFilters:new ye}),e.clearFilters&&(r(jd()),r(Md())),r(Nd({allow:!0})),r(Sr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Ud(1))}),Js=Q("search/updateSearchAction"),ep=oe("search/executeSearch",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ti(r,t,e.legacy);np(r);let n=e.next?ip(e.next):void 0;t.dispatch(Js(e.next));let i=yield Ct(r,t.extra.navigatorContext,n),o=new bt({...t,analyticsAction:n??{}}),s=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(s)});return function(_x110,_x111){return _ref41.apply(this,arguments)}}()),tp=oe("search/fetchPage",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();if(np(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Ys(r,t,e.legacy);let n=new bt({...t,analyticsAction:e.next}),i=yield Ct(r,t.extra.navigatorContext,e.next),o=yield n.fetchFromAPI(i,{origin:"mainSearch"});return yield n.process(o)});return function(_x112,_x113){return _ref42.apply(this,arguments)}}()),rp=oe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ks(t,r);let n=Tu("browseResults",t.getState),i=new bt({...t,analyticsAction:n}),o=yield Vv(r,t.extra.navigatorContext,n),s=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(s)});return function(_x114,_x115){return _ref43.apply(this,arguments)}}()),UH=oe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ti(r,t,e.legacy);let n=new bt({...t,analyticsAction:{}}),i=yield Bv(r,t.extra.navigatorContext),o=yield n.fetchFromAPI(i,{origin:"facetValues"});return yield n.process(o)});return function(_x116,_x117){return _ref44.apply(this,arguments)}}()),VH=oe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ws(e,t);z(e,{id:ee,q:ee,maxResultsPerQuery:new Re({required:!0,min:1}),cacheTimeout:new Re});let{q:n,maxResultsPerQuery:i}=e,o=ip(Ld()),s=yield Qv(r,t.extra.navigatorContext,n,i,o),u=new bt({...t,analyticsAction:o},y=>{t.dispatch(Ei({q:y,id:e.id}))}),c=yield u.fetchFromAPI(s,{origin:"instantResults",disableAbortWarning:!0}),a=yield u.process(c);return"response"in a?{results:a.response.results,searchUid:a.response.searchUid,totalCountFiltered:a.response.totalCountFiltered,duration:a.duration}:a});return function(_x118,_x119){return _ref45.apply(this,arguments)}}()),Vv=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t,r){let n=yield Ct(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function Vv(_x120,_x121,_x122){return _ref46.apply(this,arguments)}}(),Qv=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r,n,i){let o=ki(e,t,i);return ft({...o,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function Qv(_x123,_x124,_x125,_x126,_x127){return _ref47.apply(this,arguments)}}(),Bv=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=yield Ct(e,t,r);return n.request.numberOfResults=0,n});return function Bv(_x128,_x129,_x130){return _ref48.apply(this,arguments)}}(),np=e=>{e.configuration.analytics.enabled&&dt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},ip=e=>({actionCause:e.actionCause,type:e.actionCause});g();d();f();p();function Xs(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var Zs=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:i}=Xs();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=i},ea=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),op=fe(Xs(),e=>{e.addCase(nn.pending,t=>{t.isLoading=!0}).addCase(nn.fulfilled,(t,r)=>{let{content:n,uniqueId:i}=r.payload;t.position=t.resultsWithPreview.indexOf(i),t.content=n,t.uniqueId=i,t.isLoading=!1}).addCase(ep.fulfilled,(t,r)=>{Zs(t),t.resultsWithPreview=ea(r.payload.response.results)}).addCase(rp.fulfilled,(t,r)=>{Zs(t),t.resultsWithPreview=t.resultsWithPreview.concat(ea(r.payload.response.results))}).addCase(tp.fulfilled,Zs).addCase(wi,(t,r)=>{t.resultsWithPreview=ea(r.payload.results)}).addCase(Ci,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(bi,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Ri.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function sp(e,t,r,n,i){if(!$v(e))throw qe;let{dispatch:o}=e,s=()=>e.state,u=Ke(e),{result:c,maximumPreviewSize:a}=t.options,y=()=>{let{resultsWithPreview:S,position:m}=s().resultPreview;return S[m]},h=S=>{o(Ri({uniqueId:S,requestedOutputSize:a,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||o(nn({uniqueId:S,requestedOutputSize:a})),i&&i()};return{...u,fetchResultContent(){h(c.uniqueId)},next(){o(Ci()),h(y())},previous(){o(bi()),h(y())},get state(){let S=s(),m=c.hasHtmlVersion,v=S.resultPreview,R=c.uniqueId===v.uniqueId?v.content:"",E=v.isLoading,b=v.contentURL,P=y();return{content:R,resultHasPreview:m,isLoading:E,contentURL:b,currentResultUniqueId:P}}}}function $v(e){return e.addReducers({configuration:Te,resultPreview:op}),!0}function ap(e,t){if(!Hv(e))throw qe;let{dispatch:r}=e,n=()=>e.state,i=()=>n().documentSuggestion.documents,u=sp(e,t,Ai,"/html",()=>{e.dispatch(Si(t.options.result.uniqueId))});return r(wi({results:i()})),{...u,get state(){return{...u.state,currentDocument:i().findIndex(c=>c.uniqueId===u.state.currentResultUniqueId)+1,totalDocuments:i().length}}}}function Hv(e){return e.addReducers({documentSuggestion:Ye}),!0}g();d();f();p();g();d();f();p();var ta=e=>z(e,{evt:ee,type:ge}),cp=e=>be("analytics/generic/search",t=>{ta(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),up=e=>be("analytics/generic/click",(t,r)=>(os(e.result),ta(e),t.makeClickEvent(e.evt,ns(e.result,r),is(e.result),e.meta))),lp=e=>be("analytics/generic/custom",t=>(ta(e),t.makeCustomEventWithType(e.evt,e.type,e.meta)));function zv(e){return e.addReducers({}),{logSearchEvent:cp,logClickEvent:up,logCustomEvent:lp}}g();d();f();p();function Gv(e){return e.addReducers({}),{logCaseStart:Sd,logCaseNextStage:vd,logCreateCase:Ad,logSolveCase:Cd,logAbandonCase:bd,logUpdateCaseField:mr,logClassificationClick:hi,logDocumentSuggestionClick:Rd,logDocumentSuggestionRating:Ed,logQuickviewDocumentSuggestionClick:Si}}g();d();f();p();function Wv(e){return e.addReducers({caseField:yt}),{registerCaseField:yr,updateCaseField:hr,fetchCaseClassifications:We}}g();d();f();p();function Yv(e){return e.addReducers({caseInput:ht}),{updateCaseInput:Nt}}g();d();f();p();function Kv(e){return e.addReducers({documentSuggestion:Ye}),{fetchDocumentSuggestions:Ne}}/**
34
+ For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function rd(e){e==="next"&&console.warn($S)}g();d();f();p();var dd=Ne(ld(),1);function pd(e){return(0,dd.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}g();d();f();p();function fd(e,t){let r=cv(e),n=bo,i=uv(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:i,logger:t}}function cv(e){let{analytics:t}=e,r=(n,i)=>i;return t?.analyticsClientMiddleware||r}function uv(e){return e.preprocessRequest||un}g();d();f();p();g();d();f();p();var gd={organizationId:ee,accessToken:ee,name:new W({required:!1,emptyAllowed:!1}),analytics:new ce({options:{required:!1},values:{enabled:new he({required:!1}),originContext:new W({required:!1}),originLevel2:new W({required:!1}),originLevel3:new W({required:!1}),analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new W({required:!1,url:!0}),trackingId:new W({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new W({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};var md=new _e({...gd,caseAssistId:ee,locale:ge});var lv={debug:Fc,caseAssistConfiguration:ct,searchHub:Mc};function hd(e){let t=pd(e.loggerOptions);dv(e.configuration,t);let r=pv(e.configuration,t),n={...fd(e.configuration,t),apiClient:r},i={...e,reducers:lv},o=td(i,n);rd(o.state.configuration.analytics.analyticsMode);let{caseAssistId:s,locale:u,searchHub:c,proxyBaseUrl:a}=e.configuration;return o.dispatch(On({caseAssistId:s,locale:u,proxyBaseUrl:a})),Y(c)||o.dispatch(Dn(c)),{...o,get state(){return o.state}}}function dv(e,t){try{md.validate(e)}catch(r){throw t.error(r,"Case Assist engine configuration error"),r}}function pv(e,t){return new gn({logger:t,preprocessRequest:e.preprocessRequest||un})}g();d();f();p();g();d();f();p();g();d();f();p();var yd=(o=>(o.id="id",o.subject="subject",o.description="description",o.category="category",o.productId="productId",o))(yd||{}),Sd=e=>!Object.values(yd).includes(e),Ie=e=>{let t=r=>fv(e,r)??mv(e,r);return{id:t("id"),subject:t("subject"),description:t("description"),category:t("category"),productId:t("productId"),custom:{...gv(e),...hv(e)}}},fv=(e,t)=>e?.caseInput?.[t]?.value,gv=e=>Object.keys(e?.caseInput??[]).reduce((t,r)=>{if(Sd(r)){let n=e?.caseInput?.[r]?.value;if(n)return{...t,[r]:n}}return t},{}),mv=(e,t)=>e?.caseField?.fields[t]?.value,hv=e=>Object.keys(e?.caseField?.fields??[]).reduce((t,r)=>{if(Sd(r)){let n=e?.caseField?.fields?.[r]?.value;if(n)return{...t,[r]:n}}return t},{}),$s=(e,t,r=!1)=>{let n=Object.keys(e?.caseField?.fields??{}).find(u=>e?.caseField?.fields[u].suggestions.some(c=>c.id===t));if(!n)throw new Error(`Classification with ID '${t}' could not be found.`);let o=e?.caseField?.fields[n]?.suggestions.find(u=>u.id===t),s={classificationId:o?.id??"",responseId:e.caseField?.status.lastResponseId??"",fieldName:n,classification:{value:o?.value??"",confidence:o?.confidence??0}};return r?{...s,autoSelection:r}:s},ot=(e,t,r=!1,n=!1)=>{let i,o=e.documentSuggestion?.documents.find((u,c)=>{let a=u.uniqueId===t;return a&&(i=c+1),a});if(!o)throw new Error(`Document Suggestion with ID '${t}' could not be found.`);let s={suggestionId:o.uniqueId,permanentId:o.fields.permanentid,responseId:e.documentSuggestion?.status.lastResponseId??"",suggestion:{documentUri:o.fields.uri,documentUriHash:o.fields.urihash,documentTitle:o.title,documentUrl:o.clickUri,documentPosition:i??0,sourceName:o.fields.source}};return r?{...s,fromQuickview:r}:n?{...s,openDocument:n}:s};var vd=()=>Oe({prefix:"analytics/caseAssist/case/start",__legacy__getBuilder:(e,t)=>e.logEnterInterface({ticket:Ie(t)}),analyticsType:"CaseAssist.Start",analyticsPayloadBuilder:()=>({})}),Ad=e=>Oe("analytics/caseAssist/case/nextStage",(t,r)=>t.logMoveToNextCaseStep({ticket:Ie(r),stage:e?.stageName})),Cd=()=>Oe({prefix:"analytics/caseAssist/case/create",__legacy__getBuilder:(e,t)=>e.logCaseCreated({ticket:Ie(t)}),analyticsType:"CaseAssist.CreateTicket",analyticsPayloadBuilder:e=>{let{id:t,category:r,subject:n,description:i,productId:o}=Ie(e);return{ticket:{id:t,category:r,subject:n,description:i,system:o}}}}),bd=()=>Oe({prefix:"analytics/caseAssist/case/solve",__legacy__getBuilder:(e,t)=>e.logCaseSolved({ticket:Ie(t)}),analyticsType:"CaseAssist.Cancel",analyticsPayloadBuilder:()=>({reason:"solved"})}),wd=()=>Oe({prefix:"analytics/caseAssist/case/abandon",__legacy__getBuilder:(e,t)=>e.logCaseCancelled({ticket:Ie(t)}),analyticsType:"CaseAssist.Cancel",analyticsPayloadBuilder:()=>({reason:"quit"})}),mr=e=>Oe({prefix:"analytics/caseAssist/case/field/update",__legacy__getBuilder:(t,r)=>t.logUpdateCaseField({fieldName:e,ticket:Ie(r)}),analyticsType:"CaseAssist.UpdateField",analyticsPayloadBuilder:t=>{let r=t.caseField?.fields?.[e]?.value||t.caseInput?.[e]?.value||"";return{fieldName:e,fieldValue:r}}}),Rd=e=>Oe({prefix:"analytics/caseAssist/classification/click",__legacy__getBuilder:(t,r)=>t.logSelectFieldSuggestion({suggestion:$s(r,e,!0),ticket:Ie(r)}),analyticsType:"CaseAssist.SelectFieldClassification",analyticsPayloadBuilder:t=>{let r=t.caseField?.status?.lastResponseId;if(r)return{autoselected:!0,classificationId:e,responseId:r}}}),Si=e=>Oe({prefix:"analytics/caseAssist/classification/click",__legacy__getBuilder:(t,r)=>t.logSelectFieldSuggestion({suggestion:$s(r,e),ticket:Ie(r)}),analyticsType:"CaseAssist.SelectFieldClassification",analyticsPayloadBuilder:t=>{let r=t.caseField?.status?.lastResponseId;if(r)return{autoselected:!1,classificationId:e,responseId:r}}}),xd=e=>Oe({prefix:"analytics/caseAssist/documentSuggestion/click",__legacy__getBuilder:(t,r)=>t.logSelectDocumentSuggestion({suggestion:ot(r,e),ticket:Ie(r)}),analyticsType:"CaseAssist.DocumentSuggestionClick",analyticsPayloadBuilder:t=>{let r=t.documentSuggestion?.status?.lastResponseId,n=ot(t,e);if(r)return{responseId:r,position:n.suggestion.documentPosition,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:n.suggestionId,url:n.suggestion.documentUri,title:n.suggestion.documentTitle}}}}),vi=e=>Oe({prefix:"analytics/caseAssist/documentSuggestion/click",__legacy__getBuilder:(t,r)=>t.logQuickviewDocumentSuggestion({suggestion:ot(r,e),ticket:Ie(r)}),analyticsType:"CaseAssist.DocumentSuggestionClick",analyticsPayloadBuilder:t=>{let r=t.documentSuggestion?.status?.lastResponseId,n=ot(t,e);if(r)return{responseId:r,position:n.suggestion.documentPosition,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:n.suggestionId,url:n.suggestion.documentUri,title:n.suggestion.documentTitle}}}}),Ed=e=>Oe({prefix:"analytics/caseAssist/documentSuggestion/click",__legacy__getBuilder:(t,r)=>t.logSelectDocumentSuggestion({suggestion:ot(r,e,!1,!0),ticket:Ie(r)}),analyticsType:"CaseAssist.DocumentSuggestionClick",analyticsPayloadBuilder:t=>{let r=t.documentSuggestion?.status?.lastResponseId,n=ot(t,e);if(r)return{responseId:r,position:n.suggestion.documentPosition,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:n.suggestionId,url:n.suggestion.documentUri,title:n.suggestion.documentTitle}}}}),Id=(e,t)=>Oe({prefix:"analytics/caseAssist/documentSuggestion/rate",__legacy__getBuilder:(r,n)=>r.logRateDocumentSuggestion({rating:t,suggestion:ot(n,e),ticket:Ie(n)}),analyticsType:"CaseAssist.DocumentSuggestionFeedback",analyticsPayloadBuilder:r=>{let n=r.documentSuggestion?.status?.lastResponseId,i=ot(r,e);if(n)return{responseId:n,itemMetadata:{uniqueFieldName:"uniqueId",uniqueFieldValue:i.suggestionId,url:i.suggestion.documentUri,title:i.suggestion.documentTitle},liked:!!t}}});g();d();f();p();g();d();f();p();g();d();f();p();var Ai=e=>e.success!==void 0,ke=e=>e.error!==void 0;var hr=Q("caseAssist/caseField/register",e=>z(e,{fieldName:ee,fieldValue:Ue})),yr=Q("caseAssist/caseField/update",e=>z(e,{fieldName:ee,fieldValue:Ue})),Ge=oe("caseAssist/classifications/fetch",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let i=t(),o=yield n.getCaseClassifications(yield yv(i));return ke(o)?r(o.error):{response:o.success}});return function(_x54,_x55){return _ref23.apply(this,arguments)}}()),yv=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.caseAssistConfiguration.apiBaseUrl??pe(e.configuration.organizationId,e.configuration.environment),caseAssistId:e.caseAssistConfiguration.caseAssistId,...(e.configuration.analytics.enabled&&{clientId:yield ir(e.configuration.analytics)}),fields:e.caseInput,context:e.caseField?fn(e.caseField.fields):void 0,locale:e.caseAssistConfiguration.locale,debug:e.debug}});return function yv(_x56){return _ref24.apply(this,arguments)}}();g();d();f();p();g();d();f();p();var kd=()=>({status:{loading:!1,error:null,lastResponseId:""},fields:{}});var mt=fe(kd(),e=>{e.addCase(hr,(t,r)=>{let{fieldName:n,fieldValue:i}=r.payload;t.fields[n]={value:i,suggestions:[]}}).addCase(yr,(t,r)=>{let{fieldName:n,fieldValue:i}=r.payload;t.fields[n].value=i}).addCase(Ge.rejected,(t,r)=>{t.status.error=r.payload??null,t.status.loading=!1}).addCase(Ge.fulfilled,(t,r)=>{let n={value:"",suggestions:[]};Object.entries(r.payload.response.fields).forEach(([i,o])=>{t.fields[i]||(t.fields[i]={...n}),t.fields[i].suggestions=o.predictions}),t.status.lastResponseId=r.payload.response.responseId,t.status.error=null,t.status.loading=!1}).addCase(Ge.pending,t=>{t.status.loading=!0}).addCase(fr,(t,r)=>{t.status.error=r.payload,t.status.loading=!1})});g();d();f();p();g();d();f();p();var Mt=Q("caseAssist/caseInput/update",e=>z(e,{fieldName:ee,fieldValue:Ue}));g();d();f();p();var Pd=()=>({});var ht=fe(Pd(),e=>{e.addCase(Mt,(t,r)=>{t[r.payload.fieldName]={value:r.payload.fieldValue}})});g();d();f();p();var Me=oe("caseAssist/documentSuggestions/fetch",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:i}}){let o=t(),s=yield n.getDocumentSuggestions(yield Sv(o,i));return ke(s)?r(s.error):{response:s.success}});return function(_x57,_x58){return _ref25.apply(this,arguments)}}()),Sv=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.caseAssistConfiguration.apiBaseUrl??pe(e.configuration.organizationId,e.configuration.environment),caseAssistId:e.caseAssistConfiguration.caseAssistId,...(e.configuration.analytics.enabled&&{clientId:yield ir(e.configuration.analytics)}),...(e.configuration.analytics.enabled&&Qr(e.configuration.analytics,t,{actionCause:"documentSuggestion"})),fields:e.caseInput,context:e.caseField?fn(e.caseField.fields):void 0,locale:e.caseAssistConfiguration.locale,debug:e.debug}});return function Sv(_x59,_x60){return _ref26.apply(this,arguments)}}();g();d();f();p();g();d();f();p();var Od=()=>({status:{loading:!1,error:null,lastResponseId:""},documents:[]});var We=fe(Od(),e=>{e.addCase(Me.rejected,(t,r)=>{t.status.error=r.payload??null,t.status.loading=!1}).addCase(Me.fulfilled,(t,r)=>{t.documents=r.payload.response.documents,t.status.lastResponseId=r.payload.response.responseId,t.status.error=null,t.status.loading=!1}).addCase(Me.pending,t=>{t.status.loading=!0}).addCase(fr,(t,r)=>{t.status.error=r.payload,t.status.loading=!1})});g();d();f();p();function Ye(e){let t,r=new Map,n=()=>r.size===0,i=o=>{try{let s=JSON.stringify(o),u=t!==s;return t=s,u}catch(s){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",s),!0}};return{subscribe(o){o();let s=Symbol(),u;return n()&&(t=JSON.stringify(this.state),u=e.subscribe(()=>{i(this.state)&&r.forEach(c=>c())})),r.set(s,o),()=>{r.delete(s),n()&&u?.()}},get state(){return{}}}}var vv=new _e({field:ee});function Fd(e,t={}){if(!Av(e))throw De;let r=Ye(e),{dispatch:n}=e,i=Pn(e,vv,t.options,"buildCaseField"),o=()=>e.state;return o().caseField?.fields?.[i.field]||n(hr({fieldName:i.field,fieldValue:""})),{...r,get state(){let u=o().caseField?.status?.loading??!1,c=o().caseField?.status?.error??null,a=o().caseField?.fields?.[i.field],h=a?.value??"",y=a?.suggestions??[];return{loading:u,error:c,value:h,suggestions:y}},update(u,c,a){let h=o().caseField?.fields?.[i.field]?.suggestions?.find(y=>y.value===u)?.id;h&&n(a?Rd(h):Si(h)),n(yr({fieldName:i.field,fieldValue:u})),!a&&n(mr(i.field)),c?.caseClassifications&&n(Ge()),c?.documentSuggestions&&n(Me())}}}function Av(e){return e.addReducers({configuration:Fe,caseAssistConfiguration:ct,caseInput:ht,caseField:mt,documentSuggestion:We}),!0}g();d();f();p();function Cv(e,t){let r=new _e({field:ee});Pn(e,r,t,"buildCaseInput")}function Td(e,t){if(!bv(e))throw De;let r=Ye(e),{dispatch:n}=e,i=()=>e.state;Cv(e,t.options);let o=t.options.field;return i().caseInput?.[o]||n(Mt({fieldName:o,fieldValue:""})),{...r,update(u,c){n(Mt({fieldName:o,fieldValue:u})),n(mr(o)),c?.caseClassifications&&n(Ge()),c?.documentSuggestions&&n(Me())},get state(){return i().caseInput[o]}}}function bv(e){return e.addReducers({configuration:Fe,caseAssistConfiguration:ct,caseInput:ht,caseField:mt,documentSuggestion:We}),!0}g();d();f();p();g();d();f();p();function Dd(e,t,r){if(!wv(e))throw De;let n=1e3,i={selectionDelay:n,debounceWait:n,...t.options},o;return{select:mi(r,i.debounceWait,{isImmediate:!0}),beginDelayedSelect(){o=setTimeout(r,i.selectionDelay)},cancelPendingSelect(){o&&clearTimeout(o)}}}function wv(e){return e.addReducers({configuration:Fe}),!0}function qd(e,t){let r=!1;return Dd(e,t,()=>{r||(r=!0,e.dispatch(Ed(t.options.result.uniqueId)))})}g();d();f();p();function Hs(e){if(!Rv(e))throw De;let t=Ye(e),{dispatch:r}=e,n=()=>e.state;return{...t,fetch(){r(Me())},get state(){let i=n().documentSuggestion;return{loading:i.status.loading,error:i.status.error,documents:i.documents}}}}function Rv(e){return e.addReducers({configuration:Fe,caseAssistConfiguration:ct,caseInput:ht,caseField:mt,documentSuggestion:We}),!0}g();d();f();p();g();d();f();p();g();d();f();p();function Ci(_x61,_x62){return _Ci.apply(this,arguments)}function _Ci(){_Ci=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:i}=e.configuration,o=e.query?.q||"";return{url:r.apiBaseUrl??Qt(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:i,enableNavigation:!1,q:o,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Ci.apply(this,arguments)}var nn=oe("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let i=r(),o=yield Ci(i,e),s=yield t.apiClient.html(o);return ke(s)?n(s.error):{content:s.success,uniqueId:e.uniqueId}});return function(_x63,_x64){return _ref27.apply(this,arguments)}}()),bi=Q("resultPreview/next"),wi=Q("resultPreview/previous"),Ri=Q("resultPreview/prepare",e=>z(e,{results:new Xe({required:!0})})),jd=2048,xi=oe("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),i=Qa(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return i?.length>jd&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${jd} characters.`),{contentURL:i}});return function(_x65,_x66){return _ref28.apply(this,arguments)}}());g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();var Md=Q("breadcrumb/deselectAll"),Nd=Q("breadcrumb/deselectAllNonBreadcrumbs");g();d();f();p();var _d=Q("facet/updateFacetAutoSelection",e=>z(e,{allow:new he({required:!0})}));g();d();f();p();g();d();f();p();var Ei=class extends dt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let i in r[n].cache)if(r[n].cache[i].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let i in r[n].cache)if(r[n].cache[i].isActive)return r[n].cache[i];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ve().q}get responseTime(){return this.activeInstantResultCache?.duration??ze().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ze().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Ld=()=>be("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ei(e)),Ud=()=>({actionCause:"searchboxAsYouType"});g();d();f();p();var zs={id:ee},xv={...zs,q:Ue},BV=Q("instantResults/register",e=>z(e,zs)),Ii=Q("instantResults/updateQuery",e=>z(e,xv)),$V=Q("instantResults/clearExpired",e=>z(e,zs));g();d();f();p();var ki=new Re({required:!0,min:0}),ZV=Q("pagination/registerNumberOfResults",e=>z(e,ki)),e1=Q("pagination/updateNumberOfResults",e=>z(e,ki)),t1=Q("pagination/registerPage",e=>z(e,ki)),Vd=Q("pagination/updatePage",e=>z(e,ki)),r1=Q("pagination/nextPage"),n1=Q("pagination/previousPage");g();d();f();p();var Sr=Q("query/updateQuery",e=>z(e,{q:new W,enableQuerySyntax:new he}));g();d();f();p();var Pi=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Qt(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&&Qr(e.configuration.analytics,t,r)),...(e.excerptLength&&!Y(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});g();d();f();p();g();d();f();p();g();d();f();p();var Qd=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield ir(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}),...(ns()&&{pageId:ns()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Zt(e)})}}});return function Qd(_x67,_x68){return _ref29.apply(this,arguments)}}();var vr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Qt(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:lt.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 Qd(e.configuration.analytics,t))),...(e.excerptLength&&!Y(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function vr(_x69,_x70){return _ref30.apply(this,arguments)}}();g();d();f();p();g();d();f();p();var Ar=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Gs=()=>be("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),yt=e=>be("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ve().q,aq:r.advancedSearchQueries?.aq||Ar().aq,cq:r.advancedSearchQueries?.cq||Ar().cq,dq:r.advancedSearchQueries?.dq||Ar().dq,errorType:e.type,errorMessage:e.message}));g();d();f();p();g();d();f();p();var iQ=Q("didYouMean/enable"),oQ=Q("didYouMean/disable"),sQ=Q("didYouMean/automaticCorrections/disable"),aQ=Q("didYouMean/automaticCorrections/enable"),Oi=Q("didYouMean/correction",e=>z(e,ee)),cQ=Q("didYouMean/automaticCorrections/mode",e=>z(e,new W({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));g();d();f();p();var Ws=()=>be("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Bd=()=>({actionCause:"didYouMeanAutomatic"});g();d();f();p();g();d();f();p();function $d(){return{contextValues:{}}}g();d();f();p();function Hd(){return{contextValues:{}}}g();d();f();p();function zd(){return{freezeFacetOrder:!1,facets:{}}}g();d();f();p();function Gd(){return[]}g();d();f();p();function Wd(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}g();d();f();p();function Yd(){return{}}g();d();f();p();function Kd(){return{}}g();d();f();p();function Jd(){return{}}function Ke(e){return{context:e.context||$d(),dictionaryFieldContext:e.dictionaryFieldContext||Hd(),facetSet:e.facetSet||ii(),numericFacetSet:e.numericFacetSet||ni(),dateFacetSet:e.dateFacetSet||ri(),categoryFacetSet:e.categoryFacetSet||ti(),automaticFacetSet:e.automaticFacetSet??ei(),pagination:e.pagination||Wd(),query:e.query||Ve(),tabSet:e.tabSet||Jd(),advancedSearchQueries:e.advancedSearchQueries||Ar(),staticFilterSet:e.staticFilterSet||Kd(),querySet:e.querySet||Yd(),sortCriteria:e.sortCriteria||oi(),pipeline:e.pipeline||ai(),searchHub:e.searchHub||Xt(),facetOptions:e.facetOptions||zd(),facetOrder:e.facetOrder??Gd(),debug:e.debug??Tn()}}g();d();f();p();var qB=new ce({values:{undoneQuery:Ue},options:{required:!0}}),Xd=()=>be("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);g();d();f();p();var Fi=Q("trigger/query/ignore",e=>z(e,new W({emptyAllowed:!0,required:!0}))),Ti=Q("trigger/query/modification",e=>z(e,new ce({values:{originalQuery:ge,modification:ge}})));g();d();f();p();var St=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=kv(e),n=ws(e),i=Ev(e),o=yield vr(e,t),s=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return pt({...o,...(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:s(),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 St(_x71,_x72){return _ref31.apply(this,arguments)}}();function Ev(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Iv).filter(r=>r.currentValues.length>0):void 0}function Iv(e){let{field:t,label:r,values:n}=e,i=n.filter(o=>o.state==="selected");return{field:t,label:r,currentValues:i}}function kv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(o=>o.isActive)?.expression.trim()||"",i=Pv(e);return[t,n,...i].filter(o=>!!o).join(" AND ")}function Pv(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(o=>o.state==="selected"&&!!o.expression.trim()),i=n.map(o=>o.expression).join(" OR ");return n.length>1?`(${i})`:i})}var vt=class{constructor(t,r=n=>{this.dispatch(Sr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x73,_x74){var _this7=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let i=Date.now(),o=li(yield _this7.extra.apiClient.search(r,n),t),s=Date.now()-i,u=_this7.getState().query?.q||"";return{response:o,duration:s,queryExecuted:u,requestExecuted:r}}).apply(this,arguments)}process(t){var _this8=this;return _asyncToGenerator(function*(){return _this8.processQueryErrorOrContinue(t)??(yield _this8.processQueryCorrectionsOrContinue(t))??(yield _this8.processQueryTriggersOrContinue(t))??_this8.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(yt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this9=this;return _asyncToGenerator(function*(){let r=_this9.getState(),n=_this9.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:i,automaticallyCorrectQuery:o}=r.didYouMean,{results:s,queryCorrections:u,queryCorrection:c}=n;if(!i||!o)return null;let a=s.length===0&&u&&u.length!==0,h=!Y(c)&&!Y(c.correctedQuery);if(!a&&!h)return null;let S=a?yield _this9.processLegacyDidYouMeanAutoCorrection(t):_this9.processModernDidYouMeanAutoCorrection(t);return _this9.dispatch($e(Ke(_this9.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this0=this;return _asyncToGenerator(function*(){let r=_this0.getCurrentQuery(),n=_this0.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:i}=n.queryCorrections[0],o=yield _this0.automaticallyRetryQueryWithCorrection(i);return ke(o.response)?(_this0.dispatch(yt(o.response.error)),_this0.rejectWithValue(o.response.error)):(_this0.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this0.dispatch($e(Ke(_this0.getState()))),{...o,response:{...o.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Ws()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:i}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:i,analyticsAction:Ws()}}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 _this1=this;return _asyncToGenerator(function*(){let r=_this1.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(u=>u.type==="query")?.content||"";if(!n)return null;if(_this1.getState().triggers?.queryModification.queryToIgnore===n)return _this1.dispatch(Fi("")),null;_this1.analyticsAction&&(yield _this1.dispatch(_this1.analyticsAction));let o=_this1.getCurrentQuery(),s=yield _this1.automaticallyRetryQueryWithTriggerModification(n);return ke(s.response)?(_this1.dispatch(yt(s.response.error)),_this1.rejectWithValue(s.response.error)):(_this1.dispatch($e(Ke(_this1.getState()))),{...s,response:{...s.response.success},automaticallyCorrected:!1,originalQuery:o,analyticsAction:Xd()})})()}getStateAfterResponse(t,r,n,i){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ve().enableQuerySyntax},search:{...ze(),duration:r,response:i,results:i.results}}}processSuccessResponse(t){return this.dispatch($e(Ke(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Ai(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this10=this;return _asyncToGenerator(function*(){_this10.onUpdateQueryForCorrection(t);let r=yield _this10.fetchFromAPI(yield St(_this10.getState()),{origin:"mainSearch"});return _this10.dispatch(Oi(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.dispatch(Ti({newQuery:t,originalQuery:_this11.getCurrentQuery()})),_this11.onUpdateQueryForCorrection(t),yield _this11.fetchFromAPI(yield St(_this11.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 q$=oe("search/executeSearch",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Di(r,t,e)});return function(_x75,_x76){return _ref32.apply(this,arguments)}}()),j$=oe("search/fetchPage",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ks(r,t,e)});return function(_x77,_x78){return _ref33.apply(this,arguments)}}()),M$=oe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Js(t,r)});return function(_x79,_x80){return _ref34.apply(this,arguments)}}()),N$=oe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Dv(t,e,r)});return function(_x81,_x82){return _ref35.apply(this,arguments)}}()),_$=oe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){return Ys(e,t)});return function(_x83,_x84){return _ref36.apply(this,arguments)}}()),Ov=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=yield St(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function Ov(_x85,_x86){return _ref37.apply(this,arguments)}}(),Fv=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield vr(e);return pt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function Fv(_x87,_x88,_x89){return _ref38.apply(this,arguments)}}(),Tv=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=yield St(e,t);return r.request.numberOfResults=0,r});return function Tv(_x90,_x91){return _ref39.apply(this,arguments)}}(),Zd=e=>{e.configuration.analytics.enabled&&lt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Ys(_x92,_x93){return _Ys.apply(this,arguments)}function _Ys(){_Ys=_asyncToGenerator(function*(e,t){z(e,{id:ee,q:ee,maxResultsPerQuery:new Re({required:!0,min:1}),cacheTimeout:new Re});let{q:r,maxResultsPerQuery:n}=e,i=t.getState(),o=new vt({...t,analyticsAction:Ld()},a=>{t.dispatch(Ii({q:a,id:e.id}))}),s=yield Fv(i,r,n),u=yield o.fetchFromAPI(s,{origin:"instantResults",disableAbortWarning:!0}),c=yield o.process(u);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _Ys.apply(this,arguments)}function Ks(_x94,_x95,_x96){return _Ks.apply(this,arguments)}function _Ks(){_Ks=_asyncToGenerator(function*(e,t,r){Zd(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:o}=t.extra,{description:s}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:o}),u=new vt({...t,analyticsAction:r}),c=yield St(e,s),a=yield u.fetchFromAPI(c,{origin:"mainSearch"});return yield u.process(a)});return _Ks.apply(this,arguments)}function Js(_x97,_x98){return _Js.apply(this,arguments)}function _Js(){_Js=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:i}=e.extra,{description:o}=yield Gs().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:i}),s=new vt({...e,analyticsAction:Gs()}),u=yield Ov(t,o),c=yield s.fetchFromAPI(u,{origin:"mainSearch"});return yield s.process(c)});return _Js.apply(this,arguments)}function Dv(_x99,_x100,_x101){return _Dv.apply(this,arguments)}function _Dv(){_Dv=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:i,logger:o}=e.extra,{description:s}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:o}),u=new vt({...e,analyticsAction:t}),c=yield Tv(r,s),a=yield u.fetchFromAPI(c,{origin:"facetValues"});return yield u.process(a)});return _Dv.apply(this,arguments)}function Di(_x102,_x103,_x104){return _Di.apply(this,arguments)}function _Di(){_Di=_asyncToGenerator(function*(e,t,r){Zd(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:o}=t.extra,{description:s}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:o});s?.actionCause&&t.dispatch(Xs({actionCause:s.actionCause}));let u=yield St(e,s),c=new vt({...t,analyticsAction:r}),a=yield c.fetchFromAPI(u,{origin:"mainSearch"});return yield c.process(a)});return _Di.apply(this,arguments)}g();d();f();p();g();d();f();p();var At=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=Uv(e),i=qv(e),o=jv(e),s=e.configuration.analytics.analyticsMode==="legacy"?yield vr(e,r):Pi(e,t,r),u=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return pt({...s,...(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}),...(i.length&&{facets:i}),...(e.pagination&&{numberOfResults:u(),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 At(_x105,_x106,_x107){return _ref40.apply(this,arguments)}}();function qv(e){return Cs(Nv(e),e.facetOrder??[])}function jv(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Mv).filter(r=>r.currentValues.length>0):void 0}function Mv(e){let{field:t,label:r,values:n}=e,i=n.filter(o=>o.state==="selected");return{field:t,label:r,currentValues:i}}function Nv(e){return _v(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function _v(e){return[...Lv(e.facetSet??{}),...ep(e.numericFacetSet??{}),...ep(e.dateFacetSet??{}),...ft(e.categoryFacetSet??{})]}function Lv(e){return ft(e).map(t=>{let r=bs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ep(e){return ft(e).map(t=>{let r=t.currentValues,n=r.some(({state:o})=>o!=="idle"),i=r.some(o=>o.previousState);return t.generateAutomaticRanges&&!n&&!i?{...t,currentValues:[]}:t})}function Uv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(o=>o.isActive)?.expression.trim()||"",i=As(e);return[t,n,...i].filter(o=>!!o).join(" AND ")}var Ct=class{constructor(t,r=n=>{this.dispatch(Sr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x108,_x109){var _this12=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let i=Date.now(),o=li(yield _this12.extra.apiClient.search(r,n),t),s=Date.now()-i,u=_this12.getState().query?.q||"";return{response:o,duration:s,queryExecuted:u,requestExecuted:r}}).apply(this,arguments)}process(t){var _this13=this;return _asyncToGenerator(function*(){return _this13.processQueryErrorOrContinue(t)??(yield _this13.processQueryCorrectionsOrContinue(t))??(yield _this13.processQueryTriggersOrContinue(t))??_this13.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(yt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getState(),n=_this14.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:i,automaticallyCorrectQuery:o}=r.didYouMean,{results:s,queryCorrections:u,queryCorrection:c}=n;if(!i||!o)return null;let a=s.length===0&&u&&u.length!==0,h=!Y(c)&&!Y(c.correctedQuery);if(!a&&!h)return null;let S=a?yield _this14.processLegacyDidYouMeanAutoCorrection(t):_this14.processModernDidYouMeanAutoCorrection(t);return _this14.dispatch($e(Ke(_this14.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this15=this;return _asyncToGenerator(function*(){let r=_this15.getCurrentQuery(),n=_this15.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:i}=n.queryCorrections[0],o=yield _this15.automaticallyRetryQueryWithCorrection(i);return ke(o.response)?(_this15.dispatch(yt(o.response.error)),_this15.rejectWithValue(o.response.error)):(_this15.dispatch($e(Ke(_this15.getState()))),{...o,response:{...o.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:i}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:i}}processQueryTriggersOrContinue(t){var _this16=this;return _asyncToGenerator(function*(){let r=_this16.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(u=>u.type==="query")?.content||"";if(!n)return null;if(_this16.getState().triggers?.queryModification.queryToIgnore===n)return _this16.dispatch(Fi("")),null;let o=_this16.getCurrentQuery(),s=yield _this16.automaticallyRetryQueryWithTriggerModification(n);return ke(s.response)?(_this16.dispatch(yt(s.response.error)),_this16.rejectWithValue(s.response.error)):(_this16.dispatch($e(Ke(_this16.getState()))),{...s,response:{...s.response.success},automaticallyCorrected:!1,originalQuery:o})})()}processSuccessResponse(t){return this.dispatch($e(Ke(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Ai(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this17=this;return _asyncToGenerator(function*(){_this17.onUpdateQueryForCorrection(t);let r=_this17.getState(),{actionCause:n}=Bd(),i=yield _this17.fetchFromAPI(yield At(r,_this17.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this17.dispatch(Oi(t)),i})()}automaticallyRetryQueryWithTriggerModification(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.dispatch(Ti({newQuery:t,originalQuery:_this18.getCurrentQuery()})),_this18.onUpdateQueryForCorrection(t),yield _this18.fetchFromAPI(yield At(_this18.getState(),_this18.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 jH=oe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;z(e,{q:new W,enableQuerySyntax:new he,clearFilters:new he}),e.clearFilters&&(r(Md()),r(Nd())),r(_d({allow:!0})),r(Sr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Vd(1))}),Xs=Q("search/updateSearchAction"),tp=oe("search/executeSearch",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Di(r,t,e.legacy);ip(r);let n=e.next?op(e.next):void 0;t.dispatch(Xs(e.next));let i=yield At(r,t.extra.navigatorContext,n),o=new Ct({...t,analyticsAction:n??{}}),s=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(s)});return function(_x110,_x111){return _ref41.apply(this,arguments)}}()),rp=oe("search/fetchPage",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();if(ip(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Ks(r,t,e.legacy);let n=new Ct({...t,analyticsAction:e.next}),i=yield At(r,t.extra.navigatorContext,e.next),o=yield n.fetchFromAPI(i,{origin:"mainSearch"});return yield n.process(o)});return function(_x112,_x113){return _ref42.apply(this,arguments)}}()),np=oe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Js(t,r);let n=Du("browseResults",t.getState),i=new Ct({...t,analyticsAction:n}),o=yield Vv(r,t.extra.navigatorContext,n),s=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(s)});return function(_x114,_x115){return _ref43.apply(this,arguments)}}()),MH=oe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Di(r,t,e.legacy);let n=new Ct({...t,analyticsAction:{}}),i=yield Bv(r,t.extra.navigatorContext),o=yield n.fetchFromAPI(i,{origin:"facetValues"});return yield n.process(o)});return function(_x116,_x117){return _ref44.apply(this,arguments)}}()),NH=oe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ys(e,t);z(e,{id:ee,q:ee,maxResultsPerQuery:new Re({required:!0,min:1}),cacheTimeout:new Re});let{q:n,maxResultsPerQuery:i}=e,o=op(Ud()),s=yield Qv(r,t.extra.navigatorContext,n,i,o),u=new Ct({...t,analyticsAction:o},h=>{t.dispatch(Ii({q:h,id:e.id}))}),c=yield u.fetchFromAPI(s,{origin:"instantResults",disableAbortWarning:!0}),a=yield u.process(c);return"response"in a?{results:a.response.results,searchUid:a.response.searchUid,totalCountFiltered:a.response.totalCountFiltered,duration:a.duration}:a});return function(_x118,_x119){return _ref45.apply(this,arguments)}}()),Vv=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t,r){let n=yield At(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function Vv(_x120,_x121,_x122){return _ref46.apply(this,arguments)}}(),Qv=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r,n,i){let o=Pi(e,t,i);return pt({...o,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function Qv(_x123,_x124,_x125,_x126,_x127){return _ref47.apply(this,arguments)}}(),Bv=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=yield At(e,t,r);return n.request.numberOfResults=0,n});return function Bv(_x128,_x129,_x130){return _ref48.apply(this,arguments)}}(),ip=e=>{e.configuration.analytics.enabled&&lt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},op=e=>({actionCause:e.actionCause,type:e.actionCause});g();d();f();p();function Zs(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var ea=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:i}=Zs();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=i},ta=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),sp=fe(Zs(),e=>{e.addCase(nn.pending,t=>{t.isLoading=!0}).addCase(nn.fulfilled,(t,r)=>{let{content:n,uniqueId:i}=r.payload;t.position=t.resultsWithPreview.indexOf(i),t.content=n,t.uniqueId=i,t.isLoading=!1}).addCase(tp.fulfilled,(t,r)=>{ea(t),t.resultsWithPreview=ta(r.payload.response.results)}).addCase(np.fulfilled,(t,r)=>{ea(t),t.resultsWithPreview=t.resultsWithPreview.concat(ta(r.payload.response.results))}).addCase(rp.fulfilled,ea).addCase(Ri,(t,r)=>{t.resultsWithPreview=ta(r.payload.results)}).addCase(bi,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(wi,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(xi.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function ap(e,t,r,n,i){if(!$v(e))throw De;let{dispatch:o}=e,s=()=>e.state,u=Ye(e),{result:c,maximumPreviewSize:a}=t.options,h=()=>{let{resultsWithPreview:S,position:m}=s().resultPreview;return S[m]},y=S=>{o(xi({uniqueId:S,requestedOutputSize:a,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||o(nn({uniqueId:S,requestedOutputSize:a})),i&&i()};return{...u,fetchResultContent(){y(c.uniqueId)},next(){o(bi()),y(h())},previous(){o(wi()),y(h())},get state(){let S=s(),m=c.hasHtmlVersion,v=S.resultPreview,R=c.uniqueId===v.uniqueId?v.content:"",E=v.isLoading,b=v.contentURL,P=h();return{content:R,resultHasPreview:m,isLoading:E,contentURL:b,currentResultUniqueId:P}}}}function $v(e){return e.addReducers({configuration:Fe,resultPreview:sp}),!0}function cp(e,t){if(!Hv(e))throw De;let{dispatch:r}=e,n=()=>e.state,i=()=>n().documentSuggestion.documents,u=ap(e,t,Ci,"/html",()=>{e.dispatch(vi(t.options.result.uniqueId))});return r(Ri({results:i()})),{...u,get state(){return{...u.state,currentDocument:i().findIndex(c=>c.uniqueId===u.state.currentResultUniqueId)+1,totalDocuments:i().length}}}}function Hv(e){return e.addReducers({documentSuggestion:We}),!0}g();d();f();p();g();d();f();p();var ra=e=>z(e,{evt:ee,type:ge}),up=e=>be("analytics/generic/search",t=>{ra(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),lp=e=>be("analytics/generic/click",(t,r)=>(ss(e.result),ra(e),t.makeClickEvent(e.evt,is(e.result,r),os(e.result),e.meta))),dp=e=>be("analytics/generic/custom",t=>(ra(e),t.makeCustomEventWithType(e.evt,e.type,e.meta)));function zv(e){return e.addReducers({}),{logSearchEvent:up,logClickEvent:lp,logCustomEvent:dp}}g();d();f();p();function Gv(e){return e.addReducers({}),{logCaseStart:vd,logCaseNextStage:Ad,logCreateCase:Cd,logSolveCase:bd,logAbandonCase:wd,logUpdateCaseField:mr,logClassificationClick:Si,logDocumentSuggestionClick:xd,logDocumentSuggestionRating:Id,logQuickviewDocumentSuggestionClick:vi}}g();d();f();p();function Wv(e){return e.addReducers({caseField:mt}),{registerCaseField:hr,updateCaseField:yr,fetchCaseClassifications:Ge}}g();d();f();p();function Yv(e){return e.addReducers({caseInput:ht}),{updateCaseInput:Mt}}g();d();f();p();function Kv(e){return e.addReducers({documentSuggestion:We}),{fetchDocumentSuggestions:Me}}/**
35
35
  * @license
36
36
  *
37
37
  * Copyright 2025 Coveo Solutions Inc.
@@ -49,4 +49,4 @@ For more information, refer to the documentation: https://docs.coveo.com/en/o3r9
49
49
  * limitations under the License.
50
50
  */if(__exports!=exports)module.exports=exports;return module.exports});
51
51
 
52
- window.coveoQuanticVersion = '3.30.0-pre.7fbcdbbb29';
52
+ window.coveoQuanticVersion = '3.30.0-pre.8a67bd16aa';