@coveo/quantic 3.10.0-pre.66d7ea8e73 → 3.10.0-pre.bf32ecec58

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.
@@ -21,7 +21,7 @@ function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var inf
21
21
  `)}
22
22
 
23
23
  ${t}
24
- `;return new Oi(r)}var Oi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let i in this.definition){let o=this.definition[i].validate(r[i]);o&&n.push(`${i}: ${o}`)}if(n.length)throw Dd(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}},At=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&z(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 qt(e){return e===void 0}function Md(e){return e===null}function z(e){return qt(e)||Md(e)}var me=class{constructor(e={}){re(this,"value");this.config=e,this.value=new At(e)}validate(e){let t=this.value.validate(e);return t||(qd(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 qd(e){return qt(e)||_s(e)}function _s(e){return typeof e=="number"&&!isNaN(e)}var ne=class{constructor(e={}){re(this,"value");this.value=new At(e)}validate(e){let t=this.value.validate(e);return t||(Nd(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Nd(e){return qt(e)||Ls(e)}function Ls(e){return typeof e=="boolean"}var _d=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){re(this,"value");re(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new At(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:o}=this.config,s=this.value.validate(e);if(s)return s;if(qt(e))return null;if(!js(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:o&&!(_d.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 js(e){return Object.prototype.toString.call(e)==="[object String]"}var te=class{constructor(e={}){re(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(qt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Us(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&z(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],o=n.validate(i);o!==null&&(t+=" "+o)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Us(e){return e!==void 0&&typeof e=="object"}var ze=class{constructor(e={}){re(this,"value");this.config=e,this.value=new At(this.config)}validate(e){if(!z(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(z(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&&z(n)&&(r=`value is null or undefined: ${e.join(",")}`);let i=this.validatePrimitiveValue(n,this.config.each);i!==null&&(r+=" "+i)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ls(e)||js(e)||_s(e)||Us(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Vs(e){return Array.isArray(e)}var Fi=class{constructor(e){re(this,"value");this.config=e,this.value=new At(e)}validate(e){let t=this.value.validate(e);return t!==null?t:qt(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();f();p();var $r=e=>e;d();f();p();d();f();p();var na=Ie(Ys(),1);d();f();p();d();f();p();var Ee=new Error("Failed to load reducers."),Nt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var wt=class extends Error{constructor(r,n){super();re(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();f();p();function Ks(e){return Array.isArray(e)}function Js(e,t){return[...e.reduce((r,n)=>{let i=t(n);return r.has(i)||r.set(i,n),r},new Map).values()]}var up=new Set(["1",1,"yes",!0]);function Xs(){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=>up.has(r))}function Zs(e){let t={};for(let[r,n]of e)t[r]=n;return t}function fr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}d();f();p();function ea(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}function ta(e){return typeof e!="object"||!e?!1:Object.values(e).every(lp)}function lp(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ra(e){return e===429}var nt=class e{static call(t){return _asyncToGenerator(function*(){let r=dp(t),{logger:n}=t,i=yield e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:o,...s}=i,c=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let g=yield R(o,s);if(ra(g.status))throw g;return g});return function c(){return _ref.apply(this,arguments)}}();try{let g=yield(0,na.backOff)(c,{retry:a=>{let m=a&&ra(a.status);return m&&n.info("Platform retrying request"),m}});switch(g.status){case 419:case 401:throw n.info("Platform renewing token"),new Nt;case 404:throw new wt(o,g.status);default:return n.info({response:g,requestInfo:i},"Platform response"),g}}catch(g){return g.message==="Failed to fetch"?new wt(o):g}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:i,logger:o,requestMetadata:s}=r,{signal:c,...g}=t,a=fr(g);try{let m=yield i(t,n,s);return{...t,...m}}catch(m){o.error(m,"Platform request preprocessing failed. Returning default request options.")}return a})()}};function oe(e,t="prod",r="platform"){let n=t==="prod"?"":t,i=r==="platform"?"":`.${r}`;return`https://${e}${i}.org${n}.coveo.com`}function _t(e,t="prod"){return`${oe(e,t)}/rest/search/v2`}function zr(e,t="prod"){return`${oe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function dp(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:o,signal:s}=e,c=e.method==="POST"||e.method==="PUT",g=pp(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${o}`,...e.headers},...(c&&{body:g}),signal:s}}function pp(e,t){return t==="application/x-www-form-urlencoded"?ta(e)?ea(e):"":JSON.stringify(e)}d();f();p();d();f();p();var Lt=class{constructor(t){re(this,"_basePath");re(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();f();p();function Ui(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...o}=e;return o}var Vi=e=>{let{response:t}=e;return t.body?fp(e):gp(t)},fp=e=>hp(e)?yp(e):mp(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},gp=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function mp(e){return e.body.statusCode!==void 0}function hp(e){return e.body.exception!==void 0}var yp=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();f();p();function ia(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();f();p();var Bi=(e,t,r,n)=>{let i=new Lt(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};var oa=(e,t)=>{let r=new Lt(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},Qi=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield nt.call({...Bi(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ui(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ia(r),i=yield r.arrayBuffer(),s=new TextDecoder(n).decode(i);return Sp(s)?{success:s}:{error:Vi({response:r,body:s})}});return function Qi(_x,_x2){return _ref2.apply(this,arguments)}}();function Sp(e){return typeof e=="string"}d();f();p();function vp(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Cp(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Gr(e,t){if(t&&e.name==="AbortError")return{error:Cp(e)};if(e instanceof wt)return{error:vp(e)};throw e}d();f();p();d();f();p();var Wr=(e,t,r,n,i={})=>{Ap(e);let o=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=bp(i),c=s?`${o}?${s}`:o;return{accessToken:e.accessToken,method:t,contentType:r,url:c,origin:"caseAssistApiFetch"}},Yr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r]}),{}),Kr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r].value}),{}),Ap=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},bp=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var sa=e=>{let t=e.debug?{debug:"1"}:{};return{...Wr(e,"POST","application/json","/classify",t),requestParams:wp(e)}},wp=e=>({clientId:e.clientId,locale:e.locale,fields:Yr(e.fields)});d();f();p();var aa=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...Wr(e,"POST","application/json","/documents/suggest",t),requestParams:Rp(e)}},Rp=e=>({clientId:e.clientId,locale:e.locale,fields:Yr(e.fields),context:e.context});var Jr=class{constructor(t){this.options=t}getCaseClassifications(t){var _this=this;return _asyncToGenerator(function*(){let r=yield nt.call({...sa(t),..._this.options});if(r instanceof Error)return Gr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}getDocumentSuggestions(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield nt.call({...aa(t),..._this2.options});if(r instanceof Error)return Gr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this3=this;return _asyncToGenerator(function*(){return Qi(t,_this3.options)})()}};d();f();p();d();f();p();d();f();p();function le(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 xp=typeof Symbol=="function"&&Symbol.observable||"@@observable",ca=xp,$i=()=>Math.random().toString(36).substring(7).split("").join("."),Ip={INIT:`@@redux/INIT${$i()}`,REPLACE:`@@redux/REPLACE${$i()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$i()}`},Xr=Ip;function Ne(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 Hi(e,t,r){if(typeof e!="function")throw new Error(le(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(le(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(le(1));return r(Hi)(e,t)}let n=e,i=t,o=new Map,s=o,c=0,g=!1;function a(){s===o&&(s=new Map,o.forEach((x,I)=>{s.set(I,x)}))}function m(){if(g)throw new Error(le(3));return i}function y(x){if(typeof x!="function")throw new Error(le(4));if(g)throw new Error(le(5));let I=!0;a();let v=c++;return s.set(v,x),function(){if(I){if(g)throw new Error(le(6));I=!1,a(),s.delete(v),o=null}}}function h(x){if(!Ne(x))throw new Error(le(7));if(typeof x.type>"u")throw new Error(le(8));if(typeof x.type!="string")throw new Error(le(17));if(g)throw new Error(le(9));try{g=!0,i=n(i,x)}finally{g=!1}return(o=s).forEach(v=>{v()}),x}function u(x){if(typeof x!="function")throw new Error(le(10));n=x,h({type:Xr.REPLACE})}function S(){let x=y;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(le(11));function v(){let A=I;A.next&&A.next(m())}return v(),{unsubscribe:x(v)}},[ca](){return this}}}return h({type:Xr.INIT}),{dispatch:h,subscribe:y,getState:m,replaceReducer:u,[ca]:S}}function Ep(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Xr.INIT})>"u")throw new Error(le(12));if(typeof r(void 0,{type:Xr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(le(13))})}function jt(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let c=t[s];typeof e[c]=="function"&&(r[c]=e[c])}let n=Object.keys(r),i,o;try{Ep(r)}catch(s){o=s}return function(c={},g){if(o)throw o;let a=!1,m={};for(let y=0;y<n.length;y++){let h=n[y],u=r[h],S=c[h],w=u(S,g);if(typeof w>"u"){let x=g&&g.type;throw new Error(le(14))}m[h]=w,a=a||w!==S}return a=a||n.length!==Object.keys(c).length,a?m:c}}function Ut(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ua(...e){return t=>(r,n)=>{let i=t(r,n),o=()=>{throw new Error(le(15))},s={getState:i.getState,dispatch:(g,...a)=>o(g,...a)},c=e.map(g=>g(s));return o=Ut(...c)(i.dispatch),{...i,dispatch:o}}}function Zr(e){return Ne(e)&&"type"in e&&typeof e.type=="string"}d();f();p();var to=Symbol.for("immer-nothing"),gr=Symbol.for("immer-draftable"),he=Symbol.for("immer-state");function de(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xt=Object.getPrototypeOf;function Ae(e){return!!e&&!!e[he]}function ye(e){return e?ga(e)||Array.isArray(e)||!!e[gr]||!!e.constructor?.[gr]||vr(e)||Cr(e):!1}var kp=Object.prototype.constructor.toString();function ga(e){if(!e||typeof e!="object")return!1;let t=xt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===kp}function ro(e){return Ae(e)||de(15,e),e[he].base_}function mr(e,t){It(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function It(e){let t=e[he];return t?t.type_:Array.isArray(e)?1:vr(e)?2:Cr(e)?3:0}function hr(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zi(e,t){return It(e)===2?e.get(t):e[t]}function ma(e,t,r){let n=It(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Pp(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vr(e){return e instanceof Map}function Cr(e){return e instanceof Set}function Rt(e){return e.copy_||e.base_}function Yi(e,t){if(vr(e))return new Map(e);if(Cr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=ga(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[he];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){let s=i[o],c=n[s];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[s]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[s]})}return Object.create(xt(e),n)}else{let n=xt(e);if(n!==null&&r)return{...e};let i=Object.create(n);return Object.assign(i,e)}}function rn(e,t=!1){return nn(e)||Ae(e)||!ye(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Op),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>rn(n,!0))),e}function Op(){de(2)}function nn(e){return Object.isFrozen(e)}var Ki={};function Et(e){let t=Ki[e];return t||de(0,e),t}function Fp(e,t){Ki[e]||(Ki[e]=t)}var yr;function ha(){return yr}function Tp(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function la(e,t){t&&(Et("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ji(e){Xi(e),e.drafts_.forEach(Dp),e.drafts_=null}function Xi(e){e===yr&&(yr=e.parent_)}function da(e){return yr=Tp(yr,e)}function Dp(e){let t=e[he];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function pa(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[he].modified_&&(Ji(t),de(4)),ye(e)&&(e=en(t,e),t.parent_||tn(t,e)),t.patches_&&Et("Patches").generateReplacementPatches_(r[he].base_,e,t.patches_,t.inversePatches_)):e=en(t,r,[]),Ji(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==to?e:void 0}function en(e,t,r){if(nn(t))return t;let n=t[he];if(!n)return mr(t,(i,o)=>fa(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return tn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let i=n.copy_,o=i,s=!1;n.type_===3&&(o=new Set(i),i.clear(),s=!0),mr(o,(c,g)=>fa(e,n,i,c,g,r,s)),tn(e,i,!1),r&&e.patches_&&Et("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function fa(e,t,r,n,i,o,s){if(Ae(i)){let c=o&&t&&t.type_!==3&&!hr(t.assigned_,n)?o.concat(n):void 0,g=en(e,i,c);if(ma(r,n,g),Ae(g))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(ye(i)&&!nn(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;en(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&tn(e,i)}}function tn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rn(t,r)}function Mp(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ha(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=no;r&&(i=[n],o=Sr);let{revoke:s,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=s,c}var no={get(e,t){if(t===he)return e;let r=Rt(e);if(!hr(r,t))return qp(e,r,t);let n=r[t];return e.finalized_||!ye(n)?n:n===Gi(e.base_,t)?(Wi(e),e.copy_[t]=eo(n,e)):n},has(e,t){return t in Rt(e)},ownKeys(e){return Reflect.ownKeys(Rt(e))},set(e,t,r){let n=ya(Rt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let i=Gi(Rt(e),t),o=i?.[he];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Pp(r,i)&&(r!==void 0||hr(e.base_,t)))return!0;Wi(e),Zi(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 Gi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Wi(e),Zi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Rt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){de(11)},getPrototypeOf(e){return xt(e.base_)},setPrototypeOf(){de(12)}},Sr={};mr(no,(e,t)=>{Sr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Sr.deleteProperty=function(e,t){return Sr.set.call(this,e,t,void 0)};Sr.set=function(e,t,r){return no.set.call(this,e[0],t,r,e[0])};function Gi(e,t){let r=e[he];return(r?Rt(r):e)[t]}function qp(e,t,r){let n=ya(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function ya(e,t){if(!(t in e))return;let r=xt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=xt(r)}}function Zi(e){e.modified_||(e.modified_=!0,e.parent_&&Zi(e.parent_))}function Wi(e){e.copy_||(e.copy_=Yi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Np=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let s=this;return function(g=o,...a){return s.produce(g,m=>r.call(this,m,...a))}}typeof r!="function"&&de(6),n!==void 0&&typeof n!="function"&&de(7);let i;if(ye(t)){let o=da(this),s=eo(t,void 0),c=!0;try{i=r(s),c=!1}finally{c?Ji(o):Xi(o)}return la(o,n),pa(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===to&&(i=void 0),this.autoFreeze_&&rn(i,!0),n){let o=[],s=[];Et("Patches").generateReplacementPatches_(t,i,o,s),n(o,s)}return i}else de(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...c)=>this.produceWithPatches(s,g=>t(g,...c));let n,i;return[this.produce(t,r,(s,c)=>{n=s,i=c}),n,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ye(e)||de(8),Ae(e)&&(e=Sa(e));let t=da(this),r=eo(e,void 0);return r[he].isManual_=!0,Xi(t),r}finishDraft(e,t){let r=e&&e[he];(!r||!r.isManual_)&&de(9);let{scope_:n}=r;return la(n,t),pa(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let n=Et("Patches").applyPatches_;return Ae(e)?n(e,t):this.produce(e,i=>n(i,t))}};function eo(e,t){let r=vr(e)?Et("MapSet").proxyMap_(e,t):Cr(e)?Et("MapSet").proxySet_(e,t):Mp(e,t);return(t?t.scope_:ha()).drafts_.push(r),r}function Sa(e){return Ae(e)||de(10,e),va(e)}function va(e){if(!ye(e)||nn(e))return e;let t=e[he],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Yi(e,!0);return mr(r,(n,i)=>{ma(r,n,va(i))}),t&&(t.finalized_=!1),r}function Ca(){let t="replace",r="add",n="remove";function i(h,u,S,w){switch(h.type_){case 0:case 2:return s(h,u,S,w);case 1:return o(h,u,S,w);case 3:return c(h,u,S,w)}}function o(h,u,S,w){let{base_:x,assigned_:I}=h,v=h.copy_;v.length<x.length&&([x,v]=[v,x],[S,w]=[w,S]);for(let C=0;C<x.length;C++)if(I[C]&&v[C]!==x[C]){let A=u.concat([C]);S.push({op:t,path:A,value:y(v[C])}),w.push({op:t,path:A,value:y(x[C])})}for(let C=x.length;C<v.length;C++){let A=u.concat([C]);S.push({op:r,path:A,value:y(v[C])})}for(let C=v.length-1;x.length<=C;--C){let A=u.concat([C]);w.push({op:n,path:A})}}function s(h,u,S,w){let{base_:x,copy_:I}=h;mr(h.assigned_,(v,C)=>{let A=zi(x,v),E=zi(I,v),O=C?hr(x,v)?t:r:n;if(A===E&&O===t)return;let k=u.concat(v);S.push(O===n?{op:O,path:k}:{op:O,path:k,value:E}),w.push(O===r?{op:n,path:k}:O===n?{op:r,path:k,value:y(A)}:{op:t,path:k,value:y(A)})})}function c(h,u,S,w){let{base_:x,copy_:I}=h,v=0;x.forEach(C=>{if(!I.has(C)){let A=u.concat([v]);S.push({op:n,path:A,value:C}),w.unshift({op:r,path:A,value:C})}v++}),v=0,I.forEach(C=>{if(!x.has(C)){let A=u.concat([v]);S.push({op:r,path:A,value:C}),w.unshift({op:n,path:A,value:C})}v++})}function g(h,u,S,w){S.push({op:t,path:[],value:u===to?void 0:u}),w.push({op:t,path:[],value:h})}function a(h,u){return u.forEach(S=>{let{path:w,op:x}=S,I=h;for(let E=0;E<w.length-1;E++){let O=It(I),k=w[E];typeof k!="string"&&typeof k!="number"&&(k=""+k),(O===0||O===1)&&(k==="__proto__"||k==="constructor")&&de(19),typeof I=="function"&&k==="prototype"&&de(19),I=zi(I,k),typeof I!="object"&&de(18,w.join("/"))}let v=It(I),C=m(S.value),A=w[w.length-1];switch(x){case t:switch(v){case 2:return I.set(A,C);case 3:de(16);default:return I[A]=C}case r:switch(v){case 1:return A==="-"?I.push(C):I.splice(A,0,C);case 2:return I.set(A,C);case 3:return I.add(C);default:return I[A]=C}case n:switch(v){case 1:return I.splice(A,1);case 2:return I.delete(A);case 3:return I.delete(S.value);default:return delete I[A]}default:de(17,x)}}),h}function m(h){if(!ye(h))return h;if(Array.isArray(h))return h.map(m);if(vr(h))return new Map(Array.from(h.entries()).map(([S,w])=>[S,m(w)]));if(Cr(h))return new Set(Array.from(h).map(m));let u=Object.create(xt(h));for(let S in h)u[S]=m(h[S]);return hr(h,gr)&&(u[gr]=h[gr]),u}function y(h){return Ae(h)?m(h):h}Fp("Patches",{applyPatches_:a,generatePatches_:i,generateReplacementPatches_:g})}var be=new Np,We=be.produce,on=be.produceWithPatches.bind(be),dA=be.setAutoFreeze.bind(be),pA=be.setUseStrictShallowCopy.bind(be),io=be.applyPatches.bind(be),fA=be.createDraft.bind(be),gA=be.finishDraft.bind(be);d();f();p();function _p(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Lp(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function jp(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 Aa=e=>Array.isArray(e)?e:[e];function Up(e){let t=Array.isArray(e[0])?e[0]:e;return jp(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Vp(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var CA=Symbol();var AA=Object.getPrototypeOf({});var Bp=class{constructor(e){this.value=e}deref(){return this.value}},Qp=typeof WeakRef<"u"?WeakRef:Bp,$p=0,ba=1;function sn(){return{s:$p,v:void 0,o:null,p:null}}function Vt(e,t={}){let r=sn(),{resultEqualityCheck:n}=t,i,o=0;function s(){let c=r,{length:g}=arguments;for(let y=0,h=g;y<h;y++){let u=arguments[y];if(typeof u=="function"||typeof u=="object"&&u!==null){let S=c.o;S===null&&(c.o=S=new WeakMap);let w=S.get(u);w===void 0?(c=sn(),S.set(u,c)):c=w}else{let S=c.p;S===null&&(c.p=S=new Map);let w=S.get(u);w===void 0?(c=sn(),S.set(u,c)):c=w}}let a=c,m;if(c.s===ba)m=c.v;else if(m=e.apply(null,arguments),o++,n){let y=i?.deref?.()??i;y!=null&&n(y,m)&&(m=y,o!==0&&o--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Qp(m):m}return a.s=ba,a.v=m,m}return s.clearCache=()=>{r=sn(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function wa(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,s=0,c,g={},a=i.pop();typeof a=="object"&&(g=a,a=i.pop()),_p(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let m={...r,...g},{memoize:y,memoizeOptions:h=[],argsMemoize:u=Vt,argsMemoizeOptions:S=[],devModeChecks:w={}}=m,x=Aa(h),I=Aa(S),v=Up(i),C=y(function(){return o++,a.apply(null,arguments)},...x),A=!0,E=u(function(){s++;let k=Vp(v,arguments);return c=C.apply(null,k),c},...I);return Object.assign(E,{resultFunc:a,memoizedResultFunc:C,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:y,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var se=wa(Vt),Hp=Object.assign((e,t=se)=>{Lp(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((s,c,g)=>(s[r[g]]=c,s),{}))},{withTypes:()=>Hp});d();f();p();function Ra(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var xa=Ra(),Ia=Ra;var zp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ut:Ut.apply(null,arguments)},_A=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Gp=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(we(0));return{type:e,payload:i.payload,...("meta"in i&&{meta:i.meta}),...("error"in i&&{error:i.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Zr(n)&&n.type===e,r}var Oa=class Ar extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ar.prototype)}static get[Symbol.species](){return Ar}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ar(...t[0].concat(this)):new Ar(...t.concat(this))}};function Ea(e){return ye(e)?We(e,()=>{}):e}function ka(e,t,r){if(e.has(t)){let i=e.get(t);return r.update&&(i=r.update(i,t,e),e.set(t,i)),i}if(!r.insert)throw new Error(we(10));let n=r.insert(t,e);return e.set(t,n),n}function Wp(e){return typeof e=="boolean"}var Yp=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{},s=new Oa;return r&&(Wp(r)?s.push(xa):s.push(Ia(r.extraArgument))),s},Pt="RTK_autoBatch",Qt=()=>e=>({payload:e,meta:{[Pt]:!0}}),Fa=e=>t=>{setTimeout(t,e)},Kp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Fa(10),Jp=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,o=!1,s=!1,c=new Set,g=e.type==="tick"?queueMicrotask:e.type==="raf"?Kp:e.type==="callback"?e.queueNotification:Fa(e.timeout),a=()=>{s=!1,o&&(o=!1,c.forEach(m=>m()))};return Object.assign({},n,{subscribe(m){let y=()=>i&&m(),h=n.subscribe(y);return c.add(m),()=>{h(),c.delete(m)}},dispatch(m){try{return i=!m?.meta?.[Pt],o=!i,o&&(s||(s=!0,g(a))),n.dispatch(m)}finally{i=!0}}})},Xp=e=>function(r){let{autoBatch:n=!0}=r??{},i=new Oa(e);return n&&i.push(Jp(typeof n=="object"?n:void 0)),i};function Ta(e){let t=Yp(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Ne(r))c=jt(r);else throw new Error(we(1));let g;typeof n=="function"?g=n(t):g=t();let a=Ut;i&&(a=zp({trace:!1,...(typeof i=="object"&&i)}));let m=ua(...g),y=Xp(m),h=typeof s=="function"?s(y):y(),u=a(...h);return Hi(c,o,u)}function Da(e){let t={},r=[],n,i={addCase(o,s){let c=typeof o=="string"?o:o.type;if(!c)throw new Error(we(28));if(c in t)throw new Error(we(29));return t[c]=s,i},addMatcher(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function Zp(e){return typeof e=="function"}function ae(e,t){let[r,n,i]=Da(t),o;if(Zp(e))o=()=>Ea(e());else{let c=Ea(e);o=()=>c}function s(c=o(),g){let a=[r[g.type],...n.filter(({matcher:m})=>m(g)).map(({reducer:m})=>m)];return a.filter(m=>!!m).length===0&&(a=[i]),a.reduce((m,y)=>{if(y)if(Ae(m)){let u=y(m,g);return u===void 0?m:u}else{if(ye(m))return We(m,h=>y(h,g));{let h=y(m,g);if(h===void 0){if(m===null)return m;throw new Error(we(9))}return h}}return m},c)}return s.getInitialState=o,s}var Ma=(e,t)=>Gp(e)?e.match(t):e(t);function _e(...e){return t=>e.some(r=>Ma(r,t))}function Bt(...e){return t=>e.every(r=>Ma(r,t))}function cn(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 br(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function un(...e){return e.length===0?t=>cn(t,["pending"]):br(e)?_e(...e.map(t=>t.pending)):un()(e[0])}function kt(...e){return e.length===0?t=>cn(t,["rejected"]):br(e)?_e(...e.map(t=>t.rejected)):kt()(e[0])}function wr(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Bt(kt(...e),t):br(e)?Bt(kt(...e),t):wr()(e[0])}function Ye(...e){return e.length===0?t=>cn(t,["fulfilled"]):br(e)?_e(...e.map(t=>t.fulfilled)):Ye()(e[0])}function ln(...e){return e.length===0?t=>cn(t,["pending","fulfilled","rejected"]):br(e)?_e(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ln()(e[0])}var ef="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",so=(e=21)=>{let t="",r=e;for(;r--;)t+=ef[Math.random()*64|0];return t},tf=["name","message","stack","code"],oo=class{constructor(e,t){re(this,"_type");this.payload=e,this.meta=t}},Pa=class{constructor(e,t){re(this,"_type");this.payload=e,this.meta=t}},rf=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of tf)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Z=(()=>{function e(t,r,n){let i=N(t+"/fulfilled",(g,a,m,y)=>({payload:g,meta:{...(y||{}),arg:m,requestId:a,requestStatus:"fulfilled"}})),o=N(t+"/pending",(g,a,m)=>({payload:void 0,meta:{...(m||{}),arg:a,requestId:g,requestStatus:"pending"}})),s=N(t+"/rejected",(g,a,m,y,h)=>({payload:y,error:(n&&n.serializeError||rf)(g||"Rejected"),meta:{...(h||{}),arg:m,requestId:a,rejectedWithValue:!!y,requestStatus:"rejected",aborted:g?.name==="AbortError",condition:g?.name==="ConditionError"}}));function c(g){return(a,m,y)=>{let h=n?.idGenerator?n.idGenerator(g):so(),u=new l.AbortController,S,w;function x(v){w=v,u.abort()}let I=_asyncToGenerator(function*(){let v;try{let A=n?.condition?.(g,{getState:m,extra:y});if(of(A)&&(A=yield A),A===!1||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let E=new Promise((O,k)=>{S=()=>{k({name:"AbortError",message:w||"Aborted"})},u.signal.addEventListener("abort",S)});a(o(h,g,n?.getPendingMeta?.({requestId:h,arg:g},{getState:m,extra:y}))),v=yield Promise.race([E,Promise.resolve(r(g,{dispatch:a,getState:m,extra:y,requestId:h,signal:u.signal,abort:x,rejectWithValue:(O,k)=>new oo(O,k),fulfillWithValue:(O,k)=>new Pa(O,k)})).then(O=>{if(O instanceof oo)throw O;return O instanceof Pa?i(O.payload,h,g,O.meta):i(O,h,g)})])}catch(A){v=A instanceof oo?s(null,h,g,A.payload,A.meta):s(A,h,g)}finally{S&&u.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&s.match(v)&&v.meta.condition||a(v),v})();return Object.assign(I,{abort:x,requestId:h,arg:g,unwrap(){return I.then(nf)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,settled:_e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function nf(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function of(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var qa=Symbol.for("rtk-slice-createasyncthunk"),BA={[qa]:Z};function sf(e,t){return`${e}/${t}`}function af({creators:e}={}){let t=e?.asyncThunk?.[qa];return function(n){let{name:i,reducerPath:o=i}=n;if(!i)throw new Error(we(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(uf()):n.reducers)||{},c=Object.keys(s),g={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(v,C){let A=typeof v=="string"?v:v.type;if(!A)throw new Error(we(12));if(A in g.sliceCaseReducersByType)throw new Error(we(13));return g.sliceCaseReducersByType[A]=C,a},addMatcher(v,C){return g.sliceMatchers.push({matcher:v,reducer:C}),a},exposeAction(v,C){return g.actionCreators[v]=C,a},exposeCaseReducer(v,C){return g.sliceCaseReducersByName[v]=C,a}};c.forEach(v=>{let C=s[v],A={reducerName:v,type:sf(i,v),createNotation:typeof n.reducers=="function"};df(C)?ff(A,C,a,t):lf(A,C,a)});function m(){let[v={},C=[],A=void 0]=typeof n.extraReducers=="function"?Da(n.extraReducers):[n.extraReducers],E={...v,...g.sliceCaseReducersByType};return ae(n.initialState,O=>{for(let k in E)O.addCase(k,E[k]);for(let k of g.sliceMatchers)O.addMatcher(k.matcher,k.reducer);for(let k of C)O.addMatcher(k.matcher,k.reducer);A&&O.addDefaultCase(A)})}let y=v=>v,h=new Map,u;function S(v,C){return u||(u=m()),u(v,C)}function w(){return u||(u=m()),u.getInitialState()}function x(v,C=!1){function A(O){let k=O[v];return typeof k>"u"&&C&&(k=w()),k}function E(O=y){let k=ka(h,C,{insert:()=>new WeakMap});return ka(k,O,{insert:()=>{let T={};for(let[M,U]of Object.entries(n.selectors??{}))T[M]=cf(U,O,w,C);return T}})}return{reducerPath:v,getSelectors:E,get selectors(){return E(A)},selectSlice:A}}let I={name:i,reducer:S,actions:g.actionCreators,caseReducers:g.sliceCaseReducersByName,getInitialState:w,...x(o),injectInto(v,{reducerPath:C,...A}={}){let E=C??o;return v.inject({reducerPath:E,reducer:S},A),{...I,...x(E,!0)}}};return I}}function cf(e,t,r,n){function i(o,...s){let c=t(o);return typeof c>"u"&&n&&(c=r()),e(c,...s)}return i.unwrapped=e,i}var Ot=af();function uf(){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 lf({type:e,reducerName:t,createNotation:r},n,i){let o,s;if("reducer"in n){if(r&&!pf(n))throw new Error(we(17));o=n.reducer,s=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?N(e,s):N(e))}function df(e){return e._reducerDefinitionType==="asyncThunk"}function pf(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ff({type:e,reducerName:t},r,n,i){if(!i)throw new Error(we(18));let{payloadCreator:o,fulfilled:s,pending:c,rejected:g,settled:a,options:m}=r,y=i(e,o,m);n.exposeAction(t,y),s&&n.addCase(y.fulfilled,s),c&&n.addCase(y.pending,c),g&&n.addCase(y.rejected,g),a&&n.addMatcher(y.settled,a),n.exposeCaseReducer(t,{fulfilled:s||an,pending:c||an,rejected:g||an,settled:a||an})}function an(){}var Na="listener",_a="completed",La="cancelled",QA=`task-${La}`,$A=`task-${_a}`,HA=`${Na}-${La}`,zA=`${Na}-${_a}`;var{assign:ja}=Object;var ao="listenerMiddleware";var gf=ja(N(`${ao}/add`),{withTypes:()=>gf}),GA=N(`${ao}/removeAll`),mf=ja(N(`${ao}/remove`),{withTypes:()=>mf});var WA=Symbol.for("rtk-state-proxy-original");function we(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();f();p();var W=new H({required:!0,emptyAllowed:!1}),ie=new H({required:!1,emptyAllowed:!1}),Te=new H({required:!0,emptyAllowed:!0}),sb=new H({required:!1,emptyAllowed:!0}),Ua=new ze({each:W,required:!0}),Va=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),hf=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),co=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let i=new te({options:{required:!0},values:t}).validate(e);if(i)throw new Oi(i);return{payload:e}},Q=(e,t)=>{try{return co(e,t)}catch(r){return{payload:e,error:hf(r)}}};var dn=(e,t,r,n)=>{let i=`Check the options of ${n}`;return yf(e,t,r,i,"Controller initialization error")},yf=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,i),o}};var pn=N("caseAssistConfiguration/set",e=>Q(e,{caseAssistId:W,locale:ie,proxyBaseUrl:new H({required:!1,url:!0})}));d();f();p();d();f();p();var Ba=()=>({caseAssistId:"",locale:"en-US"});var it=ae(Ba(),e=>{e.addCase(pn,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});d();f();p();d();f();p();d();f();p();var Qa={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new me({min:0}),numberOfResults:new me({min:0}),sortCriteria:new H,f:new te,fExcluded:new te,cf:new te,nf:new te,mnf:new te,df:new te,debug:new ne,sf:new te,tab:new H,af:new te};var fn=N("searchParameters/restore",e=>Q(e,Qa));d();f();p();var $a=N("debug/enable"),Ha=N("debug/disable");d();f();p();var gn=()=>!1;var za=ae(gn(),e=>{e.addCase($a,()=>!0).addCase(Ha,()=>!1).addCase(fn,(t,r)=>r.payload.debug??t)});d();f();p();var mn=N("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();f();p();d();f();p();d();f();p();var $t="3.11.0-pre.66d7ea8e73",Ga=["@coveo/atomic","@coveo/quantic"];var uo=()=>ie,Wa=()=>W,Ht=N("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:ie,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:ie})),hn=N("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:ie,timezone:ie,locale:ie,authenticationProviders:new ze({required:!1,each:W})})),Sf={enabled:new ne({default:!0}),originContext:uo(),originLevel2:uo(),originLevel3:uo(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new At,anonymous:new ne({default:!1}),deviceId:ie,userDisplayName:ie,documentLocation:ie,trackingId:ie,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new te({options:{required:!1},values:Ga.reduce((e,t)=>(e[t]=Va,e),{})})},yn=N("configuration/updateAnalyticsConfiguration",e=>Q(e,Sf)),Sn=N("configuration/analytics/disable"),vn=N("configuration/analytics/enable"),Ya=N("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:Wa()})),Ka=N("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:Wa()}));d();f();p();var vf=N("history/undo"),Cf=N("history/redo"),Le=N("history/snapshot"),Ew=Z("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(vf()),yield t(Cn())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),kw=Z("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Cf()),yield t(Cn())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Cn=Z("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());d();f();p();var ot=()=>"default";var Ja=ae(ot(),e=>{e.addCase(mn,(t,r)=>r.payload).addCase(Cn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(hn,(t,r)=>r.payload.searchHub||t)});d();f();p();d();f();p();d();f();p();function Af({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:o,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(i,o,r))}var bf=/^(?:[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 wf(e){return typeof e=="string"&&bf.test(e)}function Rf(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,i=n.getItem(t),o=i&&wf(i)?i:r.generateUUID();return n.setItem(t,o),o}}}var Za="0.7.10";function xf(e){let{trackingId:t}=e;return{trackingId:t}}function If(e){return(e.source||[]).concat([`relay@${Za}`])}function ec(e,t,r,n){let{getReferrer:i,getLocation:o,getUserAgent:s}=r,c=xf(t),g=n.getClientId();return Object.freeze({type:e,config:c,ts:Date.now(),source:If(t),clientId:g,userAgent:s(),referrer:i(),location:o()})}function Ef(e,t,r,n,i){return{...t,meta:ec(e,r,n,i)}}var kf="*";function Pf(){let e=[];function t({type:g,callback:a}){return e.findIndex(m=>m.type===g&&m.callback===a)}function r(g,a){return g.type==="*"||a===g.type}function n(g){return t(g)<0&&e.push(g),()=>c(g.type,g.callback)}function i(g){e.forEach(a=>{if(r(a,g.meta.type))try{a.callback(g)}catch(m){console.error(m)}})}function o(g){if(g===kf)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===g&&e.splice(a,1)}function s(g){let a=t(g);a>=0&&e.splice(a,1)}function c(g,a){a?s({type:g,callback:a}):o(g)}return{add:n,call:i,remove:c}}function Xa({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})})}function Of(e){let t=Xa(e);return{get:()=>t,update:r=>{t=Xa({...t,...r})}}}function Ff(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var lo=Tf();function Tf(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,i=document.cookie.split(";");for(let o of i){let s=o.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,i){let o=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+i).toUTCString()}`,c=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${s}${c};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Df(){return{getItem(e){return lo.getItem(e)||localStorage.getItem(e)},removeItem(e){lo.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),lo.setItem(e,t,31556952e3)}}}function Mf(){let e=document.referrer;return e===""?null:e}function qf(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Ff().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:()=>Mf(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:Df()}}function Nf(){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 _f(){return{getItem(){return null},removeItem(){},setItem(){}}}function Lf(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:_f()}}function jf(e){return e.get().mode!=="disabled"&&Uf()&&Nf()?qf():Lf()}function Uf(){try{return typeof window=="object"}catch{return!1}}function Vf(e){return{get:()=>Object.freeze(jf(e))}}function tc(e){let t=Of(e),r=Pf(),n=Vf(t),i=Rf(n);return{emit:(o,s)=>{let c=t.get(),g=n.get(),a=Ef(o,s,c,g,i);return Af({config:c,environment:g,event:a,listenerManager:r})},getMeta:o=>ec(o,t.get(),n.get(),i),on:(o,s)=>r.add({type:o,callback:s}),off:(o,s)=>r.remove(o,s),updateConfig:o=>t.update(o),version:Za}}d();f();p();var zt=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${$t}`));var Gt=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>zt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:o},s)=>tc({mode:o?"emit":"disabled",url:i??zr(e,t),token:r,trackingId:n,source:s}));d();f();p();d();f();p();d();f();p();d();f();p();function nc(_x9,_x10){return _nc.apply(this,arguments)}function _nc(){_nc=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _nc.apply(this,arguments)}function ic(e){let t,r,n,i=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=Bf(t,s);let c=t.length,g=0;for(;r<c;){i&&(t[r]===10&&(g=++r),i=!1);let a=-1;for(;r<c&&a===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-g);break;case 13:i=!0;case 10:a=r;break}if(a===-1)break;e(t.subarray(g,a),n),g=r,n=-1}g===c?t=void 0:g!==0&&(t=t.subarray(g),r-=g)}}function oc(e,t,r){let n=rc(),i=new TextDecoder;return function(s,c){if(s.length===0)r?.(n),n=rc();else if(c>0){let g=i.decode(s.subarray(0,c)),a=c+(s[c+1]===32?2:1),m=i.decode(s.subarray(a));switch(g){case"data":n.data=n.data?n.data+`
24
+ `;return new Oi(r)}var Oi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let i in this.definition){let o=this.definition[i].validate(r[i]);o&&n.push(`${i}: ${o}`)}if(n.length)throw Dd(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}},At=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&z(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 qt(e){return e===void 0}function Md(e){return e===null}function z(e){return qt(e)||Md(e)}var me=class{constructor(e={}){re(this,"value");this.config=e,this.value=new At(e)}validate(e){let t=this.value.validate(e);return t||(qd(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 qd(e){return qt(e)||_s(e)}function _s(e){return typeof e=="number"&&!isNaN(e)}var ne=class{constructor(e={}){re(this,"value");this.value=new At(e)}validate(e){let t=this.value.validate(e);return t||(Nd(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Nd(e){return qt(e)||Ls(e)}function Ls(e){return typeof e=="boolean"}var _d=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){re(this,"value");re(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new At(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:o}=this.config,s=this.value.validate(e);if(s)return s;if(qt(e))return null;if(!js(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:o&&!(_d.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 js(e){return Object.prototype.toString.call(e)==="[object String]"}var te=class{constructor(e={}){re(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(qt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Us(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&z(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],o=n.validate(i);o!==null&&(t+=" "+o)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Us(e){return e!==void 0&&typeof e=="object"}var ze=class{constructor(e={}){re(this,"value");this.config=e,this.value=new At(this.config)}validate(e){if(!z(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(z(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&&z(n)&&(r=`value is null or undefined: ${e.join(",")}`);let i=this.validatePrimitiveValue(n,this.config.each);i!==null&&(r+=" "+i)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ls(e)||js(e)||_s(e)||Us(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Vs(e){return Array.isArray(e)}var Fi=class{constructor(e){re(this,"value");this.config=e,this.value=new At(e)}validate(e){let t=this.value.validate(e);return t!==null?t:qt(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();f();p();var $r=e=>e;d();f();p();d();f();p();var na=Ie(Ys(),1);d();f();p();d();f();p();var Ee=new Error("Failed to load reducers."),Nt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var wt=class extends Error{constructor(r,n){super();re(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();f();p();function Ks(e){return Array.isArray(e)}function Js(e,t){return[...e.reduce((r,n)=>{let i=t(n);return r.has(i)||r.set(i,n),r},new Map).values()]}var up=new Set(["1",1,"yes",!0]);function Xs(){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=>up.has(r))}function Zs(e){let t={};for(let[r,n]of e)t[r]=n;return t}function fr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}d();f();p();function ea(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}function ta(e){return typeof e!="object"||!e?!1:Object.values(e).every(lp)}function lp(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ra(e){return e===429}var nt=class e{static call(t){return _asyncToGenerator(function*(){let r=dp(t),{logger:n}=t,i=yield e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:o,...s}=i,c=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let g=yield R(o,s);if(ra(g.status))throw g;return g});return function c(){return _ref.apply(this,arguments)}}();try{let g=yield(0,na.backOff)(c,{retry:a=>{let m=a&&ra(a.status);return m&&n.info("Platform retrying request"),m}});switch(g.status){case 419:case 401:throw n.info("Platform renewing token"),new Nt;case 404:throw new wt(o,g.status);default:return n.info({response:g,requestInfo:i},"Platform response"),g}}catch(g){return g.message==="Failed to fetch"?new wt(o):g}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:i,logger:o,requestMetadata:s}=r,{signal:c,...g}=t,a=fr(g);try{let m=yield i(t,n,s);return{...t,...m}}catch(m){o.error(m,"Platform request preprocessing failed. Returning default request options.")}return a})()}};function oe(e,t="prod",r="platform"){let n=t==="prod"?"":t,i=r==="platform"?"":`.${r}`;return`https://${e}${i}.org${n}.coveo.com`}function _t(e,t="prod"){return`${oe(e,t)}/rest/search/v2`}function zr(e,t="prod"){return`${oe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function dp(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:o,signal:s}=e,c=e.method==="POST"||e.method==="PUT",g=pp(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${o}`,...e.headers},...(c&&{body:g}),signal:s}}function pp(e,t){return t==="application/x-www-form-urlencoded"?ta(e)?ea(e):"":JSON.stringify(e)}d();f();p();d();f();p();var Lt=class{constructor(t){re(this,"_basePath");re(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();f();p();function Ui(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...o}=e;return o}var Vi=e=>{let{response:t}=e;return t.body?fp(e):gp(t)},fp=e=>hp(e)?yp(e):mp(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},gp=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function mp(e){return e.body.statusCode!==void 0}function hp(e){return e.body.exception!==void 0}var yp=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();f();p();function ia(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();f();p();var Bi=(e,t,r,n)=>{let i=new Lt(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};var oa=(e,t)=>{let r=new Lt(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},Qi=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield nt.call({...Bi(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ui(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ia(r),i=yield r.arrayBuffer(),s=new TextDecoder(n).decode(i);return Sp(s)?{success:s}:{error:Vi({response:r,body:s})}});return function Qi(_x,_x2){return _ref2.apply(this,arguments)}}();function Sp(e){return typeof e=="string"}d();f();p();function vp(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Cp(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Gr(e,t){if(t&&e.name==="AbortError")return{error:Cp(e)};if(e instanceof wt)return{error:vp(e)};throw e}d();f();p();d();f();p();var Wr=(e,t,r,n,i={})=>{Ap(e);let o=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=bp(i),c=s?`${o}?${s}`:o;return{accessToken:e.accessToken,method:t,contentType:r,url:c,origin:"caseAssistApiFetch"}},Yr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r]}),{}),Kr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r].value}),{}),Ap=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},bp=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var sa=e=>{let t=e.debug?{debug:"1"}:{};return{...Wr(e,"POST","application/json","/classify",t),requestParams:wp(e)}},wp=e=>({clientId:e.clientId,locale:e.locale,fields:Yr(e.fields)});d();f();p();var aa=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...Wr(e,"POST","application/json","/documents/suggest",t),requestParams:Rp(e)}},Rp=e=>({clientId:e.clientId,locale:e.locale,fields:Yr(e.fields),context:e.context});var Jr=class{constructor(t){this.options=t}getCaseClassifications(t){var _this=this;return _asyncToGenerator(function*(){let r=yield nt.call({...sa(t),..._this.options});if(r instanceof Error)return Gr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}getDocumentSuggestions(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield nt.call({...aa(t),..._this2.options});if(r instanceof Error)return Gr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this3=this;return _asyncToGenerator(function*(){return Qi(t,_this3.options)})()}};d();f();p();d();f();p();d();f();p();function le(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 xp=typeof Symbol=="function"&&Symbol.observable||"@@observable",ca=xp,$i=()=>Math.random().toString(36).substring(7).split("").join("."),Ip={INIT:`@@redux/INIT${$i()}`,REPLACE:`@@redux/REPLACE${$i()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$i()}`},Xr=Ip;function Ne(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 Hi(e,t,r){if(typeof e!="function")throw new Error(le(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(le(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(le(1));return r(Hi)(e,t)}let n=e,i=t,o=new Map,s=o,c=0,g=!1;function a(){s===o&&(s=new Map,o.forEach((x,I)=>{s.set(I,x)}))}function m(){if(g)throw new Error(le(3));return i}function y(x){if(typeof x!="function")throw new Error(le(4));if(g)throw new Error(le(5));let I=!0;a();let v=c++;return s.set(v,x),function(){if(I){if(g)throw new Error(le(6));I=!1,a(),s.delete(v),o=null}}}function h(x){if(!Ne(x))throw new Error(le(7));if(typeof x.type>"u")throw new Error(le(8));if(typeof x.type!="string")throw new Error(le(17));if(g)throw new Error(le(9));try{g=!0,i=n(i,x)}finally{g=!1}return(o=s).forEach(v=>{v()}),x}function u(x){if(typeof x!="function")throw new Error(le(10));n=x,h({type:Xr.REPLACE})}function S(){let x=y;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(le(11));function v(){let A=I;A.next&&A.next(m())}return v(),{unsubscribe:x(v)}},[ca](){return this}}}return h({type:Xr.INIT}),{dispatch:h,subscribe:y,getState:m,replaceReducer:u,[ca]:S}}function Ep(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Xr.INIT})>"u")throw new Error(le(12));if(typeof r(void 0,{type:Xr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(le(13))})}function jt(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let c=t[s];typeof e[c]=="function"&&(r[c]=e[c])}let n=Object.keys(r),i,o;try{Ep(r)}catch(s){o=s}return function(c={},g){if(o)throw o;let a=!1,m={};for(let y=0;y<n.length;y++){let h=n[y],u=r[h],S=c[h],w=u(S,g);if(typeof w>"u"){let x=g&&g.type;throw new Error(le(14))}m[h]=w,a=a||w!==S}return a=a||n.length!==Object.keys(c).length,a?m:c}}function Ut(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ua(...e){return t=>(r,n)=>{let i=t(r,n),o=()=>{throw new Error(le(15))},s={getState:i.getState,dispatch:(g,...a)=>o(g,...a)},c=e.map(g=>g(s));return o=Ut(...c)(i.dispatch),{...i,dispatch:o}}}function Zr(e){return Ne(e)&&"type"in e&&typeof e.type=="string"}d();f();p();var to=Symbol.for("immer-nothing"),gr=Symbol.for("immer-draftable"),he=Symbol.for("immer-state");function de(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xt=Object.getPrototypeOf;function Ae(e){return!!e&&!!e[he]}function ye(e){return e?ga(e)||Array.isArray(e)||!!e[gr]||!!e.constructor?.[gr]||vr(e)||Cr(e):!1}var kp=Object.prototype.constructor.toString();function ga(e){if(!e||typeof e!="object")return!1;let t=xt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===kp}function ro(e){return Ae(e)||de(15,e),e[he].base_}function mr(e,t){It(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function It(e){let t=e[he];return t?t.type_:Array.isArray(e)?1:vr(e)?2:Cr(e)?3:0}function hr(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zi(e,t){return It(e)===2?e.get(t):e[t]}function ma(e,t,r){let n=It(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Pp(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vr(e){return e instanceof Map}function Cr(e){return e instanceof Set}function Rt(e){return e.copy_||e.base_}function Yi(e,t){if(vr(e))return new Map(e);if(Cr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=ga(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[he];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){let s=i[o],c=n[s];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[s]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[s]})}return Object.create(xt(e),n)}else{let n=xt(e);if(n!==null&&r)return{...e};let i=Object.create(n);return Object.assign(i,e)}}function rn(e,t=!1){return nn(e)||Ae(e)||!ye(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Op),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>rn(n,!0))),e}function Op(){de(2)}function nn(e){return Object.isFrozen(e)}var Ki={};function Et(e){let t=Ki[e];return t||de(0,e),t}function Fp(e,t){Ki[e]||(Ki[e]=t)}var yr;function ha(){return yr}function Tp(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function la(e,t){t&&(Et("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ji(e){Xi(e),e.drafts_.forEach(Dp),e.drafts_=null}function Xi(e){e===yr&&(yr=e.parent_)}function da(e){return yr=Tp(yr,e)}function Dp(e){let t=e[he];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function pa(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[he].modified_&&(Ji(t),de(4)),ye(e)&&(e=en(t,e),t.parent_||tn(t,e)),t.patches_&&Et("Patches").generateReplacementPatches_(r[he].base_,e,t.patches_,t.inversePatches_)):e=en(t,r,[]),Ji(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==to?e:void 0}function en(e,t,r){if(nn(t))return t;let n=t[he];if(!n)return mr(t,(i,o)=>fa(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return tn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let i=n.copy_,o=i,s=!1;n.type_===3&&(o=new Set(i),i.clear(),s=!0),mr(o,(c,g)=>fa(e,n,i,c,g,r,s)),tn(e,i,!1),r&&e.patches_&&Et("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function fa(e,t,r,n,i,o,s){if(Ae(i)){let c=o&&t&&t.type_!==3&&!hr(t.assigned_,n)?o.concat(n):void 0,g=en(e,i,c);if(ma(r,n,g),Ae(g))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(ye(i)&&!nn(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;en(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&tn(e,i)}}function tn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rn(t,r)}function Mp(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ha(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=no;r&&(i=[n],o=Sr);let{revoke:s,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=s,c}var no={get(e,t){if(t===he)return e;let r=Rt(e);if(!hr(r,t))return qp(e,r,t);let n=r[t];return e.finalized_||!ye(n)?n:n===Gi(e.base_,t)?(Wi(e),e.copy_[t]=eo(n,e)):n},has(e,t){return t in Rt(e)},ownKeys(e){return Reflect.ownKeys(Rt(e))},set(e,t,r){let n=ya(Rt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let i=Gi(Rt(e),t),o=i?.[he];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Pp(r,i)&&(r!==void 0||hr(e.base_,t)))return!0;Wi(e),Zi(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 Gi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Wi(e),Zi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Rt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){de(11)},getPrototypeOf(e){return xt(e.base_)},setPrototypeOf(){de(12)}},Sr={};mr(no,(e,t)=>{Sr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Sr.deleteProperty=function(e,t){return Sr.set.call(this,e,t,void 0)};Sr.set=function(e,t,r){return no.set.call(this,e[0],t,r,e[0])};function Gi(e,t){let r=e[he];return(r?Rt(r):e)[t]}function qp(e,t,r){let n=ya(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function ya(e,t){if(!(t in e))return;let r=xt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=xt(r)}}function Zi(e){e.modified_||(e.modified_=!0,e.parent_&&Zi(e.parent_))}function Wi(e){e.copy_||(e.copy_=Yi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Np=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let s=this;return function(g=o,...a){return s.produce(g,m=>r.call(this,m,...a))}}typeof r!="function"&&de(6),n!==void 0&&typeof n!="function"&&de(7);let i;if(ye(t)){let o=da(this),s=eo(t,void 0),c=!0;try{i=r(s),c=!1}finally{c?Ji(o):Xi(o)}return la(o,n),pa(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===to&&(i=void 0),this.autoFreeze_&&rn(i,!0),n){let o=[],s=[];Et("Patches").generateReplacementPatches_(t,i,o,s),n(o,s)}return i}else de(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...c)=>this.produceWithPatches(s,g=>t(g,...c));let n,i;return[this.produce(t,r,(s,c)=>{n=s,i=c}),n,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ye(e)||de(8),Ae(e)&&(e=Sa(e));let t=da(this),r=eo(e,void 0);return r[he].isManual_=!0,Xi(t),r}finishDraft(e,t){let r=e&&e[he];(!r||!r.isManual_)&&de(9);let{scope_:n}=r;return la(n,t),pa(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let n=Et("Patches").applyPatches_;return Ae(e)?n(e,t):this.produce(e,i=>n(i,t))}};function eo(e,t){let r=vr(e)?Et("MapSet").proxyMap_(e,t):Cr(e)?Et("MapSet").proxySet_(e,t):Mp(e,t);return(t?t.scope_:ha()).drafts_.push(r),r}function Sa(e){return Ae(e)||de(10,e),va(e)}function va(e){if(!ye(e)||nn(e))return e;let t=e[he],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Yi(e,!0);return mr(r,(n,i)=>{ma(r,n,va(i))}),t&&(t.finalized_=!1),r}function Ca(){let t="replace",r="add",n="remove";function i(h,u,S,w){switch(h.type_){case 0:case 2:return s(h,u,S,w);case 1:return o(h,u,S,w);case 3:return c(h,u,S,w)}}function o(h,u,S,w){let{base_:x,assigned_:I}=h,v=h.copy_;v.length<x.length&&([x,v]=[v,x],[S,w]=[w,S]);for(let C=0;C<x.length;C++)if(I[C]&&v[C]!==x[C]){let A=u.concat([C]);S.push({op:t,path:A,value:y(v[C])}),w.push({op:t,path:A,value:y(x[C])})}for(let C=x.length;C<v.length;C++){let A=u.concat([C]);S.push({op:r,path:A,value:y(v[C])})}for(let C=v.length-1;x.length<=C;--C){let A=u.concat([C]);w.push({op:n,path:A})}}function s(h,u,S,w){let{base_:x,copy_:I}=h;mr(h.assigned_,(v,C)=>{let A=zi(x,v),E=zi(I,v),O=C?hr(x,v)?t:r:n;if(A===E&&O===t)return;let k=u.concat(v);S.push(O===n?{op:O,path:k}:{op:O,path:k,value:E}),w.push(O===r?{op:n,path:k}:O===n?{op:r,path:k,value:y(A)}:{op:t,path:k,value:y(A)})})}function c(h,u,S,w){let{base_:x,copy_:I}=h,v=0;x.forEach(C=>{if(!I.has(C)){let A=u.concat([v]);S.push({op:n,path:A,value:C}),w.unshift({op:r,path:A,value:C})}v++}),v=0,I.forEach(C=>{if(!x.has(C)){let A=u.concat([v]);S.push({op:r,path:A,value:C}),w.unshift({op:n,path:A,value:C})}v++})}function g(h,u,S,w){S.push({op:t,path:[],value:u===to?void 0:u}),w.push({op:t,path:[],value:h})}function a(h,u){return u.forEach(S=>{let{path:w,op:x}=S,I=h;for(let E=0;E<w.length-1;E++){let O=It(I),k=w[E];typeof k!="string"&&typeof k!="number"&&(k=""+k),(O===0||O===1)&&(k==="__proto__"||k==="constructor")&&de(19),typeof I=="function"&&k==="prototype"&&de(19),I=zi(I,k),typeof I!="object"&&de(18,w.join("/"))}let v=It(I),C=m(S.value),A=w[w.length-1];switch(x){case t:switch(v){case 2:return I.set(A,C);case 3:de(16);default:return I[A]=C}case r:switch(v){case 1:return A==="-"?I.push(C):I.splice(A,0,C);case 2:return I.set(A,C);case 3:return I.add(C);default:return I[A]=C}case n:switch(v){case 1:return I.splice(A,1);case 2:return I.delete(A);case 3:return I.delete(S.value);default:return delete I[A]}default:de(17,x)}}),h}function m(h){if(!ye(h))return h;if(Array.isArray(h))return h.map(m);if(vr(h))return new Map(Array.from(h.entries()).map(([S,w])=>[S,m(w)]));if(Cr(h))return new Set(Array.from(h).map(m));let u=Object.create(xt(h));for(let S in h)u[S]=m(h[S]);return hr(h,gr)&&(u[gr]=h[gr]),u}function y(h){return Ae(h)?m(h):h}Fp("Patches",{applyPatches_:a,generatePatches_:i,generateReplacementPatches_:g})}var be=new Np,We=be.produce,on=be.produceWithPatches.bind(be),dA=be.setAutoFreeze.bind(be),pA=be.setUseStrictShallowCopy.bind(be),io=be.applyPatches.bind(be),fA=be.createDraft.bind(be),gA=be.finishDraft.bind(be);d();f();p();function _p(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Lp(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function jp(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 Aa=e=>Array.isArray(e)?e:[e];function Up(e){let t=Array.isArray(e[0])?e[0]:e;return jp(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Vp(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var CA=Symbol();var AA=Object.getPrototypeOf({});var Bp=class{constructor(e){this.value=e}deref(){return this.value}},Qp=typeof WeakRef<"u"?WeakRef:Bp,$p=0,ba=1;function sn(){return{s:$p,v:void 0,o:null,p:null}}function Vt(e,t={}){let r=sn(),{resultEqualityCheck:n}=t,i,o=0;function s(){let c=r,{length:g}=arguments;for(let y=0,h=g;y<h;y++){let u=arguments[y];if(typeof u=="function"||typeof u=="object"&&u!==null){let S=c.o;S===null&&(c.o=S=new WeakMap);let w=S.get(u);w===void 0?(c=sn(),S.set(u,c)):c=w}else{let S=c.p;S===null&&(c.p=S=new Map);let w=S.get(u);w===void 0?(c=sn(),S.set(u,c)):c=w}}let a=c,m;if(c.s===ba)m=c.v;else if(m=e.apply(null,arguments),o++,n){let y=i?.deref?.()??i;y!=null&&n(y,m)&&(m=y,o!==0&&o--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Qp(m):m}return a.s=ba,a.v=m,m}return s.clearCache=()=>{r=sn(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function wa(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,s=0,c,g={},a=i.pop();typeof a=="object"&&(g=a,a=i.pop()),_p(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let m={...r,...g},{memoize:y,memoizeOptions:h=[],argsMemoize:u=Vt,argsMemoizeOptions:S=[],devModeChecks:w={}}=m,x=Aa(h),I=Aa(S),v=Up(i),C=y(function(){return o++,a.apply(null,arguments)},...x),A=!0,E=u(function(){s++;let k=Vp(v,arguments);return c=C.apply(null,k),c},...I);return Object.assign(E,{resultFunc:a,memoizedResultFunc:C,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:y,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var se=wa(Vt),Hp=Object.assign((e,t=se)=>{Lp(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((s,c,g)=>(s[r[g]]=c,s),{}))},{withTypes:()=>Hp});d();f();p();function Ra(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var xa=Ra(),Ia=Ra;var zp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ut:Ut.apply(null,arguments)},_A=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Gp=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(we(0));return{type:e,payload:i.payload,...("meta"in i&&{meta:i.meta}),...("error"in i&&{error:i.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Zr(n)&&n.type===e,r}var Oa=class Ar extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ar.prototype)}static get[Symbol.species](){return Ar}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ar(...t[0].concat(this)):new Ar(...t.concat(this))}};function Ea(e){return ye(e)?We(e,()=>{}):e}function ka(e,t,r){if(e.has(t)){let i=e.get(t);return r.update&&(i=r.update(i,t,e),e.set(t,i)),i}if(!r.insert)throw new Error(we(10));let n=r.insert(t,e);return e.set(t,n),n}function Wp(e){return typeof e=="boolean"}var Yp=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{},s=new Oa;return r&&(Wp(r)?s.push(xa):s.push(Ia(r.extraArgument))),s},Pt="RTK_autoBatch",Qt=()=>e=>({payload:e,meta:{[Pt]:!0}}),Fa=e=>t=>{setTimeout(t,e)},Kp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Fa(10),Jp=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,o=!1,s=!1,c=new Set,g=e.type==="tick"?queueMicrotask:e.type==="raf"?Kp:e.type==="callback"?e.queueNotification:Fa(e.timeout),a=()=>{s=!1,o&&(o=!1,c.forEach(m=>m()))};return Object.assign({},n,{subscribe(m){let y=()=>i&&m(),h=n.subscribe(y);return c.add(m),()=>{h(),c.delete(m)}},dispatch(m){try{return i=!m?.meta?.[Pt],o=!i,o&&(s||(s=!0,g(a))),n.dispatch(m)}finally{i=!0}}})},Xp=e=>function(r){let{autoBatch:n=!0}=r??{},i=new Oa(e);return n&&i.push(Jp(typeof n=="object"?n:void 0)),i};function Ta(e){let t=Yp(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Ne(r))c=jt(r);else throw new Error(we(1));let g;typeof n=="function"?g=n(t):g=t();let a=Ut;i&&(a=zp({trace:!1,...(typeof i=="object"&&i)}));let m=ua(...g),y=Xp(m),h=typeof s=="function"?s(y):y(),u=a(...h);return Hi(c,o,u)}function Da(e){let t={},r=[],n,i={addCase(o,s){let c=typeof o=="string"?o:o.type;if(!c)throw new Error(we(28));if(c in t)throw new Error(we(29));return t[c]=s,i},addMatcher(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function Zp(e){return typeof e=="function"}function ae(e,t){let[r,n,i]=Da(t),o;if(Zp(e))o=()=>Ea(e());else{let c=Ea(e);o=()=>c}function s(c=o(),g){let a=[r[g.type],...n.filter(({matcher:m})=>m(g)).map(({reducer:m})=>m)];return a.filter(m=>!!m).length===0&&(a=[i]),a.reduce((m,y)=>{if(y)if(Ae(m)){let u=y(m,g);return u===void 0?m:u}else{if(ye(m))return We(m,h=>y(h,g));{let h=y(m,g);if(h===void 0){if(m===null)return m;throw new Error(we(9))}return h}}return m},c)}return s.getInitialState=o,s}var Ma=(e,t)=>Gp(e)?e.match(t):e(t);function _e(...e){return t=>e.some(r=>Ma(r,t))}function Bt(...e){return t=>e.every(r=>Ma(r,t))}function cn(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 br(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function un(...e){return e.length===0?t=>cn(t,["pending"]):br(e)?_e(...e.map(t=>t.pending)):un()(e[0])}function kt(...e){return e.length===0?t=>cn(t,["rejected"]):br(e)?_e(...e.map(t=>t.rejected)):kt()(e[0])}function wr(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Bt(kt(...e),t):br(e)?Bt(kt(...e),t):wr()(e[0])}function Ye(...e){return e.length===0?t=>cn(t,["fulfilled"]):br(e)?_e(...e.map(t=>t.fulfilled)):Ye()(e[0])}function ln(...e){return e.length===0?t=>cn(t,["pending","fulfilled","rejected"]):br(e)?_e(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ln()(e[0])}var ef="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",so=(e=21)=>{let t="",r=e;for(;r--;)t+=ef[Math.random()*64|0];return t},tf=["name","message","stack","code"],oo=class{constructor(e,t){re(this,"_type");this.payload=e,this.meta=t}},Pa=class{constructor(e,t){re(this,"_type");this.payload=e,this.meta=t}},rf=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of tf)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Z=(()=>{function e(t,r,n){let i=N(t+"/fulfilled",(g,a,m,y)=>({payload:g,meta:{...(y||{}),arg:m,requestId:a,requestStatus:"fulfilled"}})),o=N(t+"/pending",(g,a,m)=>({payload:void 0,meta:{...(m||{}),arg:a,requestId:g,requestStatus:"pending"}})),s=N(t+"/rejected",(g,a,m,y,h)=>({payload:y,error:(n&&n.serializeError||rf)(g||"Rejected"),meta:{...(h||{}),arg:m,requestId:a,rejectedWithValue:!!y,requestStatus:"rejected",aborted:g?.name==="AbortError",condition:g?.name==="ConditionError"}}));function c(g){return(a,m,y)=>{let h=n?.idGenerator?n.idGenerator(g):so(),u=new l.AbortController,S,w;function x(v){w=v,u.abort()}let I=_asyncToGenerator(function*(){let v;try{let A=n?.condition?.(g,{getState:m,extra:y});if(of(A)&&(A=yield A),A===!1||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let E=new Promise((O,k)=>{S=()=>{k({name:"AbortError",message:w||"Aborted"})},u.signal.addEventListener("abort",S)});a(o(h,g,n?.getPendingMeta?.({requestId:h,arg:g},{getState:m,extra:y}))),v=yield Promise.race([E,Promise.resolve(r(g,{dispatch:a,getState:m,extra:y,requestId:h,signal:u.signal,abort:x,rejectWithValue:(O,k)=>new oo(O,k),fulfillWithValue:(O,k)=>new Pa(O,k)})).then(O=>{if(O instanceof oo)throw O;return O instanceof Pa?i(O.payload,h,g,O.meta):i(O,h,g)})])}catch(A){v=A instanceof oo?s(null,h,g,A.payload,A.meta):s(A,h,g)}finally{S&&u.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&s.match(v)&&v.meta.condition||a(v),v})();return Object.assign(I,{abort:x,requestId:h,arg:g,unwrap(){return I.then(nf)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,settled:_e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function nf(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function of(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var qa=Symbol.for("rtk-slice-createasyncthunk"),BA={[qa]:Z};function sf(e,t){return`${e}/${t}`}function af({creators:e}={}){let t=e?.asyncThunk?.[qa];return function(n){let{name:i,reducerPath:o=i}=n;if(!i)throw new Error(we(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(uf()):n.reducers)||{},c=Object.keys(s),g={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(v,C){let A=typeof v=="string"?v:v.type;if(!A)throw new Error(we(12));if(A in g.sliceCaseReducersByType)throw new Error(we(13));return g.sliceCaseReducersByType[A]=C,a},addMatcher(v,C){return g.sliceMatchers.push({matcher:v,reducer:C}),a},exposeAction(v,C){return g.actionCreators[v]=C,a},exposeCaseReducer(v,C){return g.sliceCaseReducersByName[v]=C,a}};c.forEach(v=>{let C=s[v],A={reducerName:v,type:sf(i,v),createNotation:typeof n.reducers=="function"};df(C)?ff(A,C,a,t):lf(A,C,a)});function m(){let[v={},C=[],A=void 0]=typeof n.extraReducers=="function"?Da(n.extraReducers):[n.extraReducers],E={...v,...g.sliceCaseReducersByType};return ae(n.initialState,O=>{for(let k in E)O.addCase(k,E[k]);for(let k of g.sliceMatchers)O.addMatcher(k.matcher,k.reducer);for(let k of C)O.addMatcher(k.matcher,k.reducer);A&&O.addDefaultCase(A)})}let y=v=>v,h=new Map,u;function S(v,C){return u||(u=m()),u(v,C)}function w(){return u||(u=m()),u.getInitialState()}function x(v,C=!1){function A(O){let k=O[v];return typeof k>"u"&&C&&(k=w()),k}function E(O=y){let k=ka(h,C,{insert:()=>new WeakMap});return ka(k,O,{insert:()=>{let T={};for(let[M,U]of Object.entries(n.selectors??{}))T[M]=cf(U,O,w,C);return T}})}return{reducerPath:v,getSelectors:E,get selectors(){return E(A)},selectSlice:A}}let I={name:i,reducer:S,actions:g.actionCreators,caseReducers:g.sliceCaseReducersByName,getInitialState:w,...x(o),injectInto(v,{reducerPath:C,...A}={}){let E=C??o;return v.inject({reducerPath:E,reducer:S},A),{...I,...x(E,!0)}}};return I}}function cf(e,t,r,n){function i(o,...s){let c=t(o);return typeof c>"u"&&n&&(c=r()),e(c,...s)}return i.unwrapped=e,i}var Ot=af();function uf(){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 lf({type:e,reducerName:t,createNotation:r},n,i){let o,s;if("reducer"in n){if(r&&!pf(n))throw new Error(we(17));o=n.reducer,s=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?N(e,s):N(e))}function df(e){return e._reducerDefinitionType==="asyncThunk"}function pf(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ff({type:e,reducerName:t},r,n,i){if(!i)throw new Error(we(18));let{payloadCreator:o,fulfilled:s,pending:c,rejected:g,settled:a,options:m}=r,y=i(e,o,m);n.exposeAction(t,y),s&&n.addCase(y.fulfilled,s),c&&n.addCase(y.pending,c),g&&n.addCase(y.rejected,g),a&&n.addMatcher(y.settled,a),n.exposeCaseReducer(t,{fulfilled:s||an,pending:c||an,rejected:g||an,settled:a||an})}function an(){}var Na="listener",_a="completed",La="cancelled",QA=`task-${La}`,$A=`task-${_a}`,HA=`${Na}-${La}`,zA=`${Na}-${_a}`;var{assign:ja}=Object;var ao="listenerMiddleware";var gf=ja(N(`${ao}/add`),{withTypes:()=>gf}),GA=N(`${ao}/removeAll`),mf=ja(N(`${ao}/remove`),{withTypes:()=>mf});var WA=Symbol.for("rtk-state-proxy-original");function we(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();f();p();var W=new H({required:!0,emptyAllowed:!1}),ie=new H({required:!1,emptyAllowed:!1}),Te=new H({required:!0,emptyAllowed:!0}),sb=new H({required:!1,emptyAllowed:!0}),Ua=new ze({each:W,required:!0}),Va=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),hf=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),co=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let i=new te({options:{required:!0},values:t}).validate(e);if(i)throw new Oi(i);return{payload:e}},Q=(e,t)=>{try{return co(e,t)}catch(r){return{payload:e,error:hf(r)}}};var dn=(e,t,r,n)=>{let i=`Check the options of ${n}`;return yf(e,t,r,i,"Controller initialization error")},yf=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,i),o}};var pn=N("caseAssistConfiguration/set",e=>Q(e,{caseAssistId:W,locale:ie,proxyBaseUrl:new H({required:!1,url:!0})}));d();f();p();d();f();p();var Ba=()=>({caseAssistId:"",locale:"en-US"});var it=ae(Ba(),e=>{e.addCase(pn,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});d();f();p();d();f();p();d();f();p();var Qa={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new me({min:0}),numberOfResults:new me({min:0}),sortCriteria:new H,f:new te,fExcluded:new te,cf:new te,nf:new te,mnf:new te,df:new te,debug:new ne,sf:new te,tab:new H,af:new te};var fn=N("searchParameters/restore",e=>Q(e,Qa));d();f();p();var $a=N("debug/enable"),Ha=N("debug/disable");d();f();p();var gn=()=>!1;var za=ae(gn(),e=>{e.addCase($a,()=>!0).addCase(Ha,()=>!1).addCase(fn,(t,r)=>r.payload.debug??t)});d();f();p();var mn=N("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();f();p();d();f();p();d();f();p();var $t="3.11.0-pre.bf32ecec58",Ga=["@coveo/atomic","@coveo/quantic"];var uo=()=>ie,Wa=()=>W,Ht=N("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:ie,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:ie})),hn=N("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:ie,timezone:ie,locale:ie,authenticationProviders:new ze({required:!1,each:W})})),Sf={enabled:new ne({default:!0}),originContext:uo(),originLevel2:uo(),originLevel3:uo(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new At,anonymous:new ne({default:!1}),deviceId:ie,userDisplayName:ie,documentLocation:ie,trackingId:ie,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new te({options:{required:!1},values:Ga.reduce((e,t)=>(e[t]=Va,e),{})})},yn=N("configuration/updateAnalyticsConfiguration",e=>Q(e,Sf)),Sn=N("configuration/analytics/disable"),vn=N("configuration/analytics/enable"),Ya=N("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:Wa()})),Ka=N("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:Wa()}));d();f();p();var vf=N("history/undo"),Cf=N("history/redo"),Le=N("history/snapshot"),Ew=Z("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(vf()),yield t(Cn())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),kw=Z("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Cf()),yield t(Cn())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Cn=Z("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());d();f();p();var ot=()=>"default";var Ja=ae(ot(),e=>{e.addCase(mn,(t,r)=>r.payload).addCase(Cn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(hn,(t,r)=>r.payload.searchHub||t)});d();f();p();d();f();p();d();f();p();function Af({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:o,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(i,o,r))}var bf=/^(?:[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 wf(e){return typeof e=="string"&&bf.test(e)}function Rf(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,i=n.getItem(t),o=i&&wf(i)?i:r.generateUUID();return n.setItem(t,o),o}}}var Za="0.7.10";function xf(e){let{trackingId:t}=e;return{trackingId:t}}function If(e){return(e.source||[]).concat([`relay@${Za}`])}function ec(e,t,r,n){let{getReferrer:i,getLocation:o,getUserAgent:s}=r,c=xf(t),g=n.getClientId();return Object.freeze({type:e,config:c,ts:Date.now(),source:If(t),clientId:g,userAgent:s(),referrer:i(),location:o()})}function Ef(e,t,r,n,i){return{...t,meta:ec(e,r,n,i)}}var kf="*";function Pf(){let e=[];function t({type:g,callback:a}){return e.findIndex(m=>m.type===g&&m.callback===a)}function r(g,a){return g.type==="*"||a===g.type}function n(g){return t(g)<0&&e.push(g),()=>c(g.type,g.callback)}function i(g){e.forEach(a=>{if(r(a,g.meta.type))try{a.callback(g)}catch(m){console.error(m)}})}function o(g){if(g===kf)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===g&&e.splice(a,1)}function s(g){let a=t(g);a>=0&&e.splice(a,1)}function c(g,a){a?s({type:g,callback:a}):o(g)}return{add:n,call:i,remove:c}}function Xa({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})})}function Of(e){let t=Xa(e);return{get:()=>t,update:r=>{t=Xa({...t,...r})}}}function Ff(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var lo=Tf();function Tf(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,i=document.cookie.split(";");for(let o of i){let s=o.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,i){let o=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+i).toUTCString()}`,c=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${s}${c};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Df(){return{getItem(e){return lo.getItem(e)||localStorage.getItem(e)},removeItem(e){lo.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),lo.setItem(e,t,31556952e3)}}}function Mf(){let e=document.referrer;return e===""?null:e}function qf(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Ff().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:()=>Mf(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:Df()}}function Nf(){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 _f(){return{getItem(){return null},removeItem(){},setItem(){}}}function Lf(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:_f()}}function jf(e){return e.get().mode!=="disabled"&&Uf()&&Nf()?qf():Lf()}function Uf(){try{return typeof window=="object"}catch{return!1}}function Vf(e){return{get:()=>Object.freeze(jf(e))}}function tc(e){let t=Of(e),r=Pf(),n=Vf(t),i=Rf(n);return{emit:(o,s)=>{let c=t.get(),g=n.get(),a=Ef(o,s,c,g,i);return Af({config:c,environment:g,event:a,listenerManager:r})},getMeta:o=>ec(o,t.get(),n.get(),i),on:(o,s)=>r.add({type:o,callback:s}),off:(o,s)=>r.remove(o,s),updateConfig:o=>t.update(o),version:Za}}d();f();p();var zt=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${$t}`));var Gt=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>zt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:o},s)=>tc({mode:o?"emit":"disabled",url:i??zr(e,t),token:r,trackingId:n,source:s}));d();f();p();d();f();p();d();f();p();d();f();p();function nc(_x9,_x10){return _nc.apply(this,arguments)}function _nc(){_nc=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _nc.apply(this,arguments)}function ic(e){let t,r,n,i=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=Bf(t,s);let c=t.length,g=0;for(;r<c;){i&&(t[r]===10&&(g=++r),i=!1);let a=-1;for(;r<c&&a===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-g);break;case 13:i=!0;case 10:a=r;break}if(a===-1)break;e(t.subarray(g,a),n),g=r,n=-1}g===c?t=void 0:g!==0&&(t=t.subarray(g),r-=g)}}function oc(e,t,r){let n=rc(),i=new TextDecoder;return function(s,c){if(s.length===0)r?.(n),n=rc();else if(c>0){let g=i.decode(s.subarray(0,c)),a=c+(s[c+1]===32?2:1),m=i.decode(s.subarray(a));switch(g){case"data":n.data=n.data?n.data+`
25
25
  `+m:m;break;case"event":n.event=m;break;case"id":e(n.id=m);break;case"retry":let y=parseInt(m,10);isNaN(y)||t(n.retry=y);break}}}}function Bf(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function rc(){return{data:"",event:"",id:"",retry:void 0}}var Qf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},An="text/event-stream",$f=1e3,sc="last-event-id";function ac(){typeof window<"u"}function po(e,t){var{signal:r,headers:n,onopen:i,onmessage:o,onclose:s,onerror:c,openWhenHidden:g,fetch:a}=t,m=Qf(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((y,h)=>{let u=Object.assign({},n);u.accept||(u.accept=An);let S;function w(){S?.abort(),document.hidden||E()}!g&&ac()&&document.addEventListener("visibilitychange",w);let x=$f,I=0;function v(){ac()&&document.removeEventListener("visibilitychange",w),clearTimeout(I),S?.abort()}r?.addEventListener("abort",()=>{v(),y()});let C=a??C,A=i??Hf;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){var O;S=typeof l.AbortController>"u"?null:new l.AbortController;try{let k=yield C(e,Object.assign(Object.assign({},m),{headers:u,signal:S?.signal}));yield A(k),yield nc(k.body,ic(oc(T=>{T?u[sc]=T:delete u[sc]},T=>{x=T},o))),s?.(),v(),y()}catch(k){if(!S?.signal.aborted)try{let T=(O=c?.(k))!==null&&O!==void 0?O:x;clearTimeout(I),I=setTimeout(E,T)}catch(T){v(),h(T)}}});return _E.apply(this,arguments)}E()})}function Hf(e){let t=e.headers.get("content-type");if(!t?.startsWith(An))throw new Error(`Expected content-type to be ${An}, Actual: ${t}`)}d();f();p();d();f();p();d();f();p();d();f();p();d();f();p();function Ke(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function P(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function c(m){try{a(n.next(m))}catch(y){s(y)}}function g(m){try{a(n.throw(m))}catch(y){s(y)}}function a(m){m.done?o(m.value):i(m.value).then(c,g)}a((n=n.apply(e,t||[])).next())})}var K;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(K||(K={}));function mo(){return typeof window<"u"}function ko(){return typeof navigator<"u"}function Wt(){return typeof document<"u"}function ho(){try{return typeof localStorage<"u"}catch{return!1}}function zf(){try{return typeof sessionStorage<"u"}catch{return!1}}function Ac(){return ko()&&navigator.cookieEnabled}var Gf=[K.click,K.custom,K.search,K.view],Wf=(e,t)=>Gf.indexOf(e)!==-1?Object.assign({language:Wt()?document.documentElement.lang:"unknown",userAgent:ko()?navigator.userAgent:"unknown"},t):t,Ir=class e{static set(t,r,n){var i,o,s,c;n&&(o=new Date,o.setTime(o.getTime()+n)),c=window.location.hostname,c.indexOf(".")===-1?cc(t,r,o):(s=c.split("."),i=s[s.length-2]+"."+s[s.length-1],cc(t,r,o,i))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){var o=n[i];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function cc(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Yf(){return ho()?localStorage:Ac()?new Er:zf()?sessionStorage:new Kt}var Er=class e{getItem(t){return Ir.get(`${e.prefix}${t}`)}removeItem(t){Ir.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ir.set(`${e.prefix}${t}`,r,n)}};Er.prefix="coveo_";var yo=class{constructor(){this.cookieStorage=new Er}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)}},Kt=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Rr="__coveo.analytics.history",bc=20,wc=1e3*60,Rc=75,Jt=class{constructor(t){this.store=t||Yf()}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 P(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 P(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Rr);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return P(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Rr);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Rr,JSON.stringify(t.slice(0,bc)))}catch{}}clear(){try{this.store.removeItem(Rr)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,i)=>(i.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Rc)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>wc:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:i,value:o}=r;return{name:n,time:i,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:i}=t;return r&&typeof i=="string"&&r.toLowerCase()==="query"&&i.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},xc=Object.freeze({__proto__:null,HistoryStore:Jt,MAX_NUMBER_OF_HISTORY_ELEMENTS:bc,MAX_VALUE_SIZE:Rc,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:wc,STORE_KEY:Rr,default:Jt}),Kf=(e,t)=>P(void 0,void 0,void 0,function*(){return e===K.view?(yield Jf(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Jf=e=>P(void 0,void 0,void 0,function*(){let t=new Jt,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),bn,Xf=new Uint8Array(16);function Zf(){if(!bn&&(bn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bn(Xf)}var eg=/^(?:[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 Rn(e){return typeof e=="string"&&eg.test(e)}var pe=[];for(let e=0;e<256;++e)pe.push((e+256).toString(16).slice(1));function Ic(e,t=0){return(pe[e[t+0]]+pe[e[t+1]]+pe[e[t+2]]+pe[e[t+3]]+"-"+pe[e[t+4]]+pe[e[t+5]]+"-"+pe[e[t+6]]+pe[e[t+7]]+"-"+pe[e[t+8]]+pe[e[t+9]]+"-"+pe[e[t+10]]+pe[e[t+11]]+pe[e[t+12]]+pe[e[t+13]]+pe[e[t+14]]+pe[e[t+15]]).toLowerCase()}function tg(e){if(!Rn(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 rg(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ng="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ig="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function og(e,t,r){function n(i,o,s,c){var g;if(typeof i=="string"&&(i=rg(i)),typeof o=="string"&&(o=tg(o)),((g=o)===null||g===void 0?void 0:g.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(o),a.set(i,o.length),a=r(a),a[6]=a[6]&15|t,a[8]=a[8]&63|128,s){c=c||0;for(let m=0;m<16;++m)s[c+m]=a[m];return s}return Ic(a)}try{n.name=e}catch{}return n.DNS=ng,n.URL=ig,n}var sg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uc={randomUUID:sg};function Ft(e,t,r){if(uc.randomUUID&&!t&&!e)return uc.randomUUID();e=e||{};let n=e.random||(e.rng||Zf)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return Ic(n)}function ag(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function fo(e,t){return e<<t|e>>>32-t}function cg(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let s=unescape(encodeURIComponent(e));e=[];for(let c=0;c<s.length;++c)e.push(s.charCodeAt(c))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,i=Math.ceil(n/16),o=new Array(i);for(let s=0;s<i;++s){let c=new Uint32Array(16);for(let g=0;g<16;++g)c[g]=e[s*64+g*4]<<24|e[s*64+g*4+1]<<16|e[s*64+g*4+2]<<8|e[s*64+g*4+3];o[s]=c}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let c=new Uint32Array(80);for(let u=0;u<16;++u)c[u]=o[s][u];for(let u=16;u<80;++u)c[u]=fo(c[u-3]^c[u-8]^c[u-14]^c[u-16],1);let g=r[0],a=r[1],m=r[2],y=r[3],h=r[4];for(let u=0;u<80;++u){let S=Math.floor(u/20),w=fo(g,5)+ag(S,a,m,y)+h+t[S]+c[u]>>>0;h=y,y=m,m=fo(a,30)>>>0,a=g,g=w}r[0]=r[0]+g>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+h>>>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 ug=og("v5",80,cg),lc=ug,Ec="2.30.42",dc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,xr={pageview:"pageview",event:"event"},xn=class{constructor({client:t,uuidGenerator:r=Ft}){this.client=t,this.uuidGenerator=r}},So=class extends xn{constructor({client:t,uuidGenerator:r=Ft}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=dc(window.location),this.lastReferrer=Wt()?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:Wt()?document.title:"",encoding:Wt()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},i={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),i),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:i,location:o}=this.getNextValues(t,r);this.lastReferrer=i,this.pageViewId=n,this.currentLocation=o,t===xr.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===xr.pageview?this.nextPageViewId:this.pageViewId,referrer:t===xr.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===xr.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=i=>i.replace(/^\/?(.*)$/,"/$1");return`${(i=>i.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return dc(window.location)}},st=class e{constructor(t,r){if(!Rn(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(i=>new RegExp(i.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,i]=r;if(n.length!==32||isNaN(parseInt(i)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Rn(o)?new e(o,Number.parseInt(i)*1e3):null}};st.cvo_cid="cvo_cid";st.expirationTime=120;var vo=class extends xn{constructor({client:t,uuidGenerator:r=Ft}){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 P(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)}};vo.Id="link";var ke=Object.keys;function wn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var go=128,kc=192,pc=224,fc=240;function lg(e){return(e&248)===fc?4:(e&fc)===pc?3:(e&pc)===kc?2:1}function dg(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&go)!=go)break;if(r-=3,(n&kc)!=go){t-r>=lg(n)*3&&(r=t);break}}return e.substring(0,r)}var Co={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"},pg=ke(Co).map(e=>Co[e]),fg=[...pg].join("|"),gg=new RegExp(`^(${fg}$)`),mg={svcAction:"svc_action",svcActionData:"svc_action_data"},hg=e=>ke(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Co[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),yg=e=>gg.test(e),Sg=[yg],gc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},mc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},fe={action:"pa",list:"pal",listSource:"pls"},In={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},vg=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ao={id:"quoteId",affiliation:"quoteAffiliation"},bo={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Cg={add:fe,bookmark_add:fe,bookmark_remove:fe,click:fe,checkout:fe,checkout_option:fe,detail:fe,impression:fe,remove:fe,refund:Object.assign(Object.assign({},fe),In),purchase:Object.assign(Object.assign({},fe),In),quickview:fe,quote:Object.assign(Object.assign({},fe),Ao),review:Object.assign(Object.assign({},fe),bo)},Ag=ke(gc).map(e=>gc[e]),bg=ke(mc).map(e=>mc[e]),wg=ke(fe).map(e=>fe[e]),Rg=ke(In).map(e=>In[e]),xg=ke(bo).map(e=>bo[e]),Ig=ke(Ao).map(e=>Ao[e]),Eg=[...Ag,"custom"].join("|"),kg=[...bg,"custom"].join("|"),Pc="(pr[0-9]+)",Oc="(il[0-9]+pi[0-9]+)",Pg=new RegExp(`^${Pc}(${Eg})$`),Og=new RegExp(`^(${Oc}(${kg}))|(il[0-9]+nm)$`),Fg=new RegExp(`^(${wg.join("|")})$`),Tg=new RegExp(`^(${Rg.join("|")})$`),Dg=new RegExp(`^${Pc}custom$`),Mg=new RegExp(`^${Oc}custom$`),qg=new RegExp(`^(${[...vg,...xg,...Ig].join("|")})$`),Ng=e=>Pg.test(e),_g=e=>Og.test(e),Lg=e=>Fg.test(e),jg=e=>Tg.test(e),Ug=e=>qg.test(e),Vg=[_g,Ng,Lg,jg,Ug],Bg=[Dg,Mg],Qg={anonymizeIp:"aip"},$g={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Hg={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},zg=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Gg=Object.assign(Object.assign(Object.assign(Object.assign({},Qg),$g),Hg),zg.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),wo=Object.assign(Object.assign({},Gg),mg),Wg=e=>{let t=!!e.action&&Cg[e.action]||{};return ke(e).reduce((r,n)=>{let i=t[n]||wo[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})},{})},Yg=ke(wo).map(e=>wo[e]),Kg=e=>Yg.indexOf(e)!==-1,Jg=e=>e==="custom",Xg=e=>[...Vg,...Sg,Kg,Jg].some(t=>t(e)),Zg=e=>ke(e).reduce((t,r)=>{let n=em(r);return n?Object.assign(Object.assign({},t),tm(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),em=e=>{let t;return[...Bg].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},tm=(e,t)=>ke(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ro=class{constructor(t){this.opts=t}sendEvent(t,r){return P(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:i}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:s,payload:c}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,i),g=this.encodeForEventType(t,c),a=new Blob([g],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(s,a)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return P(this,void 0,void 0,function*(){let i=t,o=r;if(n){let s=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:c,body:g}=s;i=c||t;try{o=JSON.parse(g)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:o,url:i}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return P(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,i=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",i?`visitorId=${i}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[K.click,K.custom,K.search,K.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let i=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(i=`access_token=${encodeURIComponent(n)}&${i}`),i}},xo=class{sendEvent(t,r){return P(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return P(this,void 0,void 0,function*(){return Promise.resolve()})}},hc=b.fetch,En=class{constructor(t){this.opts=t}sendEvent(t,r){return P(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:i,preprocessRequest:o}=this.opts,s=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",c={url:`${n}/analytics/${t}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},g=Object.assign(Object.assign({},c),o?yield o(c,"analyticsFetch"):{}),{url:a}=g,m=Ke(g,["url"]),y;try{y=yield hc(a,m)}catch(h){console.error("An error has occured when sending the event.",h);return}if(y.ok){let h=yield y.json();return h.visitorId&&i.setCurrentVisitorId(h.visitorId),h}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return P(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield hc(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[K.click,K.custom,K.search,K.view].indexOf(t)!==-1}getVisitorIdParam(){return P(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"})}},Io=class{constructor(t,r){ho()&&Ac()?this.storage=new yo:ho()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Kt),this.client=new En(t),this.beaconClient=new Ro(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:i,payload:o}of n)this.beaconClient.sendEvent(i,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Eo=class{constructor(t,r){this.storage=r||new Kt,this.client=new En(t)}getClientDependingOnEventType(t){return this.client}},kn=class{constructor(){this.storage=new Kt,this.client=new xo}getClientDependingOnEventType(t){return this.client}},rm="xx",nm=e=>e?.startsWith(rm)||!1,im=`
26
26
  We've detected you're using React Native but have not provided the corresponding runtime,
27
27
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
@@ -149,8 +149,10 @@ export * from './features/commerce/recent-queries/recent-queries-actions-loader.
149
149
  export * from './features/commerce/standalone-search-box-set/standalone-search-box-set-actions-loader.js';
150
150
  export { buildResultTemplatesManager } from './features/result-templates/result-templates-manager.js';
151
151
  export type { BaseProduct, Product, ChildProduct, } from './api/commerce/common/product.js';
152
- export type { SortCriterion, SortByDate, SortByField, SortByNoSort, SortByQRE, SortByRelevancy, } from './features/sort-criteria/criteria.js';
153
- export { SortBy, SortOrder, buildDateSortCriterion, buildCriterionExpression, buildFieldSortCriterion, buildNoSortCriterion, buildQueryRankingExpressionSortCriterion, buildRelevanceSortCriterion, } from './features/sort-criteria/criteria.js';
152
+ export type { SortByDate, SortByField, SortByNoSort, SortByQRE, SortByRelevancy, } from './features/sort-criteria/criteria.js';
153
+ export { SortOrder, buildDateSortCriterion, buildCriterionExpression, buildFieldSortCriterion, buildNoSortCriterion, buildQueryRankingExpressionSortCriterion, buildRelevanceSortCriterion, } from './features/sort-criteria/criteria.js';
154
+ export type { SortCriterion } from './features/commerce/sort/sort.js';
155
+ export { SortBy } from './features/commerce/sort/sort.js';
154
156
  export { parseCriterionExpression } from './features/sort-criteria/criteria-parser.js';
155
157
  export type { Template } from './features/templates/templates-manager.js';
156
158
  export type { ProductTemplate, ProductTemplateCondition, ProductTemplatesManager, } from './features/commerce/product-templates/product-templates-manager.js';