@coveo/quantic 3.38.0 → 3.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25
25
 
26
26
  ${t}
27
27
  `;return new Oo(r)}var Oo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Pe=class{constructor(e){le(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw Yk(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},$e=class{constructor(e={}){le(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&ee(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Ua(e){return e===void 0}function Kk(e){return e===null}function ee(e){return Ua(e)||Kk(e)}var fe=class{constructor(e={}){le(this,"value");this.value=new $e(e)}validate(e){let t=this.value.validate(e);return t||(Xk(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Xk(e){return Ua(e)||ku(e)}function ku(e){return typeof e=="boolean"}var oe=class{constructor(e={}){le(this,"config");le(this,"value");this.config=e,this.value=new $e(e)}validate(e){let t=this.value.validate(e);return t||(Zk(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Zk(e){return Ua(e)||Jv(e)}function Jv(e){return typeof e=="number"&&!Number.isNaN(e)}var Jk=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,$=class{constructor(e={}){le(this,"value");le(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new $e(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(Ua(e))return null;if(!Qa(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(Jk.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Qa(e){return Object.prototype.toString.call(e)==="[object String]"}var Y=class{constructor(e={}){le(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ua(e))return this.config.options.required?"value is required and is currently undefined":null;if(!eA(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ee(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function eA(e){return e!==void 0&&typeof e=="object"}var ne=class{constructor(e={}){le(this,"config");le(this,"value");this.config=e,this.value=new $e(this.config)}validate(e){if(!ee(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ee(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&ee(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return ku(e)||Qa(e)||Jv(e)||eA(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ba(e){return Array.isArray(e)}var zs=class{constructor(e){le(this,"config");le(this,"value");this.config=e,this.value=new $e(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ua(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var Ou=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function _u(e){return Array.isArray(e)}function Nu(e){return e.trim()===""}function tA(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function eO(e){return btoa(encodeURI(e))}function Du(e,t){let{[e]:r,...n}=t;return n}function Ga(e){return eO(JSON.stringify(e))}var tO=new Set(["1",1,"yes",!0]);function rA(){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=>tO.has(r))}function nA(e){let t={};for(let[r,n]of e)t[r]=n;return t}function oA(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Ws(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function qu(e,t,r={}){let n;return(...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)}}function rO(e){if(Nu(e.openingDelimiter)||Nu(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ee(e.content)||Nu(e.content))return e.content;if(e.highlights.length===0)return $a(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,p=i+a.length;if(p>t)break;r+=$a(e.content.slice(n,i)),r+=e.openingDelimiter,r+=$a(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=$a(e.content.slice(n))),r}function Lg(e,t){return e=$a(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?jg(n,t.notMatchDelimiters):o?jg(o,t.exactMatchDelimiters):a?jg(a,t.correctionDelimiters):r)}function jg(e,t){return t?t.open+e+t.close:e}function $a(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();var hA=Fr(pA(),1);d();c();l();u();var ae=new Error("Failed to load reducers."),Ha=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},No=class extends Error{constructor(r,n){super();le(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function fA(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function mA(e){return typeof e!="object"||!e?!1:Object.values(e).every(FO)}function FO(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function gA(e){return e===429}var jr=class e{static call(t){return _asyncToGenerator(function*(){let r=TO(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(a,i);if(gA(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,hA.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&gA(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(C=>setTimeout(C,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Ha;case 404:throw new No(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new No(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Ws(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function mt(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Qn(e,t,r="prod"){return e??mt(t,r)}function Kt(e,t="prod"){return`${mt(e,t)}/rest/search/v2`}function Vu(e,t="prod"){return`${mt(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function TO(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=PO(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function PO(e,t){return t==="application/x-www-form-urlencoded"?mA(e)?fA(e):"":JSON.stringify(e)}d();c();l();u();var Xs=Fr(ju(),1),bA=Fr(yA(),1);d();c();l();u();var Lu=Fr(ju(),1),vA=Fr(SA(),1);Lu.default.extend(vA.default);var AA="YYYY/MM/DD@HH:mm:ss",kO="1401-01-01";function za(e,t){let r=(0,Lu.default)(e,t);return!r.isValid()&&!t?(0,Lu.default)(e,AA):r}function Uu(e){return e.format(AA)}function CA(e,t){let r=za(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}rh(r)}function rh(e){if(e.isBefore(kO))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Xs.default.extend(bA.default);var xA=["past","now","next"],wA=["minute","hour","day","week","month","quarter","year"],OO=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new $({required:!t,constrainTo:wA}),period:new $({required:!0,constrainTo:xA})}};function Qu(e){if(typeof e=="string"&&!Bn(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?nh(e):e;new Pe(OO(t.period)).validate(t);let r=IA(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);rh(r)}function RA(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function IA(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Xs.default)().subtract(r,n);case"next":return(0,Xs.default)().add(r,n);case"now":return(0,Xs.default)()}}function Zs(e){return Uu(IA(nh(e)))}function EA(e){return e.toLocaleLowerCase().split("-")}function Bn(e){let[t,r,n]=EA(e);if(t==="now")return!0;if(!xA.includes(t)||!wA.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function FA(e){return!!e&&typeof e=="object"&&"period"in e}function nh(e){let[t,r,n]=EA(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function TA(e){return Qu(e),nh(e)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function kA(_x3,_x4){return _kA.apply(this,arguments)}function _kA(){_kA=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _kA.apply(this,arguments)}function OA(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=NO(t,i);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function _A(e,t,r){let n=PA(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=PA();else if(p>0){let f=o.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),g=o.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
28
- ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":_O(g,n,t);break}}}}function _O(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function NO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function PA(){return{data:"",event:"",id:"",retry:void 0}}var oh="text/event-stream",DO=1e3,NA="last-event-id";function DA(){return typeof window<"u"}function Bu(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,C)=>{let x={...r};x.accept||(x.accept=oh);let h;function S(){h?.abort(),document.hidden||k()}!p&&DA()&&document.addEventListener("visibilitychange",S);let b=DO,w;function I(){DA()&&document.removeEventListener("visibilitychange",S),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{I(),g()});let E=f??v,F=n??qO;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let T=yield E(e,{...m,headers:x,signal:h?.signal});yield F(T),yield kA(T.body,OA(_A(q=>{q?x[NA]=q:delete x[NA]},q=>{b=q},o))),a?.(),I(),g()}catch(T){if(!h?.signal?.aborted)try{let q=i?.(T)??b;clearTimeout(w),w=setTimeout(k,q)}catch(q){I(),C(q)}}});return _k2.apply(this,arguments)}k()})}function qO(e){let t=e.headers.get("content-type");if(!t?.startsWith(oh))throw new Error(`Expected content-type to be ${oh}, Actual: ${t}`)}d();c();l();u();var Gn=class{constructor(t){le(this,"_basePath");le(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 MO=(e,t,r)=>new Gn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,qA=3,VO=5e3,jO="text/event-stream",sh=1,ah=class extends Error{},Js=class extends Error{constructor(r){super(r.message);le(this,"payload",r)}},ih=class{constructor(){le(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)}},Gu=class{constructor(t){le(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,C=new ih;if(!a){this.logger.error("No stream ID found");return}let x=0,h,S=()=>{h&&!C.isActive(h)&&(w?.abort(),g(),I())},b=()=>{C.remove(h),h=oA(S,h,VO),C.add(h)},w=new s.AbortController,I=()=>Bu(MO(n,o,a),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===jO)return;throw E.status>=400&&E.status<500&&E.status!==429?new Js({message:"Error opening stream",code:E.status}):new ah})()},onmessage:E=>{if(w?.signal.aborted)return;let F=JSON.parse(E.data);if(F.finishReason==="ERROR"){C.remove(h),w?.abort(),f({message:F.errorMessage,code:F.statusCode});return}p(F),x=0,F.finishReason==="COMPLETED"?(C.remove(h),m()):b()},onerror:E=>{if(!w?.signal.aborted){if(C.remove(h),E instanceof Js)throw w?.abort(),f(E),E;if(++x>qA){this.logger.info("Maximum retry exceeded.");let F={message:"Failed to complete stream.",code:sh};throw w?.abort(),f(F),new Js(F)}this.logger.info(`Retrying...(${x}/${qA})`),g()}}});return I(),w}};d();c();l();u();var $u=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function ec(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var ch=e=>{let{response:t}=e;return t.body?LO(e):UO(t)},LO=e=>BO(e)?GO(e):QO(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},UO=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function QO(e){return e.body.statusCode!==void 0}function BO(e){return e.body.exception!==void 0}var GO=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function MA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var uh=(e,t,r,n)=>{let o=new Gn(`${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 VA=(e,t)=>{let r=new Gn(`${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},lh=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jr.call({...uh(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ec(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=MA(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return $O(i)?{success:i}:{error:ch({response:r,body:i})}});return function lh(_x5,_x6){return _ref3.apply(this,arguments)}}();function $O(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function Wa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function At(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Wa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Wa(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function HO(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function zO(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Ya(e,t){if(t&&e.name==="AbortError")return{error:zO(e)};if(e instanceof No)return{error:HO(e)};throw e}var $n=e=>e.success!==void 0,He=e=>e.error!==void 0;function jA(e){return e.results!==void 0}function LA(e){let t=Wa();return ee(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var dh=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,WO=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,tc=(e,t,r,n)=>{YO(e);let o=dh(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},UA=(e,t,r)=>{KO(e);let n=WO(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},ph=e=>{let{insightId:t,...r}=ec(e);return r},QA=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},YO=e=>{if(QA(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},KO=e=>{if(QA(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var BA=e=>({...tc(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var GA=e=>({...tc(e,"POST","application/json","/search"),requestParams:ph(e)}),$A=e=>({...tc(e,"POST","application/json","/querysuggest"),requestParams:ph(e)});d();c();l();u();var HA=e=>({...UA(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Hu=class{constructor(t){le(this,"options",t)}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield jr.call({...BA(t),..._this.options});if(r instanceof Error)return Ya(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield jr.call({...GA(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return Ya(n);let o=yield n.json();return jA(o)&&(o=LA(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jr.call({...$A(t),..._this3.options});if(r instanceof Error)return Ya(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield jr.call({...HA(t),..._this4.options});if(r instanceof Error)return Ya(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return lh(t,{..._this5.options})})()}};d();c();l();u();d();c();l();u();var z=new $({required:!0,emptyAllowed:!1}),We=new $({required:!1,emptyAllowed:!1}),Ke=new $({required:!0,emptyAllowed:!0}),jz=new $({required:!1,emptyAllowed:!0}),zu=new ne({each:z,required:!0}),zA=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),WA=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Lz=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Tr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),mr=(e,t)=>{if("required"in t)return{payload:new Pe({value:t}).validate({value:e}).value};let o=new Y({options:{required:!0},values:t}).validate(e);if(o)throw new Oo(o);return{payload:e}},_=(e,t)=>{try{return mr(e,t)}catch(r){return{payload:e,error:Tr(r)}}},gr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return YA(e,t,r,o,"Controller initialization error")},ht=(e,t,r,n)=>{let o=`Check the options of ${n}`;return YA(e,t,r,o,"Controller initialization error")},YA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(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 XO=typeof Symbol=="function"&&Symbol.observable||"@@observable",KA=XO,fh=()=>Math.random().toString(36).substring(7).split("").join("."),ZO={INIT:`@@redux/INIT${fh()}`,REPLACE:`@@redux/REPLACE${fh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fh()}`},Wu=ZO;function Lr(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 mh(e,t,r){if(typeof e!="function")throw new Error(Et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Et(1));return r(mh)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,I)=>{i.set(I,w)}))}function g(){if(f)throw new Error(Et(3));return o}function C(w){if(typeof w!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let I=!0;m();let E=p++;return i.set(E,w),function(){if(I){if(f)throw new Error(Et(6));I=!1,m(),i.delete(E),a=null}}}function x(w){if(!Lr(w))throw new Error(Et(7));if(typeof w.type>"u")throw new Error(Et(8));if(typeof w.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(E=>{E()}),w}function h(w){if(typeof w!="function")throw new Error(Et(10));n=w,x({type:Wu.REPLACE})}function S(){let w=C;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(Et(11));function E(){let k=I;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[KA](){return this}}}return x({type:Wu.INIT}),{dispatch:x,subscribe:C,getState:g,replaceReducer:h,[KA]:S}}function JO(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Wu.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:Wu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Ka(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{JO(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let C=0;C<n.length;C++){let x=n[C],h=r[x],S=p[x],b=h(S,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Et(14))}g[x]=b,m=m||b!==S}return m=m||n.length!==Object.keys(p).length,m?g:p}}function rc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function XA(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Et(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=rc(...p)(o.dispatch),{...o,dispatch:a}}}function nc(e){return Lr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var xh=Symbol.for("immer-nothing"),oc=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state");function Ft(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,qo=sr.getPrototypeOf,ic="constructor",dc="prototype",yh="configurable",Zu="enumerable",Ku="writable",sc="value",$t=e=>!!e&&!!e[Ct];function Ht(e){return e?aC(e)||fc(e)||!!e[oc]||!!e[ic]?.[oc]||mc(e)||gc(e):!1}var e_=sr[dc][ic].toString(),ZA=new WeakMap;function aC(e){if(!e||!Xa(e))return!1;let t=qo(e);if(t===null||t===sr[dc])return!0;let r=sr.hasOwnProperty.call(t,ic)&&t[ic];if(r===Object)return!0;if(!Do(r))return!1;let n=ZA.get(r);return n===void 0&&(n=Function.toString.call(r),ZA.set(r,n)),n===e_}function iC(e){return $t(e)||Ft(15,e),e[Ct].base_}function pc(e,t,r=!0){Mo(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Mo(e){let t=e[Ct];return t?t.type_:fc(e)?1:mc(e)?2:gc(e)?3:0}var ac=(e,t,r=Mo(e))=>r===2?e.has(t):sr[dc].hasOwnProperty.call(e,t),Rn=(e,t,r=Mo(e))=>r===2?e.get(t):e[t],Ju=(e,t,r,n=Mo(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function t_(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var fc=Array.isArray,mc=e=>e instanceof Map,gc=e=>e instanceof Set,Xa=e=>typeof e=="object",Do=e=>typeof e=="function",gh=e=>typeof e=="boolean";function r_(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var n_=e=>Xa(e)?e?.[Ct]:null,In=e=>e.copy_||e.base_;var wh=e=>e.modified_?e.copy_:e.base_;function Sh(e,t){if(mc(e))return new Map(e);if(gc(e))return new Set(e);if(fc(e))return Array[dc].slice.call(e);let r=aC(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[Ct];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Ku]===!1&&(p[Ku]=!0,p[yh]=!0),(p.get||p.set)&&(n[i]={[yh]:!0,[Ku]:!0,[Zu]:p[Zu],[sc]:e[i]})}return sr.create(qo(e),n)}else{let n=qo(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function Rh(e,t=!1){return al(e)||$t(e)||!Ht(e)||(Mo(e)>1&&sr.defineProperties(e,{set:Yu,add:Yu,clear:Yu,delete:Yu}),sr.freeze(e),t&&pc(e,(r,n)=>{Rh(n,!0)},!1)),e}function o_(){Ft(2)}var Yu={[sc]:o_};function al(e){return e===null||!Xa(e)?!0:sr.isFrozen(e)}var el="MapSet",tl="Patches",JA="ArrayMethods",rl={};function Vo(e){let t=rl[e];return t||Ft(0,e),t}var eC=e=>!!rl[e];function a_(e,t){rl[e]||(rl[e]=t)}var cc,sC=()=>cc,i_=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:eC(el)?Vo(el):void 0,arrayMethodsPlugin_:eC(JA)?Vo(JA):void 0});function tC(e,t){t&&(e.patchPlugin_=Vo(tl),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function vh(e){Ah(e),e.drafts_.forEach(s_),e.drafts_=null}function Ah(e){e===cc&&(cc=e.parent_)}var rC=e=>cc=i_(cc,e);function s_(e){let t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function nC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ct].modified_&&(vh(t),Ft(4)),Ht(e)&&(e=oC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Ct].base_,e,t)}else e=oC(t,r);return c_(t,e,!0),vh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==xh?e:void 0}function oC(e,t){if(al(t))return t;let r=t[Ct];if(!r)return nl(t,e.handledSet_,e);if(!il(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);lC(r,e)}return r.copy_}function c_(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Rh(t,r)}function cC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var il=(e,t)=>e.scope_===t,u_=[];function uC(e,t,r,n){let o=In(e),a=e.type_;if(n!==void 0&&Rn(o,n,a)===t){Ju(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;pc(o,(f,m)=>{if($t(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??u_;for(let p of i)Ju(o,p,r,a)}function l_(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!il(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=wh(a);uC(e,a.draft_??a,i,r),lC(a,o)})}function lC(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}cC(e)}}function d_(e,t,r){let{scope_:n}=e;if($t(r)){let o=r[Ct];il(o,n)&&o.callbacks_.push(function(){Xu(e);let i=wh(o);uC(e,r,i,t)})}else Ht(r)&&e.callbacks_.push(function(){let a=In(e);e.type_===3?a.has(r)&&nl(r,n.handledSet_,n):Rn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&nl(Rn(e.copy_,t,e.type_),n.handledSet_,n)})}function nl(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||$t(e)||t.has(e)||!Ht(e)||al(e)||(t.add(e),pc(e,(n,o)=>{if($t(o)){let a=o[Ct];if(il(a,r)){let i=wh(a);Ju(e,n,i,e.type_),cC(a)}}else Ht(o)&&nl(o,t,r)})),e}function p_(e,t){let r=fc(e),n={type_:r?1:0,scope_:t?t.scope_:sC(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=ol;r&&(o=[n],a=uc);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var ol={get(e,t){if(t===Ct)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=In(e);if(!ac(o,t,e.type_))return f_(e,o,t);let a=o[t];if(e.finalized_||!Ht(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&r_(t))return a;if(a===hh(e.base_,t)){Xu(e);let i=e.type_===1?+t:t,p=bh(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,r){let n=dC(In(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=hh(In(e),t),a=o?.[Ct];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(t_(r,o)&&(r!==void 0||ac(e.base_,t,e.type_)))return!0;Xu(e),Ch(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_.set(t,!0),d_(e,t,r)),!0},deleteProperty(e,t){return Xu(e),hh(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ch(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=In(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ku]:!0,[yh]:e.type_!==1||t!=="length",[Zu]:n[Zu],[sc]:r[t]}},defineProperty(){Ft(11)},getPrototypeOf(e){return qo(e.base_)},setPrototypeOf(){Ft(12)}},uc={};for(let e in ol){let t=ol[e];uc[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}uc.deleteProperty=function(e,t){return uc.set.call(this,e,t,void 0)};uc.set=function(e,t,r){return ol.set.call(this,e[0],t,r,e[0])};function hh(e,t){let r=e[Ct];return(r?In(r):e)[t]}function f_(e,t,r){let n=dC(t,r);return n?sc in n?n[sc]:n.get?.call(e.draft_):void 0}function dC(e,t){if(!(t in e))return;let r=qo(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=qo(r)}}function Ch(e){e.modified_||(e.modified_=!0,e.parent_&&Ch(e.parent_))}function Xu(e){e.copy_||(e.assigned_=new Map,e.copy_=Sh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var m_=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Do(t)&&!Do(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}Do(r)||Ft(6),n!==void 0&&!Do(n)&&Ft(7);let o;if(Ht(t)){let a=rC(this),i=bh(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?vh(a):Ah(a)}return tC(a,n),nC(o,a)}else if(!t||!Xa(t)){if(o=r(t),o===void 0&&(o=t),o===xh&&(o=void 0),this.autoFreeze_&&Rh(o,!0),n){let a=[],i=[];Vo(tl).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else Ft(1,t)},this.produceWithPatches=(t,r)=>{if(Do(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},gh(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),gh(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),gh(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ht(e)||Ft(8),$t(e)&&(e=sl(e));let t=rC(this),r=bh(t,e,void 0);return r[Ct].isManual_=!0,Ah(t),r}finishDraft(e,t){let r=e&&e[Ct];(!r||!r.isManual_)&&Ft(9);let{scope_:n}=r;return tC(n,t),nC(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Vo(tl).applyPatches_;return $t(e)?n(e,t):this.produce(e,o=>n(o,t))}};function bh(e,t,r,n){let[o,a]=mc(t)?Vo(el).proxyMap_(t,r):gc(t)?Vo(el).proxySet_(t,r):p_(t,r);return(r?.scope_??sC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?l_(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function sl(e){return $t(e)||Ft(10,e),pC(e)}function pC(e){if(!Ht(e)||al(e))return e;let t=e[Ct],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Sh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Sh(e,!0);return pc(r,(o,a)=>{Ju(r,o,pC(a))},n),t&&(t.finalized_=!1),r}function fC(){function t(S,b=[]){if(S.key_!==void 0){let w=S.parent_.copy_??S.parent_.base_,I=n_(Rn(w,S.key_)),E=Rn(w,S.key_);if(E===void 0||E!==S.draft_&&E!==S.base_&&E!==S.copy_||I!=null&&I.base_!==S.base_)return null;let F=S.parent_.type_===3,k;if(F){let T=S.parent_;k=Array.from(T.drafts_.keys()).indexOf(S.key_)}else k=S.key_;if(!(F&&w.size>k||ac(w,k)))return null;b.push(k)}if(S.parent_)return t(S.parent_,b);b.reverse();try{r(S.copy_,b)}catch{return null}return b}function r(S,b){let w=S;for(let I=0;I<b.length-1;I++){let E=b[I];if(w=Rn(w,E),!Xa(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(S,b,w){if(S.scope_.processedForPatches_.has(S))return;S.scope_.processedForPatches_.add(S);let{patches_:I,inversePatches_:E}=w;switch(S.type_){case 0:case 2:return f(S,b,I,E);case 1:return p(S,b,I,E);case 3:return m(S,b,I,E)}}function p(S,b,w,I){let{base_:E,assigned_:F}=S,k=S.copy_;k.length<E.length&&([E,k]=[k,E],[w,I]=[I,w]);let T=S.allIndicesReassigned_===!0;for(let q=0;q<E.length;q++){let G=k[q],Q=E[q];if((T||F?.get(q.toString()))&&G!==Q){let B=G?.[Ct];if(B&&B.modified_)continue;let L=b.concat([q]);w.push({op:n,path:L,value:h(G)}),I.push({op:n,path:L,value:h(Q)})}}for(let q=E.length;q<k.length;q++){let G=b.concat([q]);w.push({op:o,path:G,value:h(k[q])})}for(let q=k.length-1;E.length<=q;--q){let G=b.concat([q]);I.push({op:a,path:G})}}function f(S,b,w,I){let{base_:E,copy_:F,type_:k}=S;pc(S.assigned_,(T,q)=>{let G=Rn(E,T,k),Q=Rn(F,T,k),j=q?ac(E,T)?n:o:a;if(G===Q&&j===n)return;let B=b.concat(T);w.push(j===a?{op:j,path:B}:{op:j,path:B,value:h(Q)}),I.push(j===o?{op:a,path:B}:j===a?{op:o,path:B,value:h(G)}:{op:n,path:B,value:h(G)})})}function m(S,b,w,I){let{base_:E,copy_:F}=S,k=0;E.forEach(T=>{if(!F.has(T)){let q=b.concat([k]);w.push({op:a,path:q,value:T}),I.unshift({op:o,path:q,value:T})}k++}),k=0,F.forEach(T=>{if(!E.has(T)){let q=b.concat([k]);w.push({op:o,path:q,value:T}),I.unshift({op:a,path:q,value:T})}k++})}function g(S,b,w){let{patches_:I,inversePatches_:E}=w;I.push({op:n,path:[],value:b===xh?void 0:b}),E.push({op:n,path:[],value:S})}function C(S,b){return b.forEach(w=>{let{path:I,op:E}=w,F=S;for(let G=0;G<I.length-1;G++){let Q=Mo(F),j=I[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(Q===0||Q===1)&&(j==="__proto__"||j===ic)&&Ft(19),Do(F)&&j===dc&&Ft(19),F=Rn(F,j),Xa(F)||Ft(18,I.join("/"))}let k=Mo(F),T=x(w.value),q=I[I.length-1];switch(E){case n:switch(k){case 2:return F.set(q,T);case 3:Ft(16);default:return F[q]=T}case o:switch(k){case 1:return q==="-"?F.push(T):F.splice(q,0,T);case 2:return F.set(q,T);case 3:return F.add(T);default:return F[q]=T}case a:switch(k){case 1:return F.splice(q,1);case 2:return F.delete(q);case 3:return F.delete(w.value);default:return delete F[q]}default:Ft(17,E)}}),S}function x(S){if(!Ht(S))return S;if(fc(S))return S.map(x);if(mc(S))return new Map(Array.from(S.entries()).map(([w,I])=>[w,x(I)]));if(gc(S))return new Set(Array.from(S).map(x));let b=Object.create(qo(S));for(let w in S)b[w]=x(S[w]);return ac(S,oc)&&(b[oc]=S[oc]),b}function h(S){return $t(S)?x(S):S}a_(tl,{applyPatches_:C,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var lc=new m_,jo=lc.produce,Ih=lc.produceWithPatches.bind(lc);var Eh=lc.applyPatches.bind(lc);d();c();l();u();function g_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function h_(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 mC=e=>Array.isArray(e)?e:[e];function y_(e){let t=Array.isArray(e[0])?e[0]:e;return h_(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function S_(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var v_=class{constructor(e){this.value=e}deref(){return this.value}},A_=()=>typeof WeakRef>"u"?v_:WeakRef,hC=A_(),C_=0,gC=1;function cl(){return{s:C_,v:void 0,o:null,p:null}}function b_(e){return e instanceof hC?e.deref():e}function hc(e,t={}){let r=cl(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let C=0,x=f;C<x;C++){let h=arguments[C];if(typeof h=="function"||typeof h=="object"&&h!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let b=S.get(h);b===void 0?(p=cl(),S.set(h,p)):p=b}else{let S=p.p;S===null&&(p.p=S=new Map);let b=S.get(h);b===void 0?(p=cl(),S.set(h,p)):p=b}}let m=p,g;if(p.s===gC)g=p.v;else if(g=e.apply(null,arguments),a++,n){let C=b_(o);C!=null&&n(C,g)&&(g=C,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new hC(g):g}return m.s=gC,m.v=g,g}return i.clearCache=()=>{r=cl(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function x_(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),g_(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:C,memoizeOptions:x=[],argsMemoize:h=hc,argsMemoizeOptions:S=[]}=g,b=mC(x),w=mC(S),I=y_(o),E=C(function(){return a++,m.apply(null,arguments)},...b),F=!0,k=h(function(){i++;let q=S_(I,arguments);return p=E.apply(null,q),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:E,dependencies:I,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:C,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var st=x_(hc);d();c();l();u();function yC(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var SC=yC(),vC=yC;var w_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rc:rc.apply(null,arguments)},AW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},R_=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(zt(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=>nc(n)&&n.type===e,r}var EC=class yc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,yc.prototype)}static get[Symbol.species](){return yc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new yc(...t[0].concat(this)):new yc(...t.concat(this))}};function AC(e){return Ht(e)?jo(e,()=>{}):e}function ul(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function I_(e){return typeof e=="boolean"}var E_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new EC;return r&&(I_(r)?i.push(SC):i.push(vC(r.extraArgument))),i},Sc="RTK_autoBatch",ei=()=>e=>({payload:e,meta:{[Sc]:!0}}),CC=e=>t=>{setTimeout(t,e)},F_=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},T_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?F_(window.requestAnimationFrame,100):CC(10):e.type==="callback"?e.queueNotification:CC(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let C=()=>o&&g(),x=n.subscribe(C);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Sc],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},P_=e=>function(r){let{autoBatch:n=!0}=r??{},o=new EC(e);return n&&o.push(T_(typeof n=="object"?n:void 0)),o};function FC(e){let t=E_(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Lr(r))f=Ka(r);else throw new Error(zt(1));let m;typeof n=="function"?m=n(t):m=t();let g=rc;o&&(g=w_({trace:!1,...(typeof o=="object"&&o)}));let C=XA(...m),x=P_(C),h=typeof p=="function"?p(x):x(),S=g(...h);return mh(f,i,S)}function TC(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(zt(28));if(p in t)throw new Error(zt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),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 k_(e){return typeof e=="function"}function pe(e,t){let[r,n,o]=TC(t),a;if(k_(e))a=()=>AC(e());else{let p=AC(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,C)=>{if(C)if($t(g)){let h=C(g,f);return h===void 0?g:h}else{if(Ht(g))return jo(g,x=>C(x,f));{let x=C(g,f);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return i.getInitialState=a,i}var PC=(e,t)=>R_(e)?e.match(t):e(t);function Ur(...e){return t=>e.some(r=>PC(r,t))}function Ja(...e){return t=>e.every(r=>PC(r,t))}function fl(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 vc(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ml(...e){return e.length===0?t=>fl(t,["pending"]):vc(e)?Ur(...e.map(t=>t.pending)):ml()(e[0])}function Uo(...e){return e.length===0?t=>fl(t,["rejected"]):vc(e)?Ur(...e.map(t=>t.rejected)):Uo()(e[0])}function Ac(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ja(Uo(...e),t):vc(e)?Ja(Uo(...e),t):Ac()(e[0])}function En(...e){return e.length===0?t=>fl(t,["fulfilled"]):vc(e)?Ur(...e.map(t=>t.fulfilled)):En()(e[0])}function gl(...e){return e.length===0?t=>fl(t,["pending","fulfilled","rejected"]):vc(e)?Ur(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):gl()(e[0])}var O_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Cc=(e=21)=>{let t="",r=e;for(;r--;)t+=O_[Math.random()*64|0];return t},__=["name","message","stack","code"],Fh=class{constructor(e,t){le(this,"payload");le(this,"meta");le(this,"_type");this.payload=e,this.meta=t}},bC=class{constructor(e,t){le(this,"payload");le(this,"meta");le(this,"_type");this.payload=e,this.meta=t}},N_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of __)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},xC="External signal was aborted",me=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,m,g,C)=>({payload:f,meta:{...(C||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=P(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=P(t+"/rejected",(f,m,g,C,x)=>({payload:C,error:(n&&n.serializeError||N_)(f||"Rejected"),meta:{...(x||{}),arg:g,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,C,x)=>{let h=n?.idGenerator?n.idGenerator(f):Cc(),S=new s.AbortController,b,w;function I(F){w=F,S.abort()}m&&(m.aborted?I(xC):m.addEventListener("abort",()=>I(xC),{once:!0}));let E=_asyncToGenerator(function*(){let F;try{let T=n?.condition?.(f,{getState:C,extra:x});if(q_(T)&&(T=yield T),T===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((G,Q)=>{b=()=>{Q({name:"AbortError",message:w||"Aborted"})},S.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:C,extra:x}))),F=yield Promise.race([q,Promise.resolve(r(f,{dispatch:g,getState:C,extra:x,requestId:h,signal:S.signal,abort:I,rejectWithValue:(G,Q)=>new Fh(G,Q),fulfillWithValue:(G,Q)=>new bC(G,Q)})).then(G=>{if(G instanceof Fh)throw G;return G instanceof bC?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(T){F=T instanceof Fh?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&S.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||g(F),F})();return Object.assign(E,{abort:I,requestId:h,arg:f,unwrap(){return E.then(D_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Ur(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function D_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function q_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var kC=Symbol.for("rtk-slice-createasyncthunk"),bW={[kC]:me};function M_(e,t){return`${e}/${t}`}function V_({creators:e}={}){let t=e?.asyncThunk?.[kC];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(zt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(L_()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,k){let T=typeof F=="string"?F:F.type;if(!T)throw new Error(zt(12));if(T in f.sliceCaseReducersByType)throw new Error(zt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(F,k){return f.sliceMatchers.push({matcher:F,reducer:k}),m},exposeAction(F,k){return f.actionCreators[F]=k,m},exposeCaseReducer(F,k){return f.sliceCaseReducersByName[F]=k,m}};p.forEach(F=>{let k=i[F],T={reducerName:F,type:M_(o,F),createNotation:typeof n.reducers=="function"};Q_(k)?G_(T,k,m,t):U_(T,k,m)});function g(){let[F={},k=[],T=void 0]=typeof n.extraReducers=="function"?TC(n.extraReducers):[n.extraReducers],q={...F,...f.sliceCaseReducersByType};return pe(n.initialState,G=>{for(let Q in q)G.addCase(Q,q[Q]);for(let Q of f.sliceMatchers)G.addMatcher(Q.matcher,Q.reducer);for(let Q of k)G.addMatcher(Q.matcher,Q.reducer);T&&G.addDefaultCase(T)})}let C=F=>F,x=new Map,h=new WeakMap,S;function b(F,k){return S||(S=g()),S(F,k)}function w(){return S||(S=g()),S.getInitialState()}function I(F,k=!1){function T(G){let Q=G[F];return typeof Q>"u"&&k&&(Q=ul(h,T,w)),Q}function q(G=C){let Q=ul(x,k,()=>new WeakMap);return ul(Q,G,()=>{let j={};for(let[B,L]of Object.entries(n.selectors??{}))j[B]=j_(L,G,()=>ul(h,G,w),k);return j})}return{reducerPath:F,getSelectors:q,get selectors(){return q(T)},selectSlice:T}}let E={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...I(a),injectInto(F,{reducerPath:k,...T}={}){let q=k??a;return F.inject({reducerPath:q,reducer:b},T),{...E,...I(q,!0)}}};return E}}function j_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var Qo=V_();function L_(){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 U_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!B_(n))throw new Error(zt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?P(e,i):P(e))}function Q_(e){return e._reducerDefinitionType==="asyncThunk"}function B_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function G_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(zt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,C=o(e,a,g);n.exposeAction(t,C),i&&n.addCase(C.fulfilled,i),p&&n.addCase(C.pending,p),f&&n.addCase(C.rejected,f),m&&n.addMatcher(C.settled,m),n.exposeCaseReducer(t,{fulfilled:i||ll,pending:p||ll,rejected:f||ll,settled:m||ll})}function ll(){}var $_="task",OC="listener",_C="completed",kh="cancelled",H_=`task-${kh}`,z_=`task-${_C}`,Th=`${OC}-${kh}`,W_=`${OC}-${_C}`,hl=class{constructor(e){le(this,"code");le(this,"name","TaskAbortError");le(this,"message");this.code=e,this.message=`${$_} ${kh} (reason: ${e})`}},Oh=(e,t)=>{if(typeof e!="function")throw new TypeError(zt(32))},dl=()=>{},NC=(e,t=dl)=>(e.catch(t),e),DC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Lo=e=>{if(e.aborted)throw new hl(e.reason)};function qC(e,t){let r=dl;return new Promise((n,o)=>{let a=()=>o(new hl(e.reason));if(e.aborted){a();return}r=DC(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=dl})}var Y_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof hl?"cancelled":"rejected",error:r}}finally{t?.()}});return function Y_(_x7,_x8){return _ref5.apply(this,arguments)}}(),pl=e=>t=>NC(qC(e,t).then(r=>(Lo(e),r))),MC=e=>{let t=pl(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Za}=Object,wC={},yl="listenerMiddleware",K_=(e,t)=>{let r=n=>DC(e,()=>n.abort(e.reason));return(n,o)=>{Oh(n,"taskExecutor");let a=new s.AbortController;r(a);let i=Y_(/*#__PURE__*/_asyncToGenerator(function*(){Lo(e),Lo(a.signal);let p=yield n({pause:pl(a.signal),delay:MC(a.signal),signal:a.signal});return Lo(a.signal),p}),()=>a.abort(z_));return o?.autoJoin&&t.push(i.catch(dl)),{result:pl(e)(i),cancel(){a.abort(H_)}}}},X_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Lo(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(C,x)=>{x.unsubscribe(),f([C,x.getState(),x.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield qC(t,Promise.race(p));return Lo(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>NC(r(n,o))},VC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(zt(21));return Oh(a,"options.listener"),{predicate:o,type:t,effect:a}},jC=Za(e=>{let{type:t,predicate:r,effect:n}=VC(e);return{id:Cc(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(zt(22))}}},{withTypes:()=>jC}),RC=(e,t)=>{let{type:r,effect:n,predicate:o}=VC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},Ph=e=>{e.pending.forEach(t=>{t.abort(Th)})},Z_=(e,t)=>()=>{for(let r of t.keys())Ph(r);e.clear()},IC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},LC=Za(P(`${yl}/add`),{withTypes:()=>LC}),J_=P(`${yl}/removeAll`),UC=Za(P(`${yl}/remove`),{withTypes:()=>UC}),e0=(...e)=>{console.error(`${yl}/error`,...e)},QC=(e={})=>{let t=new Map,r=new Map,n=h=>{let S=r.get(h)??0;r.set(h,S+1)},o=h=>{let S=r.get(h)??1;S===1?r.delete(h):r.set(h,S-1)},{extra:a,onError:i=e0}=e;Oh(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),S=>{h.unsubscribe(),S?.cancelActive&&Ph(h)}),f=h=>{let S=RC(t,h)??jC(h);return p(S)};Za(f,{withTypes:()=>f});let m=h=>{let S=RC(t,h);return S&&(S.unsubscribe(),h.cancelActive&&Ph(S)),!!S};Za(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,S,b,w){let I=new s.AbortController,E=X_(f,I.signal),F=[];try{h.pending.add(I),n(h),yield Promise.resolve(h.effect(S,Za({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:MC(I.signal),pause:pl(I.signal),extra:a,signal:I.signal,fork:K_(I.signal,F),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,q)=>{k!==I&&(k.abort(Th),q.delete(k))})},cancel:()=>{I.abort(Th),h.pending.delete(I)},throwIfCancelled:()=>{Lo(I.signal)}})))}catch(k){k instanceof hl||IC(i,k,{raisedBy:"effect"})}finally{yield Promise.all(F),I.abort(W_),o(h),h.pending.delete(I)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),C=Z_(t,r);return{middleware:h=>S=>b=>{if(!nc(b))return S(b);if(LC.match(b))return f(b.payload);if(J_.match(b)){C();return}if(UC.match(b))return m(b.payload);let w=h.getState(),I=()=>{if(w===wC)throw new Error(zt(23));return w},E;try{if(E=S(b),t.size>0){let F=h.getState(),k=Array.from(t.values());for(let T of k){let q=!1;try{q=T.predicate(b,F,w)}catch(G){q=!1,IC(i,G,{raisedBy:"predicate"})}q&&g(T,b,h,I)}}}finally{w=wC}return E},startListening:f,stopListening:m,clearListeners:C}};function zt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();function BC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var GC=/^(?:[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 t0(e){return typeof e=="string"&&GC.test(e)}var _h=t0;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function $C(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var Nh,r0=new Uint8Array(16);function Dh(){if(!Nh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Nh=crypto.getRandomValues.bind(crypto)}return Nh(r0)}d();c();l();u();d();c();l();u();var n0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qh={randomUUID:n0};function o0(e,t,r){e=e||{};let n=e.random??e.rng?.()??Dh();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return $C(n)}function a0(e,t,r){return qh.randomUUID&&!t&&!e?qh.randomUUID():o0(e,t,r)}var Mh=a0;function i0(_x13){return _i2.apply(this,arguments)}function _i2(){_i2=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _i2.apply(this,arguments)}var XC="2.1.1",Vh=128,ZC=192,HC=224,zC=240,s0=248;function c0(e){return(e&s0)===zC?4:(e&zC)===HC?3:(e&HC)===ZC?2:1}function u0(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&Vh)!=Vh)break;if(r-=3,(n&ZC)!=Vh){t-r>=c0(n)*3&&(r=t);break}}return e.substring(0,r)}function l0(e){let{trackingId:t}=e;return{trackingId:t}}function d0(e){return(e.source||[]).concat([`relay@${XC}`])}function JC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=l0(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:d0(t),clientId:p,userAgent:a(),referrer:WC(n()),location:WC(o())})}function WC(e){return e!==null?u0(e,1024):null}function p0(e,t,r,n){return{...t,meta:JC(e,r,n)}}var f0="*";function m0(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===f0)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function YC({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function g0(e){let t=YC(e);return{get:()=>t,update:r=>{t=YC({...t,...r})}}}var jh=h0();function h0(){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()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function y0(){return{getItem(e){return jh.getItem(e)||localStorage.getItem(e)},removeItem(e){jh.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),jh.setItem(e,t,31556952e3)}}}var KC="visitorId";function S0(){let e=document.referrer;return e===""?null:e}function Lh(){let e=y0();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});BC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>S0(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(KC);if(t&&_h(t))return t;let r=Mh();return e.setItem(KC,r),r}}}function v0(){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 A0(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function C0(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=A0();return t&&r?{...r,runtime:"custom"}:t&&b0()&&v0()?Lh():n}function b0(){try{return typeof window=="object"}catch{return!1}}function x0(e){return{get:()=>Object.freeze(C0(e))}}function eb(e){let t=g0(e),r=m0(),n=x0(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=p0(o,a,i,p);return i0({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>JC(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:XC}}d();c();l();u();function tb(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Hn="3.51.1",rb=["@coveo/atomic","@coveo/quantic"];var ti=st(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Hn}`));var bc=st(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ti(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=R0(p);return eb({mode:a?"emit":"disabled",url:o??Vu(e,t),token:r,trackingId:n??null,source:i,environment:f})}),w0={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},R0=e=>{if(!e)return;let t=e();return{...(tb()?Lh():w0),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Qr(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 U(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 p(g){try{m(n.next(g))}catch(C){i(C)}}function f(g){try{m(n.throw(g))}catch(C){i(C)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var De;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(De||(De={}));function Bh(){return typeof window<"u"}function ny(){return typeof navigator<"u"}function ri(){return typeof document<"u"}function Gh(){try{return typeof localStorage<"u"}catch{return!1}}function I0(){try{return typeof sessionStorage<"u"}catch{return!1}}function gb(){return ny()&&navigator.cookieEnabled}var E0=[De.click,De.custom,De.search,De.view],F0=(e,t)=>E0.indexOf(e)!==-1?Object.assign({language:ri()?document.documentElement.lang:"unknown",userAgent:ny()?navigator.userAgent:"unknown"},t):t,wc=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?nb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],nb(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 nb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function T0(){return Gh()?localStorage:gb()?new Rc:I0()?sessionStorage:new oi}var Rc=class e{getItem(t){return wc.get(`${e.prefix}${t}`)}removeItem(t){wc.erase(`${e.prefix}${t}`)}setItem(t,r,n){wc.set(`${e.prefix}${t}`,r,n)}};Rc.prefix="coveo_";var $h=class{constructor(){this.cookieStorage=new Rc}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)}},oi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Sl="__coveo.analytics.history",P0=20,k0=1e3*60,O0=75,Cl=class{constructor(t){this.store=t||T0()}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 U(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 U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Sl);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Sl);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Sl,JSON.stringify(t.slice(0,P0)))}catch{}}clear(){try{this.store.removeItem(Sl)}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,O0)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>k0:!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))}};var _0=(e,t)=>U(void 0,void 0,void 0,function*(){return e===De.view?(yield N0(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),N0=e=>U(void 0,void 0,void 0,function*(){let t=new Cl,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),vl,D0=new Uint8Array(16);function q0(){if(!vl&&(vl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vl(D0)}var M0=/^(?:[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 bl(e){return typeof e=="string"&&M0.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function hb(e,t=0){return Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]}function V0(e){if(!bl(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 j0(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var L0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",U0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Q0(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=j0(o)),typeof a=="string"&&(a=V0(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return hb(m)}try{n.name=e}catch{}return n.DNS=L0,n.URL=U0,n}var B0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ob={randomUUID:B0};function Bo(e,t,r){if(ob.randomUUID&&!t&&!e)return ob.randomUUID();e=e||{};let n=e.random||(e.rng||q0)();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 hb(n)}function G0(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 Uh(e,t){return e<<t|e>>>32-t}function $0(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 p=0;p<i.length;++p)e.push(i.charCodeAt(p))}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 p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}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 p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=Uh(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],C=r[3],x=r[4];for(let h=0;h<80;++h){let S=Math.floor(h/20),b=Uh(f,5)+G0(S,m,g,C)+x+t[S]+p[h]>>>0;x=C,C=g,g=Uh(m,30)>>>0,m=f,f=b}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+x>>>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 H0=Q0("v5",80,$0),ab=H0,yb="2.30.55",ib=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,xc={pageview:"pageview",event:"event"},xl=class{constructor({client:t,uuidGenerator:r=Bo}){this.client=t,this.uuidGenerator=r}},Hh=class extends xl{constructor({client:t,uuidGenerator:r=Bo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ib(window.location),this.lastReferrer=ri()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:ri()?document.title:"",encoding:ri()?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===xc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===xc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===xc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===xc.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 ib(window.location)}},zn=class e{constructor(t,r){if(!bl(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 bl(a)?new e(a,Number.parseInt(o)*1e3):null}};zn.cvo_cid="cvo_cid";zn.expirationTime=120;var zh=class extends xl{constructor({client:t,uuidGenerator:r=Bo}){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 U(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(zn.cvo_cid,new zn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};zh.Id="link";var yr=Object.keys;function Al(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Qh=128,Sb=192,sb=224,cb=240;function z0(e){return(e&248)===cb?4:(e&cb)===sb?3:(e&sb)===Sb?2:1}function W0(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&Qh)!=Qh)break;if(r-=3,(n&Sb)!=Qh){t-r>=z0(n)*3&&(r=t);break}}return e.substring(0,r)}var Wh={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"},Y0=yr(Wh).map(e=>Wh[e]),K0=[...Y0].join("|"),X0=new RegExp(`^(${K0}$)`),Z0={svcAction:"svc_action",svcActionData:"svc_action_data"},J0=e=>yr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Wh[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),eN=e=>X0.test(e),tN=[eN],ub={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},lb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},wl={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},rN=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Yh={id:"quoteId",affiliation:"quoteAffiliation"},Kh={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},nN={add:Mt,bookmark_add:Mt,bookmark_remove:Mt,click:Mt,checkout:Mt,checkout_option:Mt,detail:Mt,impression:Mt,remove:Mt,refund:Object.assign(Object.assign({},Mt),wl),purchase:Object.assign(Object.assign({},Mt),wl),quickview:Mt,quote:Object.assign(Object.assign({},Mt),Yh),review:Object.assign(Object.assign({},Mt),Kh)},oN=yr(ub).map(e=>ub[e]),aN=yr(lb).map(e=>lb[e]),iN=yr(Mt).map(e=>Mt[e]),sN=yr(wl).map(e=>wl[e]),cN=yr(Kh).map(e=>Kh[e]),uN=yr(Yh).map(e=>Yh[e]),lN=[...oN,"custom"].join("|"),dN=[...aN,"custom"].join("|"),vb="(pr[0-9]+)",Ab="(il[0-9]+pi[0-9]+)",pN=new RegExp(`^${vb}(${lN})$`),fN=new RegExp(`^(${Ab}(${dN}))|(il[0-9]+nm)$`),mN=new RegExp(`^(${iN.join("|")})$`),gN=new RegExp(`^(${sN.join("|")})$`),hN=new RegExp(`^${vb}custom$`),yN=new RegExp(`^${Ab}custom$`),SN=new RegExp(`^(${[...rN,...cN,...uN].join("|")})$`),vN=e=>pN.test(e),AN=e=>fN.test(e),CN=e=>mN.test(e),bN=e=>gN.test(e),xN=e=>SN.test(e),wN=[AN,vN,CN,bN,xN],RN=[hN,yN],IN={anonymizeIp:"aip"},EN={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},FN={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},TN=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],PN=Object.assign(Object.assign(Object.assign(Object.assign({},IN),EN),FN),TN.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Xh=Object.assign(Object.assign({},PN),Z0),kN=e=>{let t=!!e.action&&nN[e.action]||{};return yr(e).reduce((r,n)=>{let o=t[n]||Xh[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},ON=yr(Xh).map(e=>Xh[e]),_N=e=>ON.indexOf(e)!==-1,NN=e=>e==="custom",DN=e=>[...wN,...tN,_N,NN].some(t=>t(e)),qN=e=>yr(e).reduce((t,r)=>{let n=MN(r);return n?Object.assign(Object.assign({},t),VN(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),MN=e=>{let t;return[...RN].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},VN=(e,t)=>yr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Zh=class{constructor(t){this.opts=t}sendEvent(t,r){return U(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:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(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:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}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 U(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[De.click,De.custom,De.search,De.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}},Jh=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},db=y.fetch,Rl=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=Qr(f,["url"]),C;try{C=yield db(m,g)}catch(x){console.error("An error has occured when sending the event.",x);return}if(C.ok){let x=yield C.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{C.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,C,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield db(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[De.click,De.custom,De.search,De.view].indexOf(t)!==-1}getVisitorIdParam(){return U(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"})}},ey=class{constructor(t,r){Gh()&&gb()?this.storage=new $h:Gh()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new oi),this.client=new Rl(t),this.beaconClient=new Zh(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}},ty=class{constructor(t,r){this.storage=r||new oi,this.client=new Rl(t)}getClientDependingOnEventType(t){return this.client}},Il=class{constructor(){this.storage=new oi,this.client=new Jh}getClientDependingOnEventType(t){return this.client}},jN="xx",LN=e=>e?.startsWith(jN)||!1,UN=`
28
+ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":_O(g,n,t);break}}}}function _O(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function NO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function PA(){return{data:"",event:"",id:"",retry:void 0}}var oh="text/event-stream",DO=1e3,NA="last-event-id";function DA(){return typeof window<"u"}function Bu(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,C)=>{let x={...r};x.accept||(x.accept=oh);let h;function S(){h?.abort(),document.hidden||k()}!p&&DA()&&document.addEventListener("visibilitychange",S);let b=DO,w;function I(){DA()&&document.removeEventListener("visibilitychange",S),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{I(),g()});let E=f??v,F=n??qO;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let T=yield E(e,{...m,headers:x,signal:h?.signal});yield F(T),yield kA(T.body,OA(_A(q=>{q?x[NA]=q:delete x[NA]},q=>{b=q},o))),a?.(),I(),g()}catch(T){if(!h?.signal?.aborted)try{let q=i?.(T)??b;clearTimeout(w),w=setTimeout(k,q)}catch(q){I(),C(q)}}});return _k2.apply(this,arguments)}k()})}function qO(e){let t=e.headers.get("content-type");if(!t?.startsWith(oh))throw new Error(`Expected content-type to be ${oh}, Actual: ${t}`)}d();c();l();u();var Gn=class{constructor(t){le(this,"_basePath");le(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 MO=(e,t,r)=>new Gn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,qA=3,VO=5e3,jO="text/event-stream",sh=1,ah=class extends Error{},Js=class extends Error{constructor(r){super(r.message);le(this,"payload",r)}},ih=class{constructor(){le(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)}},Gu=class{constructor(t){le(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,C=new ih;if(!a){this.logger.error("No stream ID found");return}let x=0,h,S=()=>{h&&!C.isActive(h)&&(w?.abort(),g(),I())},b=()=>{C.remove(h),h=oA(S,h,VO),C.add(h)},w=new s.AbortController,I=()=>Bu(MO(n,o,a),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===jO)return;throw E.status>=400&&E.status<500&&E.status!==429?new Js({message:"Error opening stream",code:E.status}):new ah})()},onmessage:E=>{if(w?.signal.aborted)return;let F=JSON.parse(E.data);if(F.finishReason==="ERROR"){C.remove(h),w?.abort(),f({message:F.errorMessage,code:F.statusCode});return}p(F),x=0,F.finishReason==="COMPLETED"?(C.remove(h),m()):b()},onerror:E=>{if(!w?.signal.aborted){if(C.remove(h),E instanceof Js)throw w?.abort(),f(E),E;if(++x>qA){this.logger.info("Maximum retry exceeded.");let F={message:"Failed to complete stream.",code:sh};throw w?.abort(),f(F),new Js(F)}this.logger.info(`Retrying...(${x}/${qA})`),g()}}});return I(),w}};d();c();l();u();var $u=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function ec(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var ch=e=>{let{response:t}=e;return t.body?LO(e):UO(t)},LO=e=>BO(e)?GO(e):QO(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},UO=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function QO(e){return e.body.statusCode!==void 0}function BO(e){return e.body.exception!==void 0}var GO=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function MA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var uh=(e,t,r,n)=>{let o=new Gn(`${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 VA=(e,t)=>{let r=new Gn(`${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},lh=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jr.call({...uh(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ec(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=MA(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return $O(i)?{success:i}:{error:ch({response:r,body:i})}});return function lh(_x5,_x6){return _ref3.apply(this,arguments)}}();function $O(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function Wa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function At(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Wa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Wa(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function HO(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function zO(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Ya(e,t){if(t&&e.name==="AbortError")return{error:zO(e)};if(e instanceof No)return{error:HO(e)};throw e}var $n=e=>e.success!==void 0,He=e=>e.error!==void 0;function jA(e){return e.results!==void 0}function LA(e){let t=Wa();return ee(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var dh=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,WO=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,tc=(e,t,r,n)=>{YO(e);let o=dh(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},UA=(e,t,r)=>{KO(e);let n=WO(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},ph=e=>{let{insightId:t,...r}=ec(e);return r},QA=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},YO=e=>{if(QA(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},KO=e=>{if(QA(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var BA=e=>({...tc(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var GA=e=>({...tc(e,"POST","application/json","/search"),requestParams:ph(e)}),$A=e=>({...tc(e,"POST","application/json","/querysuggest"),requestParams:ph(e)});d();c();l();u();var HA=e=>({...UA(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Hu=class{constructor(t){le(this,"options",t)}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield jr.call({...BA(t),..._this.options});if(r instanceof Error)return Ya(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield jr.call({...GA(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return Ya(n);let o=yield n.json();return jA(o)&&(o=LA(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jr.call({...$A(t),..._this3.options});if(r instanceof Error)return Ya(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield jr.call({...HA(t),..._this4.options});if(r instanceof Error)return Ya(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return lh(t,{..._this5.options})})()}};d();c();l();u();d();c();l();u();var z=new $({required:!0,emptyAllowed:!1}),We=new $({required:!1,emptyAllowed:!1}),Ke=new $({required:!0,emptyAllowed:!0}),jz=new $({required:!1,emptyAllowed:!0}),zu=new ne({each:z,required:!0}),zA=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),WA=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Lz=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Tr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),mr=(e,t)=>{if("required"in t)return{payload:new Pe({value:t}).validate({value:e}).value};let o=new Y({options:{required:!0},values:t}).validate(e);if(o)throw new Oo(o);return{payload:e}},_=(e,t)=>{try{return mr(e,t)}catch(r){return{payload:e,error:Tr(r)}}},gr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return YA(e,t,r,o,"Controller initialization error")},ht=(e,t,r,n)=>{let o=`Check the options of ${n}`;return YA(e,t,r,o,"Controller initialization error")},YA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(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 XO=typeof Symbol=="function"&&Symbol.observable||"@@observable",KA=XO,fh=()=>Math.random().toString(36).substring(7).split("").join("."),ZO={INIT:`@@redux/INIT${fh()}`,REPLACE:`@@redux/REPLACE${fh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fh()}`},Wu=ZO;function Lr(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 mh(e,t,r){if(typeof e!="function")throw new Error(Et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Et(1));return r(mh)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,I)=>{i.set(I,w)}))}function g(){if(f)throw new Error(Et(3));return o}function C(w){if(typeof w!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let I=!0;m();let E=p++;return i.set(E,w),function(){if(I){if(f)throw new Error(Et(6));I=!1,m(),i.delete(E),a=null}}}function x(w){if(!Lr(w))throw new Error(Et(7));if(typeof w.type>"u")throw new Error(Et(8));if(typeof w.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(E=>{E()}),w}function h(w){if(typeof w!="function")throw new Error(Et(10));n=w,x({type:Wu.REPLACE})}function S(){let w=C;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(Et(11));function E(){let k=I;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[KA](){return this}}}return x({type:Wu.INIT}),{dispatch:x,subscribe:C,getState:g,replaceReducer:h,[KA]:S}}function JO(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Wu.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:Wu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Ka(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{JO(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let C=0;C<n.length;C++){let x=n[C],h=r[x],S=p[x],b=h(S,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Et(14))}g[x]=b,m=m||b!==S}return m=m||n.length!==Object.keys(p).length,m?g:p}}function rc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function XA(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Et(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=rc(...p)(o.dispatch),{...o,dispatch:a}}}function nc(e){return Lr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var xh=Symbol.for("immer-nothing"),oc=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state");function Ft(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,qo=sr.getPrototypeOf,ic="constructor",dc="prototype",yh="configurable",Zu="enumerable",Ku="writable",sc="value",$t=e=>!!e&&!!e[Ct];function Ht(e){return e?aC(e)||fc(e)||!!e[oc]||!!e[ic]?.[oc]||mc(e)||gc(e):!1}var e_=sr[dc][ic].toString(),ZA=new WeakMap;function aC(e){if(!e||!Xa(e))return!1;let t=qo(e);if(t===null||t===sr[dc])return!0;let r=sr.hasOwnProperty.call(t,ic)&&t[ic];if(r===Object)return!0;if(!Do(r))return!1;let n=ZA.get(r);return n===void 0&&(n=Function.toString.call(r),ZA.set(r,n)),n===e_}function iC(e){return $t(e)||Ft(15,e),e[Ct].base_}function pc(e,t,r=!0){Mo(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Mo(e){let t=e[Ct];return t?t.type_:fc(e)?1:mc(e)?2:gc(e)?3:0}var ac=(e,t,r=Mo(e))=>r===2?e.has(t):sr[dc].hasOwnProperty.call(e,t),Rn=(e,t,r=Mo(e))=>r===2?e.get(t):e[t],Ju=(e,t,r,n=Mo(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function t_(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var fc=Array.isArray,mc=e=>e instanceof Map,gc=e=>e instanceof Set,Xa=e=>typeof e=="object",Do=e=>typeof e=="function",gh=e=>typeof e=="boolean";function r_(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var n_=e=>Xa(e)?e?.[Ct]:null,In=e=>e.copy_||e.base_;var wh=e=>e.modified_?e.copy_:e.base_;function Sh(e,t){if(mc(e))return new Map(e);if(gc(e))return new Set(e);if(fc(e))return Array[dc].slice.call(e);let r=aC(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[Ct];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Ku]===!1&&(p[Ku]=!0,p[yh]=!0),(p.get||p.set)&&(n[i]={[yh]:!0,[Ku]:!0,[Zu]:p[Zu],[sc]:e[i]})}return sr.create(qo(e),n)}else{let n=qo(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function Rh(e,t=!1){return al(e)||$t(e)||!Ht(e)||(Mo(e)>1&&sr.defineProperties(e,{set:Yu,add:Yu,clear:Yu,delete:Yu}),sr.freeze(e),t&&pc(e,(r,n)=>{Rh(n,!0)},!1)),e}function o_(){Ft(2)}var Yu={[sc]:o_};function al(e){return e===null||!Xa(e)?!0:sr.isFrozen(e)}var el="MapSet",tl="Patches",JA="ArrayMethods",rl={};function Vo(e){let t=rl[e];return t||Ft(0,e),t}var eC=e=>!!rl[e];function a_(e,t){rl[e]||(rl[e]=t)}var cc,sC=()=>cc,i_=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:eC(el)?Vo(el):void 0,arrayMethodsPlugin_:eC(JA)?Vo(JA):void 0});function tC(e,t){t&&(e.patchPlugin_=Vo(tl),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function vh(e){Ah(e),e.drafts_.forEach(s_),e.drafts_=null}function Ah(e){e===cc&&(cc=e.parent_)}var rC=e=>cc=i_(cc,e);function s_(e){let t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function nC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ct].modified_&&(vh(t),Ft(4)),Ht(e)&&(e=oC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Ct].base_,e,t)}else e=oC(t,r);return c_(t,e,!0),vh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==xh?e:void 0}function oC(e,t){if(al(t))return t;let r=t[Ct];if(!r)return nl(t,e.handledSet_,e);if(!il(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);lC(r,e)}return r.copy_}function c_(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Rh(t,r)}function cC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var il=(e,t)=>e.scope_===t,u_=[];function uC(e,t,r,n){let o=In(e),a=e.type_;if(n!==void 0&&Rn(o,n,a)===t){Ju(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;pc(o,(f,m)=>{if($t(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??u_;for(let p of i)Ju(o,p,r,a)}function l_(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!il(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=wh(a);uC(e,a.draft_??a,i,r),lC(a,o)})}function lC(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}cC(e)}}function d_(e,t,r){let{scope_:n}=e;if($t(r)){let o=r[Ct];il(o,n)&&o.callbacks_.push(function(){Xu(e);let i=wh(o);uC(e,r,i,t)})}else Ht(r)&&e.callbacks_.push(function(){let a=In(e);e.type_===3?a.has(r)&&nl(r,n.handledSet_,n):Rn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&nl(Rn(e.copy_,t,e.type_),n.handledSet_,n)})}function nl(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||$t(e)||t.has(e)||!Ht(e)||al(e)||(t.add(e),pc(e,(n,o)=>{if($t(o)){let a=o[Ct];if(il(a,r)){let i=wh(a);Ju(e,n,i,e.type_),cC(a)}}else Ht(o)&&nl(o,t,r)})),e}function p_(e,t){let r=fc(e),n={type_:r?1:0,scope_:t?t.scope_:sC(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=ol;r&&(o=[n],a=uc);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var ol={get(e,t){if(t===Ct)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=In(e);if(!ac(o,t,e.type_))return f_(e,o,t);let a=o[t];if(e.finalized_||!Ht(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&r_(t))return a;if(a===hh(e.base_,t)){Xu(e);let i=e.type_===1?+t:t,p=bh(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,r){let n=dC(In(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=hh(In(e),t),a=o?.[Ct];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(t_(r,o)&&(r!==void 0||ac(e.base_,t,e.type_)))return!0;Xu(e),Ch(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_.set(t,!0),d_(e,t,r)),!0},deleteProperty(e,t){return Xu(e),hh(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ch(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=In(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ku]:!0,[yh]:e.type_!==1||t!=="length",[Zu]:n[Zu],[sc]:r[t]}},defineProperty(){Ft(11)},getPrototypeOf(e){return qo(e.base_)},setPrototypeOf(){Ft(12)}},uc={};for(let e in ol){let t=ol[e];uc[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}uc.deleteProperty=function(e,t){return uc.set.call(this,e,t,void 0)};uc.set=function(e,t,r){return ol.set.call(this,e[0],t,r,e[0])};function hh(e,t){let r=e[Ct];return(r?In(r):e)[t]}function f_(e,t,r){let n=dC(t,r);return n?sc in n?n[sc]:n.get?.call(e.draft_):void 0}function dC(e,t){if(!(t in e))return;let r=qo(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=qo(r)}}function Ch(e){e.modified_||(e.modified_=!0,e.parent_&&Ch(e.parent_))}function Xu(e){e.copy_||(e.assigned_=new Map,e.copy_=Sh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var m_=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Do(t)&&!Do(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}Do(r)||Ft(6),n!==void 0&&!Do(n)&&Ft(7);let o;if(Ht(t)){let a=rC(this),i=bh(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?vh(a):Ah(a)}return tC(a,n),nC(o,a)}else if(!t||!Xa(t)){if(o=r(t),o===void 0&&(o=t),o===xh&&(o=void 0),this.autoFreeze_&&Rh(o,!0),n){let a=[],i=[];Vo(tl).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else Ft(1,t)},this.produceWithPatches=(t,r)=>{if(Do(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},gh(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),gh(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),gh(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ht(e)||Ft(8),$t(e)&&(e=sl(e));let t=rC(this),r=bh(t,e,void 0);return r[Ct].isManual_=!0,Ah(t),r}finishDraft(e,t){let r=e&&e[Ct];(!r||!r.isManual_)&&Ft(9);let{scope_:n}=r;return tC(n,t),nC(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Vo(tl).applyPatches_;return $t(e)?n(e,t):this.produce(e,o=>n(o,t))}};function bh(e,t,r,n){let[o,a]=mc(t)?Vo(el).proxyMap_(t,r):gc(t)?Vo(el).proxySet_(t,r):p_(t,r);return(r?.scope_??sC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?l_(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function sl(e){return $t(e)||Ft(10,e),pC(e)}function pC(e){if(!Ht(e)||al(e))return e;let t=e[Ct],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Sh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Sh(e,!0);return pc(r,(o,a)=>{Ju(r,o,pC(a))},n),t&&(t.finalized_=!1),r}function fC(){function t(S,b=[]){if(S.key_!==void 0){let w=S.parent_.copy_??S.parent_.base_,I=n_(Rn(w,S.key_)),E=Rn(w,S.key_);if(E===void 0||E!==S.draft_&&E!==S.base_&&E!==S.copy_||I!=null&&I.base_!==S.base_)return null;let F=S.parent_.type_===3,k;if(F){let T=S.parent_;k=Array.from(T.drafts_.keys()).indexOf(S.key_)}else k=S.key_;if(!(F&&w.size>k||ac(w,k)))return null;b.push(k)}if(S.parent_)return t(S.parent_,b);b.reverse();try{r(S.copy_,b)}catch{return null}return b}function r(S,b){let w=S;for(let I=0;I<b.length-1;I++){let E=b[I];if(w=Rn(w,E),!Xa(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(S,b,w){if(S.scope_.processedForPatches_.has(S))return;S.scope_.processedForPatches_.add(S);let{patches_:I,inversePatches_:E}=w;switch(S.type_){case 0:case 2:return f(S,b,I,E);case 1:return p(S,b,I,E);case 3:return m(S,b,I,E)}}function p(S,b,w,I){let{base_:E,assigned_:F}=S,k=S.copy_;k.length<E.length&&([E,k]=[k,E],[w,I]=[I,w]);let T=S.allIndicesReassigned_===!0;for(let q=0;q<E.length;q++){let G=k[q],Q=E[q];if((T||F?.get(q.toString()))&&G!==Q){let B=G?.[Ct];if(B&&B.modified_)continue;let L=b.concat([q]);w.push({op:n,path:L,value:h(G)}),I.push({op:n,path:L,value:h(Q)})}}for(let q=E.length;q<k.length;q++){let G=b.concat([q]);w.push({op:o,path:G,value:h(k[q])})}for(let q=k.length-1;E.length<=q;--q){let G=b.concat([q]);I.push({op:a,path:G})}}function f(S,b,w,I){let{base_:E,copy_:F,type_:k}=S;pc(S.assigned_,(T,q)=>{let G=Rn(E,T,k),Q=Rn(F,T,k),j=q?ac(E,T)?n:o:a;if(G===Q&&j===n)return;let B=b.concat(T);w.push(j===a?{op:j,path:B}:{op:j,path:B,value:h(Q)}),I.push(j===o?{op:a,path:B}:j===a?{op:o,path:B,value:h(G)}:{op:n,path:B,value:h(G)})})}function m(S,b,w,I){let{base_:E,copy_:F}=S,k=0;E.forEach(T=>{if(!F.has(T)){let q=b.concat([k]);w.push({op:a,path:q,value:T}),I.unshift({op:o,path:q,value:T})}k++}),k=0,F.forEach(T=>{if(!E.has(T)){let q=b.concat([k]);w.push({op:o,path:q,value:T}),I.unshift({op:a,path:q,value:T})}k++})}function g(S,b,w){let{patches_:I,inversePatches_:E}=w;I.push({op:n,path:[],value:b===xh?void 0:b}),E.push({op:n,path:[],value:S})}function C(S,b){return b.forEach(w=>{let{path:I,op:E}=w,F=S;for(let G=0;G<I.length-1;G++){let Q=Mo(F),j=I[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(Q===0||Q===1)&&(j==="__proto__"||j===ic)&&Ft(19),Do(F)&&j===dc&&Ft(19),F=Rn(F,j),Xa(F)||Ft(18,I.join("/"))}let k=Mo(F),T=x(w.value),q=I[I.length-1];switch(E){case n:switch(k){case 2:return F.set(q,T);case 3:Ft(16);default:return F[q]=T}case o:switch(k){case 1:return q==="-"?F.push(T):F.splice(q,0,T);case 2:return F.set(q,T);case 3:return F.add(T);default:return F[q]=T}case a:switch(k){case 1:return F.splice(q,1);case 2:return F.delete(q);case 3:return F.delete(w.value);default:return delete F[q]}default:Ft(17,E)}}),S}function x(S){if(!Ht(S))return S;if(fc(S))return S.map(x);if(mc(S))return new Map(Array.from(S.entries()).map(([w,I])=>[w,x(I)]));if(gc(S))return new Set(Array.from(S).map(x));let b=Object.create(qo(S));for(let w in S)b[w]=x(S[w]);return ac(S,oc)&&(b[oc]=S[oc]),b}function h(S){return $t(S)?x(S):S}a_(tl,{applyPatches_:C,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var lc=new m_,jo=lc.produce,Ih=lc.produceWithPatches.bind(lc);var Eh=lc.applyPatches.bind(lc);d();c();l();u();function g_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function h_(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 mC=e=>Array.isArray(e)?e:[e];function y_(e){let t=Array.isArray(e[0])?e[0]:e;return h_(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function S_(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var v_=class{constructor(e){this.value=e}deref(){return this.value}},A_=()=>typeof WeakRef>"u"?v_:WeakRef,hC=A_(),C_=0,gC=1;function cl(){return{s:C_,v:void 0,o:null,p:null}}function b_(e){return e instanceof hC?e.deref():e}function hc(e,t={}){let r=cl(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let C=0,x=f;C<x;C++){let h=arguments[C];if(typeof h=="function"||typeof h=="object"&&h!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let b=S.get(h);b===void 0?(p=cl(),S.set(h,p)):p=b}else{let S=p.p;S===null&&(p.p=S=new Map);let b=S.get(h);b===void 0?(p=cl(),S.set(h,p)):p=b}}let m=p,g;if(p.s===gC)g=p.v;else if(g=e.apply(null,arguments),a++,n){let C=b_(o);C!=null&&n(C,g)&&(g=C,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new hC(g):g}return m.s=gC,m.v=g,g}return i.clearCache=()=>{r=cl(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function x_(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),g_(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:C,memoizeOptions:x=[],argsMemoize:h=hc,argsMemoizeOptions:S=[]}=g,b=mC(x),w=mC(S),I=y_(o),E=C(function(){return a++,m.apply(null,arguments)},...b),F=!0,k=h(function(){i++;let q=S_(I,arguments);return p=E.apply(null,q),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:E,dependencies:I,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:C,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var st=x_(hc);d();c();l();u();function yC(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var SC=yC(),vC=yC;var w_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rc:rc.apply(null,arguments)},AW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},R_=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(zt(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=>nc(n)&&n.type===e,r}var EC=class yc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,yc.prototype)}static get[Symbol.species](){return yc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new yc(...t[0].concat(this)):new yc(...t.concat(this))}};function AC(e){return Ht(e)?jo(e,()=>{}):e}function ul(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function I_(e){return typeof e=="boolean"}var E_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new EC;return r&&(I_(r)?i.push(SC):i.push(vC(r.extraArgument))),i},Sc="RTK_autoBatch",ei=()=>e=>({payload:e,meta:{[Sc]:!0}}),CC=e=>t=>{setTimeout(t,e)},F_=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},T_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?F_(window.requestAnimationFrame,100):CC(10):e.type==="callback"?e.queueNotification:CC(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let C=()=>o&&g(),x=n.subscribe(C);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Sc],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},P_=e=>function(r){let{autoBatch:n=!0}=r??{},o=new EC(e);return n&&o.push(T_(typeof n=="object"?n:void 0)),o};function FC(e){let t=E_(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Lr(r))f=Ka(r);else throw new Error(zt(1));let m;typeof n=="function"?m=n(t):m=t();let g=rc;o&&(g=w_({trace:!1,...(typeof o=="object"&&o)}));let C=XA(...m),x=P_(C),h=typeof p=="function"?p(x):x(),S=g(...h);return mh(f,i,S)}function TC(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(zt(28));if(p in t)throw new Error(zt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),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 k_(e){return typeof e=="function"}function pe(e,t){let[r,n,o]=TC(t),a;if(k_(e))a=()=>AC(e());else{let p=AC(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,C)=>{if(C)if($t(g)){let h=C(g,f);return h===void 0?g:h}else{if(Ht(g))return jo(g,x=>C(x,f));{let x=C(g,f);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return i.getInitialState=a,i}var PC=(e,t)=>R_(e)?e.match(t):e(t);function Ur(...e){return t=>e.some(r=>PC(r,t))}function Ja(...e){return t=>e.every(r=>PC(r,t))}function fl(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 vc(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ml(...e){return e.length===0?t=>fl(t,["pending"]):vc(e)?Ur(...e.map(t=>t.pending)):ml()(e[0])}function Uo(...e){return e.length===0?t=>fl(t,["rejected"]):vc(e)?Ur(...e.map(t=>t.rejected)):Uo()(e[0])}function Ac(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ja(Uo(...e),t):vc(e)?Ja(Uo(...e),t):Ac()(e[0])}function En(...e){return e.length===0?t=>fl(t,["fulfilled"]):vc(e)?Ur(...e.map(t=>t.fulfilled)):En()(e[0])}function gl(...e){return e.length===0?t=>fl(t,["pending","fulfilled","rejected"]):vc(e)?Ur(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):gl()(e[0])}var O_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Cc=(e=21)=>{let t="",r=e;for(;r--;)t+=O_[Math.random()*64|0];return t},__=["name","message","stack","code"],Fh=class{constructor(e,t){le(this,"payload");le(this,"meta");le(this,"_type");this.payload=e,this.meta=t}},bC=class{constructor(e,t){le(this,"payload");le(this,"meta");le(this,"_type");this.payload=e,this.meta=t}},N_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of __)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},xC="External signal was aborted",me=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,m,g,C)=>({payload:f,meta:{...(C||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=P(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=P(t+"/rejected",(f,m,g,C,x)=>({payload:C,error:(n&&n.serializeError||N_)(f||"Rejected"),meta:{...(x||{}),arg:g,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,C,x)=>{let h=n?.idGenerator?n.idGenerator(f):Cc(),S=new s.AbortController,b,w;function I(F){w=F,S.abort()}m&&(m.aborted?I(xC):m.addEventListener("abort",()=>I(xC),{once:!0}));let E=_asyncToGenerator(function*(){let F;try{let T=n?.condition?.(f,{getState:C,extra:x});if(q_(T)&&(T=yield T),T===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((G,Q)=>{b=()=>{Q({name:"AbortError",message:w||"Aborted"})},S.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:C,extra:x}))),F=yield Promise.race([q,Promise.resolve(r(f,{dispatch:g,getState:C,extra:x,requestId:h,signal:S.signal,abort:I,rejectWithValue:(G,Q)=>new Fh(G,Q),fulfillWithValue:(G,Q)=>new bC(G,Q)})).then(G=>{if(G instanceof Fh)throw G;return G instanceof bC?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(T){F=T instanceof Fh?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&S.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||g(F),F})();return Object.assign(E,{abort:I,requestId:h,arg:f,unwrap(){return E.then(D_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Ur(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function D_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function q_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var kC=Symbol.for("rtk-slice-createasyncthunk"),bW={[kC]:me};function M_(e,t){return`${e}/${t}`}function V_({creators:e}={}){let t=e?.asyncThunk?.[kC];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(zt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(L_()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,k){let T=typeof F=="string"?F:F.type;if(!T)throw new Error(zt(12));if(T in f.sliceCaseReducersByType)throw new Error(zt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(F,k){return f.sliceMatchers.push({matcher:F,reducer:k}),m},exposeAction(F,k){return f.actionCreators[F]=k,m},exposeCaseReducer(F,k){return f.sliceCaseReducersByName[F]=k,m}};p.forEach(F=>{let k=i[F],T={reducerName:F,type:M_(o,F),createNotation:typeof n.reducers=="function"};Q_(k)?G_(T,k,m,t):U_(T,k,m)});function g(){let[F={},k=[],T=void 0]=typeof n.extraReducers=="function"?TC(n.extraReducers):[n.extraReducers],q={...F,...f.sliceCaseReducersByType};return pe(n.initialState,G=>{for(let Q in q)G.addCase(Q,q[Q]);for(let Q of f.sliceMatchers)G.addMatcher(Q.matcher,Q.reducer);for(let Q of k)G.addMatcher(Q.matcher,Q.reducer);T&&G.addDefaultCase(T)})}let C=F=>F,x=new Map,h=new WeakMap,S;function b(F,k){return S||(S=g()),S(F,k)}function w(){return S||(S=g()),S.getInitialState()}function I(F,k=!1){function T(G){let Q=G[F];return typeof Q>"u"&&k&&(Q=ul(h,T,w)),Q}function q(G=C){let Q=ul(x,k,()=>new WeakMap);return ul(Q,G,()=>{let j={};for(let[B,L]of Object.entries(n.selectors??{}))j[B]=j_(L,G,()=>ul(h,G,w),k);return j})}return{reducerPath:F,getSelectors:q,get selectors(){return q(T)},selectSlice:T}}let E={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...I(a),injectInto(F,{reducerPath:k,...T}={}){let q=k??a;return F.inject({reducerPath:q,reducer:b},T),{...E,...I(q,!0)}}};return E}}function j_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var Qo=V_();function L_(){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 U_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!B_(n))throw new Error(zt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?P(e,i):P(e))}function Q_(e){return e._reducerDefinitionType==="asyncThunk"}function B_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function G_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(zt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,C=o(e,a,g);n.exposeAction(t,C),i&&n.addCase(C.fulfilled,i),p&&n.addCase(C.pending,p),f&&n.addCase(C.rejected,f),m&&n.addMatcher(C.settled,m),n.exposeCaseReducer(t,{fulfilled:i||ll,pending:p||ll,rejected:f||ll,settled:m||ll})}function ll(){}var $_="task",OC="listener",_C="completed",kh="cancelled",H_=`task-${kh}`,z_=`task-${_C}`,Th=`${OC}-${kh}`,W_=`${OC}-${_C}`,hl=class{constructor(e){le(this,"code");le(this,"name","TaskAbortError");le(this,"message");this.code=e,this.message=`${$_} ${kh} (reason: ${e})`}},Oh=(e,t)=>{if(typeof e!="function")throw new TypeError(zt(32))},dl=()=>{},NC=(e,t=dl)=>(e.catch(t),e),DC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Lo=e=>{if(e.aborted)throw new hl(e.reason)};function qC(e,t){let r=dl;return new Promise((n,o)=>{let a=()=>o(new hl(e.reason));if(e.aborted){a();return}r=DC(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=dl})}var Y_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof hl?"cancelled":"rejected",error:r}}finally{t?.()}});return function Y_(_x7,_x8){return _ref5.apply(this,arguments)}}(),pl=e=>t=>NC(qC(e,t).then(r=>(Lo(e),r))),MC=e=>{let t=pl(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Za}=Object,wC={},yl="listenerMiddleware",K_=(e,t)=>{let r=n=>DC(e,()=>n.abort(e.reason));return(n,o)=>{Oh(n,"taskExecutor");let a=new s.AbortController;r(a);let i=Y_(/*#__PURE__*/_asyncToGenerator(function*(){Lo(e),Lo(a.signal);let p=yield n({pause:pl(a.signal),delay:MC(a.signal),signal:a.signal});return Lo(a.signal),p}),()=>a.abort(z_));return o?.autoJoin&&t.push(i.catch(dl)),{result:pl(e)(i),cancel(){a.abort(H_)}}}},X_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Lo(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(C,x)=>{x.unsubscribe(),f([C,x.getState(),x.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield qC(t,Promise.race(p));return Lo(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>NC(r(n,o))},VC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(zt(21));return Oh(a,"options.listener"),{predicate:o,type:t,effect:a}},jC=Za(e=>{let{type:t,predicate:r,effect:n}=VC(e);return{id:Cc(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(zt(22))}}},{withTypes:()=>jC}),RC=(e,t)=>{let{type:r,effect:n,predicate:o}=VC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},Ph=e=>{e.pending.forEach(t=>{t.abort(Th)})},Z_=(e,t)=>()=>{for(let r of t.keys())Ph(r);e.clear()},IC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},LC=Za(P(`${yl}/add`),{withTypes:()=>LC}),J_=P(`${yl}/removeAll`),UC=Za(P(`${yl}/remove`),{withTypes:()=>UC}),e0=(...e)=>{console.error(`${yl}/error`,...e)},QC=(e={})=>{let t=new Map,r=new Map,n=h=>{let S=r.get(h)??0;r.set(h,S+1)},o=h=>{let S=r.get(h)??1;S===1?r.delete(h):r.set(h,S-1)},{extra:a,onError:i=e0}=e;Oh(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),S=>{h.unsubscribe(),S?.cancelActive&&Ph(h)}),f=h=>{let S=RC(t,h)??jC(h);return p(S)};Za(f,{withTypes:()=>f});let m=h=>{let S=RC(t,h);return S&&(S.unsubscribe(),h.cancelActive&&Ph(S)),!!S};Za(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,S,b,w){let I=new s.AbortController,E=X_(f,I.signal),F=[];try{h.pending.add(I),n(h),yield Promise.resolve(h.effect(S,Za({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:MC(I.signal),pause:pl(I.signal),extra:a,signal:I.signal,fork:K_(I.signal,F),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,q)=>{k!==I&&(k.abort(Th),q.delete(k))})},cancel:()=>{I.abort(Th),h.pending.delete(I)},throwIfCancelled:()=>{Lo(I.signal)}})))}catch(k){k instanceof hl||IC(i,k,{raisedBy:"effect"})}finally{yield Promise.all(F),I.abort(W_),o(h),h.pending.delete(I)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),C=Z_(t,r);return{middleware:h=>S=>b=>{if(!nc(b))return S(b);if(LC.match(b))return f(b.payload);if(J_.match(b)){C();return}if(UC.match(b))return m(b.payload);let w=h.getState(),I=()=>{if(w===wC)throw new Error(zt(23));return w},E;try{if(E=S(b),t.size>0){let F=h.getState(),k=Array.from(t.values());for(let T of k){let q=!1;try{q=T.predicate(b,F,w)}catch(G){q=!1,IC(i,G,{raisedBy:"predicate"})}q&&g(T,b,h,I)}}}finally{w=wC}return E},startListening:f,stopListening:m,clearListeners:C}};function zt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();function BC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var GC=/^(?:[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 t0(e){return typeof e=="string"&&GC.test(e)}var _h=t0;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function $C(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var Nh,r0=new Uint8Array(16);function Dh(){if(!Nh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Nh=crypto.getRandomValues.bind(crypto)}return Nh(r0)}d();c();l();u();d();c();l();u();var n0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qh={randomUUID:n0};function o0(e,t,r){e=e||{};let n=e.random??e.rng?.()??Dh();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return $C(n)}function a0(e,t,r){return qh.randomUUID&&!t&&!e?qh.randomUUID():o0(e,t,r)}var Mh=a0;function i0(_x13){return _i2.apply(this,arguments)}function _i2(){_i2=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _i2.apply(this,arguments)}var XC="2.1.1",Vh=128,ZC=192,HC=224,zC=240,s0=248;function c0(e){return(e&s0)===zC?4:(e&zC)===HC?3:(e&HC)===ZC?2:1}function u0(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&Vh)!=Vh)break;if(r-=3,(n&ZC)!=Vh){t-r>=c0(n)*3&&(r=t);break}}return e.substring(0,r)}function l0(e){let{trackingId:t}=e;return{trackingId:t}}function d0(e){return(e.source||[]).concat([`relay@${XC}`])}function JC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=l0(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:d0(t),clientId:p,userAgent:a(),referrer:WC(n()),location:WC(o())})}function WC(e){return e!==null?u0(e,1024):null}function p0(e,t,r,n){return{...t,meta:JC(e,r,n)}}var f0="*";function m0(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===f0)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function YC({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function g0(e){let t=YC(e);return{get:()=>t,update:r=>{t=YC({...t,...r})}}}var jh=h0();function h0(){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()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function y0(){return{getItem(e){return jh.getItem(e)||localStorage.getItem(e)},removeItem(e){jh.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),jh.setItem(e,t,31556952e3)}}}var KC="visitorId";function S0(){let e=document.referrer;return e===""?null:e}function Lh(){let e=y0();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});BC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>S0(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(KC);if(t&&_h(t))return t;let r=Mh();return e.setItem(KC,r),r}}}function v0(){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 A0(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function C0(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=A0();return t&&r?{...r,runtime:"custom"}:t&&b0()&&v0()?Lh():n}function b0(){try{return typeof window=="object"}catch{return!1}}function x0(e){return{get:()=>Object.freeze(C0(e))}}function eb(e){let t=g0(e),r=m0(),n=x0(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=p0(o,a,i,p);return i0({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>JC(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:XC}}d();c();l();u();function tb(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Hn="3.51.2",rb=["@coveo/atomic","@coveo/quantic"];var ti=st(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Hn}`));var bc=st(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ti(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=R0(p);return eb({mode:a?"emit":"disabled",url:o??Vu(e,t),token:r,trackingId:n??null,source:i,environment:f})}),w0={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},R0=e=>{if(!e)return;let t=e();return{...(tb()?Lh():w0),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Qr(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 U(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 p(g){try{m(n.next(g))}catch(C){i(C)}}function f(g){try{m(n.throw(g))}catch(C){i(C)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var De;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(De||(De={}));function Bh(){return typeof window<"u"}function ny(){return typeof navigator<"u"}function ri(){return typeof document<"u"}function Gh(){try{return typeof localStorage<"u"}catch{return!1}}function I0(){try{return typeof sessionStorage<"u"}catch{return!1}}function gb(){return ny()&&navigator.cookieEnabled}var E0=[De.click,De.custom,De.search,De.view],F0=(e,t)=>E0.indexOf(e)!==-1?Object.assign({language:ri()?document.documentElement.lang:"unknown",userAgent:ny()?navigator.userAgent:"unknown"},t):t,wc=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?nb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],nb(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 nb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function T0(){return Gh()?localStorage:gb()?new Rc:I0()?sessionStorage:new oi}var Rc=class e{getItem(t){return wc.get(`${e.prefix}${t}`)}removeItem(t){wc.erase(`${e.prefix}${t}`)}setItem(t,r,n){wc.set(`${e.prefix}${t}`,r,n)}};Rc.prefix="coveo_";var $h=class{constructor(){this.cookieStorage=new Rc}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)}},oi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Sl="__coveo.analytics.history",P0=20,k0=1e3*60,O0=75,Cl=class{constructor(t){this.store=t||T0()}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 U(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 U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Sl);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Sl);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Sl,JSON.stringify(t.slice(0,P0)))}catch{}}clear(){try{this.store.removeItem(Sl)}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,O0)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>k0:!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))}};var _0=(e,t)=>U(void 0,void 0,void 0,function*(){return e===De.view?(yield N0(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),N0=e=>U(void 0,void 0,void 0,function*(){let t=new Cl,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),vl,D0=new Uint8Array(16);function q0(){if(!vl&&(vl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vl(D0)}var M0=/^(?:[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 bl(e){return typeof e=="string"&&M0.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function hb(e,t=0){return Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]}function V0(e){if(!bl(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 j0(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var L0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",U0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Q0(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=j0(o)),typeof a=="string"&&(a=V0(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return hb(m)}try{n.name=e}catch{}return n.DNS=L0,n.URL=U0,n}var B0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ob={randomUUID:B0};function Bo(e,t,r){if(ob.randomUUID&&!t&&!e)return ob.randomUUID();e=e||{};let n=e.random||(e.rng||q0)();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 hb(n)}function G0(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 Uh(e,t){return e<<t|e>>>32-t}function $0(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 p=0;p<i.length;++p)e.push(i.charCodeAt(p))}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 p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}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 p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=Uh(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],C=r[3],x=r[4];for(let h=0;h<80;++h){let S=Math.floor(h/20),b=Uh(f,5)+G0(S,m,g,C)+x+t[S]+p[h]>>>0;x=C,C=g,g=Uh(m,30)>>>0,m=f,f=b}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+x>>>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 H0=Q0("v5",80,$0),ab=H0,yb="2.30.55",ib=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,xc={pageview:"pageview",event:"event"},xl=class{constructor({client:t,uuidGenerator:r=Bo}){this.client=t,this.uuidGenerator=r}},Hh=class extends xl{constructor({client:t,uuidGenerator:r=Bo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ib(window.location),this.lastReferrer=ri()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:ri()?document.title:"",encoding:ri()?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===xc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===xc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===xc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===xc.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 ib(window.location)}},zn=class e{constructor(t,r){if(!bl(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 bl(a)?new e(a,Number.parseInt(o)*1e3):null}};zn.cvo_cid="cvo_cid";zn.expirationTime=120;var zh=class extends xl{constructor({client:t,uuidGenerator:r=Bo}){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 U(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(zn.cvo_cid,new zn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};zh.Id="link";var yr=Object.keys;function Al(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Qh=128,Sb=192,sb=224,cb=240;function z0(e){return(e&248)===cb?4:(e&cb)===sb?3:(e&sb)===Sb?2:1}function W0(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&Qh)!=Qh)break;if(r-=3,(n&Sb)!=Qh){t-r>=z0(n)*3&&(r=t);break}}return e.substring(0,r)}var Wh={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"},Y0=yr(Wh).map(e=>Wh[e]),K0=[...Y0].join("|"),X0=new RegExp(`^(${K0}$)`),Z0={svcAction:"svc_action",svcActionData:"svc_action_data"},J0=e=>yr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Wh[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),eN=e=>X0.test(e),tN=[eN],ub={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},lb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},wl={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},rN=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Yh={id:"quoteId",affiliation:"quoteAffiliation"},Kh={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},nN={add:Mt,bookmark_add:Mt,bookmark_remove:Mt,click:Mt,checkout:Mt,checkout_option:Mt,detail:Mt,impression:Mt,remove:Mt,refund:Object.assign(Object.assign({},Mt),wl),purchase:Object.assign(Object.assign({},Mt),wl),quickview:Mt,quote:Object.assign(Object.assign({},Mt),Yh),review:Object.assign(Object.assign({},Mt),Kh)},oN=yr(ub).map(e=>ub[e]),aN=yr(lb).map(e=>lb[e]),iN=yr(Mt).map(e=>Mt[e]),sN=yr(wl).map(e=>wl[e]),cN=yr(Kh).map(e=>Kh[e]),uN=yr(Yh).map(e=>Yh[e]),lN=[...oN,"custom"].join("|"),dN=[...aN,"custom"].join("|"),vb="(pr[0-9]+)",Ab="(il[0-9]+pi[0-9]+)",pN=new RegExp(`^${vb}(${lN})$`),fN=new RegExp(`^(${Ab}(${dN}))|(il[0-9]+nm)$`),mN=new RegExp(`^(${iN.join("|")})$`),gN=new RegExp(`^(${sN.join("|")})$`),hN=new RegExp(`^${vb}custom$`),yN=new RegExp(`^${Ab}custom$`),SN=new RegExp(`^(${[...rN,...cN,...uN].join("|")})$`),vN=e=>pN.test(e),AN=e=>fN.test(e),CN=e=>mN.test(e),bN=e=>gN.test(e),xN=e=>SN.test(e),wN=[AN,vN,CN,bN,xN],RN=[hN,yN],IN={anonymizeIp:"aip"},EN={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},FN={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},TN=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],PN=Object.assign(Object.assign(Object.assign(Object.assign({},IN),EN),FN),TN.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Xh=Object.assign(Object.assign({},PN),Z0),kN=e=>{let t=!!e.action&&nN[e.action]||{};return yr(e).reduce((r,n)=>{let o=t[n]||Xh[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},ON=yr(Xh).map(e=>Xh[e]),_N=e=>ON.indexOf(e)!==-1,NN=e=>e==="custom",DN=e=>[...wN,...tN,_N,NN].some(t=>t(e)),qN=e=>yr(e).reduce((t,r)=>{let n=MN(r);return n?Object.assign(Object.assign({},t),VN(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),MN=e=>{let t;return[...RN].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},VN=(e,t)=>yr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Zh=class{constructor(t){this.opts=t}sendEvent(t,r){return U(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:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(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:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}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 U(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[De.click,De.custom,De.search,De.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}},Jh=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},db=y.fetch,Rl=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=Qr(f,["url"]),C;try{C=yield db(m,g)}catch(x){console.error("An error has occured when sending the event.",x);return}if(C.ok){let x=yield C.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{C.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,C,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield db(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[De.click,De.custom,De.search,De.view].indexOf(t)!==-1}getVisitorIdParam(){return U(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"})}},ey=class{constructor(t,r){Gh()&&gb()?this.storage=new $h:Gh()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new oi),this.client=new Rl(t),this.beaconClient=new Zh(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}},ty=class{constructor(t,r){this.storage=r||new oi,this.client=new Rl(t)}getClientDependingOnEventType(t){return this.client}},Il=class{constructor(){this.storage=new oi,this.client=new Jh}getClientDependingOnEventType(t){return this.client}},jN="xx",LN=e=>e?.startsWith(jN)||!1,UN=`
29
29
  We've detected you're using React Native but have not provided the corresponding runtime,
30
30
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
31
31
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
@@ -76,4 +76,4 @@ fast-json-patch/module/duplex.mjs:
76
76
  *)
77
77
  */if(__exports!=exports)module.exports=exports;return module.exports});
78
78
 
79
- window.coveoQuanticVersion = '3.38.0';
79
+ window.coveoQuanticVersion = '3.38.1';