@coveo/quantic 3.36.4 → 3.36.6

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 (34) hide show
  1. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +34 -9
  2. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/answer-agent-runner.d.ts +14 -0
  3. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/answer-agent.d.ts +9 -0
  4. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/head-answer-strategy.d.ts +6 -0
  5. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/endpoint-url-builder.d.ts +5 -0
  6. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/follow-up-agent/follow-up-agent.d.ts +9 -0
  7. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/follow-up-agent/follow-up-answer-strategy.d.ts +6 -0
  8. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/answer/answer-endpoint.d.ts +1 -69
  9. package/force-app/main/default/staticresources/coveoheadless/definitions/app/listener-middleware/generate-answer-listener-middleware.d.ts +8 -4
  10. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +3 -3
  11. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.d.ts +1 -2
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/facet-order/commerce-facet-order-slice.d.ts +4 -0
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/facet-search-set/category/commerce-category-facet-search-set-slice.d.ts +3 -0
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/facet-search-set/commerce-facet-search-reducer-helpers.d.ts +23 -0
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/facet-search-set/regular/commerce-specific-facet-search-set-slice.d.ts +3 -0
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-set/commerce-query-set-slice.d.ts +4 -0
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-suggest/commerce-query-suggest-slice.d.ts +3 -0
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-selectors.d.ts +9 -0
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-state.d.ts +4 -0
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-search-set/facet-search-reducer-helpers.d.ts +0 -21
  21. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-state.d.ts +8 -1
  22. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/date-facet-set/date-facet-set-state.d.ts +8 -1
  23. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/numeric-facet-set/numeric-facet-set-state.d.ts +8 -1
  24. package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +31 -0
  25. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +15 -0
  26. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +14 -0
  27. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/sse-generated-answer-errors.d.ts +14 -0
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-suggest/query-suggest-reducer-helpers.d.ts +7 -0
  29. package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-suggest/query-suggest-slice.d.ts +2 -3
  30. package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +1 -1
  31. package/force-app/main/default/staticresources/coveoheadless/headless.js +36 -11
  32. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +35 -10
  33. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +33 -8
  34. package/package.json +2 -2
@@ -14,21 +14,31 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var Mm=Object.create;var Zr=Object.defineProperty;var Nm=Object.getOwnPropertyDescriptor;var _m=Object.getOwnPropertyNames;var Vm=Object.getPrototypeOf,Um=Object.prototype.hasOwnProperty;var Lm=(e,t,r)=>t in e?Zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var en=(e,t)=>()=>(e&&(t=e(e=0)),t);var ve=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Oc=(e,t)=>{for(var r in t)Zr(e,r,{get:t[r],enumerable:!0})},Tc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _m(t))!Um.call(e,o)&&o!==r&&Zr(e,o,{get:()=>t[o],enumerable:!(n=Nm(t,o))||n.enumerable});return e};var $e=(e,t,r)=>(r=e!=null?Mm(Vm(e)):{},Tc(t||!e||!e.__esModule?Zr(r,"default",{value:e,enumerable:!0}):r,e)),Qm=e=>Tc(Zr({},"__esModule",{value:!0}),e);var ue=(e,t,r)=>Lm(e,typeof t!="symbol"?t+"":t,r);var A,c=en(()=>{"use strict";A=typeof globalThis<"u"?globalThis:window});function Yn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yn=function(t){return typeof t}:Yn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function Hm(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Gm.bind(this))}function Gm(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),Bm(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):$m(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var Bm,$m,u=en(()=>{"use strict";Bm=function(t){return typeof t=="string"},$m=function(t){return t instanceof Blob};Hm.call((typeof window>"u"?"undefined":Yn(window))==="object"?window:{})});var sa=ve(tn=>{"use strict";d();c();l();u();Object.defineProperty(tn,"__esModule",{value:!0});function Dc(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 zm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wm(e,t,r){return t=er(t),Ym(e,Nc()?Reflect.construct(t,r||[],er(e).constructor):t.apply(e,r))}function oa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qc(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,eg(n.key),n)}}function ia(e,t,r){return t&&qc(e.prototype,t),r&&qc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=tg(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,m=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){m=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(m)throw i}}}}function ra(){return ra=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Jm(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},ra.apply(null,arguments)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(e)}function Km(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&&na(e,t)}function Nc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nc=function(){return!!e})()}function Ym(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 zm(e)}function na(e,t){return na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},na(e,t)}function Jm(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=er(e))!==null;);return e}function Xm(e,t,r,n){var o=ra(er(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Zm(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 eg(e){var t=Zm(e,"string");return typeof t=="symbol"?t:t+""}function tg(e,t){if(e){if(typeof e=="string")return Dc(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)?Dc(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function rg(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 ng(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 Mc=function(){function e(){oa(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return ia(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var g=i[m];try{g.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},m=0,f=i.length;m<f;m++)a();return!r.defaultPrevented}}}])}(),aa=function(e){function t(){var r;return oa(this,t),r=Wm(this,t),r.listeners||Mc.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 Km(t,e),ia(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)),Xm(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Jn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new Jn;function i(){o.abort(this.reason),a()}function a(){var g=jc(n),h;try{for(g.s();!(h=g.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(y){g.e(y)}finally{g.f()}}var m=jc(n),f;try{for(m.s();!(f=m.n()).done;){var p=f.value;if(p.aborted){o.abort(p.reason);break}else p.addEventListener("abort",i)}}catch(g){m.e(g)}finally{m.f()}return o.signal}}])}(Mc),Jn=function(){function e(){oa(this,e),Object.defineProperty(this,"signal",{value:new aa,writable:!0,configurable:!0})}return ia(e,[{key:"abort",value:function(r){var n=ng(r),o=rg(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Jn.prototype[Symbol.toStringTag]="AbortController",aa.prototype[Symbol.toStringTag]="AbortSignal");function og(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 ig(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,m=a===void 0?!1:a;if(!og({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:m}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||m)&&(f=function(S,y){var v;y&&y.signal&&(v=y.signal,delete y.signal);var R=new o(S,y);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},f.prototype=o.prototype);var p=r,g=function(S,y){var v=f&&f.prototype.isPrototypeOf(S)?S.signal:y?y.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 I=new Promise(function(C,P){v.addEventListener("abort",function(){return P(R)},{once:!0})});return y&&y.signal&&delete y.signal,Promise.race([I,p(S,y)])}return p(S,y)};return{fetch:g,Request:f}}tn.AbortController=Jn;tn.AbortSignal=aa;tn.abortableFetch=ig});var _c,s,w,l=en(()=>{"use strict";_c=$e(sa(),1),s=$e(sa(),1),{fetch:w}=(0,_c.abortableFetch)({fetch})});function rn(e){if(gg.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function ca(e){return e.replace(yg,"")}function nn(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||!hg(r))return!1}return!0}function hg(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Uc(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 ag,Hc,sg,Gc,cg,ug,lg,dg,pg,fg,mg,gg,Vc,yg,tr,ua,Lc,Qc,Bc,$c,b,Wc=en(()=>{"use strict";d();c();l();u();ag=Object.create,Hc=Object.defineProperty,sg=Object.getOwnPropertyDescriptor,Gc=Object.getOwnPropertyNames,cg=Object.getPrototypeOf,ug=Object.prototype.hasOwnProperty,lg=(e,t)=>function(){return t||(0,e[Gc(e)[0]])((t={exports:{}}).exports,t),t.exports},dg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Gc(t))!ug.call(e,o)&&o!==r&&Hc(e,o,{get:()=>t[o],enumerable:!(n=sg(t,o))||n.enumerable});return e},pg=(e,t,r)=>(r=e!=null?ag(cg(e)):{},dg(t||!e||!e.__esModule?Hc(r,"default",{value:e,enumerable:!0}):r,e)),fg=lg({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,p){var g=f.split(";").filter(n),h=g.shift(),S=i(h),y=S.name,v=S.value;p=p?Object.assign({},r,p):r;try{v=p.decodeValues?decodeURIComponent(v):v}catch(I){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",I)}var R={name:y,value:v};return g.forEach(function(I){var C=I.split("="),P=C.shift().trimLeft().toLowerCase(),x=C.join("=");P==="expires"?R.expires=new Date(x):P==="max-age"?R.maxAge=parseInt(x,10):P==="secure"?R.secure=!0:P==="httponly"?R.httpOnly=!0:P==="samesite"?R.sameSite=x:R[P]=x}),R}function i(f){var p="",g="",h=f.split("=");return h.length>1?(p=h.shift(),g=h.join("=")):g=f,{name:p,value:g}}function a(f,p){if(p=p?Object.assign({},r,p):r,!f)return p.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!p.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),p=p?Object.assign({},r,p):r,p.map){var h={};return f.filter(n).reduce(function(S,y){var v=o(y,p);return S[v.name]=v,S},h)}else return f.filter(n).map(function(S){return o(S,p)})}function m(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var p=[],g=0,h,S,y,v,R;function I(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function C(){return S=f.charAt(g),S!=="="&&S!==";"&&S!==","}for(;g<f.length;){for(h=g,R=!1;I();)if(S=f.charAt(g),S===","){for(y=g,g+=1,I(),v=g;g<f.length&&C();)g+=1;g<f.length&&f.charAt(g)==="="?(R=!0,g=v,p.push(f.substring(h,y)),h=g):g=y+1}else g+=1;(!R||g>=f.length)&&p.push(f.substring(h,f.length))}return p}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=m}}),mg=pg(fg()),gg=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Vc=[`
19
- `,"\r","\t"," "],yg=new RegExp(`(^[${Vc.join("")}]|$[${Vc.join("")}])`,"g");tr=Symbol("normalizedHeaders"),ua=Symbol("rawHeaderNames"),Lc=", ",b=class zc{constructor(t){this[Qc]={},this[Bc]=new Map,this[$c]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof zc||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(Lc):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Lc):n)})}[(Qc=tr,Bc=ua,$c=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[tr]).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(!nn(t))throw new TypeError(`Invalid header name "${t}"`);return this[tr].hasOwnProperty(rn(t))}get(t){if(!nn(t))throw TypeError(`Invalid header name "${t}"`);return this[tr][rn(t)]??null}set(t,r){if(!nn(t)||!Uc(r))return;let n=rn(t),o=ca(r);this[tr][n]=ca(o),this[ua].set(n,t)}append(t,r){if(!nn(t)||!Uc(r))return;let n=rn(t),o=ca(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!nn(t)||!this.has(t))return;let r=rn(t);delete this[tr][r],this[ua].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,mg.splitCookiesString)(t)}}});var d=en(()=>{"use strict";Wc()});var ru=ve(sn=>{"use strict";d();c();l();u();var to=sn&&sn.__assign||function(){return to=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},to.apply(this,arguments)};Object.defineProperty(sn,"__esModule",{value:!0});var Eg={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Ig(e){var t=to(to({},Eg),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}sn.getSanitizedOptions=Ig});var nu=ve(fa=>{"use strict";d();c();l();u();Object.defineProperty(fa,"__esModule",{value:!0});function Fg(e){var t=Math.random()*e;return Math.round(t)}fa.fullJitter=Fg});var ou=ve(ma=>{"use strict";d();c();l();u();Object.defineProperty(ma,"__esModule",{value:!0});function Pg(e){return e}ma.noJitter=Pg});var iu=ve(ga=>{"use strict";d();c();l();u();Object.defineProperty(ga,"__esModule",{value:!0});var kg=nu(),Og=ou();function Tg(e){switch(e.jitter){case"full":return kg.fullJitter;case"none":default:return Og.noJitter}}ga.JitterFactory=Tg});var ha=ve(ya=>{"use strict";d();c();l();u();Object.defineProperty(ya,"__esModule",{value:!0});var Dg=iu(),qg=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=Dg.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();ya.Delay=qg});var au=ve(tt=>{"use strict";d();c();l();u();var jg=tt&&tt.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mg=tt&&tt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{p(n.next(g))}catch(h){a(h)}}function f(g){try{p(n.throw(g))}catch(h){a(h)}}function p(g){g.done?i(g.value):o(g.value).then(m,f)}p((n=n.apply(e,t||[])).next())})},Ng=tt&&tt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(p){return function(g){return f([p,g])}}function f(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(g){p=[6,g],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(tt,"__esModule",{value:!0});var _g=ha(),Vg=function(e){jg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return Mg(this,void 0,void 0,function(){return Ng(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}(_g.Delay);tt.SkipFirstDelay=Vg});var su=ve(cn=>{"use strict";d();c();l();u();var Ug=cn&&cn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(cn,"__esModule",{value:!0});var Lg=ha(),Qg=function(e){Ug(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Lg.Delay);cn.AlwaysDelay=Qg});var cu=ve(Sa=>{"use strict";d();c();l();u();Object.defineProperty(Sa,"__esModule",{value:!0});var Bg=au(),$g=su();function Hg(e,t){var r=Gg(e);return r.setAttemptNumber(t),r}Sa.DelayFactory=Hg;function Gg(e){return e.delayFirstAttempt?new $g.AlwaysDelay(e):new Bg.SkipFirstDelay(e)}});var uu=ve(qt=>{"use strict";d();c();l();u();var va=qt&&qt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{p(n.next(g))}catch(h){a(h)}}function f(g){try{p(n.throw(g))}catch(h){a(h)}}function p(g){g.done?i(g.value):o(g.value).then(m,f)}p((n=n.apply(e,t||[])).next())})},Aa=qt&&qt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(p){return function(g){return f([p,g])}}function f(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(g){p=[6,g],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(qt,"__esModule",{value:!0});var zg=ru(),Wg=cu();function Kg(e,t){return t===void 0&&(t={}),va(this,void 0,void 0,function(){var r,n;return Aa(this,function(o){switch(o.label){case 0:return r=zg.getSanitizedOptions(t),n=new Yg(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}qt.backOff=Kg;var Yg=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return va(this,void 0,void 0,function(){var t,r;return Aa(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 va(this,void 0,void 0,function(){var t;return Aa(this,function(r){switch(r.label){case 0:return t=Wg.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var hi=ve((Bs,$s)=>{"use strict";d();c();l();u();(function(e,t){typeof Bs=="object"&&typeof $s<"u"?$s.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs=t()})(Bs,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",m="day",f="week",p="month",g="quarter",h="year",S="date",y="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,I={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(Q){var U=["th","st","nd","rd"],V=Q%100;return"["+Q+(U[(V-20)%10]||U[V]||U[0])+"]"}},C=function(Q,U,V){var B=String(Q);return!B||B.length>=U?Q:""+Array(U+1-B.length).join(V)+Q},P={s:C,z:function(Q){var U=-Q.utcOffset(),V=Math.abs(U),B=Math.floor(V/60),L=V%60;return(U<=0?"+":"-")+C(B,2,"0")+":"+C(L,2,"0")},m:function Q(U,V){if(U.date()<V.date())return-Q(V,U);var B=12*(V.year()-U.year())+(V.month()-U.month()),L=U.clone().add(B,p),G=V-L<0,z=U.clone().add(B+(G?-1:1),p);return+(-(B+(V-L)/(G?L-z:z-L))||0)},a:function(Q){return Q<0?Math.ceil(Q)||0:Math.floor(Q)},p:function(Q){return{M:p,y:h,w:f,d:m,D:S,h:a,m:i,s:o,ms:n,Q:g}[Q]||String(Q||"").toLowerCase().replace(/s$/,"")},u:function(Q){return Q===void 0}},x="en",E={};E[x]=I;var M="$isDayjsObject",T=function(Q){return Q instanceof _||!(!Q||!Q[M])},F=function Q(U,V,B){var L;if(!U)return x;if(typeof U=="string"){var G=U.toLowerCase();E[G]&&(L=G),V&&(E[G]=V,L=G);var z=U.split("-");if(!L&&z.length>1)return Q(z[0])}else{var Y=U.name;E[Y]=U,L=Y}return!B&&L&&(x=L),L||!B&&x},k=function(Q,U){if(T(Q))return Q.clone();var V=typeof U=="object"?U:{};return V.date=Q,V.args=arguments,new _(V)},D=P;D.l=F,D.i=T,D.w=function(Q,U){return k(Q,{locale:U.$L,utc:U.$u,x:U.$x,$offset:U.$offset})};var _=function(){function Q(V){this.$L=F(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[M]=!0}var U=Q.prototype;return U.parse=function(V){this.$d=function(B){var L=B.date,G=B.utc;if(L===null)return new Date(NaN);if(D.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var z=L.match(v);if(z){var Y=z[2]-1||0,re=(z[7]||"0").substring(0,3);return G?new Date(Date.UTC(z[1],Y,z[3]||1,z[4]||0,z[5]||0,z[6]||0,re)):new Date(z[1],Y,z[3]||1,z[4]||0,z[5]||0,z[6]||0,re)}}return new Date(L)}(V),this.init()},U.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},U.$utils=function(){return D},U.isValid=function(){return this.$d.toString()!==y},U.isSame=function(V,B){var L=k(V);return this.startOf(B)<=L&&L<=this.endOf(B)},U.isAfter=function(V,B){return k(V)<this.startOf(B)},U.isBefore=function(V,B){return this.endOf(B)<k(V)},U.$g=function(V,B,L){return D.u(V)?this[B]:this.set(L,V)},U.unix=function(){return Math.floor(this.valueOf()/1e3)},U.valueOf=function(){return this.$d.getTime()},U.startOf=function(V,B){var L=this,G=!!D.u(B)||B,z=D.p(V),Y=function(le,fe){var he=D.w(L.$u?Date.UTC(L.$y,fe,le):new Date(L.$y,fe,le),L);return G?he:he.endOf(m)},re=function(le,fe){return D.w(L.toDate()[le].apply(L.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(fe)),L)},se=this.$W,te=this.$M,ne=this.$D,Z="set"+(this.$u?"UTC":"");switch(z){case h:return G?Y(1,0):Y(31,11);case p:return G?Y(1,te):Y(0,te+1);case f:var ie=this.$locale().weekStart||0,ge=(se<ie?se+7:se)-ie;return Y(G?ne-ge:ne+(6-ge),te);case m:case S:return re(Z+"Hours",0);case a:return re(Z+"Minutes",1);case i:return re(Z+"Seconds",2);case o:return re(Z+"Milliseconds",3);default:return this.clone()}},U.endOf=function(V){return this.startOf(V,!1)},U.$set=function(V,B){var L,G=D.p(V),z="set"+(this.$u?"UTC":""),Y=(L={},L[m]=z+"Date",L[S]=z+"Date",L[p]=z+"Month",L[h]=z+"FullYear",L[a]=z+"Hours",L[i]=z+"Minutes",L[o]=z+"Seconds",L[n]=z+"Milliseconds",L)[G],re=G===m?this.$D+(B-this.$W):B;if(G===p||G===h){var se=this.clone().set(S,1);se.$d[Y](re),se.init(),this.$d=se.set(S,Math.min(this.$D,se.daysInMonth())).$d}else Y&&this.$d[Y](re);return this.init(),this},U.set=function(V,B){return this.clone().$set(V,B)},U.get=function(V){return this[D.p(V)]()},U.add=function(V,B){var L,G=this;V=Number(V);var z=D.p(B),Y=function(te){var ne=k(G);return D.w(ne.date(ne.date()+Math.round(te*V)),G)};if(z===p)return this.set(p,this.$M+V);if(z===h)return this.set(h,this.$y+V);if(z===m)return Y(1);if(z===f)return Y(7);var re=(L={},L[i]=t,L[a]=r,L[o]=e,L)[z]||1,se=this.$d.getTime()+V*re;return D.w(se,this)},U.subtract=function(V,B){return this.add(-1*V,B)},U.format=function(V){var B=this,L=this.$locale();if(!this.isValid())return L.invalidDate||y;var G=V||"YYYY-MM-DDTHH:mm:ssZ",z=D.z(this),Y=this.$H,re=this.$m,se=this.$M,te=L.weekdays,ne=L.months,Z=L.meridiem,ie=function(fe,he,Oe,Ve){return fe&&(fe[he]||fe(B,G))||Oe[he].slice(0,Ve)},ge=function(fe){return D.s(Y%12||12,fe,"0")},le=Z||function(fe,he,Oe){var Ve=fe<12?"AM":"PM";return Oe?Ve.toLowerCase():Ve};return G.replace(R,function(fe,he){return he||function(Oe){switch(Oe){case"YY":return String(B.$y).slice(-2);case"YYYY":return D.s(B.$y,4,"0");case"M":return se+1;case"MM":return D.s(se+1,2,"0");case"MMM":return ie(L.monthsShort,se,ne,3);case"MMMM":return ie(ne,se);case"D":return B.$D;case"DD":return D.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return ie(L.weekdaysMin,B.$W,te,2);case"ddd":return ie(L.weekdaysShort,B.$W,te,3);case"dddd":return te[B.$W];case"H":return String(Y);case"HH":return D.s(Y,2,"0");case"h":return ge(1);case"hh":return ge(2);case"a":return le(Y,re,!0);case"A":return le(Y,re,!1);case"m":return String(re);case"mm":return D.s(re,2,"0");case"s":return String(B.$s);case"ss":return D.s(B.$s,2,"0");case"SSS":return D.s(B.$ms,3,"0");case"Z":return z}return null}(fe)||z.replace(":","")})},U.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},U.diff=function(V,B,L){var G,z=this,Y=D.p(B),re=k(V),se=(re.utcOffset()-this.utcOffset())*t,te=this-re,ne=function(){return D.m(z,re)};switch(Y){case h:G=ne()/12;break;case p:G=ne();break;case g:G=ne()/3;break;case f:G=(te-se)/6048e5;break;case m:G=(te-se)/864e5;break;case a:G=te/r;break;case i:G=te/t;break;case o:G=te/e;break;default:G=te}return L?G:D.a(G)},U.daysInMonth=function(){return this.endOf(p).$D},U.$locale=function(){return E[this.$L]},U.locale=function(V,B){if(!V)return this.$L;var L=this.clone(),G=F(V,B,!0);return G&&(L.$L=G),L},U.clone=function(){return D.w(this.$d,this)},U.toDate=function(){return new Date(this.valueOf())},U.toJSON=function(){return this.isValid()?this.toISOString():null},U.toISOString=function(){return this.$d.toISOString()},U.toString=function(){return this.$d.toUTCString()},Q}(),H=_.prototype;return k.prototype=H,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",m],["$M",p],["$y",h],["$D",S]].forEach(function(Q){H[Q[1]]=function(U){return this.$g(U,Q[0],Q[1])}}),k.extend=function(Q,U){return Q.$i||(Q(U,_,k),Q.$i=!0),k},k.locale=F,k.isDayjs=T,k.unix=function(Q){return k(1e3*Q)},k.en=E[x],k.Ls=E,k.p={},k})});var bp=ve((Hs,Gs)=>{"use strict";d();c();l();u();(function(e,t){typeof Hs=="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()})(Hs,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var i=o.add;o.add=function(m,f){return m=Number(m),this.$utils().p(f)===t?this.add(3*m,e):i.bind(this)(m,f)};var a=o.startOf;o.startOf=function(m,f){var p=this.$utils(),g=!!p.u(f)||f;if(p.p(m)===t){var h=this.quarter()-1;return g?this.month(3*h).startOf(e).startOf("day"):this.month(3*h+2).endOf(e).endOf("day")}return a.bind(this)(m,f)}}})});var Cp=ve((zs,Ws)=>{"use strict";d();c();l();u();(function(e,t){typeof zs=="object"&&typeof Ws<"u"?Ws.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_customParseFormat=t()})(zs,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},m=function(v){return(v=+v)+(v>68?1900:2e3)},f=function(v){return function(R){this[v]=+R}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var I=R.match(/([+-]|\d\d)/g),C=60*I[1]+(+I[2]||0);return C===0?0:I[0]==="+"?-C:C}(v)}],g=function(v){var R=a[v];return R&&(R.indexOf?R:R.s.concat(R.f))},h=function(v,R){var I,C=a.meridiem;if(C){for(var P=1;P<=24;P+=1)if(v.indexOf(C(P,0,R))>-1){I=P>12;break}}else I=v===(R?"pm":"PM");return I},S={A:[i,function(v){this.afternoon=h(v,!1)}],a:[i,function(v){this.afternoon=h(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[n,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[i,function(v){var R=a.ordinal,I=v.match(/\d+/);if(this.day=I[0],R)for(var C=1;C<=31;C+=1)R(C).replace(/\[|\]/g,"")===v&&(this.day=C)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[i,function(v){var R=g("months"),I=(g("monthsShort")||R.map(function(C){return C.slice(0,3)})).indexOf(v)+1;if(I<1)throw new Error;this.month=I%12||I}],MMMM:[i,function(v){var R=g("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(v){this.year=m(v)}],YYYY:[/\d{4}/,f("year")],Z:p,ZZ:p};function y(v){var R,I;R=v,I=a&&a.formats;for(var C=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(k,D,_){var H=_&&_.toUpperCase();return D||I[_]||e[_]||I[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Q,U,V){return U||V.slice(1)})})).match(t),P=C.length,x=0;x<P;x+=1){var E=C[x],M=S[E],T=M&&M[0],F=M&&M[1];C[x]=F?{regex:T,parser:F}:E.replace(/^\[|\]$/g,"")}return function(k){for(var D={},_=0,H=0;_<P;_+=1){var Q=C[_];if(typeof Q=="string")H+=Q.length;else{var U=Q.regex,V=Q.parser,B=k.slice(H),L=U.exec(B)[0];V.call(D,L),k=k.replace(L,"")}}return function(G){var z=G.afternoon;if(z!==void 0){var Y=G.hours;z?Y<12&&(G.hours+=12):Y===12&&(G.hours=0),delete G.afternoon}}(D),D}}return function(v,R,I){I.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(m=v.parseTwoDigitYear);var C=R.prototype,P=C.parse;C.parse=function(x){var E=x.date,M=x.utc,T=x.args;this.$u=M;var F=T[1];if(typeof F=="string"){var k=T[2]===!0,D=T[3]===!0,_=k||D,H=T[2];D&&(H=T[2]),a=this.$locale(),!k&&H&&(a=I.Ls[H]),this.$d=function(B,L,G,z){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*B);var Y=y(L)(B),re=Y.year,se=Y.month,te=Y.day,ne=Y.hours,Z=Y.minutes,ie=Y.seconds,ge=Y.milliseconds,le=Y.zone,fe=Y.week,he=new Date,Oe=te||(re||se?1:he.getDate()),Ve=re||he.getFullYear(),dt=0;re&&!se||(dt=se>0?se-1:he.getMonth());var Xt,Zt=ne||0,Xr=Z||0,ea=ie||0,ta=ge||0;return le?new Date(Date.UTC(Ve,dt,Oe,Zt,Xr,ea,ta+60*le.offset*1e3)):G?new Date(Date.UTC(Ve,dt,Oe,Zt,Xr,ea,ta)):(Xt=new Date(Ve,dt,Oe,Zt,Xr,ea,ta),fe&&(Xt=z(Xt).week(fe).toDate()),Xt)}catch{return new Date("")}}(E,F,M,I),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),_&&E!=this.format(F)&&(this.$d=new Date("")),a={}}else if(F instanceof Array)for(var Q=F.length,U=1;U<=Q;U+=1){T[1]=F[U-1];var V=I.apply(this,T);if(V.isValid()){this.$d=V.$d,this.$L=V.$L,this.init();break}U===Q&&(this.$d=new Date(""))}else P.call(this,x)}}})});var sf=ve((sc,cc)=>{"use strict";d();c();l();u();(function(e,t){typeof sc=="object"&&typeof cc<"u"?cc.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_timezone=t()})(sc,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(g,h,S){S===void 0&&(S={});var y=new Date(g),v=function(R,I){I===void 0&&(I={});var C=I.timeZoneName||"short",P=R+"|"+C,x=t[P];return x||(x=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:C}),t[P]=x),x}(h,S);return v.formatToParts(y)},m=function(g,h){for(var S=a(g,h),y=[],v=0;v<S.length;v+=1){var R=S[v],I=R.type,C=R.value,P=e[I];P>=0&&(y[P]=parseInt(C,10))}var x=y[3],E=x===24?0:x,M=y[0]+"-"+y[1]+"-"+y[2]+" "+E+":"+y[4]+":"+y[5]+":000",T=+g;return(o.utc(M).valueOf()-(T-=T%1e3))/6e4},f=n.prototype;f.tz=function(g,h){g===void 0&&(g=i);var S,y=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:g}),I=Math.round((v-new Date(R))/1e3/60),C=15*-Math.round(v.getTimezoneOffset()/15)-I;if(!Number(C))S=this.utcOffset(0,h);else if(S=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(C,!0),h){var P=S.utcOffset();S=S.add(y-P,"minute")}return S.$x.$timezone=g,S},f.offsetName=function(g){var h=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),h,{timeZoneName:g}).find(function(y){return y.type.toLowerCase()==="timezonename"});return S&&S.value};var p=f.startOf;f.startOf=function(g,h){if(!this.$x||!this.$x.$timezone)return p.call(this,g,h);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(S,g,h).tz(this.$x.$timezone,!0)},o.tz=function(g,h,S){var y=S&&h,v=S||h||i,R=m(+o(),v);if(typeof g!="string")return o(g).tz(v);var I=function(E,M,T){var F=E-60*M*1e3,k=m(F,T);if(M===k)return[F,M];var D=m(F-=60*(k-M)*1e3,T);return k===D?[F,k]:[E-60*Math.min(k,D)*1e3,Math.max(k,D)]}(o.utc(g,y).valueOf(),R,v),C=I[0],P=I[1],x=o(C).utcOffset(P);return x.$x.$timezone=v,x},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){i=g}}})});var cf=ve((uc,lc)=>{"use strict";d();c();l();u();(function(e,t){typeof uc=="object"&&typeof lc<"u"?lc.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof A<"u"?A:e||self).dayjs_plugin_utc=t()})(uc,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(y){var v={date:y,utc:!0,args:arguments};return new o(v)},a.utc=function(y){var v=i(this.toDate(),{locale:this.$L,utc:!0});return y?v.add(this.utcOffset(),e):v},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var m=a.parse;a.parse=function(y){y.utc&&(this.$u=!0),this.$utils().u(y.$offset)||(this.$offset=y.$offset),m.call(this,y)};var f=a.init;a.init=function(){if(this.$u){var y=this.$d;this.$y=y.getUTCFullYear(),this.$M=y.getUTCMonth(),this.$D=y.getUTCDate(),this.$W=y.getUTCDay(),this.$H=y.getUTCHours(),this.$m=y.getUTCMinutes(),this.$s=y.getUTCSeconds(),this.$ms=y.getUTCMilliseconds()}else f.call(this)};var p=a.utcOffset;a.utcOffset=function(y,v){var R=this.$utils().u;if(R(y))return this.$u?0:R(this.$offset)?p.call(this):this.$offset;if(typeof y=="string"&&(y=function(x){x===void 0&&(x="");var E=x.match(t);if(!E)return null;var M=(""+E[0]).match(r)||["-",0,0],T=M[0],F=60*+M[1]+ +M[2];return F===0?0:T==="+"?F:-F}(y),y===null))return this;var I=Math.abs(y)<=16?60*y:y,C=this;if(v)return C.$offset=I,C.$u=y===0,C;if(y!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(C=this.local().add(I+P,e)).$offset=I,C.$x.$localOffset=P}else C=this.utc();return C};var g=a.format;a.format=function(y){var v=y||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,v)},a.valueOf=function(){var y=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*y},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(y){return y==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var S=a.diff;a.diff=function(y,v,R){if(y&&this.$u===y.$u)return S.call(this,y,v,R);var I=this.local(),C=i(y).local();return S.call(I,C,v,R)}}})});var _f=ve((Xz,Nf)=>{"use strict";d();c();l();u();function Dw(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Nf.exports=qw;function qw(e,t,r){var n=r&&r.stringify||Dw,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var m=1;m<i;m++)a[m]=n(t[m]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var p="",g=1-o,h=-1,S=e&&e.length||0,y=0;y<S;){if(e.charCodeAt(y)===37&&y+1<S){switch(h=h>-1?h:0,e.charCodeAt(y+1)){case 100:case 102:if(g>=f||t[g]==null)break;h<y&&(p+=e.slice(h,y)),p+=Number(t[g]),h=y+2,y++;break;case 105:if(g>=f||t[g]==null)break;h<y&&(p+=e.slice(h,y)),p+=Math.floor(Number(t[g])),h=y+2,y++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;h<y&&(p+=e.slice(h,y));var v=typeof t[g];if(v==="string"){p+="'"+t[g]+"'",h=y+2,y++;break}if(v==="function"){p+=t[g].name||"<anonymous>",h=y+2,y++;break}p+=n(t[g]),h=y+2,y++;break;case 115:if(g>=f)break;h<y&&(p+=e.slice(h,y)),p+=String(t[g]),h=y+2,y++;break;case 37:h<y&&(p+=e.slice(h,y)),p+="%",h=y+2,y++,g--;break}++g}++y}return h===-1?e:(h<S&&(p+=e.slice(h)),p)}});var $f=ve((n2,Li)=>{"use strict";d();c();l();u();var Vf=_f();Li.exports=lt;var Hn=Kw().console||{},jw={mapHttpRequest:Ui,mapHttpResponse:Ui,wrapRequestSerializer:Ac,wrapResponseSerializer:Ac,wrapErrorSerializer:Ac,req:Ui,res:Ui,err:Lf,errWithCause:Lf};function Ot(e,t){return e==="silent"?1/0:t.levels.values[e]}var Cc=Symbol("pino.logFuncs"),wc=Symbol("pino.hierarchy"),Mw={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Uf(e,t){let r={logger:t,parent:e[wc]};t[wc]=r}function Nw(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Hn[o]||Hn[Mw[o]||"log"]||Gr}),e[Cc]=n}function _w(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function lt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Hn;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=_w(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&m.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",p=Object.create(r);p.log||(p.log=Gr),Nw(p,m,r),Uf({},p),Object.defineProperty(p,"levelVal",{get:h}),Object.defineProperty(p,"level",{get:S,set:y});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:m,timestamp:Gw(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Gr};p.levels=Vw(e),p.level=f,p.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=Gr,p.serializers=n,p._serialize=o,p._stdErrSerialize=i,p.child=function(...R){return v.call(this,g,...R)},t&&(p._logEvent=bc());function h(){return Ot(this.level,this)}function S(){return this._level}function y(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Wt(this,g,p,"error"),Wt(this,g,p,"fatal"),Wt(this,g,p,"warn"),Wt(this,g,p,"info"),Wt(this,g,p,"debug"),Wt(this,g,p,"trace"),a.forEach(I=>{Wt(this,g,p,I)})}function v(R,I,C){if(!I)throw new Error("missing bindings for child Pino");C=C||{},o&&I.serializers&&(C.serializers=I.serializers);let P=C.serializers;if(o&&P){var x=Object.assign({},n,P),E=e.browser.serialize===!0?Object.keys(x):o;delete I.serializers,xc([I],E,x,this._stdErrSerialize)}function M(F){this._childLevel=(F._childLevel|0)+1,this.bindings=I,x&&(this.serializers=x,this._serialize=E),t&&(this._logEvent=bc([].concat(F._logEvent.bindings,I)))}M.prototype=this;let T=new M(this);return Uf(this,T),T.child=function(...F){return v.call(this,R,...F)},T.level=C.level||this.level,R.onChild(T),T}return p}function Vw(e){let t=e.customLevels||{},r=Object.assign({},lt.levels.values,t),n=Object.assign({},lt.levels.labels,Uw(t));return{values:r,labels:n}}function Uw(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}lt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};lt.stdSerializers=jw;lt.stdTimeFunctions=Object.assign({},{nullTime:Qf,epochTime:Bf,unixTime:zw,isoTime:Ww});function Lw(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[wc];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Wt(e,t,r,n){if(Object.defineProperty(e,n,{value:Ot(e.level,r)>Ot(n,r)?Gr:r[Cc][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Gr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Ot(i,r);if(Ot(n,r)<a)return}e[n]=Bw(e,t,r,n);let o=Lw(e);o.length!==0&&(e[n]=Qw(o,e[n]))}function Qw(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Bw(e,t,r,n){return function(o){return function(){let a=t.timestamp(),m=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Hn?Hn:this;for(var p=0;p<m.length;p++)m[p]=arguments[p];var g=!1;if(t.serialize&&(xc(m,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...$w(this,n,m,a,t)):o.apply(f,m),t.transmit){let h=t.transmit.level||e._level,S=Ot(h,r),y=Ot(n,r);if(y<S)return;Hw(this,{ts:a,methodLevel:n,methodValue:y,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Ot(e._level,r)},m,g)}}}(e[Cc][n])}function $w(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},m=r.slice(),f=m[0],p={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(p.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(p,h)}else p.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof m[0]=="object";)Object.assign(p,m.shift());return[a(p),...m]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof m[0]=="object";)Object.assign(p,m.shift());f=m.length?Vf(m.shift(),m):void 0}else typeof f=="string"&&(f=Vf(m.shift(),m));return f!==void 0&&(p[o.messageKey]=f),[a(p)]}}function xc(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=lt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function Hw(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,m=t.methodValue,f=t.val,p=e._logEvent.bindings;n||xc(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(g){return p.indexOf(g)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=m,o(a,e._logEvent,f),e._logEvent=bc(p)}function bc(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Lf(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 Gw(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Qf:Bf}function Ui(){return{}}function Ac(e){return e}function Gr(){}function Qf(){return!1}function Bf(){return Date.now()}function zw(){return Math.round(Date.now()/1e3)}function Ww(){return new Date(Date.now()).toISOString()}function Kw(){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)||{}}}Li.exports.default=lt;Li.exports.pino=lt});var Kb={};Oc(Kb,{DefaultFieldsToInclude:()=>kc,EcommerceDefaultFieldsToInclude:()=>Tm,HighlightUtils:()=>pa,MinimumFieldsToInclude:()=>Xi,ResultTemplatesHelpers:()=>Qp,buildContext:()=>em,buildController:()=>Tt,buildDictionaryFieldContext:()=>tm,buildInteractiveResult:()=>Fm,buildRecommendationEngine:()=>Jf,buildRecommendationList:()=>Em,buildResultTemplatesManager:()=>jm,getAnalyticsNextApiBaseUrl:()=>ro,getOrganizationEndpoint:()=>Se,getSampleRecommendationEngineConfiguration:()=>Rc,loadAdvancedSearchQueryActions:()=>qb,loadClickAnalyticsActions:()=>Hb,loadConfigurationActions:()=>jb,loadContextActions:()=>Nb,loadDebugActions:()=>_b,loadDictionaryFieldContextActions:()=>Vb,loadFieldActions:()=>Qb,loadPaginationActions:()=>Pc,loadPipelineActions:()=>Bb,loadRecommendationActions:()=>$b,loadSearchConfigurationActions:()=>Mb,loadSearchHubActions:()=>Wb});module.exports=Qm(Kb);d();c();l();u();var pa={};Oc(pa,{escapeHtml:()=>rr,getHighlightedSuggestion:()=>Rg,highlightString:()=>xg});d();c();l();u();d();c();l();u();function Sg(e,t){let r=`
17
+ */(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var Rw=Object.create;var ti=Object.defineProperty;var Iw=Object.getOwnPropertyDescriptor;var Tw=Object.getOwnPropertyNames;var _w=Object.getPrototypeOf,kw=Object.prototype.hasOwnProperty;var Ow=(e,t,r)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ri=(e,t)=>()=>(e&&(t=e(e=0)),t);var ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ni=(e,t)=>{for(var r in t)ti(e,r,{get:t[r],enumerable:!0})},Mp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tw(t))!kw.call(e,o)&&o!==r&&ti(e,o,{get:()=>t[o],enumerable:!(n=Iw(t,o))||n.enumerable});return e};var _t=(e,t,r)=>(r=e!=null?Rw(_w(e)):{},Mp(t||!e||!e.__esModule?ti(r,"default",{value:e,enumerable:!0}):r,e)),Pw=e=>Mp(ti({},"__esModule",{value:!0}),e);var xe=(e,t,r)=>Ow(e,typeof t!="symbol"?t+"":t,r);var w,d=ri(()=>{"use strict";w=typeof globalThis<"u"?globalThis:window});function sa(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sa=function(t){return typeof t}:sa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sa(e)}function Dw(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Mw.bind(this))}function Mw(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),Nw(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):Fw(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var Nw,Fw,p=ri(()=>{"use strict";Nw=function(t){return typeof t=="string"},Fw=function(t){return t instanceof Blob};Dw.call((typeof window>"u"?"undefined":sa(window))==="object"?window:{})});var _u=ze(oi=>{"use strict";m();d();f();p();Object.defineProperty(oi,"__esModule",{value:!0});function jp(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 jw(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qw(e,t,r){return t=qn(t),Uw(e,Vp()?Reflect.construct(t,r||[],qn(e).constructor):t.apply(e,r))}function Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qp(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,$w(n.key),n)}}function Iu(e,t,r){return t&&qp(e.prototype,t),r&&qp(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Qw(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return a=c.done,c},e:function(c){s=!0,i=c},f:function(){try{a||r.return==null||r.return()}finally{if(s)throw i}}}}function Cu(){return Cu=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Vw(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Cu.apply(null,arguments)}function qn(e){return qn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qn(e)}function Lw(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&&Eu(e,t)}function Vp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vp=function(){return!!e})()}function Uw(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 jw(e)}function Eu(e,t){return Eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Eu(e,t)}function Vw(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=qn(e))!==null;);return e}function Gw(e,t,r,n){var o=Cu(qn(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Bw(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 $w(e){var t=Bw(e,"string");return typeof t=="symbol"?t:t+""}function Qw(e,t){if(e){if(typeof e=="string")return jp(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)?jp(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Hw(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 zw(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 Up=function(){function e(){Ru(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Iu(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[s];try{h.callback.call(n,r)}catch(v){Promise.resolve().then(function(){throw v})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},s=0,c=i.length;s<c;s++)a();return!r.defaultPrevented}}}])}(),Tu=function(e){function t(){var r;return Ru(this,t),r=qw(this,t),r.listeners||Up.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 Lw(t,e),Iu(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)),Gw(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new ca;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new ca;function i(){o.abort(this.reason),a()}function a(){var h=Lp(n),v;try{for(h.s();!(v=h.n()).done;){var S=v.value;S.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var s=Lp(n),c;try{for(s.s();!(c=s.n()).done;){var u=c.value;if(u.aborted){o.abort(u.reason);break}else u.addEventListener("abort",i)}}catch(h){s.e(h)}finally{s.f()}return o.signal}}])}(Up),ca=function(){function e(){Ru(this,e),Object.defineProperty(this,"signal",{value:new Tu,writable:!0,configurable:!0})}return Iu(e,[{key:"abort",value:function(r){var n=zw(r),o=Hw(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(ca.prototype[Symbol.toStringTag]="AbortController",Tu.prototype[Symbol.toStringTag]="AbortSignal");function Ww(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 Kw(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=a===void 0?!1:a;if(!Ww({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:c};var c=o;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(S,g){var y;g&&g.signal&&(y=g.signal,delete g.signal);var x=new o(S,g);return y&&Object.defineProperty(x,"signal",{writable:!1,enumerable:!1,configurable:!0,value:y}),x},c.prototype=o.prototype);var u=r,h=function(S,g){var y=c&&c.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(y){var x;try{x=new DOMException("Aborted","AbortError")}catch{x=new Error("Aborted"),x.name="AbortError"}if(y.aborted)return Promise.reject(x);var E=new Promise(function(C,I){y.addEventListener("abort",function(){return I(x)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([E,u(S,g)])}return u(S,g)};return{fetch:h,Request:c}}oi.AbortController=ca;oi.AbortSignal=Tu;oi.abortableFetch=Kw});var Gp,l,A,f=ri(()=>{"use strict";Gp=_t(_u(),1),l=_t(_u(),1),{fetch:A}=(0,Gp.abortableFetch)({fetch})});function ii(e){if(iA.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function ku(e){return e.replace(aA,"")}function ai(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||!sA(r))return!1}return!0}function sA(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function $p(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 Yw,Kp,Xw,Yp,Jw,Zw,eA,tA,rA,nA,oA,iA,Bp,aA,Ln,Ou,Qp,Hp,zp,Wp,b,Jp=ri(()=>{"use strict";m();d();f();p();Yw=Object.create,Kp=Object.defineProperty,Xw=Object.getOwnPropertyDescriptor,Yp=Object.getOwnPropertyNames,Jw=Object.getPrototypeOf,Zw=Object.prototype.hasOwnProperty,eA=(e,t)=>function(){return t||(0,e[Yp(e)[0]])((t={exports:{}}).exports,t),t.exports},tA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yp(t))!Zw.call(e,o)&&o!==r&&Kp(e,o,{get:()=>t[o],enumerable:!(n=Xw(t,o))||n.enumerable});return e},rA=(e,t,r)=>(r=e!=null?Yw(Jw(e)):{},tA(t||!e||!e.__esModule?Kp(r,"default",{value:e,enumerable:!0}):r,e)),nA=eA({"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 o(c,u){var h=c.split(";").filter(n),v=h.shift(),S=i(v),g=S.name,y=S.value;u=u?Object.assign({},r,u):r;try{y=u.decodeValues?decodeURIComponent(y):y}catch(E){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+y+"'. Set options.decodeValues to false to disable this feature.",E)}var x={name:g,value:y};return h.forEach(function(E){var C=E.split("="),I=C.shift().trimLeft().toLowerCase(),T=C.join("=");I==="expires"?x.expires=new Date(T):I==="max-age"?x.maxAge=parseInt(T,10):I==="secure"?x.secure=!0:I==="httponly"?x.httpOnly=!0:I==="samesite"?x.sameSite=T:x[I]=T}),x}function i(c){var u="",h="",v=c.split("=");return v.length>1?(u=v.shift(),h=v.join("=")):h=c,{name:u,value:h}}function a(c,u){if(u=u?Object.assign({},r,u):r,!c)return u.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&&!u.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]),u=u?Object.assign({},r,u):r,u.map){var v={};return c.filter(n).reduce(function(S,g){var y=o(g,u);return S[y.name]=y,S},v)}else return c.filter(n).map(function(S){return o(S,u)})}function s(c){if(Array.isArray(c))return c;if(typeof c!="string")return[];var u=[],h=0,v,S,g,y,x;function E(){for(;h<c.length&&/\s/.test(c.charAt(h));)h+=1;return h<c.length}function C(){return S=c.charAt(h),S!=="="&&S!==";"&&S!==","}for(;h<c.length;){for(v=h,x=!1;E();)if(S=c.charAt(h),S===","){for(g=h,h+=1,E(),y=h;h<c.length&&C();)h+=1;h<c.length&&c.charAt(h)==="="?(x=!0,h=y,u.push(c.substring(v,g)),v=h):h=g+1}else h+=1;(!x||h>=c.length)&&u.push(c.substring(v,c.length))}return u}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=s}}),oA=rA(nA()),iA=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Bp=[`
19
+ `,"\r","\t"," "],aA=new RegExp(`(^[${Bp.join("")}]|$[${Bp.join("")}])`,"g");Ln=Symbol("normalizedHeaders"),Ou=Symbol("rawHeaderNames"),Qp=", ",b=class Xp{constructor(t){this[Hp]={},this[zp]=new Map,this[Wp]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof Xp||typeof w.Headers<"u"&&t instanceof w.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(Qp):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Qp):n)})}[(Hp=Ln,zp=Ou,Wp=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[Ln]).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(!ai(t))throw new TypeError(`Invalid header name "${t}"`);return this[Ln].hasOwnProperty(ii(t))}get(t){if(!ai(t))throw TypeError(`Invalid header name "${t}"`);return this[Ln][ii(t)]??null}set(t,r){if(!ai(t)||!$p(r))return;let n=ii(t),o=ku(r);this[Ln][n]=ku(o),this[Ou].set(n,t)}append(t,r){if(!ai(t)||!$p(r))return;let n=ii(t),o=ku(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!ai(t)||!this.has(t))return;let r=ii(t);delete this[Ln][r],this[Ou].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,oA.splitCookiesString)(t)}}});var m=ri(()=>{"use strict";Jp()});var sf=ze(ui=>{"use strict";m();d();f();p();var pa=ui&&ui.__assign||function(){return pa=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},pa.apply(this,arguments)};Object.defineProperty(ui,"__esModule",{value:!0});var hA={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function yA(e){var t=pa(pa({},hA),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}ui.getSanitizedOptions=yA});var cf=ze(Du=>{"use strict";m();d();f();p();Object.defineProperty(Du,"__esModule",{value:!0});function vA(e){var t=Math.random()*e;return Math.round(t)}Du.fullJitter=vA});var uf=ze(Mu=>{"use strict";m();d();f();p();Object.defineProperty(Mu,"__esModule",{value:!0});function SA(e){return e}Mu.noJitter=SA});var lf=ze(ju=>{"use strict";m();d();f();p();Object.defineProperty(ju,"__esModule",{value:!0});var wA=cf(),AA=uf();function bA(e){switch(e.jitter){case"full":return wA.fullJitter;case"none":default:return AA.noJitter}}ju.JitterFactory=bA});var Lu=ze(qu=>{"use strict";m();d();f();p();Object.defineProperty(qu,"__esModule",{value:!0});var xA=lf(),CA=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=xA.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();qu.Delay=CA});var df=ze(Yt=>{"use strict";m();d();f();p();var EA=Yt&&Yt.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),RA=Yt&&Yt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},IA=Yt&&Yt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Yt,"__esModule",{value:!0});var TA=Lu(),_A=function(e){EA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return RA(this,void 0,void 0,function(){return IA(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}(TA.Delay);Yt.SkipFirstDelay=_A});var pf=ze(li=>{"use strict";m();d();f();p();var kA=li&&li.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(li,"__esModule",{value:!0});var OA=Lu(),PA=function(e){kA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OA.Delay);li.AlwaysDelay=PA});var ff=ze(Uu=>{"use strict";m();d();f();p();Object.defineProperty(Uu,"__esModule",{value:!0});var NA=df(),FA=pf();function DA(e,t){var r=MA(e);return r.setAttemptNumber(t),r}Uu.DelayFactory=DA;function MA(e){return e.delayFirstAttempt?new FA.AlwaysDelay(e):new NA.SkipFirstDelay(e)}});var mf=ze(Br=>{"use strict";m();d();f();p();var Vu=Br&&Br.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Gu=Br&&Br.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Br,"__esModule",{value:!0});var jA=sf(),qA=ff();function LA(e,t){return t===void 0&&(t={}),Vu(this,void 0,void 0,function(){var r,n;return Gu(this,function(o){switch(o.label){case 0:return r=jA.getSanitizedOptions(t),n=new UA(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Br.backOff=LA;var UA=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Vu(this,void 0,void 0,function(){var t,r;return Gu(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 Vu(this,void 0,void 0,function(){var t;return Gu(this,function(r){switch(r.label){case 0:return t=qA.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Ts=ze((ud,ld)=>{"use strict";m();d();f();p();(function(e,t){typeof ud=="object"&&typeof ld<"u"?ld.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs=t()})(ud,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",h="quarter",v="year",S="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|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($){var G=["th","st","nd","rd"],V=$%100;return"["+$+(G[(V-20)%10]||G[V]||G[0])+"]"}},C=function($,G,V){var Q=String($);return!Q||Q.length>=G?$:""+Array(G+1-Q.length).join(V)+$},I={s:C,z:function($){var G=-$.utcOffset(),V=Math.abs(G),Q=Math.floor(V/60),B=V%60;return(G<=0?"+":"-")+C(Q,2,"0")+":"+C(B,2,"0")},m:function $(G,V){if(G.date()<V.date())return-$(V,G);var Q=12*(V.year()-G.year())+(V.month()-G.month()),B=G.clone().add(Q,u),K=V-B<0,Y=G.clone().add(Q+(K?-1:1),u);return+(-(Q+(V-B)/(K?B-Y:Y-B))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:u,y:v,w:c,d:s,D:S,h:a,m:i,s:o,ms:n,Q:h}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",_={};_[T]=E;var q="$isDayjsObject",N=function($){return $ instanceof U||!(!$||!$[q])},k=function $(G,V,Q){var B;if(!G)return T;if(typeof G=="string"){var K=G.toLowerCase();_[K]&&(B=K),V&&(_[K]=V,B=K);var Y=G.split("-");if(!B&&Y.length>1)return $(Y[0])}else{var ne=G.name;_[ne]=G,B=ne}return!Q&&B&&(T=B),B||!Q&&T},O=function($,G){if(N($))return $.clone();var V=typeof G=="object"?G:{};return V.date=$,V.args=arguments,new U(V)},D=I;D.l=k,D.i=N,D.w=function($,G){return O($,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var U=function(){function $(V){this.$L=k(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[q]=!0}var G=$.prototype;return G.parse=function(V){this.$d=function(Q){var B=Q.date,K=Q.utc;if(B===null)return new Date(NaN);if(D.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var Y=B.match(y);if(Y){var ne=Y[2]-1||0,pe=(Y[7]||"0").substring(0,3);return K?new Date(Date.UTC(Y[1],ne,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,pe)):new Date(Y[1],ne,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,pe)}}return new Date(B)}(V),this.init()},G.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},G.$utils=function(){return D},G.isValid=function(){return this.$d.toString()!==g},G.isSame=function(V,Q){var B=O(V);return this.startOf(Q)<=B&&B<=this.endOf(Q)},G.isAfter=function(V,Q){return O(V)<this.startOf(Q)},G.isBefore=function(V,Q){return this.endOf(Q)<O(V)},G.$g=function(V,Q,B){return D.u(V)?this[Q]:this.set(B,V)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(V,Q){var B=this,K=!!D.u(Q)||Q,Y=D.p(V),ne=function(Ee,De){var Ge=D.w(B.$u?Date.UTC(B.$y,De,Ee):new Date(B.$y,De,Ee),B);return K?Ge:Ge.endOf(s)},pe=function(Ee,De){return D.w(B.toDate()[Ee].apply(B.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(De)),B)},we=this.$W,de=this.$M,fe=this.$D,le="set"+(this.$u?"UTC":"");switch(Y){case v:return K?ne(1,0):ne(31,11);case u:return K?ne(1,de):ne(0,de+1);case c:var he=this.$locale().weekStart||0,Le=(we<he?we+7:we)-he;return ne(K?fe-Le:fe+(6-Le),de);case s:case S:return pe(le+"Hours",0);case a:return pe(le+"Minutes",1);case i:return pe(le+"Seconds",2);case o:return pe(le+"Milliseconds",3);default:return this.clone()}},G.endOf=function(V){return this.startOf(V,!1)},G.$set=function(V,Q){var B,K=D.p(V),Y="set"+(this.$u?"UTC":""),ne=(B={},B[s]=Y+"Date",B[S]=Y+"Date",B[u]=Y+"Month",B[v]=Y+"FullYear",B[a]=Y+"Hours",B[i]=Y+"Minutes",B[o]=Y+"Seconds",B[n]=Y+"Milliseconds",B)[K],pe=K===s?this.$D+(Q-this.$W):Q;if(K===u||K===v){var we=this.clone().set(S,1);we.$d[ne](pe),we.init(),this.$d=we.set(S,Math.min(this.$D,we.daysInMonth())).$d}else ne&&this.$d[ne](pe);return this.init(),this},G.set=function(V,Q){return this.clone().$set(V,Q)},G.get=function(V){return this[D.p(V)]()},G.add=function(V,Q){var B,K=this;V=Number(V);var Y=D.p(Q),ne=function(de){var fe=O(K);return D.w(fe.date(fe.date()+Math.round(de*V)),K)};if(Y===u)return this.set(u,this.$M+V);if(Y===v)return this.set(v,this.$y+V);if(Y===s)return ne(1);if(Y===c)return ne(7);var pe=(B={},B[i]=t,B[a]=r,B[o]=e,B)[Y]||1,we=this.$d.getTime()+V*pe;return D.w(we,this)},G.subtract=function(V,Q){return this.add(-1*V,Q)},G.format=function(V){var Q=this,B=this.$locale();if(!this.isValid())return B.invalidDate||g;var K=V||"YYYY-MM-DDTHH:mm:ssZ",Y=D.z(this),ne=this.$H,pe=this.$m,we=this.$M,de=B.weekdays,fe=B.months,le=B.meridiem,he=function(De,Ge,ut,wt){return De&&(De[Ge]||De(Q,K))||ut[Ge].slice(0,wt)},Le=function(De){return D.s(ne%12||12,De,"0")},Ee=le||function(De,Ge,ut){var wt=De<12?"AM":"PM";return ut?wt.toLowerCase():wt};return K.replace(x,function(De,Ge){return Ge||function(ut){switch(ut){case"YY":return String(Q.$y).slice(-2);case"YYYY":return D.s(Q.$y,4,"0");case"M":return we+1;case"MM":return D.s(we+1,2,"0");case"MMM":return he(B.monthsShort,we,fe,3);case"MMMM":return he(fe,we);case"D":return Q.$D;case"DD":return D.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return he(B.weekdaysMin,Q.$W,de,2);case"ddd":return he(B.weekdaysShort,Q.$W,de,3);case"dddd":return de[Q.$W];case"H":return String(ne);case"HH":return D.s(ne,2,"0");case"h":return Le(1);case"hh":return Le(2);case"a":return Ee(ne,pe,!0);case"A":return Ee(ne,pe,!1);case"m":return String(pe);case"mm":return D.s(pe,2,"0");case"s":return String(Q.$s);case"ss":return D.s(Q.$s,2,"0");case"SSS":return D.s(Q.$ms,3,"0");case"Z":return Y}return null}(De)||Y.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(V,Q,B){var K,Y=this,ne=D.p(Q),pe=O(V),we=(pe.utcOffset()-this.utcOffset())*t,de=this-pe,fe=function(){return D.m(Y,pe)};switch(ne){case v:K=fe()/12;break;case u:K=fe();break;case h:K=fe()/3;break;case c:K=(de-we)/6048e5;break;case s:K=(de-we)/864e5;break;case a:K=de/r;break;case i:K=de/t;break;case o:K=de/e;break;default:K=de}return B?K:D.a(K)},G.daysInMonth=function(){return this.endOf(u).$D},G.$locale=function(){return _[this.$L]},G.locale=function(V,Q){if(!V)return this.$L;var B=this.clone(),K=k(V,Q,!0);return K&&(B.$L=K),B},G.clone=function(){return D.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},$}(),z=U.prototype;return O.prototype=z,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",v],["$D",S]].forEach(function($){z[$[1]]=function(G){return this.$g(G,$[0],$[1])}}),O.extend=function($,G){return $.$i||($(G,U,O),$.$i=!0),O},O.locale=k,O.isDayjs=N,O.unix=function($){return O(1e3*$)},O.en=_[T],O.Ls=_,O.p={},O})});var Th=ze((dd,pd)=>{"use strict";m();d();f();p();(function(e,t){typeof dd=="object"&&typeof pd<"u"?pd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_quarterOfYear=t()})(dd,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var i=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):i.bind(this)(s,c)};var a=o.startOf;o.startOf=function(s,c){var u=this.$utils(),h=!!u.u(c)||c;if(u.p(s)===t){var v=this.quarter()-1;return h?this.month(3*v).startOf(e).startOf("day"):this.month(3*v+2).endOf(e).endOf("day")}return a.bind(this)(s,c)}}})});var _h=ze((fd,md)=>{"use strict";m();d();f();p();(function(e,t){typeof fd=="object"&&typeof md<"u"?md.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_customParseFormat=t()})(fd,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},s=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(x){this[y]=+x}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var E=x.match(/([+-]|\d\d)/g),C=60*E[1]+(+E[2]||0);return C===0?0:E[0]==="+"?-C:C}(y)}],h=function(y){var x=a[y];return x&&(x.indexOf?x:x.s.concat(x.f))},v=function(y,x){var E,C=a.meridiem;if(C){for(var I=1;I<=24;I+=1)if(y.indexOf(C(I,0,x))>-1){E=I>12;break}}else E=y===(x?"pm":"PM");return E},S={A:[i,function(y){this.afternoon=v(y,!1)}],a:[i,function(y){this.afternoon=v(y,!0)}],Q:[r,function(y){this.month=3*(y-1)+1}],S:[r,function(y){this.milliseconds=100*+y}],SS:[n,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[i,function(y){var x=a.ordinal,E=y.match(/\d+/);if(this.day=E[0],x)for(var C=1;C<=31;C+=1)x(C).replace(/\[|\]/g,"")===y&&(this.day=C)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[i,function(y){var x=h("months"),E=(h("monthsShort")||x.map(function(C){return C.slice(0,3)})).indexOf(y)+1;if(E<1)throw new Error;this.month=E%12||E}],MMMM:[i,function(y){var x=h("months").indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(y){this.year=s(y)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(y){var x,E;x=y,E=a&&a.formats;for(var C=(y=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(O,D,U){var z=U&&U.toUpperCase();return D||E[U]||e[U]||E[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function($,G,V){return G||V.slice(1)})})).match(t),I=C.length,T=0;T<I;T+=1){var _=C[T],q=S[_],N=q&&q[0],k=q&&q[1];C[T]=k?{regex:N,parser:k}:_.replace(/^\[|\]$/g,"")}return function(O){for(var D={},U=0,z=0;U<I;U+=1){var $=C[U];if(typeof $=="string")z+=$.length;else{var G=$.regex,V=$.parser,Q=O.slice(z),B=G.exec(Q)[0];V.call(D,B),O=O.replace(B,"")}}return function(K){var Y=K.afternoon;if(Y!==void 0){var ne=K.hours;Y?ne<12&&(K.hours+=12):ne===12&&(K.hours=0),delete K.afternoon}}(D),D}}return function(y,x,E){E.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(s=y.parseTwoDigitYear);var C=x.prototype,I=C.parse;C.parse=function(T){var _=T.date,q=T.utc,N=T.args;this.$u=q;var k=N[1];if(typeof k=="string"){var O=N[2]===!0,D=N[3]===!0,U=O||D,z=N[2];D&&(z=N[2]),a=this.$locale(),!O&&z&&(a=E.Ls[z]),this.$d=function(Q,B,K,Y){try{if(["x","X"].indexOf(B)>-1)return new Date((B==="X"?1e3:1)*Q);var ne=g(B)(Q),pe=ne.year,we=ne.month,de=ne.day,fe=ne.hours,le=ne.minutes,he=ne.seconds,Le=ne.milliseconds,Ee=ne.zone,De=ne.week,Ge=new Date,ut=de||(pe||we?1:Ge.getDate()),wt=pe||Ge.getFullYear(),dr=0;pe&&!we||(dr=we>0?we-1:Ge.getMonth());var Mn,jn=fe||0,ei=le||0,bu=he||0,xu=Le||0;return Ee?new Date(Date.UTC(wt,dr,ut,jn,ei,bu,xu+60*Ee.offset*1e3)):K?new Date(Date.UTC(wt,dr,ut,jn,ei,bu,xu)):(Mn=new Date(wt,dr,ut,jn,ei,bu,xu),De&&(Mn=Y(Mn).week(De).toDate()),Mn)}catch{return new Date("")}}(_,k,q,E),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),U&&_!=this.format(k)&&(this.$d=new Date("")),a={}}else if(k instanceof Array)for(var $=k.length,G=1;G<=$;G+=1){N[1]=k[G-1];var V=E.apply(this,N);if(V.isValid()){this.$d=V.$d,this.$L=V.$L,this.init();break}G===$&&(this.$d=new Date(""))}else I.call(this,T)}}})});var py=ze((Id,Td)=>{"use strict";m();d();f();p();(function(e,t){typeof Id=="object"&&typeof Td<"u"?Td.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_timezone=t()})(Id,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,v,S){S===void 0&&(S={});var g=new Date(h),y=function(x,E){E===void 0&&(E={});var C=E.timeZoneName||"short",I=x+"|"+C,T=t[I];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:x,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:C}),t[I]=T),T}(v,S);return y.formatToParts(g)},s=function(h,v){for(var S=a(h,v),g=[],y=0;y<S.length;y+=1){var x=S[y],E=x.type,C=x.value,I=e[E];I>=0&&(g[I]=parseInt(C,10))}var T=g[3],_=T===24?0:T,q=g[0]+"-"+g[1]+"-"+g[2]+" "+_+":"+g[4]+":"+g[5]+":000",N=+h;return(o.utc(q).valueOf()-(N-=N%1e3))/6e4},c=n.prototype;c.tz=function(h,v){h===void 0&&(h=i);var S,g=this.utcOffset(),y=this.toDate(),x=y.toLocaleString("en-US",{timeZone:h}),E=Math.round((y-new Date(x))/1e3/60),C=15*-Math.round(y.getTimezoneOffset()/15)-E;if(!Number(C))S=this.utcOffset(0,v);else if(S=o(x,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(C,!0),v){var I=S.utcOffset();S=S.add(g-I,"minute")}return S.$x.$timezone=h,S},c.offsetName=function(h){var v=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),v,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var u=c.startOf;c.startOf=function(h,v){if(!this.$x||!this.$x.$timezone)return u.call(this,h,v);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(S,h,v).tz(this.$x.$timezone,!0)},o.tz=function(h,v,S){var g=S&&v,y=S||v||i,x=s(+o(),y);if(typeof h!="string")return o(h).tz(y);var E=function(_,q,N){var k=_-60*q*1e3,O=s(k,N);if(q===O)return[k,q];var D=s(k-=60*(O-q)*1e3,N);return O===D?[k,O]:[_-60*Math.min(O,D)*1e3,Math.max(O,D)]}(o.utc(h,g).valueOf(),x,y),C=E[0],I=E[1],T=o(C).utcOffset(I);return T.$x.$timezone=y,T},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var fy=ze((_d,kd)=>{"use strict";m();d();f();p();(function(e,t){typeof _d=="object"&&typeof kd<"u"?kd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_utc=t()})(_d,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var y={date:g,utc:!0,args:arguments};return new o(y)},a.utc=function(g){var y=i(this.toDate(),{locale:this.$L,utc:!0});return g?y.add(this.utcOffset(),e):y},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),s.call(this,g)};var c=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else c.call(this)};var u=a.utcOffset;a.utcOffset=function(g,y){var x=this.$utils().u;if(x(g))return this.$u?0:x(this.$offset)?u.call(this):this.$offset;if(typeof g=="string"&&(g=function(T){T===void 0&&(T="");var _=T.match(t);if(!_)return null;var q=(""+_[0]).match(r)||["-",0,0],N=q[0],k=60*+q[1]+ +q[2];return k===0?0:N==="+"?k:-k}(g),g===null))return this;var E=Math.abs(g)<=16?60*g:g,C=this;if(y)return C.$offset=E,C.$u=g===0,C;if(g!==0){var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(C=this.local().add(E+I,e)).$offset=E,C.$x.$localOffset=I}else C=this.utc();return C};var h=a.format;a.format=function(g){var y=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var v=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var S=a.diff;a.diff=function(g,y,x){if(g&&this.$u===g.$u)return S.call(this,g,y,x);var E=this.local(),C=i(g).local();return S.call(E,C,y,x)}}})});var TS=ze((Dce,IS)=>{"use strict";m();d();f();p();function zk(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}IS.exports=Wk;function Wk(e,t,r){var n=r&&r.stringify||zk,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var s=1;s<i;s++)a[s]=n(t[s]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",h=1-o,v=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(v=v>-1?v:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=c||t[h]==null)break;v<g&&(u+=e.slice(v,g)),u+=Number(t[h]),v=g+2,g++;break;case 105:if(h>=c||t[h]==null)break;v<g&&(u+=e.slice(v,g)),u+=Math.floor(Number(t[h])),v=g+2,g++;break;case 79:case 111:case 106:if(h>=c||t[h]===void 0)break;v<g&&(u+=e.slice(v,g));var y=typeof t[h];if(y==="string"){u+="'"+t[h]+"'",v=g+2,g++;break}if(y==="function"){u+=t[h].name||"<anonymous>",v=g+2,g++;break}u+=n(t[h]),v=g+2,g++;break;case 115:if(h>=c)break;v<g&&(u+=e.slice(v,g)),u+=String(t[h]),v=g+2,g++;break;case 37:v<g&&(u+=e.slice(v,g)),u+="%",v=g+2,g++,h--;break}++h}++g}return v===-1?e:(v<S&&(u+=e.slice(v)),u)}});var FS=ze((Uce,uu)=>{"use strict";m();d();f();p();var _S=TS();uu.exports=lr;var ra=u0().console||{},Kk={mapHttpRequest:cu,mapHttpResponse:cu,wrapRequestSerializer:Ep,wrapResponseSerializer:Ep,wrapErrorSerializer:Ep,req:cu,res:cu,err:OS,errWithCause:OS};function Ur(e,t){return e==="silent"?1/0:t.levels.values[e]}var Tp=Symbol("pino.logFuncs"),Rp=Symbol("pino.hierarchy"),Yk={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function kS(e,t){let r={logger:t,parent:e[Rp]};t[Rp]=r}function Xk(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:ra[o]||ra[Yk[o]||"log"]||Wo}),e[Tp]=n}function Jk(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function lr(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||ra;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=Jk(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&s.forEach(function(x){r[x]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=Wo),Xk(u,s,r),kS({},u),Object.defineProperty(u,"levelVal",{get:v}),Object.defineProperty(u,"level",{get:S,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:a0(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Wo};u.levels=Zk(e),u.level=c,u.isLevelEnabled=function(x){return this.levels.values[x]?this.levels.values[x]>=this.levels.values[this.level]:!1},u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=Wo,u.serializers=n,u._serialize=o,u._stdErrSerialize=i,u.child=function(...x){return y.call(this,h,...x)},t&&(u._logEvent=Ip());function v(){return Ur(this.level,this)}function S(){return this._level}function g(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,Pn(this,h,u,"error"),Pn(this,h,u,"fatal"),Pn(this,h,u,"warn"),Pn(this,h,u,"info"),Pn(this,h,u,"debug"),Pn(this,h,u,"trace"),a.forEach(E=>{Pn(this,h,u,E)})}function y(x,E,C){if(!E)throw new Error("missing bindings for child Pino");C=C||{},o&&E.serializers&&(C.serializers=E.serializers);let I=C.serializers;if(o&&I){var T=Object.assign({},n,I),_=e.browser.serialize===!0?Object.keys(T):o;delete E.serializers,_p([E],_,T,this._stdErrSerialize)}function q(k){this._childLevel=(k._childLevel|0)+1,this.bindings=E,T&&(this.serializers=T,this._serialize=_),t&&(this._logEvent=Ip([].concat(k._logEvent.bindings,E)))}q.prototype=this;let N=new q(this);return kS(this,N),N.child=function(...k){return y.call(this,x,...k)},N.level=C.level||this.level,x.onChild(N),N}return u}function Zk(e){let t=e.customLevels||{},r=Object.assign({},lr.levels.values,t),n=Object.assign({},lr.levels.labels,e0(t));return{values:r,labels:n}}function e0(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}lr.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"}};lr.stdSerializers=Kk;lr.stdTimeFunctions=Object.assign({},{nullTime:PS,epochTime:NS,unixTime:s0,isoTime:c0});function t0(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Rp];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Pn(e,t,r,n){if(Object.defineProperty(e,n,{value:Ur(e.level,r)>Ur(n,r)?Wo:r[Tp][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Wo){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Ur(i,r);if(Ur(n,r)<a)return}e[n]=n0(e,t,r,n);let o=t0(e);o.length!==0&&(e[n]=r0(o,e[n]))}function r0(e,t){return function(){return t.apply(this,[...e,...arguments])}}function n0(e,t,r,n){return function(o){return function(){let a=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ra?ra:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var h=!1;if(t.serialize&&(_p(s,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(c,...o0(this,n,s,a,t)):o.apply(c,s),t.transmit){let v=t.transmit.level||e._level,S=Ur(v,r),g=Ur(n,r);if(g<S)return;i0(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:v,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Ur(e._level,r)},s,h)}}}(e[Tp][n])}function o0(e,t,r,n,o){let{level:i,log:a=v=>v}=o.formatters||{},s=r.slice(),c=s[0],u={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(u.time=n),i){let v=i(t,e.levels.values[t]);Object.assign(u,v)}else u.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());return[a(u),...s]}else{if(c!==null&&typeof c=="object"){for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?_S(s.shift(),s):void 0}else typeof c=="string"&&(c=_S(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),[a(u)]}}function _p(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=lr.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function i0(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||_p(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return u.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=s,o(a,e._logEvent,c),e._logEvent=Ip(u)}function Ip(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function OS(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 a0(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?PS:NS}function cu(){return{}}function Ep(e){return e}function Wo(){}function PS(){return!1}function NS(){return Date.now()}function s0(){return Math.round(Date.now()/1e3)}function c0(){return new Date(Date.now()).toISOString()}function u0(){function e(t){return typeof t<"u"&&t}try{return typeof w<"u"?w:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),w)}catch{return e(self)||e(window)||e(this)||{}}}uu.exports.default=lr;uu.exports.pino=lr});var uO={};ni(uO,{DefaultFieldsToInclude:()=>Dp,EcommerceDefaultFieldsToInclude:()=>bw,HighlightUtils:()=>Fu,MinimumFieldsToInclude:()=>wu,ResultTemplatesHelpers:()=>Wh,buildContext:()=>$S,buildController:()=>Vr,buildDictionaryFieldContext:()=>QS,buildInteractiveResult:()=>vw,buildRecommendationEngine:()=>VS,buildRecommendationList:()=>hw,buildResultTemplatesManager:()=>Ew,getAnalyticsNextApiBaseUrl:()=>fa,getOrganizationEndpoint:()=>Be,getSampleRecommendationEngineConfiguration:()=>kp,loadAdvancedSearchQueryActions:()=>W0,loadClickAnalyticsActions:()=>iO,loadConfigurationActions:()=>K0,loadContextActions:()=>X0,loadDebugActions:()=>J0,loadDictionaryFieldContextActions:()=>Z0,loadFieldActions:()=>rO,loadPaginationActions:()=>Fp,loadPipelineActions:()=>nO,loadRecommendationActions:()=>oO,loadSearchConfigurationActions:()=>Y0,loadSearchHubActions:()=>cO});module.exports=Pw(uO);m();d();f();p();var Fu={};ni(Fu,{escapeHtml:()=>Un,getHighlightedSuggestion:()=>gA,highlightString:()=>mA});m();d();f();p();m();d();f();p();function cA(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 on(r)}var on=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Te=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Sg(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},pe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Ae(e){return e===void 0}function vg(e){return e===null}function X(e){return Ae(e)||vg(e)}var ee=class{constructor(e={}){ue(this,"value");this.value=new pe(e)}validate(e){let t=this.value.validate(e);return t||(Ag(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Ag(e){return Ae(e)||Kc(e)}function Kc(e){return typeof e=="boolean"}var J=class{constructor(e={}){ue(this,"value");this.config=e,this.value=new pe(e)}validate(e){let t=this.value.validate(e);return t||(wg(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 wg(e){return Ae(e)||Yc(e)}function Yc(e){return typeof e=="number"&&!Number.isNaN(e)}var bg=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,$=class{constructor(e={}){ue(this,"value");ue(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new pe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Ae(e))return null;if(!Xn(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(bg.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 Xn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){ue(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ae(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Jc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Jc(e){return e!==void 0&&typeof e=="object"}var oe=class{constructor(e={}){ue(this,"value");this.config=e,this.value=new pe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&X(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Kc(e)||Xn(e)||Yc(e)||Jc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Xc(e){return Array.isArray(e)}var la=class{constructor(e){ue(this,"value");this.config=e,this.value=new pe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ae(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();function Zc(e){return Array.isArray(e)}function Zn(e){return e.trim()===""}var Cg=new Set(["1",1,"yes",!0]);function eu(){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=>Cg.has(r))}function tu(e){let t={};for(let[r,n]of e)t[r]=n;return t}function an(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function eo(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function xg(e){if(Zn(e.openingDelimiter)||Zn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Zn(e.content))return e.content;if(e.highlights.length===0)return rr(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,m=a+i.length;if(m>t)break;r+=rr(e.content.slice(n,a)),r+=e.openingDelimiter,r+=rr(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=rr(e.content.slice(n))),r}function Rg(e,t){return e=rr(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?da(n,t.notMatchDelimiters):o?da(o,t.exactMatchDelimiters):i?da(i,t.correctionDelimiters):r)}function da(e,t){return t?t.open+e+t.close:e}function rr(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var fu=$e(uu(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),nr=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},jt=class extends Error{constructor(r,n){super();ue(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function lu(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function du(e){return typeof e!="object"||!e?!1:Object.values(e).every(Jg)}function Jg(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function pu(e){return e===429}var He=class e{static call(t){return _asyncToGenerator(function*(){let r=Xg(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield w(i,a);if(pu(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,fu.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(p){let g=p&&pu(p.status);return g&&(n.info("Platform retrying request"),yield new Promise(h=>setTimeout(h,1e3))),g});return function retry(_x){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new nr;case 404:throw new jt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new jt(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,p=an(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function Se(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pt(e,t="prod"){return`${Se(e,t)}/rest/search/v2`}function ro(e,t="prod"){return`${Se(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Xg(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=Zg(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function Zg(e,t){return t==="application/x-www-form-urlencoded"?du(e)?lu(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var no=e=>e;d();c();l();u();d();c();l();u();function oo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function We(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:oo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:oo(),extendedResults:{},searchAction:void 0}}d();c();l();u();function ft(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mt=e=>{let{response:t}=e;return t.body?ey(e):ty(t)},ey=e=>ny(e)?oy(e):ry(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},ty=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function ry(e){return e.body.statusCode!==void 0}function ny(e){return e.body.exception!==void 0}var oy=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var gt=class{constructor(){ue(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var un=class{constructor(t){ue(this,"_basePath");ue(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};d();c();l();u();function mu(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rt=(e,t,r,n)=>{let o=new un(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var gu=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield He.call({...rt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ft(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=mu(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return iy(a)?{success:a}:{error:mt({response:r,body:a})}});return function gu(_x2,_x3){return _ref3.apply(this,arguments)}}();function iy(e){return typeof e=="string"}d();c();l();u();function ay(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function sy(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function io(e,t){if(t&&e.name==="AbortError")return{error:sy(e)};if(e instanceof jt)return{error:ay(e)};throw e}var ao=class{constructor(t){this.options=t;ue(this,"apiCallsQueues",{unknown:new gt,mainSearch:new gt,facetValues:new gt,foldingCollection:new gt,instantResults:new gt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield He.call({...rt(t,"POST","application/json","/plan"),requestParams:ft(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return io(r);let n=yield r.json();return uy(n)?{success:n}:{error:mt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield He.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ft(t),..._this3.options});if(r instanceof Error)return io(r);let n=yield r.json(),o={response:r,body:n};return cy(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>He.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return io(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return yu(i)?(a.body=hu(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield He.call({...rt(t,"POST","application/json","/facet"),requestParams:ft(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield He.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(yu(n)){let o={response:r,body:n};return o.body=hu(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return gu(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield He.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return ly(n)?{success:n}:{error:mt({response:r,body:n})}})()}},so=e=>e.success!==void 0,De=e=>e.error!==void 0;function yu(e){return e.results!==void 0}function hu(e){let t=oo();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function cy(e){return e.completions!==void 0}function uy(e){return e.preprocessingOutput!==void 0}function ly(e){return e.fields!==void 0}d();c();l();u();var Su=e=>e,vu=e=>e,Au=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function we(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 dy=typeof Symbol=="function"&&Symbol.observable||"@@observable",wu=dy,wa=()=>Math.random().toString(36).substring(7).split("").join("."),py={INIT:`@@redux/INIT${wa()}`,REPLACE:`@@redux/REPLACE${wa()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${wa()}`},co=py;function Ke(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ba(e,t,r){if(typeof e!="function")throw new Error(we(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(we(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(we(1));return r(ba)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function p(){a===i&&(a=new Map,i.forEach((I,C)=>{a.set(C,I)}))}function g(){if(f)throw new Error(we(3));return o}function h(I){if(typeof I!="function")throw new Error(we(4));if(f)throw new Error(we(5));let C=!0;p();let P=m++;return a.set(P,I),function(){if(C){if(f)throw new Error(we(6));C=!1,p(),a.delete(P),i=null}}}function S(I){if(!Ke(I))throw new Error(we(7));if(typeof I.type>"u")throw new Error(we(8));if(typeof I.type!="string")throw new Error(we(17));if(f)throw new Error(we(9));try{f=!0,o=n(o,I)}finally{f=!1}return(i=a).forEach(P=>{P()}),I}function y(I){if(typeof I!="function")throw new Error(we(10));n=I,S({type:co.REPLACE})}function v(){let I=h;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(we(11));function P(){let E=C;E.next&&E.next(g())}return P(),{unsubscribe:I(P)}},[wu](){return this}}}return S({type:co.INIT}),{dispatch:S,subscribe:h,getState:g,replaceReducer:y,[wu]:v}}function fy(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:co.INIT})>"u")throw new Error(we(12));if(typeof r(void 0,{type:co.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(we(13))})}function or(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{fy(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let p=!1,g={};for(let h=0;h<n.length;h++){let S=n[h],y=r[S],v=m[S],R=y(v,f);if(typeof R>"u"){let I=f&&f.type;throw new Error(we(14))}g[S]=R,p=p||R!==v}return p=p||n.length!==Object.keys(m).length,p?g:m}}function ir(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function bu(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(we(15))},a={getState:o.getState,dispatch:(f,...p)=>i(f,...p)},m=e.map(f=>f(a));return i=ir(...m)(o.dispatch),{...o,dispatch:i}}}function ar(e){return Ke(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var Ta=Symbol.for("immer-nothing"),ln=Symbol.for("immer-draftable"),qe=Symbol.for("immer-state");function be(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[qe]}function je(e){return e?Fu(e)||Array.isArray(e)||!!e[ln]||!!e.constructor?.[ln]||cr(e)||yn(e):!1}var my=Object.prototype.constructor.toString(),Cu=new WeakMap;function Fu(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Cu.get(r);return n===void 0&&(n=Function.toString.call(r),Cu.set(r,n)),n===my}function Da(e){return Ne(e)||be(15,e),e[qe].base_}function dn(e,t,r=!0){Nt(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Nt(e){let t=e[qe];return t?t.type_:Array.isArray(e)?1:cr(e)?2:yn(e)?3:0}function pn(e,t){return Nt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ca(e,t){return Nt(e)===2?e.get(t):e[t]}function Pu(e,t,r){let n=Nt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function gy(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cr(e){return e instanceof Map}function yn(e){return e instanceof Set}function Mt(e){return e.copy_||e.base_}function Ea(e,t){if(cr(e))return new Map(e);if(yn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Fu(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[qe];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(sr(e),n)}else{let n=sr(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function fo(e,t=!1){return mo(e)||Ne(e)||!je(e)||(Nt(e)>1&&Object.defineProperties(e,{set:uo,add:uo,clear:uo,delete:uo}),Object.freeze(e),t&&Object.values(e).forEach(r=>fo(r,!0))),e}function yy(){be(2)}var uo={value:yy};function mo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ia={};function _t(e){let t=Ia[e];return t||be(0,e),t}function hy(e,t){Ia[e]||(Ia[e]=t)}var fn;function ku(){return fn}function Sy(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xu(e,t){t&&(_t("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Fa(e){Pa(e),e.drafts_.forEach(vy),e.drafts_=null}function Pa(e){e===fn&&(fn=e.parent_)}function Ru(e){return fn=Sy(fn,e)}function vy(e){let t=e[qe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Eu(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[qe].modified_&&(Fa(t),be(4)),je(e)&&(e=lo(t,e),t.parent_||po(t,e)),t.patches_&&_t("Patches").generateReplacementPatches_(r[qe].base_,e,t.patches_,t.inversePatches_)):e=lo(t,r,[]),Fa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ta?e:void 0}function lo(e,t,r){if(mo(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[qe];if(!o)return dn(t,(i,a)=>Iu(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return po(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,m=!1;o.type_===3&&(a=new Set(i),i.clear(),m=!0),dn(a,(f,p)=>Iu(e,o,i,f,p,r,m),n),po(e,i,!1),r&&e.patches_&&_t("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Iu(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let m=mo(o);if(!(m&&!a)){if(Ne(o)){let f=i&&t&&t.type_!==3&&!pn(t.assigned_,n)?i.concat(n):void 0,p=lo(e,o,f);if(Pu(r,n,p),Ne(p))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(je(o)&&!m){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&m)return;lo(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(cr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&po(e,o)}}}function po(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fo(t,r)}function Ay(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ku(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=qa;r&&(o=[n],i=mn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var qa={get(e,t){if(t===qe)return e;let r=Mt(e);if(!pn(r,t))return wy(e,r,t);let n=r[t];return e.finalized_||!je(n)?n:n===xa(e.base_,t)?(Ra(e),e.copy_[t]=Oa(n,e)):n},has(e,t){return t in Mt(e)},ownKeys(e){return Reflect.ownKeys(Mt(e))},set(e,t,r){let n=Ou(Mt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=xa(Mt(e),t),i=o?.[qe];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(gy(r,o)&&(r!==void 0||pn(e.base_,t)))return!0;Ra(e),ka(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 xa(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ra(e),ka(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Mt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){be(11)},getPrototypeOf(e){return sr(e.base_)},setPrototypeOf(){be(12)}},mn={};dn(qa,(e,t)=>{mn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mn.deleteProperty=function(e,t){return mn.set.call(this,e,t,void 0)};mn.set=function(e,t,r){return qa.set.call(this,e[0],t,r,e[0])};function xa(e,t){let r=e[qe];return(r?Mt(r):e)[t]}function wy(e,t,r){let n=Ou(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Ou(e,t){if(!(t in e))return;let r=sr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=sr(r)}}function ka(e){e.modified_||(e.modified_=!0,e.parent_&&ka(e.parent_))}function Ra(e){e.copy_||(e.copy_=Ea(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var by=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...p){return a.produce(f,g=>r.call(this,g,...p))}}typeof r!="function"&&be(6),n!==void 0&&typeof n!="function"&&be(7);let o;if(je(t)){let i=Ru(this),a=Oa(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?Fa(i):Pa(i)}return xu(i,n),Eu(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Ta&&(o=void 0),this.autoFreeze_&&fo(o,!0),n){let i=[],a=[];_t("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else be(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){je(e)||be(8),Ne(e)&&(e=Tu(e));let t=Ru(this),r=Oa(e,void 0);return r[qe].isManual_=!0,Pa(t),r}finishDraft(e,t){let r=e&&e[qe];(!r||!r.isManual_)&&be(9);let{scope_:n}=r;return xu(n,t),Eu(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=_t("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Oa(e,t){let r=cr(e)?_t("MapSet").proxyMap_(e,t):yn(e)?_t("MapSet").proxySet_(e,t):Ay(e,t);return(t?t.scope_:ku()).drafts_.push(r),r}function Tu(e){return Ne(e)||be(10,e),Du(e)}function Du(e){if(!je(e)||mo(e))return e;let t=e[qe],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ea(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Ea(e,!0);return dn(r,(o,i)=>{Pu(r,o,Du(i))},n),t&&(t.finalized_=!1),r}function qu(){let t="replace",r="add",n="remove";function o(S,y,v,R){switch(S.type_){case 0:case 2:return a(S,y,v,R);case 1:return i(S,y,v,R);case 3:return m(S,y,v,R)}}function i(S,y,v,R){let{base_:I,assigned_:C}=S,P=S.copy_;P.length<I.length&&([I,P]=[P,I],[v,R]=[R,v]);for(let x=0;x<I.length;x++)if(C[x]&&P[x]!==I[x]){let E=y.concat([x]);v.push({op:t,path:E,value:h(P[x])}),R.push({op:t,path:E,value:h(I[x])})}for(let x=I.length;x<P.length;x++){let E=y.concat([x]);v.push({op:r,path:E,value:h(P[x])})}for(let x=P.length-1;I.length<=x;--x){let E=y.concat([x]);R.push({op:n,path:E})}}function a(S,y,v,R){let{base_:I,copy_:C}=S;dn(S.assigned_,(P,x)=>{let E=Ca(I,P),M=Ca(C,P),T=x?pn(I,P)?t:r:n;if(E===M&&T===t)return;let F=y.concat(P);v.push(T===n?{op:T,path:F}:{op:T,path:F,value:M}),R.push(T===r?{op:n,path:F}:T===n?{op:r,path:F,value:h(E)}:{op:t,path:F,value:h(E)})})}function m(S,y,v,R){let{base_:I,copy_:C}=S,P=0;I.forEach(x=>{if(!C.has(x)){let E=y.concat([P]);v.push({op:n,path:E,value:x}),R.unshift({op:r,path:E,value:x})}P++}),P=0,C.forEach(x=>{if(!I.has(x)){let E=y.concat([P]);v.push({op:r,path:E,value:x}),R.unshift({op:n,path:E,value:x})}P++})}function f(S,y,v,R){v.push({op:t,path:[],value:y===Ta?void 0:y}),R.push({op:t,path:[],value:S})}function p(S,y){return y.forEach(v=>{let{path:R,op:I}=v,C=S;for(let M=0;M<R.length-1;M++){let T=Nt(C),F=R[M];typeof F!="string"&&typeof F!="number"&&(F=""+F),(T===0||T===1)&&(F==="__proto__"||F==="constructor")&&be(19),typeof C=="function"&&F==="prototype"&&be(19),C=Ca(C,F),typeof C!="object"&&be(18,R.join("/"))}let P=Nt(C),x=g(v.value),E=R[R.length-1];switch(I){case t:switch(P){case 2:return C.set(E,x);case 3:be(16);default:return C[E]=x}case r:switch(P){case 1:return E==="-"?C.push(x):C.splice(E,0,x);case 2:return C.set(E,x);case 3:return C.add(x);default:return C[E]=x}case n:switch(P){case 1:return C.splice(E,1);case 2:return C.delete(E);case 3:return C.delete(v.value);default:return delete C[E]}default:be(17,I)}}),S}function g(S){if(!je(S))return S;if(Array.isArray(S))return S.map(g);if(cr(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,g(R)]));if(yn(S))return new Set(Array.from(S).map(g));let y=Object.create(sr(S));for(let v in S)y[v]=g(S[v]);return pn(S,ln)&&(y[ln]=S[ln]),y}function h(S){return Ne(S)?g(S):S}hy("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:f})}var gn=new by,nt=gn.produce,go=gn.produceWithPatches.bind(gn);var ja=gn.applyPatches.bind(gn);d();c();l();u();function Cy(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function xy(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ry(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 ju=e=>Array.isArray(e)?e:[e];function Ey(e){let t=Array.isArray(e[0])?e[0]:e;return Ry(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Iy(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var xE=Symbol();var RE=Object.getPrototypeOf({});var Fy=class{constructor(e){this.value=e}deref(){return this.value}},Py=typeof WeakRef<"u"?WeakRef:Fy,ky=0,Mu=1;function yo(){return{s:ky,v:void 0,o:null,p:null}}function ur(e,t={}){let r=yo(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let y=arguments[h];if(typeof y=="function"||typeof y=="object"&&y!==null){let v=m.o;v===null&&(m.o=v=new WeakMap);let R=v.get(y);R===void 0?(m=yo(),v.set(y,m)):m=R}else{let v=m.p;v===null&&(m.p=v=new Map);let R=v.get(y);R===void 0?(m=yo(),v.set(y,m)):m=R}}let p=m,g;if(m.s===Mu)g=m.v;else if(g=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,g)&&(g=h,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Py(g):g}return p.s=Mu,p.v=g,g}return a.clearCache=()=>{r=yo(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Nu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},p=o.pop();typeof p=="object"&&(f=p,p=o.pop()),Cy(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let g={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:y=ur,argsMemoizeOptions:v=[],devModeChecks:R={}}=g,I=ju(S),C=ju(v),P=Ey(o),x=h(function(){return i++,p.apply(null,arguments)},...I),E=!0,M=y(function(){a++;let F=Iy(P,arguments);return m=x.apply(null,F),m},...C);return Object.assign(M,{resultFunc:p,memoizedResultFunc:x,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var ye=Nu(ur),Oy=Object.assign((e,t=ye)=>{xy(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>Oy});d();c();l();u();function _u(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Vu=_u(),Uu=_u;var Ty=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ir:ir.apply(null,arguments)},BE=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Dy=e=>e&&typeof e.match=="function";function O(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Pe(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ar(n)&&n.type===e,r}var Wu=class hn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,hn.prototype)}static get[Symbol.species](){return hn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new hn(...t[0].concat(this)):new hn(...t.concat(this))}};function Lu(e){return je(e)?nt(e,()=>{}):e}function Qu(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function qy(e){return typeof e=="boolean"}var jy=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Wu;return r&&(qy(r)?a.push(Vu):a.push(Uu(r.extraArgument))),a},Sn="RTK_autoBatch",pr=()=>e=>({payload:e,meta:{[Sn]:!0}}),Bu=e=>t=>{setTimeout(t,e)},My=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Bu(10):e.type==="callback"?e.queueNotification:Bu(e.timeout),p=()=>{a=!1,i&&(i=!1,m.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let h=()=>o&&g(),S=n.subscribe(h);return m.add(g),()=>{S(),m.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Sn],i=!o,i&&(a||(a=!0,f(p))),n.dispatch(g)}finally{o=!0}}})},Ny=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Wu(e);return n&&o.push(My(typeof n=="object"?n:void 0)),o};function Ku(e){let t=jy(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(Ke(r))m=or(r);else throw new Error(Pe(1));let f;typeof n=="function"?f=n(t):f=t();let p=ir;o&&(p=Ty({trace:!1,...(typeof o=="object"&&o)}));let g=bu(...f),h=Ny(g),S=typeof a=="function"?a(h):h(),y=p(...S);return ba(m,i,y)}function Yu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error(Pe(28));if(m in t)throw new Error(Pe(29));return t[m]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function _y(e){return typeof e=="function"}function me(e,t){let[r,n,o]=Yu(t),i;if(_y(e))i=()=>Lu(e());else{let m=Lu(e);i=()=>m}function a(m=i(),f){let p=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return p.filter(g=>!!g).length===0&&(p=[o]),p.reduce((g,h)=>{if(h)if(Ne(g)){let y=h(g,f);return y===void 0?g:y}else{if(je(g))return nt(g,S=>h(S,f));{let S=h(g,f);if(S===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return g},m)}return a.getInitialState=i,a}var Ju=(e,t)=>Dy(e)?e.match(t):e(t);function Ye(...e){return t=>e.some(r=>Ju(r,t))}function dr(...e){return t=>e.every(r=>Ju(r,t))}function Ao(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 vn(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function wo(...e){return e.length===0?t=>Ao(t,["pending"]):vn(e)?Ye(...e.map(t=>t.pending)):wo()(e[0])}function Lt(...e){return e.length===0?t=>Ao(t,["rejected"]):vn(e)?Ye(...e.map(t=>t.rejected)):Lt()(e[0])}function An(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?dr(Lt(...e),t):vn(e)?dr(Lt(...e),t):An()(e[0])}function ot(...e){return e.length===0?t=>Ao(t,["fulfilled"]):vn(e)?Ye(...e.map(t=>t.fulfilled)):ot()(e[0])}function bo(...e){return e.length===0?t=>Ao(t,["pending","fulfilled","rejected"]):vn(e)?Ye(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):bo()(e[0])}var Vy="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",wn=(e=21)=>{let t="",r=e;for(;r--;)t+=Vy[Math.random()*64|0];return t},Uy=["name","message","stack","code"],Ma=class{constructor(e,t){ue(this,"_type");this.payload=e,this.meta=t}},$u=class{constructor(e,t){ue(this,"_type");this.payload=e,this.meta=t}},Ly=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Uy)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ce=(()=>{function e(t,r,n){let o=O(t+"/fulfilled",(f,p,g,h)=>({payload:f,meta:{...(h||{}),arg:g,requestId:p,requestStatus:"fulfilled"}})),i=O(t+"/pending",(f,p,g)=>({payload:void 0,meta:{...(g||{}),arg:p,requestId:f,requestStatus:"pending"}})),a=O(t+"/rejected",(f,p,g,h,S)=>({payload:h,error:(n&&n.serializeError||Ly)(f||"Rejected"),meta:{...(S||{}),arg:g,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(p,g,h)=>{let S=n?.idGenerator?n.idGenerator(f):wn(),y=new s.AbortController,v,R;function I(P){R=P,y.abort()}let C=_asyncToGenerator(function*(){let P;try{let E=n?.condition?.(f,{getState:g,extra:h});if(By(E)&&(E=yield E),E===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((T,F)=>{v=()=>{F({name:"AbortError",message:R||"Aborted"})},y.signal.addEventListener("abort",v)});p(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:g,extra:h}))),P=yield Promise.race([M,Promise.resolve(r(f,{dispatch:p,getState:g,extra:h,requestId:S,signal:y.signal,abort:I,rejectWithValue:(T,F)=>new Ma(T,F),fulfillWithValue:(T,F)=>new $u(T,F)})).then(T=>{if(T instanceof Ma)throw T;return T instanceof $u?o(T.payload,S,f,T.meta):o(T,S,f)})])}catch(E){P=E instanceof Ma?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{v&&y.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P})();return Object.assign(C,{abort:I,requestId:S,arg:f,unwrap(){return C.then(Qy)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ye(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Qy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function By(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Xu=Symbol.for("rtk-slice-createasyncthunk"),WE={[Xu]:ce};function $y(e,t){return`${e}/${t}`}function Hy({creators:e}={}){let t=e?.asyncThunk?.[Xu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Pe(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(zy()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,x){let E=typeof P=="string"?P:P.type;if(!E)throw new Error(Pe(12));if(E in f.sliceCaseReducersByType)throw new Error(Pe(13));return f.sliceCaseReducersByType[E]=x,p},addMatcher(P,x){return f.sliceMatchers.push({matcher:P,reducer:x}),p},exposeAction(P,x){return f.actionCreators[P]=x,p},exposeCaseReducer(P,x){return f.sliceCaseReducersByName[P]=x,p}};m.forEach(P=>{let x=a[P],E={reducerName:P,type:$y(o,P),createNotation:typeof n.reducers=="function"};Ky(x)?Jy(E,x,p,t):Wy(E,x,p)});function g(){let[P={},x=[],E=void 0]=typeof n.extraReducers=="function"?Yu(n.extraReducers):[n.extraReducers],M={...P,...f.sliceCaseReducersByType};return me(n.initialState,T=>{for(let F in M)T.addCase(F,M[F]);for(let F of f.sliceMatchers)T.addMatcher(F.matcher,F.reducer);for(let F of x)T.addMatcher(F.matcher,F.reducer);E&&T.addDefaultCase(E)})}let h=P=>P,S=new Map,y;function v(P,x){return y||(y=g()),y(P,x)}function R(){return y||(y=g()),y.getInitialState()}function I(P,x=!1){function E(T){let F=T[P];return typeof F>"u"&&x&&(F=R()),F}function M(T=h){let F=Qu(S,x,()=>new WeakMap);return Qu(F,T,()=>{let k={};for(let[D,_]of Object.entries(n.selectors??{}))k[D]=Gy(_,T,R,x);return k})}return{reducerPath:P,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let C={name:o,reducer:v,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:R,...I(i),injectInto(P,{reducerPath:x,...E}={}){let M=x??i;return P.inject({reducerPath:M,reducer:v},E),{...C,...I(M,!0)}}};return C}}function Gy(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Qt=Hy();function zy(){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 Wy({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Yy(n))throw new Error(Pe(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?O(e,a):O(e))}function Ky(e){return e._reducerDefinitionType==="asyncThunk"}function Yy(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Jy({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Pe(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:p,options:g}=r,h=o(e,i,g);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||ho,pending:m||ho,rejected:f||ho,settled:p||ho})}function ho(){}var Xy="task",Zu="listener",el="completed",Va="cancelled",Zy=`task-${Va}`,eh=`task-${el}`,Na=`${Zu}-${Va}`,th=`${Zu}-${el}`,Co=class{constructor(e){ue(this,"name","TaskAbortError");ue(this,"message");this.code=e,this.message=`${Xy} ${Va} (reason: ${e})`}},Ua=(e,t)=>{if(typeof e!="function")throw new TypeError(Pe(32))},So=()=>{},tl=(e,t=So)=>(e.catch(t),e),rl=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Vt=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Ut=e=>{if(e.aborted){let{reason:t}=e;throw new Co(t)}};function nl(e,t){let r=So;return new Promise((n,o)=>{let i=()=>o(new Co(e.reason));if(e.aborted){i();return}r=rl(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=So})}var rh=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Co?"cancelled":"rejected",error:r}}finally{t?.()}});return function rh(_x4,_x5){return _ref5.apply(this,arguments)}}(),vo=e=>t=>tl(nl(e,t).then(r=>(Ut(e),r))),ol=e=>{let t=vo(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:lr}=Object,Hu={},xo="listenerMiddleware",nh=(e,t)=>{let r=n=>rl(e,()=>Vt(n,e.reason));return(n,o)=>{Ua(n,"taskExecutor");let i=new s.AbortController;r(i);let a=rh(/*#__PURE__*/_asyncToGenerator(function*(){Ut(e),Ut(i.signal);let m=yield n({pause:vo(i.signal),delay:ol(i.signal),signal:i.signal});return Ut(i.signal),m}),()=>Vt(i,eh));return o?.autoJoin&&t.push(a.catch(So)),{result:vo(e)(a),cancel(){Vt(i,Zy)}}}},oh=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Ut(t);let i=()=>{},m=[new Promise((f,p)=>{let g=e({predicate:n,effect:(h,S)=>{S.unsubscribe(),f([h,S.getState(),S.getOriginalState()])}});i=()=>{g(),p()}})];o!=null&&m.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield nl(t,Promise.race(m));return Ut(t),f}finally{i()}});return function r(_x6,_x7){return _ref7.apply(this,arguments)}}();return(n,o)=>tl(r(n,o))},il=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=O(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Pe(21));return Ua(i,"options.listener"),{predicate:o,type:t,effect:i}},al=lr(e=>{let{type:t,predicate:r,effect:n}=il(e);return{id:wn(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Pe(22))}}},{withTypes:()=>al}),Gu=(e,t)=>{let{type:r,effect:n,predicate:o}=il(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},_a=e=>{e.pending.forEach(t=>{Vt(t,Na)})},ih=e=>()=>{e.forEach(_a),e.clear()},zu=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},sl=lr(O(`${xo}/add`),{withTypes:()=>sl}),ah=O(`${xo}/removeAll`),cl=lr(O(`${xo}/remove`),{withTypes:()=>cl}),sh=(...e)=>{console.error(`${xo}/error`,...e)},ul=(e={})=>{let t=new Map,{extra:r,onError:n=sh}=e;Ua(n,"onError");let o=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),h=>{g.unsubscribe(),h?.cancelActive&&_a(g)}),i=g=>{let h=Gu(t,g)??al(g);return o(h)};lr(i,{withTypes:()=>i});let a=g=>{let h=Gu(t,g);return h&&(h.unsubscribe(),g.cancelActive&&_a(h)),!!h};lr(a,{withTypes:()=>a});let m=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,h,S,y){let v=new s.AbortController,R=oh(i,v.signal),I=[];try{g.pending.add(v),yield Promise.resolve(g.effect(h,lr({},S,{getOriginalState:y,condition:(C,P)=>R(C,P).then(Boolean),take:R,delay:ol(v.signal),pause:vo(v.signal),extra:r,signal:v.signal,fork:nh(v.signal,I),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((C,P,x)=>{C!==v&&(Vt(C,Na),x.delete(C))})},cancel:()=>{Vt(v,Na),g.pending.delete(v)},throwIfCancelled:()=>{Ut(v.signal)}})))}catch(C){C instanceof Co||zu(n,C,{raisedBy:"effect"})}finally{yield Promise.all(I),Vt(v,th),g.pending.delete(v)}});return function m(_x8,_x9,_x0,_x1){return _ref8.apply(this,arguments)}}(),f=ih(t);return{middleware:g=>h=>S=>{if(!ar(S))return h(S);if(sl.match(S))return i(S.payload);if(ah.match(S)){f();return}if(cl.match(S))return a(S.payload);let y=g.getState(),v=()=>{if(y===Hu)throw new Error(Pe(23));return y},R;try{if(R=h(S),t.size>0){let I=g.getState(),C=Array.from(t.values());for(let P of C){let x=!1;try{x=P.predicate(S,I,y)}catch(E){x=!1,zu(n,E,{raisedBy:"predicate"})}x&&m(P,S,g,v)}}}finally{y=Hu}return R},startListening:i,stopListening:a,clearListeners:f}};var YE=Symbol.for("rtk-state-proxy-original");function Pe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();var W=new $({required:!0,emptyAllowed:!1}),Ce=new $({required:!1,emptyAllowed:!1}),xe=new $({required:!0,emptyAllowed:!0}),cI=new $({required:!1,emptyAllowed:!0}),Ro=new oe({each:W,required:!0}),ll=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),dl=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),uI=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),it=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ue=(e,t)=>{if("required"in t)return{payload:new Te({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new on(o);return{payload:e}},N=(e,t)=>{try{return Ue(e,t)}catch(r){return{payload:e,error:it(r)}}},pl=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return ml(e,t,r,o,"Controller initialization error")},fl=(e,t,r,n)=>{let o=`Check the options of ${n}`;return ml(e,t,r,o,"Controller initialization error")},ml=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var fr="3.45.0",gl=["@coveo/atomic","@coveo/quantic"];var La=()=>Ce,yl=()=>W,yt=O("configuration/updateBasicConfiguration",e=>N(e,{accessToken:Ce,environment:new $({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Je=O("configuration/updateSearchConfiguration",e=>N(e,{proxyBaseUrl:new $({required:!1,url:!0}),pipeline:new $({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new oe({required:!1,each:W})})),ch={enabled:new ee({default:!0}),originContext:La(),originLevel2:La(),originLevel3:La(),proxyBaseUrl:new $({required:!1,url:!0}),runtimeEnvironment:new pe,anonymous:new ee({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:dl,analyticsMode:new $({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:gl.reduce((e,t)=>(e[t]=ll,e),{})})},mr=O("configuration/updateAnalyticsConfiguration",e=>N(e,ch)),gr=O("configuration/analytics/disable"),yr=O("configuration/analytics/enable"),Eo=O("configuration/analytics/originlevel2",e=>N(e,{originLevel2:yl()})),Io=O("configuration/analytics/originlevel3",e=>N(e,{originLevel3:yl()})),hl=O("knowledge/setAgentId",e=>N(e,new $({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Sl={q:new $,enableQuerySyntax:new ee,aq:new $,cq:new $,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new $,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ee,sf:new K,tab:new $,af:new K};var ht=O("searchParameters/restore",e=>N(e,Sl)),vl=O("searchParameters/restoreTab",e=>N(e,W));d();c();l();u();var Fo=O("debug/enable"),Po=O("debug/disable");d();c();l();u();var ko=()=>!1;var Oo=me(ko(),e=>{e.addCase(Fo,()=>!0).addCase(Po,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var hr=O("pipeline/set",e=>N(e,new $({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var uh=O("history/undo"),lh=O("history/redo"),Xe=O("history/snapshot"),SF=ce("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(uh()),yield t(Me())});return function(_x10,_x11){return _ref9.apply(this,arguments)}}()),vF=ce("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(lh()),yield t(Me())});return function(_x12,_x13){return _ref0.apply(this,arguments)}}()),Me=ce("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x14,_x15){return _ref1.apply(this,arguments)}}());d();c();l();u();var Sr=()=>"";var vr=me(Sr(),e=>{e.addCase(hr,(t,r)=>r.payload).addCase(Me.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Je,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var To=O("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ar=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||p.test(m)||m.indexOf(".")===-1?Qa(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Qa(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Qa(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function dh(){return typeof navigator<"u"}function Al(){try{return typeof localStorage<"u"}catch{return!1}}function wl(){try{return typeof sessionStorage<"u"}catch{return!1}}function bl(){return!!(dh()&&navigator.cookieEnabled)}var Cl=null;function xl(){return Cl||(Al()?localStorage:bl()?new Ba:wl()?sessionStorage:new $a)}var wr=class wr{getItem(t){return Ar.get(`${wr.prefix}${t}`)}removeItem(t){Ar.erase(`${wr.prefix}${t}`)}setItem(t,r,n){Ar.set(`${wr.prefix}${t}`,r,n)}};ue(wr,"prefix","coveo_");var Ba=wr;var $a=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Do="__coveo.analytics.history",ph=20,fh=1e3*60,mh=75,Bt=class Bt{constructor(t){ue(this,"store");this.store=t||xl()}static getInstance(t){return Bt.instance||(Bt.instance=new Bt(t)),Bt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Do);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Do);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Do,JSON.stringify(t.slice(0,ph)))}catch{}}clear(){try{this.store.removeItem(Do)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,mh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>fh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};ue(Bt,"instance",null);var Ha=Bt,Le=Ha;d();c();l();u();d();c();l();u();var br=ye(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${fr}`));d();c();l();u();d();c();l();u();function at(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function q(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{p(n.next(g))}catch(h){a(h)}}function f(g){try{p(n.throw(g))}catch(h){a(h)}}function p(g){g.done?i(g.value):o(g.value).then(m,f)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function Wa(){return typeof window<"u"}function ss(){return typeof navigator<"u"}function Cr(){return typeof document<"u"}function Ka(){try{return typeof localStorage<"u"}catch{return!1}}function gh(){try{return typeof sessionStorage<"u"}catch{return!1}}function _l(){return ss()&&navigator.cookieEnabled}var yh=[ae.click,ae.custom,ae.search,ae.view],hh=(e,t)=>yh.indexOf(e)!==-1?Object.assign({language:Cr()?document.documentElement.lang:"unknown",userAgent:ss()?navigator.userAgent:"unknown"},t):t,Cn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?Rl(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Rl(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Rl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Sh(){return Ka()?localStorage:_l()?new xn:gh()?sessionStorage:new Rr}var xn=class e{getItem(t){return Cn.get(`${e.prefix}${t}`)}removeItem(t){Cn.erase(`${e.prefix}${t}`)}setItem(t,r,n){Cn.set(`${e.prefix}${t}`,r,n)}};xn.prefix="coveo_";var Ya=class{constructor(){this.cookieStorage=new xn}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){}},qo="__coveo.analytics.history",vh=20,Ah=1e3*60,wh=75,No=class{constructor(t){this.store=t||Sh()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(qo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(qo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(qo,JSON.stringify(t.slice(0,vh)))}catch{}}clear(){try{this.store.removeItem(qo)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,wh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Ah:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var bh=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Ch(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Ch=e=>q(void 0,void 0,void 0,function*(){let t=new No,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),jo,xh=new Uint8Array(16);function Rh(){if(!jo&&(jo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jo(xh)}var Eh=/^(?:[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 _o(e){return typeof e=="string"&&Eh.test(e)}var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function Vl(e,t=0){return Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]}function Ih(e){if(!_o(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 Fh(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Ph="6ba7b810-9dad-11d1-80b4-00c04fd430c8",kh="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Oh(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=Fh(o)),typeof i=="string"&&(i=Ih(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){m=m||0;for(let g=0;g<16;++g)a[m+g]=p[g];return a}return Vl(p)}try{n.name=e}catch{}return n.DNS=Ph,n.URL=kh,n}var Th=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),El={randomUUID:Th};function $t(e,t,r){if(El.randomUUID&&!t&&!e)return El.randomUUID();e=e||{};let n=e.random||(e.rng||Rh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Vl(n)}function Dh(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 Ga(e,t){return e<<t|e>>>32-t}function qh(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let m=0;m<a.length;++m)e.push(a.charCodeAt(m))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let m=new Uint32Array(80);for(let y=0;y<16;++y)m[y]=i[a][y];for(let y=16;y<80;++y)m[y]=Ga(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let f=r[0],p=r[1],g=r[2],h=r[3],S=r[4];for(let y=0;y<80;++y){let v=Math.floor(y/20),R=Ga(f,5)+Dh(v,p,g,h)+S+t[v]+m[y]>>>0;S=h,h=g,g=Ga(p,30)>>>0,p=f,f=R}r[0]=r[0]+f>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var jh=Oh("v5",80,qh),Il=jh,Ul="2.30.52",Fl=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,bn={pageview:"pageview",event:"event"},Vo=class{constructor({client:t,uuidGenerator:r=$t}){this.client=t,this.uuidGenerator=r}},Ja=class extends Vo{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Fl(window.location),this.lastReferrer=Cr()?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:Cr()?document.title:"",encoding:Cr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===bn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===bn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===bn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===bn.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Fl(window.location)}},St=class e{constructor(t,r){if(!_o(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return _o(i)?new e(i,Number.parseInt(o)*1e3):null}};St.cvo_cid="cvo_cid";St.expirationTime=120;var Xa=class extends Vo{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(St.cvo_cid,new St(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Xa.Id="link";var Be=Object.keys;function Mo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var za=128,Ll=192,Pl=224,kl=240;function Mh(e){return(e&248)===kl?4:(e&kl)===Pl?3:(e&Pl)===Ll?2:1}function Nh(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&za)!=za)break;if(r-=3,(n&Ll)!=za){t-r>=Mh(n)*3&&(r=t);break}}return e.substring(0,r)}var Za={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"},_h=Be(Za).map(e=>Za[e]),Vh=[..._h].join("|"),Uh=new RegExp(`^(${Vh}$)`),Lh={svcAction:"svc_action",svcActionData:"svc_action_data"},Qh=e=>Be(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Za[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Bh=e=>Uh.test(e),$h=[Bh],Ol={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Tl={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ie={action:"pa",list:"pal",listSource:"pls"},Uo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Hh=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],es={id:"quoteId",affiliation:"quoteAffiliation"},ts={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Gh={add:Ie,bookmark_add:Ie,bookmark_remove:Ie,click:Ie,checkout:Ie,checkout_option:Ie,detail:Ie,impression:Ie,remove:Ie,refund:Object.assign(Object.assign({},Ie),Uo),purchase:Object.assign(Object.assign({},Ie),Uo),quickview:Ie,quote:Object.assign(Object.assign({},Ie),es),review:Object.assign(Object.assign({},Ie),ts)},zh=Be(Ol).map(e=>Ol[e]),Wh=Be(Tl).map(e=>Tl[e]),Kh=Be(Ie).map(e=>Ie[e]),Yh=Be(Uo).map(e=>Uo[e]),Jh=Be(ts).map(e=>ts[e]),Xh=Be(es).map(e=>es[e]),Zh=[...zh,"custom"].join("|"),eS=[...Wh,"custom"].join("|"),Ql="(pr[0-9]+)",Bl="(il[0-9]+pi[0-9]+)",tS=new RegExp(`^${Ql}(${Zh})$`),rS=new RegExp(`^(${Bl}(${eS}))|(il[0-9]+nm)$`),nS=new RegExp(`^(${Kh.join("|")})$`),oS=new RegExp(`^(${Yh.join("|")})$`),iS=new RegExp(`^${Ql}custom$`),aS=new RegExp(`^${Bl}custom$`),sS=new RegExp(`^(${[...Hh,...Jh,...Xh].join("|")})$`),cS=e=>tS.test(e),uS=e=>rS.test(e),lS=e=>nS.test(e),dS=e=>oS.test(e),pS=e=>sS.test(e),fS=[uS,cS,lS,dS,pS],mS=[iS,aS],gS={anonymizeIp:"aip"},yS={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},hS={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},SS=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],vS=Object.assign(Object.assign(Object.assign(Object.assign({},gS),yS),hS),SS.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),rs=Object.assign(Object.assign({},vS),Lh),AS=e=>{let t=!!e.action&&Gh[e.action]||{};return Be(e).reduce((r,n)=>{let o=t[n]||rs[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},wS=Be(rs).map(e=>rs[e]),bS=e=>wS.indexOf(e)!==-1,CS=e=>e==="custom",xS=e=>[...fS,...$h,bS,CS].some(t=>t(e)),RS=e=>Be(e).reduce((t,r)=>{let n=ES(r);return n?Object.assign(Object.assign({},t),IS(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ES=e=>{let t;return[...mS].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},IS=(e,t)=>Be(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),ns=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),p=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},os=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},Dl=A.fetch,Lo=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:p}=f,g=at(f,["url"]),h;try{h=yield Dl(p,g)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Dl(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},is=class{constructor(t,r){Ka()&&_l()?this.storage=new Ya:Ka()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Rr),this.client=new Lo(t),this.beaconClient=new ns(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},as=class{constructor(t,r){this.storage=r||new Rr,this.client=new Lo(t)}getClientDependingOnEventType(t){return this.client}},Qo=class{constructor(){this.storage=new Rr,this.client=new os}getClientDependingOnEventType(t){return this.client}},FS="xx",PS=e=>e?.startsWith(FS)||!1,kS=`
26
+ `;return new si(r)}var si=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},lt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw cA(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}},Oe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ie(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 We(e){return e===void 0}function uA(e){return e===null}function ie(e){return We(e)||uA(e)}var ue=class{constructor(e={}){xe(this,"value");this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(lA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function lA(e){return We(e)||Zp(e)}function Zp(e){return typeof e=="boolean"}var te=class{constructor(e={}){xe(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(dA(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 dA(e){return We(e)||ef(e)}function ef(e){return typeof e=="number"&&!Number.isNaN(e)}var pA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){xe(this,"value");xe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Oe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(We(e))return null;if(!ua(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(pA.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 ua(e){return Object.prototype.toString.call(e)==="[object String]"}var ee=class{constructor(e={}){xe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(We(e))return this.config.options.required?"value is required and is currently undefined":null;if(!tf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ie(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function tf(e){return e!==void 0&&typeof e=="object"}var ge=class{constructor(e={}){xe(this,"value");this.config=e,this.value=new Oe(this.config)}validate(e){if(!ie(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ie(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&&ie(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Zp(e)||ua(e)||ef(e)||tf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function rf(e){return Array.isArray(e)}var Pu=class{constructor(e){xe(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:We(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();f();p();function nf(e){return Array.isArray(e)}function la(e){return e.trim()===""}var fA=new Set(["1",1,"yes",!0]);function of(){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=>fA.has(r))}function af(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ci(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function da(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function mA(e){if(la(e.openingDelimiter)||la(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ie(e.content)||la(e.content))return e.content;if(e.highlights.length===0)return Un(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Un(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Un(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Un(e.content.slice(n))),r}function gA(e,t){return e=Un(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Nu(n,t.notMatchDelimiters):o?Nu(o,t.exactMatchDelimiters):i?Nu(i,t.correctionDelimiters):r)}function Nu(e,t){return t?t.open+e+t.close:e}function Un(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var vf=_t(mf(),1);m();d();f();p();var Mt=new Error("Failed to load reducers."),Vn=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."}},$r=class extends Error{constructor(r,n){super();xe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function gf(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function hf(e){return typeof e!="object"||!e?!1:Object.values(e).every(VA)}function VA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function yf(e){return e===429}var kt=class e{static call(t){return _asyncToGenerator(function*(){let r=GA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield A(i,a);if(yf(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,vf.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&yf(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Vn;case 404:throw new $r(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new $r(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=ci(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function Be(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pr(e,t="prod"){return`${Be(e,t)}/rest/search/v2`}function fa(e,t="prod"){return`${Be(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function GA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=BA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function BA(e,t){return t==="application/x-www-form-urlencoded"?hf(e)?gf(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var ma=e=>e;m();d();f();p();m();d();f();p();function ga(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function jt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ga(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ga(),extendedResults:{},searchAction:void 0}}m();d();f();p();function fr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mr=e=>{let{response:t}=e;return t.body?$A(e):QA(t)},$A=e=>zA(e)?WA(e):HA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},QA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function HA(e){return e.body.statusCode!==void 0}function zA(e){return e.body.exception!==void 0}var WA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var gr=class{constructor(){xe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();f();p();m();d();f();p();var di=class{constructor(t){xe(this,"_basePath");xe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();f();p();function Sf(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var Xt=(e,t,r,n)=>{let o=new di(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var wf=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield kt.call({...Xt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:fr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Sf(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return KA(a)?{success:a}:{error:mr({response:r,body:a})}});return function wf(_x3,_x4){return _ref3.apply(this,arguments)}}();function KA(e){return typeof e=="string"}m();d();f();p();function YA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function XA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ha(e,t){if(t&&e.name==="AbortError")return{error:XA(e)};if(e instanceof $r)return{error:YA(e)};throw e}var ya=class{constructor(t){this.options=t;xe(this,"apiCallsQueues",{unknown:new gr,mainSearch:new gr,facetValues:new gr,foldingCollection:new gr,instantResults:new gr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/plan"),requestParams:fr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return ha(r);let n=yield r.json();return ZA(n)?{success:n}:{error:mr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:fr(t),..._this3.options});if(r instanceof Error)return ha(r);let n=yield r.json(),o={response:r,body:n};return JA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>kt.call({...Xt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return ha(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return Af(i)?(a.body=bf(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/facet"),requestParams:fr(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Af(n)){let o={response:r,body:n};return o.body=bf(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return wf(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return eb(n)?{success:n}:{error:mr({response:r,body:n})}})()}},va=e=>e.success!==void 0,dt=e=>e.error!==void 0;function Af(e){return e.results!==void 0}function bf(e){let t=ga();return ie(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function JA(e){return e.completions!==void 0}function ZA(e){return e.preprocessingOutput!==void 0}function eb(e){return e.fields!==void 0}m();d();f();p();var xf=e=>e,Cf=e=>e,Ef=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ke(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 tb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rf=tb,Bu=()=>Math.random().toString(36).substring(7).split("").join("."),rb={INIT:`@@redux/INIT${Bu()}`,REPLACE:`@@redux/REPLACE${Bu()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bu()}`},Sa=rb;function qt(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 $u(e,t,r){if(typeof e!="function")throw new Error(Ke(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ke(1));return r($u)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((E,C)=>{a.set(C,E)}))}function h(){if(c)throw new Error(Ke(3));return o}function v(E){if(typeof E!="function")throw new Error(Ke(4));if(c)throw new Error(Ke(5));let C=!0;u();let I=s++;return a.set(I,E),function(){if(C){if(c)throw new Error(Ke(6));C=!1,u(),a.delete(I),i=null}}}function S(E){if(!qt(E))throw new Error(Ke(7));if(typeof E.type>"u")throw new Error(Ke(8));if(typeof E.type!="string")throw new Error(Ke(17));if(c)throw new Error(Ke(9));try{c=!0,o=n(o,E)}finally{c=!1}return(i=a).forEach(I=>{I()}),E}function g(E){if(typeof E!="function")throw new Error(Ke(10));n=E,S({type:Sa.REPLACE})}function y(){let E=v;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Ke(11));function I(){let _=C;_.next&&_.next(h())}return I(),{unsubscribe:E(I)}},[Rf](){return this}}}return S({type:Sa.INIT}),{dispatch:S,subscribe:v,getState:h,replaceReducer:g,[Rf]:y}}function nb(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Sa.INIT})>"u")throw new Error(Ke(12));if(typeof r(void 0,{type:Sa.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function Gn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{nb(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let v=0;v<n.length;v++){let S=n[v],g=r[S],y=s[S],x=g(y,c);if(typeof x>"u"){let E=c&&c.type;throw new Error(Ke(14))}h[S]=x,u=u||x!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function Bn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function If(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ke(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=Bn(...s)(o.dispatch),{...o,dispatch:i}}}function $n(e){return qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var el=Symbol.for("immer-nothing"),pi=Symbol.for("immer-draftable"),pt=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Qn=Object.getPrototypeOf;function vt(e){return!!e&&!!e[pt]}function ft(e){return e?Nf(e)||Array.isArray(e)||!!e[pi]||!!e.constructor?.[pi]||Hn(e)||vi(e):!1}var ob=Object.prototype.constructor.toString(),Tf=new WeakMap;function Nf(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Tf.get(r);return n===void 0&&(n=Function.toString.call(r),Tf.set(r,n)),n===ob}function tl(e){return vt(e)||Ye(15,e),e[pt].base_}function fi(e,t,r=!0){Hr(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Hr(e){let t=e[pt];return t?t.type_:Array.isArray(e)?1:Hn(e)?2:vi(e)?3:0}function mi(e,t){return Hr(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qu(e,t){return Hr(e)===2?e.get(t):e[t]}function Ff(e,t,r){let n=Hr(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function ib(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hn(e){return e instanceof Map}function vi(e){return e instanceof Set}function Qr(e){return e.copy_||e.base_}function Wu(e,t){if(Hn(e))return new Map(e);if(vi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Nf(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[pt];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Qn(e),n)}else{let n=Qn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function xa(e,t=!1){return Ca(e)||vt(e)||!ft(e)||(Hr(e)>1&&Object.defineProperties(e,{set:wa,add:wa,clear:wa,delete:wa}),Object.freeze(e),t&&Object.values(e).forEach(r=>xa(r,!0))),e}function ab(){Ye(2)}var wa={value:ab};function Ca(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ku={};function zr(e){let t=Ku[e];return t||Ye(0,e),t}function sb(e,t){Ku[e]||(Ku[e]=t)}var gi;function Df(){return gi}function cb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function _f(e,t){t&&(zr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yu(e){Xu(e),e.drafts_.forEach(ub),e.drafts_=null}function Xu(e){e===gi&&(gi=e.parent_)}function kf(e){return gi=cb(gi,e)}function ub(e){let t=e[pt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Of(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[pt].modified_&&(Yu(t),Ye(4)),ft(e)&&(e=Aa(t,e),t.parent_||ba(t,e)),t.patches_&&zr("Patches").generateReplacementPatches_(r[pt].base_,e,t.patches_,t.inversePatches_)):e=Aa(t,r,[]),Yu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==el?e:void 0}function Aa(e,t,r){if(Ca(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[pt];if(!o)return fi(t,(i,a)=>Pf(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return ba(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),fi(a,(c,u)=>Pf(e,o,i,c,u,r,s),n),ba(e,i,!1),r&&e.patches_&&zr("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Pf(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let s=Ca(o);if(!(s&&!a)){if(vt(o)){let c=i&&t&&t.type_!==3&&!mi(t.assigned_,n)?i.concat(n):void 0,u=Aa(e,o,c);if(Ff(r,n,u),vt(u))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(ft(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&s)return;Aa(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Hn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ba(e,o)}}}function ba(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xa(t,r)}function lb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Df(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=rl;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}var rl={get(e,t){if(t===pt)return e;let r=Qr(e);if(!mi(r,t))return db(e,r,t);let n=r[t];return e.finalized_||!ft(n)?n:n===Hu(e.base_,t)?(zu(e),e.copy_[t]=Zu(n,e)):n},has(e,t){return t in Qr(e)},ownKeys(e){return Reflect.ownKeys(Qr(e))},set(e,t,r){let n=Mf(Qr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Hu(Qr(e),t),i=o?.[pt];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ib(r,o)&&(r!==void 0||mi(e.base_,t)))return!0;zu(e),Ju(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 Hu(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zu(e),Ju(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Qr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return Qn(e.base_)},setPrototypeOf(){Ye(12)}},hi={};fi(rl,(e,t)=>{hi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return rl.set.call(this,e[0],t,r,e[0])};function Hu(e,t){let r=e[pt];return(r?Qr(r):e)[t]}function db(e,t,r){let n=Mf(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Mf(e,t){if(!(t in e))return;let r=Qn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Qn(r)}}function Ju(e){e.modified_||(e.modified_=!0,e.parent_&&Ju(e.parent_))}function zu(e){e.copy_||(e.copy_=Wu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(ft(t)){let i=kf(this),a=Zu(t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Yu(i):Xu(i)}return _f(i,n),Of(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===el&&(o=void 0),this.autoFreeze_&&xa(o,!0),n){let i=[],a=[];zr("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ft(e)||Ye(8),vt(e)&&(e=jf(e));let t=kf(this),r=Zu(e,void 0);return r[pt].isManual_=!0,Xu(t),r}finishDraft(e,t){let r=e&&e[pt];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return _f(n,t),Of(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=zr("Patches").applyPatches_;return vt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Zu(e,t){let r=Hn(e)?zr("MapSet").proxyMap_(e,t):vi(e)?zr("MapSet").proxySet_(e,t):lb(e,t);return(t?t.scope_:Df()).drafts_.push(r),r}function jf(e){return vt(e)||Ye(10,e),qf(e)}function qf(e){if(!ft(e)||Ca(e))return e;let t=e[pt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Wu(e,!0);return fi(r,(o,i)=>{Ff(r,o,qf(i))},n),t&&(t.finalized_=!1),r}function Lf(){let t="replace",r="add",n="remove";function o(S,g,y,x){switch(S.type_){case 0:case 2:return a(S,g,y,x);case 1:return i(S,g,y,x);case 3:return s(S,g,y,x)}}function i(S,g,y,x){let{base_:E,assigned_:C}=S,I=S.copy_;I.length<E.length&&([E,I]=[I,E],[y,x]=[x,y]);for(let T=0;T<E.length;T++)if(C[T]&&I[T]!==E[T]){let _=g.concat([T]);y.push({op:t,path:_,value:v(I[T])}),x.push({op:t,path:_,value:v(E[T])})}for(let T=E.length;T<I.length;T++){let _=g.concat([T]);y.push({op:r,path:_,value:v(I[T])})}for(let T=I.length-1;E.length<=T;--T){let _=g.concat([T]);x.push({op:n,path:_})}}function a(S,g,y,x){let{base_:E,copy_:C}=S;fi(S.assigned_,(I,T)=>{let _=Qu(E,I),q=Qu(C,I),N=T?mi(E,I)?t:r:n;if(_===q&&N===t)return;let k=g.concat(I);y.push(N===n?{op:N,path:k}:{op:N,path:k,value:q}),x.push(N===r?{op:n,path:k}:N===n?{op:r,path:k,value:v(_)}:{op:t,path:k,value:v(_)})})}function s(S,g,y,x){let{base_:E,copy_:C}=S,I=0;E.forEach(T=>{if(!C.has(T)){let _=g.concat([I]);y.push({op:n,path:_,value:T}),x.unshift({op:r,path:_,value:T})}I++}),I=0,C.forEach(T=>{if(!E.has(T)){let _=g.concat([I]);y.push({op:r,path:_,value:T}),x.unshift({op:n,path:_,value:T})}I++})}function c(S,g,y,x){y.push({op:t,path:[],value:g===el?void 0:g}),x.push({op:t,path:[],value:S})}function u(S,g){return g.forEach(y=>{let{path:x,op:E}=y,C=S;for(let q=0;q<x.length-1;q++){let N=Hr(C),k=x[q];typeof k!="string"&&typeof k!="number"&&(k=""+k),(N===0||N===1)&&(k==="__proto__"||k==="constructor")&&Ye(19),typeof C=="function"&&k==="prototype"&&Ye(19),C=Qu(C,k),typeof C!="object"&&Ye(18,x.join("/"))}let I=Hr(C),T=h(y.value),_=x[x.length-1];switch(E){case t:switch(I){case 2:return C.set(_,T);case 3:Ye(16);default:return C[_]=T}case r:switch(I){case 1:return _==="-"?C.push(T):C.splice(_,0,T);case 2:return C.set(_,T);case 3:return C.add(T);default:return C[_]=T}case n:switch(I){case 1:return C.splice(_,1);case 2:return C.delete(_);case 3:return C.delete(y.value);default:return delete C[_]}default:Ye(17,E)}}),S}function h(S){if(!ft(S))return S;if(Array.isArray(S))return S.map(h);if(Hn(S))return new Map(Array.from(S.entries()).map(([y,x])=>[y,h(x)]));if(vi(S))return new Set(Array.from(S).map(h));let g=Object.create(Qn(S));for(let y in S)g[y]=h(S[y]);return mi(S,pi)&&(g[pi]=S[pi]),g}function v(S){return vt(S)?h(S):S}sb("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var yi=new pb,Jt=yi.produce,Ea=yi.produceWithPatches.bind(yi);var nl=yi.applyPatches.bind(yi);m();d();f();p();function fb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function mb(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function gb(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 Uf=e=>Array.isArray(e)?e:[e];function hb(e){let t=Array.isArray(e[0])?e[0]:e;return gb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function yb(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var qF=Symbol();var LF=Object.getPrototypeOf({});var vb=class{constructor(e){this.value=e}deref(){return this.value}},Sb=typeof WeakRef<"u"?WeakRef:vb,wb=0,Vf=1;function Ra(){return{s:wb,v:void 0,o:null,p:null}}function zn(e,t={}){let r=Ra(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let v=0,S=c;v<S;v++){let g=arguments[v];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let x=y.get(g);x===void 0?(s=Ra(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);let x=y.get(g);x===void 0?(s=Ra(),y.set(g,s)):s=x}}let u=s,h;if(s.s===Vf)h=s.v;else if(h=e.apply(null,arguments),i++,n){let v=o?.deref?.()??o;v!=null&&n(v,h)&&(h=v,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Sb(h):h}return u.s=Vf,u.v=h,h}return a.clearCache=()=>{r=Ra(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Gf(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),fb(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:v,memoizeOptions:S=[],argsMemoize:g=zn,argsMemoizeOptions:y=[],devModeChecks:x={}}=h,E=Uf(S),C=Uf(y),I=hb(o),T=v(function(){return i++,u.apply(null,arguments)},...E),_=!0,q=g(function(){a++;let k=yb(I,arguments);return s=T.apply(null,k),s},...C);return Object.assign(q,{resultFunc:u,memoizedResultFunc:T,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Ue=Gf(zn),Ab=Object.assign((e,t=Ue)=>{mb(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>Ab});m();d();f();p();function Bf(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var $f=Bf(),Qf=Bf;var bb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bn:Bn.apply(null,arguments)},nD=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},xb=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(st(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>$n(n)&&n.type===e,r}var Zf=class Si extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Si.prototype)}static get[Symbol.species](){return Si}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Si(...t[0].concat(this)):new Si(...t.concat(this))}};function Hf(e){return ft(e)?Jt(e,()=>{}):e}function zf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Cb(e){return typeof e=="boolean"}var Eb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Zf;return r&&(Cb(r)?a.push($f):a.push(Qf(r.extraArgument))),a},wi="RTK_autoBatch",Yn=()=>e=>({payload:e,meta:{[wi]:!0}}),Wf=e=>t=>{setTimeout(t,e)},Rb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Wf(10):e.type==="callback"?e.queueNotification:Wf(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let v=()=>o&&h(),S=n.subscribe(v);return s.add(h),()=>{S(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[wi],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},Ib=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Zf(e);return n&&o.push(Rb(typeof n=="object"?n:void 0)),o};function em(e){let t=Eb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=Gn(r);else throw new Error(st(1));let c;typeof n=="function"?c=n(t):c=t();let u=Bn;o&&(u=bb({trace:!1,...(typeof o=="object"&&o)}));let h=If(...c),v=Ib(h),S=typeof a=="function"?a(v):v(),g=u(...S);return $u(s,i,g)}function tm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(st(28));if(s in t)throw new Error(st(29));return t[s]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Tb(e){return typeof e=="function"}function Me(e,t){let[r,n,o]=tm(t),i;if(Tb(e))i=()=>Hf(e());else{let s=Hf(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,v)=>{if(v)if(vt(h)){let g=v(h,c);return g===void 0?h:g}else{if(ft(h))return Jt(h,S=>v(S,c));{let S=v(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},s)}return a.getInitialState=i,a}var rm=(e,t)=>xb(e)?e.match(t):e(t);function Lt(...e){return t=>e.some(r=>rm(r,t))}function Kn(...e){return t=>e.every(r=>rm(r,t))}function ka(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 Ai(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Oa(...e){return e.length===0?t=>ka(t,["pending"]):Ai(e)?Lt(...e.map(t=>t.pending)):Oa()(e[0])}function Yr(...e){return e.length===0?t=>ka(t,["rejected"]):Ai(e)?Lt(...e.map(t=>t.rejected)):Yr()(e[0])}function bi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kn(Yr(...e),t):Ai(e)?Kn(Yr(...e),t):bi()(e[0])}function Zt(...e){return e.length===0?t=>ka(t,["fulfilled"]):Ai(e)?Lt(...e.map(t=>t.fulfilled)):Zt()(e[0])}function Pa(...e){return e.length===0?t=>ka(t,["pending","fulfilled","rejected"]):Ai(e)?Lt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Pa()(e[0])}var _b="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",xi=(e=21)=>{let t="",r=e;for(;r--;)t+=_b[Math.random()*64|0];return t},kb=["name","message","stack","code"],ol=class{constructor(e,t){xe(this,"_type");this.payload=e,this.meta=t}},Kf=class{constructor(e,t){xe(this,"_type");this.payload=e,this.meta=t}},Ob=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of kb)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},be=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(c,u,h,v)=>({payload:c,meta:{...(v||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=P(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=P(t+"/rejected",(c,u,h,v,S)=>({payload:v,error:(n&&n.serializeError||Ob)(c||"Rejected"),meta:{...(S||{}),arg:h,requestId:u,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,h,v)=>{let S=n?.idGenerator?n.idGenerator(c):xi(),g=new l.AbortController,y,x;function E(I){x=I,g.abort()}let C=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(c,{getState:h,extra:v});if(Nb(_)&&(_=yield _),_===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((N,k)=>{y=()=>{k({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",y)});u(i(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:v}))),I=yield Promise.race([q,Promise.resolve(r(c,{dispatch:u,getState:h,extra:v,requestId:S,signal:g.signal,abort:E,rejectWithValue:(N,k)=>new ol(N,k),fulfillWithValue:(N,k)=>new Kf(N,k)})).then(N=>{if(N instanceof ol)throw N;return N instanceof Kf?o(N.payload,S,c,N.meta):o(N,S,c)})])}catch(_){I=_ instanceof ol?a(null,S,c,_.payload,_.meta):a(_,S,c)}finally{y&&g.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||u(I),I})();return Object.assign(C,{abort:E,requestId:S,arg:c,unwrap(){return C.then(Pb)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Lt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Pb(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Nb(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var nm=Symbol.for("rtk-slice-createasyncthunk"),cD={[nm]:be};function Fb(e,t){return`${e}/${t}`}function Db({creators:e}={}){let t=e?.asyncThunk?.[nm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(st(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(jb()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,T){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(st(12));if(_ in c.sliceCaseReducersByType)throw new Error(st(13));return c.sliceCaseReducersByType[_]=T,u},addMatcher(I,T){return c.sliceMatchers.push({matcher:I,reducer:T}),u},exposeAction(I,T){return c.actionCreators[I]=T,u},exposeCaseReducer(I,T){return c.sliceCaseReducersByName[I]=T,u}};s.forEach(I=>{let T=a[I],_={reducerName:I,type:Fb(o,I),createNotation:typeof n.reducers=="function"};Lb(T)?Vb(_,T,u,t):qb(_,T,u)});function h(){let[I={},T=[],_=void 0]=typeof n.extraReducers=="function"?tm(n.extraReducers):[n.extraReducers],q={...I,...c.sliceCaseReducersByType};return Me(n.initialState,N=>{for(let k in q)N.addCase(k,q[k]);for(let k of c.sliceMatchers)N.addMatcher(k.matcher,k.reducer);for(let k of T)N.addMatcher(k.matcher,k.reducer);_&&N.addDefaultCase(_)})}let v=I=>I,S=new Map,g;function y(I,T){return g||(g=h()),g(I,T)}function x(){return g||(g=h()),g.getInitialState()}function E(I,T=!1){function _(N){let k=N[I];return typeof k>"u"&&T&&(k=x()),k}function q(N=v){let k=zf(S,T,()=>new WeakMap);return zf(k,N,()=>{let O={};for(let[D,U]of Object.entries(n.selectors??{}))O[D]=Mb(U,N,x,T);return O})}return{reducerPath:I,getSelectors:q,get selectors(){return q(_)},selectSlice:_}}let C={name:o,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:x,...E(i),injectInto(I,{reducerPath:T,..._}={}){let q=T??i;return I.inject({reducerPath:q,reducer:y},_),{...C,...E(q,!0)}}};return C}}function Mb(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var Xr=Db();function jb(){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 qb({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Ub(n))throw new Error(st(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?P(e,a):P(e))}function Lb(e){return e._reducerDefinitionType==="asyncThunk"}function Ub(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Vb({type:e,reducerName:t},r,n,o){if(!o)throw new Error(st(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,v=o(e,i,h);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),c&&n.addCase(v.rejected,c),u&&n.addMatcher(v.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ia,pending:s||Ia,rejected:c||Ia,settled:u||Ia})}function Ia(){}var Gb="task",om="listener",im="completed",sl="cancelled",Bb=`task-${sl}`,$b=`task-${im}`,il=`${om}-${sl}`,Qb=`${om}-${im}`,Na=class{constructor(e){xe(this,"name","TaskAbortError");xe(this,"message");this.code=e,this.message=`${Gb} ${sl} (reason: ${e})`}},cl=(e,t)=>{if(typeof e!="function")throw new TypeError(st(32))},Ta=()=>{},am=(e,t=Ta)=>(e.catch(t),e),sm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Wr=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Kr=e=>{if(e.aborted){let{reason:t}=e;throw new Na(t)}};function cm(e,t){let r=Ta;return new Promise((n,o)=>{let i=()=>o(new Na(e.reason));if(e.aborted){i();return}r=sm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ta})}var Hb=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Na?"cancelled":"rejected",error:r}}finally{t?.()}});return function Hb(_x5,_x6){return _ref5.apply(this,arguments)}}(),_a=e=>t=>am(cm(e,t).then(r=>(Kr(e),r))),um=e=>{let t=_a(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wn}=Object,Yf={},Fa="listenerMiddleware",zb=(e,t)=>{let r=n=>sm(e,()=>Wr(n,e.reason));return(n,o)=>{cl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=Hb(/*#__PURE__*/_asyncToGenerator(function*(){Kr(e),Kr(i.signal);let s=yield n({pause:_a(i.signal),delay:um(i.signal),signal:i.signal});return Kr(i.signal),s}),()=>Wr(i,$b));return o?.autoJoin&&t.push(a.catch(Ta)),{result:_a(e)(a),cancel(){Wr(i,Bb)}}}},Wb=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Kr(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(v,S)=>{S.unsubscribe(),c([v,S.getState(),S.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield cm(t,Promise.race(s));return Kr(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>am(r(n,o))},lm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(st(21));return cl(i,"options.listener"),{predicate:o,type:t,effect:i}},dm=Wn(e=>{let{type:t,predicate:r,effect:n}=lm(e);return{id:xi(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(st(22))}}},{withTypes:()=>dm}),Xf=(e,t)=>{let{type:r,effect:n,predicate:o}=lm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},al=e=>{e.pending.forEach(t=>{Wr(t,il)})},Kb=e=>()=>{e.forEach(al),e.clear()},Jf=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},pm=Wn(P(`${Fa}/add`),{withTypes:()=>pm}),Yb=P(`${Fa}/removeAll`),fm=Wn(P(`${Fa}/remove`),{withTypes:()=>fm}),Xb=(...e)=>{console.error(`${Fa}/error`,...e)},mm=(e={})=>{let t=new Map,{extra:r,onError:n=Xb}=e;cl(n,"onError");let o=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),v=>{h.unsubscribe(),v?.cancelActive&&al(h)}),i=h=>{let v=Xf(t,h)??dm(h);return o(v)};Wn(i,{withTypes:()=>i});let a=h=>{let v=Xf(t,h);return v&&(v.unsubscribe(),h.cancelActive&&al(v)),!!v};Wn(a,{withTypes:()=>a});let s=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,v,S,g){let y=new l.AbortController,x=Wb(i,y.signal),E=[];try{h.pending.add(y),yield Promise.resolve(h.effect(v,Wn({},S,{getOriginalState:g,condition:(C,I)=>x(C,I).then(Boolean),take:x,delay:um(y.signal),pause:_a(y.signal),extra:r,signal:y.signal,fork:zb(y.signal,E),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((C,I,T)=>{C!==y&&(Wr(C,il),T.delete(C))})},cancel:()=>{Wr(y,il),h.pending.delete(y)},throwIfCancelled:()=>{Kr(y.signal)}})))}catch(C){C instanceof Na||Jf(n,C,{raisedBy:"effect"})}finally{yield Promise.all(E),Wr(y,Qb),h.pending.delete(y)}});return function s(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),c=Kb(t);return{middleware:h=>v=>S=>{if(!$n(S))return v(S);if(pm.match(S))return i(S.payload);if(Yb.match(S)){c();return}if(fm.match(S))return a(S.payload);let g=h.getState(),y=()=>{if(g===Yf)throw new Error(st(23));return g},x;try{if(x=v(S),t.size>0){let E=h.getState(),C=Array.from(t.values());for(let I of C){let T=!1;try{T=I.predicate(S,E,g)}catch(_){T=!1,Jf(n,_,{raisedBy:"predicate"})}T&&s(I,S,h,y)}}}finally{g=Yf}return x},startListening:i,stopListening:a,clearListeners:c}};var lD=Symbol.for("rtk-state-proxy-original");function st(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();f();p();var X=new H({required:!0,emptyAllowed:!1}),Xe=new H({required:!1,emptyAllowed:!1}),Je=new H({required:!0,emptyAllowed:!0}),bD=new H({required:!1,emptyAllowed:!0}),Da=new ge({each:X,required:!0}),gm=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),hm=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),xD=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),er=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),At=(e,t)=>{if("required"in t)return{payload:new lt({value:t}).validate({value:e}).value};let o=new ee({options:{required:!0},values:t}).validate(e);if(o)throw new si(o);return{payload:e}},j=(e,t)=>{try{return At(e,t)}catch(r){return{payload:e,error:er(r)}}},ym=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Sm(e,t,r,o,"Controller initialization error")},vm=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Sm(e,t,r,o,"Controller initialization error")},Sm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Xn="3.46.0",wm=["@coveo/atomic","@coveo/quantic"];var ul=()=>Xe,Am=()=>X,hr=P("configuration/updateBasicConfiguration",e=>j(e,{accessToken:Xe,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Xe})),Ut=P("configuration/updateSearchConfiguration",e=>j(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Xe,timezone:Xe,locale:Xe,authenticationProviders:new ge({required:!1,each:X})})),Jb={enabled:new ue({default:!0}),originContext:ul(),originLevel2:ul(),originLevel3:ul(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new Oe,anonymous:new ue({default:!1}),deviceId:Xe,userDisplayName:Xe,documentLocation:Xe,trackingId:hm,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ee({options:{required:!1},values:wm.reduce((e,t)=>(e[t]=gm,e),{})})},Jn=P("configuration/updateAnalyticsConfiguration",e=>j(e,Jb)),Zn=P("configuration/analytics/disable"),eo=P("configuration/analytics/enable"),Ma=P("configuration/analytics/originlevel2",e=>j(e,{originLevel2:Am()})),ja=P("configuration/analytics/originlevel3",e=>j(e,{originLevel3:Am()})),bm=P("knowledge/setAgentId",e=>j(e,new H({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var xm={q:new H,enableQuerySyntax:new ue,aq:new H,cq:new H,firstResult:new te({min:0}),numberOfResults:new te({min:0}),sortCriteria:new H,f:new ee,fExcluded:new ee,cf:new ee,nf:new ee,mnf:new ee,df:new ee,debug:new ue,sf:new ee,tab:new H,af:new ee};var yr=P("searchParameters/restore",e=>j(e,xm)),Cm=P("searchParameters/restoreTab",e=>j(e,X));m();d();f();p();var qa=P("debug/enable"),La=P("debug/disable");m();d();f();p();var Ua=()=>!1;var Va=Me(Ua(),e=>{e.addCase(qa,()=>!0).addCase(La,()=>!1).addCase(yr,(t,r)=>r.payload.debug??t)});m();d();f();p();var to=P("pipeline/set",e=>j(e,new H({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var Zb=P("history/undo"),ex=P("history/redo"),Vt=P("history/snapshot"),PM=be("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Zb()),yield t(mt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),NM=be("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(ex()),yield t(mt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),mt=be("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var ro=()=>"";var no=Me(ro(),e=>{e.addCase(to,(t,r)=>r.payload).addCase(mt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ut,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var Ga=P("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var oo=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?ll(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],ll(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ll(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();f();p();function tx(){return typeof navigator<"u"}function Em(){try{return typeof localStorage<"u"}catch{return!1}}function Rm(){try{return typeof sessionStorage<"u"}catch{return!1}}function Im(){return!!(tx()&&navigator.cookieEnabled)}var Tm=null;function _m(){return Tm||(Em()?localStorage:Im()?new dl:Rm()?sessionStorage:new pl)}var io=class io{getItem(t){return oo.get(`${io.prefix}${t}`)}removeItem(t){oo.erase(`${io.prefix}${t}`)}setItem(t,r,n){oo.set(`${io.prefix}${t}`,r,n)}};xe(io,"prefix","coveo_");var dl=io;var pl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ba="__coveo.analytics.history",rx=20,nx=1e3*60,ox=75,Jr=class Jr{constructor(t){xe(this,"store");this.store=t||_m()}static getInstance(t){return Jr.instance||(Jr.instance=new Jr(t)),Jr.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ba);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Ba);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ba,JSON.stringify(t.slice(0,rx)))}catch{}}clear(){try{this.store.removeItem(Ba)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,ox)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>nx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};xe(Jr,"instance",null);var fl=Jr,bt=fl;m();d();f();p();m();d();f();p();var ao=Ue(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Xn}`));m();d();f();p();m();d();f();p();function tr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function M(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function hl(){return typeof window<"u"}function _l(){return typeof navigator<"u"}function so(){return typeof document<"u"}function yl(){try{return typeof localStorage<"u"}catch{return!1}}function ix(){try{return typeof sessionStorage<"u"}catch{return!1}}function Bm(){return _l()&&navigator.cookieEnabled}var ax=[ve.click,ve.custom,ve.search,ve.view],sx=(e,t)=>ax.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:_l()?navigator.userAgent:"unknown"},t):t,Ei=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?km(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],km(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function km(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function cx(){return yl()?localStorage:Bm()?new Ri:ix()?sessionStorage:new uo}var Ri=class e{getItem(t){return Ei.get(`${e.prefix}${t}`)}removeItem(t){Ei.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ei.set(`${e.prefix}${t}`,r,n)}};Ri.prefix="coveo_";var vl=class{constructor(){this.cookieStorage=new Ri}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},$a="__coveo.analytics.history",ux=20,lx=1e3*60,dx=75,za=class{constructor(t){this.store=t||cx()}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 M(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 M(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem($a);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return M(this,void 0,void 0,function*(){try{let t=yield this.store.getItem($a);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem($a,JSON.stringify(t.slice(0,ux)))}catch{}}clear(){try{this.store.removeItem($a)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,dx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>lx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var px=(e,t)=>M(void 0,void 0,void 0,function*(){return e===ve.view?(yield fx(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),fx=e=>M(void 0,void 0,void 0,function*(){let t=new za,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Qa,mx=new Uint8Array(16);function gx(){if(!Qa&&(Qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qa(mx)}var hx=/^(?:[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 Wa(e){return typeof e=="string"&&hx.test(e)}var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function $m(e,t=0){return Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]}function yx(e){if(!Wa(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 vx(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Sx="6ba7b810-9dad-11d1-80b4-00c04fd430c8",wx="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ax(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=vx(o)),typeof i=="string"&&(i=yx(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return $m(u)}try{n.name=e}catch{}return n.DNS=Sx,n.URL=wx,n}var bx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Om={randomUUID:bx};function Zr(e,t,r){if(Om.randomUUID&&!t&&!e)return Om.randomUUID();e=e||{};let n=e.random||(e.rng||gx)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return $m(n)}function xx(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function ml(e,t){return e<<t|e>>>32-t}function Cx(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=ml(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],v=r[3],S=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),x=ml(c,5)+xx(y,u,h,v)+S+t[y]+s[g]>>>0;S=v,v=h,h=ml(u,30)>>>0,u=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+v>>>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 Ex=Ax("v5",80,Cx),Pm=Ex,Qm="2.30.52",Nm=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ci={pageview:"pageview",event:"event"},Ka=class{constructor({client:t,uuidGenerator:r=Zr}){this.client=t,this.uuidGenerator=r}},Sl=class extends Ka{constructor({client:t,uuidGenerator:r=Zr}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Nm(window.location),this.lastReferrer=so()?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:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Ci.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ci.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ci.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ci.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Nm(window.location)}},vr=class e{constructor(t,r){if(!Wa(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Wa(i)?new e(i,Number.parseInt(o)*1e3):null}};vr.cvo_cid="cvo_cid";vr.expirationTime=120;var wl=class extends Ka{constructor({client:t,uuidGenerator:r=Zr}){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 M(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(vr.cvo_cid,new vr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};wl.Id="link";var Ct=Object.keys;function Ha(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var gl=128,Hm=192,Fm=224,Dm=240;function Rx(e){return(e&248)===Dm?4:(e&Dm)===Fm?3:(e&Fm)===Hm?2:1}function Ix(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&gl)!=gl)break;if(r-=3,(n&Hm)!=gl){t-r>=Rx(n)*3&&(r=t);break}}return e.substring(0,r)}var Al={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"},Tx=Ct(Al).map(e=>Al[e]),_x=[...Tx].join("|"),kx=new RegExp(`^(${_x}$)`),Ox={svcAction:"svc_action",svcActionData:"svc_action_data"},Px=e=>Ct(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Al[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Nx=e=>kx.test(e),Fx=[Nx],Mm={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},jm={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ot={action:"pa",list:"pal",listSource:"pls"},Ya={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Dx=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],bl={id:"quoteId",affiliation:"quoteAffiliation"},xl={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Mx={add:ot,bookmark_add:ot,bookmark_remove:ot,click:ot,checkout:ot,checkout_option:ot,detail:ot,impression:ot,remove:ot,refund:Object.assign(Object.assign({},ot),Ya),purchase:Object.assign(Object.assign({},ot),Ya),quickview:ot,quote:Object.assign(Object.assign({},ot),bl),review:Object.assign(Object.assign({},ot),xl)},jx=Ct(Mm).map(e=>Mm[e]),qx=Ct(jm).map(e=>jm[e]),Lx=Ct(ot).map(e=>ot[e]),Ux=Ct(Ya).map(e=>Ya[e]),Vx=Ct(xl).map(e=>xl[e]),Gx=Ct(bl).map(e=>bl[e]),Bx=[...jx,"custom"].join("|"),$x=[...qx,"custom"].join("|"),zm="(pr[0-9]+)",Wm="(il[0-9]+pi[0-9]+)",Qx=new RegExp(`^${zm}(${Bx})$`),Hx=new RegExp(`^(${Wm}(${$x}))|(il[0-9]+nm)$`),zx=new RegExp(`^(${Lx.join("|")})$`),Wx=new RegExp(`^(${Ux.join("|")})$`),Kx=new RegExp(`^${zm}custom$`),Yx=new RegExp(`^${Wm}custom$`),Xx=new RegExp(`^(${[...Dx,...Vx,...Gx].join("|")})$`),Jx=e=>Qx.test(e),Zx=e=>Hx.test(e),eC=e=>zx.test(e),tC=e=>Wx.test(e),rC=e=>Xx.test(e),nC=[Zx,Jx,eC,tC,rC],oC=[Kx,Yx],iC={anonymizeIp:"aip"},aC={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},sC={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},cC=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],uC=Object.assign(Object.assign(Object.assign(Object.assign({},iC),aC),sC),cC.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Cl=Object.assign(Object.assign({},uC),Ox),lC=e=>{let t=!!e.action&&Mx[e.action]||{};return Ct(e).reduce((r,n)=>{let o=t[n]||Cl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},dC=Ct(Cl).map(e=>Cl[e]),pC=e=>dC.indexOf(e)!==-1,fC=e=>e==="custom",mC=e=>[...nC,...Fx,pC,fC].some(t=>t(e)),gC=e=>Ct(e).reduce((t,r)=>{let n=hC(r);return n?Object.assign(Object.assign({},t),yC(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),hC=e=>{let t;return[...oC].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},yC=(e,t)=>Ct(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),El=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return M(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return M(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Rl=class{sendEvent(t,r){return M(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){return Promise.resolve()})}},qm=w.fetch,Xa=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=tr(c,["url"]),v;try{v=yield qm(u,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(v.ok){let S=yield v.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield qm(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}getVisitorIdParam(){return M(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"})}},Il=class{constructor(t,r){yl()&&Bm()?this.storage=new vl:yl()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new Xa(t),this.beaconClient=new El(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Tl=class{constructor(t,r){this.storage=r||new uo,this.client=new Xa(t)}getClientDependingOnEventType(t){return this.client}},Ja=class{constructor(){this.storage=new uo,this.client=new Rl}getClientDependingOnEventType(t){return this.client}},vC="xx",SC=e=>e?.startsWith(vC)||!1,wC=`
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 OS(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var TS=["1",1,"yes",!0];function Bo(){let e=[];return Wa()&&e.push(window.doNotTrack),ss()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>TS.indexOf(t)!==-1)}var $l="v15",Hl={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 DS(e=Hl.default,t=$l,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 qS="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ze=class{get defaultOptions(){return{endpoint:Hl.default,isCustomEndpoint:!1,token:"",version:$l,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Ul}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=[bh,hh].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};Bo()?this.runtime=new Qo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return Wa()&&Cr()?new is(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(OS()&&console.warn(kS),new as(t))}get storage(){return this.runtime.storage}determineVisitorId(){return q(this,void 0,void 0,function*(){try{return Wa()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||$t()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),$t()}})}getCurrentVisitorId(){return q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return q(this,void 0,void 0,function*(){if(_o(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Il(t,Il(r,qS)))}})}getParameters(t,...r){return q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId($t()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Bo())return null;try{let r=new URL(t).searchParams.get(St.cvo_cid);if(r==null)return null;let n=St.fromString(r);return!n||!Cr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>q(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>i?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((v,R)=>q(this,void 0,void 0,function*(){let I=yield v;return yield R(t,I)}),y)].reduce((y,v)=>q(this,void 0,void 0,function*(){let R=yield y;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?AS(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>q(this,void 0,void 0,function*(){let y=yield h;return yield S(y)}),Promise.resolve(r))})}makeEvent(t,...r){return q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new No().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){return q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){return q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){return q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=at(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return q(this,void 0,void 0,function*(){let r=yield(yield w(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return q(this,void 0,void 0,function*(){return yield(yield w(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(xS(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=at(t,["custom"]),o={};r&&Mo(r)&&(o=this.lowercaseKeys(r));let i=RS(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=at(t,["custom"]);if(r&&Mo(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=at(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=at(t,["userId"]);return PS(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=at(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Mo(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Mo(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"?Nh(t,r):t}get baseUrl(){return DS(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},st;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(st||(st={}));var j;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(j||(j={}));var ql={[j.triggerNotify]:"queryPipelineTriggers",[j.triggerExecute]:"queryPipelineTriggers",[j.triggerQuery]:"queryPipelineTriggers",[j.triggerRedirect]:"queryPipelineTriggers",[j.queryErrorBack]:"errors",[j.queryErrorClear]:"errors",[j.queryErrorRetry]:"errors",[j.pagerNext]:"getMoreResults",[j.pagerPrevious]:"getMoreResults",[j.pagerNumber]:"getMoreResults",[j.pagerResize]:"getMoreResults",[j.pagerScrolling]:"getMoreResults",[j.facetSearch]:"facet",[j.facetShowLess]:"facet",[j.facetShowMore]:"facet",[j.recommendation]:"recommendation",[j.likeSmartSnippet]:"smartSnippet",[j.dislikeSmartSnippet]:"smartSnippet",[j.expandSmartSnippet]:"smartSnippet",[j.collapseSmartSnippet]:"smartSnippet",[j.openSmartSnippetFeedbackModal]:"smartSnippet",[j.closeSmartSnippetFeedbackModal]:"smartSnippet",[j.sendSmartSnippetReason]:"smartSnippet",[j.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.clearRecentQueries]:"recentQueries",[j.recentResultClick]:"recentlyClickedDocuments",[j.clearRecentResults]:"recentlyClickedDocuments",[j.showLessFoldedResults]:"folding",[j.caseDetach]:"case",[j.likeGeneratedAnswer]:"generatedAnswer",[j.dislikeGeneratedAnswer]:"generatedAnswer",[j.openGeneratedAnswerSource]:"generatedAnswer",[j.generatedAnswerStreamEnd]:"generatedAnswer",[j.generatedAnswerSourceHover]:"generatedAnswer",[j.generatedAnswerCopyToClipboard]:"generatedAnswer",[j.generatedAnswerHideAnswers]:"generatedAnswer",[j.generatedAnswerShowAnswers]:"generatedAnswer",[j.generatedAnswerExpand]:"generatedAnswer",[j.generatedAnswerCollapse]:"generatedAnswer",[j.generatedAnswerFeedbackSubmit]:"generatedAnswer",[j.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[st.expandToFullUI]:"interface",[st.openUserActions]:"User Actions",[st.showPrecedingSessions]:"User Actions",[st.showFollowingSessions]:"User Actions",[st.clickViewedDocument]:"User Actions",[st.clickPageView]:"User Actions",[st.createArticle]:"createArticle"},Er=class{constructor(){this.runtime=new Qo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Ul}};function jS(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function MS(e){return e.map(t=>t.replace(/;/g,""))}function Gl(e){let r=e.join(";");return r.length<=256?r:Gl(e.slice(1))}var jl=e=>{let t=MS(e),r=jS(t);return Gl(r)};function Ml(e){let t=typeof e.partialQueries=="string"?e.partialQueries:jl(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:jl(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var $o=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Bo();this.coveoAnalyticsClient=n?new Er:new Ze(t)}disable(){this.coveoAnalyticsClient=new Er}enable(){this.coveoAnalyticsClient=new Ze(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(j.interfaceLoad)}logInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(j.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(j.recommendation)}logRecommendation(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(j.recommendationOpen,t,r)}logRecommendationOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(j.staticFilterClearAll,t)}logStaticFilterClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(j.staticFilterSelect,t)}logStaticFilterSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(j.staticFilterDeselect,t)}logStaticFilterDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(j.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(j.interfaceChange,t)}logInterfaceChange(t){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(j.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(j.didyoumeanClick)}logDidYouMeanClick(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(j.resultsSort,t)}logResultsSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(j.searchboxSubmit)}logSearchboxSubmit(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(j.searchboxClear)}logSearchboxClear(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(j.searchboxAsYouType)}logSearchboxAsYouType(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(j.breadcrumbFacet,t)}logBreadcrumbFacet(t){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(j.breadcrumbResetAll)}logBreadcrumbResetAll(){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(j.documentQuickview,t,r)}logDocumentQuickview(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(j.documentOpen,t,r)}logDocumentOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(j.omniboxAnalytics,Ml(t))}logOmniboxAnalytics(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(j.omniboxFromLink,Ml(t))}logOmniboxFromLink(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(j.searchFromLink)}logSearchFromLink(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(j.triggerNotify,t)}logTriggerNotify(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(j.triggerExecute,t)}logTriggerExecute(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(j.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(j.undoTriggerQuery,t)}logUndoTriggerQuery(t){return q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(j.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(j.pagerResize,t)}logPagerResize(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(j.pagerNumber,t)}logPagerNumber(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(j.pagerNext,t)}logPagerNext(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(j.pagerPrevious,t)}logPagerPrevious(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(j.pagerScrolling)}logPagerScrolling(){return q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(j.facetClearAll,t)}logFacetClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(j.facetSearch,t)}logFacetSearch(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(j.facetSelect,t)}logFacetSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(j.facetDeselect,t)}logFacetDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(j.facetExclude,t)}logFacetExclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(j.facetUnexclude,t)}logFacetUnexclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(j.facetSelectAll,t)}logFacetSelectAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(j.facetUpdateSort,t)}logFacetUpdateSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(j.facetShowMore,t)}logFacetShowMore(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(j.facetShowLess,t)}logFacetShowLess(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(j.queryError,t)}logQueryError(t){return q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorBack);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorBack)})}})}logQueryErrorBack(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorRetry);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorRetry)})}})}logQueryErrorRetry(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorClear);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorClear)})}})}logQueryErrorClear(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(j.likeSmartSnippet)}logLikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(j.dislikeSmartSnippet)}logDislikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(j.expandSmartSnippet)}logExpandSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(j.collapseSmartSnippet)}logCollapseSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(j.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(j.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(j.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(j.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(j.copyToClipboard,t,r)}logCopyToClipboard(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(j.recentQueryClick)}logRecentQueryClick(){return q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(j.clearRecentQueries)}logClearRecentQueries(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(j.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(j.clearRecentResults)}logClearRecentResults(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(j.noResultsBack)}logNoResultsBack(){return q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(j.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(j.showLessFoldedResults)}logShowLessFoldedResults(){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return q(this,arguments,void 0,function*(n,o,i=ql[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),m=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(m);return{description:this.makeEventDescription(f,n),log:({searchUID:p})=>f.log({lastSearchQueryUid:p})}})}logCustomEvent(t,r){return q(this,arguments,void 0,function*(n,o,i=ql[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(j.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(j.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(j.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(j.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(j.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(j.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(j.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(j.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(j.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(j.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(j.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(j.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(j.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Ho=Object.assign({},bn),Nl=Object.keys(Ho).map(e=>Ho[e]),xr=class extends Ja{constructor({client:t,uuidGenerator:r=$t}){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])=>Nl.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Nl.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Ho.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Ho.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return Qh(this.ticket)}};xr.Id="svc";var Go;(function(e){e.click="click",e.flowStart="flowStart"})(Go||(Go={}));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 zo;(function(e){e.quit="Quit",e.solved="Solved"})(zo||(zo={}));var Wo=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Bo();this.coveoAnalyticsClient=o?new Ze(t):new Er,this.svc=new xr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Er,this.svc=new xr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ze(this.options),this.svc=new xr({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:zo.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Qe.caseSolved,{reason:zo.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",Go.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Go.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){var i,a;let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var zl=e=>new Ze(e).getCurrentVisitorId(),Rn=(e,t)=>typeof t=="function"?(...r)=>{let n=an(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,En=(e,t)=>(...r)=>{let n=an(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ko(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function Wl(e){let{activeValue:t,ancestryMap:r}=NS(e);return t?_S(t,r):[]}function NS(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function _S(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var VS=(e,t)=>e.categoryFacetSet[t]?.request;var ls=(e,t)=>{let r=VS(e,t);return Wl(r?.currentValues??[])};d();c();l();u();function Yo(){return{}}d();c();l();u();function Jo(){return{}}d();c();l();u();function Xo(){return{}}d();c();l();u();function Zo(){return{}}function ds(e){return{facetSet:e.facetSet??Zo(),categoryFacetSet:e.categoryFacetSet??Yo(),dateFacetSet:e.dateFacetSet??Jo(),numericFacetSet:e.numericFacetSet??Xo(),automaticFacetSet:e.automaticFacetSet??Ko()}}var ps=e=>{let t=[];return QS(e).forEach((r,n)=>{let o=YS(e,r.facetId),i=WS(r,n+1);if(LS(r)){if(!!!ls(e,r.facetId).length)return;t.push({...i,...GS(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=Kl(a,m+1,o),p=US(r)?Yl(a):$S(a);t.push({...i,...f,...p})})}),BS(e).forEach((r,n)=>{let o=zS(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=Kl(i,a+1,"specific"),f=Yl(i);t.push({...o,...m,...f})})}),t},US=e=>e.type==="specific",LS=e=>e.type==="hierarchical",QS=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),BS=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Kl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),$S=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Yl=e=>({displayValue:e.value,value:e.value}),HS=(e,t)=>ls(e,t).map(n=>n.value).join(";"),GS=(e,t)=>{let n=HS(e,t);return{value:n,valuePosition:1,displayValue:n}},zS=(e,t)=>({title:Jl(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),WS=(e,t)=>({title:Jl(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Jl=(e,t)=>`${e}_${t}`,KS=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,YS=(e,t)=>{let r=KS(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var fs=e=>e.configuration.search.locale,Xl=e=>e.configuration.search.timezone,Ir=e=>e.configuration?.knowledge?.agentId;var Ht=e=>{if(JS(e)||ms(e))return e.generatedAnswer?.answerId;if(XS(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},JS=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),ms=e=>{let t=Ir(e);return"answerGenerationApi"in e&&"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},XS=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",gs=e=>e.generatedAnswer?.fieldsToIncludeInCitations,ZS=ye(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var _e=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var Zl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Zl||{}),ed=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(ed||{}),ys=e=>{if(Xc(e))return e.map(t=>ys(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""}},td=()=>({by:"relevancy"});var sO=new K({values:{by:new la({enum:ed,required:!0}),order:new la({enum:Zl}),field:new $}});function ei(){return ys(td())}d();c();l();u();d();c();l();u();var Fr=()=>"default";var ev=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ct=class{constructor(t){this.getState=t;ue(this,"state");this.state=t()}getLanguage(){return ev(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=fr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Fr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var In=class In extends ct{constructor(){super(...arguments);ue(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 ps(ds(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||In.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||We().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||In.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ht(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ei()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||_e().q}get responseTime(){return this.state.search?.duration||We().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||We().response.totalCountFiltered}};ue(In,"fallbackPipelineName","default");var vt=In,rd=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Se(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,g=new $o({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:Rn(e,n),beforeSendHooks:[En(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||g.disable(),g},hs=()=>{let t=Le.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var ti=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield zl(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}),...(hs()&&{pageId:hs()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:br(e)})}}});return function ti(_x16,_x17){return _ref10.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var Pr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Fn=class extends ct{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:_e().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||Pr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||Pr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||Pr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var nd=/^(?:[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 tv(e){return typeof e=="string"&&nd.test(e)}var Ss=tv;d();c();l();u();var Ee=[];for(let e=0;e<256;++e)Ee.push((e+256).toString(16).slice(1));function od(e,t=0){return(Ee[e[t+0]]+Ee[e[t+1]]+Ee[e[t+2]]+Ee[e[t+3]]+"-"+Ee[e[t+4]]+Ee[e[t+5]]+"-"+Ee[e[t+6]]+Ee[e[t+7]]+"-"+Ee[e[t+8]]+Ee[e[t+9]]+"-"+Ee[e[t+10]]+Ee[e[t+11]]+Ee[e[t+12]]+Ee[e[t+13]]+Ee[e[t+14]]+Ee[e[t+15]]).toLowerCase()}d();c();l();u();var vs,rv=new Uint8Array(16);function As(){if(!vs){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vs=crypto.getRandomValues.bind(crypto)}return vs(rv)}d();c();l();u();d();c();l();u();var nv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ws={randomUUID:nv};function ov(e,t,r){e=e||{};let n=e.random??e.rng?.()??As();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return od(n)}function iv(e,t,r){return ws.randomUUID&&!t&&!e?ws.randomUUID():ov(e,t,r)}var bs=iv;d();c();l();u();function id(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function av({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var ad="visitorId";function sv(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(ad),o=n&&Ss(n)?n:t.generateUUID();return r.setItem(ad,o),o}}}var dd="1.2.15",Cs=128,pd=192,sd=224,cd=240,cv=248;function uv(e){return(e&cv)===cd?4:(e&cd)===sd?3:(e&sd)===pd?2:1}function lv(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&Cs)!=Cs)break;if(r-=3,(n&pd)!=Cs){t-r>=uv(n)*3&&(r=t);break}}return e.substring(0,r)}function dv(e){let{trackingId:t}=e;return{trackingId:t}}function pv(e){return(e.source||[]).concat([`relay@${dd}`])}function fd(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=dv(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:pv(t),clientId:f,userAgent:a(),referrer:ud(o()),location:ud(i())})}function ud(e){return e!==null?lv(e,1024):null}function fv(e,t,r,n,o){return{...t,meta:fd(e,r,n,o)}}var mv="*";function gv(){let e=[];function t({type:f,callback:p}){return e.findIndex(g=>g.type===f&&g.callback===p)}function r(f,p){return f.type==="*"||p===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(p=>{if(r(p,f.meta.type))try{p.callback(f)}catch(g){console.error(g)}})}function i(f){if(f===mv)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===f&&e.splice(p,1)}function a(f){let p=t(f);p>=0&&e.splice(p,1)}function m(f,p){p?a({type:f,callback:p}):i(f)}return{add:n,call:o,remove:m}}function ld({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 yv(e){let t=ld(e);return{get:()=>t,update:r=>{t=ld({...t,...r})}}}var xs=hv();function hv(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Sv(){return{getItem(e){return xs.getItem(e)||localStorage.getItem(e)},removeItem(e){xs.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),xs.setItem(e,t,31556952e3)}}}function vv(){let e=document.referrer;return e===""?null:e}function Rs(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(id().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:()=>vv(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>bs(),storage:Sv()}}function Av(){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 wv(){return{getItem(){return null},removeItem(){},setItem(){}}}function bv(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:wv()}}function Cv(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=bv();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&xv()&&Av()?Rs():n}function xv(){try{return typeof window=="object"}catch{return!1}}function Rv(e){return{get:()=>Object.freeze(Cv(e))}}function md(e){let t=yv(e),r=gv(),n=Rv(t),o=sv(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),p=fv(i,a,m,f,o);return av({config:m,environment:f,event:p,listenerManager:r})},getMeta:i=>fd(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:dd}}d();c();l();u();function gd(){return typeof window<"u"&&typeof document<"u"}var Pn=ye(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>br(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=Iv(m);return md({mode:i?"emit":"disabled",url:o??ro(e,t),token:r,trackingId:n??null,source:a,environment:f})}),Ev={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},Iv=e=>{if(!e)return;let t=e();return{...(gd()?Rs():Ev),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();var kn=class extends ct{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},yd=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new kn(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Se(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,g=new Wo({enableAnalytics:p,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:Rn(e,n),beforeSendHooks:[En(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||g.disable(),g};d();c();l();u();d();c();l();u();function hd(e,t){return{...new vt(t).getBaseMetadata(),actionCause:e,type:e}}function Fv(e){return Object.assign(e,{instantlyCallable:!0})}function Pv(e,t){let r=i=>Fv(ce(e,i)),n=r(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:p,logger:g}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:p,logger:g})).log({state:a(),extra:m})});return function(_x18,_x19){return _ref11.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref12=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:p,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:p,action:r(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(h,{getState:S,extra:y}){return yield g({state:S(),extra:y})});return function(_x21,_x22){return _ref13.apply(this,arguments)}}())}});return function prepare(_x20){return _ref12.apply(this,arguments)}}()}),n}var Sd=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return Tv(i)}return n},kv=e=>e.configuration.analytics.analyticsMode==="legacy",Ov=e=>e.configuration.analytics.analyticsMode==="next",Tv=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),Pv(e,/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:p,logger:g}){let h=[],S={log:function(){var _ref15=_asyncToGenerator(function*({state:C}){for(let P of h)yield P(C)});return function log(_x24){return _ref15.apply(this,arguments)}}()},y=m(),v=i({getState:m,logger:g,analyticsClientMiddleware:f,preprocessRequest:p,provider:r(m)}),R=yield t(v,m());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(C){kv(C)&&(yield Dv(R,r,C,g,v.coveoAnalyticsClient))});return function(_x25){return _ref16.apply(this,arguments)}}());let{emit:I}=Pn(y);return h.push(/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(C){if(Ov(C)&&o&&n){let P=n(C);yield Uv(I,o,P)}});return function(_x26){return _ref17.apply(this,arguments)}}()),S});return function(_x23){return _ref14.apply(this,arguments)}}()));function Dv(_x27,_x28,_x29,_x30,_x31){return _Dv.apply(this,arguments)}function _Dv(){_Dv=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _Dv.apply(this,arguments)}var qv=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref18=_asyncToGenerator(function*(i){r(n,o)});return function log(_x32){return _ref18.apply(this,arguments)}}()}),ke=Sd(e=>rd({...e,provider:e.provider||new vt(e.getState)}),e=>e,vt),hq=Sd(yd,qv("caseAssist"),kn);var Es=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return jv(e,r,t)};function jv(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:_v(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:Vv(e),queryPipeline:r.pipeline||Sr()}}var ri=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||""}),vd={urihash:new $,sourcetype:new $,permanentid:new $},Ad={uniqueId:W,raw:new K({values:vd}),title:W,uri:W,clickUri:W,rankingModifier:new $({required:!1,emptyAllowed:!0})};function Mv(e){return Object.assign({},...Object.keys(vd).map(t=>({[t]:e[t]})))}function Nv(e){return Object.assign({},...Object.keys(Ad).map(t=>({[t]:e[t]})),{raw:Mv(e.raw)})}function _v(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function Vv(e){let t=e.raw.source;return X(t)?"unknown":t}var Is=e=>new Te(Ad).validate(Nv(e));function Uv(_x33,_x34,_x35){return _Uv.apply(this,arguments)}function _Uv(){_Uv=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _Uv.apply(this,arguments)}d();c();l();u();var wd=()=>ke("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Fn(e)),bd=()=>({actionCause:"recommendationInterfaceLoad"}),oi=e=>ke({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Is(e),t.makeRecommendationOpen(Es(e,r),ri(e))),__legacy__provider:t=>new Fn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Es(e,t),n=ri(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var kr=O("recommendation/set",e=>N(e,{id:W})),At=ce("recommendation/get",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield Lv(o),m=yield n.recommendations(a),f=Date.now()-i;return De(m)?r(m.error):{recommendations:m.success.results,analyticsAction:wd(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x36,_x37){return _ref19.apply(this,arguments)}}()),Lv=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Le.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield Qv(e,bd()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function Lv(_x38){return _ref20.apply(this,arguments)}}(),Qv=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield ti(e.configuration.analytics,r)});return function Qv(_x39,_x40){return _ref21.apply(this,arguments)}}();var Or=me(Pr(),e=>{e.addCase(kr,(t,r)=>{t.id=r.payload.id}).addCase(At.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(At.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(At.pending,t=>{t.isLoading=!0}).addCase(To,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Tr=O("searchHub/set",e=>N(e,new $({required:!0,emptyAllowed:!0})));d();c();l();u();var Dr=me(Fr(),e=>{e.addCase(Tr,(t,r)=>r.payload).addCase(Me.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Je,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function Cd(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var xd=Ke;function Md(e,t){if(e===t||!(xd(e)&&xd(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Md(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function qr(e){let t=0;for(let r in e)t++;return t}var Rd=e=>[].concat(...e);function Bv(e){return new RegExp("(^|:)//").test(e)}function $v(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function si(e){return e!=null}function Hv(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Gv=e=>e.replace(/\/$/,""),zv=e=>e.replace(/^\//,"");function Wv(e,t){if(!e)return t;if(!t)return e;if(Bv(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Gv(e),t=zv(t),`${e}${r}${t}`}function Kv(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Ed=(...e)=>w(...e),Yv=e=>e.status>=200&&e.status<=299,Jv=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Id(e){if(!Ke(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Nd({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=Ed,paramsSerializer:n,isJsonContentType:o=Jv,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:p,...g}={}){return typeof w>"u"&&r===Ed&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(S,y,v){let{getState:R,extra:I,endpoint:C,forced:P,type:x}=y,E,{url:M,headers:T=new b(g.headers),params:F=void 0,responseHandler:k=f??"json",validateStatus:D=p??Yv,timeout:_=m,...H}=typeof S=="string"?{url:S}:S,Q,U=y.signal;_&&(Q=new s.AbortController,y.signal.addEventListener("abort",Q.abort),U=Q.signal);let V={...g,signal:U,...H};T=new b(Id(T)),V.headers=(yield t(T,{getState:R,arg:S,extra:I,endpoint:C,forced:P,type:x,extraOptions:v}))||T;let B=Z=>typeof Z=="object"&&(Ke(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!V.headers.has("content-type")&&B(V.body)&&V.headers.set("content-type",i),B(V.body)&&o(V.headers)&&(V.body=JSON.stringify(V.body,a)),F){let Z=~M.indexOf("?")?"&":"?",ie=n?n(F):new URLSearchParams(Id(F));M+=Z+ie}M=Wv(e,M);let L=new Request(M,V);E={request:new Request(M,V)};let z,Y=!1,re=Q&&setTimeout(()=>{Y=!0,Q.abort()},_);try{z=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{re&&clearTimeout(re),Q?.signal.removeEventListener("abort",Q.abort)}let se=z.clone();E.response=se;let te,ne="";try{let Z;if(yield Promise.all([h(z,k).then(ie=>te=ie,ie=>Z=ie),se.text().then(ie=>ne=ie,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:z.status,data:ne,error:String(Z)},meta:E}}return D(z,te)?{data:te,meta:E}:{error:{status:z.status,data:te},meta:E}});return function(_x41,_x42,_x43){return _ref22.apply(this,arguments)}}());function h(_x44,_x45){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,y){if(typeof y=="function")return y(S);if(y==="content-type"&&(y=o(S.headers)?"json":"text"),y==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var jr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Xv(){return _Xv.apply(this,arguments)}function _Xv(){_Xv=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _Xv.apply(this,arguments)}function Zv(e,t){throw Object.assign(new jr({error:e,meta:t}),{throwImmediately:!0})}var Fd={},eA=(e,t)=>(/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Fd).maxRetries,(o||Fd).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:Xv,retryCondition:(g,h,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new jr(g);return g}catch(g){if(p++,g.throwImmediately){if(g instanceof jr)return g.value;throw g}if(g instanceof jr&&!f.retryCondition(g.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(p,f.maxRetries)}});return function(_x46,_x47,_x48){return _ref23.apply(this,arguments)}}()),ci=Object.assign(eA,{fail:Zv}),Ts=O("__rtkq/focused"),_d=O("__rtkq/unfocused"),Ds=O("__rtkq/online"),Vd=O("__rtkq/offline");function qs(e){return e.type==="query"}function tA(e){return e.type==="mutation"}function js(e){return e.type==="infinitequery"}function Ms(e,t,r,n,o,i){return rA(e)?e(t,r,n,o).filter(si).map(Ps).map(i):Array.isArray(e)?e.map(Ps).map(i):[]}function rA(e){return typeof e=="function"}function Ps(e){return typeof e=="string"?{type:e}:e}function nA(e,t){return e.catch(t)}var Tn=Symbol("forceQueryFn"),ks=e=>typeof e[Tn]=="function";function oA({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:p,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:C,buildInitiateInfiniteQuery:P,buildInitiateMutation:x,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:y,getRunningMutationsThunk:v};function h(E,M){return T=>{let F=i.endpointDefinitions[E],k=e({queryArgs:M,endpointDefinition:F,endpointName:E});return a.get(T)?.[k]}}function S(E,M){return T=>m.get(T)?.[M]}function y(){return E=>Object.values(a.get(E)||{}).filter(si)}function v(){return E=>Object.values(m.get(E)||{}).filter(si)}function R(E){}function I(E,M){let T=(F,{subscribe:k=!0,forceRefetch:D,subscriptionOptions:_,[Tn]:H,...Q}={})=>(U,V)=>{let B=e({queryArgs:F,endpointDefinition:M,endpointName:E}),L,G={...Q,type:"query",subscribe:k,forceRefetch:D,subscriptionOptions:_,endpointName:E,originalArgs:F,queryCacheKey:B,[Tn]:H};if(qs(M))L=t(G);else{let{direction:le,initialPageParam:fe}=Q;L=r({...G,direction:le,initialPageParam:fe})}let z=o.endpoints[E].select(F),Y=U(L),re=z(V());let{requestId:se,abort:te}=Y,ne=re.requestId!==se,Z=a.get(U)?.[B],ie=()=>z(V()),ge=Object.assign(H?Y.then(ie):ne&&!Z?Promise.resolve(re):Promise.all([Z,Y]).then(ie),{arg:F,requestId:se,subscriptionOptions:_,queryCacheKey:B,abort:te,unwrap(){return _asyncToGenerator(function*(){let le=yield ge;if(le.isError)throw le.error;return le.data})()},refetch:()=>U(T(F,{subscribe:!1,forceRefetch:!0})),unsubscribe(){k&&U(f({queryCacheKey:B,requestId:se}))},updateSubscriptionOptions(le){ge.subscriptionOptions=le,U(g({endpointName:E,requestId:se,queryCacheKey:B,options:le}))}});if(!Z&&!ne&&!H){let le=Kv(a,U,{});le[B]=ge,ge.then(()=>{delete le[B],qr(le)||a.delete(U)})}return ge};return T}function C(E,M){return I(E,M)}function P(E,M){return I(E,M)}function x(E){return(M,{track:T=!0,fixedCacheKey:F}={})=>(k,D)=>{let _=n({type:"mutation",endpointName:E,originalArgs:M,track:T,fixedCacheKey:F}),H=k(_);let{requestId:Q,abort:U,unwrap:V}=H,B=nA(H.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{k(p({requestId:Q,fixedCacheKey:F}))},G=Object.assign(B,{arg:H.arg,requestId:Q,abort:U,unwrap:V,reset:L}),z=m.get(k)||{};return m.set(k,z),z[Q]=G,G.then(()=>{delete z[Q],qr(z)||m.delete(k)}),F&&(z[F]=G,G.then(()=>{z[F]===G&&(delete z[F],qr(z)||m.delete(k))})),G}}}function iA(e){return e}var ii=(e={})=>({...e,[Sn]:!0});function aA({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(k,D,_,H)=>(Q,U)=>{let V=r[k],B=n({queryArgs:D,endpointDefinition:V,endpointName:k});if(Q(o.internalActions.queryResultPatched({queryCacheKey:B,patches:_})),!H)return;let L=o.endpoints[k].select(D)(U()),G=Ms(V.providesTags,L.data,void 0,D,{},i);Q(o.internalActions.updateProvidedBy({queryCacheKey:B,providedTags:G}))};function f(k,D,_=0){let H=[D,...k];return _&&H.length>_?H.slice(0,-1):H}function p(k,D,_=0){let H=[...k,D];return _&&H.length>_?H.slice(1):H}let g=(k,D,_,H=!0)=>(Q,U)=>{let B=o.endpoints[k].select(D)(U()),L={patches:[],inversePatches:[],undo:()=>Q(o.util.patchQueryData(k,D,L.inversePatches,H))};if(B.status==="uninitialized")return L;let G;if("data"in B)if(je(B.data)){let[z,Y,re]=go(B.data,_);L.patches.push(...Y),L.inversePatches.push(...re),G=z}else G=_(B.data),L.patches.push({op:"replace",path:[],value:G}),L.inversePatches.push({op:"replace",path:[],value:B.data});return L.patches.length===0||Q(o.util.patchQueryData(k,D,L.patches,H)),L},h=(k,D,_)=>H=>H(o.endpoints[k].initiate(D,{subscribe:!1,forceRefetch:!0,[Tn]:()=>({data:_})})),S=(k,D)=>k.query&&k[D]?k[D]:iA,y=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(k,{signal:D,abort:_,rejectWithValue:H,fulfillWithValue:Q,dispatch:U,getState:V,extra:B}){let L=r[k.endpointName];try{let G=S(L,"transformResponse"),z={signal:D,abort:_,dispatch:U,getState:V,extra:B,endpoint:k.endpointName,type:k.type,forced:k.type==="query"?v(k,V()):void 0,queryCacheKey:k.type==="query"?k.queryCacheKey:void 0},Y=k.type==="query"?k[Tn]:void 0,re,se=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(ne,Z,ie,ge){if(Z==null&&ne.pages.length)return Promise.resolve({data:ne});let le={queryArg:k.originalArgs,pageParam:Z},fe=yield te(le),he=ge?f:p;return{data:{pages:he(ne.pages,fe.data,ie),pageParams:he(ne.pageParams,Z,ie)}}});return function se(_x51,_x52,_x53,_x54){return _ref25.apply(this,arguments)}}();function te(_x55){return _te.apply(this,arguments)}function _te(){_te=_asyncToGenerator(function*(ne){let Z,{extraOptions:ie}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(ne),z,ie):Z=yield L.queryFn(ne,z,ie,le=>t(le,z,ie)),typeof process<"u",Z.error)throw new jr(Z.error,Z.meta);let ge=yield G(Z.data,Z.meta,ne);return{...Z,data:ge}});return _te.apply(this,arguments)}if(k.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:ne}=L,{maxPages:Z=1/0}=ne,ie,ge={pages:[],pageParams:[]},le=a.selectQueryEntry(V(),k.queryCacheKey)?.data,he=v(k,V())&&!k.direction||!le?ge:le;if("direction"in k&&k.direction&&he.pages.length){let Oe=k.direction==="backward",dt=(Oe?Ud:Os)(ne,he);ie=yield se(he,dt,Z,Oe)}else{let{initialPageParam:Oe=ne.initialPageParam}=k,Ve=le?.pageParams??[],dt=Ve[0]??Oe,Xt=Ve.length;ie=yield se(he,dt,Z),Y&&(ie={data:ie.data.pages[0]});for(let Zt=1;Zt<Xt;Zt++){let Xr=Os(ne,ie.data);ie=yield se(ie.data,Xr,Z)}}re=ie}else re=yield te(k.originalArgs);return Q(re.data,ii({fulfilledTimeStamp:Date.now(),baseQueryMeta:re.meta}))}catch(G){let z=G;if(z instanceof jr){let Y=S(L,"transformErrorResponse");try{return H(yield Y(z.value,z.meta,k.originalArgs),ii({baseQueryMeta:z.meta}))}catch(re){z=re}}throw typeof process<"u",console.error(z),z}});return function y(_x49,_x50){return _ref24.apply(this,arguments)}}();function v(k,D){let _=a.selectQueryEntry(D,k.queryCacheKey),H=a.selectConfig(D).refetchOnMountOrArgChange,Q=_?.fulfilledTimeStamp,U=k.forceRefetch??(k.subscribe&&H);return U?U===!0||(Number(new Date)-Number(Q))/1e3>=U:!1}let R=()=>ce(`${e}/executeQuery`,y,{getPendingMeta({arg:D}){let _=r[D.endpointName];return ii({startedTimeStamp:Date.now(),...(js(_)?{direction:D.direction}:{})})},condition(D,{getState:_}){let H=_(),Q=a.selectQueryEntry(H,D.queryCacheKey),U=Q?.fulfilledTimeStamp,V=D.originalArgs,B=Q?.originalArgs,L=r[D.endpointName],G=D.direction;return ks(D)?!0:Q?.status==="pending"?!1:v(D,H)||qs(L)&&L?.forceRefetch?.({currentArg:V,previousArg:B,endpointState:Q,state:H})?!0:!(U&&!G)},dispatchConditionRejection:!0}),I=R(),C=R(),P=ce(`${e}/executeMutation`,y,{getPendingMeta(){return ii({startedTimeStamp:Date.now()})}}),x=k=>"force"in k,E=k=>"ifOlderThan"in k,M=(k,D,_)=>(H,Q)=>{let U=x(_)&&_.force,V=E(_)&&_.ifOlderThan,B=(G=!0)=>{let z={forceRefetch:G,isPrefetch:!0};return o.endpoints[k].initiate(D,z)},L=o.endpoints[k].select(D)(Q());if(U)H(B());else if(V){let G=L?.fulfilledTimeStamp;if(!G){H(B());return}(Number(new Date)-Number(new Date(G)))/1e3>=V&&H(B())}else H(B(!1))};function T(k){return D=>D?.meta?.arg?.endpointName===k}function F(k,D){return{matchPending:dr(wo(k),T(D)),matchFulfilled:dr(ot(k),T(D)),matchRejected:dr(Lt(k),T(D))}}return{queryThunk:I,mutationThunk:P,infiniteQueryThunk:C,prefetch:M,updateQueryData:g,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:F}}function Os(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Ud(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Ld(e,t,r,n){return Ms(r[e.meta.arg.endpointName][t],ot(e)?e.payload:void 0,An(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function ai(e,t,r){let n=e[t];n&&r(n)}function Dn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Pd(e,t,r){let n=e[Dn(t)];n&&r(n)}var On={};function sA({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:p}){let g=O(`${e}/resetApiState`);function h(T,F,k,D){var _;T[_=F.queryCacheKey]??(T[_]={status:"uninitialized",endpointName:F.endpointName}),ai(T,F.queryCacheKey,H=>{H.status="pending",H.requestId=k&&H.requestId?H.requestId:D.requestId,F.originalArgs!==void 0&&(H.originalArgs=F.originalArgs),H.startedTimeStamp=D.startedTimeStamp;let Q=o[D.arg.endpointName];js(Q)&&"direction"in F&&(H.direction=F.direction)})}function S(T,F,k,D){ai(T,F.arg.queryCacheKey,_=>{if(_.requestId!==F.requestId&&!D)return;let{merge:H}=o[F.arg.endpointName];if(_.status="fulfilled",H){if(_.data!==void 0){let{fulfilledTimeStamp:Q,arg:U,baseQueryMeta:V,requestId:B}=F,L=nt(_.data,G=>H(G,k,{arg:U.originalArgs,baseQueryMeta:V,fulfilledTimeStamp:Q,requestId:B}));_.data=L}else _.data=k;}else _.data=o[F.arg.endpointName].structuralSharing??!0?Md(Ne(_.data)?Da(_.data):_.data,k):k;delete _.error,_.fulfilledTimeStamp=F.fulfilledTimeStamp})}let y=Qt({name:`${e}/queries`,initialState:On,reducers:{removeQueryResult:{reducer(T,{payload:{queryCacheKey:F}}){delete T[F]},prepare:pr()},cacheEntriesUpserted:{reducer(T,F){for(let k of F.payload){let{queryDescription:D,value:_}=k;h(T,D,!0,{arg:D,requestId:F.meta.requestId,startedTimeStamp:F.meta.timestamp}),S(T,{arg:D,requestId:F.meta.requestId,fulfilledTimeStamp:F.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:T=>({payload:T.map(D=>{let{endpointName:_,arg:H,value:Q}=D,U=o[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:D.arg,queryCacheKey:n({queryArgs:H,endpointDefinition:U,endpointName:_})},value:Q}}),meta:{[Sn]:!0,requestId:wn(),timestamp:Date.now()}})},queryResultPatched:{reducer(T,{payload:{queryCacheKey:F,patches:k}}){ai(T,F,D=>{D.data=ja(D.data,k.concat())})},prepare:pr()}},extraReducers(T){T.addCase(t.pending,(F,{meta:k,meta:{arg:D}})=>{let _=ks(D);h(F,D,_,k)}).addCase(t.fulfilled,(F,{meta:k,payload:D})=>{let _=ks(k.arg);S(F,k,D,_)}).addCase(t.rejected,(F,{meta:{condition:k,arg:D,requestId:_},error:H,payload:Q})=>{ai(F,D.queryCacheKey,U=>{if(!k){if(U.requestId!==_)return;U.status="rejected",U.error=Q??H}})}).addMatcher(m,(F,k)=>{let{queries:D}=a(k);for(let[_,H]of Object.entries(D))(H?.status==="fulfilled"||H?.status==="rejected")&&(F[_]=H)})}}),v=Qt({name:`${e}/mutations`,initialState:On,reducers:{removeMutationResult:{reducer(T,{payload:F}){let k=Dn(F);k in T&&delete T[k]},prepare:pr()}},extraReducers(T){T.addCase(r.pending,(F,{meta:k,meta:{requestId:D,arg:_,startedTimeStamp:H}})=>{_.track&&(F[Dn(k)]={requestId:D,status:"pending",endpointName:_.endpointName,startedTimeStamp:H})}).addCase(r.fulfilled,(F,{payload:k,meta:D})=>{D.arg.track&&Pd(F,D,_=>{_.requestId===D.requestId&&(_.status="fulfilled",_.data=k,_.fulfilledTimeStamp=D.fulfilledTimeStamp)})}).addCase(r.rejected,(F,{payload:k,error:D,meta:_})=>{_.arg.track&&Pd(F,_,H=>{H.requestId===_.requestId&&(H.status="rejected",H.error=k??D)})}).addMatcher(m,(F,k)=>{let{mutations:D}=a(k);for(let[_,H]of Object.entries(D))(H?.status==="fulfilled"||H?.status==="rejected")&&_!==H?.requestId&&(F[_]=H)})}}),R=Qt({name:`${e}/invalidation`,initialState:On,reducers:{updateProvidedBy:{reducer(T,F){var _,H;let{queryCacheKey:k,providedTags:D}=F.payload;for(let Q of Object.values(T))for(let U of Object.values(Q)){let V=U.indexOf(k);V!==-1&&U.splice(V,1)}for(let{type:Q,id:U}of D){let V=(_=T[Q]??(T[Q]={}))[H=U||"__internal_without_id"]??(_[H]=[]);V.includes(k)||V.push(k)}},prepare:pr()}},extraReducers(T){T.addCase(y.actions.removeQueryResult,(F,{payload:{queryCacheKey:k}})=>{for(let D of Object.values(F))for(let _ of Object.values(D)){let H=_.indexOf(k);H!==-1&&_.splice(H,1)}}).addMatcher(m,(F,k)=>{var _,H;let{provided:D}=a(k);for(let[Q,U]of Object.entries(D))for(let[V,B]of Object.entries(U)){let L=(_=F[Q]??(F[Q]={}))[H=V||"__internal_without_id"]??(_[H]=[]);for(let G of B)L.includes(G)||L.push(G)}}).addMatcher(Ye(ot(t),An(t)),(F,k)=>{let D=Ld(k,"providesTags",o,f),{queryCacheKey:_}=k.meta.arg;R.caseReducers.updateProvidedBy(F,R.actions.updateProvidedBy({queryCacheKey:_,providedTags:D}))})}}),I=Qt({name:`${e}/subscriptions`,initialState:On,reducers:{updateSubscriptionOptions(T,F){},unsubscribeQueryResult(T,F){},internal_getRTKQSubscriptions(){}}}),C=Qt({name:`${e}/internalSubscriptions`,initialState:On,reducers:{subscriptionsUpdated:{reducer(T,F){return ja(T,F.payload)},prepare:pr()}}}),P=Qt({name:`${e}/config`,initialState:{online:Hv(),focused:$v(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(T,{payload:F}){T.middlewareRegistered=T.middlewareRegistered==="conflict"||i!==F?"conflict":!0}},extraReducers:T=>{T.addCase(Ds,F=>{F.online=!0}).addCase(Vd,F=>{F.online=!1}).addCase(Ts,F=>{F.focused=!0}).addCase(_d,F=>{F.focused=!1}).addMatcher(m,F=>({...F}))}}),x=or({queries:y.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:C.reducer,config:P.reducer}),E=(T,F)=>x(g.match(F)?void 0:T,F),M={...P.actions,...y.actions,...I.actions,...C.actions,...v.actions,...R.actions,resetApiState:g};return{reducer:E,actions:M}}var Fs=Symbol.for("RTKQ/skipToken"),Qd={status:"uninitialized"},kd=nt(Qd,()=>{}),Od=nt(Qd,()=>{});function cA({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=x=>kd,o=x=>Od;return{buildQuerySelector:S,buildInfiniteQuerySelector:y,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:I,selectApiState:a,selectQueries:m,selectMutations:p,selectQueryEntry:f,selectConfig:g};function i(x){return{...x,...Cd(x.status)}}function a(x){return x[t]}function m(x){return a(x)?.queries}function f(x,E){return m(x)?.[E]}function p(x){return a(x)?.mutations}function g(x){return a(x)?.config}function h(x,E,M){return T=>{if(T===Fs)return r(n,M);let F=e({queryArgs:T,endpointDefinition:E,endpointName:x});return r(D=>f(D,F)??kd,M)}}function S(x,E){return h(x,E,i)}function y(x,E){let{infiniteQueryOptions:M}=E;function T(F){let k={...F,...Cd(F.status)},{isLoading:D,isError:_,direction:H}=k,Q=H==="forward",U=H==="backward";return{...k,hasNextPage:C(M,k.data),hasPreviousPage:P(M,k.data),isFetchingNextPage:D&&Q,isFetchingPreviousPage:D&&U,isFetchNextPageError:_&&Q,isFetchPreviousPageError:_&&U}}return h(x,E,T)}function v(){return x=>{let E;return typeof x=="object"?E=Dn(x)??Fs:E=x,r(E===Fs?o:F=>a(F)?.mutations?.[E]??Od,i)}}function R(x,E){let M=x[t],T=new Set;for(let F of E.filter(si).map(Ps)){let k=M.provided[F.type];if(!k)continue;let D=(F.id!==void 0?k[F.id]:Rd(Object.values(k)))??[];for(let _ of D)T.add(_)}return Rd(Array.from(T.values()).map(F=>{let k=M.queries[F];return k?[{queryCacheKey:F,endpointName:k.endpointName,originalArgs:k.originalArgs}]:[]}))}function I(x,E){return Object.values(m(x)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function C(x,E){return E?Os(x,E)!=null:!1}function P(x,E){return!E||!x.getPreviousPageParam?!1:Ud(x,E)!=null}}var Td=WeakMap?new WeakMap:void 0,Dd=({endpointName:e,queryArgs:t})=>{let r="",n=Td?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ke(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));Ke(t)&&Td?.set(t,o),r=o}return`${e}(${r})`};function uA(...e){return function(r){let n=ur(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let g=Dd;if("serializeQueryArgs"in p.endpointDefinition){let h=p.endpointDefinition.serializeQueryArgs;g=S=>{let y=h(S);return typeof y=="string"?y:Dd({...S,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:wn(),extractRehydrationInfo:n,hasRehydrationInfo:ur(p=>n(p)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:p,endpoints:g}){if(p)for(let h of p)o.tagTypes.includes(h)||o.tagTypes.push(h);if(g)for(let[h,S]of Object.entries(g))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(p=>p.init(a,o,i));function f(p){let g=p.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(g)){if(p.overrideExisting!==!0&&h in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error(Pe(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let y of m)y.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ut(e,...t){return Object.assign(e,...t)}var lA=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(y,v)=>{var I,C;if(a.match(v)){let{queryCacheKey:P,requestId:x,options:E}=v.payload;return y?.[P]?.[x]&&(y[P][x]=E),!0}if(m.match(v)){let{queryCacheKey:P,requestId:x}=v.payload;return y[P]&&delete y[P][x],!0}if(e.internalActions.removeQueryResult.match(v))return delete y[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:x}}=v,E=y[I=P.queryCacheKey]??(y[I]={});return E[`${x}_running`]={},P.subscribe&&(E[x]=P.subscriptionOptions??E[x]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=y[v.meta.arg.queryCacheKey]||{},x=`${v.meta.requestId}_running`;R||(R=!!P[x]),delete P[x]}if(t.rejected.match(v)){let{meta:{condition:P,arg:x,requestId:E}}=v;if(P&&x.subscribe){let M=y[C=x.queryCacheKey]??(y[C]={});M[E]=x.subscriptionOptions??M[E]??{},R=!0}}return R},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:y=>{let R=p()[y]??{};return qr(R)},isRequestSubscribed:(y,v)=>!!p()?.[y]?.[v]};return(y,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(y))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(y))return[!1,S];let R=f(r.currentSubscriptions,y),I=!0;if(R){i||(i=setTimeout(()=>{let x=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=go(o,()=>x);v.next(e.internalActions.subscriptionsUpdated(E)),o=x,i=null},500));let C=typeof y.type=="string"&&!!y.type.startsWith(n),P=t.rejected.match(y)&&y.meta.condition&&!!y.meta.arg.subscribe;I=!C&&!P}return[I,!1]}};function dA(e){for(let t in e)return!1;return!0}var pA=2147483647/1e3-1,fA=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:p}=t.internalActions,g=Ye(f.match,r.fulfilled,r.rejected,p.match);function h(I){let C=o.currentSubscriptions[I];return!!C&&!dA(C)}let S={},y=(I,C,P)=>{let x=C.getState(),E=a(x);if(g(I)){let M;if(p.match(I))M=I.payload.map(T=>T.queryDescription.queryCacheKey);else{let{queryCacheKey:T}=f.match(I)?I.payload:I.meta.arg;M=[T]}v(M,C,E)}if(t.util.resetApiState.match(I))for(let[M,T]of Object.entries(S))T&&clearTimeout(T),delete S[M];if(n.hasRehydrationInfo(I)){let{queries:M}=n.extractRehydrationInfo(I);v(Object.keys(M),C,E)}};function v(I,C,P){let x=C.getState();for(let E of I){let M=i(x,E);R(E,M?.endpointName,C,P)}}function R(I,C,P,x){let M=n.endpointDefinitions[C]?.keepUnusedDataFor??x.keepUnusedDataFor;if(M===1/0)return;let T=Math.max(0,Math.min(M,pA));if(!h(I)){let F=S[I];F&&clearTimeout(F),S[I]=setTimeout(()=>{h(I)||P.dispatch(m({queryCacheKey:I})),delete S[I]},T*1e3)}}return y},qd=new Error("Promise never resolved before cacheEntryRemoved."),mA=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=bo(n),p=bo(o),g=ot(n,o),h={};function S(C,P,x){let E=h[C];E?.valueResolved&&(E.valueResolved({data:P,meta:x}),delete E.valueResolved)}function y(C){let P=h[C];P&&(delete h[C],P.cacheEntryRemoved())}let v=(C,P,x)=>{let E=R(C);function M(T,F,k,D){let _=a(x,F),H=a(P.getState(),F);!_&&H&&I(T,D,F,P,k)}if(n.pending.match(C))M(C.meta.arg.endpointName,E,C.meta.requestId,C.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(C))for(let{queryDescription:T,value:F}of C.payload){let{endpointName:k,originalArgs:D,queryCacheKey:_}=T;M(k,_,C.meta.requestId,D),S(_,F,{})}else if(o.pending.match(C))P.getState()[t].mutations[E]&&I(C.meta.arg.endpointName,C.meta.arg.originalArgs,E,P,C.meta.requestId);else if(g(C))S(E,C.payload,C.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(C)||e.internalActions.removeMutationResult.match(C))y(E);else if(e.util.resetApiState.match(C))for(let T of Object.keys(h))y(T)};function R(C){return f(C)?C.meta.arg.queryCacheKey:p(C)?C.meta.arg.fixedCacheKey??C.meta.requestId:e.internalActions.removeQueryResult.match(C)?C.payload.queryCacheKey:e.internalActions.removeMutationResult.match(C)?Dn(C.payload):""}function I(C,P,x,E,M){let T=r.endpointDefinitions[C],F=T?.onCacheEntryAdded;if(!F)return;let k={},D=new Promise(B=>{k.cacheEntryRemoved=B}),_=Promise.race([new Promise(B=>{k.valueResolved=B}),D.then(()=>{throw qd})]);_.catch(()=>{}),h[x]=k;let H=e.endpoints[C].select(T.type==="query"?P:x),Q=E.dispatch((B,L,G)=>G),U={...E,getCacheEntry:()=>H(E.getState()),requestId:M,extra:Q,updateCachedData:T.type==="query"?B=>E.dispatch(e.util.updateQueryData(C,P,B)):void 0,cacheDataLoaded:_,cacheEntryRemoved:D},V=F(P,U);Promise.resolve(V).catch(B=>{if(B!==qd)throw B})}return v},gA=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},yA=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:p}=i.internalActions,g=Ye(ot(n),An(n)),h=Ye(ot(n,o),Lt(n,o)),S=[],y=(I,C)=>{g(I)?R(Ld(I,"invalidatesTags",r,a),C):h(I)?R([],C):i.util.invalidateTags.match(I)&&R(Ms(I.payload,void 0,void 0,void 0,void 0,a),C)};function v(I){let{queries:C,mutations:P}=I;for(let x of[C,P])for(let E in x)if(x[E]?.status==="pending")return!0;return!1}function R(I,C){let P=C.getState(),x=P[e];if(S.push(...I),x.config.invalidationBehavior==="delayed"&&v(x))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(P,E);t.batch(()=>{let T=Array.from(M.values());for(let{queryCacheKey:F}of T){let k=x.queries[F],D=f.currentSubscriptions[F]??{};k&&(qr(D)===0?C.dispatch(p({queryCacheKey:F})):k.status!=="uninitialized"&&C.dispatch(m(k)))}})}return y},hA=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(y,v)=>{(r.internalActions.updateSubscriptionOptions.match(y)||r.internalActions.unsubscribeQueryResult.match(y))&&p(y.payload,v),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&p(y.meta.arg,v),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&f(y.meta.arg,v),r.util.resetApiState.match(y)&&h()};function m(y,v){let I=v.getState()[e].queries[y],C=o.currentSubscriptions[y];if(!(!I||I.status==="uninitialized"))return C}function f({queryCacheKey:y},v){let R=v.getState()[e],I=R.queries[y],C=o.currentSubscriptions[y];if(!I||I.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:x}=S(C);if(!Number.isFinite(P))return;let E=i[y];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+P;i[y]={nextPollTimestamp:M,pollingInterval:P,timeout:setTimeout(()=>{(R.config.focused||!x)&&v.dispatch(n(I)),f({queryCacheKey:y},v)},P)}}function p({queryCacheKey:y},v){let I=v.getState()[e].queries[y],C=o.currentSubscriptions[y];if(!I||I.status==="uninitialized")return;let{lowestPollingInterval:P}=S(C);if(!Number.isFinite(P)){g(y);return}let x=i[y],E=Date.now()+P;(!x||E<x.nextPollTimestamp)&&f({queryCacheKey:y},v)}function g(y){let v=i[y];v?.timeout&&clearTimeout(v.timeout),delete i[y]}function h(){for(let y of Object.keys(i))g(y)}function S(y={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let I in y)y[I].pollingInterval&&(R=Math.min(y[I].pollingInterval,R),v=y[I].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return a},SA=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=wo(r,n),i=Lt(r,n),a=ot(r,n),m={};return(p,g)=>{if(o(p)){let{requestId:h,arg:{endpointName:S,originalArgs:y}}=p.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let I={},C=new Promise((M,T)=>{I.resolve=M,I.reject=T});C.catch(()=>{}),m[h]=I;let P=e.endpoints[S].select(v.type==="query"?y:h),x=g.dispatch((M,T,F)=>F),E={...g,getCacheEntry:()=>P(g.getState()),requestId:h,extra:x,updateCachedData:v.type==="query"?M=>g.dispatch(e.util.updateQueryData(S,y,M)):void 0,queryFulfilled:C};R(y,E)}}else if(a(p)){let{requestId:h,baseQueryMeta:S}=p.meta;m[h]?.resolve({data:p.payload,meta:S}),delete m[h]}else if(i(p)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:y}=p.meta;m[h]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:y}),delete m[h]}}},vA=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,p)=>{Ts.match(f)&&m(p,"refetchOnFocus"),Ds.match(f)&&m(p,"refetchOnReconnect")};function m(f,p){let g=f.getState()[e],h=g.queries,S=o.currentSubscriptions;t.batch(()=>{for(let y of Object.keys(S)){let v=h[y],R=S[y];if(!R||!v)continue;(Object.values(R).some(C=>C[p]===!0)||Object.values(R).every(C=>C[p]===void 0)&&g.config[p])&&(qr(R)===0?f.dispatch(i({queryCacheKey:y})):v.status!=="uninitialized"&&f.dispatch(n(v)))}})}return a};function AA(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:O(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[gA,fA,yA,hA,mA,SA];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:m},R=f.map(P=>P(v)),I=lA(v),C=vA(v);return P=>x=>{if(!ar(x))return P(x);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:P},M=h.getState(),[T,F]=I(x,E,M),k;if(T?k=P(x):k=F,h.getState()[t]&&(C(x,E,M),m(x)||o.hasRehydrationInfo(x)))for(let D of R)D(x,E,M);return k}},actions:a};function g(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var jd=Symbol(),wA=({createSelector:e=ye}={})=>({name:jd,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:p,invalidationBehavior:g},h){qu();let S=te=>(typeof process<"u",te);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Ds,onOffline:Vd,onFocus:Ts,onFocusLost:_d},util:{}});let y=cA({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:I,buildInfiniteQuerySelector:C,buildMutationSelector:P}=y;ut(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:x,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:T,updateQueryData:F,upsertQueryData:k,prefetch:D,buildMatchThunkActions:_}=aA({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:y}),{reducer:H,actions:Q}=sA({context:h,queryThunk:x,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:p,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});ut(t.util,{patchQueryData:T,updateQueryData:F,upsertQueryData:k,prefetch:D,resetApiState:Q.resetApiState,upsertQueryEntries:Q.cacheEntriesUpserted}),ut(t.internalActions,Q);let{middleware:U,actions:V}=AA({reducerPath:o,context:h,queryThunk:x,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:y});ut(t.util,V),ut(t,{reducer:H,middleware:U});let{buildInitiateQuery:B,buildInitiateInfiniteQuery:L,buildInitiateMutation:G,getRunningMutationThunk:z,getRunningMutationsThunk:Y,getRunningQueriesThunk:re,getRunningQueryThunk:se}=oA({queryThunk:x,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ut(t.util,{getRunningMutationThunk:z,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:re}),{name:jd,injectEndpoint(te,ne){var ge;let ie=(ge=t.endpoints)[te]??(ge[te]={});qs(ne)&&ut(ie,{name:te,select:I(te,ne),initiate:B(te,ne)},_(x,te)),tA(ne)&&ut(ie,{name:te,select:P(),initiate:G(te)},_(M,te)),js(ne)&&ut(ie,{name:te,select:C(te,ne),initiate:L(te,ne)},_(x,te))}}}}),ui=uA(wA());d();c();l();u();var Ns=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,m=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=Se(a,i);return{data:Nd({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${m}`,fetchFn:function(){var _ref27=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,y={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{y[v]=h[v]}),y.duplex="half",y.body=yield h.text(),w(S,y)});return function fetchFn(_x59){return _ref27.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(p){return{error:p}}});return function Ns(_x56,_x57,_x58){return _ref26.apply(this,arguments)}}(),Bd=ui({reducerPath:"answer",baseQuery:ci(Ns,{maxRetries:3}),endpoints:()=>({})});var Mr=ui({reducerPath:"answerGenerationApi",refetchOnMountOrArgChange:!0,baseQuery:ci(Ns,{maxRetries:3}),endpoints:()=>({})});d();c();l();u();d();c();l();u();d();c();l();u();var Gt=e=>e.query,$d=e=>e.query?.enableQuerySyntax;var oj=ye(e=>Gt(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),bA=ye(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();d();c();l();u();var li=()=>({contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!1,isLoading:!0});d();c();l();u();d();c();l();u();d();c();l();u();function Gd(_x60,_x61){return _Gd.apply(this,arguments)}function _Gd(){_Gd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Gd.apply(this,arguments)}function zd(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=xA(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let p=-1;for(;r<m&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(f,p),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Wd(e,t,r){let n=Hd(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=Hd();else if(m>0){let f=o.decode(a.subarray(0,m)),p=m+(a[m+1]===32?2:1),g=o.decode(a.subarray(p));switch(f){case"data":n.data=n.data?`${n.data}
31
- ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":CA(g,n,t);break}}}}function CA(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function xA(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Hd(){return{data:"",event:"",id:"",retry:void 0}}var _s="text/event-stream",RA=1e3,Kd="last-event-id";function Yd(){return typeof window<"u"}function di(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:m,fetch:f,...p}){return new Promise((g,h)=>{let S={...r};S.accept||(S.accept=_s);let y;function v(){y?.abort(),document.hidden||E()}!m&&Yd()&&document.addEventListener("visibilitychange",v);let R=RA,I;function C(){Yd()&&document.removeEventListener("visibilitychange",v),clearTimeout(I),y?.abort()}t?.addEventListener("abort",()=>{C(),g()});let P=f??w,x=n??EA;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){y=s.AbortController?new s.AbortController:null;try{let M=yield P(e,{...p,headers:S,signal:y?.signal});yield x(M),yield Gd(M.body,zd(Wd(T=>{T?S[Kd]=T:delete S[Kd]},T=>{R=T},o))),i?.(),C(),g()}catch(M){if(!y?.signal?.aborted)try{let T=a?.(M)??R;clearTimeout(I),I=setTimeout(E,T)}catch(T){C(),h(T)}}});return _E.apply(this,arguments)}E()})}function EA(e){let t=e.headers.get("content-type");if(!t?.startsWith(_s))throw new Error(`Expected content-type to be ${_s}, Actual: ${t}`)}d();c();l();u();d();c();l();u();var Jd=(e,t)=>{t&&(e.answerId=t)},Xd=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Zd=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},ep=(e,t)=>{e.citations=t.citations},tp=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},rp=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code??500},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)};var pi={handleOpen:(e,t)=>{let r=e.headers.get("x-answer-id");r&&t(n=>{Jd(n,r)})},handleMessage:{"agentInteraction.answerHeader":(e,t)=>{t(r=>{Xd(r,{contentFormat:"text/markdown"})})},"generativeengines.messageType":(e,t)=>{e?.payload?.textDelta&&t(r=>{Zd(r,e.payload)})},"agentInteraction.citations":(e,t)=>{e?.payload?.citations!==void 0&&t(r=>{ep(r,e.payload)})},"generativeengines.endOfStreamType":(e,t)=>{t(r=>{tp(r,e.payload)})},error:(e,t)=>{e.finishReason==="ERROR"&&t(r=>{rp(r,e)})}}};var fi=(e,t,r,n)=>{let{dispatch:o,updateCachedData:i,getState:a}=r,{configuration:{accessToken:m}}=a();return di(e,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${m}`,Accept:"text/event-stream","Content-Type":"application/json","Accept-Encoding":"*"},fetch:w,onopen:function(){var _ref28=_asyncToGenerator(function*(f){pi.handleOpen(f,i),n.handleOpen(f,o)});return function onopen(_x62){return _ref28.apply(this,arguments)}}(),onclose:()=>{n.handleClose?.(o)},onerror:f=>{n.handleError(f)},onmessage:f=>{let p=IA(f.data);if(!p)return;pi.handleMessage.error?.(p,i),n.handleMessage.error?.(p,o);let g=p.payloadType;pi.handleMessage[g]?.(p,i),n.handleMessage[g]?.(p,o)}})};function IA(e){if(!e?.length)return null;try{return JSON.parse(e)}catch(t){return console.warn("Failed to parse message",{payload:e,error:t}),null}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var np=e=>{let{configuration:t}=e,{organizationId:r,environment:n,knowledge:{agentId:o}}=t,i=Se(r,n),a=o?.trim();if(!i||!r||!a)throw new Error("Missing required parameters for follow up endpoint");let m=`/api/preview/organizations/${r}/agents`;return`${i}${m}/${a}/follow-up`};var FA=Mr.injectEndpoints({overrideExisting:!0,endpoints:e=>({generateFollowUpAnswer:e.query({queryFn:()=>({data:li()}),onQueryStarted(_x63,_x64){return _asyncToGenerator(function*(t,{getState:r,updateCachedData:n,dispatch:o}){let{strategyKey:i,...a}=t,m=np(r());yield fi(m,a,{getState:r,updateCachedData:n,dispatch:o},mi[i]?.())}).apply(this,arguments)}})})}),op=e=>FA.endpoints.generateFollowUpAnswer.initiate(e);d();c();l();u();var ip=(e,t)=>({conversationId:t.followUpAnswers?.conversationId??"",q:e});var PA=new $({required:!0}),ap=O("followUpAnswers/setIsEnabled",e=>N(e,new ee({required:!0}))),sp=O("followUpAnswers/setFollowUpAnswersConversationId",e=>N(e,W)),kA=O("followUpAnswers/createFollowUpAnswer",e=>N(e,{question:W})),cp=O("followUpAnswers/setActiveFollowUpAnswerId",e=>N(e,W)),up=O("followUpAnswers/setFollowUpAnswerContentFormat",e=>N(e,{contentFormat:gi,answerId:W})),lp=O("followUpAnswers/setFollowUpIsLoading",e=>N(e,{isLoading:new ee({required:!0}),answerId:W})),dp=O("followUpAnswers/followUpMessageChunkReceived",e=>N(e,{textDelta:PA,answerId:W})),pp=O("followUpAnswers/followUpCitationsReceived",e=>N(e,{citations:new oe({required:!0,each:new K({values:Vs})}),answerId:W})),fp=O("followUpAnswers/followUpCompleted",e=>N(e,{answerId:W,cannotAnswer:new ee({required:!1})})),mp=O("followUpAnswers/followUpFailed",e=>N(e,{message:new $,code:new J({min:0}),answerId:W})),SM=O("followUpAnswers/likeFollowUp",e=>N(e,{answerId:W})),vM=O("followUpAnswers/dislikeFollowUp",e=>N(e,{answerId:W})),AM=O("followUpAnswers/submitFollowUpFeedback",e=>N(e,{answerId:W})),gp=O("followUpAnswers/resetFollowUpAnswers"),wM=ce("generatedAnswerWithFollowUps/generateFollowUpAnswer",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{logger:n}}){let o=t(),i=Ir(o)?.trim(),a=ip(e,o);if(!i){n.warn("Missing agentId in engine configuration. The generateFollowUpAnswer action requires an agent ID.");return}if(!a.conversationId){n.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}r(kA({question:e})),yield r(op({strategyKey:"follow-up-answer",...a}))});return function(_x65,_x66){return _ref29.apply(this,arguments)}}());var yp=()=>{let e=null;return{handleOpen:(t,r)=>{e=t.headers.get("x-answer-id"),e&&(r(cp(e)),r(lp({answerId:e,isLoading:!0})),r(up({contentFormat:"text/markdown",answerId:e})))},handleError:t=>{throw t},handleMessage:{"generativeengines.messageType":(t,r)=>{t?.payload?.textDelta&&r(dp({textDelta:t.payload.textDelta,answerId:e}))},"agentInteraction.citations":(t,r)=>{t?.payload?.citations!==void 0&&r(pp({citations:t.payload.citations,answerId:e}))},"generativeengines.endOfStreamType":(t,r)=>{let n=t?.payload?.answerGenerated??!1;r(fp({cannotAnswer:!n,answerId:e}))},error:(t,r)=>{t.finishReason==="ERROR"&&r(mp({answerId:e,message:t.errorMessage,code:t.code}))}}}};d();c();l();u();d();c();l();u();var Nr=e=>ke({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ht(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ht(t)??"",answerGenerated:e??!1})}),_r=()=>ke({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Ht(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});var hp=()=>({handleOpen:(e,t)=>{let r=e.headers.get("x-answer-id");r&&t(yi(r))},handleError:e=>{throw e},handleMessage:{"agentInteraction.answerHeader":(e,t)=>{e?.payload?.conversationId&&t(sp(e.payload.conversationId)),e.payload.followUpEnabled&&t(ap(e.payload.followUpEnabled)),t(Nn("text/markdown")),t(qn(!0)),t(Vr(!1))},"generativeengines.messageType":(e,t)=>{e?.payload?.textDelta&&t(jn({textDelta:e.payload.textDelta}))},"agentInteraction.citations":(e,t)=>{e?.payload?.citations!==void 0&&t(Mn({citations:e.payload.citations}))},"generativeengines.endOfStreamType":(e,t)=>{let r=e?.payload?.answerGenerated??!1;t(Ls(r)),t(_n(!r)),t(qn(!1)),t(Vr(!1)),t(Nr(r)),t(_r())},error:(e,t)=>{e.finishReason==="ERROR"&&t(Us(e))}}});var mi={"head-answer":hp,"follow-up-answer":yp};d();c();l();u();var Sp=e=>{let{configuration:t}=e,{organizationId:r,environment:n,knowledge:{agentId:o}}=t,i=Se(r,n),a=o?.trim();if(!i||!r||!a)throw new Error("Missing required parameters for answer endpoint");let m=`/api/preview/organizations/${r}/agents`;return`${i}${m}/${a}/answer`};var OA=Mr.injectEndpoints({overrideExisting:!0,endpoints:e=>({generateAnswer:e.query({queryFn:()=>({data:li()}),onQueryStarted(_x67,_x68){return _asyncToGenerator(function*(t,{getState:r,updateCachedData:n,dispatch:o}){let{strategyKey:i,...a}=t,m=Sp(r());yield fi(m,a,{getState:r,updateCachedData:n,dispatch:o},mi[i]?.())}).apply(this,arguments)}})})}),vp=e=>OA.endpoints.generateAnswer.initiate(e);d();c();l();u();d();c();l();u();var Ap=ye(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Vn=(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:br(e)}});d();c();l();u();var wp=e=>e.context;d();c();l();u();var Qs=e=>e.pipeline;d();c();l();u();d();c();l();u();var Un=$e(hi(),1),Ip=$e(bp(),1);d();c();l();u();var Si=$e(hi(),1),xp=$e(Cp(),1);Si.default.extend(xp.default);var Rp="YYYY/MM/DD@HH:mm:ss",TA="1401-01-01";function Ur(e,t){let r=(0,Si.default)(e,t);return!r.isValid()&&!t?(0,Si.default)(e,Rp):r}function vi(e){return e.format(Rp)}function Ep(e,t){let r=Ur(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}Ks(r)}function Ks(e){if(e.isBefore(TA))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Un.default.extend(Ip.default);var Fp=["past","now","next"],Pp=["minute","hour","day","week","month","quarter","year"],DA=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new $({required:!t,constrainTo:Pp}),period:new $({required:!0,constrainTo:Fp})}};function Ys(e){if(typeof e=="string"&&!wt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?qp(e):e;new Te(DA(t.period)).validate(t);let r=Op(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Ks(r)}function kp(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Op(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Un.default)().subtract(r,n);case"next":return(0,Un.default)().add(r,n);case"now":return(0,Un.default)()}}function Ln(e){return vi(Op(qp(e)))}function Tp(e){return e.toLocaleLowerCase().split("-")}function wt(e){let[t,r,n]=Tp(e);if(t==="now")return!0;if(!Fp.includes(t)||!Pp.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Dp(e){return!!e&&typeof e=="object"&&"period"in e}function qp(e){let[t,r,n]=Tp(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function jp(e){return e.type==="dateRange"}function Mp(e){return`start${e}`}function Np(e){return`end${e}`}var Js=()=>({dateFacetValueMap:{}});function qA(e,t,r){let n=e.start,o=e.end;return wt(n)&&(n=Ln(n),r.dateFacetValueMap[t][Mp(n)]=e.start),wt(o)&&(o=Ln(o),r.dateFacetValueMap[t][Np(o)]=e.end),{...e,start:n,end:o}}function Xs(e,t){if(jp(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>qA(o,r,t))}}return e}function bt(e){let t=Js();return{request:{...e,facets:e.facets?.map(n=>Xs(n,t))},mappings:t}}function jA(e,t,r){return{...e,start:r.dateFacetValueMap[t][Mp(e.start)]||e.start,end:r.dateFacetValueMap[t][Np(e.end)]||e.end}}function MA(e,t){return e.facetId in t.dateFacetValueMap}function NA(e,t){return MA(e,t)?{...e,values:e.values.map(r=>jA(r,e.facetId,t))}:e}function Ai(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>NA(n,t))}}:e}d();c();l();u();d();c();l();u();d();c();l();u();function Ct(e){return Object.values(e).map(t=>t.request)}function Zs(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function _p(e){return Ct(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ec={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function _A(e){return Ct(e).map(t=>{let r=ec[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function VA(e){return[..._A(e.facetSet??{}),..._p(e.numericFacetSet??{}),..._p(e.dateFacetSet??{}),...Ct(e.categoryFacetSet??{})]}function UA(e){return VA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function wi(e){return Zs(UA(e),e.facetOrder??[])}d();c();l();u();d();c();l();u();var xt=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Le.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield ti(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function xt(_x69,_x70){return _ref30.apply(this,arguments)}}();d();c();l();u();var Lr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Vn(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();var Vp=ye(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Rt=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t,r){let n=rc(e),o=LA(e),i=QA(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield xt(e,r):Lr(e,t,r);return bt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:tc(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Rt(_x71,_x72,_x73){return _ref31.apply(this,arguments)}}();function tc(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function LA(e){return Zs($A(e),e.facetOrder??[])}function QA(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(BA).filter(r=>r.currentValues.length>0):void 0}function BA(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function $A(e){return HA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function HA(e){return[...GA(e.facetSet??{}),...Up(e.numericFacetSet??{}),...Up(e.dateFacetSet??{}),...Ct(e.categoryFacetSet??{})]}function GA(e){return Ct(e).map(t=>{let r=ec[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Up(e){return Ct(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function rc(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Vp(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}d();c();l();u();d();c();l();u();var Qn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},zA=e=>t=>e.every(r=>!X(Qn(t,r))),WA=e=>t=>e.every(r=>X(Qn(t,r))),KA=(e,t)=>r=>{let n=Lp(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},YA=(e,t)=>r=>{let n=Lp(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Lp=(e,t)=>{let r=Qn(t,e);return Zc(r)?r:[r]},Qp={getResultProperty:Qn,fieldsMustBeDefined:zA,fieldsMustNotBeDefined:WA,fieldMustMatch:KA,fieldMustNotMatch:YA};var nc=ye(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var oc=e=>e.searchHub;d();c();l();u();var ic=ye(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),LV=ye(e=>e,e=>{let t=ic(e);return t&&e?e[t].expression:""});d();c();l();u();var Bp=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var $p=e=>e.excerptLength?.length;d();c();l();u();var Hp=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var Gp=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var zp=e=>e.sortCriteria;var Wp=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Se(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Wp(_x74){return _ref32.apply(this,arguments)}}(),Kp=(e,t)=>{let r=Gt(e)?.q,{aq:n,cq:o,dq:i,lq:a}=XA(e),m=wp(e),f=Vn(e.configuration.analytics,t,{actionCause:nc(e)}),p=oc(e),g=Qs(e),h=gs(e)??[],S=Jp(e),y=ic(e.tabSet)||"default",v=fs(e),R=Xl(e),I=t.referrer||"",C=Hp(e),P=zp(e),x=JA(e),E=$p(e),M=Gp(e),T=Bp(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:$d(e)}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(p?.length&&{searchHub:p}),...(g?.length&&{pipeline:g}),...(S.length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:tc(e),firstResult:e.pagination.firstResult}),tab:y,locale:v,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:I,...x,...(M??{}),...(E&&{excerptLength:E}),...(T&&{dictionaryFieldContext:T}),sortCriteria:P,...(C&&{facetOptions:C}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Yp=(e,t)=>{let r=Gt(e)?.q,n=Jp(e),o=Vn(e.configuration.analytics,t,{actionCause:nc(e)}),i=fs(e),a=oc(e),m=Qs(e),f=gs(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(a?.length&&{searchHub:a}),...(m?.length&&{pipeline:m}),...o,locale:i}},Jp=e=>wi(e)?.map(t=>Xs(t,Js())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),JA=e=>({actionsHistory:e.configuration.analytics.enabled?Le.getInstance().getHistory():[]}),XA=e=>{let t=Ap(e),r=rc(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Xp=["text/plain","text/markdown"];var Qr=new $({required:!0}),Zp=new $,Br=new ee({required:!0}),Vs={id:Qr,title:Qr,uri:Qr,permanentid:Qr,clickUri:Zp},gi=new $({required:!0,constrainTo:Xp}),nL=O("generatedAnswer/setIsVisible",e=>N(e,Br)),yi=O("generatedAnswer/setAnswerId",e=>N(e,W)),oL=O("generatedAnswer/setAnswerGenerationMode",e=>N(e,new $({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),iL=O("generatedAnswer/setIsEnabled",e=>N(e,Br)),jn=O("generatedAnswer/updateMessage",e=>N(e,{textDelta:Qr})),Mn=O("generatedAnswer/updateCitations",e=>N(e,{citations:new oe({required:!0,each:new K({values:Vs})})})),Us=O("generatedAnswer/updateError",e=>N(e,{message:Zp,code:new J({min:0})})),Bn=O("generatedAnswer/resetAnswer"),aL=O("generatedAnswer/like"),sL=O("generatedAnswer/dislike"),cL=O("generatedAnswer/feedbackModal/open"),uL=O("generatedAnswer/expand"),lL=O("generatedAnswer/collapse"),dL=O("generatedAnswer/setId",e=>N(e,{id:new $({required:!0})})),pL=O("generatedAnswer/feedbackModal/close"),fL=O("generatedAnswer/sendFeedback"),Vr=O("generatedAnswer/setIsLoading",e=>N(e,Br)),qn=O("generatedAnswer/setIsStreaming",e=>N(e,Br)),Nn=O("generatedAnswer/setAnswerContentFormat",e=>N(e,gi)),mL=O("generatedAnswer/updateResponseFormat",e=>N(e,{contentFormat:new oe({each:gi,default:["text/plain"]})})),gL=O("knowledge/updateAnswerConfigurationId",e=>N(e,Qr)),yL=O("generatedAnswer/registerFieldsToIncludeInCitations",e=>N(e,Ro)),Ls=O("generatedAnswer/setIsAnswerGenerated",e=>N(e,Br)),_n=O("generatedAnswer/setCannotAnswer",e=>N(e,Br)),ef=O("generatedAnswer/setAnswerApiQueryParams",e=>N(e,new K({}))),hL=ce("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,p=yield Wp(r),g=(y,v)=>{switch(y){case"genqa.headerMessageType":{let R=JSON.parse(v);n(Nn(R.contentFormat));break}case"genqa.messageType":n(jn(JSON.parse(v)));break;case"genqa.citationsType":n(Mn(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,I=m.length!==0&&!R;n(_n(I)),n(qn(!1)),n(Ls(R)),n(Nr(R)),n(_r());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(Vr(!0));let h=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:y=>{h(p)&&(n(Vr(!1)),y.payload&&y.payloadType&&g(y.payloadType,y.payload))},abort:y=>{h(p)&&n(Us(y))},close:()=>{h(p)&&n(qn(!1))},resetAnswer:()=>{h(p)&&n(Bn())}});S?f(S):n(Vr(!1))});return function(_x75,_x76){return _ref33.apply(this,arguments)}}()),SL=ce("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(Bn());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=Kp(i,n);r(ef(a)),yield r(rf(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x77,_x78){return _ref34.apply(this,arguments)}}()),tf=ce("generatedAnswerWithFollowUps/generateHeadAnswer",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){let i=t();if(!Ir(i)){o.warn("Missing agentId in engine configuration. The generateHeadAnswer action requires an agent ID.");return}r(Bn());let m=Yp(i,n),f={...m,strategyKey:"head-answer"};r(ef(m)),yield r(vp(f))});return function(_x79,_x80){return _ref35.apply(this,arguments)}}());var ZA=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},ew=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},tw=(e,t)=>{e.citations=t.citations},rw=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},nw=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},ow=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&nw(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(ZA(t,o),r(Nn(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(ew(t,o),r(jn({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(tw(t,o),r(Mn({citations:o.citations})));break;case"genqa.endOfStreamType":rw(t,o),r(Nr(o.answerGenerated??!1)),r(_r());break}},iw=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},ac=Bd.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x81,_x82){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:m,insightConfiguration:f}=r(),{organizationId:p,environment:g,accessToken:h}=a,S=Se(p,g),y=iw(S,p,m.answerConfigurationId,f?.insightId);yield di(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:w,onopen:function(){var _ref36=_asyncToGenerator(function*(v){let R=v.headers.get("x-answer-id");R&&o(I=>{I.answerId=R,i(yi(R))})});return function onopen(_x83){return _ref36.apply(this,arguments)}}(),onmessage:v=>{o(R=>{ow(v,R,i)})},onerror:v=>{throw v},onclose:()=>{o(v=>{i(_n(!v.generated))})}})}).apply(this,arguments)}})})}),rf=e=>ac.endpoints.getAnswer.initiate(e);d();c();l();u();var nf=me(fr,e=>e);d();c();l();u();function aw(e){let t=e.payload?.analyticsAction;return of(e)&&!X(t)}function of(e){return"type"in e}var af=e=>t=>r=>{let n;aw(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return of(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var JL=O("tab/register",e=>{let t=new K({values:{id:W,expression:xe}});return N(e,t)}),bi=O("tab/updateActiveTab",e=>N(e,W));d();c();l();u();var Ci=$e(hi(),1),uf=$e(sf(),1),lf=$e(cf(),1);Ci.default.extend(lf.default);Ci.default.extend(uf.default);var df=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Ci.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var sw=/(^|; )Coveo-Pendragon=([^;]*)/;function dc(){return typeof window>"u"?!1:sw.exec(document.cookie)?.pop()||null}var pf=me(df(),e=>e.addCase(yt,(t,r)=>{cw(t,r.payload)}).addCase(Je,(t,r)=>{uw(t,r.payload)}).addCase(mr,(t,r)=>{lw(t,r.payload)}).addCase(gr,t=>{t.analytics.enabled=!1}).addCase(yr,t=>{t.analytics.enabled=!0}).addCase(Eo,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Io,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(bi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(vl,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ht,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(hl,(t,{payload:r})=>{t.knowledge.agentId=r}));function cw(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function uw(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function lw(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=dc();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Ge=pf;d();c();l();u();function dw(e){return e.instantlyCallable}var ff=()=>e=>t=>e(dw(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();var xi=O("breadcrumb/deselectAll"),mf=O("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var gf=O("facet/updateFacetAutoSelection",e=>N(e,{allow:new ee({required:!0})}));d();c();l();u();d();c();l();u();var Ri=class extends vt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??_e().q}get responseTime(){return this.activeInstantResultCache?.duration??We().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??We().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var yf=()=>ke("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ri(e)),hf=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var pc={id:W},pw={...pc,q:xe},C1=O("instantResults/register",e=>N(e,pc)),Ei=O("instantResults/updateQuery",e=>N(e,pw)),x1=O("instantResults/clearExpired",e=>N(e,pc));d();c();l();u();var Ii=new J({required:!0,min:0}),Fi=O("pagination/registerNumberOfResults",e=>N(e,Ii)),Pi=O("pagination/updateNumberOfResults",e=>N(e,Ii)),ki=O("pagination/registerPage",e=>N(e,Ii)),$r=O("pagination/updatePage",e=>N(e,Ii)),Oi=O("pagination/nextPage"),Ti=O("pagination/previousPage");d();c();l();u();var Hr=O("query/updateQuery",e=>N(e,{q:new $,enableQuerySyntax:new ee}));d();c();l();u();d();c();l();u();d();c();l();u();var Et=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var fc=()=>ke("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),It=e=>ke("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||_e().q,aq:r.advancedSearchQueries?.aq||Et().aq,cq:r.advancedSearchQueries?.cq||Et().cq,dq:r.advancedSearchQueries?.dq||Et().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var cB=O("didYouMean/enable"),uB=O("didYouMean/disable"),lB=O("didYouMean/automaticCorrections/disable"),dB=O("didYouMean/automaticCorrections/enable"),Di=O("didYouMean/correction",e=>N(e,W)),pB=O("didYouMean/automaticCorrections/mode",e=>N(e,new $({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var mc=()=>ke("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Sf=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function qi(){return{contextValues:{}}}d();c();l();u();function ji(){return{contextValues:{}}}d();c();l();u();function vf(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Af(){return[]}d();c();l();u();function $n(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function wf(){return{}}d();c();l();u();function bf(){return{}}d();c();l();u();function Cf(){return{}}function et(e){return{context:e.context||qi(),dictionaryFieldContext:e.dictionaryFieldContext||ji(),facetSet:e.facetSet||Zo(),numericFacetSet:e.numericFacetSet||Xo(),dateFacetSet:e.dateFacetSet||Jo(),categoryFacetSet:e.categoryFacetSet||Yo(),automaticFacetSet:e.automaticFacetSet??Ko(),pagination:e.pagination||$n(),query:e.query||_e(),tabSet:e.tabSet||Cf(),advancedSearchQueries:e.advancedSearchQueries||Et(),staticFilterSet:e.staticFilterSet||bf(),querySet:e.querySet||wf(),sortCriteria:e.sortCriteria||ei(),pipeline:e.pipeline||Sr(),searchHub:e.searchHub||Fr(),facetOptions:e.facetOptions||vf(),facetOrder:e.facetOrder??Af(),debug:e.debug??ko()}}d();c();l();u();var _$=new K({values:{undoneQuery:xe},options:{required:!0}}),xf=()=>ke("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var Mi=O("trigger/query/ignore",e=>N(e,new $({emptyAllowed:!0,required:!0}))),Ni=O("trigger/query/modification",e=>N(e,new K({values:{originalQuery:Ce,modification:Ce}})));d();c();l();u();var Ft=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=gw(e),n=wi(e),o=fw(e),i=yield xt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return bt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ft(_x84,_x85){return _ref37.apply(this,arguments)}}();function fw(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(mw).filter(r=>r.currentValues.length>0):void 0}function mw(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function gw(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=yw(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function yw(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Pt=class{constructor(t,r=n=>{this.dispatch(Hr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x86,_x87){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Ai(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return De(t.response)?(this.dispatch(It(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,g=!X(f)&&!X(f.correctedQuery);if(!p&&!g)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Xe(et(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return De(i.response)?(_this13.dispatch(It(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Xe(et(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:mc()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:mc()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Mi("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return De(a.response)?(_this14.dispatch(It(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Xe(et(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:xf()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??_e().enableQuerySyntax},search:{...We(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Xe(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return so(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Ft(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Di(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ni({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Ft(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var NH=ce("search/executeSearch",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();return yield _i(r,t,e)});return function(_x88,_x89){return _ref38.apply(this,arguments)}}()),_H=ce("search/fetchPage",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();return yield yc(r,t,e)});return function(_x90,_x91){return _ref39.apply(this,arguments)}}()),VH=ce("search/fetchMoreResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=t.getState();return yield hc(t,r)});return function(_x92,_x93){return _ref40.apply(this,arguments)}}()),UH=ce("search/fetchFacetValues",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Aw(t,e,r)});return function(_x94,_x95){return _ref41.apply(this,arguments)}}()),LH=ce("search/fetchInstantResults",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){return gc(e,t)});return function(_x96,_x97){return _ref42.apply(this,arguments)}}()),hw=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=yield Ft(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function hw(_x98,_x99){return _ref43.apply(this,arguments)}}(),Sw=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t,r){let n=yield xt(e);return bt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function Sw(_x100,_x101,_x102){return _ref44.apply(this,arguments)}}(),vw=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=yield Ft(e,t);return r.request.numberOfResults=0,r});return function vw(_x103,_x104){return _ref45.apply(this,arguments)}}(),Rf=e=>{e.configuration.analytics.enabled&&Le.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function gc(_x105,_x106){return _gc.apply(this,arguments)}function _gc(){_gc=_asyncToGenerator(function*(e,t){N(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Pt({...t,analyticsAction:yf()},p=>{t.dispatch(Ei({q:p,id:e.id}))}),a=yield Sw(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _gc.apply(this,arguments)}function yc(_x107,_x108,_x109){return _yc.apply(this,arguments)}function _yc(){_yc=_asyncToGenerator(function*(e,t,r){Rf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Pt({...t,analyticsAction:r}),f=yield Ft(e,a),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _yc.apply(this,arguments)}function hc(_x110,_x111){return _hc.apply(this,arguments)}function _hc(){_hc=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield fc().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Pt({...e,analyticsAction:fc()}),m=yield hw(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _hc.apply(this,arguments)}function Aw(_x112,_x113,_x114){return _Aw.apply(this,arguments)}function _Aw(){_Aw=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Pt({...e,analyticsAction:t}),f=yield vw(r,a),p=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(p)});return _Aw.apply(this,arguments)}function _i(_x115,_x116,_x117){return _i2.apply(this,arguments)}function _i2(){_i2=_asyncToGenerator(function*(e,t,r){Rf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=yield Ft(e,a),f=new Pt({...t,analyticsAction:r}),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _i2.apply(this,arguments)}d();c();l();u();var kt=class{constructor(t,r=n=>{this.dispatch(Hr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x118,_x119){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Ai(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return De(t.response)?(this.dispatch(It(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,g=!X(f)&&!X(f.correctedQuery);if(!p&&!g)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Xe(et(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return De(i.response)?(_this20.dispatch(It(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Xe(et(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Mi("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return De(a.response)?(_this21.dispatch(It(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Xe(et(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Xe(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return so(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Sf(),o=yield _this22.fetchFromAPI(yield Rt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Di(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ni({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Rt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var EG=ce("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;N(e,{q:new $,enableQuerySyntax:new ee,clearFilters:new ee}),e.clearFilters&&(r(xi()),r(mf())),r(gf({allow:!0})),r(Hr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r($r(1))}),IG=O("search/updateSearchAction"),Vi=ce("search/executeSearch",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return _i(r,t,e.legacy);If(r);let n=e.next?Ff(e.next):void 0,o=yield Rt(r,t.extra.navigatorContext,n),i=new kt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x120,_x121){return _ref46.apply(this,arguments)}}()),Ef=ce("search/fetchPage",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState();if(If(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return yc(r,t,e.legacy);let n=new kt({...t,analyticsAction:e.next}),o=yield Rt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x122,_x123){return _ref47.apply(this,arguments)}}()),FG=ce("search/fetchMoreResults",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return hc(t,r);let n=hd("browseResults",t.getState),o=new kt({...t,analyticsAction:n}),i=yield ww(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x124,_x125){return _ref48.apply(this,arguments)}}()),PG=ce("search/fetchFacetValues",/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return _i(r,t,e.legacy);let n=new kt({...t,analyticsAction:{}}),o=yield Cw(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x126,_x127){return _ref49.apply(this,arguments)}}()),kG=ce("search/fetchInstantResults",/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return gc(e,t);N(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=Ff(hf()),a=yield bw(r,t.extra.navigatorContext,n,o,i),m=new kt({...t,analyticsAction:i},g=>{t.dispatch(Ei({q:g,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield m.process(f);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x128,_x129){return _ref50.apply(this,arguments)}}()),ww=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t,r){let n=yield Rt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function ww(_x130,_x131,_x132){return _ref51.apply(this,arguments)}}(),bw=/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t,r,n,o){let i=Lr(e,t,o);return bt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function bw(_x133,_x134,_x135,_x136,_x137){return _ref52.apply(this,arguments)}}(),Cw=/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t,r){let n=yield Rt(e,t,r);return n.request.numberOfResults=0,n});return function Cw(_x138,_x139,_x140){return _ref53.apply(this,arguments)}}(),If=e=>{e.configuration.analytics.enabled&&Le.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Ff=e=>({actionCause:e.actionCause,type:e.actionCause});var Sc=ul();Sc.startListening({actionCreator:Vi.pending,effect:function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState(),n=Gt(r)?.q,o=!n||n.trim()==="";ms(r)&&(t.dispatch(Bn()),t.dispatch(gp()),!o&&t.dispatch(tf()))});return function effect(_x141,_x142){return _ref54.apply(this,arguments)}}()});d();c();l();u();var Pf=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},kf=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var vc=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();function Of(e,t){let r={...e},n,o=i=>(a,m)=>{let f=i(a,m);return n?n(f,m):f};return{get combinedReducer(){let i=tu(Object.entries(t).filter(([a])=>!(a in r)).map(([a,m])=>[a,()=>m]));return o(or({...i,...r}))},containsAll(i){return Object.keys(i).every(m=>m in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function xw(e){if(!e||!Rw(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Tf(e,t=60){if(!e)return!1;let r=xw(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Rw(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function qf(e,t){let r=0,n=null,o=eo(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(f,p=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){return p&&Iw(t),yield t()})().finally(()=>{n=null}));let h=yield n;return g&&h&&f.dispatch(yt({accessToken:h})),h});return function i(_x143){return _ref55.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(f){let p=f.getState(),g=Fw(p);if(!(!g||!Tf(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(h){e.warn(h,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x144){return _ref57.apply(this,arguments)}}(),m=/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(f,p,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Df(f,p.error),p;r++,o(),yield i(f,!0),f.dispatch(g)});return function m(_x145,_x146,_x147){return _ref58.apply(this,arguments)}}();return f=>p=>(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(g){let h=typeof g=="function",S=typeof t=="function";if(!h)return p(g);S&&(yield a(f));let y=yield p(g);return Ew(y)?S?yield m(f,y,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Df(f,y.error),y):y});return function(_x148){return _ref59.apply(this,arguments)}}())}function Ew(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new nr().name}function Df(e,t){e.dispatch(To({status:401,statusCode:401,message:t.message,type:t.name}))}function Iw(_x149){return _Iw.apply(this,arguments)}function _Iw(){_Iw=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _Iw.apply(this,arguments)}function Fw(e){return e.configuration.accessToken}d();c();l();u();function jf({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return Ku({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(kf(n.logger))})}function Pw(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&eu()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Mf(e,t){let r={...e.reducers,configuration:Ge,version:nf},n=kw({...e,reducers:r},t,Ge),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(yt({accessToken:o,environment:i,organizationId:a}));let m=Pw(e.configuration,n.logger);return m&&n.dispatch(mr(m)),n}function kw(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=Of({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,m={...t,get relay(){return Pn(p.state,o)},get navigatorContext(){return vc(this.relay,o)}},f=Ow(e,m,i),p={addReducers(g){i.containsAll(g)||(i.add(g),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(yr())},disableAnalytics(){f.dispatch(gr())},get state(){return f.getState()},get relay(){return Pn(this.state,o)},get navigatorContext(){return vc(this.relay,o)},logger:a,store:f};return p}function Ow(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=Tw(e,t.logger);return jf({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function Tw(e,t){let{renewAccessToken:r}=e.configuration,n=qf(t,r);return[ff,n,Pf(t),af].concat(ac.middleware,Mr.middleware,Sc.middleware,e.middlewares||[])}d();c();l();u();var Hf=$e($f(),1);function Gf(e){return(0,Hf.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function zf(e,t){let r=Yw(e),n=Ue,o=Jw(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function Yw(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function Jw(e){return e.preprocessRequest||no}d();c();l();u();d();c();l();u();var Wf={organizationId:W,accessToken:W,name:new $({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new ee({required:!1}),originContext:new $({required:!1}),originLevel2:new $({required:!1}),originLevel3:new $({required:!1}),analyticsMode:new $({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new $({required:!1,url:!0}),trackingId:new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new $({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Kf(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Yf=new Te({...Wf,pipeline:new $({required:!1,emptyAllowed:!0}),searchHub:Ce,locale:Ce,timezone:Ce});function Rc(){return{...Kf(),searchHub:"default"}}var Xw={debug:Oo,pipeline:vr,searchHub:Dr,recommendation:Or};function Jf(e){let t=Gf(e.loggerOptions);Zw(e.configuration,t);let r=eb(e.configuration,t),n={...zf(e.configuration,t),apiClient:r},o={...e,reducers:Xw},i=Mf(o,n),{pipeline:a,searchHub:m,timezone:f,locale:p,proxyBaseUrl:g}=e.configuration;return i.dispatch(Je({timezone:f,locale:p,proxyBaseUrl:g})),X(a)||i.dispatch(hr(a)),X(m)||i.dispatch(Tr(m)),{...i,get state(){return i.state}}}function Zw(e,t){try{Yf.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function eb(e,t){return new ao({logger:t,preprocessRequest:e.preprocessRequest||no,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Su,postprocessFacetSearchResponseMiddleware:vu,postprocessQuerySuggestResponseMiddleware:Au})}d();c();l();u();d();c();l();u();d();c();l();u();var tb=new oe({each:W,required:!0}),Xf=(e,t)=>(N(e,W),Xn(t)?N(t,W):N(t,tb),{payload:{contextKey:e,contextValue:t}}),Kt=O("context/set",e=>{for(let[t,r]of Object.entries(e))Xf(t,r);return{payload:e}}),Yt=O("context/add",e=>Xf(e.contextKey,e.contextValue)),Jt=O("context/remove",e=>N(e,W));d();c();l();u();var Qi=me(qi(),e=>{e.addCase(Kt,(t,r)=>{t.contextValues=r.payload}).addCase(Yt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Jt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();function Tt(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),m=t!==a;return t=a,m}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),m;return n()&&(t=JSON.stringify(this.state),m=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&m?.()}},get state(){return{}}}}d();c();l();u();var rb=["caseId","caseNumber"],nb={caseId:"caseContext",caseNumber:"caseContext"},Gn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${nb[t]} to set this value.}`)}};function Ec(e){return rb.includes(e)}var ob=new Te({values:new K({options:{required:!1}})});function Zf(e,t={}){if(!sb(e))throw ze;let r=Tt(e),{dispatch:n}=e,o=()=>e.state,i=pl(e,ob,t.initialState,"buildContext");return i.values&&n(Kt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Kt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?ib(n):ab(n))}}var ib=e=>({add(t,r){e(Yt({contextKey:t,contextValue:r}))},remove(t){e(Jt(t))}}),ab=e=>({add(t,r){if(Ec(t))throw new Gn(t);e(Yt({contextKey:t,contextValue:r}))},remove(t){if(Ec(t))throw new Gn(t);e(Jt(t))}});function sb(e){return e.addReducers({context:Qi}),!0}function em(e,t){return Zf(e,t)}d();c();l();u();d();c();l();u();var zr=O("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=N(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new oe({each:xe}),i=N(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Wr=O("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:xe,key:xe}});return N(e,t)}),Kr=O("dictionaryFieldContext/remove",e=>N(e,xe));d();c();l();u();var Bi=me(ji(),e=>{e.addCase(zr,(t,r)=>{t.contextValues=r.payload}).addCase(Wr,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Kr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function tm(e){if(!cb(e))throw ze;let t=Tt(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(zr(o))},add(o,i){r(Wr({field:o,key:i}))},remove(o){r(Kr(o))}}}function cb(e){return e.addReducers({dictionaryFieldContext:Bi}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var zn={value:W,numberOfResults:new J({min:0}),state:W};d();c();l();u();var de=W;var pb=new J({min:1,default:8,required:!1}),fb=new J({min:1,max:20,default:5,required:!1}),mb={desiredCount:fb,numberOfValues:pb},NK=O("automaticFacet/setOptions",e=>N(e,mb)),_K=O("automaticFacet/deselectAll",e=>N(e,de)),gb=W,rm=O("automaticFacet/toggleSelectValue",e=>N(e,{field:gb,selection:new K({values:zn})}));d();c();l();u();d();c();l();u();var yb={state:new pe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new $({required:!0,emptyAllowed:!0}),path:new oe({required:!0,each:W}),moreValuesAvailable:new ee({required:!1})};function Ic(e){e.children.forEach(t=>{Ic(t)}),Ue({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},yb)}var Yr={facetId:de,field:W,tabs:new K({options:{required:!1},values:{included:new oe({each:new $}),excluded:new oe({each:new $})}}),activeTab:new $({required:!1}),delimitingCharacter:new $({required:!1,emptyAllowed:!0}),filterFacetCount:new ee({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),basePath:new oe({required:!1,each:W}),filterByBasePath:new ee({required:!1})};var r3=O("categoryFacet/register",e=>N(e,Yr)),nm=O("categoryFacet/toggleSelectValue",e=>{try{return Ue(e.facetId,W),Ic(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),om=O("categoryFacet/deselectAll",e=>N(e,Yr.facetId)),n3=O("categoryFacet/updateNumberOfValues",e=>N(e,{facetId:Yr.facetId,numberOfValues:Yr.numberOfValues})),o3=O("categoryFacet/updateSortCriterion",e=>N(e,{facetId:Yr.facetId,criterion:new pe})),i3=O("categoryFacet/updateBasePath",e=>N(e,{facetId:Yr.facetId,basePath:new oe({each:W})}));d();c();l();u();d();c();l();u();var Wn={facetId:de,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new $({required:!1,emptyAllowed:!0})};var hb={path:new oe({required:!0,each:W}),displayValue:xe,rawValue:xe,count:new J({required:!0,min:0})},im=O("categoryFacet/selectSearchResult",e=>N(e,{facetId:de,value:new K({values:hb})})),C3=O("categoryFacetSearch/register",e=>N(e,Wn));d();c();l();u();var am={facetId:de,value:new K({values:{displayValue:xe,rawValue:xe,count:new J({required:!0,min:0})}})},q3=O("facetSearch/register",e=>N(e,Wn)),j3=O("facetSearch/update",e=>N(e,Wn)),sm=O("facetSearch/toggleSelectValue",e=>N(e,am)),cm=O("facetSearch/toggleExcludeValue",e=>N(e,am));d();c();l();u();d();c();l();u();var Q3=new $({regex:/^[a-zA-Z0-9-_]+$/}),B3=new $({required:!0}),$3=new oe({each:new $}),H3=new $,G3=new ee,z3=new ee,W3=new J({min:0}),Sb=new J({min:1}),K3=new ee({required:!0}),vb=new K,Ab=new $,wb={captions:vb,numberOfValues:Sb,query:Ab},Y3=new K({values:wb}),um=new K({options:{required:!1},values:{type:new $({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new oe({required:!0,max:25,each:new $({emptyAllowed:!1,required:!0})})}}),J3=new ee,lm=new oe({min:1,max:25,required:!1,each:new $({emptyAllowed:!1,required:!0})});var bb={facetId:de,field:new $({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new oe({each:new $}),excluded:new oe({each:new $})}}),activeTab:new $({required:!1}),filterFacetCount:new ee({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),resultsMustMatch:new pe({required:!1}),allowedValues:um,customSort:lm},uY=O("facet/register",e=>N(e,bb)),dm=O("facet/toggleSelectValue",e=>N(e,{facetId:de,selection:new K({values:zn})})),pm=O("facet/toggleExcludeValue",e=>N(e,{facetId:de,selection:new K({values:zn})})),$i=O("facet/deselectAll",e=>N(e,de)),lY=O("facet/updateSortCriterion",e=>N(e,{facetId:de,criterion:new pe({required:!0})})),dY=O("facet/updateNumberOfValues",e=>N(e,{facetId:de,numberOfValues:new J({required:!0,min:1})})),pY=O("facet/updateIsFieldExpanded",e=>N(e,{facetId:de,isFieldExpanded:new ee({required:!0})})),fY=O("facet/updateFreezeCurrentValues",e=>N(e,{facetId:de,freezeCurrentValues:new ee({required:!0})}));d();c();l();u();d();c();l();u();function mm(e){let t=fm(e.start,e),r=fm(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function fm(e,t){let{dateFormat:r}=t;return Dp(e)?(Ys(e),kp(e)):typeof e=="string"&&wt(e)?(Ys(e),e):(Ep(e,r),vi(Ur(e,r)))}d();c();l();u();var gm=O("rangeFacet/updateSortCriterion",e=>N(e,{facetId:de,criterion:new pe({required:!0})}));d();c();l();u();var Hi={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ee({required:!0}),numberOfResults:new J({required:!0,min:0})},Gi={start:W,end:W,endInclusive:new ee({required:!0}),state:W,numberOfResults:new J({required:!0,min:0})};var Cb={start:W,end:W,endInclusive:new ee({required:!0}),state:W},xb={facetId:de,field:W,tabs:new K({options:{required:!1},values:{included:new oe({each:new $}),excluded:new oe({each:new $})}}),activeTab:new $({required:!1}),currentValues:new oe({required:!1,each:new K({values:Cb})}),generateAutomaticRanges:new ee({required:!0}),filterFacetCount:new ee({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),rangeAlgorithm:new pe({required:!1})};function ym(e){return wt(e)?Ln(e):e}function hm(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=mm(t);if(Ur(ym(r)).isAfter(Ur(ym(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var ZY=O("dateFacet/register",e=>{try{return Ue(e,xb),hm(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),Sm=O("dateFacet/toggleSelectValue",e=>N(e,{facetId:de,selection:new K({values:Gi})})),vm=O("dateFacet/toggleExcludeValue",e=>N(e,{facetId:de,selection:new K({values:Gi})})),Am=O("dateFacet/updateFacetValues",e=>{try{return Ue(e,{facetId:de,values:new oe({each:new K({values:Gi})})}),hm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});d();c();l();u();var Rb={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ee({required:!0})},Eb={facetId:de,field:W,tabs:new K({options:{required:!1},values:{included:new oe({each:new $}),excluded:new oe({each:new $})}}),activeTab:new $({required:!1}),currentValues:new oe({required:!1,each:new K({values:Rb})}),generateAutomaticRanges:new ee({required:!0}),filterFacetCount:new ee({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new pe({required:!1}),rangeAlgorithm:new pe({required:!1})};function wm(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var p4=O("numericFacet/register",e=>{try{return N(e,Eb),wm(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),bm=O("numericFacet/toggleSelectValue",e=>N(e,{facetId:de,selection:new K({values:Hi})})),Cm=O("numericFacet/toggleExcludeValue",e=>N(e,{facetId:de,selection:new K({values:Hi})})),xm=O("numericFacet/updateFacetValues",e=>{try{return Ue(e,{facetId:de,values:new oe({each:new K({values:Hi})})}),wm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});var Rm=me($n(),e=>{e.addCase(Fi,(t,r)=>{let n=Fc(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Kn(n,o)}).addCase(Pi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(bi,t=>{t.firstResult=0}).addCase(ki,(t,r)=>{let n=r.payload;t.firstResult=Kn(n,t.numberOfResults)}).addCase($r,(t,r)=>{let n=r.payload;t.firstResult=Kn(n,t.numberOfResults)}).addCase(Ti,t=>{let r=Fc(t),n=Math.max(r-1,1);t.firstResult=Kn(n,t.numberOfResults)}).addCase(Oi,t=>{let r=Fc(t),n=Fb(t),o=Math.min(r+1,n);t.firstResult=Kn(o,t.numberOfResults)}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(ht,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Vi.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Ef.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase($i,t=>{Fe(t)}).addCase(vm,t=>{Fe(t)}).addCase(pm,t=>{Fe(t)}).addCase(Cm,t=>{Fe(t)}).addCase(cm,t=>{Fe(t)}).addCase(dm,t=>{Fe(t)}).addCase(om,t=>{Fe(t)}).addCase(nm,t=>{Fe(t)}).addCase(im,t=>{Fe(t)}).addCase(Sm,t=>{Fe(t)}).addCase(bm,t=>{Fe(t)}).addCase(xi,t=>{Fe(t)}).addCase(Am,t=>{Fe(t)}).addCase(xm,t=>{Fe(t)}).addCase(sm,t=>{Fe(t)}).addCase(rm,t=>{Fe(t)})});function Fe(e){e.firstResult=$n().firstResult}function Fc(e){let{firstResult:t,numberOfResults:r}=e;return Pb(t,r)}function Fb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return kb(t,r)}function Kn(e,t){return(e-1)*t}function Pb(e,t){return Math.round(e/t)+1}function kb(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Pc(e){return e.addReducers({pagination:Rm}),{nextPage:Oi,previousPage:Ti,registerNumberOfResults:Fi,registerPage:ki,updateNumberOfResults:Pi,updatePage:$r}}var Ob=new Te({id:new $({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function Em(e,t={}){if(!Tb(e))throw ze;let r=Tt(e),{dispatch:n}=e,o=()=>e.state,i=fl(e,Ob,t.options,"buildRecommendationList");return i.id!==""&&n(kr({id:i.id})),i.numberOfRecommendations&&n(Pc(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(At())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function Tb(e){return e.addReducers({recommendation:Or,configuration:Ge}),!0}d();c();l();u();d();c();l();u();function Im(e,t,r){if(!Db(e))throw ze;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:eo(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function Db(e){return e.addReducers({configuration:Ge}),!0}function Fm(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(oi(t.options.result)))};return Im(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var Dt=()=>new $({required:!1,emptyAllowed:!0}),zi=O("advancedSearchQueries/update",e=>N(e,{aq:Dt(),cq:Dt(),lq:Dt(),dq:Dt()})),Wi=O("advancedSearchQueries/register",e=>N(e,{aq:Dt(),cq:Dt(),lq:Dt(),dq:Dt()}));var Pm=me(Et(),e=>{e.addCase(zi,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Ae(n)||(t.aq=n,t.aqWasSet=!0),Ae(o)||(t.cq=o,t.cqWasSet=!0),Ae(i)||(t.lq=i,t.lqWasSet=!0),Ae(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(Wi,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Ae(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Ae(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Ae(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),Ae(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(Me.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(ht,(t,r)=>{let{aq:n,cq:o}=r.payload;Ae(n)||(t.aq=n,t.aqWasSet=!0),Ae(o)||(t.cq=o,t.cqWasSet=!0)})});function qb(e){return e.addReducers({advancedSearchQueries:Pm}),{updateAdvancedSearchQueries:zi,registerAdvancedSearchQueries:Wi}}d();c();l();u();function jb(e){return e.addReducers({configuration:Ge}),{disableAnalytics:gr,enableAnalytics:yr,setOriginLevel2:Eo,setOriginLevel3:Io,updateAnalyticsConfiguration:mr,updateBasicConfiguration:yt}}d();c();l();u();function Mb(e){return e.addReducers({configuration:Ge,pipeline:vr,searchHub:Dr}),{updateSearchConfiguration:Je}}d();c();l();u();function Nb(e){return e.addReducers({context:Qi}),{addContext:Yt,removeContext:Jt,setContext:Kt}}d();c();l();u();function _b(e){return e.addReducers({debug:Oo}),{disableDebug:Po,enableDebug:Fo}}d();c();l();u();function Vb(e){return e.addReducers({dictionaryFieldContext:Bi}),{addContext:Wr,removeContext:Kr,setContext:zr}}d();c();l();u();d();c();l();u();d();c();l();u();var Ub={collectionField:new $({emptyAllowed:!1,required:!1}),parentField:new $({emptyAllowed:!1,required:!1}),childField:new $({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},km=O("folding/register",e=>N(e,Ub)),j8=ce("folding/loadCollection",/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield xt(i):Lr(i,o),m=yield n.search({...a,q:Lb(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return De(m)?r(m.error):{collectionId:e,results:m.success.results,searchUid:m.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x150,_x151){return _ref60.apply(this,arguments)}}());function Lb(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var Om=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Jr=O("fields/registerFieldsToInclude",e=>N(e,Ro)),Ki=O("fields/fetchall/enable"),Yi=O("fields/fetchall/disable"),Ji=ce("fields/fetchDescription",/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:m}=o.configuration,{apiBaseUrl:f}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:m,url:f??pt(m,a)});return De(p)?n(p.error):p.success.fields});return function(_x152,_x153){return _ref61.apply(this,arguments)}}());d();c();l();u();var Xi=["author","language","urihash","objecttype","collection","source","permanentid"],kc=[...Xi,"date","filetype","parents"],Tm=[...kc,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],Dm=()=>({fieldsToInclude:Xi,fetchAllFields:!1,fieldsDescription:[]});var Zi=me(Dm(),e=>e.addCase(Jr,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Ki,t=>{t.fetchAllFields=!0}).addCase(Yi,t=>{t.fetchAllFields=!1}).addCase(Ji.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(km,(t,{payload:r})=>{let n=Om().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function Qb(e){return e.addReducers({fields:Zi}),{registerFieldsToInclude:Jr,enableFetchAllFields:Ki,disableFetchAllFields:Yi,fetchFieldsDescription:Ji}}d();c();l();u();function Bb(e){return e.addReducers({pipeline:vr}),{setPipeline:hr}}d();c();l();u();function $b(e){return e.addReducers({recommendation:Or}),{getRecommendations:At,setRecommendationId:kr}}d();c();l();u();function Hb(e){return e.addReducers({}),{logRecommendationOpen:oi}}d();c();l();u();d();c();l();u();var Gb=new Te({content:new pe({required:!0}),conditions:new pe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new oe({required:!1,each:W})});function qm(){let e=[],t=r=>{let n=Gb.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new on("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function jm(e){if(!zb(e))throw ze;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=qm();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Jr(i))},selectTemplate:r,selectLinkTemplate:n}}function zb(e){return e.addReducers({fields:Zi}),!0}d();c();l();u();function Wb(e){return e.addReducers({searchHub:Dr}),{setSearchHub:Tr}}/**
30
+ `;function AC(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var bC=["1",1,"yes",!0];function Za(){let e=[];return hl()&&e.push(window.doNotTrack),_l()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>bC.indexOf(t)!==-1)}var Km="v15",Ym={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 xC(e=Ym.default,t=Km,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 CC="38824e1f-37f5-42d3-8372-a4b8fa9df946",Gt=class{get defaultOptions(){return{endpoint:Ym.default,isCustomEndpoint:!1,token:"",version:Km,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Qm}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=[px,sx].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};Za()?this.runtime=new Ja:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ve.view,{newEventType:ve.view,addClientIdParameter:!0}),this.addEventTypeMapping(ve.click,{newEventType:ve.click,addClientIdParameter:!0}),this.addEventTypeMapping(ve.custom,{newEventType:ve.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ve.search,{newEventType:ve.search,addClientIdParameter:!0})}initRuntime(t){return hl()&&so()?new Il(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(AC()&&console.warn(wC),new Tl(t))}get storage(){return this.runtime.storage}determineVisitorId(){return M(this,void 0,void 0,function*(){try{return hl()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Zr()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Zr()}})}getCurrentVisitorId(){return M(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return M(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return M(this,void 0,void 0,function*(){if(Wa(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Pm(t,Pm(r,CC)))}})}getParameters(t,...r){return M(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return M(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(Zr()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Za())return null;try{let r=new URL(t).searchParams.get(vr.cvo_cid);if(r==null)return null;let n=vr.fromString(r);return!n||!so()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return M(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>M(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>M(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((y,x)=>M(this,void 0,void 0,function*(){let E=yield y;return yield x(t,E)}),g)].reduce((g,y)=>M(this,void 0,void 0,function*(){let x=yield g;return yield y(x)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return M(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?lC(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,S)=>M(this,void 0,void 0,function*(){let g=yield v;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return M(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>M(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return M(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return M(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 za().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.search,t)})}sendSearchEvent(t){return M(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=tr(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.click,t)})}sendClickEvent(t){return M(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=tr(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.custom,t)})}sendCustomEvent(t){return M(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=tr(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.view,t)})}sendViewEvent(t){return M(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return M(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return M(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ve.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(mC(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=tr(t,["custom"]),o={};r&&Ha(r)&&(o=this.lowercaseKeys(r));let i=gC(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=tr(t,["custom"]);if(r&&Ha(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=tr(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ve.view||r==ve.click||r==ve.search||r==ve.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ve.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=tr(t,["userId"]);return SC(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=tr(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Ha(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Ha(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"?Ix(t,r):t}get baseUrl(){return xC(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},rr;(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"})(rr||(rr={}));var L;(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",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(L||(L={}));var Lm={[L.triggerNotify]:"queryPipelineTriggers",[L.triggerExecute]:"queryPipelineTriggers",[L.triggerQuery]:"queryPipelineTriggers",[L.triggerRedirect]:"queryPipelineTriggers",[L.queryErrorBack]:"errors",[L.queryErrorClear]:"errors",[L.queryErrorRetry]:"errors",[L.pagerNext]:"getMoreResults",[L.pagerPrevious]:"getMoreResults",[L.pagerNumber]:"getMoreResults",[L.pagerResize]:"getMoreResults",[L.pagerScrolling]:"getMoreResults",[L.facetSearch]:"facet",[L.facetShowLess]:"facet",[L.facetShowMore]:"facet",[L.recommendation]:"recommendation",[L.likeSmartSnippet]:"smartSnippet",[L.dislikeSmartSnippet]:"smartSnippet",[L.expandSmartSnippet]:"smartSnippet",[L.collapseSmartSnippet]:"smartSnippet",[L.openSmartSnippetFeedbackModal]:"smartSnippet",[L.closeSmartSnippetFeedbackModal]:"smartSnippet",[L.sendSmartSnippetReason]:"smartSnippet",[L.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.clearRecentQueries]:"recentQueries",[L.recentResultClick]:"recentlyClickedDocuments",[L.clearRecentResults]:"recentlyClickedDocuments",[L.showLessFoldedResults]:"folding",[L.caseDetach]:"case",[L.likeGeneratedAnswer]:"generatedAnswer",[L.dislikeGeneratedAnswer]:"generatedAnswer",[L.openGeneratedAnswerSource]:"generatedAnswer",[L.generatedAnswerStreamEnd]:"generatedAnswer",[L.generatedAnswerSourceHover]:"generatedAnswer",[L.generatedAnswerCopyToClipboard]:"generatedAnswer",[L.generatedAnswerHideAnswers]:"generatedAnswer",[L.generatedAnswerShowAnswers]:"generatedAnswer",[L.generatedAnswerExpand]:"generatedAnswer",[L.generatedAnswerCollapse]:"generatedAnswer",[L.generatedAnswerFeedbackSubmit]:"generatedAnswer",[L.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[rr.expandToFullUI]:"interface",[rr.openUserActions]:"User Actions",[rr.showPrecedingSessions]:"User Actions",[rr.showFollowingSessions]:"User Actions",[rr.clickViewedDocument]:"User Actions",[rr.clickPageView]:"User Actions",[rr.createArticle]:"createArticle"},lo=class{constructor(){this.runtime=new Ja,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(ve.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ve.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ve.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ve.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Qm}};function EC(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function RC(e){return e.map(t=>t.replace(/;/g,""))}function Xm(e){let r=e.join(";");return r.length<=256?r:Xm(e.slice(1))}var Um=e=>{let t=RC(e),r=EC(t);return Xm(r)};function Vm(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Um(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Um(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var es=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Za();this.coveoAnalyticsClient=n?new lo:new Gt(t)}disable(){this.coveoAnalyticsClient=new lo}enable(){this.coveoAnalyticsClient=new Gt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(L.interfaceLoad)}logInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(L.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(L.recommendation)}logRecommendation(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(L.recommendationOpen,t,r)}logRecommendationOpen(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(L.staticFilterClearAll,t)}logStaticFilterClearAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(L.staticFilterSelect,t)}logStaticFilterSelect(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(L.staticFilterDeselect,t)}logStaticFilterDeselect(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(L.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return M(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(L.interfaceChange,t)}logInterfaceChange(t){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(L.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(L.didyoumeanClick)}logDidYouMeanClick(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(L.resultsSort,t)}logResultsSort(t){return M(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(L.searchboxSubmit)}logSearchboxSubmit(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(L.searchboxClear)}logSearchboxClear(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(L.searchboxAsYouType)}logSearchboxAsYouType(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(L.breadcrumbFacet,t)}logBreadcrumbFacet(t){return M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(L.breadcrumbResetAll)}logBreadcrumbResetAll(){return M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(L.documentQuickview,t,r)}logDocumentQuickview(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(L.documentOpen,t,r)}logDocumentOpen(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(L.omniboxAnalytics,Vm(t))}logOmniboxAnalytics(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(L.omniboxFromLink,Vm(t))}logOmniboxFromLink(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(L.searchFromLink)}logSearchFromLink(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(L.triggerNotify,t)}logTriggerNotify(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(L.triggerExecute,t)}logTriggerExecute(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(L.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(L.undoTriggerQuery,t)}logUndoTriggerQuery(t){return M(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(L.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(L.pagerResize,t)}logPagerResize(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(L.pagerNumber,t)}logPagerNumber(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(L.pagerNext,t)}logPagerNext(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(L.pagerPrevious,t)}logPagerPrevious(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(L.pagerScrolling)}logPagerScrolling(){return M(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(L.facetClearAll,t)}logFacetClearAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(L.facetSearch,t)}logFacetSearch(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(L.facetSelect,t)}logFacetSelect(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(L.facetDeselect,t)}logFacetDeselect(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(L.facetExclude,t)}logFacetExclude(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(L.facetUnexclude,t)}logFacetUnexclude(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(L.facetSelectAll,t)}logFacetSelectAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(L.facetUpdateSort,t)}logFacetUpdateSort(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(L.facetShowMore,t)}logFacetShowMore(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(L.facetShowLess,t)}logFacetShowLess(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(L.queryError,t)}logQueryError(t){return M(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorBack);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorBack)})}})}logQueryErrorBack(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorRetry);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorRetry)})}})}logQueryErrorRetry(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorClear);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorClear)})}})}logQueryErrorClear(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(L.likeSmartSnippet)}logLikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(L.dislikeSmartSnippet)}logDislikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(L.expandSmartSnippet)}logExpandSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(L.collapseSmartSnippet)}logCollapseSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(L.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(L.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(L.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(L.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(L.copyToClipboard,t,r)}logCopyToClipboard(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(L.recentQueryClick)}logRecentQueryClick(){return M(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(L.clearRecentQueries)}logClearRecentQueries(){return M(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(L.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(L.clearRecentResults)}logClearRecentResults(){return M(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(L.noResultsBack)}logNoResultsBack(){return M(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(L.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(L.showLessFoldedResults)}logShowLessFoldedResults(){return M(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return M(this,arguments,void 0,function*(n,o,i=Lm[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),c=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(c,n),log:({searchUID:u})=>c.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r){return M(this,arguments,void 0,function*(n,o,i=Lm[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return M(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return M(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return M(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 Gt?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(L.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(L.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(L.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return M(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(L.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(L.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(L.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(L.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(L.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(L.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(L.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(L.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(L.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return M(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(L.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},ts=Object.assign({},Ci),Gm=Object.keys(ts).map(e=>ts[e]),co=class extends Sl{constructor({client:t,uuidGenerator:r=Zr}){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])=>Gm.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Gm.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(ts.pageview,{newEventType:ve.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(ts.event,{newEventType:ve.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return Px(this.ticket)}};co.Id="svc";var rs;(function(e){e.click="click",e.flowStart="flowStart"})(rs||(rs={}));var xt;(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"})(xt||(xt={}));var ns;(function(e){e.quit="Quit",e.solved="Solved"})(ns||(ns={}));var os=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Za();this.coveoAnalyticsClient=o?new Gt(t):new lo,this.svc=new co({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new lo,this.svc=new co({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Gt(this.options),this.svc=new co({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(xt.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(xt.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(xt.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(xt.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(xt.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(xt.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(xt.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(xt.caseCancelled,{reason:ns.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(xt.caseSolved,{reason:ns.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(xt.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",rs.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",rs.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return M(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Gt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var Jm=e=>new Gt(e).getCurrentVisitorId(),Ii=(e,t)=>typeof t=="function"?(...r)=>{let n=ci(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Ti=(e,t)=>(...r)=>{let n=ci(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function is(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();f();p();m();d();f();p();m();d();f();p();function Zm(e){let{activeValue:t,ancestryMap:r}=IC(e);return t?TC(t,r):[]}function IC(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function TC(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var _C=(e,t)=>e.categoryFacetSet[t]?.request;var Pl=(e,t)=>{let r=_C(e,t);return Zm(r?.currentValues??[])};m();d();f();p();function as(){return{}}m();d();f();p();function ss(){return{}}m();d();f();p();function cs(){return{}}m();d();f();p();function us(){return{}}function Nl(e){return{facetSet:e.facetSet??us(),categoryFacetSet:e.categoryFacetSet??as(),dateFacetSet:e.dateFacetSet??ss(),numericFacetSet:e.numericFacetSet??cs(),automaticFacetSet:e.automaticFacetSet??is()}}var Fl=e=>{let t=[];return PC(e).forEach((r,n)=>{let o=UC(e,r.facetId),i=qC(r,n+1);if(OC(r)){if(!!!Pl(e,r.facetId).length)return;t.push({...i,...MC(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let c=eg(a,s+1,o),u=kC(r)?tg(a):FC(a);t.push({...i,...c,...u})})}),NC(e).forEach((r,n)=>{let o=jC(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=eg(i,a+1,"specific"),c=tg(i);t.push({...o,...s,...c})})}),t},kC=e=>e.type==="specific",OC=e=>e.type==="hierarchical",PC=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),NC=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),eg=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),FC=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),tg=e=>({displayValue:e.value,value:e.value}),DC=(e,t)=>Pl(e,t).map(n=>n.value).join(";"),MC=(e,t)=>{let n=DC(e,t);return{value:n,valuePosition:1,displayValue:n}},jC=(e,t)=>({title:rg(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),qC=(e,t)=>({title:rg(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),rg=(e,t)=>`${e}_${t}`,LC=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,UC=(e,t)=>{let r=LC(e,t);return r?r.type:"specific"};m();d();f();p();m();d();f();p();var Dl=e=>e.configuration.search.locale,ng=e=>e.configuration.search.timezone,og=e=>e.configuration.accessToken,ig=e=>e.configuration.organizationId,ag=e=>e.configuration.environment,Sr=e=>e.configuration?.knowledge?.agentId;var en=e=>{if(VC(e)||Ml(e))return e.generatedAnswer?.answerId;if(GC(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},VC=e=>"answer"in e&&"generatedAnswer"in e&&!ie(e.generatedAnswer?.answerConfigurationId),Ml=e=>{let t=Sr(e);return"answerGenerationApi"in e&&"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},GC=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",jl=e=>e.generatedAnswer?.fieldsToIncludeInCitations,BC=Ue(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));m();d();f();p();var St=()=>({q:"",enableQuerySyntax:!1});m();d();f();p();m();d();f();p();var sg=(r=>(r.Ascending="ascending",r.Descending="descending",r))(sg||{}),cg=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(cg||{}),ql=e=>{if(rf(e))return e.map(t=>ql(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""}},ug=()=>({by:"relevancy"});var AL=new ee({values:{by:new Pu({enum:cg,required:!0}),order:new Pu({enum:sg}),field:new H}});function ls(){return ql(ug())}m();d();f();p();m();d();f();p();var po=()=>"default";var $C=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},nr=class{constructor(t){this.getState=t;xe(this,"state");this.state=t()}getLanguage(){return $C(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Xn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||po()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var _i=class _i extends nr{constructor(){super(...arguments);xe(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 Fl(Nl(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||_i.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||jt().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||_i.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=en(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ls()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(u=>u.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",c=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",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||St().q}get responseTime(){return this.state.search?.duration||jt().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||jt().response.totalCountFiltered}};xe(_i,"fallbackPipelineName","default");var wr=_i,lg=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Be(i.configuration.organizationId,i.configuration.environment,"analytics"),c=i.configuration.analytics.runtimeEnvironment,u=i.configuration.analytics.enabled,h=new es({token:a,endpoint:s,runtimeEnvironment:c,preprocessRequest:Ii(e,n),beforeSendHooks:[Ti(e,r),(v,S)=>(e.info({...S,type:v,endpoint:s,token:a},"Analytics request"),S)]},o);return u||h.disable(),h},Ll=()=>{let t=bt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var ds=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Jm(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}),...(Ll()&&{pageId:Ll()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:ao(e)})}}});return function ds(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();f();p();m();d();f();p();m();d();f();p();var fo=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var ki=class extends nr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:St().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||fo().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||fo().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||fo().recommendations.length}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var dg=/^(?:[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 QC(e){return typeof e=="string"&&dg.test(e)}var Ul=QC;m();d();f();p();var et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function pg(e,t=0){return(et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]).toLowerCase()}m();d();f();p();var Vl,HC=new Uint8Array(16);function Gl(){if(!Vl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Vl=crypto.getRandomValues.bind(crypto)}return Vl(HC)}m();d();f();p();m();d();f();p();var zC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Bl={randomUUID:zC};function WC(e,t,r){e=e||{};let n=e.random??e.rng?.()??Gl();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return pg(n)}function KC(e,t,r){return Bl.randomUUID&&!t&&!e?Bl.randomUUID():WC(e,t,r)}var $l=KC;m();d();f();p();function fg(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function YC({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var mg="visitorId";function XC(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(mg),o=n&&Ul(n)?n:t.generateUUID();return r.setItem(mg,o),o}}}var Sg="1.2.15",Ql=128,wg=192,gg=224,hg=240,JC=248;function ZC(e){return(e&JC)===hg?4:(e&hg)===gg?3:(e&gg)===wg?2:1}function eE(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&Ql)!=Ql)break;if(r-=3,(n&wg)!=Ql){t-r>=ZC(n)*3&&(r=t);break}}return e.substring(0,r)}function tE(e){let{trackingId:t}=e;return{trackingId:t}}function rE(e){return(e.source||[]).concat([`relay@${Sg}`])}function Ag(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,s=tE(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:rE(t),clientId:c,userAgent:a(),referrer:yg(o()),location:yg(i())})}function yg(e){return e!==null?eE(e,1024):null}function nE(e,t,r,n,o){return{...t,meta:Ag(e,r,n,o)}}var oE="*";function iE(){let e=[];function t({type:c,callback:u}){return e.findIndex(h=>h.type===c&&h.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(h){console.error(h)}})}function i(c){if(c===oE)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function a(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?a({type:c,callback:u}):i(c)}return{add:n,call:o,remove:s}}function vg({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 aE(e){let t=vg(e);return{get:()=>t,update:r=>{t=vg({...t,...r})}}}var Hl=sE();function sE(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function cE(){return{getItem(e){return Hl.getItem(e)||localStorage.getItem(e)},removeItem(e){Hl.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Hl.setItem(e,t,31556952e3)}}}function uE(){let e=document.referrer;return e===""?null:e}function zl(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(fg().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:()=>uE(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>$l(),storage:cE()}}function lE(){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 dE(){return{getItem(){return null},removeItem(){},setItem(){}}}function pE(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:dE()}}function fE(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=pE();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&mE()&&lE()?zl():n}function mE(){try{return typeof window=="object"}catch{return!1}}function gE(e){return{get:()=>Object.freeze(fE(e))}}function bg(e){let t=aE(e),r=iE(),n=gE(t),o=XC(n);return{emit:(i,a)=>{let s=t.get(),c=n.get(),u=nE(i,a,s,c,o);return YC({config:s,environment:c,event:u,listenerManager:r})},getMeta:i=>Ag(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:Sg}}m();d();f();p();function xg(){return typeof window<"u"&&typeof document<"u"}var Oi=Ue(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ao(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let c=yE(s);return bg({mode:i?"emit":"disabled",url:o??fa(e,t),token:r,trackingId:n??null,source:a,environment:c})}),hE={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},yE=e=>{if(!e)return;let t=e();return{...(xg()?zl():hE),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();f();p();var Pi=class extends nr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Cg=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new Pi(t)})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Be(i.configuration.organizationId,i.configuration.environment,"analytics"),c=i.configuration.analytics.runtimeEnvironment,u=i.configuration.analytics.enabled,h=new os({enableAnalytics:u,token:a,endpoint:s,runtimeEnvironment:c,preprocessRequest:Ii(e,n),beforeSendHooks:[Ti(e,r),(v,S)=>(e.info({...S,type:v,endpoint:s,token:a},"Analytics request"),S)]},o);return u||h.disable(),h};m();d();f();p();m();d();f();p();function Eg(e,t){return{...new wr(t).getBaseMetadata(),actionCause:e,type:e}}function vE(e){return Object.assign(e,{instantlyCallable:!0})}function SE(e,t){let r=i=>vE(be(e,i)),n=r(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:c,preprocessRequest:u,logger:h}=s;return yield(yield t({getState:a,analyticsClientMiddleware:c,preprocessRequest:u,logger:h})).log({state:a(),extra:s})});return function(_x19,_x20){return _ref11.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref12=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c}){let{description:u,log:h}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c});return{description:u,action:r(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(v,{getState:S,extra:g}){return yield h({state:S(),extra:g})});return function(_x22,_x23){return _ref13.apply(this,arguments)}}())}});return function prepare(_x21){return _ref12.apply(this,arguments)}}()}),n}var Rg=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return bE(i)}return n},wE=e=>e.configuration.analytics.analyticsMode==="legacy",AE=e=>e.configuration.analytics.analyticsMode==="next",bE=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),SE(e,/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:c,preprocessRequest:u,logger:h}){let v=[],S={log:function(){var _ref15=_asyncToGenerator(function*({state:C}){for(let I of v)yield I(C)});return function log(_x25){return _ref15.apply(this,arguments)}}()},g=s(),y=i({getState:s,logger:h,analyticsClientMiddleware:c,preprocessRequest:u,provider:r(s)}),x=yield t(y,s());S.description=x?.description,v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(C){wE(C)&&(yield xE(x,r,C,h,y.coveoAnalyticsClient))});return function(_x26){return _ref16.apply(this,arguments)}}());let{emit:E}=Oi(g);return v.push(/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(C){if(AE(C)&&o&&n){let I=n(C);yield kE(E,o,I)}});return function(_x27){return _ref17.apply(this,arguments)}}()),S});return function(_x24){return _ref14.apply(this,arguments)}}()));function xE(_x28,_x29,_x30,_x31,_x32){return _xE.apply(this,arguments)}function _xE(){_xE=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _xE.apply(this,arguments)}var CE=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref18=_asyncToGenerator(function*(i){r(n,o)});return function log(_x33){return _ref18.apply(this,arguments)}}()}),ct=Rg(e=>lg({...e,provider:e.provider||new wr(e.getState)}),e=>e,wr),O1=Rg(Cg,CE("caseAssist"),Pi);var Wl=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return EE(e,r,t)};function EE(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:TE(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:_E(e),queryPipeline:r.pipeline||ro()}}var ps=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||""}),Ig={urihash:new H,sourcetype:new H,permanentid:new H},Tg={uniqueId:X,raw:new ee({values:Ig}),title:X,uri:X,clickUri:X,rankingModifier:new H({required:!1,emptyAllowed:!0})};function RE(e){return Object.assign({},...Object.keys(Ig).map(t=>({[t]:e[t]})))}function IE(e){return Object.assign({},...Object.keys(Tg).map(t=>({[t]:e[t]})),{raw:RE(e.raw)})}function TE(e){let t=e.raw.author;return ie(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function _E(e){let t=e.raw.source;return ie(t)?"unknown":t}var Kl=e=>new lt(Tg).validate(IE(e));function kE(_x34,_x35,_x36){return _kE.apply(this,arguments)}function _kE(){_kE=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _kE.apply(this,arguments)}m();d();f();p();var _g=()=>ct("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new ki(e)),kg=()=>({actionCause:"recommendationInterfaceLoad"}),ms=e=>ct({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Kl(e),t.makeRecommendationOpen(Wl(e,r),ps(e))),__legacy__provider:t=>new ki(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Wl(e,t),n=ps(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var mo=P("recommendation/set",e=>j(e,{id:X})),Ar=be("recommendation/get",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield OE(o),s=yield n.recommendations(a),c=Date.now()-i;return dt(s)?r(s.error):{recommendations:s.success.results,analyticsAction:_g(),duration:c,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x37,_x38){return _ref19.apply(this,arguments)}}()),OE=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pr(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?bt.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield PE(e,kg()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function OE(_x39){return _ref20.apply(this,arguments)}}(),PE=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield ds(e.configuration.analytics,r)});return function PE(_x40,_x41){return _ref21.apply(this,arguments)}}();var go=Me(fo(),e=>{e.addCase(mo,(t,r)=>{t.id=r.payload.id}).addCase(Ar.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Ar.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Ar.pending,t=>{t.isLoading=!0}).addCase(Ga,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();f();p();var ho=P("searchHub/set",e=>j(e,new H({required:!0,emptyAllowed:!0})));m();d();f();p();var yo=Me(po(),e=>{e.addCase(ho,(t,r)=>r.payload).addCase(mt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ut,(t,r)=>r.payload.searchHub||t)});m();d();f();p();m();d();f();p();m();d();f();p();function Og(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Pg=qt;function $g(e,t){if(e===t||!(Pg(e)&&Pg(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=$g(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function vo(e){let t=0;for(let r in e)t++;return t}var Ng=e=>[].concat(...e);function NE(e){return new RegExp("(^|:)//").test(e)}function FE(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function ys(e){return e!=null}function DE(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var ME=e=>e.replace(/\/$/,""),jE=e=>e.replace(/^\//,"");function qE(e,t){if(!e)return t;if(!t)return e;if(NE(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=ME(e),t=jE(t),`${e}${r}${t}`}function LE(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Fg=(...e)=>A(...e),UE=e=>e.status>=200&&e.status<=299,VE=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Dg(e){if(!qt(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Qg({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=Fg,paramsSerializer:n,isJsonContentType:o=VE,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:c,validateStatus:u,...h}={}){return typeof A>"u"&&r===Fg&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(S,g,y){let{getState:x,extra:E,endpoint:C,forced:I,type:T}=g,_,{url:q,headers:N=new b(h.headers),params:k=void 0,responseHandler:O=c??"json",validateStatus:D=u??UE,timeout:U=s,...z}=typeof S=="string"?{url:S}:S,$,G=g.signal;U&&($=new l.AbortController,g.signal.addEventListener("abort",$.abort),G=$.signal);let V={...h,signal:G,...z};N=new b(Dg(N)),V.headers=(yield t(N,{getState:x,arg:S,extra:E,endpoint:C,forced:I,type:T,extraOptions:y}))||N;let Q=le=>typeof le=="object"&&(qt(le)||Array.isArray(le)||typeof le.toJSON=="function");if(!V.headers.has("content-type")&&Q(V.body)&&V.headers.set("content-type",i),Q(V.body)&&o(V.headers)&&(V.body=JSON.stringify(V.body,a)),k){let le=~q.indexOf("?")?"&":"?",he=n?n(k):new URLSearchParams(Dg(k));q+=le+he}q=qE(e,q);let B=new Request(q,V);_={request:new Request(q,V)};let Y,ne=!1,pe=$&&setTimeout(()=>{ne=!0,$.abort()},U);try{Y=yield r(B)}catch(le){return{error:{status:ne?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(le)},meta:_}}finally{pe&&clearTimeout(pe),$?.signal.removeEventListener("abort",$.abort)}let we=Y.clone();_.response=we;let de,fe="";try{let le;if(yield Promise.all([v(Y,O).then(he=>de=he,he=>le=he),we.text().then(he=>fe=he,()=>{})]),le)throw le}catch(le){return{error:{status:"PARSING_ERROR",originalStatus:Y.status,data:fe,error:String(le)},meta:_}}return D(Y,de)?{data:de,meta:_}:{error:{status:Y.status,data:de},meta:_}});return function(_x42,_x43,_x44){return _ref22.apply(this,arguments)}}());function v(_x45,_x46){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let y=yield S.text();return y.length?JSON.parse(y):null}return S.text()});return _v2.apply(this,arguments)}}var So=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function GE(){return _GE.apply(this,arguments)}function _GE(){_GE=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _GE.apply(this,arguments)}function BE(e,t){throw Object.assign(new So({error:e,meta:t}),{throwImmediately:!0})}var Mg={},$E=(e,t)=>(/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Mg).maxRetries,(o||Mg).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),c={maxRetries:a,backoff:GE,retryCondition:(h,v,{attempt:S})=>S<=a,...t,...o},u=0;for(;;)try{let h=yield e(r,n,o);if(h.error)throw new So(h);return h}catch(h){if(u++,h.throwImmediately){if(h instanceof So)return h.value;throw h}if(h instanceof So&&!c.retryCondition(h.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:o}))return h.value;yield c.backoff(u,c.maxRetries)}});return function(_x47,_x48,_x49){return _ref23.apply(this,arguments)}}()),vs=Object.assign($E,{fail:BE}),ed=P("__rtkq/focused"),Hg=P("__rtkq/unfocused"),td=P("__rtkq/online"),zg=P("__rtkq/offline");function rd(e){return e.type==="query"}function QE(e){return e.type==="mutation"}function nd(e){return e.type==="infinitequery"}function od(e,t,r,n,o,i){return HE(e)?e(t,r,n,o).filter(ys).map(Xl).map(i):Array.isArray(e)?e.map(Xl).map(i):[]}function HE(e){return typeof e=="function"}function Xl(e){return typeof e=="string"?{type:e}:e}function zE(e,t){return e.catch(t)}var Fi=Symbol("forceQueryFn"),Jl=e=>typeof e[Fi]=="function";function WE({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,s=new Map,{unsubscribeQueryResult:c,removeMutationResult:u,updateSubscriptionOptions:h}=o.internalActions;return{buildInitiateQuery:C,buildInitiateInfiniteQuery:I,buildInitiateMutation:T,getRunningQueryThunk:v,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:y};function v(_,q){return N=>{let k=i.endpointDefinitions[_],O=e({queryArgs:q,endpointDefinition:k,endpointName:_});return a.get(N)?.[O]}}function S(_,q){return N=>s.get(N)?.[q]}function g(){return _=>Object.values(a.get(_)||{}).filter(ys)}function y(){return _=>Object.values(s.get(_)||{}).filter(ys)}function x(_){}function E(_,q){let N=(k,{subscribe:O=!0,forceRefetch:D,subscriptionOptions:U,[Fi]:z,...$}={})=>(G,V)=>{let Q=e({queryArgs:k,endpointDefinition:q,endpointName:_}),B,K={...$,type:"query",subscribe:O,forceRefetch:D,subscriptionOptions:U,endpointName:_,originalArgs:k,queryCacheKey:Q,[Fi]:z};if(rd(q))B=t(K);else{let{direction:Ee,initialPageParam:De}=$;B=r({...K,direction:Ee,initialPageParam:De})}let Y=o.endpoints[_].select(k),ne=G(B),pe=Y(V());let{requestId:we,abort:de}=ne,fe=pe.requestId!==we,le=a.get(G)?.[Q],he=()=>Y(V()),Le=Object.assign(z?ne.then(he):fe&&!le?Promise.resolve(pe):Promise.all([le,ne]).then(he),{arg:k,requestId:we,subscriptionOptions:U,queryCacheKey:Q,abort:de,unwrap(){return _asyncToGenerator(function*(){let Ee=yield Le;if(Ee.isError)throw Ee.error;return Ee.data})()},refetch:()=>G(N(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&G(c({queryCacheKey:Q,requestId:we}))},updateSubscriptionOptions(Ee){Le.subscriptionOptions=Ee,G(h({endpointName:_,requestId:we,queryCacheKey:Q,options:Ee}))}});if(!le&&!fe&&!z){let Ee=LE(a,G,{});Ee[Q]=Le,Le.then(()=>{delete Ee[Q],vo(Ee)||a.delete(G)})}return Le};return N}function C(_,q){return E(_,q)}function I(_,q){return E(_,q)}function T(_){return(q,{track:N=!0,fixedCacheKey:k}={})=>(O,D)=>{let U=n({type:"mutation",endpointName:_,originalArgs:q,track:N,fixedCacheKey:k}),z=O(U);let{requestId:$,abort:G,unwrap:V}=z,Q=zE(z.unwrap().then(ne=>({data:ne})),ne=>({error:ne})),B=()=>{O(u({requestId:$,fixedCacheKey:k}))},K=Object.assign(Q,{arg:z.arg,requestId:$,abort:G,unwrap:V,reset:B}),Y=s.get(O)||{};return s.set(O,Y),Y[$]=K,K.then(()=>{delete Y[$],vo(Y)||s.delete(O)}),k&&(Y[k]=K,K.then(()=>{Y[k]===K&&(delete Y[k],vo(Y)||s.delete(O))})),K}}}function KE(e){return e}var gs=(e={})=>({...e,[wi]:!0});function YE({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let s=(O,D,U,z)=>($,G)=>{let V=r[O],Q=n({queryArgs:D,endpointDefinition:V,endpointName:O});if($(o.internalActions.queryResultPatched({queryCacheKey:Q,patches:U})),!z)return;let B=o.endpoints[O].select(D)(G()),K=od(V.providesTags,B.data,void 0,D,{},i);$(o.internalActions.updateProvidedBy({queryCacheKey:Q,providedTags:K}))};function c(O,D,U=0){let z=[D,...O];return U&&z.length>U?z.slice(0,-1):z}function u(O,D,U=0){let z=[...O,D];return U&&z.length>U?z.slice(1):z}let h=(O,D,U,z=!0)=>($,G)=>{let Q=o.endpoints[O].select(D)(G()),B={patches:[],inversePatches:[],undo:()=>$(o.util.patchQueryData(O,D,B.inversePatches,z))};if(Q.status==="uninitialized")return B;let K;if("data"in Q)if(ft(Q.data)){let[Y,ne,pe]=Ea(Q.data,U);B.patches.push(...ne),B.inversePatches.push(...pe),K=Y}else K=U(Q.data),B.patches.push({op:"replace",path:[],value:K}),B.inversePatches.push({op:"replace",path:[],value:Q.data});return B.patches.length===0||$(o.util.patchQueryData(O,D,B.patches,z)),B},v=(O,D,U)=>z=>z(o.endpoints[O].initiate(D,{subscribe:!1,forceRefetch:!0,[Fi]:()=>({data:U})})),S=(O,D)=>O.query&&O[D]?O[D]:KE,g=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(O,{signal:D,abort:U,rejectWithValue:z,fulfillWithValue:$,dispatch:G,getState:V,extra:Q}){let B=r[O.endpointName];try{let K=S(B,"transformResponse"),Y={signal:D,abort:U,dispatch:G,getState:V,extra:Q,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?y(O,V()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},ne=O.type==="query"?O[Fi]:void 0,pe,we=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(fe,le,he,Le){if(le==null&&fe.pages.length)return Promise.resolve({data:fe});let Ee={queryArg:O.originalArgs,pageParam:le},De=yield de(Ee),Ge=Le?c:u;return{data:{pages:Ge(fe.pages,De.data,he),pageParams:Ge(fe.pageParams,le,he)}}});return function we(_x52,_x53,_x54,_x55){return _ref25.apply(this,arguments)}}();function de(_x56){return _de.apply(this,arguments)}function _de(){_de=_asyncToGenerator(function*(fe){let le,{extraOptions:he}=B;if(ne?le=ne():B.query?le=yield t(B.query(fe),Y,he):le=yield B.queryFn(fe,Y,he,Ee=>t(Ee,Y,he)),typeof process<"u",le.error)throw new So(le.error,le.meta);let Le=yield K(le.data,le.meta,fe);return{...le,data:Le}});return _de.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in B){let{infiniteQueryOptions:fe}=B,{maxPages:le=1/0}=fe,he,Le={pages:[],pageParams:[]},Ee=a.selectQueryEntry(V(),O.queryCacheKey)?.data,Ge=y(O,V())&&!O.direction||!Ee?Le:Ee;if("direction"in O&&O.direction&&Ge.pages.length){let ut=O.direction==="backward",dr=(ut?Wg:Zl)(fe,Ge);he=yield we(Ge,dr,le,ut)}else{let{initialPageParam:ut=fe.initialPageParam}=O,wt=Ee?.pageParams??[],dr=wt[0]??ut,Mn=wt.length;he=yield we(Ge,dr,le),ne&&(he={data:he.data.pages[0]});for(let jn=1;jn<Mn;jn++){let ei=Zl(fe,he.data);he=yield we(he.data,ei,le)}}pe=he}else pe=yield de(O.originalArgs);return $(pe.data,gs({fulfilledTimeStamp:Date.now(),baseQueryMeta:pe.meta}))}catch(K){let Y=K;if(Y instanceof So){let ne=S(B,"transformErrorResponse");try{return z(yield ne(Y.value,Y.meta,O.originalArgs),gs({baseQueryMeta:Y.meta}))}catch(pe){Y=pe}}throw typeof process<"u",console.error(Y),Y}});return function g(_x50,_x51){return _ref24.apply(this,arguments)}}();function y(O,D){let U=a.selectQueryEntry(D,O.queryCacheKey),z=a.selectConfig(D).refetchOnMountOrArgChange,$=U?.fulfilledTimeStamp,G=O.forceRefetch??(O.subscribe&&z);return G?G===!0||(Number(new Date)-Number($))/1e3>=G:!1}let x=()=>be(`${e}/executeQuery`,g,{getPendingMeta({arg:D}){let U=r[D.endpointName];return gs({startedTimeStamp:Date.now(),...(nd(U)?{direction:D.direction}:{})})},condition(D,{getState:U}){let z=U(),$=a.selectQueryEntry(z,D.queryCacheKey),G=$?.fulfilledTimeStamp,V=D.originalArgs,Q=$?.originalArgs,B=r[D.endpointName],K=D.direction;return Jl(D)?!0:$?.status==="pending"?!1:y(D,z)||rd(B)&&B?.forceRefetch?.({currentArg:V,previousArg:Q,endpointState:$,state:z})?!0:!(G&&!K)},dispatchConditionRejection:!0}),E=x(),C=x(),I=be(`${e}/executeMutation`,g,{getPendingMeta(){return gs({startedTimeStamp:Date.now()})}}),T=O=>"force"in O,_=O=>"ifOlderThan"in O,q=(O,D,U)=>(z,$)=>{let G=T(U)&&U.force,V=_(U)&&U.ifOlderThan,Q=(K=!0)=>{let Y={forceRefetch:K,isPrefetch:!0};return o.endpoints[O].initiate(D,Y)},B=o.endpoints[O].select(D)($());if(G)z(Q());else if(V){let K=B?.fulfilledTimeStamp;if(!K){z(Q());return}(Number(new Date)-Number(new Date(K)))/1e3>=V&&z(Q())}else z(Q(!1))};function N(O){return D=>D?.meta?.arg?.endpointName===O}function k(O,D){return{matchPending:Kn(Oa(O),N(D)),matchFulfilled:Kn(Zt(O),N(D)),matchRejected:Kn(Yr(O),N(D))}}return{queryThunk:E,mutationThunk:I,infiniteQueryThunk:C,prefetch:q,updateQueryData:h,upsertQueryData:v,patchQueryData:s,buildMatchThunkActions:k}}function Zl(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Wg(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Kg(e,t,r,n){return od(r[e.meta.arg.endpointName][t],Zt(e)?e.payload:void 0,bi(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function hs(e,t,r){let n=e[t];n&&r(n)}function Di(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function jg(e,t,r){let n=e[Di(t)];n&&r(n)}var Ni={};function XE({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:c,config:u}){let h=P(`${e}/resetApiState`);function v(N,k,O,D){var U;N[U=k.queryCacheKey]??(N[U]={status:"uninitialized",endpointName:k.endpointName}),hs(N,k.queryCacheKey,z=>{z.status="pending",z.requestId=O&&z.requestId?z.requestId:D.requestId,k.originalArgs!==void 0&&(z.originalArgs=k.originalArgs),z.startedTimeStamp=D.startedTimeStamp;let $=o[D.arg.endpointName];nd($)&&"direction"in k&&(z.direction=k.direction)})}function S(N,k,O,D){hs(N,k.arg.queryCacheKey,U=>{if(U.requestId!==k.requestId&&!D)return;let{merge:z}=o[k.arg.endpointName];if(U.status="fulfilled",z){if(U.data!==void 0){let{fulfilledTimeStamp:$,arg:G,baseQueryMeta:V,requestId:Q}=k,B=Jt(U.data,K=>z(K,O,{arg:G.originalArgs,baseQueryMeta:V,fulfilledTimeStamp:$,requestId:Q}));U.data=B}else U.data=O;}else U.data=o[k.arg.endpointName].structuralSharing??!0?$g(vt(U.data)?tl(U.data):U.data,O):O;delete U.error,U.fulfilledTimeStamp=k.fulfilledTimeStamp})}let g=Xr({name:`${e}/queries`,initialState:Ni,reducers:{removeQueryResult:{reducer(N,{payload:{queryCacheKey:k}}){delete N[k]},prepare:Yn()},cacheEntriesUpserted:{reducer(N,k){for(let O of k.payload){let{queryDescription:D,value:U}=O;v(N,D,!0,{arg:D,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),S(N,{arg:D,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:N=>({payload:N.map(D=>{let{endpointName:U,arg:z,value:$}=D,G=o[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:D.arg,queryCacheKey:n({queryArgs:z,endpointDefinition:G,endpointName:U})},value:$}}),meta:{[wi]:!0,requestId:xi(),timestamp:Date.now()}})},queryResultPatched:{reducer(N,{payload:{queryCacheKey:k,patches:O}}){hs(N,k,D=>{D.data=nl(D.data,O.concat())})},prepare:Yn()}},extraReducers(N){N.addCase(t.pending,(k,{meta:O,meta:{arg:D}})=>{let U=Jl(D);v(k,D,U,O)}).addCase(t.fulfilled,(k,{meta:O,payload:D})=>{let U=Jl(O.arg);S(k,O,D,U)}).addCase(t.rejected,(k,{meta:{condition:O,arg:D,requestId:U},error:z,payload:$})=>{hs(k,D.queryCacheKey,G=>{if(!O){if(G.requestId!==U)return;G.status="rejected",G.error=$??z}})}).addMatcher(s,(k,O)=>{let{queries:D}=a(O);for(let[U,z]of Object.entries(D))(z?.status==="fulfilled"||z?.status==="rejected")&&(k[U]=z)})}}),y=Xr({name:`${e}/mutations`,initialState:Ni,reducers:{removeMutationResult:{reducer(N,{payload:k}){let O=Di(k);O in N&&delete N[O]},prepare:Yn()}},extraReducers(N){N.addCase(r.pending,(k,{meta:O,meta:{requestId:D,arg:U,startedTimeStamp:z}})=>{U.track&&(k[Di(O)]={requestId:D,status:"pending",endpointName:U.endpointName,startedTimeStamp:z})}).addCase(r.fulfilled,(k,{payload:O,meta:D})=>{D.arg.track&&jg(k,D,U=>{U.requestId===D.requestId&&(U.status="fulfilled",U.data=O,U.fulfilledTimeStamp=D.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:O,error:D,meta:U})=>{U.arg.track&&jg(k,U,z=>{z.requestId===U.requestId&&(z.status="rejected",z.error=O??D)})}).addMatcher(s,(k,O)=>{let{mutations:D}=a(O);for(let[U,z]of Object.entries(D))(z?.status==="fulfilled"||z?.status==="rejected")&&U!==z?.requestId&&(k[U]=z)})}}),x=Xr({name:`${e}/invalidation`,initialState:Ni,reducers:{updateProvidedBy:{reducer(N,k){var U,z;let{queryCacheKey:O,providedTags:D}=k.payload;for(let $ of Object.values(N))for(let G of Object.values($)){let V=G.indexOf(O);V!==-1&&G.splice(V,1)}for(let{type:$,id:G}of D){let V=(U=N[$]??(N[$]={}))[z=G||"__internal_without_id"]??(U[z]=[]);V.includes(O)||V.push(O)}},prepare:Yn()}},extraReducers(N){N.addCase(g.actions.removeQueryResult,(k,{payload:{queryCacheKey:O}})=>{for(let D of Object.values(k))for(let U of Object.values(D)){let z=U.indexOf(O);z!==-1&&U.splice(z,1)}}).addMatcher(s,(k,O)=>{var U,z;let{provided:D}=a(O);for(let[$,G]of Object.entries(D))for(let[V,Q]of Object.entries(G)){let B=(U=k[$]??(k[$]={}))[z=V||"__internal_without_id"]??(U[z]=[]);for(let K of Q)B.includes(K)||B.push(K)}}).addMatcher(Lt(Zt(t),bi(t)),(k,O)=>{let D=Kg(O,"providesTags",o,c),{queryCacheKey:U}=O.meta.arg;x.caseReducers.updateProvidedBy(k,x.actions.updateProvidedBy({queryCacheKey:U,providedTags:D}))})}}),E=Xr({name:`${e}/subscriptions`,initialState:Ni,reducers:{updateSubscriptionOptions(N,k){},unsubscribeQueryResult(N,k){},internal_getRTKQSubscriptions(){}}}),C=Xr({name:`${e}/internalSubscriptions`,initialState:Ni,reducers:{subscriptionsUpdated:{reducer(N,k){return nl(N,k.payload)},prepare:Yn()}}}),I=Xr({name:`${e}/config`,initialState:{online:DE(),focused:FE(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(N,{payload:k}){N.middlewareRegistered=N.middlewareRegistered==="conflict"||i!==k?"conflict":!0}},extraReducers:N=>{N.addCase(td,k=>{k.online=!0}).addCase(zg,k=>{k.online=!1}).addCase(ed,k=>{k.focused=!0}).addCase(Hg,k=>{k.focused=!1}).addMatcher(s,k=>({...k}))}}),T=Gn({queries:g.reducer,mutations:y.reducer,provided:x.reducer,subscriptions:C.reducer,config:I.reducer}),_=(N,k)=>T(h.match(k)?void 0:N,k),q={...I.actions,...g.actions,...E.actions,...C.actions,...y.actions,...x.actions,resetApiState:h};return{reducer:_,actions:q}}var Yl=Symbol.for("RTKQ/skipToken"),Yg={status:"uninitialized"},qg=Jt(Yg,()=>{}),Lg=Jt(Yg,()=>{});function JE({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=T=>qg,o=T=>Lg;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:y,selectInvalidatedBy:x,selectCachedArgsForQuery:E,selectApiState:a,selectQueries:s,selectMutations:u,selectQueryEntry:c,selectConfig:h};function i(T){return{...T,...Og(T.status)}}function a(T){return T[t]}function s(T){return a(T)?.queries}function c(T,_){return s(T)?.[_]}function u(T){return a(T)?.mutations}function h(T){return a(T)?.config}function v(T,_,q){return N=>{if(N===Yl)return r(n,q);let k=e({queryArgs:N,endpointDefinition:_,endpointName:T});return r(D=>c(D,k)??qg,q)}}function S(T,_){return v(T,_,i)}function g(T,_){let{infiniteQueryOptions:q}=_;function N(k){let O={...k,...Og(k.status)},{isLoading:D,isError:U,direction:z}=O,$=z==="forward",G=z==="backward";return{...O,hasNextPage:C(q,O.data),hasPreviousPage:I(q,O.data),isFetchingNextPage:D&&$,isFetchingPreviousPage:D&&G,isFetchNextPageError:U&&$,isFetchPreviousPageError:U&&G}}return v(T,_,N)}function y(){return T=>{let _;return typeof T=="object"?_=Di(T)??Yl:_=T,r(_===Yl?o:k=>a(k)?.mutations?.[_]??Lg,i)}}function x(T,_){let q=T[t],N=new Set;for(let k of _.filter(ys).map(Xl)){let O=q.provided[k.type];if(!O)continue;let D=(k.id!==void 0?O[k.id]:Ng(Object.values(O)))??[];for(let U of D)N.add(U)}return Ng(Array.from(N.values()).map(k=>{let O=q.queries[k];return O?[{queryCacheKey:k,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function E(T,_){return Object.values(s(T)).filter(q=>q?.endpointName===_&&q.status!=="uninitialized").map(q=>q.originalArgs)}function C(T,_){return _?Zl(T,_)!=null:!1}function I(T,_){return!_||!T.getPreviousPageParam?!1:Wg(T,_)!=null}}var Ug=WeakMap?new WeakMap:void 0,Vg=({endpointName:e,queryArgs:t})=>{let r="",n=Ug?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=qt(a)?Object.keys(a).sort().reduce((s,c)=>(s[c]=a[c],s),{}):a,a));qt(t)&&Ug?.set(t,o),r=o}return`${e}(${r})`};function ZE(...e){return function(r){let n=zn(u=>r.extractRehydrationInfo?.(u,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let h=Vg;if("serializeQueryArgs"in u.endpointDefinition){let v=u.endpointDefinition.serializeQueryArgs;h=S=>{let g=v(S);return typeof g=="string"?g:Vg({...S,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(u)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(u){u()},apiUid:xi(),extractRehydrationInfo:n,hasRehydrationInfo:zn(u=>n(u)!=null)},a={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:h}){if(u)for(let v of u)o.tagTypes.includes(v)||o.tagTypes.push(v);if(h)for(let[v,S]of Object.entries(h))typeof S=="function"?S(i.endpointDefinitions[v]):Object.assign(i.endpointDefinitions[v]||{},S);return a}},s=e.map(u=>u.init(a,o,i));function c(u){let h=u.endpoints({query:v=>({...v,type:"query"}),mutation:v=>({...v,type:"mutation"}),infiniteQuery:v=>({...v,type:"infinitequery"})});for(let[v,S]of Object.entries(h)){if(u.overrideExisting!==!0&&v in i.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(st(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=S;for(let g of s)g.injectEndpoint(v,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function or(e,...t){return Object.assign(e,...t)}var eR=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:s}=e.internalActions,c=(g,y)=>{var E,C;if(a.match(y)){let{queryCacheKey:I,requestId:T,options:_}=y.payload;return g?.[I]?.[T]&&(g[I][T]=_),!0}if(s.match(y)){let{queryCacheKey:I,requestId:T}=y.payload;return g[I]&&delete g[I][T],!0}if(e.internalActions.removeQueryResult.match(y))return delete g[y.payload.queryCacheKey],!0;if(t.pending.match(y)){let{meta:{arg:I,requestId:T}}=y,_=g[E=I.queryCacheKey]??(g[E]={});return _[`${T}_running`]={},I.subscribe&&(_[T]=I.subscriptionOptions??_[T]??{}),!0}let x=!1;if(t.fulfilled.match(y)||t.rejected.match(y)){let I=g[y.meta.arg.queryCacheKey]||{},T=`${y.meta.requestId}_running`;x||(x=!!I[T]),delete I[T]}if(t.rejected.match(y)){let{meta:{condition:I,arg:T,requestId:_}}=y;if(I&&T.subscribe){let q=g[C=T.queryCacheKey]??(g[C]={});q[_]=T.subscriptionOptions??q[_]??{},x=!0}}return x},u=()=>r.currentSubscriptions,S={getSubscriptions:u,getSubscriptionCount:g=>{let x=u()[g]??{};return vo(x)},isRequestSubscribed:(g,y)=>!!u()?.[g]?.[y]};return(g,y)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let x=c(r.currentSubscriptions,g),E=!0;if(x){i||(i=setTimeout(()=>{let T=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,_]=Ea(o,()=>T);y.next(e.internalActions.subscriptionsUpdated(_)),o=T,i=null},500));let C=typeof g.type=="string"&&!!g.type.startsWith(n),I=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;E=!C&&!I}return[E,!1]}};function tR(e){for(let t in e)return!1;return!0}var rR=2147483647/1e3-1,nR=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:s,unsubscribeQueryResult:c,cacheEntriesUpserted:u}=t.internalActions,h=Lt(c.match,r.fulfilled,r.rejected,u.match);function v(E){let C=o.currentSubscriptions[E];return!!C&&!tR(C)}let S={},g=(E,C,I)=>{let T=C.getState(),_=a(T);if(h(E)){let q;if(u.match(E))q=E.payload.map(N=>N.queryDescription.queryCacheKey);else{let{queryCacheKey:N}=c.match(E)?E.payload:E.meta.arg;q=[N]}y(q,C,_)}if(t.util.resetApiState.match(E))for(let[q,N]of Object.entries(S))N&&clearTimeout(N),delete S[q];if(n.hasRehydrationInfo(E)){let{queries:q}=n.extractRehydrationInfo(E);y(Object.keys(q),C,_)}};function y(E,C,I){let T=C.getState();for(let _ of E){let q=i(T,_);x(_,q?.endpointName,C,I)}}function x(E,C,I,T){let q=n.endpointDefinitions[C]?.keepUnusedDataFor??T.keepUnusedDataFor;if(q===1/0)return;let N=Math.max(0,Math.min(q,rR));if(!v(E)){let k=S[E];k&&clearTimeout(k),S[E]=setTimeout(()=>{v(E)||I.dispatch(s({queryCacheKey:E})),delete S[E]},N*1e3)}}return g},Gg=new Error("Promise never resolved before cacheEntryRemoved."),oR=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let c=Pa(n),u=Pa(o),h=Zt(n,o),v={};function S(C,I,T){let _=v[C];_?.valueResolved&&(_.valueResolved({data:I,meta:T}),delete _.valueResolved)}function g(C){let I=v[C];I&&(delete v[C],I.cacheEntryRemoved())}let y=(C,I,T)=>{let _=x(C);function q(N,k,O,D){let U=a(T,k),z=a(I.getState(),k);!U&&z&&E(N,D,k,I,O)}if(n.pending.match(C))q(C.meta.arg.endpointName,_,C.meta.requestId,C.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(C))for(let{queryDescription:N,value:k}of C.payload){let{endpointName:O,originalArgs:D,queryCacheKey:U}=N;q(O,U,C.meta.requestId,D),S(U,k,{})}else if(o.pending.match(C))I.getState()[t].mutations[_]&&E(C.meta.arg.endpointName,C.meta.arg.originalArgs,_,I,C.meta.requestId);else if(h(C))S(_,C.payload,C.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(C)||e.internalActions.removeMutationResult.match(C))g(_);else if(e.util.resetApiState.match(C))for(let N of Object.keys(v))g(N)};function x(C){return c(C)?C.meta.arg.queryCacheKey:u(C)?C.meta.arg.fixedCacheKey??C.meta.requestId:e.internalActions.removeQueryResult.match(C)?C.payload.queryCacheKey:e.internalActions.removeMutationResult.match(C)?Di(C.payload):""}function E(C,I,T,_,q){let N=r.endpointDefinitions[C],k=N?.onCacheEntryAdded;if(!k)return;let O={},D=new Promise(Q=>{O.cacheEntryRemoved=Q}),U=Promise.race([new Promise(Q=>{O.valueResolved=Q}),D.then(()=>{throw Gg})]);U.catch(()=>{}),v[T]=O;let z=e.endpoints[C].select(N.type==="query"?I:T),$=_.dispatch((Q,B,K)=>K),G={..._,getCacheEntry:()=>z(_.getState()),requestId:q,extra:$,updateCachedData:N.type==="query"?Q=>_.dispatch(e.util.updateQueryData(C,I,Q)):void 0,cacheDataLoaded:U,cacheEntryRemoved:D},V=k(I,G);Promise.resolve(V).catch(Q=>{if(Q!==Gg)throw Q})}return y},iR=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},aR=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:c})=>{let{removeQueryResult:u}=i.internalActions,h=Lt(Zt(n),bi(n)),v=Lt(Zt(n,o),Yr(n,o)),S=[],g=(E,C)=>{h(E)?x(Kg(E,"invalidatesTags",r,a),C):v(E)?x([],C):i.util.invalidateTags.match(E)&&x(od(E.payload,void 0,void 0,void 0,void 0,a),C)};function y(E){let{queries:C,mutations:I}=E;for(let T of[C,I])for(let _ in T)if(T[_]?.status==="pending")return!0;return!1}function x(E,C){let I=C.getState(),T=I[e];if(S.push(...E),T.config.invalidationBehavior==="delayed"&&y(T))return;let _=S;if(S=[],_.length===0)return;let q=i.util.selectInvalidatedBy(I,_);t.batch(()=>{let N=Array.from(q.values());for(let{queryCacheKey:k}of N){let O=T.queries[k],D=c.currentSubscriptions[k]??{};O&&(vo(D)===0?C.dispatch(u({queryCacheKey:k})):O.status!=="uninitialized"&&C.dispatch(s(O)))}})}return g},sR=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,y)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&u(g.payload,y),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&u(g.meta.arg,y),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&c(g.meta.arg,y),r.util.resetApiState.match(g)&&v()};function s(g,y){let E=y.getState()[e].queries[g],C=o.currentSubscriptions[g];if(!(!E||E.status==="uninitialized"))return C}function c({queryCacheKey:g},y){let x=y.getState()[e],E=x.queries[g],C=o.currentSubscriptions[g];if(!E||E.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:T}=S(C);if(!Number.isFinite(I))return;let _=i[g];_?.timeout&&(clearTimeout(_.timeout),_.timeout=void 0);let q=Date.now()+I;i[g]={nextPollTimestamp:q,pollingInterval:I,timeout:setTimeout(()=>{(x.config.focused||!T)&&y.dispatch(n(E)),c({queryCacheKey:g},y)},I)}}function u({queryCacheKey:g},y){let E=y.getState()[e].queries[g],C=o.currentSubscriptions[g];if(!E||E.status==="uninitialized")return;let{lowestPollingInterval:I}=S(C);if(!Number.isFinite(I)){h(g);return}let T=i[g],_=Date.now()+I;(!T||_<T.nextPollTimestamp)&&c({queryCacheKey:g},y)}function h(g){let y=i[g];y?.timeout&&clearTimeout(y.timeout),delete i[g]}function v(){for(let g of Object.keys(i))h(g)}function S(g={}){let y=!1,x=Number.POSITIVE_INFINITY;for(let E in g)g[E].pollingInterval&&(x=Math.min(g[E].pollingInterval,x),y=g[E].skipPollingIfUnfocused||y);return{lowestPollingInterval:x,skipPollingIfUnfocused:y}}return a},cR=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Oa(r,n),i=Yr(r,n),a=Zt(r,n),s={};return(u,h)=>{if(o(u)){let{requestId:v,arg:{endpointName:S,originalArgs:g}}=u.meta,y=t.endpointDefinitions[S],x=y?.onQueryStarted;if(x){let E={},C=new Promise((q,N)=>{E.resolve=q,E.reject=N});C.catch(()=>{}),s[v]=E;let I=e.endpoints[S].select(y.type==="query"?g:v),T=h.dispatch((q,N,k)=>k),_={...h,getCacheEntry:()=>I(h.getState()),requestId:v,extra:T,updateCachedData:y.type==="query"?q=>h.dispatch(e.util.updateQueryData(S,g,q)):void 0,queryFulfilled:C};x(g,_)}}else if(a(u)){let{requestId:v,baseQueryMeta:S}=u.meta;s[v]?.resolve({data:u.payload,meta:S}),delete s[v]}else if(i(u)){let{requestId:v,rejectedWithValue:S,baseQueryMeta:g}=u.meta;s[v]?.reject({error:u.payload??u.error,isUnhandledError:!S,meta:g}),delete s[v]}}},uR=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(c,u)=>{ed.match(c)&&s(u,"refetchOnFocus"),td.match(c)&&s(u,"refetchOnReconnect")};function s(c,u){let h=c.getState()[e],v=h.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let y=v[g],x=S[g];if(!x||!y)continue;(Object.values(x).some(C=>C[u]===!0)||Object.values(x).every(C=>C[u]===void 0)&&h.config[u])&&(vo(x)===0?c.dispatch(i({queryCacheKey:g})):y.status!=="uninitialized"&&c.dispatch(n(y)))}})}return a};function lR(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:P(`${t}/invalidateTags`)},s=v=>v.type.startsWith(`${t}/`),c=[iR,nR,aR,sR,oR,cR];return{middleware:v=>{let S=!1,y={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:s},x=c.map(I=>I(y)),E=eR(y),C=uR(y);return I=>T=>{if(!$n(T))return I(T);S||(S=!0,v.dispatch(n.internalActions.middlewareRegistered(i)));let _={...v,next:I},q=v.getState(),[N,k]=E(T,_,q),O;if(N?O=I(T):O=k,v.getState()[t]&&(C(T,_,q),s(T)||o.hasRehydrationInfo(T)))for(let D of x)D(T,_,q);return O}},actions:a};function h(v){return e.api.endpoints[v.endpointName].initiate(v.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Bg=Symbol(),dR=({createSelector:e=Ue}={})=>({name:Bg,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:h},v){Lf();let S=de=>(typeof process<"u",de);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:td,onOffline:zg,onFocus:ed,onFocusLost:Hg},util:{}});let g=JE({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:y,selectCachedArgsForQuery:x,buildQuerySelector:E,buildInfiniteQuerySelector:C,buildMutationSelector:I}=g;or(t.util,{selectInvalidatedBy:y,selectCachedArgsForQuery:x});let{queryThunk:T,infiniteQueryThunk:_,mutationThunk:q,patchQueryData:N,updateQueryData:k,upsertQueryData:O,prefetch:D,buildMatchThunkActions:U}=YE({baseQuery:r,reducerPath:o,context:v,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:z,actions:$}=XE({context:v,queryThunk:T,infiniteQueryThunk:_,mutationThunk:q,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});or(t.util,{patchQueryData:N,updateQueryData:k,upsertQueryData:O,prefetch:D,resetApiState:$.resetApiState,upsertQueryEntries:$.cacheEntriesUpserted}),or(t.internalActions,$);let{middleware:G,actions:V}=lR({reducerPath:o,context:v,queryThunk:T,mutationThunk:q,infiniteQueryThunk:_,api:t,assertTagType:S,selectors:g});or(t.util,V),or(t,{reducer:z,middleware:G});let{buildInitiateQuery:Q,buildInitiateInfiniteQuery:B,buildInitiateMutation:K,getRunningMutationThunk:Y,getRunningMutationsThunk:ne,getRunningQueriesThunk:pe,getRunningQueryThunk:we}=WE({queryThunk:T,mutationThunk:q,infiniteQueryThunk:_,api:t,serializeQueryArgs:i,context:v});return or(t.util,{getRunningMutationThunk:Y,getRunningMutationsThunk:ne,getRunningQueryThunk:we,getRunningQueriesThunk:pe}),{name:Bg,injectEndpoint(de,fe){var Le;let he=(Le=t.endpoints)[de]??(Le[de]={});rd(fe)&&or(he,{name:de,select:E(de,fe),initiate:Q(de,fe)},U(T,de)),QE(fe)&&or(he,{name:de,select:I(),initiate:K(de)},U(q,de)),nd(fe)&&or(he,{name:de,select:C(de,fe),initiate:B(de,fe)},U(T,de))}}}}),Ss=ZE(dR());m();d();f();p();var id=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let u=Be(a,i);return{data:Qg({baseUrl:`${u}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref27=_asyncToGenerator(function*(v){if(v instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=v.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(y=>{g[y]=v[y]}),g.duplex="half",g.body=yield v.text(),A(S,g)});return function fetchFn(_x60){return _ref27.apply(this,arguments)}}()})(c,{...t,signal:null},r)}}catch(u){return{error:u}}});return function id(_x57,_x58,_x59){return _ref26.apply(this,arguments)}}(),Xg=Ss({reducerPath:"answer",baseQuery:vs(id,{maxRetries:3}),endpoints:()=>({})});var wo=Ss({reducerPath:"answerGenerationApi",refetchOnMountOrArgChange:!0,baseQuery:vs(id,{maxRetries:3}),endpoints:()=>({})});m();d();f();p();m();d();f();p();m();d();f();p();var tn=e=>e.query,Jg=e=>e.query?.enableQuerySyntax;var vG=Ue(e=>tn(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),pR=Ue(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();f();p();m();d();f();p();m();d();f();p();var ws=()=>({contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!1,isLoading:!0});m();d();f();p();m();d();f();p();m();d();f();p();function eh(_x61,_x62){return _eh.apply(this,arguments)}function _eh(){_eh=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _eh.apply(this,arguments)}function th(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=mR(t,a);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function rh(e,t,r){let n=Zg(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=Zg();else if(s>0){let c=o.decode(a.subarray(0,s)),u=s+(a[s+1]===32?2:1),h=o.decode(a.subarray(u));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":fR(h,n,t);break}}}}function fR(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function mR(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Zg(){return{data:"",event:"",id:"",retry:void 0}}var ad="text/event-stream",gR=1e3,nh="last-event-id";function oh(){return typeof window<"u"}function As(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:c,...u}){return new Promise((h,v)=>{let S={...r};S.accept||(S.accept=ad);let g;function y(){g?.abort(),document.hidden||_()}!s&&oh()&&document.addEventListener("visibilitychange",y);let x=gR,E;function C(){oh()&&document.removeEventListener("visibilitychange",y),clearTimeout(E),g?.abort()}t?.addEventListener("abort",()=>{C(),h()});let I=c??A,T=n??hR;function _(){return _2.apply(this,arguments)}function _2(){_2=_asyncToGenerator(function*(){g=l.AbortController?new l.AbortController:null;try{let q=yield I(e,{...u,headers:S,signal:g?.signal});yield T(q),yield eh(q.body,th(rh(N=>{N?S[nh]=N:delete S[nh]},N=>{x=N},o))),i?.(),C(),h()}catch(q){if(!g?.signal?.aborted)try{let N=a?.(q)??x;clearTimeout(E),E=setTimeout(_,N)}catch(N){C(),v(N)}}});return _2.apply(this,arguments)}_()})}function hR(e){let t=e.headers.get("content-type");if(!t?.startsWith(ad))throw new Error(`Expected content-type to be ${ad}, Actual: ${t}`)}m();d();f();p();m();d();f();p();var ih=(e,t)=>{t&&(e.answerId=t)},ah=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},sh=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},ch=(e,t)=>{e.citations=t.citations},uh=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},lh=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code??500},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)};var bs={handleOpen:(e,t)=>{let r=e.headers.get("x-answer-id");r&&t(n=>{ih(n,r)})},handleMessage:{"agentInteraction.answerHeader":(e,t)=>{t(r=>{ah(r,{contentFormat:"text/markdown"})})},"generativeengines.messageType":(e,t)=>{e?.payload?.textDelta&&t(r=>{sh(r,e.payload)})},"agentInteraction.citations":(e,t)=>{e?.payload?.citations!==void 0&&t(r=>{ch(r,e.payload)})},"generativeengines.endOfStreamType":(e,t)=>{t(r=>{uh(r,e.payload)})},error:(e,t)=>{e.finishReason==="ERROR"&&t(r=>{lh(r,e)})}}};var xs=(e,t,r,n)=>{let{dispatch:o,updateCachedData:i,getState:a}=r,{configuration:{accessToken:s}}=a();return As(e,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${s}`,Accept:"text/event-stream","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref28=_asyncToGenerator(function*(c){bs.handleOpen(c,i),n.handleOpen(c,o)});return function onopen(_x63){return _ref28.apply(this,arguments)}}(),onclose:()=>{n.handleClose?.(o)},onerror:c=>{n.handleError(c)},onmessage:c=>{let u=yR(c.data);if(!u)return;bs.handleMessage.error?.(u,i),n.handleMessage.error?.(u,o);let h=u.payloadType;bs.handleMessage[h]?.(u,i),n.handleMessage[h]?.(u,o)}})};function yR(e){if(!e?.length)return null;try{return JSON.parse(e)}catch(t){return console.warn("Failed to parse message",{payload:e,error:t}),null}}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var dh=e=>{let{configuration:t}=e,{organizationId:r,environment:n,knowledge:{agentId:o}}=t,i=Be(r,n),a=o?.trim();if(!i||!r||!a)throw new Error("Missing required parameters for follow up endpoint");let s=`/api/preview/organizations/${r}/agents`;return`${i}${s}/${a}/follow-up`};var vR=wo.injectEndpoints({overrideExisting:!0,endpoints:e=>({generateFollowUpAnswer:e.query({queryFn:()=>({data:ws()}),onQueryStarted(_x64,_x65){return _asyncToGenerator(function*(t,{getState:r,updateCachedData:n,dispatch:o}){let{strategyKey:i,...a}=t,s=dh(r());yield xs(s,a,{getState:r,updateCachedData:n,dispatch:o},Cs[i]?.())}).apply(this,arguments)}})})}),ph=e=>vR.endpoints.generateFollowUpAnswer.initiate(e);m();d();f();p();var Ao=["searching","thinking","answering"];m();d();f();p();var fh=(e,t)=>({conversationId:t.followUpAnswers?.conversationId??"",q:e});var SR=new H({required:!0}),Es=P("followUpAnswers/setIsEnabled",e=>j(e,new ue({required:!0}))),Rs=P("followUpAnswers/setFollowUpAnswersConversationId",e=>j(e,X)),wR=P("followUpAnswers/createFollowUpAnswer",e=>j(e,{question:X})),mh=P("followUpAnswers/setActiveFollowUpAnswerId",e=>j(e,X)),gh=P("followUpAnswers/setFollowUpAnswerContentFormat",e=>j(e,{contentFormat:Is,answerId:X})),hh=P("followUpAnswers/setFollowUpIsLoading",e=>j(e,{isLoading:new ue({required:!0}),answerId:X})),qB=P("followUpAnswers/setFollowUpIsStreaming",e=>j(e,{isStreaming:new ue({required:!0}),answerId:X})),yh=P("followUpAnswers/followUpMessageChunkReceived",e=>j(e,{textDelta:SR,answerId:X})),vh=P("followUpAnswers/followUpCitationsReceived",e=>j(e,{citations:new ge({required:!0,each:new ee({values:sd})}),answerId:X})),Sh=P("followUpAnswers/followUpCompleted",e=>j(e,{answerId:X,cannotAnswer:new ue({required:!1})})),wh=P("followUpAnswers/followUpFailed",e=>j(e,{message:new H,code:new te({min:0}),answerId:X})),LB=P("followUpAnswers/activeFollowUpStartFailed",e=>j(e,{message:new H})),UB=P("followUpAnswers/likeFollowUp",e=>j(e,{answerId:X})),VB=P("followUpAnswers/dislikeFollowUp",e=>j(e,{answerId:X})),GB=P("followUpAnswers/submitFollowUpFeedback",e=>j(e,{answerId:X})),Ah=P("followUpAnswers/resetFollowUpAnswers"),BB=P("followUpAnswers/stepStarted",e=>j(e,{answerId:X,name:new H({required:!0,constrainTo:Ao}),startedAt:new te({min:0,required:!0})})),$B=P("followUpAnswers/stepFinished",e=>j(e,{answerId:X,name:new H({required:!0,constrainTo:Ao}),finishedAt:new te({min:0,required:!0})})),QB=be("generatedAnswerWithFollowUps/generateFollowUpAnswer",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{logger:n}}){let o=t(),i=Sr(o)?.trim(),a=fh(e,o);if(!i){n.warn("Missing agentId in engine configuration. The generateFollowUpAnswer action requires an agent ID.");return}if(!a.conversationId){n.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}r(wR({question:e})),yield r(ph({strategyKey:"follow-up-answer",...a}))});return function(_x66,_x67){return _ref29.apply(this,arguments)}}());var bh=()=>{let e=null;return{handleOpen:(t,r)=>{e=t.headers.get("x-answer-id"),e&&(r(mh(e)),r(hh({answerId:e,isLoading:!0})),r(gh({contentFormat:"text/markdown",answerId:e})))},handleError:t=>{throw t},handleMessage:{"generativeengines.messageType":(t,r)=>{t?.payload?.textDelta&&r(yh({textDelta:t.payload.textDelta,answerId:e}))},"agentInteraction.citations":(t,r)=>{t?.payload?.citations!==void 0&&r(vh({citations:t.payload.citations,answerId:e}))},"generativeengines.endOfStreamType":(t,r)=>{let n=t?.payload?.answerGenerated??!1;r(Sh({cannotAnswer:!n,answerId:e}))},error:(t,r)=>{t.finishReason==="ERROR"&&r(wh({answerId:e,message:t.errorMessage,code:t.code}))}}}};m();d();f();p();m();d();f();p();var bo=e=>ct({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=en(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:en(t)??"",answerGenerated:e??!1})}),xo=()=>ct({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:en(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});var xh=()=>({handleOpen:(e,t)=>{let r=e.headers.get("x-answer-id");r&&t(Co(r))},handleError:e=>{throw e},handleMessage:{"agentInteraction.answerHeader":(e,t)=>{e?.payload?.conversationId&&t(Rs(e.payload.conversationId)),e.payload.followUpEnabled&&t(Es(e.payload.followUpEnabled)),t(an("text/markdown")),t(br(!0)),t(Ot(!1))},"generativeengines.messageType":(e,t)=>{e?.payload?.textDelta&&t(rn({textDelta:e.payload.textDelta}))},"agentInteraction.citations":(e,t)=>{e?.payload?.citations!==void 0&&t(nn({citations:e.payload.citations}))},"generativeengines.endOfStreamType":(e,t)=>{let r=e?.payload?.answerGenerated??!1;t(Mi(r)),t(sn(!r)),t(br(!1)),t(Ot(!1)),t(bo(r)),t(xo())},error:(e,t)=>{e.finishReason==="ERROR"&&t(on(e))}}});var Cs={"head-answer":xh,"follow-up-answer":bh};m();d();f();p();var Ch=e=>{let{configuration:t}=e,{organizationId:r,environment:n,knowledge:{agentId:o}}=t,i=Be(r,n),a=o?.trim();if(!i||!r||!a)throw new Error("Missing required parameters for answer endpoint");let s=`/api/preview/organizations/${r}/agents`;return`${i}${s}/${a}/answer`};var AR=wo.injectEndpoints({overrideExisting:!0,endpoints:e=>({generateAnswer:e.query({queryFn:()=>({data:ws()}),onQueryStarted(_x68,_x69){return _asyncToGenerator(function*(t,{getState:r,updateCachedData:n,dispatch:o}){let{strategyKey:i,...a}=t,s=Ch(r());yield xs(s,a,{getState:r,updateCachedData:n,dispatch:o},Cs[i]?.())}).apply(this,arguments)}})})}),Eh=e=>AR.endpoints.generateAnswer.initiate(e);m();d();f();p();m();d();f();p();var Rh=Ue(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});m();d();f();p();var ji=(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:ao(e)}});m();d();f();p();var Ih=e=>e.context;m();d();f();p();var cd=e=>e.pipeline;m();d();f();p();m();d();f();p();var qi=_t(Ts(),1),Nh=_t(Th(),1);m();d();f();p();var _s=_t(Ts(),1),kh=_t(_h(),1);_s.default.extend(kh.default);var Oh="YYYY/MM/DD@HH:mm:ss",bR="1401-01-01";function Eo(e,t){let r=(0,_s.default)(e,t);return!r.isValid()&&!t?(0,_s.default)(e,Oh):r}function ks(e){return e.format(Oh)}function Ph(e,t){let r=Eo(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}gd(r)}function gd(e){if(e.isBefore(bR))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}qi.default.extend(Nh.default);var Fh=["past","now","next"],Dh=["minute","hour","day","week","month","quarter","year"],xR=e=>{let t=e==="now";return{amount:new te({required:!t,min:1}),unit:new H({required:!t,constrainTo:Dh}),period:new H({required:!0,constrainTo:Fh})}};function hd(e){if(typeof e=="string"&&!xr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Uh(e):e;new lt(xR(t.period)).validate(t);let r=jh(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);gd(r)}function Mh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function jh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,qi.default)().subtract(r,n);case"next":return(0,qi.default)().add(r,n);case"now":return(0,qi.default)()}}function Li(e){return ks(jh(Uh(e)))}function qh(e){return e.toLocaleLowerCase().split("-")}function xr(e){let[t,r,n]=qh(e);if(t==="now")return!0;if(!Fh.includes(t)||!Dh.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Lh(e){return!!e&&typeof e=="object"&&"period"in e}function Uh(e){let[t,r,n]=qh(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}m();d();f();p();function Vh(e){return e.type==="dateRange"}function Gh(e){return`start${e}`}function Bh(e){return`end${e}`}var yd=()=>({dateFacetValueMap:{}});function CR(e,t,r){let n=e.start,o=e.end;return xr(n)&&(n=Li(n),r.dateFacetValueMap[t][Gh(n)]=e.start),xr(o)&&(o=Li(o),r.dateFacetValueMap[t][Bh(o)]=e.end),{...e,start:n,end:o}}function vd(e,t){if(Vh(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>CR(o,r,t))}}return e}function Cr(e){let t=yd();return{request:{...e,facets:e.facets?.map(n=>vd(n,t))},mappings:t}}function ER(e,t,r){return{...e,start:r.dateFacetValueMap[t][Gh(e.start)]||e.start,end:r.dateFacetValueMap[t][Bh(e.end)]||e.end}}function RR(e,t){return e.facetId in t.dateFacetValueMap}function IR(e,t){return RR(e,t)?{...e,values:e.values.map(r=>ER(r,e.facetId,t))}:e}function Os(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>IR(n,t))}}:e}m();d();f();p();m();d();f();p();m();d();f();p();function Er(e){return Object.values(e).map(t=>t.request)}function Sd(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function $h(e){return Er(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var wd={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function TR(e){return Er(e).map(t=>{let r=wd[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function _R(e){return[...TR(e.facetSet??{}),...$h(e.numericFacetSet??{}),...$h(e.dateFacetSet??{}),...Er(e.categoryFacetSet??{})]}function kR(e){return _R(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ps(e){return Sd(kR(e),e.facetOrder??[])}m();d();f();p();m();d();f();p();var Rr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pr(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:bt.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 ds(e.configuration.analytics,t))),...(e.excerptLength&&!ie(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Rr(_x70,_x71){return _ref30.apply(this,arguments)}}();m();d();f();p();var Ro=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pr(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&&ji(e.configuration.analytics,t,r)),...(e.excerptLength&&!ie(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();f();p();var Qh=Ue(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Ir=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t,r){let n=bd(e),o=OR(e),i=PR(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Rr(e,r):Ro(e,t,r);return Cr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Ad(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ir(_x72,_x73,_x74){return _ref31.apply(this,arguments)}}();function Ad(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function OR(e){return Sd(FR(e),e.facetOrder??[])}function PR(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(NR).filter(r=>r.currentValues.length>0):void 0}function NR(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function FR(e){return DR(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function DR(e){return[...MR(e.facetSet??{}),...Hh(e.numericFacetSet??{}),...Hh(e.dateFacetSet??{}),...Er(e.categoryFacetSet??{})]}function MR(e){return Er(e).map(t=>{let r=wd[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Hh(e){return Er(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function bd(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Qh(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();f();p();m();d();f();p();var Ui=(e,t)=>{let r=e;return ie(r[t])?ie(e.raw[t])?null:e.raw[t]:r[t]},jR=e=>t=>e.every(r=>!ie(Ui(t,r))),qR=e=>t=>e.every(r=>ie(Ui(t,r))),LR=(e,t)=>r=>{let n=zh(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},UR=(e,t)=>r=>{let n=zh(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},zh=(e,t)=>{let r=Ui(t,e);return nf(r)?r:[r]},Wh={getResultProperty:Ui,fieldsMustBeDefined:jR,fieldsMustNotBeDefined:qR,fieldMustMatch:LR,fieldMustNotMatch:UR};var xd=Ue(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();f();p();var Cd=e=>e.searchHub;m();d();f();p();var Ed=Ue(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),dH=Ue(e=>e,e=>{let t=Ed(e);return t&&e?e[t].expression:""});m();d();f();p();var Kh=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();f();p();var Yh=e=>e.excerptLength?.length;m();d();f();p();var Xh=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();f();p();var Jh=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();f();p();var Zh=e=>e.sortCriteria;var ey=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Be(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ey(_x75){return _ref32.apply(this,arguments)}}(),ty=(e,t)=>{let r=tn(e)?.q,{aq:n,cq:o,dq:i,lq:a}=GR(e),s=Ih(e),c=ji(e.configuration.analytics,t,{actionCause:xd(e)}),u=Cd(e),h=cd(e),v=jl(e)??[],S=ry(e),g=Ed(e.tabSet)||"default",y=Dl(e),x=ng(e),E=t.referrer||"",C=Xh(e),I=Zh(e),T=VR(e),_=Yh(e),q=Jh(e),N=Kh(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:Jg(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(u?.length&&{searchHub:u}),...(h?.length&&{pipeline:h}),...(S.length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Ad(e),firstResult:e.pagination.firstResult}),tab:g,locale:y,timezone:x,...(e.debug!==void 0&&{debug:e.debug}),referrer:E,...T,...(q??{}),...(_&&{excerptLength:_}),...(N&&{dictionaryFieldContext:N}),sortCriteria:I,...(C&&{facetOptions:C}),...c,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Ns=(e,t)=>{let r=tn(e)?.q,n=ry(e),o=ji(e.configuration.analytics,t,{actionCause:xd(e)}),i=Dl(e),a=Cd(e),s=cd(e),c=jl(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:c}},...(a?.length&&{searchHub:a}),...(s?.length&&{pipeline:s}),...o,locale:i}},ry=e=>Ps(e)?.map(t=>vd(t,yd())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),VR=e=>({actionsHistory:e.configuration.analytics.enabled?bt.getInstance().getHistory():[]}),GR=e=>{let t=Rh(e),r=bd(e);return{...t,...(r&&{cq:r})}};m();d();f();p();var ny=["text/plain","text/markdown"];var Io=new H({required:!0}),oy=new H,To=new ue({required:!0}),sd={id:Io,title:Io,uri:Io,permanentid:Io,clickUri:oy},Is=new H({required:!0,constrainTo:ny}),Tz=P("generatedAnswer/setIsVisible",e=>j(e,To)),Co=P("generatedAnswer/setAnswerId",e=>j(e,X)),_z=P("generatedAnswer/setAnswerGenerationMode",e=>j(e,new H({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),kz=P("generatedAnswer/setIsEnabled",e=>j(e,To)),rn=P("generatedAnswer/updateMessage",e=>j(e,{textDelta:Io})),nn=P("generatedAnswer/updateCitations",e=>j(e,{citations:new ge({required:!0,each:new ee({values:sd})})})),on=P("generatedAnswer/updateError",e=>j(e,{message:oy,code:new te({min:0})})),Vi=P("generatedAnswer/resetAnswer"),Oz=P("generatedAnswer/like"),Pz=P("generatedAnswer/dislike"),Nz=P("generatedAnswer/feedbackModal/open"),Fz=P("generatedAnswer/expand"),Dz=P("generatedAnswer/collapse"),Mz=P("generatedAnswer/setId",e=>j(e,{id:new H({required:!0})})),jz=P("generatedAnswer/feedbackModal/close"),qz=P("generatedAnswer/sendFeedback"),Ot=P("generatedAnswer/setIsLoading",e=>j(e,To)),br=P("generatedAnswer/setIsStreaming",e=>j(e,To)),an=P("generatedAnswer/setAnswerContentFormat",e=>j(e,Is)),Lz=P("generatedAnswer/updateResponseFormat",e=>j(e,{contentFormat:new ge({each:Is,default:["text/plain"]})})),Uz=P("knowledge/updateAnswerConfigurationId",e=>j(e,Io)),Vz=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>j(e,Da)),Mi=P("generatedAnswer/setIsAnswerGenerated",e=>j(e,To)),sn=P("generatedAnswer/setCannotAnswer",e=>j(e,To)),iy=P("generatedAnswer/setAnswerApiQueryParams",e=>j(e,new ee({}))),ay=P("generatedAnswer/startStep",e=>j(e,{name:new H({required:!0,constrainTo:Ao}),startedAt:new te({min:0,required:!0})})),sy=P("generatedAnswer/finishStep",e=>j(e,{name:new H({required:!0,constrainTo:Ao}),finishedAt:new te({min:0,required:!0})})),Gz=be("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:s}=a,{setAbortControllerRef:c}=e,u=yield ey(r),h=(g,y)=>{switch(g){case"genqa.headerMessageType":{let x=JSON.parse(y);n(an(x.contentFormat));break}case"genqa.messageType":n(rn(JSON.parse(y)));break;case"genqa.citationsType":n(nn(JSON.parse(y)));break;case"genqa.endOfStreamType":{let x=JSON.parse(y).answerGenerated,E=s.length!==0&&!x;n(sn(E)),n(br(!1)),n(Mi(x)),n(bo(x)),n(xo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Ot(!0));let v=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(u,{write:g=>{v(u)&&(n(Ot(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{v(u)&&n(on(g))},close:()=>{v(u)&&n(br(!1))},resetAnswer:()=>{v(u)&&n(Vi())}});S?c(S):n(Ot(!1))});return function(_x76,_x77){return _ref33.apply(this,arguments)}}()),Bz=be("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(Vi());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=ty(i,n);r(iy(a)),yield r(cy(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x78,_x79){return _ref34.apply(this,arguments)}}()),$z=be("generatedAnswerWithFollowUps/generateHeadAnswer",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){let i=t();if(!Sr(i)){o.warn("Missing agentId in engine configuration. The generateHeadAnswer action requires an agent ID.");return}r(Vi());let s=Ns(i,n),c={...s,strategyKey:"head-answer"};r(iy(s)),yield r(Eh(c))});return function(_x80,_x81){return _ref35.apply(this,arguments)}}());var BR=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},$R=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},QR=(e,t)=>{e.citations=t.citations},HR=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},zR=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},WR=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&zR(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(BR(t,o),r(an(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&($R(t,o),r(rn({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(QR(t,o),r(nn({citations:o.citations})));break;case"genqa.endOfStreamType":HR(t,o),r(bo(o.answerGenerated??!1)),r(xo());break}},KR=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Rd=Xg.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x82,_x83){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:s,insightConfiguration:c}=r(),{organizationId:u,environment:h,accessToken:v}=a,S=Be(u,h),g=KR(S,u,s.answerConfigurationId,c?.insightId);yield As(g,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref36=_asyncToGenerator(function*(y){let x=y.headers.get("x-answer-id");x&&o(E=>{E.answerId=x,i(Co(x))})});return function onopen(_x84){return _ref36.apply(this,arguments)}}(),onmessage:y=>{o(x=>{WR(y,x,i)})},onerror:y=>{throw y},onclose:()=>{o(y=>{i(sn(!y.generated))})}})}).apply(this,arguments)}})})}),cy=e=>Rd.endpoints.getAnswer.initiate(e);m();d();f();p();var uy=Me(Xn,e=>e);m();d();f();p();function YR(e){let t=e.payload?.analyticsAction;return ly(e)&&!ie(t)}function ly(e){return"type"in e}var dy=e=>t=>r=>{let n;YR(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return ly(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};m();d();f();p();m();d();f();p();m();d();f();p();var x4=P("tab/register",e=>{let t=new ee({values:{id:X,expression:Je}});return j(e,t)}),Fs=P("tab/updateActiveTab",e=>j(e,X));m();d();f();p();var Ds=_t(Ts(),1),my=_t(py(),1),gy=_t(fy(),1);Ds.default.extend(gy.default);Ds.default.extend(my.default);var hy=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Ds.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});m();d();f();p();var XR=/(^|; )Coveo-Pendragon=([^;]*)/;function Od(){return typeof window>"u"?!1:XR.exec(document.cookie)?.pop()||null}var yy=Me(hy(),e=>e.addCase(hr,(t,r)=>{JR(t,r.payload)}).addCase(Ut,(t,r)=>{ZR(t,r.payload)}).addCase(Jn,(t,r)=>{eI(t,r.payload)}).addCase(Zn,t=>{t.analytics.enabled=!1}).addCase(eo,t=>{t.analytics.enabled=!0}).addCase(Ma,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ja,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Fs,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Cm,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(yr,(t,r)=>{ie(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(bm,(t,{payload:r})=>{t.knowledge.agentId=r}));function JR(e,t){ie(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",ie(t.organizationId)||(e.organizationId=t.organizationId)}function ZR(e,t){ie(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),ie(t.locale)||(e.search.locale=t.locale),ie(t.timezone)||(e.search.timezone=t.timezone),ie(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function eI(e,t){ie(t.enabled)||(e.analytics.enabled=t.enabled),ie(t.originContext)||(e.analytics.originContext=t.originContext),ie(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),ie(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),ie(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),ie(t.trackingId)||(e.analytics.trackingId=t.trackingId),ie(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),ie(t.source)||(e.analytics.source=t.source);try{let r=Od();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}ie(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),ie(t.anonymous)||(e.analytics.anonymous=t.anonymous),ie(t.deviceId)||(e.analytics.deviceId=t.deviceId),ie(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),ie(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Pt=yy;m();d();f();p();function tI(e){return e.instantlyCallable}var vy=()=>e=>t=>e(tI(t)?t():t);m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var tt=[];for(let e=0;e<256;++e)tt.push((e+256).toString(16).slice(1));function Sy(e,t=0){return(tt[e[t+0]]+tt[e[t+1]]+tt[e[t+2]]+tt[e[t+3]]+"-"+tt[e[t+4]]+tt[e[t+5]]+"-"+tt[e[t+6]]+tt[e[t+7]]+"-"+tt[e[t+8]]+tt[e[t+9]]+"-"+tt[e[t+10]]+tt[e[t+11]]+tt[e[t+12]]+tt[e[t+13]]+tt[e[t+14]]+tt[e[t+15]]).toLowerCase()}m();d();f();p();var Pd,rI=new Uint8Array(16);function Nd(){if(!Pd){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Pd=crypto.getRandomValues.bind(crypto)}return Pd(rI)}m();d();f();p();m();d();f();p();var nI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fd={randomUUID:nI};function oI(e,t,r){if(Fd.randomUUID&&!t&&!e)return Fd.randomUUID();e=e||{};let n=e.random??e.rng?.()??Nd();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Sy(n)}var Tr=oI;m();d();f();p();m();d();f();p();var R={};ni(R,{BRAND:()=>kI,DIRTY:()=>un,EMPTY_PATH:()=>cI,INVALID:()=>se,NEVER:()=>mT,OK:()=>it,ParseStatus:()=>rt,Schema:()=>ye,ZodAny:()=>Or,ZodArray:()=>cr,ZodBigInt:()=>dn,ZodBoolean:()=>pn,ZodBranded:()=>Bi,ZodCatch:()=>xn,ZodDate:()=>fn,ZodDefault:()=>bn,ZodDiscriminatedUnion:()=>qs,ZodEffects:()=>It,ZodEnum:()=>wn,ZodError:()=>gt,ZodFirstPartyTypeKind:()=>ce,ZodFunction:()=>Us,ZodIntersection:()=>yn,ZodIssueCode:()=>W,ZodLazy:()=>vn,ZodLiteral:()=>Sn,ZodMap:()=>Fo,ZodNaN:()=>Mo,ZodNativeEnum:()=>An,ZodNever:()=>Nt,ZodNull:()=>gn,ZodNullable:()=>Qt,ZodNumber:()=>ln,ZodObject:()=>ht,ZodOptional:()=>Et,ZodParsedType:()=>Z,ZodPipeline:()=>$i,ZodPromise:()=>Pr,ZodReadonly:()=>Cn,ZodRecord:()=>Ls,ZodSchema:()=>ye,ZodSet:()=>Do,ZodString:()=>kr,ZodSymbol:()=>Po,ZodTransformer:()=>It,ZodTuple:()=>$t,ZodType:()=>ye,ZodUndefined:()=>mn,ZodUnion:()=>hn,ZodUnknown:()=>sr,ZodVoid:()=>No,addIssueToContext:()=>J,any:()=>LI,array:()=>BI,bigint:()=>FI,boolean:()=>ky,coerce:()=>fT,custom:()=>Iy,date:()=>DI,datetimeRegex:()=>Ey,defaultErrorMap:()=>ir,discriminatedUnion:()=>zI,effect:()=>iT,enum:()=>rT,function:()=>ZI,getErrorMap:()=>_o,getParsedType:()=>Bt,instanceof:()=>PI,intersection:()=>WI,isAborted:()=>Ms,isAsync:()=>ko,isDirty:()=>js,isValid:()=>_r,late:()=>OI,lazy:()=>eT,literal:()=>tT,makeIssue:()=>Gi,map:()=>XI,nan:()=>NI,nativeEnum:()=>nT,never:()=>VI,null:()=>qI,nullable:()=>sT,number:()=>_y,object:()=>$I,objectUtil:()=>Dd,oboolean:()=>pT,onumber:()=>dT,optional:()=>aT,ostring:()=>lT,pipeline:()=>uT,preprocess:()=>cT,promise:()=>oT,quotelessJson:()=>iI,record:()=>YI,set:()=>JI,setErrorMap:()=>sI,strictObject:()=>QI,string:()=>Ty,symbol:()=>MI,transformer:()=>iT,tuple:()=>KI,undefined:()=>jI,union:()=>HI,unknown:()=>UI,util:()=>Ae,void:()=>GI});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Ae;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ae||(Ae={}));var Dd;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Dd||(Dd={}));var Z=Ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bt=e=>{switch(typeof e){case"undefined":return Z.undefined;case"string":return Z.string;case"number":return Number.isNaN(e)?Z.nan:Z.number;case"boolean":return Z.boolean;case"function":return Z.function;case"bigint":return Z.bigint;case"symbol":return Z.symbol;case"object":return Array.isArray(e)?Z.array:e===null?Z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Z.promise:typeof Map<"u"&&e instanceof Map?Z.map:typeof Set<"u"&&e instanceof Set?Z.set:typeof Date<"u"&&e instanceof Date?Z.date:Z.object;default:return Z.unknown}};var W=Ae.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),iI=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),gt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};gt.create=e=>new gt(e);var aI=(e,t)=>{let r;switch(e.code){case W.invalid_type:e.received===Z.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ae.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ae.joinValues(e.keys,", ")}`;break;case W.invalid_union:r="Invalid input";break;case W.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ae.joinValues(e.options)}`;break;case W.invalid_enum_value:r=`Invalid enum value. Expected ${Ae.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:r="Invalid function arguments";break;case W.invalid_return_type:r="Invalid function return type";break;case W.invalid_date:r="Invalid date";break;case W.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ae.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case W.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case W.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case W.custom:r="Invalid input";break;case W.invalid_intersection_types:r="Intersection results could not be merged";break;case W.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ae.assertNever(e)}return{message:r}},ir=aI;var wy=ir;function sI(e){wy=e}function _o(){return wy}m();d();f();p();var Gi=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},cI=[];function J(e,t){let r=_o(),n=Gi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ir?void 0:ir].filter(o=>!!o)});e.common.issues.push(n)}var rt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return se;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return se;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},se=Object.freeze({status:"aborted"}),un=e=>({status:"dirty",value:e}),it=e=>({status:"valid",value:e}),Ms=e=>e.status==="aborted",js=e=>e.status==="dirty",_r=e=>e.status==="valid",ko=e=>typeof Promise<"u"&&e instanceof Promise;m();d();f();p();m();d();f();p();var re;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(re||(re={}));var Rt=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ay=(e,t)=>{if(_r(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new gt(e.common.issues);return this._error=r,this._error}}};function me(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:o}}var ye=class{get description(){return this._def.description}_getType(t){return Bt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Bt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new rt,ctx:{common:t.parent.common,data:t.data,parsedType:Bt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ko(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Ay(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return _r(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>_r(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Bt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield ko(o)?o:Promise.resolve(o);return Ay(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:W.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new It({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Et.create(this,this._def)}nullable(){return Qt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this)}promise(){return Pr.create(this,this._def)}or(t){return hn.create([this,t],this._def)}and(t){return yn.create(this,t,this._def)}transform(t){return new It({...me(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new bn({...me(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new Bi({typeName:ce.ZodBranded,type:this,...me(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new xn({...me(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return $i.create(this,t)}readonly(){return Cn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},uI=/^c[^\s-]{8,}$/i,lI=/^[0-9a-z]+$/,dI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fI=/^[a-z0-9_-]{21}$/i,mI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,gI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Md,vI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,SI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,AI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xy="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",CI=new RegExp(`^${xy}$`);function Cy(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function EI(e){return new RegExp(`^${Cy(e)}$`)}function Ey(e){let t=`${xy}T${Cy(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function RI(e,t){return!!((t==="v4"||!t)&&vI.test(e)||(t==="v6"||!t)&&wI.test(e))}function II(e,t){if(!mI.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function TI(e,t){return!!((t==="v4"||!t)&&SI.test(e)||(t==="v6"||!t)&&AI.test(e))}var kr=class e extends ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Z.string){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_type,expected:Z.string,received:i.parsedType}),se}let n=new rt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?J(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&J(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")hI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"email",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Md||(Md=new RegExp(yI,"u")),Md.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"emoji",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")pI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"uuid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")fI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"nanoid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")uI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cuid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")lI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cuid2",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")dI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"ulid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),J(o,{validation:"url",code:W.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"regex",code:W.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Ey(i).test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?CI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?EI(i).test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?gI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"duration",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?RI(t.data,i.version)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"ip",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?II(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"jwt",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?TI(t.data,i.version)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cidr",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?bI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"base64",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?xI.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"base64url",code:W.invalid_string,message:i.message}),n.dirty()):Ae.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:W.invalid_string,...re.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...re.errToObj(t)})}url(t){return this._addCheck({kind:"url",...re.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...re.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...re.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...re.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...re.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...re.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...re.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...re.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...re.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...re.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...re.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...re.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...re.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...re.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...re.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...re.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...re.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...re.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...re.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...re.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...re.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...re.errToObj(r)})}nonempty(t){return this.min(1,re.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};kr.create=e=>new kr({checks:[],typeName:ce.ZodString,coerce:e?.coerce??!1,...me(e)});function _I(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var ln=class e extends ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Z.number){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_type,expected:Z.number,received:i.parsedType}),se}let n,o=new rt;for(let i of this._def.checks)i.kind==="int"?Ae.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),J(n,{code:W.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?_I(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),J(n,{code:W.not_finite,message:i.message}),o.dirty()):Ae.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,re.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:re.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:re.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:re.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ae.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ln.create=e=>new ln({checks:[],typeName:ce.ZodNumber,coerce:e?.coerce||!1,...me(e)});var dn=class e extends ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Z.bigint)return this._getInvalidInput(t);let n,o=new rt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ae.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return J(r,{code:W.invalid_type,expected:Z.bigint,received:r.parsedType}),se}gte(t,r){return this.setLimit("min",t,!0,re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,re.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:re.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};dn.create=e=>new dn({checks:[],typeName:ce.ZodBigInt,coerce:e?.coerce??!1,...me(e)});var pn=class extends ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Z.boolean){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.boolean,received:n.parsedType}),se}return it(t.data)}};pn.create=e=>new pn({typeName:ce.ZodBoolean,coerce:e?.coerce||!1,...me(e)});var fn=class e extends ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Z.date){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_type,expected:Z.date,received:i.parsedType}),se}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_date}),se}let n=new rt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ae.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:re.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:re.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};fn.create=e=>new fn({checks:[],coerce:e?.coerce||!1,typeName:ce.ZodDate,...me(e)});var Po=class extends ye{_parse(t){if(this._getType(t)!==Z.symbol){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.symbol,received:n.parsedType}),se}return it(t.data)}};Po.create=e=>new Po({typeName:ce.ZodSymbol,...me(e)});var mn=class extends ye{_parse(t){if(this._getType(t)!==Z.undefined){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.undefined,received:n.parsedType}),se}return it(t.data)}};mn.create=e=>new mn({typeName:ce.ZodUndefined,...me(e)});var gn=class extends ye{_parse(t){if(this._getType(t)!==Z.null){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.null,received:n.parsedType}),se}return it(t.data)}};gn.create=e=>new gn({typeName:ce.ZodNull,...me(e)});var Or=class extends ye{constructor(){super(...arguments),this._any=!0}_parse(t){return it(t.data)}};Or.create=e=>new Or({typeName:ce.ZodAny,...me(e)});var sr=class extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return it(t.data)}};sr.create=e=>new sr({typeName:ce.ZodUnknown,...me(e)});var Nt=class extends ye{_parse(t){let r=this._getOrReturnCtx(t);return J(r,{code:W.invalid_type,expected:Z.never,received:r.parsedType}),se}};Nt.create=e=>new Nt({typeName:ce.ZodNever,...me(e)});var No=class extends ye{_parse(t){if(this._getType(t)!==Z.undefined){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.void,received:n.parsedType}),se}return it(t.data)}};No.create=e=>new No({typeName:ce.ZodVoid,...me(e)});var cr=class e extends ye{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==Z.array)return J(r,{code:W.invalid_type,expected:Z.array,received:r.parsedType}),se;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(J(r,{code:a?W.too_big:W.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(J(r,{code:W.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(J(r,{code:W.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>o.type._parseAsync(new Rt(r,a,r.path,s)))).then(a=>rt.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Rt(r,a,r.path,s)));return rt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:re.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:re.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:re.toString(r)}})}nonempty(t){return this.min(1,t)}};cr.create=(e,t)=>new cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...me(t)});function Oo(e){if(e instanceof ht){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Et.create(Oo(n))}return new ht({...e._def,shape:()=>t})}else return e instanceof cr?new cr({...e._def,type:Oo(e.element)}):e instanceof Et?Et.create(Oo(e.unwrap())):e instanceof Qt?Qt.create(Oo(e.unwrap())):e instanceof $t?$t.create(e.items.map(t=>Oo(t))):e}var ht=class e extends ye{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ae.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Z.object){let u=this._getOrReturnCtx(t);return J(u,{code:W.invalid_type,expected:Z.object,received:u.parsedType}),se}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Nt&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let h=i[u],v=o.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new Rt(o,v,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Nt){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of s)c.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(u==="strict")s.length>0&&(J(o,{code:W.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of s){let v=o.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new Rt(o,v,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let u=[];for(let h of c){let v=yield h.key,S=yield h.value;u.push({key:v,value:S,alwaysSet:h.alwaysSet})}return u})).then(u=>rt.mergeObjectSync(n,u)):rt.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return re.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:re.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ce.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Ae.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Ae.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Oo(this)}partial(t){let r={};for(let n of Ae.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Ae.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Et;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Ry(Ae.objectKeys(this.shape))}};ht.create=(e,t)=>new ht({shape:()=>e,unknownKeys:"strip",catchall:Nt.create(),typeName:ce.ZodObject,...me(t)});ht.strictCreate=(e,t)=>new ht({shape:()=>e,unknownKeys:"strict",catchall:Nt.create(),typeName:ce.ZodObject,...me(t)});ht.lazycreate=(e,t)=>new ht({shape:e,unknownKeys:"strip",catchall:Nt.create(),typeName:ce.ZodObject,...me(t)});var hn=class extends ye{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new gt(s.ctx.common.issues));return J(r,{code:W.invalid_union,unionErrors:a}),se}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x85){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},h=c._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new gt(c));return J(r,{code:W.invalid_union,unionErrors:s}),se}}get options(){return this._def.options}};hn.create=(e,t)=>new hn({options:e,typeName:ce.ZodUnion,...me(t)});var ar=e=>e instanceof vn?ar(e.schema):e instanceof It?ar(e.innerType()):e instanceof Sn?[e.value]:e instanceof wn?e.options:e instanceof An?Ae.objectValues(e.enum):e instanceof bn?ar(e._def.innerType):e instanceof mn?[void 0]:e instanceof gn?[null]:e instanceof Et?[void 0,...ar(e.unwrap())]:e instanceof Qt?[null,...ar(e.unwrap())]:e instanceof Bi||e instanceof Cn?ar(e.unwrap()):e instanceof xn?ar(e._def.innerType):[],qs=class e extends ye{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Z.object)return J(r,{code:W.invalid_type,expected:Z.object,received:r.parsedType}),se;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(J(r,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=ar(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...me(n)})}};function jd(e,t){let r=Bt(e),n=Bt(t);if(e===t)return{valid:!0,data:e};if(r===Z.object&&n===Z.object){let o=Ae.objectKeys(t),i=Ae.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let c=jd(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===Z.array&&n===Z.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],c=jd(a,s);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===Z.date&&n===Z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var yn=class extends ye{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(Ms(i)||Ms(a))return se;let s=jd(i.value,a.value);return s.valid?((js(i)||js(a))&&r.dirty(),{status:r.value,value:s.data}):(J(n,{code:W.invalid_intersection_types}),se)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};yn.create=(e,t,r)=>new yn({left:e,right:t,typeName:ce.ZodIntersection,...me(r)});var $t=class e extends ye{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Z.array)return J(n,{code:W.invalid_type,expected:Z.array,received:n.parsedType}),se;if(n.data.length<this._def.items.length)return J(n,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),se;!this._def.rest&&n.data.length>this._def.items.length&&(J(n,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Rt(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>rt.mergeArray(r,a)):rt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};$t.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $t({items:e,typeName:ce.ZodTuple,rest:null,...me(t)})};var Ls=class e extends ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Z.object)return J(n,{code:W.invalid_type,expected:Z.object,received:n.parsedType}),se;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Rt(n,s,n.path,s)),value:a._parse(new Rt(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?rt.mergeObjectAsync(r,o):rt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ye?new e({keyType:t,valueType:r,typeName:ce.ZodRecord,...me(n)}):new e({keyType:kr.create(),valueType:t,typeName:ce.ZodRecord,...me(r)})}},Fo=class extends ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Z.map)return J(n,{code:W.invalid_type,expected:Z.map,received:n.parsedType}),se;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:o._parse(new Rt(n,s,n.path,[u,"key"])),value:i._parse(new Rt(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let c of a){let u=yield c.key,h=yield c.value;if(u.status==="aborted"||h.status==="aborted")return se;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let c of a){let u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return se;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}}};Fo.create=(e,t,r)=>new Fo({valueType:t,keyType:e,typeName:ce.ZodMap,...me(r)});var Do=class e extends ye{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Z.set)return J(n,{code:W.invalid_type,expected:Z.set,received:n.parsedType}),se;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(J(n,{code:W.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(J(n,{code:W.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let h of c){if(h.status==="aborted")return se;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>i._parse(new Rt(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:re.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:re.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Do.create=(e,t)=>new Do({valueType:e,minSize:null,maxSize:null,typeName:ce.ZodSet,...me(t)});var Us=class e extends ye{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Z.function)return J(r,{code:W.invalid_type,expected:Z.function,received:r.parsedType}),se;function n(s,c){return Gi({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_o(),ir].filter(u=>!!u),issueData:{code:W.invalid_arguments,argumentsError:c}})}function o(s,c){return Gi({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_o(),ir].filter(u=>!!u),issueData:{code:W.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Pr){let s=this;return it(/*#__PURE__*/_asyncToGenerator(function*(...c){let u=new gt([]),h=yield s._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),v=yield Reflect.apply(a,this,h);return yield s._def.returns._def.type.parseAsync(v,i).catch(g=>{throw u.addIssue(o(v,g)),u})}))}else{let s=this;return it(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new gt([n(c,u.error)]);let h=Reflect.apply(a,this,u.data),v=s._def.returns.safeParse(h,i);if(!v.success)throw new gt([o(h,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:$t.create(t).rest(sr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||$t.create([]).rest(sr.create()),returns:r||sr.create(),typeName:ce.ZodFunction,...me(n)})}},vn=class extends ye{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};vn.create=(e,t)=>new vn({getter:e,typeName:ce.ZodLazy,...me(t)});var Sn=class extends ye{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return J(r,{received:r.data,code:W.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:t.data}}get value(){return this._def.value}};Sn.create=(e,t)=>new Sn({value:e,typeName:ce.ZodLiteral,...me(t)});function Ry(e,t){return new wn({values:e,typeName:ce.ZodEnum,...me(t)})}var wn=class e extends ye{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return J(r,{expected:Ae.joinValues(n),received:r.parsedType,code:W.invalid_type}),se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return J(r,{received:r.data,code:W.invalid_enum_value,options:n}),se}return it(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};wn.create=Ry;var An=class extends ye{_parse(t){let r=Ae.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Z.string&&n.parsedType!==Z.number){let o=Ae.objectValues(r);return J(n,{expected:Ae.joinValues(o),received:n.parsedType,code:W.invalid_type}),se}if(this._cache||(this._cache=new Set(Ae.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ae.objectValues(r);return J(n,{received:n.data,code:W.invalid_enum_value,options:o}),se}return it(t.data)}get enum(){return this._def.values}};An.create=(e,t)=>new An({values:e,typeName:ce.ZodNativeEnum,...me(t)});var Pr=class extends ye{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Z.promise&&r.common.async===!1)return J(r,{code:W.invalid_type,expected:Z.promise,received:r.parsedType}),se;let n=r.parsedType===Z.promise?r.data:Promise.resolve(r.data);return it(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Pr.create=(e,t)=>new Pr({type:e,typeName:ce.ZodPromise,...me(t)});var It=class extends ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{J(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return se;let c=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?se:c.status==="dirty"?un(c.value):r.value==="dirty"?un(c.value):c});return function(_x86){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return se;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?se:s.status==="dirty"?un(s.value):r.value==="dirty"?un(s.value):s}}if(o.type==="refinement"){let a=s=>{let c=o.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?se:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?se:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_r(a))return se;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>_r(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):se);Ae.assertNever(o)}};It.create=(e,t,r)=>new It({schema:e,typeName:ce.ZodEffects,effect:t,...me(r)});It.createWithPreprocess=(e,t,r)=>new It({schema:t,effect:{type:"preprocess",transform:e},typeName:ce.ZodEffects,...me(r)});var Et=class extends ye{_parse(t){return this._getType(t)===Z.undefined?it(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Et.create=(e,t)=>new Et({innerType:e,typeName:ce.ZodOptional,...me(t)});var Qt=class extends ye{_parse(t){return this._getType(t)===Z.null?it(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Qt.create=(e,t)=>new Qt({innerType:e,typeName:ce.ZodNullable,...me(t)});var bn=class extends ye{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};bn.create=(e,t)=>new bn({innerType:e,typeName:ce.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...me(t)});var xn=class extends ye{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ko(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new gt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new gt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xn.create=(e,t)=>new xn({innerType:e,typeName:ce.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...me(t)});var Mo=class extends ye{_parse(t){if(this._getType(t)!==Z.nan){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.nan,received:n.parsedType}),se}return{status:"valid",value:t.data}}};Mo.create=e=>new Mo({typeName:ce.ZodNaN,...me(e)});var kI=Symbol("zod_brand"),Bi=class extends ye{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},$i=class e extends ye{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?se:i.status==="dirty"?(r.dirty(),un(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?se:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:ce.ZodPipeline})}},Cn=class extends ye{_parse(t){let r=this._def.innerType._parse(t),n=o=>(_r(o)&&(o.value=Object.freeze(o.value)),o);return ko(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Cn.create=(e,t)=>new Cn({innerType:e,typeName:ce.ZodReadonly,...me(t)});function by(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Iy(e,t={},r){return e?Or.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=by(t,n),c=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:c})}});if(!i){let a=by(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):Or.create()}var OI={object:ht.lazycreate},ce;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ce||(ce={}));var PI=(e,t={message:`Input not instance of ${e.name}`})=>Iy(r=>r instanceof e,t),Ty=kr.create,_y=ln.create,NI=Mo.create,FI=dn.create,ky=pn.create,DI=fn.create,MI=Po.create,jI=mn.create,qI=gn.create,LI=Or.create,UI=sr.create,VI=Nt.create,GI=No.create,BI=cr.create,$I=ht.create,QI=ht.strictCreate,HI=hn.create,zI=qs.create,WI=yn.create,KI=$t.create,YI=Ls.create,XI=Fo.create,JI=Do.create,ZI=Us.create,eT=vn.create,tT=Sn.create,rT=wn.create,nT=An.create,oT=Pr.create,iT=It.create,aT=Et.create,sT=Qt.create,cT=It.createWithPreprocess,uT=$i.create,lT=()=>Ty().optional(),dT=()=>_y().optional(),pT=()=>ky().optional(),fT={string:e=>kr.create({...e,coerce:!0}),number:e=>ln.create({...e,coerce:!0}),boolean:e=>pn.create({...e,coerce:!0}),bigint:e=>dn.create({...e,coerce:!0}),date:e=>fn.create({...e,coerce:!0})};var mT=se;var gT=R.object({name:R.string(),arguments:R.string()}),hT=R.object({id:R.string(),type:R.literal("function"),function:gT,encryptedValue:R.string().optional()}),Vs=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),yT=R.object({type:R.literal("text"),text:R.string()}),Oy=R.object({type:R.literal("binary"),mimeType:R.string(),id:R.string().optional(),url:R.string().optional(),data:R.string().optional(),filename:R.string().optional()}),Py=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:R.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},eK=Oy.superRefine((e,t)=>{Py(e,t)}),vT=R.discriminatedUnion("type",[yT,Oy]),ST=vT.superRefine((e,t)=>{e.type==="binary"&&Py(e,t)}),wT=Vs.extend({role:R.literal("developer"),content:R.string()}),AT=Vs.extend({role:R.literal("system"),content:R.string()}),bT=Vs.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array(hT).optional()}),xT=Vs.extend({role:R.literal("user"),content:R.union([R.string(),R.array(ST)])}),CT=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),ET=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),RT=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),Ny=R.discriminatedUnion("role",[wT,AT,bT,xT,CT,ET,RT]),tK=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),IT=R.object({description:R.string(),value:R.string()}),TT=R.object({name:R.string(),description:R.string(),parameters:R.any()}),_T=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(Ny),tools:R.array(TT),context:R.array(IT),forwardedProps:R.any()}),kT=R.any(),je=class extends Error{constructor(e){super(e)}},qd=class extends je{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},Fy=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),F=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Re=R.object({type:R.nativeEnum(F),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),OT=Re.extend({type:R.literal(F.TEXT_MESSAGE_START),messageId:R.string(),role:Fy.default("assistant")}),Dy=Re.extend({type:R.literal(F.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string().refine(e=>e.length>0,"Delta must not be an empty string")}),PT=Re.extend({type:R.literal(F.TEXT_MESSAGE_END),messageId:R.string()}),NT=Re.extend({type:R.literal(F.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:Fy.optional(),delta:R.string().optional()}),FT=Re.extend({type:R.literal(F.THINKING_TEXT_MESSAGE_START)}),DT=Dy.omit({messageId:!0,type:!0}).extend({type:R.literal(F.THINKING_TEXT_MESSAGE_CONTENT)}),MT=Re.extend({type:R.literal(F.THINKING_TEXT_MESSAGE_END)}),jT=Re.extend({type:R.literal(F.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),qT=Re.extend({type:R.literal(F.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),LT=Re.extend({type:R.literal(F.TOOL_CALL_END),toolCallId:R.string()}),UT=Re.extend({messageId:R.string(),type:R.literal(F.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),VT=Re.extend({type:R.literal(F.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),GT=Re.extend({type:R.literal(F.THINKING_START),title:R.string().optional()}),BT=Re.extend({type:R.literal(F.THINKING_END)}),$T=Re.extend({type:R.literal(F.STATE_SNAPSHOT),snapshot:kT}),QT=Re.extend({type:R.literal(F.STATE_DELTA),delta:R.array(R.any())}),HT=Re.extend({type:R.literal(F.MESSAGES_SNAPSHOT),messages:R.array(Ny)}),zT=Re.extend({type:R.literal(F.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),WT=Re.extend({type:R.literal(F.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),KT=Re.extend({type:R.literal(F.RAW),event:R.any(),source:R.string().optional()}),YT=Re.extend({type:R.literal(F.CUSTOM),name:R.string(),value:R.any()}),XT=Re.extend({type:R.literal(F.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:_T.optional()}),JT=Re.extend({type:R.literal(F.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional()}),ZT=Re.extend({type:R.literal(F.RUN_ERROR),message:R.string(),code:R.string().optional()}),e_=Re.extend({type:R.literal(F.STEP_STARTED),stepName:R.string()}),t_=Re.extend({type:R.literal(F.STEP_FINISHED),stepName:R.string()}),r_=R.union([R.literal("tool-call"),R.literal("message")]),n_=Re.extend({type:R.literal(F.REASONING_START),messageId:R.string()}),o_=Re.extend({type:R.literal(F.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),i_=Re.extend({type:R.literal(F.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string().refine(e=>e.length>0,"Delta must not be an empty string")}),a_=Re.extend({type:R.literal(F.REASONING_MESSAGE_END),messageId:R.string()}),s_=Re.extend({type:R.literal(F.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),c_=Re.extend({type:R.literal(F.REASONING_END),messageId:R.string()}),u_=Re.extend({type:R.literal(F.REASONING_ENCRYPTED_VALUE),subtype:r_,entityId:R.string(),encryptedValue:R.string()}),Gs=R.discriminatedUnion("type",[OT,Dy,PT,NT,GT,BT,FT,DT,MT,jT,qT,LT,VT,UT,$T,QT,HT,zT,WT,KT,YT,XT,JT,ZT,e_,t_,n_,o_,i_,a_,s_,c_,u_]);m();d();f();p();var Ld={};ni(Ld,{JsonPatchError:()=>Ve,_areEquals:()=>zi,applyOperation:()=>En,applyPatch:()=>Nr,applyReducer:()=>m_,deepClone:()=>p_,getValueByPointer:()=>zs,validate:()=>jy,validator:()=>Ws});m();d();f();p();m();d();f();p();var l_=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),d_=Object.prototype.hasOwnProperty;function $s(e,t){return d_.call(e,t)}function Qs(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)$s(e,o)&&n.push(o);return n}function nt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Hs(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Ht(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Qi(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Bs(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Bs(e[t]))return!0}else if(typeof e=="object"){for(var n=Qs(e),o=n.length,i=0;i<o;i++)if(Bs(e[n[i]]))return!0}}return!1}function My(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
32
+ `)}var Hi=function(e){l_(t,e);function t(r,n,o,i,a){var s=this.constructor,c=e.call(this,My(r,{name:n,index:o,operation:i,tree:a}))||this;return c.name=n,c.index=o,c.operation=i,c.tree=a,Object.setPrototypeOf(c,s.prototype),c.message=My(r,{name:n,index:o,operation:i,tree:a}),c}return t}(Error);var Ve=Hi,p_=nt,jo={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=zs(r,this.path);n&&(n=nt(n));var o=En(r,{op:"remove",path:this.from}).removed;return En(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=zs(r,this.from);return En(r,{op:"add",path:this.path,value:nt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:zi(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},f_={add:function(e,t,r){return Hs(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:jo.move,copy:jo.copy,test:jo.test,_get:jo._get};function zs(e,t){if(t=="")return e;var r={op:"_get",path:t};return En(e,r),r.value}function En(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):Ws(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=zs(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=zi(e,t.value),a.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new Ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=nt(e));var s=t.path||"",c=s.split("/"),u=e,h=1,v=c.length,S=void 0,g=void 0,y=void 0;for(typeof r=="function"?y=r:y=Ws;;){if(g=c[h],g&&g.indexOf("~")!=-1&&(g=Qi(g)),o&&(g=="__proto__"||g=="prototype"&&h>0&&c[h-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&S===void 0&&(u[g]===void 0?S=c.slice(0,h).join("/"):h==v-1&&(S=t.path),S!==void 0&&y(t,0,e,S)),h++,Array.isArray(u)){if(g==="-")g=u.length;else{if(r&&!Hs(g))throw new Ve("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);Hs(g)&&(g=~~g)}if(h>=v){if(r&&t.op==="add"&&g>u.length)throw new Ve("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=f_[t.op].call(t,u,g,e);if(a.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(h>=v){var a=jo[t.op].call(t,u,g,e);if(a.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(u=u[g],r&&h<v&&(!u||typeof u!="object"))throw new Ve("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function Nr(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new Ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=nt(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=En(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function m_(e,t,r){var n=En(e,t);if(n.test===!1)throw new Ve("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Ws(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ve("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(jo[e.op]){if(typeof e.path!="string")throw new Ve("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ve("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Ve("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Bs(e.value))throw new Ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new Ve("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new Ve("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},s=jy([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ve("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function jy(e,t,r){try{if(!Array.isArray(e))throw new Ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Nr(nt(t),nt(e),r||!0);else{r=r||Ws;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof Ve)return o;throw o}}function zi(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!zi(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(s[o]))return!1;for(o=i;o--!==0;)if(a=s[o],!zi(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Bd={};ni(Bd,{compare:()=>b_,generate:()=>Ud,observe:()=>A_,unobserve:()=>w_});m();d();f();p();var Vd=new WeakMap,g_=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),h_=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function y_(e){return Vd.get(e)}function v_(e,t){return e.observers.get(t)}function S_(e,t){e.observers.delete(t.callback)}function w_(e,t){t.unobserve()}function A_(e,t){var r=[],n,o=y_(e);if(!o)o=new g_(e),Vd.set(e,o);else{var i=v_(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=nt(e),t){n.callback=t,n.next=null;var a=function(){Ud(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){Ud(n),clearTimeout(n.next),S_(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},o.observers.set(t,new h_(t,n)),n}function Ud(e,t){t===void 0&&(t=!1);var r=Vd.get(e.object);Gd(r.value,e.object,e.patches,"",t),e.patches.length&&Nr(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Gd(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=Qs(t),a=Qs(e),s=!1,c=!1,u=a.length-1;u>=0;u--){var h=a[u],v=e[h];if($s(t,h)&&!(t[h]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var S=t[h];typeof v=="object"&&v!=null&&typeof S=="object"&&S!=null&&Array.isArray(v)===Array.isArray(S)?Gd(v,S,r,n+"/"+Ht(h),o):v!==S&&(s=!0,o&&r.push({op:"test",path:n+"/"+Ht(h),value:nt(v)}),r.push({op:"replace",path:n+"/"+Ht(h),value:nt(S)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+Ht(h),value:nt(v)}),r.push({op:"remove",path:n+"/"+Ht(h)}),c=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!c&&i.length==a.length))for(var u=0;u<i.length;u++){var h=i[u];!$s(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+Ht(h),value:nt(t[h])})}}}function b_(e,t,r){r===void 0&&(r=!1);var n=[];return Gd(e,t,n,"",r),n}var RK=Object.assign({},Ld,Bd,{JsonPatchError:Hi,deepClone:nt,escapePathComponent:Ht,unescapePathComponent:Qi});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var $d=function(e,t){return $d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},$d(e,t)};function zt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$d(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function qy(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function Ks(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ur(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function qo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Lo(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Rn(e){return this instanceof Rn?(this.v=e,this):new Rn(e)}function Ly(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(g){return function(y){return Promise.resolve(y).then(g,v)}}function s(g,y){n[g]&&(o[g]=function(x){return new Promise(function(E,C){i.push([g,x,E,C])>1||c(g,x)})},y&&(o[g]=y(o[g])))}function c(g,y){try{u(n[g](y))}catch(x){S(i[0][3],x)}}function u(g){g.value instanceof Rn?Promise.resolve(g.value.v).then(h,v):S(i[0][2],g)}function h(g){c("next",g)}function v(g){c("throw",g)}function S(g,y){g(y),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Uy(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof ur=="function"?ur(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),o(s,c,a.done,a.value)})}}function o(i,a,s,c){Promise.resolve(c).then(function(u){i({value:u,done:s})},a)}}m();d();f();p();function Se(e){return typeof e=="function"}m();d();f();p();m();d();f();p();m();d();f();p();function Uo(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Ys=Uo(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
33
+ `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
34
+ `):"",this.name="UnsubscriptionError",this.errors=r}});m();d();f();p();function Wi(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Vo=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=ur(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(x){t={error:x}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var h=this.initialTeardown;if(Se(h))try{h()}catch(x){i=x instanceof Ys?x.errors:[x]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var S=ur(v),g=S.next();!g.done;g=S.next()){var y=g.value;try{Vy(y)}catch(x){i=i??[],x instanceof Ys?i=Lo(Lo([],qo(i)),qo(x.errors)):i.push(x)}}}catch(x){n={error:x}}finally{try{g&&!g.done&&(o=S.return)&&o.call(S)}finally{if(n)throw n.error}}}if(i)throw new Ys(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Vy(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Wi(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Wi(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Qd=Vo.EMPTY;function Xs(e){return e instanceof Vo||e&&"closed"in e&&Se(e.remove)&&Se(e.add)&&Se(e.unsubscribe)}function Vy(e){Se(e)?e():e.unsubscribe()}m();d();f();p();var Ft={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};m();d();f();p();m();d();f();p();var Go={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Go.delegate;return o?.setTimeout?o.setTimeout.apply(o,Lo([e,t],qo(r))):setTimeout.apply(void 0,Lo([e,t],qo(r)))},clearTimeout:function(e){var t=Go.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Js(e){Go.setTimeout(function(){var t=Ft.onUnhandledError;if(t)t(e);else throw e})}m();d();f();p();function Ki(){}m();d();f();p();var Gy=function(){return Hd("C",void 0,void 0)}();function By(e){return Hd("E",void 0,e)}function $y(e){return Hd("N",e,void 0)}function Hd(e,t,r){return{kind:e,value:t,error:r}}m();d();f();p();var In=null;function Bo(e){if(Ft.useDeprecatedSynchronousErrorHandling){var t=!In;if(t&&(In={errorThrown:!1,error:null}),e(),t){var r=In,n=r.errorThrown,o=r.error;if(In=null,n)throw o}}else e()}function Qy(e){Ft.useDeprecatedSynchronousErrorHandling&&In&&(In.errorThrown=!0,In.error=e)}var Yi=function(e){zt(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Xs(r)&&r.add(n)):n.destination=I_,n}return t.create=function(r,n,o){return new ec(r,n,o)},t.prototype.next=function(r){this.isStopped?Wd($y(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Wd(By(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Wd(Gy,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Vo);var C_=Function.prototype.bind;function zd(e,t){return C_.call(e,t)}var E_=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Zs(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Zs(n)}else Zs(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Zs(r)}},e}(),ec=function(e){zt(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(Se(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Ft.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&zd(r.next,s),error:r.error&&zd(r.error,s),complete:r.complete&&zd(r.complete,s)}):a=r}return i.destination=new E_(a),i}return t}(Yi);function Zs(e){Ft.useDeprecatedSynchronousErrorHandling?Qy(e):Js(e)}function R_(e){throw e}function Wd(e,t){var r=Ft.onStoppedNotification;r&&Go.setTimeout(function(){return r(e,t)})}var I_={closed:!0,next:Ki,error:R_,complete:Ki};m();d();f();p();var $o=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();m();d();f();p();m();d();f();p();function Qo(e){return e}function tc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd(e)}function Kd(e){return e.length===0?Qo:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ne=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=__(t)?t:new ec(t,r,n);return Bo(function(){var a=o,s=a.operator,c=a.source;i.add(s?s.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Hy(r),new r(function(o,i){var a=new ec({next:function(s){try{t(s)}catch(c){i(c),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[$o]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Kd(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Hy(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function Hy(e){var t;return(t=e??Ft.Promise)!==null&&t!==void 0?t:Promise}function T_(e){return e&&Se(e.next)&&Se(e.error)&&Se(e.complete)}function __(e){return e&&e instanceof Yi||T_(e)&&Xs(e)}m();d();f();p();function k_(e){return Se(e?.lift)}function $e(e){return function(t){if(k_(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}m();d();f();p();function Qe(e,t,r,n,o){return new O_(e,t,r,n,o)}var O_=function(e){zt(t,e);function t(r,n,o,i,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(u){try{n(u)}catch(h){r.error(h)}}:e.prototype._next,c._error=i?function(u){try{i(u)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=o?function(){try{o()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Yi);m();d();f();p();m();d();f();p();var zy=Uo(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var Wt=function(e){zt(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new Wy(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new zy},t.prototype.next=function(r){var n=this;Bo(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=ur(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(u){o={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Bo(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;Bo(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Qd:(this.currentObservers=null,s.push(r),new Vo(function(){n.currentObservers=null,Wi(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new Ne;return r.source=this,r},t.create=function(r,n){return new Wy(r,n)},t}(Ne);var Wy=function(e){zt(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Qd},t}(Wt);m();d();f();p();m();d();f();p();var Yd={now:function(){return(Yd.delegate||Date).now()},delegate:void 0};var rc=function(e){zt(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Yd);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=i?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var c=o.now(),u=0,h=1;h<i.length&&i[h]<=c;h+=2)u=h;u&&i.splice(0,u+1)}},t}(Wt);m();d();f();p();var nc=new Ne(function(e){return e.complete()});m();d();f();p();m();d();f();p();m();d();f();p();function Ky(e){return e&&Se(e.schedule)}function P_(e){return e[e.length-1]}function Yy(e){return Ky(P_(e))?e.pop():void 0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var oc=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};m();d();f();p();function ic(e){return Se(e?.then)}m();d();f();p();function ac(e){return Se(e[$o])}m();d();f();p();function sc(e){return Symbol.asyncIterator&&Se(e?.[Symbol.asyncIterator])}m();d();f();p();function cc(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}m();d();f();p();m();d();f();p();function N_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var uc=N_();function lc(e){return Se(e?.[uc])}m();d();f();p();function dc(e){return Ly(this,arguments,function(){var r,n,o,i;return Ks(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Rn(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Rn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Rn(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function pc(e){return Se(e?.getReader)}function He(e){if(e instanceof Ne)return e;if(e!=null){if(ac(e))return F_(e);if(oc(e))return D_(e);if(ic(e))return M_(e);if(sc(e))return Xy(e);if(lc(e))return j_(e);if(pc(e))return q_(e)}throw cc(e)}function F_(e){return new Ne(function(t){var r=e[$o]();if(Se(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function D_(e){return new Ne(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function M_(e){return new Ne(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Js)})}function j_(e){return new Ne(function(t){var r,n;try{for(var o=ur(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Xy(e){return new Ne(function(t){L_(e,t).catch(function(r){return t.error(r)})})}function q_(e){return Xy(dc(e))}function L_(e,t){var r,n,o,i;return qy(this,void 0,void 0,function(){var a,s;return Ks(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Uy(e),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),o={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}m();d();f();p();m();d();f();p();function Tt(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function fc(e,t){return t===void 0&&(t=0),$e(function(r,n){r.subscribe(Qe(n,function(o){return Tt(n,e,function(){return n.next(o)},t)},function(){return Tt(n,e,function(){return n.complete()},t)},function(o){return Tt(n,e,function(){return n.error(o)},t)}))})}m();d();f();p();function mc(e,t){return t===void 0&&(t=0),$e(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Jy(e,t){return He(e).pipe(mc(t),fc(t))}m();d();f();p();function Zy(e,t){return He(e).pipe(mc(t),fc(t))}m();d();f();p();function ev(e,t){return new Ne(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}m();d();f();p();function tv(e,t){return new Ne(function(r){var n;return Tt(r,t,function(){n=e[uc](),Tt(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return Se(n?.return)&&n.return()}})}m();d();f();p();function gc(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ne(function(r){Tt(r,t,function(){var n=e[Symbol.asyncIterator]();Tt(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}m();d();f();p();function rv(e,t){return gc(dc(e),t)}function nv(e,t){if(e!=null){if(ac(e))return Jy(e,t);if(oc(e))return ev(e,t);if(ic(e))return Zy(e,t);if(sc(e))return gc(e,t);if(lc(e))return tv(e,t);if(pc(e))return rv(e,t)}throw cc(e)}function Tn(e,t){return t?nv(e,t):He(e)}function qe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Yy(e);return Tn(e,r)}m();d();f();p();function Fe(e,t){var r=Se(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ne(t?function(o){return t.schedule(n,0,o)}:n)}m();d();f();p();m();d();f();p();var ov=Uo(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function hc(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new ov)}})})}m();d();f();p();function _n(e,t){return $e(function(r,n){var o=0;r.subscribe(Qe(n,function(i){n.next(e.call(t,i,o++))}))})}m();d();f();p();m();d();f();p();m();d();f();p();function iv(e,t,r,n,o,i,a,s){var c=[],u=0,h=0,v=!1,S=function(){v&&!c.length&&!u&&t.complete()},g=function(x){return u<n?y(x):c.push(x)},y=function(x){i&&t.next(x),u++;var E=!1;He(r(x,h++)).subscribe(Qe(t,function(C){o?.(C),i?g(C):t.next(C)},function(){E=!0},void 0,function(){if(E)try{u--;for(var C=function(){var I=c.shift();a?Tt(t,a,function(){return y(I)}):y(I)};c.length&&u<n;)C();S()}catch(I){t.error(I)}}))};return e.subscribe(Qe(t,g,function(){v=!0,S()})),function(){s?.()}}function yt(e,t,r){return r===void 0&&(r=1/0),Se(t)?yt(function(n,o){return _n(function(i,a){return t(n,i,o,a)})(He(e(n,o)))},r):(typeof t=="number"&&(r=t),$e(function(n,o){return iv(n,o,e,r)}))}function Xd(e){return e===void 0&&(e=1/0),yt(Qo,e)}m();d();f();p();function Jd(e){return new Ne(function(t){He(e()).subscribe(t)})}m();d();f();p();function Xi(e){return $e(function(t,r){var n=null,o=!1,i;n=t.subscribe(Qe(r,void 0,void 0,function(a){i=He(e(a,Xi(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}m();d();f();p();function yc(e,t){return Se(t)?yt(e,t,1):yt(e,1)}m();d();f();p();function Zd(e){return $e(function(t,r){var n=!1;t.subscribe(Qe(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}m();d();f();p();function kn(e){return $e(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}m();d();f();p();function ep(e,t){return $e(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(Qe(n,function(c){o?.unsubscribe();var u=0,h=i++;He(e(c,h)).subscribe(o=Qe(n,function(v){return n.next(t?t(c,v,h,u++):v)},function(){o=null,s()}))},function(){a=!0,s()}))})}m();d();f();p();function vc(e){return $e(function(t,r){He(e).subscribe(Qe(r,function(){return r.complete()},Ki)),!r.closed&&t.subscribe(r)})}m();d();f();p();function tp(e,t,r){var n=Se(e)||t||r?{next:e,error:t,complete:r}:e;return n?$e(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(Qe(i,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),i.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var u;s=!1,(u=n.error)===null||u===void 0||u.call(n,c),i.error(c)},function(){var c,u;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):Qo}m();d();f();p();m();d();f();p();function av(e){return` \r
35
+ `.indexOf(e)>=0}function Sc(e){for(var t=["topLevel"],r=0,n,o,i,a=function(I){return t.push(I)},s=function(I){return t[t.length-1]=I},c=function(I){n==null&&(n=r,o=t.length,i=I)},u=function(I){I===i&&(n=void 0,o=void 0,i=void 0)},h=function(){return t.pop()},v=function(){return r--},S=function(I){if("0"<=I&&I<="9"){a("number");return}switch(I){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},g=e.length;r<g;r++){var y=e[r];switch(t[t.length-1]){case"topLevel":S(y);break;case"string":switch(y){case"\"":h();break;case"\\":c("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":y==="u"?a("stringUnicode"):(u("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(u("stringEscape"),h());break;case"number":y==="."?s("numberNeedsDigit"):y==="e"||y==="E"?s("numberNeedsExponent"):(y<"0"||y>"9")&&(v(),h());break;case"numberNeedsDigit":s("number");break;case"numberNeedsExponent":s(y==="+"||y==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(y<"a"||y>"z")&&(v(),h());break;case"arrayNeedsValue":y==="]"?h():av(y)||(u("collectionItem"),s("arrayNeedsComma"),S(y));break;case"arrayNeedsComma":y==="]"?h():y===","&&(c("collectionItem"),s("arrayNeedsValue"));break;case"objectNeedsKey":y==="}"?h():y==="\""&&(c("collectionItem"),s("objectNeedsColon"),a("string"));break;case"objectNeedsColon":y===":"&&s("objectNeedsValue");break;case"objectNeedsValue":av(y)||(u("collectionItem"),s("objectNeedsComma"),S(y));break;case"objectNeedsComma":y==="}"?h():y===","&&(c("collectionItem"),s("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var x=[n!=null?e.slice(0,n):e],E=function(I){return x.push(I.slice(e.length-e.lastIndexOf(I[0])))},C=t.length-1;C>=0;C--)switch(t[C]){case"string":x.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":x.push("0");break;case"true":E("true");break;case"false":E("false");break;case"null":E("null");break;case"arrayNeedsValue":case"arrayNeedsComma":x.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":x.push("}");break}return x.join("")}m();d();f();p();m();d();f();p();m();d();f();p();function cv(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Ac(e,t,r){for(let i=0;i<28;i=i+7){let a=e>>>i,s=!(!(a>>>7)&&t==0),c=(s?a|128:a)&255;if(r.push(c),!s)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let i=3;i<31;i=i+7){let a=t>>>i,s=!!(a>>>7),c=(s?a|128:a)&255;if(r.push(c),!s)return}r.push(t>>>31&1)}}var wc=4294967296;function rp(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,s){let c=Number(e.slice(a,s));o*=r,n=n*r+c,n>=wc&&(o=o+(n/wc|0),n=n%wc)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?lv(n,o):op(n,o)}function uv(e,t){let r=op(e,t),n=r.hi&2147483648;n&&(r=lv(r.lo,r.hi));let o=np(r.lo,r.hi);return n?"-"+o:o}function np(e,t){if({lo:e,hi:t}=U_(e,t),t<=2097151)return String(wc*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,s=o*2,c=1e7;return i>=c&&(a+=Math.floor(i/c),i%=c),a>=c&&(s+=Math.floor(a/c),a%=c),s.toString()+sv(a)+sv(i)}function U_(e,t){return{lo:e>>>0,hi:t>>>0}}function op(e,t){return{lo:e|0,hi:t|0}}function lv(e,t){return t=~t,e?e=~e+1:t+=1,op(e,t)}var sv=e=>{let t=String(e);return"0000000".slice(t.length)+t};function ip(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function dv(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}m();d();f();p();var Dt=V_();function V_(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!w.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>n||s<r)throw new Error(`invalid int64: ${a}`);return s},uParse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>i||s<o)throw new Error(`invalid uint64: ${a}`);return s},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),pv(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),fv(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),pv(r),rp(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),fv(r),rp(r)},dec(r,n){return uv(r,n)},uDec(r,n){return np(r,n)}}}function pv(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function fv(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}m();d();f();p();var ap=Symbol.for("@bufbuild/protobuf/text-encoding");function sp(){if(w[ap]==null){let e=new w.TextEncoder,t=new w.TextDecoder;w[ap]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return w[ap]}var Fr;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Fr||(Fr={}));var G_=34028234663852886e22,B_=-34028234663852886e22,$_=4294967295,Q_=2147483647,H_=-2147483648,Te=class{constructor(t=sp().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(mv(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return cp(t),ip(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){z_(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){mv(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){cp(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return cp(t),t=(t<<1^t>>31)>>>0,ip(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Dt.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Dt.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Dt.enc(t);return Ac(r.lo,r.hi,this.buf),this}sint64(t){let r=Dt.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return Ac(o,i,this.buf),this}uint64(t){let r=Dt.uEnc(t);return Ac(r.lo,r.hi,this.buf),this}},oe=class{constructor(t,r=sp().decodeUtf8){this.decodeUtf8=r,this.varint64=cv,this.uint32=dv,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case Fr.Varint:for(;this.buf[this.pos++]&128;);break;case Fr.Bit64:this.pos+=4;case Fr.Bit32:this.pos+=4;break;case Fr.LengthDelimited:let o=this.uint32();this.pos+=o;break;case Fr.StartGroup:for(;;){let[i,a]=this.tag();if(a===Fr.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(a,i)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Dt.dec(...this.varint64())}uint64(){return Dt.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Dt.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Dt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Dt.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function cp(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>Q_||e<H_)throw new Error("invalid int32: "+e)}function mv(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>$_||e<0)throw new Error("invalid uint32: "+e)}function z_(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>G_||e<B_))throw new Error("invalid float32: "+e)}var W_=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function up(){return{fields:{}}}var Ji={encode(e,t=new Te){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&pp.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=up();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=pp.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ji.fromPartial(e??{})},fromPartial(e){let t=up();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=up();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function gv(){return{key:"",value:void 0}}var pp={encode(e,t=new Te){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Ce.encode(Ce.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=gv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return pp.fromPartial(e??{})},fromPartial(e){let t=gv();return t.key=e.key??"",t.value=e.value??void 0,t}};function lp(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Ce={encode(e,t=new Te){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Ji.encode(Ji.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Zi.encode(Zi.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=lp();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=Ji.unwrap(Ji.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=Zi.unwrap(Zi.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let t=lp();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=lp();if(e===null)t.nullValue=W_.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(w.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new w.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function dp(){return{values:[]}}var Zi={encode(e,t=new Te){for(let r of e.values)Ce.encode(Ce.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=dp();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(Ce.unwrap(Ce.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Zi.fromPartial(e??{})},fromPartial(e){let t=dp();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=dp();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&w.Array.isArray(e.values)?e.values:e}},K_=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function hv(){return{op:0,path:"",from:void 0,value:void 0}}var bc={encode(e,t=new Te){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Ce.encode(Ce.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=hv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return bc.fromPartial(e??{})},fromPartial(e){let t=hv();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function yv(){return{id:"",type:"",function:void 0}}var xc={encode(e,t=new Te){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&Cc.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=yv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=Cc.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xc.fromPartial(e??{})},fromPartial(e){let t=yv();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?Cc.fromPartial(e.function):void 0,t}};function vv(){return{name:"",arguments:""}}var Cc={encode(e,t=new Te){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=vv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Cc.fromPartial(e??{})},fromPartial(e){let t=vv();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function Sv(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var Ec={encode(e,t=new Te){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)xc.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Sv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(xc.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ec.fromPartial(e??{})},fromPartial(e){let t=Sv();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>xc.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},Y_=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function wv(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ae={encode(e,t=new Te){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Ce.encode(Ce.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=wv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=X_(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ae.fromPartial(e??{})},fromPartial(e){let t=wv();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function Av(){return{baseEvent:void 0,messageId:"",role:void 0}}var Rc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Av();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Rc.fromPartial(e??{})},fromPartial(e){let t=Av();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function bv(){return{baseEvent:void 0,messageId:"",delta:""}}var Ic={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=bv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ic.fromPartial(e??{})},fromPartial(e){let t=bv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function xv(){return{baseEvent:void 0,messageId:""}}var Tc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=xv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Tc.fromPartial(e??{})},fromPartial(e){let t=xv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function Cv(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var _c={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Cv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return _c.fromPartial(e??{})},fromPartial(e){let t=Cv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function Ev(){return{baseEvent:void 0,toolCallId:"",delta:""}}var kc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Ev();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return kc.fromPartial(e??{})},fromPartial(e){let t=Ev();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function Rv(){return{baseEvent:void 0,toolCallId:""}}var Oc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Rv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Oc.fromPartial(e??{})},fromPartial(e){let t=Rv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function Iv(){return{baseEvent:void 0,snapshot:void 0}}var Pc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Ce.encode(Ce.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Iv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Pc.fromPartial(e??{})},fromPartial(e){let t=Iv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function Tv(){return{baseEvent:void 0,delta:[]}}var Nc={encode(e,t=new Te){e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)bc.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Tv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push(bc.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Nc.fromPartial(e??{})},fromPartial(e){let t=Tv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>bc.fromPartial(r))||[],t}};function _v(){return{baseEvent:void 0,messages:[]}}var Fc={encode(e,t=new Te){e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Ec.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=_v();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(Ec.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Fc.fromPartial(e??{})},fromPartial(e){let t=_v();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Ec.fromPartial(r))||[],t}};function kv(){return{baseEvent:void 0,event:void 0,source:void 0}}var Dc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Ce.encode(Ce.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=kv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=Ce.unwrap(Ce.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Dc.fromPartial(e??{})},fromPartial(e){let t=kv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function Ov(){return{baseEvent:void 0,name:"",value:void 0}}var Mc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&Ce.encode(Ce.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Ov();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Mc.fromPartial(e??{})},fromPartial(e){let t=Ov();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function Pv(){return{baseEvent:void 0,threadId:"",runId:""}}var jc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Pv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return jc.fromPartial(e??{})},fromPartial(e){let t=Pv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function Nv(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var qc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&Ce.encode(Ce.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Nv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return qc.fromPartial(e??{})},fromPartial(e){let t=Nv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function Fv(){return{baseEvent:void 0,code:void 0,message:""}}var Lc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Fv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Lc.fromPartial(e??{})},fromPartial(e){let t=Fv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function Dv(){return{baseEvent:void 0,stepName:""}}var Uc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Dv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Uc.fromPartial(e??{})},fromPartial(e){let t=Dv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function Mv(){return{baseEvent:void 0,stepName:""}}var Vc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Mv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Vc.fromPartial(e??{})},fromPartial(e){let t=Mv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function jv(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Gc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=jv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Gc.fromPartial(e??{})},fromPartial(e){let t=jv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function qv(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Bc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=qv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Bc.fromPartial(e??{})},fromPartial(e){let t=qv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function Lv(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var Uv={encode(e,t=new Te){return e.textMessageStart!==void 0&&Rc.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Ic.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Tc.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&_c.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&kc.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Oc.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Pc.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Nc.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Fc.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Dc.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Mc.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&jc.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&qc.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Lc.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Uc.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Vc.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Gc.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Bc.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Lv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=Rc.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=Ic.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=Tc.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=_c.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=kc.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=Oc.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=Pc.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=Nc.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=Fc.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=Dc.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=Mc.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=jc.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=qc.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=Lc.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=Uc.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=Vc.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=Gc.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=Bc.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Uv.fromPartial(e??{})},fromPartial(e){let t=Lv();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Rc.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Ic.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Tc.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?_c.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?kc.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Oc.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Pc.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Nc.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Fc.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Dc.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Mc.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?jc.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?qc.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Lc.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Uc.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Vc.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Gc.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Bc.fromPartial(e.toolCallChunk):void 0,t}};function X_(e){let t=w.Number(e.toString());if(t>w.Number.MAX_SAFE_INTEGER)throw new w.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<w.Number.MIN_SAFE_INTEGER)throw new w.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function Vv(e){let t=Uv.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=Y_[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===F.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===F.STATE_DELTA)for(let n of r.delta)n.op=K_[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),Gs.parse(r)}var Gv="application/vnd.ag-ui.event+proto";m();d();f();p();m();d();f();p();m();d();f();p();var Z_=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,fp=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(Z_);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Bv=e=>e==="*"||e==="x"||e==="X",$v=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},ek=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],tk=(e,t)=>{if(Bv(e)||Bv(t))return 0;let[r,n]=ek($v(e),$v(t));return r>n?1:r<n?-1:0},mp=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=tk(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var $c=(e,t)=>{let r=fp(e),n=fp(t),o=r.pop(),i=n.pop(),a=mp(r,n);return a!==0?a:o&&i?mp(o.split("."),i.split(".")):o||i?o?-1:1:0};var ke=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function ea(){return Tr()}function _e(_x87,_x88,_x89,_x90){return _e2.apply(this,arguments)}function _e2(){_e2=_asyncToGenerator(function*(e,t,r,n){let o=t,i=r,a;for(let s of e)try{let c=yield n(s,ke(o),ke(i));if(c===void 0)continue;if(c.messages!==void 0&&(o=c.messages),c.state!==void 0&&(i=c.state),a=c.stopPropagation,a===!0)break}catch(c){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",c);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(i)===JSON.stringify(r)?{}:{state:i}),...(a===void 0?{}:{stopPropagation:a})}});return _e2.apply(this,arguments)}var Yv=(e,t,r,n)=>{let o=ke(r.messages),i=ke(e.state),a={},s=u=>{u.messages!==void 0&&(o=u.messages,a.messages=u.messages),u.state!==void 0&&(i=u.state,a.state=u.state)},c=()=>{let u=ke(a);return a={},u.messages!==void 0||u.state!==void 0?qe(u):nc};return t.pipe(yc(/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(u){let h=yield _e(n,o,i,(v,S,g)=>v.onEvent?.({event:u,agent:r,input:e,messages:S,state:g}));if(s(h),h.stopPropagation===!0)return c();switch(u.type){case F.TEXT_MESSAGE_START:{let v=yield _e(n,o,i,(S,g,y)=>S.onTextMessageStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messageId:S,role:g="assistant"}=u;if(!o.find(y=>y.id===S)){let y={id:S,role:g,content:""};o.push(y),s({messages:o})}}return c()}case F.TEXT_MESSAGE_CONTENT:{let{messageId:v,delta:S}=u,g=o.find(x=>x.id===v);if(!g)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${v}'`),c();let y=yield _e(n,o,i,(x,E,C)=>x.onTextMessageContentEvent?.({event:u,messages:E,state:C,agent:r,input:e,textMessageBuffer:typeof g.content=="string"?g.content:""}));return s(y),y.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${S}`,s({messages:o})),c()}case F.TEXT_MESSAGE_END:{let{messageId:v}=u,S=o.find(g=>g.id===v);return S?(s(yield _e(n,o,i,(g,y,x)=>g.onTextMessageEndEvent?.({event:u,messages:y,state:x,agent:r,input:e,textMessageBuffer:typeof S.content=="string"?S.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:S,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${v}'`),c())}case F.TOOL_CALL_START:{let v=yield _e(n,o,i,(S,g,y)=>S.onToolCallStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{toolCallId:S,toolCallName:g,parentMessageId:y}=u,x;y&&o.length>0&&o[o.length-1].id===y?x=o[o.length-1]:(x={id:y||S,role:"assistant",toolCalls:[]},o.push(x)),x.toolCalls??(x.toolCalls=[]),x.toolCalls.push({id:S,type:"function",function:{name:g,arguments:""}}),s({messages:o})}return c()}case F.TOOL_CALL_ARGS:{let{toolCallId:v,delta:S}=u,g=o.find(E=>E.toolCalls?.some(C=>C.id===v));if(!g)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${v}'`),c();let y=g.toolCalls?.find(E=>E.id===v);if(!y)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${v}'`),c();let x=yield _e(n,o,i,(E,C,I)=>{let T=y.function.arguments,_=y.function.name,q={};try{q=Sc(T)}catch{}return E.onToolCallArgsEvent?.({event:u,messages:C,state:I,agent:r,input:e,toolCallBuffer:T,toolCallName:_,partialToolCallArgs:q})});return s(x),x.stopPropagation!==!0&&(y.function.arguments+=S,s({messages:o})),c()}case F.TOOL_CALL_END:{let{toolCallId:v}=u,S=o.find(y=>y.toolCalls?.some(x=>x.id===v));if(!S)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${v}'`),c();let g=S.toolCalls?.find(y=>y.id===v);return g?(s(yield _e(n,o,i,(y,x,E)=>{let C=g.function.arguments,I=g.function.name,T={};try{T=JSON.parse(C)}catch{}return y.onToolCallEndEvent?.({event:u,messages:x,state:E,agent:r,input:e,toolCallName:I,toolCallArgs:T})})),yield Promise.all(n.map(y=>{y.onNewToolCall?.({toolCall:g,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${v}'`),c())}case F.TOOL_CALL_RESULT:{let v=yield _e(n,o,i,(S,g,y)=>S.onToolCallResultEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messageId:S,toolCallId:g,content:y,role:x}=u,E={id:S,toolCallId:g,role:x||"tool",content:y};o.push(E),yield Promise.all(n.map(C=>{C.onNewMessage?.({message:E,messages:o,state:i,agent:r,input:e})})),s({messages:o})}return c()}case F.STATE_SNAPSHOT:{let v=yield _e(n,o,i,(S,g,y)=>S.onStateSnapshotEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{snapshot:S}=u;i=S,s({state:i})}return c()}case F.STATE_DELTA:{let v=yield _e(n,o,i,(S,g,y)=>S.onStateDeltaEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{delta:S}=u;try{i=Nr(i,S,!0,!1).newDocument,s({state:i})}catch(g){let y=g instanceof Error?g.message:String(g);console.warn(`Failed to apply state patch:
36
+ Current state: ${JSON.stringify(i,null,2)}
37
+ Patch operations: ${JSON.stringify(S,null,2)}
38
+ Error: ${y}`)}}return c()}case F.MESSAGES_SNAPSHOT:{let v=yield _e(n,o,i,(S,g,y)=>S.onMessagesSnapshotEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messages:S}=u;o=S,s({messages:o})}return c()}case F.ACTIVITY_SNAPSHOT:{let v=u,S=o.findIndex(C=>C.id===v.messageId),g=S>=0?o[S]:void 0,y=g?.role==="activity"?g:void 0,x=v.replace??!0,E=yield _e(n,o,i,(C,I,T)=>C.onActivitySnapshotEvent?.({event:v,messages:I,state:T,agent:r,input:e,activityMessage:y,existingMessage:g}));if(s(E),E.stopPropagation!==!0){let C={id:v.messageId,role:"activity",activityType:v.activityType,content:ke(v.content)},I;S===-1?(o.push(C),I=C):y?x&&(o[S]={...y,activityType:v.activityType,content:ke(v.content)}):x&&(o[S]=C,I=C),s({messages:o}),I&&(yield Promise.all(n.map(T=>T.onNewMessage?.({message:I,messages:o,state:i,agent:r,input:e}))))}return c()}case F.ACTIVITY_DELTA:{let v=u,S=o.findIndex(E=>E.id===v.messageId);if(S===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${v.messageId}' to apply patch`),c();let g=o[S];if(g.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${v.messageId}' is not an activity message`),c();let y=g,x=yield _e(n,o,i,(E,C,I)=>E.onActivityDeltaEvent?.({event:v,messages:C,state:I,agent:r,input:e,activityMessage:y}));if(s(x),x.stopPropagation!==!0)try{let E=ke(y.content??{}),C=Nr(E,v.patch??[],!0,!1).newDocument;o[S]={...y,content:ke(C),activityType:v.activityType},s({messages:o})}catch(E){let C=E instanceof Error?E.message:String(E);console.warn(`Failed to apply activity patch for '${v.messageId}': ${C}`)}return c()}case F.RAW:return s(yield _e(n,o,i,(v,S,g)=>v.onRawEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.CUSTOM:return s(yield _e(n,o,i,(v,S,g)=>v.onCustomEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.RUN_STARTED:{let v=yield _e(n,o,i,(S,g,y)=>S.onRunStartedEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let S=u;if(S.input?.messages){for(let g of S.input.messages)o.find(y=>y.id===g.id)||o.push(g);s({messages:o})}}return c()}case F.RUN_FINISHED:return s(yield _e(n,o,i,(v,S,g)=>v.onRunFinishedEvent?.({event:u,messages:S,state:g,agent:r,input:e,result:u.result}))),c();case F.RUN_ERROR:return s(yield _e(n,o,i,(v,S,g)=>v.onRunErrorEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.STEP_STARTED:return s(yield _e(n,o,i,(v,S,g)=>v.onStepStartedEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.STEP_FINISHED:return s(yield _e(n,o,i,(v,S,g)=>v.onStepFinishedEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case F.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case F.THINKING_START:return c();case F.THINKING_END:return c();case F.THINKING_TEXT_MESSAGE_START:return c();case F.THINKING_TEXT_MESSAGE_CONTENT:return c();case F.THINKING_TEXT_MESSAGE_END:return c();case F.REASONING_START:return s(yield _e(n,o,i,(v,S,g)=>v.onReasoningStartEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.REASONING_MESSAGE_START:{let v=yield _e(n,o,i,(S,g,y)=>S.onReasoningMessageStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messageId:S}=u;if(!o.find(g=>g.id===S)){let g={id:S,role:"reasoning",content:""};o.push(g),s({messages:o})}}return c()}case F.REASONING_MESSAGE_CONTENT:{let{messageId:v,delta:S}=u,g=o.find(x=>x.id===v);if(!g)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${v}'`),c();let y=yield _e(n,o,i,(x,E,C)=>x.onReasoningMessageContentEvent?.({event:u,messages:E,state:C,agent:r,input:e,reasoningMessageBuffer:typeof g.content=="string"?g.content:""}));return s(y),y.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${S}`,s({messages:o})),c()}case F.REASONING_MESSAGE_END:{let{messageId:v}=u,S=o.find(g=>g.id===v);return S?(s(yield _e(n,o,i,(g,y,x)=>g.onReasoningMessageEndEvent?.({event:u,messages:y,state:x,agent:r,input:e,reasoningMessageBuffer:typeof S.content=="string"?S.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:S,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${v}'`),c())}case F.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case F.REASONING_END:return s(yield _e(n,o,i,(v,S,g)=>v.onReasoningEndEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.REASONING_ENCRYPTED_VALUE:{let{subtype:v,entityId:S,encryptedValue:g}=u,y=yield _e(n,o,i,(x,E,C)=>x.onReasoningEncryptedValueEvent?.({event:u,messages:E,state:C,agent:r,input:e}));if(s(y),y.stopPropagation!==!0){let x=!1;if(v==="tool-call"){for(let E of o)if(E.role==="assistant"&&E.toolCalls){let C=E.toolCalls.find(I=>I.id===S);if(C){C.encryptedValue=g,x=!0;break}}}else{let E=o.find(C=>C.id===S);E?.role!=="activity"&&E&&(E.encryptedValue=g,x=!0)}x&&(a.messages=o)}return c()}}return u.type,c()});return function(_x91){return _ref43.apply(this,arguments)}}()),Xd(),n.length>0?Zd({}):u=>u)},gp=e=>t=>{let r=new Map,n=new Map,o=!1,i=!1,a=!1,s=new Map,c=!1,u=!1,h=!1,v=()=>{r.clear(),n.clear(),s.clear(),c=!1,u=!1,o=!1,i=!1,h=!0};return t.pipe(yt(S=>{let g=S.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(S)),i)return Fe(()=>new je(`Cannot send event type '${g}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&g!==F.RUN_ERROR&&g!==F.RUN_STARTED)return Fe(()=>new je(`Cannot send event type '${g}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(a){if(g===F.RUN_STARTED){if(h&&!o)return Fe(()=>new je("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&v()}}else if(a=!0,g!==F.RUN_STARTED&&g!==F.RUN_ERROR)return Fe(()=>new je("First event must be 'RUN_STARTED'"));switch(g){case F.TEXT_MESSAGE_START:{let y=S.messageId;return r.has(y)?Fe(()=>new je(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${y}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(y,!0),qe(S))}case F.TEXT_MESSAGE_CONTENT:{let y=S.messageId;return r.has(y)?qe(S):Fe(()=>new je(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${y}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case F.TEXT_MESSAGE_END:{let y=S.messageId;return r.has(y)?(r.delete(y),qe(S)):Fe(()=>new je(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${y}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case F.TOOL_CALL_START:{let y=S.toolCallId;return n.has(y)?Fe(()=>new je(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${y}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(y,!0),qe(S))}case F.TOOL_CALL_ARGS:{let y=S.toolCallId;return n.has(y)?qe(S):Fe(()=>new je(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${y}'. Start a tool call with 'TOOL_CALL_START' first.`))}case F.TOOL_CALL_END:{let y=S.toolCallId;return n.has(y)?(n.delete(y),qe(S)):Fe(()=>new je(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${y}'. A 'TOOL_CALL_START' event must be sent first.`))}case F.STEP_STARTED:{let y=S.stepName;return s.has(y)?Fe(()=>new je(`Step "${y}" is already active for 'STEP_STARTED'`)):(s.set(y,!0),qe(S))}case F.STEP_FINISHED:{let y=S.stepName;return s.has(y)?(s.delete(y),qe(S)):Fe(()=>new je(`Cannot send 'STEP_FINISHED' for step "${y}" that was not started`))}case F.RUN_STARTED:return h=!0,qe(S);case F.RUN_FINISHED:if(s.size>0){let y=Array.from(s.keys()).join(", ");return Fe(()=>new je(`Cannot send 'RUN_FINISHED' while steps are still active: ${y}`))}if(r.size>0){let y=Array.from(r.keys()).join(", ");return Fe(()=>new je(`Cannot send 'RUN_FINISHED' while text messages are still active: ${y}`))}if(n.size>0){let y=Array.from(n.keys()).join(", ");return Fe(()=>new je(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${y}`))}return o=!0,qe(S);case F.RUN_ERROR:return i=!0,qe(S);case F.CUSTOM:return qe(S);case F.THINKING_TEXT_MESSAGE_START:return c?u?Fe(()=>new je("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(u=!0,qe(S)):Fe(()=>new je("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case F.THINKING_TEXT_MESSAGE_CONTENT:return u?qe(S):Fe(()=>new je("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case F.THINKING_TEXT_MESSAGE_END:return u?(u=!1,qe(S)):Fe(()=>new je("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case F.THINKING_START:return c?Fe(()=>new je("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(c=!0,qe(S));case F.THINKING_END:return c?(c=!1,qe(S)):Fe(()=>new je("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return qe(S)}}))},On=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),rk=(e,t)=>Jd(()=>Tn(A(e,t))).pipe(ep(r=>{if(!r.ok){let i=r.headers.get("content-type")||"";return Tn(r.text()).pipe(yt(a=>{let s=a;if(i.includes("application/json"))try{s=JSON.parse(a)}catch{}let c=Error(`HTTP ${r.status}: ${typeof s=="string"?s:JSON.stringify(s)}`);return c.status=r.status,c.payload=s,Fe(()=>c)}))}let n={type:On.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new Ne(i=>(i.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:s}=yield o.read();if(a)break;let c={type:On.DATA,data:s};i.next(c)}i.complete()}catch(a){i.error(a)}})(),()=>{o.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):Fe(()=>Error("Failed to getReader() from response"))})),nk=e=>{let t=new Wt,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:i=>{if(i.type!==On.HEADERS&&i.type===On.DATA&&i.data){let a=r.decode(i.data,{stream:!0});n+=a;let s=n.split(/\n\n/);n=s.pop()||"";for(let c of s)o(c)}},error:i=>t.error(i),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(i){let a=i.split(`
39
+ `),s=[];for(let c of a)c.startsWith("data:")&&s.push(c.slice(5).replace(/^ /,""));if(s.length>0)try{let c=s.join(`
40
+ `),u=JSON.parse(c);t.next(u)}catch(c){t.error(c)}}return t.asObservable()},ok=e=>{let t=new Wt,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==On.HEADERS&&o.type===On.DATA&&o.data){let i=new Uint8Array(r.length+o.data.length);i.set(r,0),i.set(o.data,r.length),r=i,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let i=r.slice(4,o),a=Vv(i);t.next(a),r=r.slice(o)}catch(i){let a=i instanceof Error?i.message:String(i);t.error(Error(`Failed to decode protocol buffer message: ${a}`));return}}}return t.asObservable()},ik=e=>{let t=new Wt,r=new rc,n=!1;return e.subscribe({next:o=>{r.next(o),o.type===On.HEADERS&&!n?(n=!0,o.headers.get("content-type")===Gv?ok(r).subscribe({next:i=>t.next(i),error:i=>t.error(i),complete:()=>t.complete()}):nk(r).subscribe({next:i=>{try{let a=Gs.parse(i);t.next(a)}catch(a){t.error(a)}},error:i=>{if(i?.name==="AbortError"){t.next({type:F.RUN_ERROR,message:i.message||"Request aborted",code:"abort",rawEvent:i}),t.complete();return}return t.error(i)},complete:()=>t.complete()})):n||t.error(Error("No headers event received before data events"))},error:o=>{r.error(o),t.error(o)},complete:()=>{r.complete()}}),t.asObservable()},Pe=R.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),ak=R.enum(["LangGraphInterruptEvent","PredictState","Exit"]),sk=R.object({type:R.literal(Pe.enum.TextMessageStart),messageId:R.string(),parentMessageId:R.string().optional(),role:R.string().optional()}),ck=R.object({type:R.literal(Pe.enum.TextMessageContent),messageId:R.string(),content:R.string()}),uk=R.object({type:R.literal(Pe.enum.TextMessageEnd),messageId:R.string()}),lk=R.object({type:R.literal(Pe.enum.ActionExecutionStart),actionExecutionId:R.string(),actionName:R.string(),parentMessageId:R.string().optional()}),dk=R.object({type:R.literal(Pe.enum.ActionExecutionArgs),actionExecutionId:R.string(),args:R.string()}),pk=R.object({type:R.literal(Pe.enum.ActionExecutionEnd),actionExecutionId:R.string()}),fk=R.object({type:R.literal(Pe.enum.ActionExecutionResult),actionName:R.string(),actionExecutionId:R.string(),result:R.string()}),mk=R.object({type:R.literal(Pe.enum.AgentStateMessage),threadId:R.string(),agentName:R.string(),nodeName:R.string(),runId:R.string(),active:R.boolean(),role:R.string(),state:R.string(),running:R.boolean()}),gk=R.object({type:R.literal(Pe.enum.MetaEvent),name:ak,value:R.any()}),hk=R.object({type:R.literal(Pe.enum.RunError),message:R.string(),code:R.string().optional()});R.discriminatedUnion("type",[sk,ck,uk,lk,dk,pk,fk,mk,gk,hk]),R.object({id:R.string(),role:R.string(),content:R.string(),parentMessageId:R.string().optional()}),R.object({id:R.string(),name:R.string(),arguments:R.any(),parentMessageId:R.string().optional()}),R.object({id:R.string(),result:R.any(),actionExecutionId:R.string(),actionName:R.string()});var yk=e=>{if(typeof e=="string")return e;if(!Array.isArray(e))return;let t=e.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(t.length!==0)return t.join(`
41
+ `)},vk=(e,t,r)=>n=>{let o={},i=!0,a=!0,s="",c=null,u=null,h=[],v={},S=g=>{typeof g=="object"&&g&&("messages"in g&&delete g.messages,o=g)};return n.pipe(yt(g=>{switch(g.type){case F.TEXT_MESSAGE_START:{let y=g;return[{type:Pe.enum.TextMessageStart,messageId:y.messageId,role:y.role}]}case F.TEXT_MESSAGE_CONTENT:{let y=g;return[{type:Pe.enum.TextMessageContent,messageId:y.messageId,content:y.delta}]}case F.TEXT_MESSAGE_END:{let y=g;return[{type:Pe.enum.TextMessageEnd,messageId:y.messageId}]}case F.TOOL_CALL_START:{let y=g;return h.push({id:y.toolCallId,type:"function",function:{name:y.toolCallName,arguments:""}}),a=!0,v[y.toolCallId]=y.toolCallName,[{type:Pe.enum.ActionExecutionStart,actionExecutionId:y.toolCallId,actionName:y.toolCallName,parentMessageId:y.parentMessageId}]}case F.TOOL_CALL_ARGS:{let y=g,x=h.find(C=>C.id===y.toolCallId);if(!x)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${y.toolCallId}'`),[];x.function.arguments+=y.delta;let E=!1;if(u){let C=u.find(I=>I.tool==x.function.name);if(C)try{let I=JSON.parse(Sc(x.function.arguments));C.tool_argument&&C.tool_argument in I?(S({...o,[C.state_key]:I[C.tool_argument]}),E=!0):C.tool_argument||(S({...o,[C.state_key]:I}),E=!0)}catch{}}return[{type:Pe.enum.ActionExecutionArgs,actionExecutionId:y.toolCallId,args:y.delta},...(E?[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case F.TOOL_CALL_END:{let y=g;return[{type:Pe.enum.ActionExecutionEnd,actionExecutionId:y.toolCallId}]}case F.TOOL_CALL_RESULT:{let y=g;return[{type:Pe.enum.ActionExecutionResult,actionExecutionId:y.toolCallId,result:y.content,actionName:v[y.toolCallId]||"unknown"}]}case F.RAW:return[];case F.CUSTOM:{let y=g;switch(y.name){case"Exit":i=!1;break;case"PredictState":u=y.value;break}return[{type:Pe.enum.MetaEvent,name:y.name,value:y.value}]}case F.STATE_SNAPSHOT:return S(g.snapshot),[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case F.STATE_DELTA:{let y=g,x=Nr(o,y.delta,!0,!1);return x?(S(x.newDocument),[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case F.MESSAGES_SNAPSHOT:return c=g.messages,[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:c}:{})}),active:!0}];case F.RUN_STARTED:return[];case F.RUN_FINISHED:return c&&(o.messages=c),Object.keys(o).length===0?[]:[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:Sk(c)}:{})}),active:!1}];case F.RUN_ERROR:{let y=g;return[{type:Pe.enum.RunError,message:y.message,code:y.code}]}case F.STEP_STARTED:return s=g.stepName,h=[],u=null,[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case F.STEP_FINISHED:return h=[],u=null,[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function Sk(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=yk(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var Qc=e=>t=>{let r,n,o,i,a=()=>{if(!r||i!=="text")throw Error("No text message to close");let h={type:F.TEXT_MESSAGE_END,messageId:r.messageId};return i=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(h)),h},s=()=>{if(!n||i!=="tool")throw Error("No tool call to close");let h={type:F.TOOL_CALL_END,toolCallId:n.toolCallId};return i=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(h)),h},c=()=>{if(!o||i!=="reasoning")throw Error("No reasoning message to close");let h={type:F.REASONING_MESSAGE_END,messageId:o.messageId};return i=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(h)),h},u=()=>i==="text"?[a()]:i==="tool"?[s()]:i==="reasoning"?[c()]:[];return t.pipe(yt(h=>{switch(h.type){case F.TEXT_MESSAGE_START:case F.TEXT_MESSAGE_CONTENT:case F.TEXT_MESSAGE_END:case F.TOOL_CALL_START:case F.TOOL_CALL_ARGS:case F.TOOL_CALL_END:case F.TOOL_CALL_RESULT:case F.STATE_SNAPSHOT:case F.STATE_DELTA:case F.MESSAGES_SNAPSHOT:case F.CUSTOM:case F.RUN_STARTED:case F.RUN_FINISHED:case F.RUN_ERROR:case F.STEP_STARTED:case F.STEP_FINISHED:case F.THINKING_START:case F.THINKING_END:case F.THINKING_TEXT_MESSAGE_START:case F.THINKING_TEXT_MESSAGE_CONTENT:case F.THINKING_TEXT_MESSAGE_END:case F.REASONING_START:case F.REASONING_MESSAGE_START:case F.REASONING_MESSAGE_CONTENT:case F.REASONING_MESSAGE_END:case F.REASONING_END:return[...u(),h];case F.RAW:case F.ACTIVITY_SNAPSHOT:case F.ACTIVITY_DELTA:case F.REASONING_ENCRYPTED_VALUE:return[h];case F.TEXT_MESSAGE_CHUNK:let v=h,S=[];if((i!=="text"||v.messageId!==void 0&&v.messageId!==r?.messageId)&&S.push(...u()),i!=="text"){if(v.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:v.messageId},i="text";let C={type:F.TEXT_MESSAGE_START,messageId:v.messageId,role:v.role||"assistant"};S.push(C),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(C))}if(v.delta!==void 0){let C={type:F.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:v.delta};S.push(C),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(C))}return S;case F.TOOL_CALL_CHUNK:let g=h,y=[];if((i!=="tool"||g.toolCallId!==void 0&&g.toolCallId!==n?.toolCallId)&&y.push(...u()),i!=="tool"){if(g.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(g.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId},i="tool";let C={type:F.TOOL_CALL_START,toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId};y.push(C),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(C))}if(g.delta!==void 0){let C={type:F.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:g.delta};y.push(C),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(C))}return y;case F.REASONING_MESSAGE_CHUNK:let x=h,E=[];if((i!=="reasoning"||x.messageId&&x.messageId!==o?.messageId)&&E.push(...u()),i!=="reasoning"){if(x.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:x.messageId},i="reasoning";let C={type:F.REASONING_MESSAGE_START,messageId:x.messageId};E.push(C),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(C))}if(x.delta!==void 0){let C={type:F.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:x.delta};E.push(C),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(C))}return E}return h.type,[]}),kn(()=>{u()}))},hp=class{runNext(e,t){return t.run(e).pipe(Qc(!1))}runNextWithState(e,t){let r=ke(e.messages||[]),n=ke(e.state||{}),o=new rc;return Yv(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(yc(/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:ke(r),state:ke(n)}});return function(_x92){return _ref45.apply(this,arguments)}}()))}},wk=class extends hp{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function Ak(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var bk=class extends hp{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(Ak)};return this.runNext(o,t)}},Qv="THINKING_START",Hv="THINKING_END",zv="THINKING_TEXT_MESSAGE_START",Wv="THINKING_TEXT_MESSAGE_CONTENT",Kv="THINKING_TEXT_MESSAGE_END",xk=class extends hp{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(_n(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case Qv:{this.currentReasoningId=ea();let{title:t,...r}=e;return this.warnAboutTransformation(Qv,F.REASONING_START),{...r,type:F.REASONING_START,messageId:this.currentReasoningId}}case zv:return this.currentMessageId=ea(),this.warnAboutTransformation(zv,F.REASONING_MESSAGE_START),{...e,type:F.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case Wv:{let{delta:t,...r}=e;return this.warnAboutTransformation(Wv,F.REASONING_MESSAGE_CONTENT),{...r,type:F.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??ea(),delta:t}}case Kv:{let t=this.currentMessageId??ea();return this.warnAboutTransformation(Kv,F.REASONING_MESSAGE_END),{...e,type:F.REASONING_MESSAGE_END,messageId:t}}case Hv:{let t=this.currentReasoningId??ea();return this.warnAboutTransformation(Hv,F.REASONING_END),{...e,type:F.REASONING_END,messageId:t}}default:return e}}},Ck="0.0.45",Ek=class{get maxVersion(){return Ck}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Tr(),this.messages=ke(n??[]),this.state=ke(o??{}),this.debug=i??!1,$c(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new bk),$c(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new xk)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new wk(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this14=this;return _asyncToGenerator(function*(){try{_this14.isRunning=!0,_this14.agentId=_this14.agentId??Tr();let r=_this14.prepareRunAgentInput(e),n,o=new Set(_this14.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{n=c.result}},..._this14.subscribers,t??{}];yield _this14.onInitialize(r,i),_this14.activeRunDetach$=new Wt;let a;_this14.activeRunCompletionPromise=new Promise(c=>{a=c}),yield hc(tc(()=>_this14.middlewares.length===0?_this14.run(r):_this14.middlewares.reduceRight((c,u)=>({run:h=>u.run(h,c)}),_this14).run(r),Qc(_this14.debug),gp(_this14.debug),c=>c.pipe(vc(_this14.activeRunDetach$)),c=>_this14.apply(r,c,i),c=>_this14.processApplyEvents(r,c,i),Xi(c=>(_this14.isRunning=!1,_this14.onError(r,c,i))),kn(()=>{_this14.isRunning=!1,_this14.onFinalize(r,i),a?.(),a=void 0,_this14.activeRunCompletionPromise=void 0,_this14.activeRunDetach$=void 0}))(qe(null)));let s=ke(_this14.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this14.isRunning=!1}})()}connect(e){throw new qd}connectAgent(e,t){var _this15=this;return _asyncToGenerator(function*(){try{_this15.isRunning=!0,_this15.agentId=_this15.agentId??Tr();let r=_this15.prepareRunAgentInput(e),n,o=new Set(_this15.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{n=c.result}},..._this15.subscribers,t??{}];yield _this15.onInitialize(r,i),_this15.activeRunDetach$=new Wt;let a;_this15.activeRunCompletionPromise=new Promise(c=>{a=c}),yield hc(tc(()=>_this15.connect(r),Qc(_this15.debug),gp(_this15.debug),c=>c.pipe(vc(_this15.activeRunDetach$)),c=>_this15.apply(r,c,i),c=>_this15.processApplyEvents(r,c,i),Xi(c=>(_this15.isRunning=!1,c instanceof qd?nc:_this15.onError(r,c,i))),kn(()=>{_this15.isRunning=!1,_this15.onFinalize(r,i),a?.(),a=void 0,_this15.activeRunCompletionPromise=void 0,_this15.activeRunDetach$=void 0}))(qe(null)));let s=ke(_this15.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this15.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this16=this;return _asyncToGenerator(function*(){if(!_this16.activeRunDetach$)return;let e=_this16.activeRunCompletionPromise??Promise.resolve();_this16.activeRunDetach$.next(),_this16.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return Yv(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(tp(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=ke(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Tr(),tools:ke(e?.tools??[]),context:ke(e?.context??[]),forwardedProps:ke(e?.forwardedProps??{}),state:ke(this.state),messages:t}}onInitialize(e,t){var _this17=this;return _asyncToGenerator(function*(){let r=yield _e(t,_this17.messages,_this17.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this17,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this17.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this17.messages,state:_this17.state,agent:_this17,input:e})})),r.state&&(_this17.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this17.state,messages:_this17.messages,agent:_this17,input:e})})))})()}onError(e,t,r){return Tn(_e(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(_n(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this18=this;return _asyncToGenerator(function*(){let r=yield _e(t,_this18.messages,_this18.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this18,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this18.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this18.messages,state:_this18.state,agent:_this18,input:e})})),r.state!==void 0&&(_this18.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this18.state,messages:_this18.messages,agent:_this18,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=ke(this.messages),e.state=ke(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this19=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this19.subscribers)yield t.onNewMessage?.({message:e,messages:_this19.messages,state:_this19.state,agent:_this19});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this19.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this19.messages,state:_this19.state,agent:_this19});for(let t of _this19.subscribers)yield t.onMessagesChanged?.({messages:_this19.messages,state:_this19.state,agent:_this19})})()}addMessages(e){var _this20=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this20.subscribers)yield r.onNewMessage?.({message:t,messages:_this20.messages,state:_this20.state,agent:_this20});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this20.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this20.messages,state:_this20.state,agent:_this20})}for(let t of _this20.subscribers)yield t.onMessagesChanged?.({messages:_this20.messages,state:_this20.state,agent:_this20})})()}setMessages(e){var _this21=this;this.messages=ke(e),_asyncToGenerator(function*(){for(let t of _this21.subscribers)yield t.onMessagesChanged?.({messages:_this21.messages,state:_this21.state,agent:_this21})})()}setState(e){var _this22=this;this.state=ke(e),_asyncToGenerator(function*(){for(let t of _this22.subscribers)yield t.onStateChanged?.({messages:_this22.messages,state:_this22.state,agent:_this22})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Tr();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(Qc(this.debug),gp(this.debug),vk(this.threadId,t.runId,this.agentId),r=>r.pipe(_n(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},Xv=class extends Ek{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new l.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new l.AbortController,this.url=e.url,this.headers=ke(e.headers??{})}run(e){return ik(rk(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=ke(this.headers??{});let t=new l.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};m();d();f();p();var Jv=(e,t,r)=>{let n=Be(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/preview/organizations/${t}/agents`;return`${n}${i}/${o}`};var yp=class extends Xv{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},Zv=(e,t,r)=>new yp({url:`${Jv(e,t,r)}/answer`});m();d();f();p();m();d();f();p();var Rk={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004};function eS(e){return e?Rk[e]??1004:1004}var tS=e=>({onRunStartedEvent:({event:t})=>{e(Co(t.runId)),e(Ot(!1)),e(br(!0)),e(Rs(t.threadId))},onStepStartedEvent:({event:t})=>{e(ay({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(sy({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(rn({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e(an(n.contentFormat)),n?.followUpEnabled&&e(Es(n.followUpEnabled));return}case"citations":{e(nn({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=eS(t.code);e(on({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.answerGenerated??!1;e(Mi(r)),e(sn(!r)),e(br(!1))}});var rS=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref50=_asyncToGenerator(function*(n,o,i){t();let a=Sr(n),s=ig(n),c=ag(n),u=og(n),h=Zv(a,s,c);e=h;let v=tS(o),S=Ns(n,i());try{o(Ot(!0)),yield h.runAgent({forwardedProps:{params:S,accessToken:u}},v)}catch(g){o(Ot(!1)),o(on({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",g)}});return function run(_x93,_x94,_x95){return _ref50.apply(this,arguments)}}(),abortRun:t}};m();d();f();p();m();d();f();p();var Hc=P("breadcrumb/deselectAll"),nS=P("breadcrumb/deselectAllNonBreadcrumbs");m();d();f();p();var oS=P("facet/updateFacetAutoSelection",e=>j(e,{allow:new ue({required:!0})}));m();d();f();p();m();d();f();p();var zc=class extends wr{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??St().q}get responseTime(){return this.activeInstantResultCache?.duration??jt().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??jt().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var iS=()=>ct("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new zc(e)),aS=()=>({actionCause:"searchboxAsYouType"});m();d();f();p();var vp={id:X},Ik={...vp,q:Je},ine=P("instantResults/register",e=>j(e,vp)),Wc=P("instantResults/updateQuery",e=>j(e,Ik)),ane=P("instantResults/clearExpired",e=>j(e,vp));m();d();f();p();var Kc=new te({required:!0,min:0}),Yc=P("pagination/registerNumberOfResults",e=>j(e,Kc)),Xc=P("pagination/updateNumberOfResults",e=>j(e,Kc)),Jc=P("pagination/registerPage",e=>j(e,Kc)),Ho=P("pagination/updatePage",e=>j(e,Kc)),Zc=P("pagination/nextPage"),eu=P("pagination/previousPage");m();d();f();p();var zo=P("query/updateQuery",e=>j(e,{q:new H,enableQuerySyntax:new ue}));m();d();f();p();m();d();f();p();m();d();f();p();var Dr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Sp=()=>ct("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Mr=e=>ct("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||St().q,aq:r.advancedSearchQueries?.aq||Dr().aq,cq:r.advancedSearchQueries?.cq||Dr().cq,dq:r.advancedSearchQueries?.dq||Dr().dq,errorType:e.type,errorMessage:e.message}));m();d();f();p();m();d();f();p();var $ne=P("didYouMean/enable"),Qne=P("didYouMean/disable"),Hne=P("didYouMean/automaticCorrections/disable"),zne=P("didYouMean/automaticCorrections/enable"),tu=P("didYouMean/correction",e=>j(e,X)),Wne=P("didYouMean/automaticCorrections/mode",e=>j(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));m();d();f();p();var wp=()=>ct("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var sS=()=>({actionCause:"didYouMeanAutomatic"});m();d();f();p();m();d();f();p();function ru(){return{contextValues:{}}}m();d();f();p();function nu(){return{contextValues:{}}}m();d();f();p();function cS(){return{freezeFacetOrder:!1,facets:{}}}m();d();f();p();function uS(){return[]}m();d();f();p();function ta(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}m();d();f();p();function lS(){return{}}m();d();f();p();function dS(){return{}}m();d();f();p();function pS(){return{}}function Kt(e){return{context:e.context||ru(),dictionaryFieldContext:e.dictionaryFieldContext||nu(),facetSet:e.facetSet||us(),numericFacetSet:e.numericFacetSet||cs(),dateFacetSet:e.dateFacetSet||ss(),categoryFacetSet:e.categoryFacetSet||as(),automaticFacetSet:e.automaticFacetSet??is(),pagination:e.pagination||ta(),query:e.query||St(),tabSet:e.tabSet||pS(),advancedSearchQueries:e.advancedSearchQueries||Dr(),staticFilterSet:e.staticFilterSet||dS(),querySet:e.querySet||lS(),sortCriteria:e.sortCriteria||ls(),pipeline:e.pipeline||ro(),searchHub:e.searchHub||po(),facetOptions:e.facetOptions||cS(),facetOrder:e.facetOrder??uS(),debug:e.debug??Ua()}}m();d();f();p();var wie=new ee({values:{undoneQuery:Je},options:{required:!0}}),fS=()=>ct("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);m();d();f();p();var ou=P("trigger/query/ignore",e=>j(e,new H({emptyAllowed:!0,required:!0}))),iu=P("trigger/query/modification",e=>j(e,new ee({values:{originalQuery:Xe,modification:Xe}})));m();d();f();p();var jr=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=kk(e),n=Ps(e),o=Tk(e),i=yield Rr(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Cr({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function jr(_x96,_x97){return _ref51.apply(this,arguments)}}();function Tk(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(_k).filter(r=>r.currentValues.length>0):void 0}function _k(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function kk(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Ok(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function Ok(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var qr=class{constructor(t,r=n=>{this.dispatch(zo({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x98,_x99){var _this23=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Os(yield _this23.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this23.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this24=this;return _asyncToGenerator(function*(){return _this24.processQueryErrorOrContinue(t)??(yield _this24.processQueryCorrectionsOrContinue(t))??(yield _this24.processQueryTriggersOrContinue(t))??_this24.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return dt(t.response)?(this.dispatch(Mr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this25=this;return _asyncToGenerator(function*(){let r=_this25.getState(),n=_this25.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!ie(c)&&!ie(c.correctedQuery);if(!u&&!h)return null;let S=u?yield _this25.processLegacyDidYouMeanAutoCorrection(t):_this25.processModernDidYouMeanAutoCorrection(t);return _this25.dispatch(Vt(Kt(_this25.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getCurrentQuery(),n=_this26.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this26.automaticallyRetryQueryWithCorrection(o);return dt(i.response)?(_this26.dispatch(Mr(i.response.error)),_this26.rejectWithValue(i.response.error)):(_this26.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this26.dispatch(Vt(Kt(_this26.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:wp()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:wp()}}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 _this27=this;return _asyncToGenerator(function*(){let r=_this27.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this27.getState().triggers?.queryModification.queryToIgnore===n)return _this27.dispatch(ou("")),null;_this27.analyticsAction&&(yield _this27.dispatch(_this27.analyticsAction));let i=_this27.getCurrentQuery(),a=yield _this27.automaticallyRetryQueryWithTriggerModification(n);return dt(a.response)?(_this27.dispatch(Mr(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(Vt(Kt(_this27.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:fS()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??St().enableQuerySyntax},search:{...jt(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Vt(Kt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return va(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this28=this;return _asyncToGenerator(function*(){_this28.onUpdateQueryForCorrection(t);let r=yield _this28.fetchFromAPI(yield jr(_this28.getState()),{origin:"mainSearch"});return _this28.dispatch(tu(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this29=this;return _asyncToGenerator(function*(){return _this29.dispatch(iu({newQuery:t,originalQuery:_this29.getCurrentQuery()})),_this29.onUpdateQueryForCorrection(t),yield _this29.fetchFromAPI(yield jr(_this29.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 Sae=be("search/executeSearch",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();return yield au(r,t,e)});return function(_x100,_x101){return _ref52.apply(this,arguments)}}()),wae=be("search/fetchPage",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();return yield bp(r,t,e)});return function(_x102,_x103){return _ref53.apply(this,arguments)}}()),Aae=be("search/fetchMoreResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();return yield xp(t,r)});return function(_x104,_x105){return _ref54.apply(this,arguments)}}()),bae=be("search/fetchFacetValues",/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Dk(t,e,r)});return function(_x106,_x107){return _ref55.apply(this,arguments)}}()),xae=be("search/fetchInstantResults",/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t){return Ap(e,t)});return function(_x108,_x109){return _ref56.apply(this,arguments)}}()),Pk=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t){let r=yield jr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function Pk(_x110,_x111){return _ref57.apply(this,arguments)}}(),Nk=/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,t,r){let n=yield Rr(e);return Cr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function Nk(_x112,_x113,_x114){return _ref58.apply(this,arguments)}}(),Fk=/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,t){let r=yield jr(e,t);return r.request.numberOfResults=0,r});return function Fk(_x115,_x116){return _ref59.apply(this,arguments)}}(),mS=e=>{e.configuration.analytics.enabled&&bt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Ap(_x117,_x118){return _Ap.apply(this,arguments)}function _Ap(){_Ap=_asyncToGenerator(function*(e,t){j(e,{id:X,q:X,maxResultsPerQuery:new te({required:!0,min:1}),cacheTimeout:new te});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new qr({...t,analyticsAction:iS()},u=>{t.dispatch(Wc({q:u,id:e.id}))}),a=yield Nk(o,r,n),s=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),c=yield i.process(s);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _Ap.apply(this,arguments)}function bp(_x119,_x120,_x121){return _bp.apply(this,arguments)}function _bp(){_bp=_asyncToGenerator(function*(e,t,r){mS(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new qr({...t,analyticsAction:r}),c=yield jr(e,a),u=yield s.fetchFromAPI(c,{origin:"mainSearch"});return yield s.process(u)});return _bp.apply(this,arguments)}function xp(_x122,_x123){return _xp.apply(this,arguments)}function _xp(){_xp=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Sp().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new qr({...e,analyticsAction:Sp()}),s=yield Pk(t,i),c=yield a.fetchFromAPI(s,{origin:"mainSearch"});return yield a.process(c)});return _xp.apply(this,arguments)}function Dk(_x124,_x125,_x126){return _Dk.apply(this,arguments)}function _Dk(){_Dk=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new qr({...e,analyticsAction:t}),c=yield Fk(r,a),u=yield s.fetchFromAPI(c,{origin:"facetValues"});return yield s.process(u)});return _Dk.apply(this,arguments)}function au(_x127,_x128,_x129){return _au.apply(this,arguments)}function _au(){_au=_asyncToGenerator(function*(e,t,r){mS(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=yield jr(e,a),c=new qr({...t,analyticsAction:r}),u=yield c.fetchFromAPI(s,{origin:"mainSearch"});return yield c.process(u)});return _au.apply(this,arguments)}m();d();f();p();var Lr=class{constructor(t,r=n=>{this.dispatch(zo({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x130,_x131){var _this30=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Os(yield _this30.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this30.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this31=this;return _asyncToGenerator(function*(){return _this31.processQueryErrorOrContinue(t)??(yield _this31.processQueryCorrectionsOrContinue(t))??(yield _this31.processQueryTriggersOrContinue(t))??_this31.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return dt(t.response)?(this.dispatch(Mr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this32=this;return _asyncToGenerator(function*(){let r=_this32.getState(),n=_this32.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!ie(c)&&!ie(c.correctedQuery);if(!u&&!h)return null;let S=u?yield _this32.processLegacyDidYouMeanAutoCorrection(t):_this32.processModernDidYouMeanAutoCorrection(t);return _this32.dispatch(Vt(Kt(_this32.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this33=this;return _asyncToGenerator(function*(){let r=_this33.getCurrentQuery(),n=_this33.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this33.automaticallyRetryQueryWithCorrection(o);return dt(i.response)?(_this33.dispatch(Mr(i.response.error)),_this33.rejectWithValue(i.response.error)):(_this33.dispatch(Vt(Kt(_this33.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this34=this;return _asyncToGenerator(function*(){let r=_this34.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this34.getState().triggers?.queryModification.queryToIgnore===n)return _this34.dispatch(ou("")),null;let i=_this34.getCurrentQuery(),a=yield _this34.automaticallyRetryQueryWithTriggerModification(n);return dt(a.response)?(_this34.dispatch(Mr(a.response.error)),_this34.rejectWithValue(a.response.error)):(_this34.dispatch(Vt(Kt(_this34.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Vt(Kt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return va(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this35=this;return _asyncToGenerator(function*(){_this35.onUpdateQueryForCorrection(t);let r=_this35.getState(),{actionCause:n}=sS(),o=yield _this35.fetchFromAPI(yield Ir(r,_this35.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this35.dispatch(tu(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this36=this;return _asyncToGenerator(function*(){return _this36.dispatch(iu({newQuery:t,originalQuery:_this36.getCurrentQuery()})),_this36.onUpdateQueryForCorrection(t),yield _this36.fetchFromAPI(yield Ir(_this36.getState(),_this36.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 cse=be("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;j(e,{q:new H,enableQuerySyntax:new ue,clearFilters:new ue}),e.clearFilters&&(r(Hc()),r(nS())),r(oS({allow:!0})),r(zo({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Ho(1))}),use=P("search/updateSearchAction"),su=be("search/executeSearch",/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return au(r,t,e.legacy);hS(r);let n=e.next?yS(e.next):void 0,o=yield Ir(r,t.extra.navigatorContext,n),i=new Lr({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x132,_x133){return _ref60.apply(this,arguments)}}()),gS=be("search/fetchPage",/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e,t){let r=t.getState();if(hS(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return bp(r,t,e.legacy);let n=new Lr({...t,analyticsAction:e.next}),o=yield Ir(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x134,_x135){return _ref61.apply(this,arguments)}}()),lse=be("search/fetchMoreResults",/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return xp(t,r);let n=Eg("browseResults",t.getState),o=new Lr({...t,analyticsAction:n}),i=yield Mk(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x136,_x137){return _ref62.apply(this,arguments)}}()),dse=be("search/fetchFacetValues",/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return au(r,t,e.legacy);let n=new Lr({...t,analyticsAction:{}}),o=yield qk(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x138,_x139){return _ref63.apply(this,arguments)}}()),pse=be("search/fetchInstantResults",/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ap(e,t);j(e,{id:X,q:X,maxResultsPerQuery:new te({required:!0,min:1}),cacheTimeout:new te});let{q:n,maxResultsPerQuery:o}=e,i=yS(aS()),a=yield jk(r,t.extra.navigatorContext,n,o,i),s=new Lr({...t,analyticsAction:i},h=>{t.dispatch(Wc({q:h,id:e.id}))}),c=yield s.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),u=yield s.process(c);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u});return function(_x140,_x141){return _ref64.apply(this,arguments)}}()),Mk=/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t,r){let n=yield Ir(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function Mk(_x142,_x143,_x144){return _ref65.apply(this,arguments)}}(),jk=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,t,r,n,o){let i=Ro(e,t,o);return Cr({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function jk(_x145,_x146,_x147,_x148,_x149){return _ref66.apply(this,arguments)}}(),qk=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=yield Ir(e,t,r);return n.request.numberOfResults=0,n});return function qk(_x150,_x151,_x152){return _ref67.apply(this,arguments)}}(),hS=e=>{e.configuration.analytics.enabled&&bt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},yS=e=>({actionCause:e.actionCause,type:e.actionCause});var vS=e=>{let t=mm({extra:e}),r=rS();return t.startListening({actionCreator:su.pending,effect:function(){var _ref68=_asyncToGenerator(function*(n,o){let i=o.getState();if(!Ml(i))return;r.abortRun(),o.dispatch(Vi()),o.dispatch(Ah());let a=tn(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x153,_x154){return _ref68.apply(this,arguments)}}()}),t};m();d();f();p();var SS=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},wS=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));m();d();f();p();var Cp=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};m();d();f();p();function AS(e,t){let r={...e},n,o=i=>(a,s)=>{let c=i(a,s);return n?n(c,s):c};return{get combinedReducer(){let i=af(Object.entries(t).filter(([a])=>!(a in r)).map(([a,s])=>[a,()=>s]));return o(Gn({...i,...r}))},containsAll(i){return Object.keys(i).every(s=>s in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}m();d();f();p();m();d();f();p();function Lk(e){if(!e||!Uk(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function bS(e,t=60){if(!e)return!1;let r=Lk(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Uk(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function CS(e,t){let r=0,n=null,o=da(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(c,u=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(S){if(!u)throw S;return null}})().finally(()=>{n=null}));let v=yield n;return h&&v&&c.dispatch(hr({accessToken:v})),v});return function i(_x155){return _ref69.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(c){let u=c.getState(),h=Gk(u);if(!(!h||!bS(h))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(c))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(v){e.warn(v,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x156){return _ref71.apply(this,arguments)}}(),s=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(c,u,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),xS(c,u.error),u;r++,o(),yield i(c,!0),c.dispatch(h)});return function s(_x157,_x158,_x159){return _ref72.apply(this,arguments)}}();return c=>u=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(h){let v=typeof h=="function",S=typeof t=="function";if(!v)return u(h);S&&(yield a(c));let g=yield u(h);return Vk(g)?S?yield s(c,g,h):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),xS(c,g.error),g):g});return function(_x160){return _ref73.apply(this,arguments)}}())}function Vk(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Vn().name}function xS(e,t){e.dispatch(Ga({status:401,statusCode:401,message:t.message,type:t.name}))}function Gk(e){return e.configuration.accessToken}m();d();f();p();function ES({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return em({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(wS(n.logger))})}function Bk(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&of()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function RS(e,t){let r={...e.reducers,configuration:Pt,version:uy},n=$k({...e,reducers:r},t,Pt),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(hr({accessToken:o,environment:i,organizationId:a}));let s=Bk(e.configuration,n.logger);return s&&n.dispatch(Jn(s)),n}function $k(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=AS({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,s={...t,get relay(){return Oi(u.state,o)},get navigatorContext(){return Cp(this.relay,o)}},c=Qk(e,s,i),u={addReducers(h){i.containsAll(h)||(i.add(h),c.replaceReducer(i.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(eo())},disableAnalytics(){c.dispatch(Zn())},get state(){return c.getState()},get relay(){return Oi(this.state,o)},get navigatorContext(){return Cp(this.relay,o)},logger:a,store:c};return u}function Qk(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=Hk(e,t.logger,()=>t.navigatorContext);return ES({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function Hk(e,t,r){let{renewAccessToken:n}=e.configuration,o=CS(t,n),i=vS({getNavigatorContext:r});return[vy,o,SS(t),dy].concat(Rd.middleware,wo.middleware,i.middleware,e.middlewares||[])}m();d();f();p();var DS=_t(FS(),1);function MS(e){return(0,DS.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}m();d();f();p();function jS(e,t){let r=l0(e),n=At,o=d0(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function l0(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function d0(e){return e.preprocessRequest||ma}m();d();f();p();m();d();f();p();var qS={organizationId:X,accessToken:X,name:new H({required:!1,emptyAllowed:!1}),analytics:new ee({options:{required:!1},values:{enabled:new ue({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function LS(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var US=new lt({...qS,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Xe,locale:Xe,timezone:Xe});function kp(){return{...LS(),searchHub:"default"}}var p0={debug:Va,pipeline:no,searchHub:yo,recommendation:go};function VS(e){let t=MS(e.loggerOptions);f0(e.configuration,t);let r=m0(e.configuration,t),n={...jS(e.configuration,t),apiClient:r},o={...e,reducers:p0},i=RS(o,n),{pipeline:a,searchHub:s,timezone:c,locale:u,proxyBaseUrl:h}=e.configuration;return i.dispatch(Ut({timezone:c,locale:u,proxyBaseUrl:h})),ie(a)||i.dispatch(to(a)),ie(s)||i.dispatch(ho(s)),{...i,get state(){return i.state}}}function f0(e,t){try{US.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function m0(e,t){return new ya({logger:t,preprocessRequest:e.preprocessRequest||ma,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||xf,postprocessFacetSearchResponseMiddleware:Cf,postprocessQuerySuggestResponseMiddleware:Ef})}m();d();f();p();m();d();f();p();m();d();f();p();var g0=new ge({each:X,required:!0}),GS=(e,t)=>(j(e,X),ua(t)?j(t,X):j(t,g0),{payload:{contextKey:e,contextValue:t}}),Nn=P("context/set",e=>{for(let[t,r]of Object.entries(e))GS(t,r);return{payload:e}}),Fn=P("context/add",e=>GS(e.contextKey,e.contextValue)),Dn=P("context/remove",e=>j(e,X));m();d();f();p();var lu=Me(ru(),e=>{e.addCase(Nn,(t,r)=>{t.contextValues=r.payload}).addCase(Fn,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Dn,(t,r)=>{delete t.contextValues[r.payload]}).addCase(mt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});m();d();f();p();function Vr(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),s=t!==a;return t=a,s}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),s;return n()&&(t=JSON.stringify(this.state),s=e.subscribe(()=>{o(this.state)&&r.forEach(c=>c())})),r.set(a,i),()=>{r.delete(a),n()&&s?.()}},get state(){return{}}}}m();d();f();p();var h0=["caseId","caseNumber"],y0={caseId:"caseContext",caseNumber:"caseContext"},na=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${y0[t]} to set this value.}`)}};function Op(e){return h0.includes(e)}var v0=new lt({values:new ee({options:{required:!1}})});function BS(e,t={}){if(!A0(e))throw Mt;let r=Vr(e),{dispatch:n}=e,o=()=>e.state,i=ym(e,v0,t.initialState,"buildContext");return i.values&&n(Nn(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Nn(a))},...(o().configuration.analytics.analyticsMode==="legacy"?S0(n):w0(n))}}var S0=e=>({add(t,r){e(Fn({contextKey:t,contextValue:r}))},remove(t){e(Dn(t))}}),w0=e=>({add(t,r){if(Op(t))throw new na(t);e(Fn({contextKey:t,contextValue:r}))},remove(t){if(Op(t))throw new na(t);e(Dn(t))}});function A0(e){return e.addReducers({context:lu}),!0}function $S(e,t){return BS(e,t)}m();d();f();p();m();d();f();p();var Ko=P("dictionaryFieldContext/set",e=>{let t=new ee({options:{required:!0}}),r=j(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ge({each:Je}),i=j(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Yo=P("dictionaryFieldContext/add",e=>{let t=new ee({options:{required:!0},values:{field:Je,key:Je}});return j(e,t)}),Xo=P("dictionaryFieldContext/remove",e=>j(e,Je));m();d();f();p();var du=Me(nu(),e=>{e.addCase(Ko,(t,r)=>{t.contextValues=r.payload}).addCase(Yo,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Xo,(t,r)=>{delete t.contextValues[r.payload]}).addCase(mt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function QS(e){if(!b0(e))throw Mt;let t=Vr(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Ko(o))},add(o,i){r(Yo({field:o,key:i}))},remove(o){r(Xo(o))}}}function b0(e){return e.addReducers({dictionaryFieldContext:du}),!0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var oa={value:X,numberOfResults:new te({min:0}),state:X};m();d();f();p();var Ie=X;var R0=new te({min:1,default:8,required:!1}),I0=new te({min:1,max:20,default:5,required:!1}),T0={desiredCount:I0,numberOfValues:R0},wde=P("automaticFacet/setOptions",e=>j(e,T0)),Ade=P("automaticFacet/deselectAll",e=>j(e,Ie)),_0=X,HS=P("automaticFacet/toggleSelectValue",e=>j(e,{field:_0,selection:new ee({values:oa})}));m();d();f();p();m();d();f();p();var k0={state:new Oe({required:!0}),numberOfResults:new te({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ge({required:!0,each:X}),moreValuesAvailable:new ue({required:!1})};function Pp(e){e.children.forEach(t=>{Pp(t)}),At({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},k0)}var Jo={facetId:Ie,field:X,tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),basePath:new ge({required:!1,each:X}),filterByBasePath:new ue({required:!1})};var Lde=P("categoryFacet/register",e=>j(e,Jo)),zS=P("categoryFacet/toggleSelectValue",e=>{try{return At(e.facetId,X),Pp(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:er(t)}}}),WS=P("categoryFacet/deselectAll",e=>j(e,Jo.facetId)),Ude=P("categoryFacet/updateNumberOfValues",e=>j(e,{facetId:Jo.facetId,numberOfValues:Jo.numberOfValues})),Vde=P("categoryFacet/updateSortCriterion",e=>j(e,{facetId:Jo.facetId,criterion:new Oe})),Gde=P("categoryFacet/updateBasePath",e=>j(e,{facetId:Jo.facetId,basePath:new ge({each:X})}));m();d();f();p();m();d();f();p();var ia={facetId:Ie,captions:new ee({options:{required:!1}}),numberOfValues:new te({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var O0={path:new ge({required:!0,each:X}),displayValue:Je,rawValue:Je,count:new te({required:!0,min:0})},KS=P("categoryFacet/selectSearchResult",e=>j(e,{facetId:Ie,value:new ee({values:O0})})),ape=P("categoryFacetSearch/register",e=>j(e,ia));m();d();f();p();var YS={facetId:Ie,value:new ee({values:{displayValue:Je,rawValue:Je,count:new te({required:!0,min:0})}})},ype=P("facetSearch/register",e=>j(e,ia)),vpe=P("facetSearch/update",e=>j(e,ia)),XS=P("facetSearch/toggleSelectValue",e=>j(e,YS)),JS=P("facetSearch/toggleExcludeValue",e=>j(e,YS));m();d();f();p();m();d();f();p();var Epe=new H({regex:/^[a-zA-Z0-9-_]+$/}),Rpe=new H({required:!0}),Ipe=new ge({each:new H}),Tpe=new H,_pe=new ue,kpe=new ue,Ope=new te({min:0}),P0=new te({min:1}),Ppe=new ue({required:!0}),N0=new ee,F0=new H,D0={captions:N0,numberOfValues:P0,query:F0},Npe=new ee({values:D0}),ZS=new ee({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ge({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),Fpe=new ue,ew=new ge({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var M0={facetId:Ie,field:new H({required:!0,emptyAllowed:!0}),tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),resultsMustMatch:new Oe({required:!1}),allowedValues:ZS,customSort:ew},Hpe=P("facet/register",e=>j(e,M0)),tw=P("facet/toggleSelectValue",e=>j(e,{facetId:Ie,selection:new ee({values:oa})})),rw=P("facet/toggleExcludeValue",e=>j(e,{facetId:Ie,selection:new ee({values:oa})})),pu=P("facet/deselectAll",e=>j(e,Ie)),zpe=P("facet/updateSortCriterion",e=>j(e,{facetId:Ie,criterion:new Oe({required:!0})})),Wpe=P("facet/updateNumberOfValues",e=>j(e,{facetId:Ie,numberOfValues:new te({required:!0,min:1})})),Kpe=P("facet/updateIsFieldExpanded",e=>j(e,{facetId:Ie,isFieldExpanded:new ue({required:!0})})),Ype=P("facet/updateFreezeCurrentValues",e=>j(e,{facetId:Ie,freezeCurrentValues:new ue({required:!0})}));m();d();f();p();m();d();f();p();function ow(e){let t=nw(e.start,e),r=nw(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function nw(e,t){let{dateFormat:r}=t;return Lh(e)?(hd(e),Mh(e)):typeof e=="string"&&xr(e)?(hd(e),e):(Ph(e,r),ks(Eo(e,r)))}m();d();f();p();var iw=P("rangeFacet/updateSortCriterion",e=>j(e,{facetId:Ie,criterion:new Oe({required:!0})}));m();d();f();p();var fu={state:X,start:new te({required:!0}),end:new te({required:!0}),endInclusive:new ue({required:!0}),numberOfResults:new te({required:!0,min:0})},mu={start:X,end:X,endInclusive:new ue({required:!0}),state:X,numberOfResults:new te({required:!0,min:0})};var j0={start:X,end:X,endInclusive:new ue({required:!0}),state:X},q0={facetId:Ie,field:X,tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ge({required:!1,each:new ee({values:j0})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),rangeAlgorithm:new Oe({required:!1})};function aw(e){return xr(e)?Li(e):e}function sw(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=ow(t);if(Eo(aw(r)).isAfter(Eo(aw(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Mfe=P("dateFacet/register",e=>{try{return At(e,q0),sw(e),{payload:e,error:null}}catch(t){return{payload:e,error:er(t)}}}),cw=P("dateFacet/toggleSelectValue",e=>j(e,{facetId:Ie,selection:new ee({values:mu})})),uw=P("dateFacet/toggleExcludeValue",e=>j(e,{facetId:Ie,selection:new ee({values:mu})})),lw=P("dateFacet/updateFacetValues",e=>{try{return At(e,{facetId:Ie,values:new ge({each:new ee({values:mu})})}),sw({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:er(t)}}});m();d();f();p();var L0={state:X,start:new te({required:!0}),end:new te({required:!0}),endInclusive:new ue({required:!0})},U0={facetId:Ie,field:X,tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ge({required:!1,each:new ee({values:L0})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),rangeAlgorithm:new Oe({required:!1})};function dw(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Kfe=P("numericFacet/register",e=>{try{return j(e,U0),dw(e),{payload:e,error:null}}catch(t){return{payload:e,error:er(t)}}}),pw=P("numericFacet/toggleSelectValue",e=>j(e,{facetId:Ie,selection:new ee({values:fu})})),fw=P("numericFacet/toggleExcludeValue",e=>j(e,{facetId:Ie,selection:new ee({values:fu})})),mw=P("numericFacet/updateFacetValues",e=>{try{return At(e,{facetId:Ie,values:new ge({each:new ee({values:fu})})}),dw({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:er(t)}}});var gw=Me(ta(),e=>{e.addCase(Yc,(t,r)=>{let n=Np(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=aa(n,o)}).addCase(Xc,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Fs,t=>{t.firstResult=0}).addCase(Jc,(t,r)=>{let n=r.payload;t.firstResult=aa(n,t.numberOfResults)}).addCase(Ho,(t,r)=>{let n=r.payload;t.firstResult=aa(n,t.numberOfResults)}).addCase(eu,t=>{let r=Np(t),n=Math.max(r-1,1);t.firstResult=aa(n,t.numberOfResults)}).addCase(Zc,t=>{let r=Np(t),n=G0(t),o=Math.min(r+1,n);t.firstResult=aa(o,t.numberOfResults)}).addCase(mt.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(yr,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(su.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(gS.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(pu,t=>{at(t)}).addCase(uw,t=>{at(t)}).addCase(rw,t=>{at(t)}).addCase(fw,t=>{at(t)}).addCase(JS,t=>{at(t)}).addCase(tw,t=>{at(t)}).addCase(WS,t=>{at(t)}).addCase(zS,t=>{at(t)}).addCase(KS,t=>{at(t)}).addCase(cw,t=>{at(t)}).addCase(pw,t=>{at(t)}).addCase(Hc,t=>{at(t)}).addCase(lw,t=>{at(t)}).addCase(mw,t=>{at(t)}).addCase(XS,t=>{at(t)}).addCase(HS,t=>{at(t)})});function at(e){e.firstResult=ta().firstResult}function Np(e){let{firstResult:t,numberOfResults:r}=e;return B0(t,r)}function G0(e){let{totalCountFiltered:t,numberOfResults:r}=e;return $0(t,r)}function aa(e,t){return(e-1)*t}function B0(e,t){return Math.round(e/t)+1}function $0(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Fp(e){return e.addReducers({pagination:gw}),{nextPage:Zc,previousPage:eu,registerNumberOfResults:Yc,registerPage:Jc,updateNumberOfResults:Xc,updatePage:Ho}}var Q0=new lt({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new te({min:0})});function hw(e,t={}){if(!H0(e))throw Mt;let r=Vr(e),{dispatch:n}=e,o=()=>e.state,i=vm(e,Q0,t.options,"buildRecommendationList");return i.id!==""&&n(mo({id:i.id})),i.numberOfRecommendations&&n(Fp(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(Ar())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function H0(e){return e.addReducers({recommendation:go,configuration:Pt}),!0}m();d();f();p();m();d();f();p();function yw(e,t,r){if(!z0(e))throw Mt;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:da(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function z0(e){return e.addReducers({configuration:Pt}),!0}function vw(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(ms(t.options.result)))};return yw(e,t,()=>{n()})}m();d();f();p();m();d();f();p();m();d();f();p();var Gr=()=>new H({required:!1,emptyAllowed:!0}),gu=P("advancedSearchQueries/update",e=>j(e,{aq:Gr(),cq:Gr(),lq:Gr(),dq:Gr()})),hu=P("advancedSearchQueries/register",e=>j(e,{aq:Gr(),cq:Gr(),lq:Gr(),dq:Gr()}));var Sw=Me(Dr(),e=>{e.addCase(gu,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;We(n)||(t.aq=n,t.aqWasSet=!0),We(o)||(t.cq=o,t.cqWasSet=!0),We(i)||(t.lq=i,t.lqWasSet=!0),We(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(hu,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;We(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),We(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),We(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),We(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(mt.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(yr,(t,r)=>{let{aq:n,cq:o}=r.payload;We(n)||(t.aq=n,t.aqWasSet=!0),We(o)||(t.cq=o,t.cqWasSet=!0)})});function W0(e){return e.addReducers({advancedSearchQueries:Sw}),{updateAdvancedSearchQueries:gu,registerAdvancedSearchQueries:hu}}m();d();f();p();function K0(e){return e.addReducers({configuration:Pt}),{disableAnalytics:Zn,enableAnalytics:eo,setOriginLevel2:Ma,setOriginLevel3:ja,updateAnalyticsConfiguration:Jn,updateBasicConfiguration:hr}}m();d();f();p();function Y0(e){return e.addReducers({configuration:Pt,pipeline:no,searchHub:yo}),{updateSearchConfiguration:Ut}}m();d();f();p();function X0(e){return e.addReducers({context:lu}),{addContext:Fn,removeContext:Dn,setContext:Nn}}m();d();f();p();function J0(e){return e.addReducers({debug:Va}),{disableDebug:La,enableDebug:qa}}m();d();f();p();function Z0(e){return e.addReducers({dictionaryFieldContext:du}),{addContext:Yo,removeContext:Xo,setContext:Ko}}m();d();f();p();m();d();f();p();m();d();f();p();var eO={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new te({min:0,required:!1})},ww=P("folding/register",e=>j(e,eO)),vhe=be("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Rr(i):Ro(i,o),s=yield n.search({...a,q:tO(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return dt(s)?r(s.error):{collectionId:e,results:s.success.results,searchUid:s.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x161,_x162){return _ref74.apply(this,arguments)}}());function tO(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}m();d();f();p();var Aw=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});m();d();f();p();var Zo=P("fields/registerFieldsToInclude",e=>j(e,Da)),yu=P("fields/fetchall/enable"),vu=P("fields/fetchall/disable"),Su=be("fields/fetchDescription",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:s}=o.configuration,{apiBaseUrl:c}=o.configuration.search,u=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:s,url:c??pr(s,a)});return dt(u)?n(u.error):u.success.fields});return function(_x163,_x164){return _ref75.apply(this,arguments)}}());m();d();f();p();var wu=["author","language","urihash","objecttype","collection","source","permanentid"],Dp=[...wu,"date","filetype","parents"],bw=[...Dp,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],xw=()=>({fieldsToInclude:wu,fetchAllFields:!1,fieldsDescription:[]});var Au=Me(xw(),e=>e.addCase(Zo,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(yu,t=>{t.fetchAllFields=!0}).addCase(vu,t=>{t.fetchAllFields=!1}).addCase(Su.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(ww,(t,{payload:r})=>{let n=Aw().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function rO(e){return e.addReducers({fields:Au}),{registerFieldsToInclude:Zo,enableFetchAllFields:yu,disableFetchAllFields:vu,fetchFieldsDescription:Su}}m();d();f();p();function nO(e){return e.addReducers({pipeline:no}),{setPipeline:to}}m();d();f();p();function oO(e){return e.addReducers({recommendation:go}),{getRecommendations:Ar,setRecommendationId:mo}}m();d();f();p();function iO(e){return e.addReducers({}),{logRecommendationOpen:ms}}m();d();f();p();m();d();f();p();var aO=new lt({content:new Oe({required:!0}),conditions:new Oe({required:!0}),priority:new te({required:!1,default:0,min:0}),fields:new ge({required:!1,each:X})});function Cw(){let e=[],t=r=>{let n=aO.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new si("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function Ew(e){if(!sO(e))throw Mt;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Cw();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Zo(i))},selectTemplate:r,selectLinkTemplate:n}}function sO(e){return e.addReducers({fields:Au}),!0}m();d();f();p();function cO(e){return e.addReducers({searchHub:yo}),{setSearchHub:ho}}/**
32
42
  * @license
33
43
  *
34
44
  * Copyright 2026 Coveo Solutions Inc.
@@ -44,6 +54,21 @@ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":C
44
54
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
55
  * See the License for the specific language governing permissions and
46
56
  * limitations under the License.
47
- */if(__exports!=exports)module.exports=exports;return module.exports});
57
+ *//*! Bundled license information:
48
58
 
49
- window.coveoQuanticVersion = '3.36.4';
59
+ fast-json-patch/module/helpers.mjs:
60
+ (*!
61
+ * https://github.com/Starcounter-Jack/JSON-Patch
62
+ * (c) 2017-2022 Joachim Wester
63
+ * MIT licensed
64
+ *)
65
+
66
+ fast-json-patch/module/duplex.mjs:
67
+ (*!
68
+ * https://github.com/Starcounter-Jack/JSON-Patch
69
+ * (c) 2017-2021 Joachim Wester
70
+ * MIT license
71
+ *)
72
+ */if(__exports!=exports)module.exports=exports;return module.exports});
73
+
74
+ window.coveoQuanticVersion = '3.36.6';