@coveo/headless 3.16.1-pre.2f5ed054e8 → 3.16.1-pre.3f4a309ff4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/case-assist/headless.esm.js +1 -1
- package/dist/browser/case-assist/headless.js +1 -1
- package/dist/browser/commerce/headless.esm.js +1 -1
- package/dist/browser/commerce/headless.js +1 -1
- package/dist/browser/headless.esm.js +1 -1
- package/dist/browser/headless.js +1 -1
- package/dist/browser/insight/headless.esm.js +1 -1
- package/dist/browser/insight/headless.js +1 -1
- package/dist/browser/recommendation/headless.esm.js +1 -1
- package/dist/browser/recommendation/headless.js +1 -1
- package/dist/browser/ssr/headless.esm.js +1 -1
- package/dist/browser/ssr/headless.js +1 -1
- package/dist/browser/ssr-commerce/headless.esm.js +1 -1
- package/dist/browser/ssr-commerce/headless.js +1 -1
- package/dist/case-assist/headless.cjs +1 -1
- package/dist/case-assist/headless.esm.js +1 -1
- package/dist/commerce/headless.cjs +1 -1
- package/dist/commerce/headless.esm.js +1 -1
- package/dist/headless.cjs +1 -1
- package/dist/headless.esm.js +1 -1
- package/dist/insight/headless.cjs +1 -1
- package/dist/insight/headless.esm.js +1 -1
- package/dist/quantic/case-assist/headless.js +1 -1
- package/dist/quantic/commerce/headless.js +1 -1
- package/dist/quantic/headless.js +1 -1
- package/dist/quantic/insight/headless.js +1 -1
- package/dist/quantic/recommendation/headless.js +1 -1
- package/dist/recommendation/headless.cjs +1 -1
- package/dist/recommendation/headless.esm.js +1 -1
- package/dist/ssr/headless.cjs +1 -1
- package/dist/ssr/headless.esm.js +1 -1
- package/dist/ssr-commerce/headless.cjs +1 -1
- package/dist/ssr-commerce/headless.esm.js +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
var Mb=Object.create;var Sc=Object.defineProperty;var Lb=Object.getOwnPropertyDescriptor;var Qb=Object.getOwnPropertyNames;var Bb=Object.getPrototypeOf,Ub=Object.prototype.hasOwnProperty;var _b=(e,t,r)=>t in e?Sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jb=(e,t)=>{for(var r in t)Sc(e,r,{get:t[r],enumerable:!0})},$b=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qb(t))!Ub.call(e,o)&&o!==r&&Sc(e,o,{get:()=>t[o],enumerable:!(n=Lb(t,o))||n.enumerable});return e};var Ot=(e,t,r)=>(r=e!=null?Mb(Bb(e)):{},$b(t||!e||!e.__esModule?Sc(r,"default",{value:e,enumerable:!0}):r,e));var pe=(e,t,r)=>_b(e,typeof t!="symbol"?t+"":t,r);var rS=Ee(ji=>{"use strict";var Fc=ji&&ji.__assign||function(){return Fc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Fc.apply(this,arguments)};Object.defineProperty(ji,"__esModule",{value:!0});var rv={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function nv(e){var t=Fc(Fc({},rv),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}ji.getSanitizedOptions=nv});var nS=Ee(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});function ov(e){var t=Math.random()*e;return Math.round(t)}Tp.fullJitter=ov});var oS=Ee(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});function av(e){return e}kp.noJitter=av});var aS=Ee(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var iv=nS(),sv=oS();function cv(e){switch(e.jitter){case"full":return iv.fullJitter;case"none":default:return sv.noJitter}}Op.JitterFactory=cv});var Dp=Ee(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var uv=aS(),lv=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=uv.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();qp.Delay=lv});var iS=Ee(Ar=>{"use strict";var dv=Ar&&Ar.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pv=Ar&&Ar.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},mv=Ar&&Ar.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=u[0]&2?o.return:u[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;switch(o=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ar,"__esModule",{value:!0});var fv=Dp(),gv=function(e){dv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return pv(this,void 0,void 0,function(){return mv(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(fv.Delay);Ar.SkipFirstDelay=gv});var sS=Ee($i=>{"use strict";var Sv=$i&&$i.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($i,"__esModule",{value:!0});var hv=Dp(),yv=function(e){Sv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(hv.Delay);$i.AlwaysDelay=yv});var cS=Ee(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var Cv=iS(),xv=sS();function Av(e,t){var r=Fv(e);return r.setAttemptNumber(t),r}Vp.DelayFactory=Av;function Fv(e){return e.delayFirstAttempt?new xv.AlwaysDelay(e):new Cv.SkipFirstDelay(e)}});var uS=Ee(_n=>{"use strict";var Np=_n&&_n.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Mp=_n&&_n.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=u[0]&2?o.return:u[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;switch(o=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(_n,"__esModule",{value:!0});var Rv=rS(),bv=cS();function vv(e,t){return t===void 0&&(t={}),Np(this,void 0,void 0,function(){var r,n;return Mp(this,function(o){switch(o.label){case 0:return r=Rv.getSanitizedOptions(t),n=new Pv(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}_n.backOff=vv;var Pv=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Np(this,void 0,void 0,function(){var t,r;return Mp(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Np(this,void 0,void 0,function(){var t;return Mp(this,function(r){switch(r.label){case 0:return t=bv.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var du=Ee((Bm,Um)=>{"use strict";(function(e,t){typeof Bm=="object"&&typeof Um<"u"?Um.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Bm,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",s="day",c="week",u="month",l="quarter",m="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var O=["th","st","nd","rd"],k=q%100;return"["+q+(O[(k-20)%10]||O[k]||O[0])+"]"}},h=function(q,O,k){var Q=String(q);return!Q||Q.length>=O?q:""+Array(O+1-Q.length).join(k)+q},g={s:h,z:function(q){var O=-q.utcOffset(),k=Math.abs(O),Q=Math.floor(k/60),L=k%60;return(O<=0?"+":"-")+h(Q,2,"0")+":"+h(L,2,"0")},m:function q(O,k){if(O.date()<k.date())return-q(k,O);var Q=12*(k.year()-O.year())+(k.month()-O.month()),L=O.clone().add(Q,u),W=k-L<0,j=O.clone().add(Q+(W?-1:1),u);return+(-(Q+(k-L)/(W?L-j:j-L))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:u,y:m,w:c,d:s,D:d,h:i,m:a,s:o,ms:n,Q:l}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},x="en",F={};F[x]=S;var I="$isDayjsObject",b=function(q){return q instanceof T||!(!q||!q[I])},R=function q(O,k,Q){var L;if(!O)return x;if(typeof O=="string"){var W=O.toLowerCase();F[W]&&(L=W),k&&(F[W]=k,L=W);var j=O.split("-");if(!L&&j.length>1)return q(j[0])}else{var K=O.name;F[K]=O,L=K}return!Q&&L&&(x=L),L||!Q&&x},E=function(q,O){if(b(q))return q.clone();var k=typeof O=="object"?O:{};return k.date=q,k.args=arguments,new T(k)},w=g;w.l=R,w.i=b,w.w=function(q,O){return E(q,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var T=function(){function q(k){this.$L=R(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[I]=!0}var O=q.prototype;return O.parse=function(k){this.$d=function(Q){var L=Q.date,W=Q.utc;if(L===null)return new Date(NaN);if(w.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var j=L.match(f);if(j){var K=j[2]-1||0,Z=(j[7]||"0").substring(0,3);return W?new Date(Date.UTC(j[1],K,j[3]||1,j[4]||0,j[5]||0,j[6]||0,Z)):new Date(j[1],K,j[3]||1,j[4]||0,j[5]||0,j[6]||0,Z)}}return new Date(L)}(k),this.init()},O.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},O.$utils=function(){return w},O.isValid=function(){return this.$d.toString()!==p},O.isSame=function(k,Q){var L=E(k);return this.startOf(Q)<=L&&L<=this.endOf(Q)},O.isAfter=function(k,Q){return E(k)<this.startOf(Q)},O.isBefore=function(k,Q){return this.endOf(Q)<E(k)},O.$g=function(k,Q,L){return w.u(k)?this[Q]:this.set(L,k)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(k,Q){var L=this,W=!!w.u(Q)||Q,j=w.p(k),K=function(kt,Ie){var nt=w.w(L.$u?Date.UTC(L.$y,Ie,kt):new Date(L.$y,Ie,kt),L);return W?nt:nt.endOf(s)},Z=function(kt,Ie){return w.w(L.toDate()[kt].apply(L.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Ie)),L)},re=this.$W,oe=this.$M,ae=this.$D,de="set"+(this.$u?"UTC":"");switch(j){case m:return W?K(1,0):K(31,11);case u:return W?K(1,oe):K(0,oe+1);case c:var we=this.$locale().weekStart||0,Un=(re<we?re+7:re)-we;return K(W?ae-Un:ae+(6-Un),oe);case s:case d:return Z(de+"Hours",0);case i:return Z(de+"Minutes",1);case a:return Z(de+"Seconds",2);case o:return Z(de+"Milliseconds",3);default:return this.clone()}},O.endOf=function(k){return this.startOf(k,!1)},O.$set=function(k,Q){var L,W=w.p(k),j="set"+(this.$u?"UTC":""),K=(L={},L[s]=j+"Date",L[d]=j+"Date",L[u]=j+"Month",L[m]=j+"FullYear",L[i]=j+"Hours",L[a]=j+"Minutes",L[o]=j+"Seconds",L[n]=j+"Milliseconds",L)[W],Z=W===s?this.$D+(Q-this.$W):Q;if(W===u||W===m){var re=this.clone().set(d,1);re.$d[K](Z),re.init(),this.$d=re.set(d,Math.min(this.$D,re.daysInMonth())).$d}else K&&this.$d[K](Z);return this.init(),this},O.set=function(k,Q){return this.clone().$set(k,Q)},O.get=function(k){return this[w.p(k)]()},O.add=function(k,Q){var L,W=this;k=Number(k);var j=w.p(Q),K=function(oe){var ae=E(W);return w.w(ae.date(ae.date()+Math.round(oe*k)),W)};if(j===u)return this.set(u,this.$M+k);if(j===m)return this.set(m,this.$y+k);if(j===s)return K(1);if(j===c)return K(7);var Z=(L={},L[a]=t,L[i]=r,L[o]=e,L)[j]||1,re=this.$d.getTime()+k*Z;return w.w(re,this)},O.subtract=function(k,Q){return this.add(-1*k,Q)},O.format=function(k){var Q=this,L=this.$locale();if(!this.isValid())return L.invalidDate||p;var W=k||"YYYY-MM-DDTHH:mm:ssZ",j=w.z(this),K=this.$H,Z=this.$m,re=this.$M,oe=L.weekdays,ae=L.months,de=L.meridiem,we=function(Ie,nt,xr,Br){return Ie&&(Ie[nt]||Ie(Q,W))||xr[nt].slice(0,Br)},Un=function(Ie){return w.s(K%12||12,Ie,"0")},kt=de||function(Ie,nt,xr){var Br=Ie<12?"AM":"PM";return xr?Br.toLowerCase():Br};return W.replace(y,function(Ie,nt){return nt||function(xr){switch(xr){case"YY":return String(Q.$y).slice(-2);case"YYYY":return w.s(Q.$y,4,"0");case"M":return re+1;case"MM":return w.s(re+1,2,"0");case"MMM":return we(L.monthsShort,re,ae,3);case"MMMM":return we(ae,re);case"D":return Q.$D;case"DD":return w.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return we(L.weekdaysMin,Q.$W,oe,2);case"ddd":return we(L.weekdaysShort,Q.$W,oe,3);case"dddd":return oe[Q.$W];case"H":return String(K);case"HH":return w.s(K,2,"0");case"h":return Un(1);case"hh":return Un(2);case"a":return kt(K,Z,!0);case"A":return kt(K,Z,!1);case"m":return String(Z);case"mm":return w.s(Z,2,"0");case"s":return String(Q.$s);case"ss":return w.s(Q.$s,2,"0");case"SSS":return w.s(Q.$ms,3,"0");case"Z":return j}return null}(Ie)||j.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(k,Q,L){var W,j=this,K=w.p(Q),Z=E(k),re=(Z.utcOffset()-this.utcOffset())*t,oe=this-Z,ae=function(){return w.m(j,Z)};switch(K){case m:W=ae()/12;break;case u:W=ae();break;case l:W=ae()/3;break;case c:W=(oe-re)/6048e5;break;case s:W=(oe-re)/864e5;break;case i:W=oe/r;break;case a:W=oe/t;break;case o:W=oe/e;break;default:W=oe}return L?W:w.a(W)},O.daysInMonth=function(){return this.endOf(u).$D},O.$locale=function(){return F[this.$L]},O.locale=function(k,Q){if(!k)return this.$L;var L=this.clone(),W=R(k,Q,!0);return W&&(L.$L=W),L},O.clone=function(){return w.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},q}(),U=T.prototype;return E.prototype=U,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",s],["$M",u],["$y",m],["$D",d]].forEach(function(q){U[q[1]]=function(O){return this.$g(O,q[0],q[1])}}),E.extend=function(q,O){return q.$i||(q(O,T,E),q.$i=!0),E},E.locale=R,E.isDayjs=b,E.unix=function(q){return E(1e3*q)},E.en=F[x],E.Ls=F,E.p={},E})});var hy=Ee((_m,jm)=>{"use strict";(function(e,t){typeof _m=="object"&&typeof jm<"u"?jm.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_quarterOfYear=t()})(_m,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var a=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):a.bind(this)(s,c)};var i=o.startOf;o.startOf=function(s,c){var u=this.$utils(),l=!!u.u(c)||c;if(u.p(s)===t){var m=this.quarter()-1;return l?this.month(3*m).startOf(e).startOf("day"):this.month(3*m+2).endOf(e).endOf("day")}return i.bind(this)(s,c)}}})});var yy=Ee(($m,Gm)=>{"use strict";(function(e,t){typeof $m=="object"&&typeof Gm<"u"?Gm.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_customParseFormat=t()})($m,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},s=function(f){return(f=+f)+(f>68?1900:2e3)},c=function(f){return function(y){this[f]=+y}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(f){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var S=y.match(/([+-]|\d\d)/g),h=60*S[1]+(+S[2]||0);return h===0?0:S[0]==="+"?-h:h}(f)}],l=function(f){var y=i[f];return y&&(y.indexOf?y:y.s.concat(y.f))},m=function(f,y){var S,h=i.meridiem;if(h){for(var g=1;g<=24;g+=1)if(f.indexOf(h(g,0,y))>-1){S=g>12;break}}else S=f===(y?"pm":"PM");return S},d={A:[a,function(f){this.afternoon=m(f,!1)}],a:[a,function(f){this.afternoon=m(f,!0)}],Q:[r,function(f){this.month=3*(f-1)+1}],S:[r,function(f){this.milliseconds=100*+f}],SS:[n,function(f){this.milliseconds=10*+f}],SSS:[/\d{3}/,function(f){this.milliseconds=+f}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[a,function(f){var y=i.ordinal,S=f.match(/\d+/);if(this.day=S[0],y)for(var h=1;h<=31;h+=1)y(h).replace(/\[|\]/g,"")===f&&(this.day=h)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[a,function(f){var y=l("months"),S=(l("monthsShort")||y.map(function(h){return h.slice(0,3)})).indexOf(f)+1;if(S<1)throw new Error;this.month=S%12||S}],MMMM:[a,function(f){var y=l("months").indexOf(f)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(f){this.year=s(f)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function p(f){var y,S;y=f,S=i&&i.formats;for(var h=(f=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(E,w,T){var U=T&&T.toUpperCase();return w||S[T]||e[T]||S[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(q,O,k){return O||k.slice(1)})})).match(t),g=h.length,x=0;x<g;x+=1){var F=h[x],I=d[F],b=I&&I[0],R=I&&I[1];h[x]=R?{regex:b,parser:R}:F.replace(/^\[|\]$/g,"")}return function(E){for(var w={},T=0,U=0;T<g;T+=1){var q=h[T];if(typeof q=="string")U+=q.length;else{var O=q.regex,k=q.parser,Q=E.slice(U),L=O.exec(Q)[0];k.call(w,L),E=E.replace(L,"")}}return function(W){var j=W.afternoon;if(j!==void 0){var K=W.hours;j?K<12&&(W.hours+=12):K===12&&(W.hours=0),delete W.afternoon}}(w),w}}return function(f,y,S){S.p.customParseFormat=!0,f&&f.parseTwoDigitYear&&(s=f.parseTwoDigitYear);var h=y.prototype,g=h.parse;h.parse=function(x){var F=x.date,I=x.utc,b=x.args;this.$u=I;var R=b[1];if(typeof R=="string"){var E=b[2]===!0,w=b[3]===!0,T=E||w,U=b[2];w&&(U=b[2]),i=this.$locale(),!E&&U&&(i=S.Ls[U]),this.$d=function(Q,L,W,j){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*Q);var K=p(L)(Q),Z=K.year,re=K.month,oe=K.day,ae=K.hours,de=K.minutes,we=K.seconds,Un=K.milliseconds,kt=K.zone,Ie=K.week,nt=new Date,xr=oe||(Z||re?1:nt.getDate()),Br=Z||nt.getFullYear(),fc=0;Z&&!re||(fc=re>0?re-1:nt.getMonth());var gc,xp=ae||0,Ap=de||0,Fp=we||0,Rp=Un||0;return kt?new Date(Date.UTC(Br,fc,xr,xp,Ap,Fp,Rp+60*kt.offset*1e3)):W?new Date(Date.UTC(Br,fc,xr,xp,Ap,Fp,Rp)):(gc=new Date(Br,fc,xr,xp,Ap,Fp,Rp),Ie&&(gc=j(gc).week(Ie).toDate()),gc)}catch{return new Date("")}}(F,R,I,S),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),T&&F!=this.format(R)&&(this.$d=new Date("")),i={}}else if(R instanceof Array)for(var q=R.length,O=1;O<=q;O+=1){b[1]=R[O-1];var k=S.apply(this,b);if(k.isValid()){this.$d=k.$d,this.$L=k.$L,this.init();break}O===q&&(this.$d=new Date(""))}else g.call(this,x)}}})});var OC=Ee((JH,kC)=>{"use strict";var yk=/(^|; )Coveo-Pendragon=([^;]*)/;kC.exports=()=>yk.exec(document.cookie)?.pop()||null});var qC=Ee((Sf,hf)=>{"use strict";(function(e,t){typeof Sf=="object"&&typeof hf<"u"?hf.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(Sf,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(l,m,d){d===void 0&&(d={});var p=new Date(l),f=function(y,S){S===void 0&&(S={});var h=S.timeZoneName||"short",g=y+"|"+h,x=t[g];return x||(x=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:y,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:h}),t[g]=x),x}(m,d);return f.formatToParts(p)},s=function(l,m){for(var d=i(l,m),p=[],f=0;f<d.length;f+=1){var y=d[f],S=y.type,h=y.value,g=e[S];g>=0&&(p[g]=parseInt(h,10))}var x=p[3],F=x===24?0:x,I=p[0]+"-"+p[1]+"-"+p[2]+" "+F+":"+p[4]+":"+p[5]+":000",b=+l;return(o.utc(I).valueOf()-(b-=b%1e3))/6e4},c=n.prototype;c.tz=function(l,m){l===void 0&&(l=a);var d,p=this.utcOffset(),f=this.toDate(),y=f.toLocaleString("en-US",{timeZone:l}),S=Math.round((f-new Date(y))/1e3/60),h=15*-Math.round(f.getTimezoneOffset()/15)-S;if(!Number(h))d=this.utcOffset(0,m);else if(d=o(y,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),m){var g=d.utcOffset();d=d.add(p-g,"minute")}return d.$x.$timezone=l,d},c.offsetName=function(l){var m=this.$x.$timezone||o.tz.guess(),d=i(this.valueOf(),m,{timeZoneName:l}).find(function(p){return p.type.toLowerCase()==="timezonename"});return d&&d.value};var u=c.startOf;c.startOf=function(l,m){if(!this.$x||!this.$x.$timezone)return u.call(this,l,m);var d=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(d,l,m).tz(this.$x.$timezone,!0)},o.tz=function(l,m,d){var p=d&&m,f=d||m||a,y=s(+o(),f);if(typeof l!="string")return o(l).tz(f);var S=function(F,I,b){var R=F-60*I*1e3,E=s(R,b);if(I===E)return[R,I];var w=s(R-=60*(E-I)*1e3,b);return E===w?[R,E]:[F-60*Math.min(E,w)*1e3,Math.max(E,w)]}(o.utc(l,p).valueOf(),y,f),h=S[0],g=S[1],x=o(h).utcOffset(g);return x.$x.$timezone=f,x},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(l){a=l}}})});var DC=Ee((yf,Cf)=>{"use strict";(function(e,t){typeof yf=="object"&&typeof Cf<"u"?Cf.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_utc=t()})(yf,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(p){var f={date:p,utc:!0,args:arguments};return new o(f)},i.utc=function(p){var f=a(this.toDate(),{locale:this.$L,utc:!0});return p?f.add(this.utcOffset(),e):f},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=i.parse;i.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),s.call(this,p)};var c=i.init;i.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else c.call(this)};var u=i.utcOffset;i.utcOffset=function(p,f){var y=this.$utils().u;if(y(p))return this.$u?0:y(this.$offset)?u.call(this):this.$offset;if(typeof p=="string"&&(p=function(x){x===void 0&&(x="");var F=x.match(t);if(!F)return null;var I=(""+F[0]).match(r)||["-",0,0],b=I[0],R=60*+I[1]+ +I[2];return R===0?0:b==="+"?R:-R}(p),p===null))return this;var S=Math.abs(p)<=16?60*p:p,h=this;if(f)return h.$offset=S,h.$u=p===0,h;if(p!==0){var g=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(h=this.local().add(S+g,e)).$offset=S,h.$x.$localOffset=g}else h=this.utc();return h};var l=i.format;i.format=function(p){var f=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,f)},i.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var m=i.toDate;i.toDate=function(p){return p==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var d=i.diff;i.diff=function(p,f,y){if(p&&this.$u===p.$u)return d.call(this,p,f,y);var S=this.local(),h=a(p).local();return d.call(S,h,f,y)}}})});var WC=Ee((aK,GC)=>{"use strict";function Tk(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}GC.exports=kk;function kk(e,t,r){var n=r&&r.stringify||Tk,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var s=1;s<a;s++)i[s]=n(t[s]);return i.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",l=1-o,m=-1,d=e&&e.length||0,p=0;p<d;){if(e.charCodeAt(p)===37&&p+1<d){switch(m=m>-1?m:0,e.charCodeAt(p+1)){case 100:case 102:if(l>=c||t[l]==null)break;m<p&&(u+=e.slice(m,p)),u+=Number(t[l]),m=p+2,p++;break;case 105:if(l>=c||t[l]==null)break;m<p&&(u+=e.slice(m,p)),u+=Math.floor(Number(t[l])),m=p+2,p++;break;case 79:case 111:case 106:if(l>=c||t[l]===void 0)break;m<p&&(u+=e.slice(m,p));var f=typeof t[l];if(f==="string"){u+="'"+t[l]+"'",m=p+2,p++;break}if(f==="function"){u+=t[l].name||"<anonymous>",m=p+2,p++;break}u+=n(t[l]),m=p+2,p++;break;case 115:if(l>=c)break;m<p&&(u+=e.slice(m,p)),u+=String(t[l]),m=p+2,p++;break;case 37:m<p&&(u+=e.slice(m,p)),u+="%",m=p+2,p++,l--;break}++l}++p}return m===-1?e:(m<d&&(u+=e.slice(m)),u)}});var XC=Ee((iK,Zu)=>{"use strict";var HC=WC();Zu.exports=kr;var Ls=Wk().console||{},Ok={mapHttpRequest:Xu,mapHttpResponse:Xu,wrapRequestSerializer:Rf,wrapResponseSerializer:Rf,wrapErrorSerializer:Rf,req:Xu,res:Xu,err:KC,errWithCause:KC};function pn(e,t){return e==="silent"?1/0:t.levels.values[e]}var Pf=Symbol("pino.logFuncs"),bf=Symbol("pino.hierarchy"),qk={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function zC(e,t){let r={logger:t,parent:e[bf]};t[bf]=r}function Dk(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Ls[o]||Ls[qk[o]||"log"]||ka}),e[Pf]=n}function Vk(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function kr(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Ls;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=Vk(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&s.forEach(function(y){r[y]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=ka),Dk(u,s,r),zC({},u),Object.defineProperty(u,"levelVal",{get:m}),Object.defineProperty(u,"level",{get:d,set:p});let l={transmit:t,serialize:o,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:s,timestamp:jk(e),messageKey:e.messageKey||"msg",onChild:e.onChild||ka};u.levels=Nk(e),u.level=c,u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=ka,u.serializers=n,u._serialize=o,u._stdErrSerialize=a,u.child=function(...y){return f.call(this,l,...y)},t&&(u._logEvent=vf());function m(){return pn(this.level,this)}function d(){return this._level}function p(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,no(this,l,u,"error"),no(this,l,u,"fatal"),no(this,l,u,"warn"),no(this,l,u,"info"),no(this,l,u,"debug"),no(this,l,u,"trace"),i.forEach(S=>{no(this,l,u,S)})}function f(y,S,h){if(!S)throw new Error("missing bindings for child Pino");h=h||{},o&&S.serializers&&(h.serializers=S.serializers);let g=h.serializers;if(o&&g){var x=Object.assign({},n,g),F=e.browser.serialize===!0?Object.keys(x):o;delete S.serializers,wf([S],F,x,this._stdErrSerialize)}function I(R){this._childLevel=(R._childLevel|0)+1,this.bindings=S,x&&(this.serializers=x,this._serialize=F),t&&(this._logEvent=vf([].concat(R._logEvent.bindings,S)))}I.prototype=this;let b=new I(this);return zC(this,b),b.child=function(...R){return f.call(this,y,...R)},b.level=h.level||this.level,y.onChild(b),b}return u}function Nk(e){let t=e.customLevels||{},r=Object.assign({},kr.levels.values,t),n=Object.assign({},kr.levels.labels,Mk(t));return{values:r,labels:n}}function Mk(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}kr.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};kr.stdSerializers=Ok;kr.stdTimeFunctions=Object.assign({},{nullTime:YC,epochTime:JC,unixTime:$k,isoTime:Gk});function Lk(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[bf];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function no(e,t,r,n){if(Object.defineProperty(e,n,{value:pn(e.level,r)>pn(n,r)?ka:r[Pf][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===ka){if(!t.transmit)return;let a=t.transmit.level||e.level,i=pn(a,r);if(pn(n,r)<i)return}e[n]=Bk(e,t,r,n);let o=Lk(e);o.length!==0&&(e[n]=Qk(o,e[n]))}function Qk(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Bk(e,t,r,n){return function(o){return function(){let i=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ls?Ls:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var l=!1;if(t.serialize&&(wf(s,this._serialize,this.serializers,this._stdErrSerialize),l=!0),t.asObject||t.formatters?o.call(c,Uk(this,n,s,i,t)):o.apply(c,s),t.transmit){let m=t.transmit.level||e._level,d=pn(m,r),p=pn(n,r);if(p<d)return;_k(this,{ts:i,methodLevel:n,methodValue:p,transmitLevel:m,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:pn(e._level,r)},s,l)}}}(e[Pf][n])}function Uk(e,t,r,n,o){let{level:a,log:i=d=>d}=o.formatters||{},s=r.slice(),c=s[0],u={};if(n&&(u.time=n),a){let d=a(t,e.levels.values[t]);Object.assign(u,d)}else u.level=e.levels.values[t];let l=(e._childLevel|0)+1;if(l<1&&(l=1),c!==null&&typeof c=="object"){for(;l--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?HC(s.shift(),s):void 0}else typeof c=="string"&&(c=HC(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),i(u)}function wf(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=kr.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function _k(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||wf(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(l){return u.indexOf(l)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=s,o(i,e._logEvent,c),e._logEvent=vf(u)}function vf(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function KC(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function jk(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?YC:JC}function Xu(){return{}}function Rf(e){return e}function ka(){}function YC(){return!1}function JC(){return Date.now()}function $k(){return Math.round(Date.now()/1e3)}function Gk(){return new Date(Date.now()).toISOString()}function Wk(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}Zu.exports.default=kr;Zu.exports.pino=kr});var zg={};jb(zg,{escape:()=>wo,getHighlightedSuggestion:()=>vp,highlightString:()=>zb});import{isNullOrUndefined as Hb}from"@coveo/bueno";var Ur=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function hc(e){return Array.isArray(e)}function yc(e){return e.trim()===""}function $g(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function Gb(e){return btoa(encodeURI(e))}function Cc(e,t){let{[e]:r,...n}=t;return n}function Po(e){return Gb(JSON.stringify(e))}var Wb=new Set(["1",1,"yes",!0]);function Gg(){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=>Wb.has(r))}function Wg(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Hg(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Ui(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function zb(e){if(yc(e.openingDelimiter)||yc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(Hb(e.content)||yc(e.content))return e.content;if(e.highlights.length===0)return wo(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,s=i+a.length;if(s>t)break;r+=wo(e.content.slice(n,i)),r+=e.openingDelimiter,r+=wo(e.content.slice(i,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=wo(e.content.slice(n))),r}function vp(e,t){return e=wo(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?bp(n,t.notMatchDelimiters):o?bp(o,t.exactMatchDelimiters):a?bp(a,t.correctionDelimiters):r)}function bp(e,t){return t?t.open+e+t.close:e}function wo(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}async function Yg(e,t){let r=e.getReader(),n;for(;!(n=await r.read()).done;)t(n.value)}function Jg(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=Yb(t,i);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function Xg(e,t,r){let n=Kg(),o=new TextDecoder;return function(i,s){if(i.length===0)r?.(n),n=Kg();else if(s>0){let c=o.decode(i.subarray(0,s)),u=s+(i[s+1]===32?2:1),l=o.decode(i.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
|
|
19
|
-
`+l:l;break;case"event":n.event=l;break;case"id":e(n.id=l);break;case"retry":Kb(l,n,t);break}}}}function Kb(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function Yb(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Kg(){return{data:"",event:"",id:"",retry:void 0}}var Pp="text/event-stream",Jb=1e3,Zg="last-event-id";function eS(){return typeof window<"u"}function xc(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:s,fetch:c,...u}){return new Promise((l,m)=>{let d={...r};d.accept||(d.accept=Pp);let p;function f(){p?.abort(),document.hidden||F()}!s&&eS()&&document.addEventListener("visibilitychange",f);let y=Jb,S;function h(){eS()&&document.removeEventListener("visibilitychange",f),clearTimeout(S),p?.abort()}t?.addEventListener("abort",()=>{h(),l()});let g=c??fetch,x=n??Xb;async function F(){p=AbortController?new AbortController:null;try{let I=await g(e,{...u,headers:d,signal:p?.signal});await x(I),await Yg(I.body,Jg(Xg(b=>{b?d[Zg]=b:delete d[Zg]},b=>{y=b},o))),a?.(),h(),l()}catch(I){if(!p?.signal?.aborted)try{let b=i?.(I)??y;clearTimeout(S),S=setTimeout(F,b)}catch(b){h(),m(b)}}}F()})}function Xb(e){let t=e.headers.get("content-type");if(!t?.startsWith(Pp))throw new Error(`Expected content-type to be ${Pp}, Actual: ${t}`)}var _r=class{constructor(t){pe(this,"_basePath");pe(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}};var Zb=(e,t,r)=>new _r(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,tS=3,ev=5e3,tv="text/event-stream",Ep=1,wp=class extends Error{},_i=class extends Error{constructor(r){super(r.message);this.payload=r}},Ip=class{constructor(){pe(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Ac=class{constructor(t){pe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:s,abort:c,close:u,resetAnswer:l}=r,m=new Ip;if(!a){this.logger.error("No stream ID found");return}let d=0,p,f=()=>{p&&!m.isActive(p)&&(S?.abort(),l(),h())},y=()=>{m.remove(p),p=Hg(f,p,ev),m.add(p)},S=new AbortController,h=()=>xc(Zb(n,o,a),{method:"GET",fetch,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:S?.signal,async onopen(g){if(g.ok&&g.headers.get("content-type")===tv)return;throw g.status>=400&&g.status<500&&g.status!==429?new _i({message:"Error opening stream",code:g.status}):new wp},onmessage:g=>{if(S?.signal.aborted)return;let x=JSON.parse(g.data);if(x.finishReason==="ERROR"){m.remove(p),S?.abort(),c({message:x.errorMessage,code:x.statusCode});return}s(x),d=0,x.finishReason==="COMPLETED"?(m.remove(p),u()):y()},onerror:g=>{if(!S?.signal.aborted){if(m.remove(p),g instanceof _i)throw S?.abort(),c(g),g;if(++d>tS){this.logger.info("Maximum retry exceeded.");let x={message:"Failed to complete stream.",code:Ep};throw S?.abort(),c(x),new _i(x)}this.logger.info(`Retrying...(${d}/${tS})`),l()}}});return h(),S}};var mS=Ot(uS(),1);var wv="recommendation-internal-options",v0=Symbol.for(wv);var N=new Error("Failed to load reducers."),Io=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var jn=class extends Error{constructor(r,n){super();pe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};function lS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function dS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Iv)}function Iv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function pS(e){return e===429}var ot=class e{static async call(t){let r=Ev(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,s=async()=>{let c=await fetch(a,i);if(pS(c.status))throw c;return c};try{let c=await(0,mS.backOff)(s,{retry:u=>{let l=u&&pS(u.status);return l&&n.info("Platform retrying request"),l}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Io;case 404:throw new jn(a,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new jn(a):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:s,...c}=t,u=Ui(c);try{let l=await o(t,n,i);return{...t,...l}}catch(l){a.error(l,"Platform request preprocessing failed. Returning default request options.")}return u}};function De(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function xe(e,t="prod"){return`${De(e,t)}/rest/search/v2`}function Lp(e,t="prod"){return`${De(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Ev(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,s=e.method==="POST"||e.method==="PUT",c=Tv(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:c},signal:i}}function Tv(e,t){return t==="application/x-www-form-urlencoded"?dS(e)?lS(e):"":JSON.stringify(e)}var Rc=e=>e;var fS=e=>e,gS=e=>e,SS=e=>e;import{isNullOrUndefined as Qv}from"@coveo/bueno";function Eo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ye(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Eo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Eo(),extendedResults:{}}}function jr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var $r=e=>{let{response:t}=e;return t.body?kv(e):Ov(t)},kv=e=>Dv(e)?Vv(e):qv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Ov=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function qv(e){return e.body.statusCode!==void 0}function Dv(e){return e.body.exception!==void 0}var Vv=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});var Gr=class{constructor(){pe(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController,o=this.currentAbortController=new AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};function hS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}var Fr=(e,t,r,n)=>{let o=new _r(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var yS=(e,t)=>{let r=new _r(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},CS=async(e,t)=>{let r=await ot.call({...Fr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:jr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=hS(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return Nv(i)?{success:i}:{error:$r({response:r,body:i})}};function Nv(e){return typeof e=="string"}function Mv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Lv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Gi(e,t){if(t&&e.name==="AbortError")return{error:Lv(e)};if(e instanceof jn)return{error:Mv(e)};throw e}var bc=class{constructor(t){this.options=t;pe(this,"apiCallsQueues",{unknown:new Gr,mainSearch:new Gr,facetValues:new Gr,foldingCollection:new Gr,instantResults:new Gr})}async plan(t){let r=await ot.call({...Fr(t,"POST","application/json","/plan"),requestParams:jr(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Gi(r);let n=await r.json();return Uv(n)?{success:n}:{error:$r({response:r,body:n})}}async querySuggest(t){let r=await ot.call({...Fr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:jr(t),...this.options});if(r instanceof Error)return Gi(r);let n=await r.json(),o={response:r,body:n};return Bv(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:$r(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(s=>ot.call({...Fr(t,"POST","application/json",""),requestParams:jr(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:s??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Gi(o,r?.disableAbortWarning);let a=await o.json(),i={response:o,body:a};return xS(a)?(i.body=AS(a),{success:(await this.options.postprocessSearchResponseMiddleware(i)).body}):{error:$r(i)}}async facetSearch(t){let r=await ot.call({...Fr(t,"POST","application/json","/facet"),requestParams:jr(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await ot.call({...Fr(t,"POST","application/json",""),requestParams:jr(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(xS(n)){let o={response:r,body:n};return o.body=AS(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:$r({response:r,body:n})}}async html(t){return CS(t,{...this.options})}async fieldDescriptions(t){let r=await ot.call({...Fr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return _v(n)?{success:n}:{error:$r({response:r,body:n})}}},vc=e=>e.success!==void 0,Fe=e=>e.error!==void 0;function xS(e){return e.results!==void 0}function AS(e){let t=Eo();return Qv(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Bv(e){return e.completions!==void 0}function Uv(e){return e.preprocessingOutput!==void 0}function _v(e){return e.fields!==void 0}import{Schema as jv,SchemaValidationError as $v,StringValue as Wi,RecordValue as Gv,ArrayValue as Wv}from"@coveo/bueno";var D=new Wi({required:!0,emptyAllowed:!1}),ce=new Wi({required:!1,emptyAllowed:!1}),ne=new Wi({required:!0,emptyAllowed:!0}),FS=new Wi({required:!1,emptyAllowed:!0}),Pc=new Wv({each:D,required:!0}),RS=new Wi({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Rr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),at=(e,t)=>{if("required"in t)return{payload:new jv({value:t}).validate({value:e}).value};let o=new Gv({options:{required:!0},values:t}).validate(e);if(o)throw new $v(o);return{payload:e}},A=(e,t)=>{try{return at(e,t)}catch(r){return{payload:e,error:Rr(r)}}},Se=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return bS(e,t,r,o,"Controller initialization error")},ie=(e,t,r,n)=>{let o=`Check the options of ${n}`;return bS(e,t,r,o,"Controller initialization error")},bS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};import{isNullOrUndefined as qm,RecordValue as $I,Schema as GI,StringValue as tu}from"@coveo/bueno";function Te(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 Hv=typeof Symbol=="function"&&Symbol.observable||"@@observable",vS=Hv,Qp=()=>Math.random().toString(36).substring(7).split("").join("."),zv={INIT:`@@redux/INIT${Qp()}`,REPLACE:`@@redux/REPLACE${Qp()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Qp()}`},wc=zv;function qt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Bp(e,t,r){if(typeof e!="function")throw new Error(Te(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Te(1));return r(Bp)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,c=!1;function u(){i===a&&(i=new Map,a.forEach((S,h)=>{i.set(h,S)}))}function l(){if(c)throw new Error(Te(3));return o}function m(S){if(typeof S!="function")throw new Error(Te(4));if(c)throw new Error(Te(5));let h=!0;u();let g=s++;return i.set(g,S),function(){if(h){if(c)throw new Error(Te(6));h=!1,u(),i.delete(g),a=null}}}function d(S){if(!qt(S))throw new Error(Te(7));if(typeof S.type>"u")throw new Error(Te(8));if(typeof S.type!="string")throw new Error(Te(17));if(c)throw new Error(Te(9));try{c=!0,o=n(o,S)}finally{c=!1}return(a=i).forEach(g=>{g()}),S}function p(S){if(typeof S!="function")throw new Error(Te(10));n=S,d({type:wc.REPLACE})}function f(){let S=m;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Te(11));function g(){let F=h;F.next&&F.next(l())}return g(),{unsubscribe:S(g)}},[vS](){return this}}}return d({type:wc.INIT}),{dispatch:d,subscribe:m,getState:l,replaceReducer:p,[vS]:f}}function Kv(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:wc.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:wc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}function To(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let s=t[i];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,a;try{Kv(r)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1,l={};for(let m=0;m<n.length;m++){let d=n[m],p=r[d],f=s[d],y=p(f,c);if(typeof y>"u"){let S=c&&c.type;throw new Error(Te(14))}l[d]=y,u=u||y!==f}return u=u||n.length!==Object.keys(s).length,u?l:s}}function ko(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Te(15))},i={getState:o.getState,dispatch:(c,...u)=>a(c,...u)},s=e.map(c=>c(i));return a=ko(...s)(o.dispatch),{...o,dispatch:a}}}function Ic(e){return qt(e)&&"type"in e&&typeof e.type=="string"}var Yp=Symbol.for("immer-nothing"),Hi=Symbol.for("immer-draftable"),_e=Symbol.for("immer-state");function ke(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gn=Object.getPrototypeOf;function Je(e){return!!e&&!!e[_e]}function je(e){return e?kS(e)||Array.isArray(e)||!!e[Hi]||!!e.constructor?.[Hi]||Xi(e)||Zi(e):!1}var Yv=Object.prototype.constructor.toString();function kS(e){if(!e||typeof e!="object")return!1;let t=Gn(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)===Yv}function Jp(e){return Je(e)||ke(15,e),e[_e].base_}function zi(e,t){Wn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Wn(e){let t=e[_e];return t?t.type_:Array.isArray(e)?1:Xi(e)?2:Zi(e)?3:0}function Ki(e,t){return Wn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Up(e,t){return Wn(e)===2?e.get(t):e[t]}function OS(e,t,r){let n=Wn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Jv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xi(e){return e instanceof Map}function Zi(e){return e instanceof Set}function $n(e){return e.copy_||e.base_}function $p(e,t){if(Xi(e))return new Map(e);if(Zi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=kS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[_e];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Gn(e),n)}else{let n=Gn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function kc(e,t=!1){return Oc(e)||Je(e)||!je(e)||(Wn(e)>1&&(e.set=e.add=e.clear=e.delete=Xv),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>kc(n,!0))),e}function Xv(){ke(2)}function Oc(e){return Object.isFrozen(e)}var Gp={};function Hn(e){let t=Gp[e];return t||ke(0,e),t}function Zv(e,t){Gp[e]||(Gp[e]=t)}var Yi;function qS(){return Yi}function eP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(Hn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wp(e){Hp(e),e.drafts_.forEach(tP),e.drafts_=null}function Hp(e){e===Yi&&(Yi=e.parent_)}function IS(e){return Yi=eP(Yi,e)}function tP(e){let t=e[_e];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ES(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[_e].modified_&&(Wp(t),ke(4)),je(e)&&(e=Ec(t,e),t.parent_||Tc(t,e)),t.patches_&&Hn("Patches").generateReplacementPatches_(r[_e].base_,e,t.patches_,t.inversePatches_)):e=Ec(t,r,[]),Wp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yp?e:void 0}function Ec(e,t,r){if(Oc(t))return t;let n=t[_e];if(!n)return zi(t,(o,a)=>TS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Tc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,i=!1;n.type_===3&&(a=new Set(o),o.clear(),i=!0),zi(a,(s,c)=>TS(e,n,o,s,c,r,i)),Tc(e,o,!1),r&&e.patches_&&Hn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function TS(e,t,r,n,o,a,i){if(Je(o)){let s=a&&t&&t.type_!==3&&!Ki(t.assigned_,n)?a.concat(n):void 0,c=Ec(e,o,s);if(OS(r,n,c),Je(c))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(je(o)&&!Oc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ec(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Tc(e,o)}}function Tc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kc(t,r)}function rP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:qS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Xp;r&&(o=[n],a=Ji);let{revoke:i,proxy:s}=Proxy.revocable(o,a);return n.draft_=s,n.revoke_=i,s}var Xp={get(e,t){if(t===_e)return e;let r=$n(e);if(!Ki(r,t))return nP(e,r,t);let n=r[t];return e.finalized_||!je(n)?n:n===_p(e.base_,t)?(jp(e),e.copy_[t]=Kp(n,e)):n},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=DS($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=_p($n(e),t),a=o?.[_e];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Jv(r,o)&&(r!==void 0||Ki(e.base_,t)))return!0;jp(e),zp(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 _p(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,jp(e),zp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ke(11)},getPrototypeOf(e){return Gn(e.base_)},setPrototypeOf(){ke(12)}},Ji={};zi(Xp,(e,t)=>{Ji[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ji.deleteProperty=function(e,t){return Ji.set.call(this,e,t,void 0)};Ji.set=function(e,t,r){return Xp.set.call(this,e[0],t,r,e[0])};function _p(e,t){let r=e[_e];return(r?$n(r):e)[t]}function nP(e,t,r){let n=DS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function DS(e,t){if(!(t in e))return;let r=Gn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Gn(r)}}function zp(e){e.modified_||(e.modified_=!0,e.parent_&&zp(e.parent_))}function jp(e){e.copy_||(e.copy_=$p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(c=a,...u){return i.produce(c,l=>r.call(this,l,...u))}}typeof r!="function"&&ke(6),n!==void 0&&typeof n!="function"&&ke(7);let o;if(je(t)){let a=IS(this),i=Kp(t,void 0),s=!0;try{o=r(i),s=!1}finally{s?Wp(a):Hp(a)}return wS(a,n),ES(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Yp&&(o=void 0),this.autoFreeze_&&kc(o,!0),n){let a=[],i=[];Hn("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else ke(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...s)=>this.produceWithPatches(i,c=>t(c,...s));let n,o;return[this.produce(t,r,(i,s)=>{n=i,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){je(e)||ke(8),Je(e)&&(e=VS(e));let t=IS(this),r=Kp(e,void 0);return r[_e].isManual_=!0,Hp(t),r}finishDraft(e,t){let r=e&&e[_e];(!r||!r.isManual_)&&ke(9);let{scope_:n}=r;return wS(n,t),ES(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Hn("Patches").applyPatches_;return Je(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Kp(e,t){let r=Xi(e)?Hn("MapSet").proxyMap_(e,t):Zi(e)?Hn("MapSet").proxySet_(e,t):rP(e,t);return(t?t.scope_:qS()).drafts_.push(r),r}function VS(e){return Je(e)||ke(10,e),NS(e)}function NS(e){if(!je(e)||Oc(e))return e;let t=e[_e],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=$p(e,t.scope_.immer_.useStrictShallowCopy_)}else r=$p(e,!0);return zi(r,(n,o)=>{OS(r,n,NS(o))}),t&&(t.finalized_=!1),r}function MS(){let t="replace",r="add",n="remove";function o(d,p,f,y){switch(d.type_){case 0:case 2:return i(d,p,f,y);case 1:return a(d,p,f,y);case 3:return s(d,p,f,y)}}function a(d,p,f,y){let{base_:S,assigned_:h}=d,g=d.copy_;g.length<S.length&&([S,g]=[g,S],[f,y]=[y,f]);for(let x=0;x<S.length;x++)if(h[x]&&g[x]!==S[x]){let F=p.concat([x]);f.push({op:t,path:F,value:m(g[x])}),y.push({op:t,path:F,value:m(S[x])})}for(let x=S.length;x<g.length;x++){let F=p.concat([x]);f.push({op:r,path:F,value:m(g[x])})}for(let x=g.length-1;S.length<=x;--x){let F=p.concat([x]);y.push({op:n,path:F})}}function i(d,p,f,y){let{base_:S,copy_:h}=d;zi(d.assigned_,(g,x)=>{let F=Up(S,g),I=Up(h,g),b=x?Ki(S,g)?t:r:n;if(F===I&&b===t)return;let R=p.concat(g);f.push(b===n?{op:b,path:R}:{op:b,path:R,value:I}),y.push(b===r?{op:n,path:R}:b===n?{op:r,path:R,value:m(F)}:{op:t,path:R,value:m(F)})})}function s(d,p,f,y){let{base_:S,copy_:h}=d,g=0;S.forEach(x=>{if(!h.has(x)){let F=p.concat([g]);f.push({op:n,path:F,value:x}),y.unshift({op:r,path:F,value:x})}g++}),g=0,h.forEach(x=>{if(!S.has(x)){let F=p.concat([g]);f.push({op:r,path:F,value:x}),y.unshift({op:n,path:F,value:x})}g++})}function c(d,p,f,y){f.push({op:t,path:[],value:p===Yp?void 0:p}),y.push({op:t,path:[],value:d})}function u(d,p){return p.forEach(f=>{let{path:y,op:S}=f,h=d;for(let I=0;I<y.length-1;I++){let b=Wn(h),R=y[I];typeof R!="string"&&typeof R!="number"&&(R=""+R),(b===0||b===1)&&(R==="__proto__"||R==="constructor")&&ke(19),typeof h=="function"&&R==="prototype"&&ke(19),h=Up(h,R),typeof h!="object"&&ke(18,y.join("/"))}let g=Wn(h),x=l(f.value),F=y[y.length-1];switch(S){case t:switch(g){case 2:return h.set(F,x);case 3:ke(16);default:return h[F]=x}case r:switch(g){case 1:return F==="-"?h.push(x):h.splice(F,0,x);case 2:return h.set(F,x);case 3:return h.add(x);default:return h[F]=x}case n:switch(g){case 1:return h.splice(F,1);case 2:return h.delete(F);case 3:return h.delete(f.value);default:return delete h[F]}default:ke(17,S)}}),d}function l(d){if(!je(d))return d;if(Array.isArray(d))return d.map(l);if(Xi(d))return new Map(Array.from(d.entries()).map(([f,y])=>[f,l(y)]));if(Zi(d))return new Set(Array.from(d).map(l));let p=Object.create(Gn(d));for(let f in d)p[f]=l(d[f]);return Ki(d,Hi)&&(p[Hi]=d[Hi]),p}function m(d){return Je(d)?l(d):d}Zv("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var Xe=new oP,br=Xe.produce,qc=Xe.produceWithPatches.bind(Xe),SB=Xe.setAutoFreeze.bind(Xe),hB=Xe.setUseStrictShallowCopy.bind(Xe),Zp=Xe.applyPatches.bind(Xe),yB=Xe.createDraft.bind(Xe),CB=Xe.finishDraft.bind(Xe);function aP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function iP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function sP(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 LS=e=>Array.isArray(e)?e:[e];function cP(e){let t=Array.isArray(e[0])?e[0]:e;return sP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function uP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var FB=Symbol();var RB=Object.getPrototypeOf({});var lP=class{constructor(e){this.value=e}deref(){return this.value}},dP=typeof WeakRef<"u"?WeakRef:lP,pP=0,QS=1;function Dc(){return{s:pP,v:void 0,o:null,p:null}}function Oo(e,t={}){let r=Dc(),{resultEqualityCheck:n}=t,o,a=0;function i(){let s=r,{length:c}=arguments;for(let m=0,d=c;m<d;m++){let p=arguments[m];if(typeof p=="function"||typeof p=="object"&&p!==null){let f=s.o;f===null&&(s.o=f=new WeakMap);let y=f.get(p);y===void 0?(s=Dc(),f.set(p,s)):s=y}else{let f=s.p;f===null&&(s.p=f=new Map);let y=f.get(p);y===void 0?(s=Dc(),f.set(p,s)):s=y}}let u=s,l;if(s.s===QS)l=s.v;else if(l=e.apply(null,arguments),a++,n){let m=o?.deref?.()??o;m!=null&&n(m,l)&&(l=m,a!==0&&a--),o=typeof l=="object"&&l!==null||typeof l=="function"?new dP(l):l}return u.s=QS,u.v=l,l}return i.clearCache=()=>{r=Dc(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function BS(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),aP(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let l={...r,...c},{memoize:m,memoizeOptions:d=[],argsMemoize:p=Oo,argsMemoizeOptions:f=[],devModeChecks:y={}}=l,S=LS(d),h=LS(f),g=cP(o),x=m(function(){return a++,u.apply(null,arguments)},...S),F=!0,I=p(function(){i++;let R=uP(g,arguments);return s=x.apply(null,R),s},...h);return Object.assign(I,{resultFunc:u,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var Y=BS(Oo),mP=Object.assign((e,t=Y)=>{iP(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(a=>e[a]);return t(n,(...a)=>a.reduce((i,s,c)=>(i[r[c]]=s,i),{}))},{withTypes:()=>mP});function US(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var _S=US(),jS=US;var fP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ko:ko.apply(null,arguments)},qB=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 C(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(At(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Ic(n)&&n.type===e,r}var zS=class es extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,es.prototype)}static get[Symbol.species](){return es}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new es(...t[0].concat(this)):new es(...t.concat(this))}};function $S(e){return je(e)?br(e,()=>{}):e}function GS(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function SP(e){return typeof e=="boolean"}var hP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new zS;return r&&(SP(r)?i.push(_S):i.push(jS(r.extraArgument))),i},Wr="RTK_autoBatch",Do=()=>e=>({payload:e,meta:{[Wr]:!0}}),WS=e=>t=>{setTimeout(t,e)},yP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:WS(10):e.type==="callback"?e.queueNotification:WS(e.timeout),u=()=>{i=!1,a&&(a=!1,s.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let m=()=>o&&l(),d=n.subscribe(m);return s.add(l),()=>{d(),s.delete(l)}},dispatch(l){try{return o=!l?.meta?.[Wr],a=!o,a&&(i||(i=!0,c(u))),n.dispatch(l)}finally{o=!0}}})},CP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new zS(e);return n&&o.push(yP(typeof n=="object"?n:void 0)),o};function KS(e){let t=hP(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=To(r);else throw new Error(At(1));let c;typeof n=="function"?c=n(t):c=t();let u=ko;o&&(u=fP({trace:!1,...typeof o=="object"&&o}));let l=PS(...c),m=CP(l),d=typeof i=="function"?i(m):m(),p=u(...d);return Bp(s,a,p)}function YS(e){let t={},r=[],n,o={addCase(a,i){let s=typeof a=="string"?a:a.type;if(!s)throw new Error(At(28));if(s in t)throw new Error(At(29));return t[s]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function xP(e){return typeof e=="function"}function _(e,t){let[r,n,o]=YS(t),a;if(xP(e))a=()=>$S(e());else{let s=$S(e);a=()=>s}function i(s=a(),c){let u=[r[c.type],...n.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[o]),u.reduce((l,m)=>{if(m)if(Je(l)){let p=m(l,c);return p===void 0?l:p}else{if(je(l))return br(l,d=>m(d,c));{let d=m(l,c);if(d===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return l},s)}return i.getInitialState=a,i}var JS=(e,t)=>gP(e)?e.match(t):e(t);function Dt(...e){return t=>e.some(r=>JS(r,t))}function qo(...e){return t=>e.every(r=>JS(r,t))}function Nc(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 ts(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Mc(...e){return e.length===0?t=>Nc(t,["pending"]):ts(e)?Dt(...e.map(t=>t.pending)):Mc()(e[0])}function zn(...e){return e.length===0?t=>Nc(t,["rejected"]):ts(e)?Dt(...e.map(t=>t.rejected)):zn()(e[0])}function rs(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qo(zn(...e),t):ts(e)?qo(zn(...e),t):rs()(e[0])}function vr(...e){return e.length===0?t=>Nc(t,["fulfilled"]):ts(e)?Dt(...e.map(t=>t.fulfilled)):vr()(e[0])}function Lc(...e){return e.length===0?t=>Nc(t,["pending","fulfilled","rejected"]):ts(e)?Dt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Lc()(e[0])}var AP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qc=(e=21)=>{let t="",r=e;for(;r--;)t+=AP[Math.random()*64|0];return t},FP=["name","message","stack","code"],em=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},HS=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},RP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of FP)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},G=(()=>{function e(t,r,n){let o=C(t+"/fulfilled",(c,u,l,m)=>({payload:c,meta:{...m||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),a=C(t+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),i=C(t+"/rejected",(c,u,l,m,d)=>({payload:m,error:(n&&n.serializeError||RP)(c||"Rejected"),meta:{...d||{},arg:l,requestId:u,rejectedWithValue:!!m,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,l,m)=>{let d=n?.idGenerator?n.idGenerator(c):Qc(),p=new AbortController,f,y;function S(g){y=g,p.abort()}let h=async function(){let g;try{let F=n?.condition?.(c,{getState:l,extra:m});if(vP(F)&&(F=await F),F===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let I=new Promise((b,R)=>{f=()=>{R({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",f)});u(a(d,c,n?.getPendingMeta?.({requestId:d,arg:c},{getState:l,extra:m}))),g=await Promise.race([I,Promise.resolve(r(c,{dispatch:u,getState:l,extra:m,requestId:d,signal:p.signal,abort:S,rejectWithValue:(b,R)=>new em(b,R),fulfillWithValue:(b,R)=>new HS(b,R)})).then(b=>{if(b instanceof em)throw b;return b instanceof HS?o(b.payload,d,c,b.meta):o(b,d,c)})])}catch(F){g=F instanceof em?i(null,d,c,F.payload,F.meta):i(F,d,c)}finally{f&&p.signal.removeEventListener("abort",f)}return n&&!n.dispatchConditionRejection&&i.match(g)&&g.meta.condition||u(g),g}();return Object.assign(h,{abort:S,requestId:d,arg:c,unwrap(){return h.then(bP)}})}}return Object.assign(s,{pending:a,rejected:i,fulfilled:o,settled:Dt(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function bP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var XS=Symbol.for("rtk-slice-createasyncthunk"),LB={[XS]:G};function PP(e,t){return`${e}/${t}`}function wP({creators:e}={}){let t=e?.asyncThunk?.[XS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(At(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(EP()):n.reducers)||{},s=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,x){let F=typeof g=="string"?g:g.type;if(!F)throw new Error(At(12));if(F in c.sliceCaseReducersByType)throw new Error(At(13));return c.sliceCaseReducersByType[F]=x,u},addMatcher(g,x){return c.sliceMatchers.push({matcher:g,reducer:x}),u},exposeAction(g,x){return c.actionCreators[g]=x,u},exposeCaseReducer(g,x){return c.sliceCaseReducersByName[g]=x,u}};s.forEach(g=>{let x=i[g],F={reducerName:g,type:PP(o,g),createNotation:typeof n.reducers=="function"};kP(x)?qP(F,x,u,t):TP(F,x,u)});function l(){let[g={},x=[],F=void 0]=typeof n.extraReducers=="function"?YS(n.extraReducers):[n.extraReducers],I={...g,...c.sliceCaseReducersByType};return _(n.initialState,b=>{for(let R in I)b.addCase(R,I[R]);for(let R of c.sliceMatchers)b.addMatcher(R.matcher,R.reducer);for(let R of x)b.addMatcher(R.matcher,R.reducer);F&&b.addDefaultCase(F)})}let m=g=>g,d=new Map,p;function f(g,x){return p||(p=l()),p(g,x)}function y(){return p||(p=l()),p.getInitialState()}function S(g,x=!1){function F(b){let R=b[g];return typeof R>"u"&&x&&(R=y()),R}function I(b=m){let R=GS(d,x,()=>new WeakMap);return GS(R,b,()=>{let E={};for(let[w,T]of Object.entries(n.selectors??{}))E[w]=IP(T,b,y,x);return E})}return{reducerPath:g,getSelectors:I,get selectors(){return I(F)},selectSlice:F}}let h={name:o,reducer:f,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...S(a),injectInto(g,{reducerPath:x,...F}={}){let I=x??a;return g.inject({reducerPath:I,reducer:f},F),{...h,...S(I,!0)}}};return h}}function IP(e,t,r,n){function o(a,...i){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...i)}return o.unwrapped=e,o}var Kn=wP();function EP(){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 TP({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!OP(n))throw new Error(At(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?C(e,i):C(e))}function kP(e){return e._reducerDefinitionType==="asyncThunk"}function OP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function qP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(At(18));let{payloadCreator:a,fulfilled:i,pending:s,rejected:c,settled:u,options:l}=r,m=o(e,a,l);n.exposeAction(t,m),i&&n.addCase(m.fulfilled,i),s&&n.addCase(m.pending,s),c&&n.addCase(m.rejected,c),u&&n.addMatcher(m.settled,u),n.exposeCaseReducer(t,{fulfilled:i||Vc,pending:s||Vc,rejected:c||Vc,settled:u||Vc})}function Vc(){}var ZS="listener",eh="completed",th="cancelled",QB=`task-${th}`,BB=`task-${eh}`,UB=`${ZS}-${th}`,_B=`${ZS}-${eh}`;var{assign:rh}=Object;var tm="listenerMiddleware";var DP=rh(C(`${tm}/add`),{withTypes:()=>DP}),jB=C(`${tm}/removeAll`),VP=rh(C(`${tm}/remove`),{withTypes:()=>VP});var $B=Symbol.for("rtk-state-proxy-original");function At(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. `}function NP({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;i!=="disabled"&&(n.call(r),t.send(o,a,r))}var MP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function LP(e){return typeof e=="string"&&MP.test(e)}var Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));function QP(e,t=0){return(Oe[e[t+0]]+Oe[e[t+1]]+Oe[e[t+2]]+Oe[e[t+3]]+"-"+Oe[e[t+4]]+Oe[e[t+5]]+"-"+Oe[e[t+6]]+Oe[e[t+7]]+"-"+Oe[e[t+8]]+Oe[e[t+9]]+"-"+Oe[e[t+10]]+Oe[e[t+11]]+Oe[e[t+12]]+Oe[e[t+13]]+Oe[e[t+14]]+Oe[e[t+15]]).toLowerCase()}var rm,BP=new Uint8Array(16);function UP(){if(!rm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rm=crypto.getRandomValues.bind(crypto)}return rm(BP)}var _P=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nh={randomUUID:_P};function jP(e,t,r){if(nh.randomUUID&&!e)return nh.randomUUID();e=e||{};let n=e.random??e.rng?.()??UP();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,QP(n)}function $P(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&LP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var ah="1.0.0";function GP(e){let{trackingId:t}=e;return{trackingId:t}}function WP(e){return(e.source||[]).concat([`relay@${ah}`])}function ih(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,s=GP(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:WP(t),clientId:c,userAgent:i(),referrer:o(),location:a()})}function HP(e,t,r,n,o){return{...t,meta:ih(e,r,n,o)}}var zP="*";function KP(){let e=[];function t({type:c,callback:u}){return e.findIndex(l=>l.type===c&&l.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(l){console.error(l)}})}function a(c){if(c===zP)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function i(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?i({type:c,callback:u}):a(c)}return{add:n,call:o,remove:s}}function oh({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 YP(e){let t=oh(e);return{get:()=>t,update:r=>{t=oh({...t,...r})}}}function JP(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var nm=XP();function XP(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function ZP(){return{getItem(e){return nm.getItem(e)||localStorage.getItem(e)},removeItem(e){nm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),nm.setItem(e,t,31556952e3)}}}function ew(){let e=document.referrer;return e===""?null:e}function tw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(JP().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:()=>ew(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>jP(),storage:ZP()}}function rw(){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 nw(){return{getItem(){return null},removeItem(){},setItem(){}}}function ow(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:nw()}}function aw(e){return e.get().mode!=="disabled"&&iw()&&rw()?tw():ow()}function iw(){try{return typeof window=="object"}catch{return!1}}function sw(e){return{get:()=>Object.freeze(aw(e))}}function sh(e){let t=YP(e),r=KP(),n=sw(t),o=$P(n);return{emit:(a,i)=>{let s=t.get(),c=n.get(),u=HP(a,i,s,c,o);return NP({config:s,environment:c,event:u,listenerManager:r})},getMeta:a=>ih(a,t.get(),n.get(),o),on:(a,i)=>r.add({type:a,callback:i}),off:(a,i)=>r.remove(a,i),updateConfig:a=>t.update(a),version:ah}}var Yn="3.16.1-pre.2f5ed054e8",ch=["@coveo/atomic","@coveo/quantic"];var Vt=Y(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Yn}`));var Vo=Y(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Vt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i)=>sh({mode:a?"emit":"disabled",url:o??Lp(e,t),token:r,trackingId:n,source:i}));function Pr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function v(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function im(){return typeof window<"u"}function Cm(){return typeof navigator<"u"}function No(){return typeof document<"u"}function sm(){try{return typeof localStorage<"u"}catch{return!1}}function cw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fh(){return Cm()&&navigator.cookieEnabled}var uw=[X.click,X.custom,X.search,X.view],lw=(e,t)=>uw.indexOf(e)!==-1?Object.assign({language:No()?document.documentElement.lang:"unknown",userAgent:Cm()?navigator.userAgent:"unknown"},t):t,as=class e{static set(t,r,n){var o,a,i,s;n&&(a=new Date,a.setTime(a.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?uh(t,r,a):(i=s.split("."),o=i[i.length-2]+"."+i[i.length-1],uh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function uh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function dw(){return sm()?localStorage:Fh()?new is:cw()?sessionStorage:new Lo}var is=class e{getItem(t){return as.get(`${e.prefix}${t}`)}removeItem(t){as.erase(`${e.prefix}${t}`)}setItem(t,r,n){as.set(`${e.prefix}${t}`,r,n)}};is.prefix="coveo_";var cm=class{constructor(){this.cookieStorage=new is}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)}},Lo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},ns="__coveo.analytics.history",Rh=20,bh=1e3*60,vh=75,Qo=class{constructor(t){this.store=t||dw()}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 v(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 v(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(ns);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return v(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(ns);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(ns,JSON.stringify(t.slice(0,Rh)))}catch{}}clear(){try{this.store.removeItem(ns)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,vh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>bh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},Ph=Object.freeze({__proto__:null,HistoryStore:Qo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Rh,MAX_VALUE_SIZE:vh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:bh,STORE_KEY:ns,default:Qo}),pw=(e,t)=>v(void 0,void 0,void 0,function*(){return e===X.view?(yield mw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),mw=e=>v(void 0,void 0,void 0,function*(){let t=new Qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Bc,fw=new Uint8Array(16);function gw(){if(!Bc&&(Bc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bc(fw)}var Sw=/^(?:[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 _c(e){return typeof e=="string"&&Sw.test(e)}var qe=[];for(let e=0;e<256;++e)qe.push((e+256).toString(16).slice(1));function wh(e,t=0){return(qe[e[t+0]]+qe[e[t+1]]+qe[e[t+2]]+qe[e[t+3]]+"-"+qe[e[t+4]]+qe[e[t+5]]+"-"+qe[e[t+6]]+qe[e[t+7]]+"-"+qe[e[t+8]]+qe[e[t+9]]+"-"+qe[e[t+10]]+qe[e[t+11]]+qe[e[t+12]]+qe[e[t+13]]+qe[e[t+14]]+qe[e[t+15]]).toLowerCase()}function hw(e){if(!_c(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 yw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Cw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",xw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Aw(e,t,r){function n(o,a,i,s){var c;if(typeof o=="string"&&(o=yw(o)),typeof a=="string"&&(a=hw(a)),((c=a)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(a),u.set(o,a.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,i){s=s||0;for(let l=0;l<16;++l)i[s+l]=u[l];return i}return wh(u)}try{n.name=e}catch{}return n.DNS=Cw,n.URL=xw,n}var Fw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lh={randomUUID:Fw};function Jn(e,t,r){if(lh.randomUUID&&!t&&!e)return lh.randomUUID();e=e||{};let n=e.random||(e.rng||gw)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return wh(n)}function Rw(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 om(e,t){return e<<t|e>>>32-t}function bw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let s=0;s<i.length;++s)e.push(i.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[i*64+c*4]<<24|e[i*64+c*4+1]<<16|e[i*64+c*4+2]<<8|e[i*64+c*4+3];a[i]=s}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let s=new Uint32Array(80);for(let p=0;p<16;++p)s[p]=a[i][p];for(let p=16;p<80;++p)s[p]=om(s[p-3]^s[p-8]^s[p-14]^s[p-16],1);let c=r[0],u=r[1],l=r[2],m=r[3],d=r[4];for(let p=0;p<80;++p){let f=Math.floor(p/20),y=om(c,5)+Rw(f,u,l,m)+d+t[f]+s[p]>>>0;d=m,m=l,l=om(u,30)>>>0,u=c,c=y}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+d>>>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 vw=Aw("v5",80,bw),dh=vw,Ih="2.30.43",ph=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,os={pageview:"pageview",event:"event"},jc=class{constructor({client:t,uuidGenerator:r=Jn}){this.client=t,this.uuidGenerator=r}},um=class extends jc{constructor({client:t,uuidGenerator:r=Jn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ph(window.location),this.lastReferrer=No()?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:No()?document.title:"",encoding:No()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===os.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===os.pageview?this.nextPageViewId:this.pageViewId,referrer:t===os.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===os.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return ph(window.location)}},Hr=class e{constructor(t,r){if(!_c(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return _c(a)?new e(a,Number.parseInt(o)*1e3):null}};Hr.cvo_cid="cvo_cid";Hr.expirationTime=120;var lm=class extends jc{constructor({client:t,uuidGenerator:r=Jn}){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 v(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(Hr.cvo_cid,new Hr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};lm.Id="link";var it=Object.keys;function Uc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var am=128,Eh=192,mh=224,fh=240;function Pw(e){return(e&248)===fh?4:(e&fh)===mh?3:(e&mh)===Eh?2:1}function ww(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&am)!=am)break;if(r-=3,(n&Eh)!=am){t-r>=Pw(n)*3&&(r=t);break}}return e.substring(0,r)}var dm={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"},Iw=it(dm).map(e=>dm[e]),Ew=[...Iw].join("|"),Tw=new RegExp(`^(${Ew}$)`),kw={svcAction:"svc_action",svcActionData:"svc_action_data"},Ow=e=>it(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=dm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),qw=e=>Tw.test(e),Dw=[qw],gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Sh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ve={action:"pa",list:"pal",listSource:"pls"},$c={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Vw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],pm={id:"quoteId",affiliation:"quoteAffiliation"},mm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Nw={add:Ve,bookmark_add:Ve,bookmark_remove:Ve,click:Ve,checkout:Ve,checkout_option:Ve,detail:Ve,impression:Ve,remove:Ve,refund:Object.assign(Object.assign({},Ve),$c),purchase:Object.assign(Object.assign({},Ve),$c),quickview:Ve,quote:Object.assign(Object.assign({},Ve),pm),review:Object.assign(Object.assign({},Ve),mm)},Mw=it(gh).map(e=>gh[e]),Lw=it(Sh).map(e=>Sh[e]),Qw=it(Ve).map(e=>Ve[e]),Bw=it($c).map(e=>$c[e]),Uw=it(mm).map(e=>mm[e]),_w=it(pm).map(e=>pm[e]),jw=[...Mw,"custom"].join("|"),$w=[...Lw,"custom"].join("|"),Th="(pr[0-9]+)",kh="(il[0-9]+pi[0-9]+)",Gw=new RegExp(`^${Th}(${jw})$`),Ww=new RegExp(`^(${kh}(${$w}))|(il[0-9]+nm)$`),Hw=new RegExp(`^(${Qw.join("|")})$`),zw=new RegExp(`^(${Bw.join("|")})$`),Kw=new RegExp(`^${Th}custom$`),Yw=new RegExp(`^${kh}custom$`),Jw=new RegExp(`^(${[...Vw,...Uw,..._w].join("|")})$`),Xw=e=>Gw.test(e),Zw=e=>Ww.test(e),eI=e=>Hw.test(e),tI=e=>zw.test(e),rI=e=>Jw.test(e),nI=[Zw,Xw,eI,tI,rI],oI=[Kw,Yw],aI={anonymizeIp:"aip"},iI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},sI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},cI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],uI=Object.assign(Object.assign(Object.assign(Object.assign({},aI),iI),sI),cI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),fm=Object.assign(Object.assign({},uI),kw),lI=e=>{let t=!!e.action&&Nw[e.action]||{};return it(e).reduce((r,n)=>{let o=t[n]||fm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},dI=it(fm).map(e=>fm[e]),pI=e=>dI.indexOf(e)!==-1,mI=e=>e==="custom",fI=e=>[...nI,...Dw,pI,mI].some(t=>t(e)),gI=e=>it(e).reduce((t,r)=>{let n=SI(r);return n?Object.assign(Object.assign({},t),hI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),SI=e=>{let t;return[...oI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},hI=(e,t)=>it(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),gm=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return v(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=i;o=s||t;try{a=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return v(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Sm=class{sendEvent(t,r){return v(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){return Promise.resolve()})}},hh=globalThis.fetch,Gc=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),a?yield a(s,"analyticsFetch"):{}),{url:u}=c,l=Pr(c,["url"]),m;try{m=yield hh(u,l)}catch(d){console.error("An error has occured when sending the event.",d);return}if(m.ok){let d=yield m.json();return d.visitorId&&o.setCurrentVisitorId(d.visitorId),d}else{try{m.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,m,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield hh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return v(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"})}},hm=class{constructor(t,r){sm()&&Fh()?this.storage=new cm:sm()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Lo),this.client=new Gc(t),this.beaconClient=new gm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},ym=class{constructor(t,r){this.storage=r||new Lo,this.client=new Gc(t)}getClientDependingOnEventType(t){return this.client}},Wc=class{constructor(){this.storage=new Lo,this.client=new Sm}getClientDependingOnEventType(t){return this.client}},yI="xx",CI=e=>e?.startsWith(yI)||!1,xI=`
|
|
19
|
+
`+l:l;break;case"event":n.event=l;break;case"id":e(n.id=l);break;case"retry":Kb(l,n,t);break}}}}function Kb(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function Yb(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Kg(){return{data:"",event:"",id:"",retry:void 0}}var Pp="text/event-stream",Jb=1e3,Zg="last-event-id";function eS(){return typeof window<"u"}function xc(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:s,fetch:c,...u}){return new Promise((l,m)=>{let d={...r};d.accept||(d.accept=Pp);let p;function f(){p?.abort(),document.hidden||F()}!s&&eS()&&document.addEventListener("visibilitychange",f);let y=Jb,S;function h(){eS()&&document.removeEventListener("visibilitychange",f),clearTimeout(S),p?.abort()}t?.addEventListener("abort",()=>{h(),l()});let g=c??fetch,x=n??Xb;async function F(){p=AbortController?new AbortController:null;try{let I=await g(e,{...u,headers:d,signal:p?.signal});await x(I),await Yg(I.body,Jg(Xg(b=>{b?d[Zg]=b:delete d[Zg]},b=>{y=b},o))),a?.(),h(),l()}catch(I){if(!p?.signal?.aborted)try{let b=i?.(I)??y;clearTimeout(S),S=setTimeout(F,b)}catch(b){h(),m(b)}}}F()})}function Xb(e){let t=e.headers.get("content-type");if(!t?.startsWith(Pp))throw new Error(`Expected content-type to be ${Pp}, Actual: ${t}`)}var _r=class{constructor(t){pe(this,"_basePath");pe(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}};var Zb=(e,t,r)=>new _r(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,tS=3,ev=5e3,tv="text/event-stream",Ep=1,wp=class extends Error{},_i=class extends Error{constructor(r){super(r.message);this.payload=r}},Ip=class{constructor(){pe(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Ac=class{constructor(t){pe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:s,abort:c,close:u,resetAnswer:l}=r,m=new Ip;if(!a){this.logger.error("No stream ID found");return}let d=0,p,f=()=>{p&&!m.isActive(p)&&(S?.abort(),l(),h())},y=()=>{m.remove(p),p=Hg(f,p,ev),m.add(p)},S=new AbortController,h=()=>xc(Zb(n,o,a),{method:"GET",fetch,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:S?.signal,async onopen(g){if(g.ok&&g.headers.get("content-type")===tv)return;throw g.status>=400&&g.status<500&&g.status!==429?new _i({message:"Error opening stream",code:g.status}):new wp},onmessage:g=>{if(S?.signal.aborted)return;let x=JSON.parse(g.data);if(x.finishReason==="ERROR"){m.remove(p),S?.abort(),c({message:x.errorMessage,code:x.statusCode});return}s(x),d=0,x.finishReason==="COMPLETED"?(m.remove(p),u()):y()},onerror:g=>{if(!S?.signal.aborted){if(m.remove(p),g instanceof _i)throw S?.abort(),c(g),g;if(++d>tS){this.logger.info("Maximum retry exceeded.");let x={message:"Failed to complete stream.",code:Ep};throw S?.abort(),c(x),new _i(x)}this.logger.info(`Retrying...(${d}/${tS})`),l()}}});return h(),S}};var mS=Ot(uS(),1);var wv="recommendation-internal-options",v0=Symbol.for(wv);var N=new Error("Failed to load reducers."),Io=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var jn=class extends Error{constructor(r,n){super();pe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};function lS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function dS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Iv)}function Iv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function pS(e){return e===429}var ot=class e{static async call(t){let r=Ev(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,s=async()=>{let c=await fetch(a,i);if(pS(c.status))throw c;return c};try{let c=await(0,mS.backOff)(s,{retry:u=>{let l=u&&pS(u.status);return l&&n.info("Platform retrying request"),l}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Io;case 404:throw new jn(a,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new jn(a):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:s,...c}=t,u=Ui(c);try{let l=await o(t,n,i);return{...t,...l}}catch(l){a.error(l,"Platform request preprocessing failed. Returning default request options.")}return u}};function De(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function xe(e,t="prod"){return`${De(e,t)}/rest/search/v2`}function Lp(e,t="prod"){return`${De(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Ev(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,s=e.method==="POST"||e.method==="PUT",c=Tv(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:c},signal:i}}function Tv(e,t){return t==="application/x-www-form-urlencoded"?dS(e)?lS(e):"":JSON.stringify(e)}var Rc=e=>e;var fS=e=>e,gS=e=>e,SS=e=>e;import{isNullOrUndefined as Qv}from"@coveo/bueno";function Eo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ye(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Eo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Eo(),extendedResults:{}}}function jr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var $r=e=>{let{response:t}=e;return t.body?kv(e):Ov(t)},kv=e=>Dv(e)?Vv(e):qv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Ov=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function qv(e){return e.body.statusCode!==void 0}function Dv(e){return e.body.exception!==void 0}var Vv=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});var Gr=class{constructor(){pe(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController,o=this.currentAbortController=new AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};function hS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}var Fr=(e,t,r,n)=>{let o=new _r(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var yS=(e,t)=>{let r=new _r(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},CS=async(e,t)=>{let r=await ot.call({...Fr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:jr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=hS(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return Nv(i)?{success:i}:{error:$r({response:r,body:i})}};function Nv(e){return typeof e=="string"}function Mv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Lv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Gi(e,t){if(t&&e.name==="AbortError")return{error:Lv(e)};if(e instanceof jn)return{error:Mv(e)};throw e}var bc=class{constructor(t){this.options=t;pe(this,"apiCallsQueues",{unknown:new Gr,mainSearch:new Gr,facetValues:new Gr,foldingCollection:new Gr,instantResults:new Gr})}async plan(t){let r=await ot.call({...Fr(t,"POST","application/json","/plan"),requestParams:jr(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Gi(r);let n=await r.json();return Uv(n)?{success:n}:{error:$r({response:r,body:n})}}async querySuggest(t){let r=await ot.call({...Fr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:jr(t),...this.options});if(r instanceof Error)return Gi(r);let n=await r.json(),o={response:r,body:n};return Bv(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:$r(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(s=>ot.call({...Fr(t,"POST","application/json",""),requestParams:jr(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:s??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Gi(o,r?.disableAbortWarning);let a=await o.json(),i={response:o,body:a};return xS(a)?(i.body=AS(a),{success:(await this.options.postprocessSearchResponseMiddleware(i)).body}):{error:$r(i)}}async facetSearch(t){let r=await ot.call({...Fr(t,"POST","application/json","/facet"),requestParams:jr(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await ot.call({...Fr(t,"POST","application/json",""),requestParams:jr(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(xS(n)){let o={response:r,body:n};return o.body=AS(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:$r({response:r,body:n})}}async html(t){return CS(t,{...this.options})}async fieldDescriptions(t){let r=await ot.call({...Fr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return _v(n)?{success:n}:{error:$r({response:r,body:n})}}},vc=e=>e.success!==void 0,Fe=e=>e.error!==void 0;function xS(e){return e.results!==void 0}function AS(e){let t=Eo();return Qv(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Bv(e){return e.completions!==void 0}function Uv(e){return e.preprocessingOutput!==void 0}function _v(e){return e.fields!==void 0}import{Schema as jv,SchemaValidationError as $v,StringValue as Wi,RecordValue as Gv,ArrayValue as Wv}from"@coveo/bueno";var D=new Wi({required:!0,emptyAllowed:!1}),ce=new Wi({required:!1,emptyAllowed:!1}),ne=new Wi({required:!0,emptyAllowed:!0}),FS=new Wi({required:!1,emptyAllowed:!0}),Pc=new Wv({each:D,required:!0}),RS=new Wi({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Rr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),at=(e,t)=>{if("required"in t)return{payload:new jv({value:t}).validate({value:e}).value};let o=new Gv({options:{required:!0},values:t}).validate(e);if(o)throw new $v(o);return{payload:e}},A=(e,t)=>{try{return at(e,t)}catch(r){return{payload:e,error:Rr(r)}}},Se=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return bS(e,t,r,o,"Controller initialization error")},ie=(e,t,r,n)=>{let o=`Check the options of ${n}`;return bS(e,t,r,o,"Controller initialization error")},bS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};import{isNullOrUndefined as qm,RecordValue as $I,Schema as GI,StringValue as tu}from"@coveo/bueno";function Te(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 Hv=typeof Symbol=="function"&&Symbol.observable||"@@observable",vS=Hv,Qp=()=>Math.random().toString(36).substring(7).split("").join("."),zv={INIT:`@@redux/INIT${Qp()}`,REPLACE:`@@redux/REPLACE${Qp()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Qp()}`},wc=zv;function qt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Bp(e,t,r){if(typeof e!="function")throw new Error(Te(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Te(1));return r(Bp)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,c=!1;function u(){i===a&&(i=new Map,a.forEach((S,h)=>{i.set(h,S)}))}function l(){if(c)throw new Error(Te(3));return o}function m(S){if(typeof S!="function")throw new Error(Te(4));if(c)throw new Error(Te(5));let h=!0;u();let g=s++;return i.set(g,S),function(){if(h){if(c)throw new Error(Te(6));h=!1,u(),i.delete(g),a=null}}}function d(S){if(!qt(S))throw new Error(Te(7));if(typeof S.type>"u")throw new Error(Te(8));if(typeof S.type!="string")throw new Error(Te(17));if(c)throw new Error(Te(9));try{c=!0,o=n(o,S)}finally{c=!1}return(a=i).forEach(g=>{g()}),S}function p(S){if(typeof S!="function")throw new Error(Te(10));n=S,d({type:wc.REPLACE})}function f(){let S=m;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Te(11));function g(){let F=h;F.next&&F.next(l())}return g(),{unsubscribe:S(g)}},[vS](){return this}}}return d({type:wc.INIT}),{dispatch:d,subscribe:m,getState:l,replaceReducer:p,[vS]:f}}function Kv(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:wc.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:wc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}function To(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let s=t[i];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,a;try{Kv(r)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1,l={};for(let m=0;m<n.length;m++){let d=n[m],p=r[d],f=s[d],y=p(f,c);if(typeof y>"u"){let S=c&&c.type;throw new Error(Te(14))}l[d]=y,u=u||y!==f}return u=u||n.length!==Object.keys(s).length,u?l:s}}function ko(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Te(15))},i={getState:o.getState,dispatch:(c,...u)=>a(c,...u)},s=e.map(c=>c(i));return a=ko(...s)(o.dispatch),{...o,dispatch:a}}}function Ic(e){return qt(e)&&"type"in e&&typeof e.type=="string"}var Yp=Symbol.for("immer-nothing"),Hi=Symbol.for("immer-draftable"),_e=Symbol.for("immer-state");function ke(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gn=Object.getPrototypeOf;function Je(e){return!!e&&!!e[_e]}function je(e){return e?kS(e)||Array.isArray(e)||!!e[Hi]||!!e.constructor?.[Hi]||Xi(e)||Zi(e):!1}var Yv=Object.prototype.constructor.toString();function kS(e){if(!e||typeof e!="object")return!1;let t=Gn(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)===Yv}function Jp(e){return Je(e)||ke(15,e),e[_e].base_}function zi(e,t){Wn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Wn(e){let t=e[_e];return t?t.type_:Array.isArray(e)?1:Xi(e)?2:Zi(e)?3:0}function Ki(e,t){return Wn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Up(e,t){return Wn(e)===2?e.get(t):e[t]}function OS(e,t,r){let n=Wn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Jv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xi(e){return e instanceof Map}function Zi(e){return e instanceof Set}function $n(e){return e.copy_||e.base_}function $p(e,t){if(Xi(e))return new Map(e);if(Zi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=kS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[_e];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Gn(e),n)}else{let n=Gn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function kc(e,t=!1){return Oc(e)||Je(e)||!je(e)||(Wn(e)>1&&(e.set=e.add=e.clear=e.delete=Xv),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>kc(n,!0))),e}function Xv(){ke(2)}function Oc(e){return Object.isFrozen(e)}var Gp={};function Hn(e){let t=Gp[e];return t||ke(0,e),t}function Zv(e,t){Gp[e]||(Gp[e]=t)}var Yi;function qS(){return Yi}function eP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(Hn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wp(e){Hp(e),e.drafts_.forEach(tP),e.drafts_=null}function Hp(e){e===Yi&&(Yi=e.parent_)}function IS(e){return Yi=eP(Yi,e)}function tP(e){let t=e[_e];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ES(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[_e].modified_&&(Wp(t),ke(4)),je(e)&&(e=Ec(t,e),t.parent_||Tc(t,e)),t.patches_&&Hn("Patches").generateReplacementPatches_(r[_e].base_,e,t.patches_,t.inversePatches_)):e=Ec(t,r,[]),Wp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yp?e:void 0}function Ec(e,t,r){if(Oc(t))return t;let n=t[_e];if(!n)return zi(t,(o,a)=>TS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Tc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,i=!1;n.type_===3&&(a=new Set(o),o.clear(),i=!0),zi(a,(s,c)=>TS(e,n,o,s,c,r,i)),Tc(e,o,!1),r&&e.patches_&&Hn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function TS(e,t,r,n,o,a,i){if(Je(o)){let s=a&&t&&t.type_!==3&&!Ki(t.assigned_,n)?a.concat(n):void 0,c=Ec(e,o,s);if(OS(r,n,c),Je(c))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(je(o)&&!Oc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ec(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Tc(e,o)}}function Tc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kc(t,r)}function rP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:qS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Xp;r&&(o=[n],a=Ji);let{revoke:i,proxy:s}=Proxy.revocable(o,a);return n.draft_=s,n.revoke_=i,s}var Xp={get(e,t){if(t===_e)return e;let r=$n(e);if(!Ki(r,t))return nP(e,r,t);let n=r[t];return e.finalized_||!je(n)?n:n===_p(e.base_,t)?(jp(e),e.copy_[t]=Kp(n,e)):n},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=DS($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=_p($n(e),t),a=o?.[_e];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Jv(r,o)&&(r!==void 0||Ki(e.base_,t)))return!0;jp(e),zp(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 _p(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,jp(e),zp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ke(11)},getPrototypeOf(e){return Gn(e.base_)},setPrototypeOf(){ke(12)}},Ji={};zi(Xp,(e,t)=>{Ji[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ji.deleteProperty=function(e,t){return Ji.set.call(this,e,t,void 0)};Ji.set=function(e,t,r){return Xp.set.call(this,e[0],t,r,e[0])};function _p(e,t){let r=e[_e];return(r?$n(r):e)[t]}function nP(e,t,r){let n=DS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function DS(e,t){if(!(t in e))return;let r=Gn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Gn(r)}}function zp(e){e.modified_||(e.modified_=!0,e.parent_&&zp(e.parent_))}function jp(e){e.copy_||(e.copy_=$p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(c=a,...u){return i.produce(c,l=>r.call(this,l,...u))}}typeof r!="function"&&ke(6),n!==void 0&&typeof n!="function"&&ke(7);let o;if(je(t)){let a=IS(this),i=Kp(t,void 0),s=!0;try{o=r(i),s=!1}finally{s?Wp(a):Hp(a)}return wS(a,n),ES(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Yp&&(o=void 0),this.autoFreeze_&&kc(o,!0),n){let a=[],i=[];Hn("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else ke(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...s)=>this.produceWithPatches(i,c=>t(c,...s));let n,o;return[this.produce(t,r,(i,s)=>{n=i,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){je(e)||ke(8),Je(e)&&(e=VS(e));let t=IS(this),r=Kp(e,void 0);return r[_e].isManual_=!0,Hp(t),r}finishDraft(e,t){let r=e&&e[_e];(!r||!r.isManual_)&&ke(9);let{scope_:n}=r;return wS(n,t),ES(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Hn("Patches").applyPatches_;return Je(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Kp(e,t){let r=Xi(e)?Hn("MapSet").proxyMap_(e,t):Zi(e)?Hn("MapSet").proxySet_(e,t):rP(e,t);return(t?t.scope_:qS()).drafts_.push(r),r}function VS(e){return Je(e)||ke(10,e),NS(e)}function NS(e){if(!je(e)||Oc(e))return e;let t=e[_e],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=$p(e,t.scope_.immer_.useStrictShallowCopy_)}else r=$p(e,!0);return zi(r,(n,o)=>{OS(r,n,NS(o))}),t&&(t.finalized_=!1),r}function MS(){let t="replace",r="add",n="remove";function o(d,p,f,y){switch(d.type_){case 0:case 2:return i(d,p,f,y);case 1:return a(d,p,f,y);case 3:return s(d,p,f,y)}}function a(d,p,f,y){let{base_:S,assigned_:h}=d,g=d.copy_;g.length<S.length&&([S,g]=[g,S],[f,y]=[y,f]);for(let x=0;x<S.length;x++)if(h[x]&&g[x]!==S[x]){let F=p.concat([x]);f.push({op:t,path:F,value:m(g[x])}),y.push({op:t,path:F,value:m(S[x])})}for(let x=S.length;x<g.length;x++){let F=p.concat([x]);f.push({op:r,path:F,value:m(g[x])})}for(let x=g.length-1;S.length<=x;--x){let F=p.concat([x]);y.push({op:n,path:F})}}function i(d,p,f,y){let{base_:S,copy_:h}=d;zi(d.assigned_,(g,x)=>{let F=Up(S,g),I=Up(h,g),b=x?Ki(S,g)?t:r:n;if(F===I&&b===t)return;let R=p.concat(g);f.push(b===n?{op:b,path:R}:{op:b,path:R,value:I}),y.push(b===r?{op:n,path:R}:b===n?{op:r,path:R,value:m(F)}:{op:t,path:R,value:m(F)})})}function s(d,p,f,y){let{base_:S,copy_:h}=d,g=0;S.forEach(x=>{if(!h.has(x)){let F=p.concat([g]);f.push({op:n,path:F,value:x}),y.unshift({op:r,path:F,value:x})}g++}),g=0,h.forEach(x=>{if(!S.has(x)){let F=p.concat([g]);f.push({op:r,path:F,value:x}),y.unshift({op:n,path:F,value:x})}g++})}function c(d,p,f,y){f.push({op:t,path:[],value:p===Yp?void 0:p}),y.push({op:t,path:[],value:d})}function u(d,p){return p.forEach(f=>{let{path:y,op:S}=f,h=d;for(let I=0;I<y.length-1;I++){let b=Wn(h),R=y[I];typeof R!="string"&&typeof R!="number"&&(R=""+R),(b===0||b===1)&&(R==="__proto__"||R==="constructor")&&ke(19),typeof h=="function"&&R==="prototype"&&ke(19),h=Up(h,R),typeof h!="object"&&ke(18,y.join("/"))}let g=Wn(h),x=l(f.value),F=y[y.length-1];switch(S){case t:switch(g){case 2:return h.set(F,x);case 3:ke(16);default:return h[F]=x}case r:switch(g){case 1:return F==="-"?h.push(x):h.splice(F,0,x);case 2:return h.set(F,x);case 3:return h.add(x);default:return h[F]=x}case n:switch(g){case 1:return h.splice(F,1);case 2:return h.delete(F);case 3:return h.delete(f.value);default:return delete h[F]}default:ke(17,S)}}),d}function l(d){if(!je(d))return d;if(Array.isArray(d))return d.map(l);if(Xi(d))return new Map(Array.from(d.entries()).map(([f,y])=>[f,l(y)]));if(Zi(d))return new Set(Array.from(d).map(l));let p=Object.create(Gn(d));for(let f in d)p[f]=l(d[f]);return Ki(d,Hi)&&(p[Hi]=d[Hi]),p}function m(d){return Je(d)?l(d):d}Zv("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var Xe=new oP,br=Xe.produce,qc=Xe.produceWithPatches.bind(Xe),SB=Xe.setAutoFreeze.bind(Xe),hB=Xe.setUseStrictShallowCopy.bind(Xe),Zp=Xe.applyPatches.bind(Xe),yB=Xe.createDraft.bind(Xe),CB=Xe.finishDraft.bind(Xe);function aP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function iP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function sP(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 LS=e=>Array.isArray(e)?e:[e];function cP(e){let t=Array.isArray(e[0])?e[0]:e;return sP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function uP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var FB=Symbol();var RB=Object.getPrototypeOf({});var lP=class{constructor(e){this.value=e}deref(){return this.value}},dP=typeof WeakRef<"u"?WeakRef:lP,pP=0,QS=1;function Dc(){return{s:pP,v:void 0,o:null,p:null}}function Oo(e,t={}){let r=Dc(),{resultEqualityCheck:n}=t,o,a=0;function i(){let s=r,{length:c}=arguments;for(let m=0,d=c;m<d;m++){let p=arguments[m];if(typeof p=="function"||typeof p=="object"&&p!==null){let f=s.o;f===null&&(s.o=f=new WeakMap);let y=f.get(p);y===void 0?(s=Dc(),f.set(p,s)):s=y}else{let f=s.p;f===null&&(s.p=f=new Map);let y=f.get(p);y===void 0?(s=Dc(),f.set(p,s)):s=y}}let u=s,l;if(s.s===QS)l=s.v;else if(l=e.apply(null,arguments),a++,n){let m=o?.deref?.()??o;m!=null&&n(m,l)&&(l=m,a!==0&&a--),o=typeof l=="object"&&l!==null||typeof l=="function"?new dP(l):l}return u.s=QS,u.v=l,l}return i.clearCache=()=>{r=Dc(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function BS(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),aP(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let l={...r,...c},{memoize:m,memoizeOptions:d=[],argsMemoize:p=Oo,argsMemoizeOptions:f=[],devModeChecks:y={}}=l,S=LS(d),h=LS(f),g=cP(o),x=m(function(){return a++,u.apply(null,arguments)},...S),F=!0,I=p(function(){i++;let R=uP(g,arguments);return s=x.apply(null,R),s},...h);return Object.assign(I,{resultFunc:u,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var Y=BS(Oo),mP=Object.assign((e,t=Y)=>{iP(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(a=>e[a]);return t(n,(...a)=>a.reduce((i,s,c)=>(i[r[c]]=s,i),{}))},{withTypes:()=>mP});function US(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var _S=US(),jS=US;var fP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ko:ko.apply(null,arguments)},qB=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 C(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(At(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Ic(n)&&n.type===e,r}var zS=class es extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,es.prototype)}static get[Symbol.species](){return es}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new es(...t[0].concat(this)):new es(...t.concat(this))}};function $S(e){return je(e)?br(e,()=>{}):e}function GS(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function SP(e){return typeof e=="boolean"}var hP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new zS;return r&&(SP(r)?i.push(_S):i.push(jS(r.extraArgument))),i},Wr="RTK_autoBatch",Do=()=>e=>({payload:e,meta:{[Wr]:!0}}),WS=e=>t=>{setTimeout(t,e)},yP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:WS(10):e.type==="callback"?e.queueNotification:WS(e.timeout),u=()=>{i=!1,a&&(a=!1,s.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let m=()=>o&&l(),d=n.subscribe(m);return s.add(l),()=>{d(),s.delete(l)}},dispatch(l){try{return o=!l?.meta?.[Wr],a=!o,a&&(i||(i=!0,c(u))),n.dispatch(l)}finally{o=!0}}})},CP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new zS(e);return n&&o.push(yP(typeof n=="object"?n:void 0)),o};function KS(e){let t=hP(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=To(r);else throw new Error(At(1));let c;typeof n=="function"?c=n(t):c=t();let u=ko;o&&(u=fP({trace:!1,...typeof o=="object"&&o}));let l=PS(...c),m=CP(l),d=typeof i=="function"?i(m):m(),p=u(...d);return Bp(s,a,p)}function YS(e){let t={},r=[],n,o={addCase(a,i){let s=typeof a=="string"?a:a.type;if(!s)throw new Error(At(28));if(s in t)throw new Error(At(29));return t[s]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function xP(e){return typeof e=="function"}function _(e,t){let[r,n,o]=YS(t),a;if(xP(e))a=()=>$S(e());else{let s=$S(e);a=()=>s}function i(s=a(),c){let u=[r[c.type],...n.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[o]),u.reduce((l,m)=>{if(m)if(Je(l)){let p=m(l,c);return p===void 0?l:p}else{if(je(l))return br(l,d=>m(d,c));{let d=m(l,c);if(d===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return l},s)}return i.getInitialState=a,i}var JS=(e,t)=>gP(e)?e.match(t):e(t);function Dt(...e){return t=>e.some(r=>JS(r,t))}function qo(...e){return t=>e.every(r=>JS(r,t))}function Nc(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 ts(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Mc(...e){return e.length===0?t=>Nc(t,["pending"]):ts(e)?Dt(...e.map(t=>t.pending)):Mc()(e[0])}function zn(...e){return e.length===0?t=>Nc(t,["rejected"]):ts(e)?Dt(...e.map(t=>t.rejected)):zn()(e[0])}function rs(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qo(zn(...e),t):ts(e)?qo(zn(...e),t):rs()(e[0])}function vr(...e){return e.length===0?t=>Nc(t,["fulfilled"]):ts(e)?Dt(...e.map(t=>t.fulfilled)):vr()(e[0])}function Lc(...e){return e.length===0?t=>Nc(t,["pending","fulfilled","rejected"]):ts(e)?Dt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Lc()(e[0])}var AP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qc=(e=21)=>{let t="",r=e;for(;r--;)t+=AP[Math.random()*64|0];return t},FP=["name","message","stack","code"],em=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},HS=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},RP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of FP)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},G=(()=>{function e(t,r,n){let o=C(t+"/fulfilled",(c,u,l,m)=>({payload:c,meta:{...m||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),a=C(t+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),i=C(t+"/rejected",(c,u,l,m,d)=>({payload:m,error:(n&&n.serializeError||RP)(c||"Rejected"),meta:{...d||{},arg:l,requestId:u,rejectedWithValue:!!m,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,l,m)=>{let d=n?.idGenerator?n.idGenerator(c):Qc(),p=new AbortController,f,y;function S(g){y=g,p.abort()}let h=async function(){let g;try{let F=n?.condition?.(c,{getState:l,extra:m});if(vP(F)&&(F=await F),F===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let I=new Promise((b,R)=>{f=()=>{R({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",f)});u(a(d,c,n?.getPendingMeta?.({requestId:d,arg:c},{getState:l,extra:m}))),g=await Promise.race([I,Promise.resolve(r(c,{dispatch:u,getState:l,extra:m,requestId:d,signal:p.signal,abort:S,rejectWithValue:(b,R)=>new em(b,R),fulfillWithValue:(b,R)=>new HS(b,R)})).then(b=>{if(b instanceof em)throw b;return b instanceof HS?o(b.payload,d,c,b.meta):o(b,d,c)})])}catch(F){g=F instanceof em?i(null,d,c,F.payload,F.meta):i(F,d,c)}finally{f&&p.signal.removeEventListener("abort",f)}return n&&!n.dispatchConditionRejection&&i.match(g)&&g.meta.condition||u(g),g}();return Object.assign(h,{abort:S,requestId:d,arg:c,unwrap(){return h.then(bP)}})}}return Object.assign(s,{pending:a,rejected:i,fulfilled:o,settled:Dt(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function bP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var XS=Symbol.for("rtk-slice-createasyncthunk"),LB={[XS]:G};function PP(e,t){return`${e}/${t}`}function wP({creators:e}={}){let t=e?.asyncThunk?.[XS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(At(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(EP()):n.reducers)||{},s=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,x){let F=typeof g=="string"?g:g.type;if(!F)throw new Error(At(12));if(F in c.sliceCaseReducersByType)throw new Error(At(13));return c.sliceCaseReducersByType[F]=x,u},addMatcher(g,x){return c.sliceMatchers.push({matcher:g,reducer:x}),u},exposeAction(g,x){return c.actionCreators[g]=x,u},exposeCaseReducer(g,x){return c.sliceCaseReducersByName[g]=x,u}};s.forEach(g=>{let x=i[g],F={reducerName:g,type:PP(o,g),createNotation:typeof n.reducers=="function"};kP(x)?qP(F,x,u,t):TP(F,x,u)});function l(){let[g={},x=[],F=void 0]=typeof n.extraReducers=="function"?YS(n.extraReducers):[n.extraReducers],I={...g,...c.sliceCaseReducersByType};return _(n.initialState,b=>{for(let R in I)b.addCase(R,I[R]);for(let R of c.sliceMatchers)b.addMatcher(R.matcher,R.reducer);for(let R of x)b.addMatcher(R.matcher,R.reducer);F&&b.addDefaultCase(F)})}let m=g=>g,d=new Map,p;function f(g,x){return p||(p=l()),p(g,x)}function y(){return p||(p=l()),p.getInitialState()}function S(g,x=!1){function F(b){let R=b[g];return typeof R>"u"&&x&&(R=y()),R}function I(b=m){let R=GS(d,x,()=>new WeakMap);return GS(R,b,()=>{let E={};for(let[w,T]of Object.entries(n.selectors??{}))E[w]=IP(T,b,y,x);return E})}return{reducerPath:g,getSelectors:I,get selectors(){return I(F)},selectSlice:F}}let h={name:o,reducer:f,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...S(a),injectInto(g,{reducerPath:x,...F}={}){let I=x??a;return g.inject({reducerPath:I,reducer:f},F),{...h,...S(I,!0)}}};return h}}function IP(e,t,r,n){function o(a,...i){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...i)}return o.unwrapped=e,o}var Kn=wP();function EP(){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 TP({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!OP(n))throw new Error(At(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?C(e,i):C(e))}function kP(e){return e._reducerDefinitionType==="asyncThunk"}function OP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function qP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(At(18));let{payloadCreator:a,fulfilled:i,pending:s,rejected:c,settled:u,options:l}=r,m=o(e,a,l);n.exposeAction(t,m),i&&n.addCase(m.fulfilled,i),s&&n.addCase(m.pending,s),c&&n.addCase(m.rejected,c),u&&n.addMatcher(m.settled,u),n.exposeCaseReducer(t,{fulfilled:i||Vc,pending:s||Vc,rejected:c||Vc,settled:u||Vc})}function Vc(){}var ZS="listener",eh="completed",th="cancelled",QB=`task-${th}`,BB=`task-${eh}`,UB=`${ZS}-${th}`,_B=`${ZS}-${eh}`;var{assign:rh}=Object;var tm="listenerMiddleware";var DP=rh(C(`${tm}/add`),{withTypes:()=>DP}),jB=C(`${tm}/removeAll`),VP=rh(C(`${tm}/remove`),{withTypes:()=>VP});var $B=Symbol.for("rtk-state-proxy-original");function At(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. `}function NP({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;i!=="disabled"&&(n.call(r),t.send(o,a,r))}var MP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function LP(e){return typeof e=="string"&&MP.test(e)}var Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));function QP(e,t=0){return(Oe[e[t+0]]+Oe[e[t+1]]+Oe[e[t+2]]+Oe[e[t+3]]+"-"+Oe[e[t+4]]+Oe[e[t+5]]+"-"+Oe[e[t+6]]+Oe[e[t+7]]+"-"+Oe[e[t+8]]+Oe[e[t+9]]+"-"+Oe[e[t+10]]+Oe[e[t+11]]+Oe[e[t+12]]+Oe[e[t+13]]+Oe[e[t+14]]+Oe[e[t+15]]).toLowerCase()}var rm,BP=new Uint8Array(16);function UP(){if(!rm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rm=crypto.getRandomValues.bind(crypto)}return rm(BP)}var _P=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nh={randomUUID:_P};function jP(e,t,r){if(nh.randomUUID&&!e)return nh.randomUUID();e=e||{};let n=e.random??e.rng?.()??UP();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,QP(n)}function $P(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&LP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var ah="1.0.0";function GP(e){let{trackingId:t}=e;return{trackingId:t}}function WP(e){return(e.source||[]).concat([`relay@${ah}`])}function ih(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,s=GP(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:WP(t),clientId:c,userAgent:i(),referrer:o(),location:a()})}function HP(e,t,r,n,o){return{...t,meta:ih(e,r,n,o)}}var zP="*";function KP(){let e=[];function t({type:c,callback:u}){return e.findIndex(l=>l.type===c&&l.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(l){console.error(l)}})}function a(c){if(c===zP)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function i(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?i({type:c,callback:u}):a(c)}return{add:n,call:o,remove:s}}function oh({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 YP(e){let t=oh(e);return{get:()=>t,update:r=>{t=oh({...t,...r})}}}function JP(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var nm=XP();function XP(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function ZP(){return{getItem(e){return nm.getItem(e)||localStorage.getItem(e)},removeItem(e){nm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),nm.setItem(e,t,31556952e3)}}}function ew(){let e=document.referrer;return e===""?null:e}function tw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(JP().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:()=>ew(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>jP(),storage:ZP()}}function rw(){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 nw(){return{getItem(){return null},removeItem(){},setItem(){}}}function ow(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:nw()}}function aw(e){return e.get().mode!=="disabled"&&iw()&&rw()?tw():ow()}function iw(){try{return typeof window=="object"}catch{return!1}}function sw(e){return{get:()=>Object.freeze(aw(e))}}function sh(e){let t=YP(e),r=KP(),n=sw(t),o=$P(n);return{emit:(a,i)=>{let s=t.get(),c=n.get(),u=HP(a,i,s,c,o);return NP({config:s,environment:c,event:u,listenerManager:r})},getMeta:a=>ih(a,t.get(),n.get(),o),on:(a,i)=>r.add({type:a,callback:i}),off:(a,i)=>r.remove(a,i),updateConfig:a=>t.update(a),version:ah}}var Yn="3.16.1-pre.3f4a309ff4",ch=["@coveo/atomic","@coveo/quantic"];var Vt=Y(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Yn}`));var Vo=Y(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Vt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i)=>sh({mode:a?"emit":"disabled",url:o??Lp(e,t),token:r,trackingId:n,source:i}));function Pr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function v(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function im(){return typeof window<"u"}function Cm(){return typeof navigator<"u"}function No(){return typeof document<"u"}function sm(){try{return typeof localStorage<"u"}catch{return!1}}function cw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fh(){return Cm()&&navigator.cookieEnabled}var uw=[X.click,X.custom,X.search,X.view],lw=(e,t)=>uw.indexOf(e)!==-1?Object.assign({language:No()?document.documentElement.lang:"unknown",userAgent:Cm()?navigator.userAgent:"unknown"},t):t,as=class e{static set(t,r,n){var o,a,i,s;n&&(a=new Date,a.setTime(a.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?uh(t,r,a):(i=s.split("."),o=i[i.length-2]+"."+i[i.length-1],uh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function uh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function dw(){return sm()?localStorage:Fh()?new is:cw()?sessionStorage:new Lo}var is=class e{getItem(t){return as.get(`${e.prefix}${t}`)}removeItem(t){as.erase(`${e.prefix}${t}`)}setItem(t,r,n){as.set(`${e.prefix}${t}`,r,n)}};is.prefix="coveo_";var cm=class{constructor(){this.cookieStorage=new is}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)}},Lo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},ns="__coveo.analytics.history",Rh=20,bh=1e3*60,vh=75,Qo=class{constructor(t){this.store=t||dw()}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 v(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 v(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(ns);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return v(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(ns);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(ns,JSON.stringify(t.slice(0,Rh)))}catch{}}clear(){try{this.store.removeItem(ns)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,vh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>bh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},Ph=Object.freeze({__proto__:null,HistoryStore:Qo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Rh,MAX_VALUE_SIZE:vh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:bh,STORE_KEY:ns,default:Qo}),pw=(e,t)=>v(void 0,void 0,void 0,function*(){return e===X.view?(yield mw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),mw=e=>v(void 0,void 0,void 0,function*(){let t=new Qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Bc,fw=new Uint8Array(16);function gw(){if(!Bc&&(Bc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bc(fw)}var Sw=/^(?:[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 _c(e){return typeof e=="string"&&Sw.test(e)}var qe=[];for(let e=0;e<256;++e)qe.push((e+256).toString(16).slice(1));function wh(e,t=0){return(qe[e[t+0]]+qe[e[t+1]]+qe[e[t+2]]+qe[e[t+3]]+"-"+qe[e[t+4]]+qe[e[t+5]]+"-"+qe[e[t+6]]+qe[e[t+7]]+"-"+qe[e[t+8]]+qe[e[t+9]]+"-"+qe[e[t+10]]+qe[e[t+11]]+qe[e[t+12]]+qe[e[t+13]]+qe[e[t+14]]+qe[e[t+15]]).toLowerCase()}function hw(e){if(!_c(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 yw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Cw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",xw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Aw(e,t,r){function n(o,a,i,s){var c;if(typeof o=="string"&&(o=yw(o)),typeof a=="string"&&(a=hw(a)),((c=a)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(a),u.set(o,a.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,i){s=s||0;for(let l=0;l<16;++l)i[s+l]=u[l];return i}return wh(u)}try{n.name=e}catch{}return n.DNS=Cw,n.URL=xw,n}var Fw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lh={randomUUID:Fw};function Jn(e,t,r){if(lh.randomUUID&&!t&&!e)return lh.randomUUID();e=e||{};let n=e.random||(e.rng||gw)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return wh(n)}function Rw(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 om(e,t){return e<<t|e>>>32-t}function bw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let s=0;s<i.length;++s)e.push(i.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[i*64+c*4]<<24|e[i*64+c*4+1]<<16|e[i*64+c*4+2]<<8|e[i*64+c*4+3];a[i]=s}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let s=new Uint32Array(80);for(let p=0;p<16;++p)s[p]=a[i][p];for(let p=16;p<80;++p)s[p]=om(s[p-3]^s[p-8]^s[p-14]^s[p-16],1);let c=r[0],u=r[1],l=r[2],m=r[3],d=r[4];for(let p=0;p<80;++p){let f=Math.floor(p/20),y=om(c,5)+Rw(f,u,l,m)+d+t[f]+s[p]>>>0;d=m,m=l,l=om(u,30)>>>0,u=c,c=y}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+d>>>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 vw=Aw("v5",80,bw),dh=vw,Ih="2.30.43",ph=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,os={pageview:"pageview",event:"event"},jc=class{constructor({client:t,uuidGenerator:r=Jn}){this.client=t,this.uuidGenerator=r}},um=class extends jc{constructor({client:t,uuidGenerator:r=Jn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ph(window.location),this.lastReferrer=No()?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:No()?document.title:"",encoding:No()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===os.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===os.pageview?this.nextPageViewId:this.pageViewId,referrer:t===os.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===os.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return ph(window.location)}},Hr=class e{constructor(t,r){if(!_c(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return _c(a)?new e(a,Number.parseInt(o)*1e3):null}};Hr.cvo_cid="cvo_cid";Hr.expirationTime=120;var lm=class extends jc{constructor({client:t,uuidGenerator:r=Jn}){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 v(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(Hr.cvo_cid,new Hr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};lm.Id="link";var it=Object.keys;function Uc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var am=128,Eh=192,mh=224,fh=240;function Pw(e){return(e&248)===fh?4:(e&fh)===mh?3:(e&mh)===Eh?2:1}function ww(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&am)!=am)break;if(r-=3,(n&Eh)!=am){t-r>=Pw(n)*3&&(r=t);break}}return e.substring(0,r)}var dm={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"},Iw=it(dm).map(e=>dm[e]),Ew=[...Iw].join("|"),Tw=new RegExp(`^(${Ew}$)`),kw={svcAction:"svc_action",svcActionData:"svc_action_data"},Ow=e=>it(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=dm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),qw=e=>Tw.test(e),Dw=[qw],gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Sh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ve={action:"pa",list:"pal",listSource:"pls"},$c={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Vw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],pm={id:"quoteId",affiliation:"quoteAffiliation"},mm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Nw={add:Ve,bookmark_add:Ve,bookmark_remove:Ve,click:Ve,checkout:Ve,checkout_option:Ve,detail:Ve,impression:Ve,remove:Ve,refund:Object.assign(Object.assign({},Ve),$c),purchase:Object.assign(Object.assign({},Ve),$c),quickview:Ve,quote:Object.assign(Object.assign({},Ve),pm),review:Object.assign(Object.assign({},Ve),mm)},Mw=it(gh).map(e=>gh[e]),Lw=it(Sh).map(e=>Sh[e]),Qw=it(Ve).map(e=>Ve[e]),Bw=it($c).map(e=>$c[e]),Uw=it(mm).map(e=>mm[e]),_w=it(pm).map(e=>pm[e]),jw=[...Mw,"custom"].join("|"),$w=[...Lw,"custom"].join("|"),Th="(pr[0-9]+)",kh="(il[0-9]+pi[0-9]+)",Gw=new RegExp(`^${Th}(${jw})$`),Ww=new RegExp(`^(${kh}(${$w}))|(il[0-9]+nm)$`),Hw=new RegExp(`^(${Qw.join("|")})$`),zw=new RegExp(`^(${Bw.join("|")})$`),Kw=new RegExp(`^${Th}custom$`),Yw=new RegExp(`^${kh}custom$`),Jw=new RegExp(`^(${[...Vw,...Uw,..._w].join("|")})$`),Xw=e=>Gw.test(e),Zw=e=>Ww.test(e),eI=e=>Hw.test(e),tI=e=>zw.test(e),rI=e=>Jw.test(e),nI=[Zw,Xw,eI,tI,rI],oI=[Kw,Yw],aI={anonymizeIp:"aip"},iI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},sI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},cI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],uI=Object.assign(Object.assign(Object.assign(Object.assign({},aI),iI),sI),cI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),fm=Object.assign(Object.assign({},uI),kw),lI=e=>{let t=!!e.action&&Nw[e.action]||{};return it(e).reduce((r,n)=>{let o=t[n]||fm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},dI=it(fm).map(e=>fm[e]),pI=e=>dI.indexOf(e)!==-1,mI=e=>e==="custom",fI=e=>[...nI,...Dw,pI,mI].some(t=>t(e)),gI=e=>it(e).reduce((t,r)=>{let n=SI(r);return n?Object.assign(Object.assign({},t),hI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),SI=e=>{let t;return[...oI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},hI=(e,t)=>it(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),gm=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return v(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=i;o=s||t;try{a=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return v(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Sm=class{sendEvent(t,r){return v(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){return Promise.resolve()})}},hh=globalThis.fetch,Gc=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),a?yield a(s,"analyticsFetch"):{}),{url:u}=c,l=Pr(c,["url"]),m;try{m=yield hh(u,l)}catch(d){console.error("An error has occured when sending the event.",d);return}if(m.ok){let d=yield m.json();return d.visitorId&&o.setCurrentVisitorId(d.visitorId),d}else{try{m.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,m,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield hh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return v(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"})}},hm=class{constructor(t,r){sm()&&Fh()?this.storage=new cm:sm()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Lo),this.client=new Gc(t),this.beaconClient=new gm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},ym=class{constructor(t,r){this.storage=r||new Lo,this.client=new Gc(t)}getClientDependingOnEventType(t){return this.client}},Wc=class{constructor(){this.storage=new Lo,this.client=new Sm}getClientDependingOnEventType(t){return this.client}},yI="xx",CI=e=>e?.startsWith(yI)||!1,xI=`
|
|
20
20
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
21
21
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
22
22
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|